master
sikadi 2023-11-20 10:42:24 +08:00
parent 3fd0ce2baa
commit 9893275297
11 changed files with 91 additions and 79 deletions

View File

@ -21,12 +21,10 @@
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-core</artifactId> <artifactId>fate-common-core</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-redis</artifactId> <artifactId>fate-common-redis</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
@ -40,5 +38,33 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId> <artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.0</version>
</dependency>
<!-- fate Common DataSource -->
<dependency>
<groupId>com.fate</groupId>
<artifactId>fate-common-datasource</artifactId>
</dependency>
<!-- fate Common DataScope -->
<dependency>
<groupId>com.fate</groupId>
<artifactId>fate-common-datascope</artifactId>
</dependency>
<!-- fate Common Log -->
<dependency>
<groupId>com.fate</groupId>
<artifactId>fate-common-log</artifactId>
</dependency>
<!-- fate Common Swagger -->
<dependency>
<groupId>com.fate</groupId>
<artifactId>fate-common-swagger</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,6 +1,8 @@
package com.fate.firm.domain; package com.fate.firm.domain;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fate.common.core.annotation.Excel;
import com.fate.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
@ -20,49 +22,53 @@ import java.util.Date;
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("t_firm") @TableName("t_firm")
@ApiModel(value = "Firm对象", description = "企业公司") public class Firm extends BaseEntity {
@EqualsAndHashCode(callSuper = false) private static final long serialVersionUID = 1L;
public class Firm {
@ApiModelProperty("企业主键") @Excel(name = "企业主键",cellType = Excel.ColumnType.NUMERIC)
@TableId(value = "firm_id", type = IdType.AUTO) @TableId( type = IdType.AUTO)
private Integer firmId; private Integer firmId;
@ApiModelProperty("企业名称") @Excel(name = "企业名称")
@TableField("firm_name") @TableField("firm_name")
private String firmName; private String firmName;
@ApiModelProperty("企业地址") @Excel(name = "企业地址")
@TableField("firm_address") @TableField("firm_address")
private String firmAddress; private String firmAddress;
@ApiModelProperty("企业电话") @Excel(name = "企业电话")
@TableField("firm_phone") @TableField("firm_phone")
private String firmPhone; private String firmPhone;
@ApiModelProperty("企业类型") @Excel(name = "企业类型")
@TableField("firm_right") @TableField("firm_right")
private Integer firmRight; private Integer firmRight;
@ApiModelProperty("企业状态") @Excel(name = "企业状态")
@TableField("firm_staus") @TableField("firm_staus")
private Integer firmStaus; private Integer firmStaus;
@ApiModelProperty("创建人") @Excel(name = "创建人")
@TableField("create_id") @TableField("create_by")
private Integer createId; private String createBy;
@ApiModelProperty("创建时间") @Excel(name = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT) @TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime; private Date createTime;
@ApiModelProperty("修改人") @Excel(name = "修改人")
@TableField("update_id") @TableField("update_by")
private Integer updateId; private String updateBy;
@ApiModelProperty("修改时间") @Excel(name = "修改时间")
@TableField(value = "update_time",fill = FieldFill.INSERT) @TableField(value = "update_time",fill = FieldFill.INSERT)
private Date updateTime; private Date updateTime;
@Excel(name = "备注")
@TableField("remark")
private String remark;
} }

View File

@ -19,6 +19,7 @@
<dependencies> <dependencies>
<!-- SpringCloud Alibaba Nacos --> <!-- SpringCloud Alibaba Nacos -->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
@ -52,46 +53,35 @@
<!-- Mysql Connector --> <!-- Mysql Connector -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>com.mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency> </dependency>
<!-- fate Common DataSource --> <!-- fate Common DataSource -->
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-datasource</artifactId> <artifactId>fate-common-datasource</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<!-- fate Common DataScope --> <!-- fate Common DataScope -->
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-datascope</artifactId> <artifactId>fate-common-datascope</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<!-- fate Common Log --> <!-- fate Common Log -->
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-log</artifactId> <artifactId>fate-common-log</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<!-- fate Common Swagger --> <!-- fate Common Swagger -->
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
<artifactId>fate-common-swagger</artifactId> <artifactId>fate-common-swagger</artifactId>
<version>3.6.3</version>
</dependency> </dependency>
<!-- fate Common Swagger -->
<dependency>
<groupId>com.fate</groupId>
<artifactId>fate-common-security</artifactId>
<version>3.6.3</version>
</dependency>
<!-- 商品服务公共11依赖 --> <!-- 商品服务公共11依赖 -->
<dependency> <dependency>
<groupId>com.fate</groupId> <groupId>com.fate</groupId>
@ -107,21 +97,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -18,9 +18,9 @@ import javax.swing.*;
@EnableCustomConfig @EnableCustomConfig
@EnableCustomSwagger2 @EnableCustomSwagger2
@EnableMyFeignClients @EnableMyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @SpringBootApplication
public class FirmApplication { public class FirmApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(FirmApplication.class); SpringApplication.run(FirmApplication.class,args);
} }
} }

View File

@ -1,7 +1,11 @@
package com.fate.firm.controller; package com.fate.firm.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fate.common.core.domain.Result; import com.fate.common.core.domain.Result;
import com.fate.common.core.web.controller.BaseController;
import com.fate.firm.domain.Firm; import com.fate.firm.domain.Firm;
import com.fate.firm.service.FirmService; import com.fate.firm.service.FirmService;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -14,6 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
@ -27,10 +32,13 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/firm") @RequestMapping("/firm")
@Log4j2 @Log4j2
public class FirmController { public class FirmController extends BaseController {
@Autowired @Autowired
private FirmService firmService; private FirmService firmService;
@Autowired
private HttpServletRequest request;
@PostMapping("/addList") @PostMapping("/addList")
public Result addList(@RequestBody Firm firm) { public Result addList(@RequestBody Firm firm) {
@ -50,11 +58,20 @@ public class FirmController {
return Result.success(list); return Result.success(list);
} }
/**
*
* @author: ZhuoXin
* @date: 2023/11/20 10:24
* @param: []
* @return: com.fate.common.core.domain.Result<java.util.List<com.fate.firm.domain.Firm>>
**/
@GetMapping("/listAll") @GetMapping("/listAll")
public Result<List<Firm>> listAll(){ public Result<List<Firm>> listAll(){
log.info("功能:查询我的公司,URI:{},方法:{}",request.getRequestURI(),request.getMethod());
List<Firm> list = firmService.listAll(); LambdaQueryWrapper<Firm> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(Firm::getCreateBy,"1");
List<Firm> list = firmService.list(queryWrapper);
log.info("功能:查询我的公司,URI:{},方法:{},响应:{}",request.getRequestURI(),request.getMethod(), JSON.toJSONString(list));
return Result.success(list); return Result.success(list);
} }

View File

@ -17,7 +17,4 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface FirmMapper extends BaseMapper<Firm> { public interface FirmMapper extends BaseMapper<Firm> {
List<Firm> listAll();
} }

View File

@ -6,7 +6,6 @@ import com.fate.firm.domain.Firm;
import java.util.List; import java.util.List;
/** /**
* <p> * <p>
* *
@ -15,6 +14,7 @@ import java.util.List;
* @author sikadi * @author sikadi
* @since 2023-11-18 06:27:02 * @since 2023-11-18 06:27:02
*/ */
public interface FirmService extends IService<Firm> { public interface FirmService extends IService<Firm> {
Result addList(Firm firm); Result addList(Firm firm);
@ -24,5 +24,4 @@ public interface FirmService extends IService<Firm> {
List<Firm> listSel(Firm firm); List<Firm> listSel(Firm firm);
List<Firm> listAll();
} }

View File

@ -31,9 +31,6 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
@Override @Override
public Result addList(Firm firm) { public Result addList(Firm firm) {
firm.setCreateId(Math.toIntExact(SecurityUtils.getUserId()));
firm.setCreateTime(new Date());
firm.setUpdateId(0);
firm.setUpdateTime(null); firm.setUpdateTime(null);
firm.setFirmStaus(1); firm.setFirmStaus(1);
int insert = firmMapper.insert(firm); int insert = firmMapper.insert(firm);
@ -42,8 +39,6 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
@Override @Override
public Result updateLL(Firm firm) { public Result updateLL(Firm firm) {
firm.setUpdateId(Math.toIntExact(SecurityUtils.getUserId()));
firm.setCreateTime(new Date()); firm.setCreateTime(new Date());
int i = firmMapper.updateById(firm); int i = firmMapper.updateById(firm);
return i>0?Result.success("成功"):Result.error("失败"); return i>0?Result.success("成功"):Result.error("失败");
@ -65,8 +60,4 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
return list; return list;
} }
@Override
public List<Firm> listAll() {
return firmMapper.listAll();
}
} }

View File

@ -17,12 +17,17 @@ spring:
server-addr: 182.254.222.21:8848 server-addr: 182.254.222.21:8848
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 184.254.222.21:8848 server-addr: 182.254.222.21:8848
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
shared-configs: shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
mybatis: logging:
configuration: level:
map-underscore-to-camel-case: true com.fate.system.mapper: DEBUG
#mybatis:
# configuration:
# map-underscore-to-camel-case: true

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false"> <configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 --> <!-- 日志存放路径 -->
<property name="log.path" value="./logs/fate/firm/wallet" /> <property name="log.path" value="./logs/fate/firm" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

View File

@ -2,8 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fate.firm.mapper.FirmMapper"> <mapper namespace="com.fate.firm.mapper.FirmMapper">
<select id="listAll" resultType="com.fate.firm.domain.Firm">
select *
from t_firm
</select>
</mapper> </mapper>