master
parent
3fd0ce2baa
commit
9893275297
|
@ -21,12 +21,10 @@
|
|||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-core</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-redis</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
@ -40,5 +38,33 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
|
||||
</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>
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.fate.firm.domain;
|
||||
|
||||
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.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
@ -20,49 +22,53 @@ import java.util.Date;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("t_firm")
|
||||
@ApiModel(value = "Firm对象", description = "企业公司")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Firm {
|
||||
public class Firm extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("企业主键")
|
||||
@TableId(value = "firm_id", type = IdType.AUTO)
|
||||
@Excel(name = "企业主键",cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Integer firmId;
|
||||
|
||||
@ApiModelProperty("企业名称")
|
||||
@Excel(name = "企业名称")
|
||||
@TableField("firm_name")
|
||||
private String firmName;
|
||||
|
||||
@ApiModelProperty("企业地址")
|
||||
@Excel(name = "企业地址")
|
||||
@TableField("firm_address")
|
||||
private String firmAddress;
|
||||
|
||||
@ApiModelProperty("企业电话")
|
||||
@Excel(name = "企业电话")
|
||||
@TableField("firm_phone")
|
||||
private String firmPhone;
|
||||
|
||||
@ApiModelProperty("企业类型")
|
||||
@Excel(name = "企业类型")
|
||||
@TableField("firm_right")
|
||||
private Integer firmRight;
|
||||
|
||||
@ApiModelProperty("企业状态")
|
||||
@Excel(name = "企业状态")
|
||||
@TableField("firm_staus")
|
||||
private Integer firmStaus;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
@TableField("create_id")
|
||||
private Integer createId;
|
||||
@Excel(name = "创建人")
|
||||
@TableField("create_by")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@Excel(name = "创建时间")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("修改人")
|
||||
@TableField("update_id")
|
||||
private Integer updateId;
|
||||
@Excel(name = "修改人")
|
||||
@TableField("update_by")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
@Excel(name = "修改时间")
|
||||
@TableField(value = "update_time",fill = FieldFill.INSERT)
|
||||
private Date updateTime;
|
||||
|
||||
@Excel(name = "备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
@ -52,46 +53,35 @@
|
|||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
|
||||
<!-- fate Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-datasource</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- fate Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-datascope</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- fate Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-log</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- fate Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-swagger</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- fate Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
<artifactId>fate-common-security</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 商品服务公共11依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.fate</groupId>
|
||||
|
@ -107,21 +97,6 @@
|
|||
</dependency>
|
||||
</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>
|
||||
|
|
|
@ -18,9 +18,9 @@ import javax.swing.*;
|
|||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
@SpringBootApplication
|
||||
public class FirmApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(FirmApplication.class);
|
||||
SpringApplication.run(FirmApplication.class,args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
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.web.controller.BaseController;
|
||||
import com.fate.firm.domain.Firm;
|
||||
import com.fate.firm.service.FirmService;
|
||||
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.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -27,10 +32,13 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/firm")
|
||||
@Log4j2
|
||||
public class FirmController {
|
||||
public class FirmController extends BaseController {
|
||||
@Autowired
|
||||
private FirmService firmService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
|
||||
@PostMapping("/addList")
|
||||
public Result addList(@RequestBody Firm firm) {
|
||||
|
@ -50,11 +58,20 @@ public class FirmController {
|
|||
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")
|
||||
public Result<List<Firm>> listAll(){
|
||||
|
||||
List<Firm> list = firmService.listAll();
|
||||
|
||||
log.info("功能:查询我的公司,URI:{},方法:{}",request.getRequestURI(),request.getMethod());
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,4 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface FirmMapper extends BaseMapper<Firm> {
|
||||
|
||||
List<Firm> listAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.fate.firm.domain.Firm;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 企业公司 服务类
|
||||
|
@ -15,6 +14,7 @@ import java.util.List;
|
|||
* @author sikadi
|
||||
* @since 2023-11-18 06:27:02
|
||||
*/
|
||||
|
||||
public interface FirmService extends IService<Firm> {
|
||||
|
||||
Result addList(Firm firm);
|
||||
|
@ -24,5 +24,4 @@ public interface FirmService extends IService<Firm> {
|
|||
List<Firm> listSel(Firm firm);
|
||||
|
||||
|
||||
List<Firm> listAll();
|
||||
}
|
||||
|
|
|
@ -31,9 +31,6 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
|
||||
@Override
|
||||
public Result addList(Firm firm) {
|
||||
firm.setCreateId(Math.toIntExact(SecurityUtils.getUserId()));
|
||||
firm.setCreateTime(new Date());
|
||||
firm.setUpdateId(0);
|
||||
firm.setUpdateTime(null);
|
||||
firm.setFirmStaus(1);
|
||||
int insert = firmMapper.insert(firm);
|
||||
|
@ -42,8 +39,6 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
|
||||
@Override
|
||||
public Result updateLL(Firm firm) {
|
||||
|
||||
firm.setUpdateId(Math.toIntExact(SecurityUtils.getUserId()));
|
||||
firm.setCreateTime(new Date());
|
||||
int i = firmMapper.updateById(firm);
|
||||
return i>0?Result.success("成功"):Result.error("失败");
|
||||
|
@ -65,8 +60,4 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Firm> listAll() {
|
||||
return firmMapper.listAll();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,12 +17,17 @@ spring:
|
|||
server-addr: 182.254.222.21:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 184.254.222.21:8848
|
||||
server-addr: 182.254.222.21:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
logging:
|
||||
level:
|
||||
com.fate.system.mapper: DEBUG
|
||||
|
||||
|
||||
#mybatis:
|
||||
# configuration:
|
||||
# map-underscore-to-camel-case: true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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" />
|
||||
|
||||
|
|
|
@ -2,8 +2,4 @@
|
|||
<!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">
|
||||
|
||||
<select id="listAll" resultType="com.fate.firm.domain.Firm">
|
||||
select *
|
||||
from t_firm
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue