Browse Source

基本模块提交,新增人员证书管理

zhongwei
ty 11 months ago
parent
commit
4aaf352fcf
  1. 13
      hzims-service-api/basic-api/pom.xml
  2. 11
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/constants/BasicConstants.java
  3. 59
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetEntity.java
  4. 68
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java
  5. 87
      hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/vo/PersonManagemetVo.java
  6. 1
      hzims-service-api/pom.xml
  7. 173
      hzims-service/hzims-basic/pom.xml
  8. 32
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/BasicApplication.java
  9. 87
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
  10. 15
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.java
  11. 6
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.xml
  12. 30
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  13. 99
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
  14. 13
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetService.java
  15. 21
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
  16. 21
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetServiceImpl.java
  17. 124
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
  18. 41
      hzims-service/hzims-basic/src/main/resources/application.yml
  19. 7
      hzims-service/hzims-basic/src/main/resources/bootstrap.yml
  20. 15
      hzims-service/hzims-basic/src/test/java/com/hnac/hzims/basic/BasicApplicationTests.java
  21. 1
      hzims-service/pom.xml
  22. 5
      pom.xml

13
hzims-service-api/basic-api/pom.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hzims-service-api</artifactId>
<groupId>com.hnac.hzims</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>basic-api</artifactId>
<packaging>jar</packaging>
</project>

11
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/constants/BasicConstants.java

@ -0,0 +1,11 @@
package com.hnac.hzims.basic.constants;
/**
* @author ysj
*/
public interface BasicConstants {
String APP_NAME = "hzims-basic";
}

59
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/CertificatetEntity.java

@ -0,0 +1,59 @@
package com.hnac.hzims.basic.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
* @author Chill
*/
@Data
@TableName("hzims_certificatet")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "档案管理表", description = "档案管理表")
public class CertificatetEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String personId;
/**
* 档案类型
*/
@ApiModelProperty(value = "档案类型")
@QueryField(condition = SqlCondition.LIKE)
private String type;
/**
* 到期时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期时间")
private Date deadTime;
/**
* 图片地址
*/
@ApiModelProperty(value = "图片地址")
private String pic;
}

68
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java

@ -0,0 +1,68 @@
package com.hnac.hzims.basic.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 实体类
* @author Chill
*/
@Data
@TableName("hzims_person_managemet")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "人员管理表", description = "人员管理表")
public class PersonManagemetEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String userId;
/**
* 用户名称
*/
@ApiModelProperty(value = "用户名称")
@QueryField(condition = SqlCondition.LIKE)
private String name;
/**
* 单位名称
*/
@ApiModelProperty(value = "单位名称")
@QueryField(condition = SqlCondition.LIKE)
private String unitName;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
@QueryField(condition = SqlCondition.EQUAL)
private String sex;
/**
* 性别
*/
@ApiModelProperty(value = "职位")
@QueryField(condition = SqlCondition.EQUAL)
private String job;
/**
* 职称
*/
@ApiModelProperty(value = "职称")
@QueryField(condition = SqlCondition.EQUAL)
private String academicTitle;
/**
* 电话号码
*/
@ApiModelProperty(value = "电话号码")
@QueryField(condition = SqlCondition.EQUAL)
private String phone;
}

87
hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/vo/PersonManagemetVo.java

@ -0,0 +1,87 @@
package com.hnac.hzims.basic.vo;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* 实体类
* @author Chill
*/
@Data
@ApiModel(value = "档案管理实体类",description = "档案管理实体类")
public class PersonManagemetVo extends PersonManagemetEntity {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID")
@QueryField(condition = SqlCondition.EQUAL)
private String personId;
/**
* 档案类型
*/
@ApiModelProperty(value = "档案类型")
@QueryField(condition = SqlCondition.LIKE)
private String type;
/**
* 到期开始时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期开始时间")
private Date deadStartTime;
/**
* 到期时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "到期时间")
private Date deadTime;
/**
* 图片地址
*/
@ApiModelProperty(value = "图片地址")
private String pic;
/**
* 档案编号
*/
@ApiModelProperty(value = "档案编号")
private List<String> certificatetIds;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户IDs")
private List<String> personIds;
/**
* 档案
*/
@ApiModelProperty(value = "档案")
private List<CertificatetEntity> certificatetEntityList;
}

1
hzims-service-api/pom.xml

@ -19,6 +19,7 @@
<!-- <module>spare-api</module>--> <!-- <module>spare-api</module>-->
<module>topvision-api</module> <module>topvision-api</module>
<module>equipment-api</module> <module>equipment-api</module>
<module>basic-api</module>
<module>safeproduct-api</module> <module>safeproduct-api</module>
<module>hzims-operational-api</module> <module>hzims-operational-api</module>
<module>inspect-api</module> <module>inspect-api</module>

173
hzims-service/hzims-basic/pom.xml

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-service</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hzims-basic</artifactId>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.6.13</spring-boot.version>
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>
<exclusions>
<exclusion>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-redis</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-auto</artifactId>
<scope>provided</scope>
</dependency>
<!-- spring-boot-websocket start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--WebSocket核心依赖包-->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
</dependency>
<!--生成代码-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</dependency>
<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要-->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.2</version>
</dependency>
<!--swagger-bootstrap-ui-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>alarm-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>basic-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>equipment-api</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-operational-api</artifactId>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>message-api</artifactId>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

32
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/BasicApplication.java

@ -0,0 +1,32 @@
package com.hnac.hzims.basic;
import com.hnac.hzims.basic.constants.BasicConstants;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.cloud.feign.EnableBladeFeign;
import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.ComponentScan;
import javax.annotation.Resource;
/**
* @author ty
*/
@EnableBladeFeign
@SpringCloudApplication
@MapperScan("com.hnac.hzims.**.mapper.**")
@ComponentScan(basePackages = {"com.hnac.hzims.basic.*"})
@Resource
public class BasicApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
BladeApplication.run(BasicConstants.APP_NAME, BasicApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return BladeApplication.createSpringApplicationBuilder(builder, BasicConstants.APP_NAME, BasicApplication.class);
}
}

87
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java

@ -0,0 +1,87 @@
package com.hnac.hzims.basic.controller;
import com.alibaba.spring.util.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.service.IImsPresonManagementService;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@RequestMapping("/presonManagement")
@Api(value = "人员档案", tags = "人员档案页面")
public class PresonManagementController extends BladeController {
private final IImsPresonManagementService iImsPresonManagementService;
/**
* 分页 代码自定义代号
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入imsDutyClass")
@OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "档案管理")
public R<IPage<PersonManagemetVo>> list(PersonManagemetVo personManagemetVo, Query query) {
IPage<PersonManagemetVo> page=iImsPresonManagementService.getPersonManagemetEntity(personManagemetVo,query);
return R.data(page);
}
/**
* 新增或修改
*/
@PostMapping ("/submit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加", notes = "传入imsDutyClass")
public R submit(@RequestBody PersonManagemetVo personManagemetVo) {
Boolean submit = iImsPresonManagementService.submit(personManagemetVo);
if (submit){
return R.success("保存成功");
}
return R.fail("保存失败");
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "删除", notes = "传入imsDutyClass")
public R remove(@RequestBody PersonManagemetVo personManagemetVo) {
Boolean flag = iImsPresonManagementService.removeByPersonManagemetVo(personManagemetVo);
if (flag){
return R.success("删除成功");
}
return R.fail("删除失败");
}
}

15
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.basic.mapper;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface CertificatetMapper extends UserDataScopeBaseMapper<CertificatetEntity> {
}

6
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/CertificatetMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.basic.mapper.CertificatetMapper">
</mapper>

30
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -0,0 +1,30 @@
package com.hnac.hzims.basic.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Date;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
@Mapper
public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonManagemetEntity> {
List<PersonManagemetVo> getPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
Integer getCountByPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
}

99
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.basic.mapper.PersonManagemetMapper">
<!--嵌套结果的 resultMap-->
<resultMap id="PersonManagemetMap" type="com.hnac.hzims.basic.vo.PersonManagemetVo">
<id property="id" column="id" jdbcType="VARCHAR" />
<result property="name" column="name" jdbcType="VARCHAR" />
<result property="unitName" column="unitName" jdbcType="VARCHAR" />
<result property="sex" column="sex" jdbcType="VARCHAR" />
<result property="job" column="job" jdbcType="VARCHAR" />
<result property="academicTitle" column="academic_title" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<collection property="certificatetEntityList" ofType="com.hnac.hzims.basic.entity.CertificatetEntity">
<id property="id" column="certificatetId" />
<result property="personId" column="person_id" />
<result property="type" column="type" />
<result property="deadTime" column="dead_time" />
<result property="pic" column="pic" />
<result property="status" column="status" />
<result property="createTime" column="CREATE_TIME" />
</collection>
</resultMap>
<!--嵌套查询-->
<select id="getPersonManagemetEntity" resultMap="PersonManagemetMap">
select a.id ,a.name,a.unit_name ,a.sex,a.job ,a.academic_title,a.phone ,a.CREATE_TIME,
b.id as certificatetId,b.person_id,b.type,b.dead_time,b.pic,b.CREATE_TIME,b.status,b.create_dept
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id
where a.is_deleted = 0 and b.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
<if test="status != null and status != ''">
and b.status =#{status}
</if>
LIMIT #{current}, #{size}
</select>
<!--嵌套查询-->
<select id="getCountByPersonManagemetEntity" resultType="Integer">
select count(*)
from hzims_person_managemet as a
left join hzims_certificatet as b
on a.id=b.person_id
where a.is_deleted = 0 and b.is_deleted = 0
<if test="type != null and type != ''">
and b.type = #{type}
</if>
<if test="deadStartTime != null and type != ''">
and b.dead_time &gt;= #{deadStartTime}
</if>
<if test="deadTime != null and type != ''">
and b.dead_time &lt;= #{deadTime}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like CONCAT('%',#{unitName},'%')
</if>
<if test="sex != null and sex != ''">
and a.sex = #{sex}
</if>
<if test="job != null and job != ''">
and a.job like CONCAT('%',#{job},'%')
</if>
<if test="academicTitle != null and academicTitle != ''">
and a.academic_title like CONCAT('%',#{academic_title},'%')
</if>
<if test="status != null and status != ''">
and b.status =#{status}
</if>
</select>
</mapper>

13
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsCertificatetService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.CertificatetEntity;
/**
* 服务类
*
* @author Chill
*/
public interface IImsCertificatetService extends IService<CertificatetEntity> {
}

21
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java

@ -0,0 +1,21 @@
package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.springblade.core.mp.support.Query;
/**
* 服务类
*
* @author Chill
*/
public interface IImsPresonManagementService extends IService<PersonManagemetEntity> {
IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query);
Boolean submit(PersonManagemetVo personManagemetVo);
Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo);
}

21
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/CertificatetServiceImpl.java

@ -0,0 +1,21 @@
package com.hnac.hzims.basic.service.impl;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.mapper.CertificatetMapper;
import com.hnac.hzims.basic.service.IImsCertificatetService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 证书实现类
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class CertificatetServiceImpl extends BaseServiceImpl<CertificatetMapper, CertificatetEntity> implements IImsCertificatetService {
}

124
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java

@ -0,0 +1,124 @@
package com.hnac.hzims.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.basic.entity.CertificatetEntity;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.mapper.PersonManagemetMapper;
import com.hnac.hzims.basic.service.IImsCertificatetService;
import com.hnac.hzims.basic.service.IImsPresonManagementService;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import com.hnac.hzims.common.logs.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* 人员信息实现类
*
* @author ty
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class PresonManagementServiceImpl extends BaseServiceImpl<PersonManagemetMapper, PersonManagemetEntity> implements IImsPresonManagementService {
private ISysClient sysClient;
private final IImsCertificatetService certificatetService;
@Override
public IPage<PersonManagemetVo> getPersonManagemetEntity(PersonManagemetVo personManagemetVo, Query query) {
List<PersonManagemetVo> personManagemetEntity = baseMapper.getPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(),
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(),
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), query.getCurrent(), query.getSize());
Integer count = baseMapper.getCountByPersonManagemetEntity(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(),
personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(),
personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus(), query.getCurrent(), query.getSize());
IPage<PersonManagemetVo> res = new Page<>();
res.setCurrent(query.getCurrent());
res.setSize(query.getSize());
res.setTotal(Long.valueOf(count));
res.setRecords(personManagemetEntity);
return res;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean submit(PersonManagemetVo personManagemetVo) {
try {
if (ObjectUtil.isNotEmpty(personManagemetVo)) {
PersonManagemetEntity personManagemetEntity = new PersonManagemetEntity();
BeanUtil.copy(personManagemetVo, personManagemetEntity);
if (StringUtils.isBlank(personManagemetEntity.getUnitName())){
String deptId = AuthUtil.getDeptId();
R<String> deptName = sysClient.getDeptName(Long.valueOf(deptId));
if (deptName.isSuccess()&&StringUtils.isBlank(deptName.getData())){
personManagemetEntity.setUnitName(deptName.getData());
}
}
if (ObjectUtil.isNotEmpty(personManagemetEntity)) {
this.saveOrUpdate(personManagemetEntity);
}
if (CollectionUtil.isNotEmpty(personManagemetVo.getCertificatetEntityList())) {
List<CertificatetEntity> certificatetList = personManagemetVo.getCertificatetEntityList().stream().map(
s -> {
s.setPersonId(personManagemetEntity.getId().toString());
if (System.currentTimeMillis() > s.getDeadTime().getTime()){
s.setStatus(2);
}else {
s.setStatus(1);
}
return s;
}
).collect(Collectors.toList());
certificatetService.saveOrUpdateBatch(certificatetList);
}
return true;
}
return false;
} catch (Exception e) {
log.error("入参 personManagemetVo" + personManagemetVo + ":" + e);
return false;
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean removeByPersonManagemetVo(PersonManagemetVo personManagemetVo) {
try {
if (ObjectUtil.isNotEmpty(personManagemetVo)) {
if (ObjectUtil.isNotEmpty(personManagemetVo.getPersonIds())) {
this.removeByIds(personManagemetVo.getPersonIds());
certificatetService.remove(new LambdaQueryWrapper<CertificatetEntity>() {{
in(CertificatetEntity::getPersonId, personManagemetVo.getPersonIds());
}});
}
if (CollectionUtil.isNotEmpty(personManagemetVo.getCertificatetIds())) {
certificatetService.removeByIds(personManagemetVo.getCertificatetIds());
}
return true;
}
return false;
} catch (Exception e) {
log.error("removeByPersonManagemetVo 入参 personManagemetVo" + personManagemetVo + ":" + e);
return false;
}
}
}

41
hzims-service/hzims-basic/src/main/resources/application.yml

@ -0,0 +1,41 @@
#服务器端口
server:
port: 8430
#数据源配置
spring:
main:
allow-bean-definition-overriding: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
url: jdbc:mysql://192.168.60.34:3576/hzims_basic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: hzinfo
password: 1qaz2WSX!
#mybatis-plus配置
mybatis-plus:
mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置
swagger:
base-packages:
- org.springbalde
- com.hnac
blade:
data-scope:
enabled: false
lock:
enabled: true
address: redis://192.168.1.20:3577
password: 1qaz2WSX@redis
database: 0
ssl: false

7
hzims-service/hzims-basic/src/main/resources/bootstrap.yml

@ -0,0 +1,7 @@
spring:
cloud:
nacos:
discovery:
server-addr: 175.6.40.67:10042

15
hzims-service/hzims-basic/src/test/java/com/hnac/hzims/basic/BasicApplicationTests.java

@ -0,0 +1,15 @@
package com.hnac.hzims.basic;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes = BasicApplication.class)
class BasicApplicationTests {
@Test
void contextLoads() {
System.out.println("1");
}
}

1
hzims-service/pom.xml

@ -27,6 +27,7 @@
<module>hzims-middle</module> <module>hzims-middle</module>
<module>hzims-scheduled</module> <module>hzims-scheduled</module>
<module>hzims-alarm</module> <module>hzims-alarm</module>
<module>hzims-basic</module>
</modules> </modules>
<dependencies> <dependencies>

5
pom.xml

@ -93,6 +93,11 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>basic-api</artifactId>
<version>${hzims.project.version}</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-operational-api</artifactId> <artifactId>hzims-operational-api</artifactId>
<version>${hzims.project.version}</version> <version>${hzims.project.version}</version>
</dependency> </dependency>

Loading…
Cancel
Save