Browse Source

暂提列表

master
zxc 3 years ago
parent
commit
67a4600b24
  1. 41
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EmployeeRegisterListFormDTO.java
  2. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EmployeeRegisterListResultDTO.java
  3. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterController.java
  4. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDao.java
  5. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEmployeeRegisterService.java
  6. 59
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterServiceImpl.java
  7. 56
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDao.xml

41
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EmployeeRegisterListFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/10/27 09:01
*/
@Data
public class EmployeeRegisterListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -5327830228503748858L;
private String customerId;
private String staffId;
private String agencyId;
/**
* 核酸检测开始结束日期eg2022-02-02
*/
private String natStartDate;
private String natEndDate;
/**
* 检查状态1已检测0未检测
*/
private String checkStatus;
private String placeOrgName;
/**
* 场所类别0九小场所1企事业单位
*/
private String placeCategory;
private String name;
private String mobile;
private String idCard;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EmployeeRegisterListResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/10/27 09:10
*/
@Data
public class EmployeeRegisterListResultDTO implements Serializable {
private static final long serialVersionUID = -7966608283208846072L;
private String placeOrgName;
private String name;
private String mobile;
private String idCard;
private Integer ymjzCount;
private String latestNatTime;
private String dbCompare;
private String dbCompareName;
private String registerId;
public EmployeeRegisterListResultDTO() {
this.placeOrgName = "";
this.name = "";
this.mobile = "";
this.idCard = "";
this.ymjzCount = NumConstant.ZERO;
this.latestNatTime = "";
this.dbCompare = "";
this.dbCompareName = "";
this.registerId = "";
}
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterController.java

@ -1,7 +1,11 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -9,6 +13,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcEmployeeRegisterDTO;
import com.epmet.dto.form.EmployeeRegisterListFormDTO;
import com.epmet.dto.result.EmployeeRegisterListResultDTO;
import com.epmet.service.IcEmployeeRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -43,6 +49,12 @@ public class IcEmployeeRegisterController {
return new Result<IcEmployeeRegisterDTO>().ok(data);
}
/**
* @Description 新增
* @param dto
* @Author zxc
* @Date 2022/10/27 08:57
*/
@NoRepeatSubmit
@PostMapping("add")
public Result save(@RequestBody IcEmployeeRegisterDTO dto){
@ -61,9 +73,47 @@ public class IcEmployeeRegisterController {
return new Result();
}
/**
* @Description 批量删除
* @param ids
* @Author zxc
* @Date 2022/10/27 08:57
*/
@PostMapping("delete")
public Result delete(@RequestBody List<String> ids){
icEmployeeRegisterService.delete(ids);
return new Result();
}
/**
* @Description 员工疫情管理列表
* @param formDTO
* @param tokenDto
* @Author zxc
* @Date 2022/10/27 09:15
*/
@PostMapping("list")
@MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
public Result<PageData<EmployeeRegisterListResultDTO>> employeeRegisterList(@RequestBody EmployeeRegisterListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<EmployeeRegisterListResultDTO>>().ok(icEmployeeRegisterService.employeeRegisterList(formDTO));
}
/**
* @Description 员工疫情管理详情列表
* @param formDTO
* @param tokenDto
* @Author zxc
* @Date 2022/10/27 09:22
*/
@PostMapping("detailList")
@MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
public Result<PageData<EmployeeRegisterListResultDTO>> employeeRegisterDetailList(@RequestBody EmployeeRegisterListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<EmployeeRegisterListResultDTO>>().ok(icEmployeeRegisterService.employeeRegisterDetailList(formDTO));
}
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDao.java

@ -1,6 +1,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.EmployeeRegisterListFormDTO;
import com.epmet.dto.result.EmployeeRegisterListResultDTO;
import com.epmet.entity.IcEmployeeRegisterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -32,4 +34,12 @@ public interface IcEmployeeRegisterDao extends BaseDao<IcEmployeeRegisterEntity>
*/
void delRegisterDetail(@Param("registerIds")List<String> registerIds);
/**
* @Description 员工疫情管理列表
* @param formDTO
* @Author zxc
* @Date 2022/10/27 09:15
*/
List<EmployeeRegisterListResultDTO> employeeRegisterList(EmployeeRegisterListFormDTO formDTO);
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEmployeeRegisterService.java

@ -3,6 +3,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcEmployeeRegisterDTO;
import com.epmet.dto.form.EmployeeRegisterListFormDTO;
import com.epmet.dto.result.EmployeeRegisterListResultDTO;
import com.epmet.entity.IcEmployeeRegisterEntity;
import java.util.List;
@ -74,4 +76,20 @@ public interface IcEmployeeRegisterService extends BaseService<IcEmployeeRegiste
* @date 2022-10-26
*/
void delete(List<String> ids);
/**
* @Description 员工疫情管理列表
* @param formDTO
* @Author zxc
* @Date 2022/10/27 09:15
*/
PageData<EmployeeRegisterListResultDTO> employeeRegisterList(EmployeeRegisterListFormDTO formDTO);
/**
* @Description 员工疫情管理详情列表
* @param formDTO
* @Author zxc
* @Date 2022/10/27 09:22
*/
PageData<EmployeeRegisterListResultDTO> employeeRegisterDetailList(EmployeeRegisterListFormDTO formDTO);
}

59
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterServiceImpl.java

@ -3,15 +3,22 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcEmployeeRegisterDao;
import com.epmet.dto.IcEmployeeRegisterDTO;
import com.epmet.dto.form.EmployeeRegisterListFormDTO;
import com.epmet.dto.result.EmployeeRegisterListResultDTO;
import com.epmet.entity.IcEmployeeRegisterDetailEntity;
import com.epmet.entity.IcEmployeeRegisterEntity;
import com.epmet.service.IcEmployeeRegisterDetailService;
import com.epmet.service.IcEmployeeRegisterService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -65,6 +72,12 @@ public class IcEmployeeRegisterServiceImpl extends BaseServiceImpl<IcEmployeeReg
return ConvertUtils.sourceToTarget(entity, IcEmployeeRegisterDTO.class);
}
/**
* @Description 新增
* @param dto
* @Author zxc
* @Date 2022/10/27 08:57
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcEmployeeRegisterDTO dto) {
@ -89,6 +102,12 @@ public class IcEmployeeRegisterServiceImpl extends BaseServiceImpl<IcEmployeeReg
updateById(entity);
}
/**
* @Description 批量删除
* @param ids
* @Author zxc
* @Date 2022/10/27 08:57
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(List<String> ids) {
@ -98,4 +117,44 @@ public class IcEmployeeRegisterServiceImpl extends BaseServiceImpl<IcEmployeeReg
}
}
/**
* @Description 员工疫情管理列表
* @param formDTO
* @Author zxc
* @Date 2022/10/27 09:15
*/
@Override
public PageData<EmployeeRegisterListResultDTO> employeeRegisterList(EmployeeRegisterListFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息:"+formDTO.getStaffId());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
PageData<EmployeeRegisterListResultDTO> result = new PageData<>();
List<EmployeeRegisterListResultDTO> list;
if (formDTO.getIsPage()){
PageInfo<EmployeeRegisterListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.employeeRegisterList(formDTO));
result.setList(pageInfo.getList());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
}else {
list = baseDao.employeeRegisterList(formDTO);
result.setList(list);
result.setTotal(list.size());
}
// 数据库比对
return result;
}
/**
* @Description 员工疫情管理详情列表
* @param formDTO
* @Author zxc
* @Date 2022/10/27 09:22
*/
@Override
public PageData<EmployeeRegisterListResultDTO> employeeRegisterDetailList(EmployeeRegisterListFormDTO formDTO) {
return null;
}
}

56
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDao.xml

@ -19,4 +19,60 @@
select * from ic_employee_register
where del_flag = 0 and id_card = #{idCard}
</select>
<!-- 员工疫情管理列表 -->
<select id="employeeRegisterList" resultType="com.epmet.dto.result.EmployeeRegisterListResultDTO">
SELECT
t.*
FROM(
SELECT
DISTINCT ier.ID AS registerId,
rd.YMJZ_COUNT,
rd.LATEST_NAT_TIME,
rd.CREATED_TIME,
ier.`NAME`,
ier.MOBILE,
ier.ID_CARD,
ier.ENTERPRISE_ID,
ie.PLACE_ORG_NAME,
ie.PLACE_CATEGORY
FROM ic_enterprise ie
left join JOIN ic_employee_register ier ON ier.ENTERPRISE_ID = ie.ID AND ier.DEL_FLAG = 0
left JOIN ic_employee_register_detail rd ON rd.REGISTER_ID = ier.ID AND rd.DEL_FLAG = 0
WHERE ie.DEL_FLAG = 0
AND CONCAT(AGENCY_PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%')
ORDER BY rd.CREATED_TIME DESC
)t
where 1=1
<choose>
<when test='checkStatus == "1" '>
<if test='null != natStartDate and natStartDate != ""'>
AND DATE_FORMAT(LATEST_NAT_TIME,'%Y-%m-%d') >= #{natStartDate}
</if>
<if test='null != natEndDate and natEndDate != ""'>
AND DATE_FORMAT(LATEST_NAT_TIME,'%Y-%m-%d') <![CDATA[<=]]> #{natEndDate}
</if>
</when>
<otherwise>
</otherwise>
</choose>
<if test='null != placeOrgName and placeOrgName != ""'>
AND PLACE_ORG_NAME LIKE CONCAT('%',#{placeOrgName},'%')
</if>
<if test='null != placeCategory and placeCategory != ""'>
AND PLACE_CATEGORY = #{placeCategory}
</if>
<if test='null != name and name != ""'>
AND name LIKE CONCAT('%',#{name},'%')
</if>
<if test='null != mobile and mobile != ""'>
AND mobile LIKE CONCAT('%',#{mobile},'%')
</if>
<if test='null != idCard and idCard != ""'>
AND ID_CARD LIKE CONCAT('%',#{idCard},'%')
</if>
GROUP BY t.registerId
ORDER BY LATEST_NAT_TIME desc
</select>
</mapper>
Loading…
Cancel
Save