From ac471df96c5202c2278cb0a7ff30fe0214d1999b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Mar 2022 15:20:33 +0800 Subject: [PATCH 01/33] =?UTF-8?q?/resi/mine/personalcenter/initinfo?= =?UTF-8?q?=E8=BF=94=E5=8F=82mobile=E3=80=81realName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/resi/mine/dto/result/InitInfoResultDTO.java | 8 ++++++++ .../mine/service/impl/PersonalCenterServiceImpl.java | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java index 6ee30a91e4..36b860a3e9 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java @@ -45,4 +45,12 @@ public class InitInfoResultDTO implements Serializable { * 身份证号 */ private String idNum; + /** + * 姓名 + */ + private String realName; + /** + * 手机号 + */ + private String mobile; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java index d3ba9d2b22..a508fffe31 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -28,8 +28,8 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { @Override public InitInfoResultDTO initInfo(TokenDto tokenDto) { - Result baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); - if (!baseInfoResult.success()) { + Result baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); + if (!baseInfoResult.success() || null == baseInfoResult.getData()) { throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg()); } InitInfoResultDTO resultDTO = new InitInfoResultDTO(); @@ -41,6 +41,8 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { resultDTO.setBuildingAddress(baseInfoResult.getData().getBuildingAddress()); resultDTO.setNickname(baseInfoResult.getData().getNickname()); resultDTO.setIdNum(baseInfoResult.getData().getIdNum()); + resultDTO.setMobile(baseInfoResult.getData().getMobile()); + resultDTO.setRealName(baseInfoResult.getData().getRealName()); return resultDTO; } From 308c9715eb01f3fab87cc56a255e90489a680d7c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Mar 2022 15:55:49 +0800 Subject: [PATCH 02/33] init --- .../com/epmet/dto/IcFollowUpRecordDTO.java | 89 ++++++++++++ .../com/epmet/dto/IcTripReportRecordDTO.java | 134 ++++++++++++++++++ .../IcFollowUpRecordController.java | 72 ++++++++++ .../IcTripReportRecordController.java | 72 ++++++++++ .../com/epmet/dao/IcFollowUpRecordDao.java | 16 +++ .../com/epmet/dao/IcTripReportRecordDao.java | 16 +++ .../epmet/entity/IcFollowUpRecordEntity.java | 59 ++++++++ .../entity/IcTripReportRecordEntity.java | 104 ++++++++++++++ .../epmet/excel/IcFollowUpRecordExcel.java | 60 ++++++++ .../epmet/excel/IcTripReportRecordExcel.java | 87 ++++++++++++ .../service/IcFollowUpRecordService.java | 78 ++++++++++ .../service/IcTripReportRecordService.java | 78 ++++++++++ .../impl/IcFollowUpRecordServiceImpl.java | 83 +++++++++++ .../impl/IcTripReportRecordServiceImpl.java | 83 +++++++++++ .../resources/mapper/IcFollowUpRecordDao.xml | 8 ++ .../mapper/IcTripReportRecordDao.xml | 8 ++ 16 files changed, 1047 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java new file mode 100644 index 0000000000..ae5c05bede --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +public class IcFollowUpRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 0行程上报,1疫苗接种,2核酸检测 + */ + private String origin; + + /** + * 随访时间 + */ + private Date visitTime; + + /** + * 随访内容 + */ + private String content; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java new file mode 100644 index 0000000000..7c452c6e8f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java @@ -0,0 +1,134 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +public class IcTripReportRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 用户id + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 0:未加入;1:已加入 + */ + private Integer heSuanCheck; + + /** + * 最近一次通知时间 + */ + private Date latestNoticeTime; + + /** + * 现居地编码 + */ + private String presentAddressCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + private String presentAddress; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地区地址 + */ + private String sourceAddress; + + /** + * 到达日期 + */ + private Date arriveDate; + + /** + * 离开日期 + */ + private Date leaveDate; + + /** + * 备注信息 + */ + private String remark; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java new file mode 100644 index 0000000000..2e717fbe8d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.service.IcFollowUpRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@RestController +@RequestMapping("followup") +public class IcFollowUpRecordController { + + @Autowired + private IcFollowUpRecordService icFollowUpRecordService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icFollowUpRecordService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcFollowUpRecordDTO data = icFollowUpRecordService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcFollowUpRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icFollowUpRecordService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcFollowUpRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icFollowUpRecordService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icFollowUpRecordService.delete(ids); + return new Result(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java new file mode 100644 index 0000000000..9e3faa4bd2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.service.IcTripReportRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@RestController +@RequestMapping("triprecord") +public class IcTripReportRecordController { + + @Autowired + private IcTripReportRecordService icTripReportRecordService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icTripReportRecordService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcTripReportRecordDTO data = icTripReportRecordService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcTripReportRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icTripReportRecordService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcTripReportRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icTripReportRecordService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icTripReportRecordService.delete(ids); + return new Result(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java new file mode 100644 index 0000000000..0117f48651 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFollowUpRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Mapper +public interface IcFollowUpRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java new file mode 100644 index 0000000000..f6e54e8100 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcTripReportRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Mapper +public interface IcTripReportRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java new file mode 100644 index 0000000000..4d9e6de99e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java @@ -0,0 +1,59 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_follow_up_record") +public class IcFollowUpRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 0行程上报,1疫苗接种,2核酸检测 + */ + private String origin; + + /** + * 随访时间 + */ + private Date visitTime; + + /** + * 随访内容 + */ + private String content; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java new file mode 100644 index 0000000000..6ca87717fa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java @@ -0,0 +1,104 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_trip_report_record") +public class IcTripReportRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 用户id + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 0:未加入;1:已加入 + */ + private Integer heSuanCheck; + + /** + * 最近一次通知时间 + */ + private Date latestNoticeTime; + + /** + * 现居地编码 + */ + private String presentAddressCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + private String presentAddress; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地区地址 + */ + private String sourceAddress; + + /** + * 到达日期 + */ + private Date arriveDate; + + /** + * 离开日期 + */ + private Date leaveDate; + + /** + * 备注信息 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java new file mode 100644 index 0000000000..8f3eb1ecc0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcFollowUpRecordExcel.java @@ -0,0 +1,60 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +public class IcFollowUpRecordExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "0行程上报,1疫苗接种,2核酸检测") + private String origin; + + @Excel(name = "随访时间") + private Date visitTime; + + @Excel(name = "随访内容") + private String content; + + @Excel(name = "删除标识 1删除;0未删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java new file mode 100644 index 0000000000..c904a6c244 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java @@ -0,0 +1,87 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +public class IcTripReportRecordExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other") + private String userType; + + @Excel(name = "0:未加入;1:已加入") + private Integer heSuanCheck; + + @Excel(name = "最近一次通知时间") + private Date latestNoticeTime; + + @Excel(name = "现居地编码") + private String presentAddressCode; + + @Excel(name = "现居地名称eg:山东省青岛市黄岛区玫瑰山路社区") + private String presentAddress; + + @Excel(name = "详细地址") + private String detailAddress; + + @Excel(name = "来源地区编码") + private String sourceAddressCode; + + @Excel(name = "来源地区地址") + private String sourceAddress; + + @Excel(name = "到达日期") + private Date arriveDate; + + @Excel(name = "离开日期") + private Date leaveDate; + + @Excel(name = "备注信息") + private String remark; + + @Excel(name = "删除标识 1删除;0未删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java new file mode 100644 index 0000000000..7183ae1e4d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.entity.IcFollowUpRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +public interface IcFollowUpRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcFollowUpRecordDTO + * @author generator + * @date 2022-03-25 + */ + IcFollowUpRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void save(IcFollowUpRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void update(IcFollowUpRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java new file mode 100644 index 0000000000..3949fed1bc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.entity.IcTripReportRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +public interface IcTripReportRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcTripReportRecordDTO + * @author generator + * @date 2022-03-25 + */ + IcTripReportRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void save(IcTripReportRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void update(IcTripReportRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java new file mode 100644 index 0000000000..40d380278a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java @@ -0,0 +1,83 @@ +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFollowUpRecordDao; +import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.entity.IcFollowUpRecordEntity; +import com.epmet.service.IcFollowUpRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 随访记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Service +public class IcFollowUpRecordServiceImpl extends BaseServiceImpl implements IcFollowUpRecordService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcFollowUpRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcFollowUpRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcFollowUpRecordDTO get(String id) { + IcFollowUpRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcFollowUpRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcFollowUpRecordDTO dto) { + IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcFollowUpRecordDTO dto) { + IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java new file mode 100644 index 0000000000..c9d2c0326e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -0,0 +1,83 @@ +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcTripReportRecordDao; +import com.epmet.dto.IcTripReportRecordDTO; +import com.epmet.entity.IcTripReportRecordEntity; +import com.epmet.service.IcTripReportRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 行程上报信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Service +public class IcTripReportRecordServiceImpl extends BaseServiceImpl implements IcTripReportRecordService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcTripReportRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcTripReportRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcTripReportRecordDTO get(String id) { + IcTripReportRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcTripReportRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcTripReportRecordDTO dto) { + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcTripReportRecordDTO dto) { + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml new file mode 100644 index 0000000000..a8710f4094 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcFollowUpRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml new file mode 100644 index 0000000000..c4e619b1ec --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 0b6eef93dc843e249c118694c8d3068521a051bc Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 09:52:09 +0800 Subject: [PATCH 03/33] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNatDTO.java | 120 ++++++++++++++++++ .../com/epmet/dto/form/AddIcNatFormDTO.java | 92 ++++++++++++++ .../com/epmet/controller/IcNatController.java | 89 +++++++++++++ .../src/main/java/com/epmet/dao/IcNatDao.java | 17 +++ .../java/com/epmet/entity/IcNatEntity.java | 90 +++++++++++++ .../java/com/epmet/service/IcNatService.java | 86 +++++++++++++ .../epmet/service/impl/IcNatServiceImpl.java | 94 ++++++++++++++ .../src/main/resources/mapper/IcNatDao.xml | 7 + 8 files changed, 595 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java new file mode 100644 index 0000000000..0a733f35ba --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -0,0 +1,120 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 核酸上报记录 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +public class IcNatDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id + */ + private String agencyId; + + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 人员姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 检测时间,精确到分钟 + */ + private Date testingTime; + + /** + * 检测结果(0:阴性 1:阳性) + */ + private String testingResult; + + /** + * 检测地点 + */ + private String testingAddress; + + /** + * 文件名 + */ + private String fileName; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java new file mode 100644 index 0000000000..8ed0f5da57 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -0,0 +1,92 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 核酸检测-上报核酸记录 + * @Author sun + */ +@Data +public class AddIcNatFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + public interface Nat extends CustomerClientShowGroup { + } + + /** + * 当前网格所属组织Id + */ + @NotBlank(message = "组织Id不能为空", groups = Nat.class) + private String agencyId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + @NotBlank(message = "居民来源不能为空", groups = Nat.class) + private String userType; + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空", groups = Nat.class) + private String name; + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = Nat.class) + private String mobile; + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = Nat.class) + private String idCard; + /** + * 检测时间 + */ + @NotBlank(message = "检测时间不能为空", groups = Nat.class) + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date testingTime; + /** + * 检测结果 + */ + private String testingResult; + /** + * 检测地点 + */ + private String testingAddress; + /** + * 文件名 + */ + private String fileName; + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + /** + * 通知渠道 0小程序通知,1短信通知,多选用逗号分隔(0,1) + */ + private String channel; + /** + * 通知内容 + */ + private String content; + + //token中信息 + private String staffId; + private String customerId; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java new file mode 100644 index 0000000000..d1a08b471c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -0,0 +1,89 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +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; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcNatDTO; +import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.service.IcNatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 核酸上报记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@RestController +@RequestMapping("icNuclein") +public class IcNatController { + + @Autowired + private IcNatService icNucleinService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = icNucleinService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + IcNatDTO data = icNucleinService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcNatDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNucleinService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcNatDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNucleinService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNucleinService.delete(ids); + return new Result(); + } + + + /** + * @Author sun + * @Description 核酸检测-上报核酸记录 + **/ + @NoRepeatSubmit + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icNucleinService.add(formDTO); + return new Result(); + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java new file mode 100644 index 0000000000..d2a5cffbcd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -0,0 +1,17 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNatEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 核酸上报记录 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Mapper +public interface IcNatDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java new file mode 100644 index 0000000000..94a8edabb4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -0,0 +1,90 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 核酸上报记录 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_nat") +public class IcNatEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id + */ + private String agencyId; + + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 人员姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 检测时间,精确到分钟 + */ + private Date testingTime; + + /** + * 检测结果(0:阴性 1:阳性) + */ + private String testingResult; + + /** + * 检测地点 + */ + private String testingAddress; + + /** + * 文件名 + */ + private String fileName; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java new file mode 100644 index 0000000000..36f5ec98c2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -0,0 +1,86 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNatDTO; +import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.entity.IcNatEntity; + +import java.util.List; +import java.util.Map; + +/** + * 核酸上报记录 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +public interface IcNatService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNucleinDTO + * @author generator + * @date 2022-03-25 + */ + IcNatDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void save(IcNatDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-25 + */ + void update(IcNatDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-25 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 核酸检测-上报核酸记录 + **/ + void add(AddIcNatFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java new file mode 100644 index 0000000000..6db2d231d1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -0,0 +1,94 @@ +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcNatDao; +import com.epmet.dto.IcNatDTO; +import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.entity.IcNatEntity; +import com.epmet.service.IcNatService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 核酸上报记录 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-25 + */ +@Service +public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNatDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNatDTO get(String id) { + IcNatEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNatDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNatDTO dto) { + IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNatDTO dto) { + IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 核酸检测-上报核酸记录 + **/ + @Override + public void add(AddIcNatFormDTO formDTO) { + + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml new file mode 100644 index 0000000000..e29e5495fb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 07c628b97fd5b39f3aeb1e5485d2449be9b4b237 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 10:12:33 +0800 Subject: [PATCH 04/33] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E8=AE=B0=E5=BD=95=5F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddIcNatFormDTO.java | 6 +++--- .../com/epmet/controller/IcNatController.java | 1 - .../epmet/service/impl/IcNatServiceImpl.java | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index 8ed0f5da57..1417c416c4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -7,6 +7,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Description 核酸检测-上报核酸记录 @@ -76,16 +77,15 @@ public class AddIcNatFormDTO implements Serializable { */ private String attachmentUrl; /** - * 通知渠道 0小程序通知,1短信通知,多选用逗号分隔(0,1) + * 通知渠道 0小程序通知,1短信通知,多选是数组 */ - private String channel; + private List channel; /** * 通知内容 */ private String content; //token中信息 - private String staffId; private String customerId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index d1a08b471c..c64fa880f3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -79,7 +79,6 @@ public class IcNatController { @PostMapping("add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); - formDTO.setStaffId(tokenDto.getUserId()); formDTO.setCustomerId(tokenDto.getCustomerId()); icNucleinService.add(formDTO); return new Result(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 6db2d231d1..818db023b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -4,7 +4,11 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcNatDao; import com.epmet.dto.IcNatDTO; @@ -88,6 +92,19 @@ public class IcNatServiceImpl extends BaseServiceImpl imp **/ @Override public void add(AddIcNatFormDTO formDTO) { + //1.获取所填居民所属组织缓存信息 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); + if (null == agencyInfo) { + throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId())); + } + //2.新增核酸记录表数据 + IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); + insert(entity); + + //3.新增通知表信息 + if(formDTO.getChannel().size()> NumConstant.ZERO){ + //TODO + } } From cf001aab6bd54422d392c8864647a94ca0fefe38 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 10:14:02 +0800 Subject: [PATCH 05/33] .. --- .../src/main/java/com/epmet/controller/IcNatController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index c64fa880f3..b282b5840a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -26,7 +26,7 @@ import java.util.Map; * @since v1.0.0 2022-03-25 */ @RestController -@RequestMapping("icNuclein") +@RequestMapping("icNat") public class IcNatController { @Autowired From dcbe869c6389b8335cc7c04451d4e75868650663 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Mar 2022 10:19:48 +0800 Subject: [PATCH 06/33] emm --- .../dto/IcEpidemicSpecialAttentionDTO.java | 109 ++++++++++++++++++ .../main/java/com/epmet/dto/IcNoticeDTO.java | 84 ++++++++++++++ .../java/com/epmet/dto/IcResiVaccineDTO.java | 109 ++++++++++++++++++ .../IcEpidemicSpecialAttentionController.java | 73 ++++++++++++ .../epmet/controller/IcNoticeController.java | 73 ++++++++++++ .../controller/IcResiVaccineController.java | 73 ++++++++++++ .../dao/IcEpidemicSpecialAttentionDao.java | 16 +++ .../main/java/com/epmet/dao/IcNoticeDao.java | 16 +++ .../java/com/epmet/dao/IcResiVaccineDao.java | 16 +++ .../IcEpidemicSpecialAttentionEntity.java | 79 +++++++++++++ .../java/com/epmet/entity/IcNoticeEntity.java | 54 +++++++++ .../com/epmet/entity/IcResiVaccineEntity.java | 79 +++++++++++++ .../IcEpidemicSpecialAttentionService.java | 78 +++++++++++++ .../com/epmet/service/IcNoticeService.java | 78 +++++++++++++ .../epmet/service/IcResiVaccineService.java | 78 +++++++++++++ ...IcEpidemicSpecialAttentionServiceImpl.java | 83 +++++++++++++ .../service/impl/IcNoticeServiceImpl.java | 83 +++++++++++++ .../impl/IcResiVaccineServiceImpl.java | 83 +++++++++++++ .../mapper/IcEpidemicSpecialAttentionDao.xml | 28 +++++ .../src/main/resources/mapper/IcNoticeDao.xml | 23 ++++ .../resources/mapper/IcResiVaccineDao.xml | 28 +++++ 21 files changed, 1343 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java new file mode 100644 index 0000000000..269fdf3a0f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +public class IcEpidemicSpecialAttentionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 当前工作人员所属组织ID + */ + private String orgId; + + /** + * 组织ID上级 + */ + private String pid; + + /** + * 组织ID所有上级 + */ + private String pids; + + /** + * 是否关注 1:关注,0:取消关注 + */ + private Integer isAttention; + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + private Integer attentionType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 原因 + */ + private String reason; + + /** + * 备注 + */ + private String remark; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java new file mode 100644 index 0000000000..6e0fb6b20b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java @@ -0,0 +1,84 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +public class IcNoticeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 通知渠道 0小程序通知,1短信通知 + */ + private String channel; + + /** + * 通知来源 0行程上报,1疫苗接种,2核酸检测 + */ + private String origin; + + /** + * 被通知人身份证号 + */ + private String idCard; + + /** + * 通知内容 + */ + private String content; + + /** + * 发送通知的社区 + */ + private String orgName; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java new file mode 100644 index 0000000000..57ea1109e3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiVaccineDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +public class IcResiVaccineDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 接种时间 + */ + private Date inoculateTime; + + /** + * 接种地点 + */ + private String inoculateAddress; + + /** + * 疫苗厂家 + */ + private String manufacturer; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 备注 + */ + private String remaek; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java new file mode 100644 index 0000000000..9f33b49365 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -0,0 +1,73 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.IcEpidemicSpecialAttentionDTO; +import com.epmet.service.IcEpidemicSpecialAttentionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@RestController +@RequestMapping("icEpidemicSpecialAttention") +public class IcEpidemicSpecialAttentionController { + + @Autowired + private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icEpidemicSpecialAttentionService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcEpidemicSpecialAttentionDTO data = icEpidemicSpecialAttentionService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcEpidemicSpecialAttentionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icEpidemicSpecialAttentionService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcEpidemicSpecialAttentionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icEpidemicSpecialAttentionService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icEpidemicSpecialAttentionService.delete(ids); + return new Result(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java new file mode 100644 index 0000000000..11000e575d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java @@ -0,0 +1,73 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.IcNoticeDTO; +import com.epmet.service.IcNoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@RestController +@RequestMapping("icNotice") +public class IcNoticeController { + + @Autowired + private IcNoticeService icNoticeService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icNoticeService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcNoticeDTO data = icNoticeService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcNoticeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icNoticeService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcNoticeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icNoticeService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icNoticeService.delete(ids); + return new Result(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java new file mode 100644 index 0000000000..722c2966eb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java @@ -0,0 +1,73 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.IcResiVaccineDTO; +import com.epmet.service.IcResiVaccineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@RestController +@RequestMapping("icResiVaccine") +public class IcResiVaccineController { + + @Autowired + private IcResiVaccineService icResiVaccineService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiVaccineService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcResiVaccineDTO data = icResiVaccineService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcResiVaccineDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiVaccineService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcResiVaccineDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiVaccineService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiVaccineService.delete(ids); + return new Result(); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java new file mode 100644 index 0000000000..7da733ebe3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEpidemicSpecialAttentionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Mapper +public interface IcEpidemicSpecialAttentionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java new file mode 100644 index 0000000000..a5f035887d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcNoticeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Mapper +public interface IcNoticeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java new file mode 100644 index 0000000000..4679c59587 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiVaccineDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcResiVaccineEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Mapper +public interface IcResiVaccineDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java new file mode 100644 index 0000000000..3ade140ffa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_epidemic_special_attention") +public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 当前工作人员所属组织ID + */ + private String orgId; + + /** + * 组织ID上级 + */ + private String pid; + + /** + * 组织ID所有上级 + */ + private String pids; + + /** + * 是否关注 1:关注,0:取消关注 + */ + private Integer isAttention; + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + private Integer attentionType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 原因 + */ + private String reason; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java new file mode 100644 index 0000000000..0114b3c5e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java @@ -0,0 +1,54 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_notice") +public class IcNoticeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 通知渠道 0小程序通知,1短信通知 + */ + private String channel; + + /** + * 通知来源 0行程上报,1疫苗接种,2核酸检测 + */ + private String origin; + + /** + * 被通知人身份证号 + */ + private String idCard; + + /** + * 通知内容 + */ + private String content; + + /** + * 发送通知的社区 + */ + private String orgName; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java new file mode 100644 index 0000000000..f26abbe525 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiVaccineEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_vaccine") +public class IcResiVaccineEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 接种时间 + */ + private Date inoculateTime; + + /** + * 接种地点 + */ + private String inoculateAddress; + + /** + * 疫苗厂家 + */ + private String manufacturer; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 备注 + */ + private String remaek; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java new file mode 100644 index 0000000000..6f0e11fe5c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.entity.IcEpidemicSpecialAttentionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +public interface IcEpidemicSpecialAttentionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEpidemicSpecialAttentionDTO + * @author generator + * @date 2022-03-28 + */ + IcEpidemicSpecialAttentionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void save(IcEpidemicSpecialAttentionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void update(IcEpidemicSpecialAttentionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-28 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java new file mode 100644 index 0000000000..82d94c16d9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcNoticeDTO; +import com.epmet.entity.IcNoticeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +public interface IcNoticeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcNoticeDTO + * @author generator + * @date 2022-03-28 + */ + IcNoticeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void save(IcNoticeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void update(IcNoticeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-28 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java new file mode 100644 index 0000000000..44207d875f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcResiVaccineDTO; +import com.epmet.entity.IcResiVaccineEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +public interface IcResiVaccineService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-03-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-03-28 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiVaccineDTO + * @author generator + * @date 2022-03-28 + */ + IcResiVaccineDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void save(IcResiVaccineDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-03-28 + */ + void update(IcResiVaccineDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-03-28 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java new file mode 100644 index 0000000000..36351504f4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -0,0 +1,83 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcEpidemicSpecialAttentionDao; +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.entity.IcEpidemicSpecialAttentionEntity; +import com.epmet.service.IcEpidemicSpecialAttentionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 疫情特别关注 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Service +public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl implements IcEpidemicSpecialAttentionService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEpidemicSpecialAttentionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEpidemicSpecialAttentionDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEpidemicSpecialAttentionDTO get(String id) { + IcEpidemicSpecialAttentionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEpidemicSpecialAttentionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEpidemicSpecialAttentionDTO dto) { + IcEpidemicSpecialAttentionEntity entity = ConvertUtils.sourceToTarget(dto, IcEpidemicSpecialAttentionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEpidemicSpecialAttentionDTO dto) { + IcEpidemicSpecialAttentionEntity entity = ConvertUtils.sourceToTarget(dto, IcEpidemicSpecialAttentionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java new file mode 100644 index 0000000000..9c1d1c4628 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -0,0 +1,83 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcNoticeDao; +import com.epmet.dto.IcNoticeDTO; +import com.epmet.entity.IcNoticeEntity; +import com.epmet.service.IcNoticeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 防疫通知 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Service +public class IcNoticeServiceImpl extends BaseServiceImpl implements IcNoticeService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcNoticeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcNoticeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcNoticeDTO get(String id) { + IcNoticeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcNoticeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcNoticeDTO dto) { + IcNoticeEntity entity = ConvertUtils.sourceToTarget(dto, IcNoticeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcNoticeDTO dto) { + IcNoticeEntity entity = ConvertUtils.sourceToTarget(dto, IcNoticeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java new file mode 100644 index 0000000000..c8c586137a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java @@ -0,0 +1,83 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcResiVaccineDao; +import com.epmet.dto.IcResiVaccineDTO; +import com.epmet.entity.IcResiVaccineEntity; +import com.epmet.service.IcResiVaccineService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民疫苗情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-03-28 + */ +@Service +public class IcResiVaccineServiceImpl extends BaseServiceImpl implements IcResiVaccineService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiVaccineDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiVaccineDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcResiVaccineDTO get(String id) { + IcResiVaccineEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiVaccineDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiVaccineDTO dto) { + IcResiVaccineEntity entity = ConvertUtils.sourceToTarget(dto, IcResiVaccineEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiVaccineDTO dto) { + IcResiVaccineEntity entity = ConvertUtils.sourceToTarget(dto, IcResiVaccineEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml new file mode 100644 index 0000000000..21b940fe58 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml new file mode 100644 index 0000000000..dab4ffd739 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNoticeDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml new file mode 100644 index 0000000000..a330bccba9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 0a87bfd7ae037cfa42f20bab75fcefb627a9fc92 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 10:40:38 +0800 Subject: [PATCH 07/33] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E8=AE=B0=E5=BD=95-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=88=91=E7=9A=84=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNatDTO.java | 6 +- .../com/epmet/dto/form/AddIcNatFormDTO.java | 6 +- .../com/epmet/dto/form/MyNatListFormDTO.java | 29 ++++++++ .../epmet/dto/result/MyNatListResultDTO.java | 70 +++++++++++++++++++ .../com/epmet/controller/IcNatController.java | 16 ++++- .../src/main/java/com/epmet/dao/IcNatDao.java | 13 +++- .../java/com/epmet/entity/IcNatEntity.java | 7 +- .../java/com/epmet/service/IcNatService.java | 8 +++ .../epmet/service/impl/IcNatServiceImpl.java | 13 ++++ .../src/main/resources/mapper/IcNatDao.xml | 20 ++++++ 10 files changed, 176 insertions(+), 12 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index 0a733f35ba..c3d059802e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -60,17 +60,17 @@ public class IcNatDTO implements Serializable { /** * 检测时间,精确到分钟 */ - private Date testingTime; + private Date natTime; /** * 检测结果(0:阴性 1:阳性) */ - private String testingResult; + private String natResult; /** * 检测地点 */ - private String testingAddress; + private String natAddress; /** * 文件名 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index 1417c416c4..f291477154 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -54,15 +54,15 @@ public class AddIcNatFormDTO implements Serializable { */ @NotBlank(message = "检测时间不能为空", groups = Nat.class) @JsonFormat(pattern="yyyy-MM-dd HH:mm") - private Date testingTime; + private Date natTime; /** * 检测结果 */ - private String testingResult; + private String natResult; /** * 检测地点 */ - private String testingAddress; + private String natAddress; /** * 文件名 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java new file mode 100644 index 0000000000..fa450472ba --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 核酸检测-我的上报记录 + * @Author sun + */ +@Data +public class MyNatListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + public interface MyNat extends CustomerClientShowGroup { + } + + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = MyNat.class) + private String idCard; + + //token信息 + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java new file mode 100644 index 0000000000..feb97d97f5 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyNatListResultDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 核酸检测-我的上报记录 + * @Author sun + */ +@Data +public class MyNatListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 核酸记录Id + */ + private String icNatId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 检测时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date natTime; + + /** + * 检测结果 + */ + private String natResult; + + /** + * 检测地点 + */ + private String natAddress; + + /** + * 附件名 + */ + private String fileName; + + /** + * 附件地址 + */ + private String attachmentUrl; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index b282b5840a..0925456a21 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -12,10 +12,13 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.service.IcNatService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; @@ -70,7 +73,6 @@ public class IcNatController { return new Result(); } - /** * @Author sun * @Description 核酸检测-上报核酸记录 @@ -84,5 +86,17 @@ public class IcNatController { return new Result(); } + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + @NoRepeatSubmit + @PostMapping("mynatlist") + public Result> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.MyNat.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icNucleinService.myNatList(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index d2a5cffbcd..2de5a0fecf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -1,9 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.entity.IcNatEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 核酸上报记录 @@ -13,5 +17,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcNatDao extends BaseDao { - + + /** + * @Author sun + * @Description 核酸检测-按条件查询核酸记录 + **/ + List getMyNatList(MyNatListFormDTO formDTO); + + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index 94a8edabb4..e83a6cc95b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -1,7 +1,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -60,17 +59,17 @@ public class IcNatEntity extends BaseEpmetEntity { /** * 检测时间,精确到分钟 */ - private Date testingTime; + private Date natTime; /** * 检测结果(0:阴性 1:阳性) */ - private String testingResult; + private String natResult; /** * 检测地点 */ - private String testingAddress; + private String natOAddress; /** * 文件名 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 36f5ec98c2..206b65720c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -4,6 +4,8 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.entity.IcNatEntity; import java.util.List; @@ -83,4 +85,10 @@ public interface IcNatService extends BaseService { * @Description 核酸检测-上报核酸记录 **/ void add(AddIcNatFormDTO formDTO); + + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + List myNatList(MyNatListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 818db023b6..54ef03f097 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -13,6 +13,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcNatDao; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.entity.IcNatEntity; import com.epmet.service.IcNatService; import org.apache.commons.lang3.StringUtils; @@ -108,4 +110,15 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } + /** + * @Author sun + * @Description 核酸检测-居民端我的上报 + **/ + @Override + public List myNatList(MyNatListFormDTO formDTO) { + //1.根据身份证号查询该人员所有核酸记录(居民端录入、数字平台录入、数字平台导入) + List resultList = baseDao.getMyNatList(formDTO); + return resultList; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index e29e5495fb..d31df0f3d5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -3,5 +3,25 @@ + \ No newline at end of file From f97b4cb903bb2565208dd7fc4af5d616d709b55e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 10:51:45 +0800 Subject: [PATCH 08/33] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E8=AE=B0=E5=BD=95-?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E6=96=B0=E5=A2=9Epids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNatDTO.java | 5 +++++ .../src/main/java/com/epmet/entity/IcNatEntity.java | 5 +++++ .../main/java/com/epmet/service/impl/IcNatServiceImpl.java | 1 + 3 files changed, 11 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index c3d059802e..367c6df668 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -32,6 +32,11 @@ public class IcNatDTO implements Serializable { */ private String agencyId; + /** + * 组织pids + */ + private String pids; + /** * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index e83a6cc95b..8990c36df1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -31,6 +31,11 @@ public class IcNatEntity extends BaseEpmetEntity { */ private String agencyId; + /** + * 组织pids + */ + private String pids; + /** * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 54ef03f097..fe7fa1f814 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -101,6 +101,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } //2.新增核酸记录表数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); + entity.setPids(agencyInfo.getPids()); insert(entity); //3.新增通知表信息 From 24107913b3352951574d659bd0d2e5960bfaa4e3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 11:58:53 +0800 Subject: [PATCH 09/33] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E8=AE=B0=E5=BD=95-?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E8=A1=A8=E8=BF=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java | 2 +- .../src/main/java/com/epmet/entity/IcNatEntity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index 367c6df668..a201e11ad0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -43,7 +43,7 @@ public class IcNatDTO implements Serializable { private String userId; /** - * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + * 居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro */ private String userType; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index 8990c36df1..d1f62275b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -42,7 +42,7 @@ public class IcNatEntity extends BaseEpmetEntity { private String userId; /** - * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + * 居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro */ private String userType; From c16a7e90807f776a1ec33e3e948675dd5e9ee766 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Mar 2022 14:06:25 +0800 Subject: [PATCH 10/33] =?UTF-8?q?=E5=85=88=E6=8A=8A=E6=A1=86=E6=A1=86?= =?UTF-8?q?=E6=8F=90=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/IcEpidemicSpecialAttentionDTO.java | 17 ++- .../dto/form/CancelAttentionFormDTO.java | 27 ++++ .../com/epmet/dto/form/NatListFormDTO.java | 46 ++++++ .../epmet/dto/form/VaccinationAddFormDTO.java | 32 +++++ .../dto/form/VaccinationListFormDTO.java | 42 ++++++ .../IcEpidemicSpecialAttentionController.java | 134 ++++++++++++++++++ .../IcEpidemicSpecialAttentionService.java | 44 ++++++ ...IcEpidemicSpecialAttentionServiceImpl.java | 65 +++++++++ 8 files changed, 403 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java index 269fdf3a0f..cceed0a556 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -4,6 +4,9 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + /** * 疫情特别关注 @@ -16,6 +19,8 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface IcEpidemicSpecialAttention{} + /** * ID */ @@ -44,7 +49,8 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { /** * 是否关注 1:关注,0:取消关注 */ - private Integer isAttention; + @NotNull(message = "isAttention不能为空",groups = IcEpidemicSpecialAttention.class) + private Integer isAttention; /** * 关注类型,核酸检测:2,疫苗接种:1 @@ -54,17 +60,20 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { /** * 姓名 */ - private String name; + @NotBlank(message = "name不能为空",groups = IcEpidemicSpecialAttention.class) + private String name; /** * 手机号 */ - private String mobile; + @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttention.class) + private String mobile; /** * 身份证号 */ - private String idCard; + @NotBlank(message = "idCard不能为空",groups = IcEpidemicSpecialAttention.class) + private String idCard; /** * 原因 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java new file mode 100644 index 0000000000..e1fcde9b28 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/28 13:47 + * @DESC + */ +@Data +public class CancelAttentionFormDTO implements Serializable { + + private static final long serialVersionUID = 2252387281427013057L; + + /** + * 身份证 + */ + private String idCard; + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + private Integer attentionType ; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java new file mode 100644 index 0000000000..c1b77eb9f3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/28 10:30 + * @DESC + */ +@Data +public class NatListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -498378123902522370L; + + /** + * 手机号 + */ + private String mobile; + + /** + * 名字 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 关注原因 + */ + private String reason; + + /** + * 备注 + */ + private String remark; + + private String userId; + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java new file mode 100644 index 0000000000..2bc2194083 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/28 10:46 + * @DESC + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VaccinationAddFormDTO implements Serializable { + + private static final long serialVersionUID = -4786942219804246138L; + + public interface VaccinationAddForm{} + + @Valid + private List list; + + private String userId; + + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java new file mode 100644 index 0000000000..ed5e1bd5ef --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/28 10:30 + * @DESC + */ +@Data +public class VaccinationListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -498378993902522370L; + + /** + * 手机号 + */ + private String mobile; + + /** + * 名字 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 疫苗接种次数 + */ + private Integer vaccinationCount; + + private String userId; + private String customerId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 9f33b49365..5959d82d0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -1,7 +1,10 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; 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,10 +12,16 @@ 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.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.form.CancelAttentionFormDTO; +import com.epmet.dto.form.NatListFormDTO; +import com.epmet.dto.form.VaccinationAddFormDTO; +import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.service.IcEpidemicSpecialAttentionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; @@ -68,6 +77,131 @@ public class IcEpidemicSpecialAttentionController { return new Result(); } + /** + * Desc: 【疫苗接种关注名单】列表 + * @param formDTO + * @author zxc + * @date 2022/3/28 10:29 + */ + @PostMapping("vaccination-list") + public Result vaccinationList(@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icEpidemicSpecialAttentionService.vaccinationList(formDTO)); + } + + /** + * Desc: 【疫苗接种关注名单】列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/3/28 10:42 + */ + @PostMapping("nat-list") + public Result natList(@RequestBody NatListFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icEpidemicSpecialAttentionService.natList(formDTO)); + } + + /** + * Desc:【疫苗接种关注名单,核酸检测关注名单】新增 + * @param list + * @param tokenDto + * @author zxc + * @date 2022/3/28 13:35 + */ + @PostMapping("vaccination-add") + public Result vaccinationAdd(@RequestBody List list,@LoginUser TokenDto tokenDto){ + VaccinationAddFormDTO formDTO = new VaccinationAddFormDTO(); + formDTO.setList(list); + ValidatorUtils.validateEntity(formDTO, VaccinationAddFormDTO.VaccinationAddForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icEpidemicSpecialAttentionService.vaccinationAdd(formDTO); + return new Result(); + } + + /** + * Desc:【疫苗接种关注名单,核酸检测关注名单】修改 + * @param formDTO + * @author zxc + * @date 2022/3/28 13:45 + */ + @PostMapping("vaccination-update") + public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){ + icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO); + return new Result(); + } + + /** + * Desc: 取消关注 + * @param list + * @author zxc + * @date 2022/3/28 13:51 + */ + @PostMapping("cancel-attention") + public Result cancelAttention(@RequestBody List list){ + icEpidemicSpecialAttentionService.cancelAttention(list); + return new Result(); + } + + /** + * Desc: 【疫苗接种关注名单】导入 + * @param + * @author zxc + * @date 2022/3/28 13:40 + */ + @PostMapping("vaccination-import") + public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file){ + + return new Result(); + } + + /** + * Desc: 【疫苗接种关注名单】导出 + * @param response + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/3/28 13:57 + */ + @PostMapping("vaccination-export") + public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + } + + /** + * Desc: 【核酸检测关注名单】导入 + * @param + * @author zxc + * @date 2022/3/28 13:40 + */ + @PostMapping("nat-import") + public Result natImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file){ + + return new Result(); + } + + /** + * Desc: 【核酸检测关注名单】导出 + * @param response + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/3/28 13:59 + */ + @PostMapping("nat-export") + public void natExport(HttpServletResponse response,@RequestBody NatListFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index 6f0e11fe5c..4cb1cca09d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -3,6 +3,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.form.CancelAttentionFormDTO; +import com.epmet.dto.form.NatListFormDTO; +import com.epmet.dto.form.VaccinationAddFormDTO; +import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import java.util.List; @@ -75,4 +79,44 @@ public interface IcEpidemicSpecialAttentionService extends BaseService list); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 36351504f4..f326408b64 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -3,11 +3,16 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; +import com.epmet.dto.form.CancelAttentionFormDTO; +import com.epmet.dto.form.NatListFormDTO; +import com.epmet.dto.form.VaccinationAddFormDTO; +import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.service.IcEpidemicSpecialAttentionService; import org.apache.commons.lang3.StringUtils; @@ -15,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -80,4 +86,63 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl list) { + + } + } \ No newline at end of file From bbfee55ff95317c9a86831d0ae55d61b7a3124d8 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 14:23:09 +0800 Subject: [PATCH 11/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/MyNatListFormDTO.java | 27 +++++++ .../epmet/dto/result/NatListResultDTO.java | 76 +++++++++++++++++++ .../com/epmet/controller/IcNatController.java | 56 ++++++++++++++ .../src/main/java/com/epmet/dao/IcNatDao.java | 7 +- .../java/com/epmet/service/IcNatService.java | 32 +++++++- .../epmet/service/impl/IcNatServiceImpl.java | 76 ++++++++++++++++++- .../src/main/resources/mapper/IcNatDao.xml | 37 +++++++++ 7 files changed, 305 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index fa450472ba..7d5eb73285 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -22,8 +22,35 @@ public class MyNatListFormDTO implements Serializable { */ @NotBlank(message = "身份证号不能为空", groups = MyNat.class) private String idCard; + /** + * 当前组织:current 根组织:all + */ + private String orgType; + private String agencyId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 检测开始时间yyyy-MM-dd HH:mm + */ + private String startTime; + /** + * 检测结束时间yyyy-MM-dd HH:mm间yy-mm-dd + */ + private String endTime; + /** + * 分页参数 + */ + private Integer pageNo = 1; + private Integer pageSize = 10; //token信息 private String customerId; + private String userId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java new file mode 100644 index 0000000000..d3cbead954 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Description 核酸检测-我的上报记录 + * @Author sun + */ +@Data +public class NatListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //总条数 + private Integer total; + List list = new ArrayList<>(); + + @Data + public static class NatListDTO { + + /** + * 核酸记录Id + */ + private String icNatId; + /** + * 组织Id + */ + private String agencyId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + private String userId; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + private String userType; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 检测时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date natTime; + + /** + * 检测结果 + */ + private String natResult; + + /** + * 检测地点 + */ + private String natAddress; + + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 0925456a21..38cb884864 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -14,6 +14,7 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.service.IcNatService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -98,5 +99,60 @@ public class IcNatController { return new Result>().ok(icNucleinService.myNatList(formDTO)); } + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @NoRepeatSubmit + @PostMapping("natlist") + public Result natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icNucleinService.natList(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + @NoRepeatSubmit + @PostMapping("detail") + public Result detail(@RequestBody MyNatListFormDTO formDTO) { + return new Result().ok(icNucleinService.detail(formDTO)); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.edit(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + @NoRepeatSubmit + @PostMapping("del") + public Result del(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.del(formDTO); + return new Result<>(); + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + @NoRepeatSubmit + @PostMapping("synchro") + public Result synchro(@RequestBody MyNatListFormDTO formDTO) { + icNucleinService.synchro(formDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 2de5a0fecf..5d292bb229 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import org.apache.ibatis.annotations.Mapper; @@ -24,5 +25,9 @@ public interface IcNatDao extends BaseDao { **/ List getMyNatList(MyNatListFormDTO formDTO); - + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + List getNatList(MyNatListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 206b65720c..1bc5c22b63 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -6,6 +6,7 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import java.util.List; @@ -13,7 +14,6 @@ import java.util.Map; /** * 核酸上报记录 - * * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 @@ -91,4 +91,34 @@ public interface IcNatService extends BaseService { * @Description 核酸检测-居民端我的上报 **/ List myNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + NatListResultDTO natList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + NatListResultDTO detail(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + void edit(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + void del(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + void synchro(MyNatListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index fe7fa1f814..d2bafa5070 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcNatDao; @@ -15,8 +18,11 @@ import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; +import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import com.epmet.service.IcNatService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,7 +33,6 @@ import java.util.Map; /** * 核酸上报记录 - * * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 @@ -52,8 +57,8 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -105,7 +110,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp insert(entity); //3.新增通知表信息 - if(formDTO.getChannel().size()> NumConstant.ZERO){ + if (formDTO.getChannel().size() > NumConstant.ZERO) { //TODO } @@ -122,4 +127,67 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return resultList; } + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @Override + public NatListResultDTO natList(MyNatListFormDTO formDTO) { + NatListResultDTO resultDTO = new NatListResultDTO(); + //1.根据orgType值判断是查询当前组织下还是整个客户下数据 + if ("current".equals(formDTO.getOrgType())) { + //获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + + //2.按条件查询业务数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) + .doSelectPageInfo(() -> baseDao.getNatList(formDTO)); + resultDTO.setTotal((int) data.getTotal()); + resultDTO.setList(data.getList()); + + return resultDTO; + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息详情 + **/ + @Override + public NatListResultDTO detail(MyNatListFormDTO formDTO) { + + return null; + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息修改 + **/ + @Override + public void edit(MyNatListFormDTO formDTO) { + + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息删除/取消同步 + **/ + @Override + public void del(MyNatListFormDTO formDTO) { + + } + + /** + * @Author sun + * @Description 【核酸】核酸检测信息同步 + **/ + @Override + public void synchro(MyNatListFormDTO formDTO) { + + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index d31df0f3d5..0d49f7d6c3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -24,4 +24,41 @@ AND id_card = #{idCard} + + \ No newline at end of file From 3306ec74ea6c2928bfad48ef7d60af981540492f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 15:08:45 +0800 Subject: [PATCH 12/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNatDTO.java | 13 +++ .../com/epmet/dto/form/AddIcNatFormDTO.java | 4 + .../com/epmet/dto/form/MyNatListFormDTO.java | 12 ++ .../com/epmet/controller/IcNatController.java | 52 ++------- .../src/main/java/com/epmet/dao/IcNatDao.java | 8 +- .../java/com/epmet/service/IcNatService.java | 64 +---------- .../epmet/service/impl/IcNatServiceImpl.java | 107 ++++++++---------- .../src/main/resources/mapper/IcNatDao.xml | 4 + 8 files changed, 102 insertions(+), 162 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index a201e11ad0..df1f7db433 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -2,6 +2,9 @@ package com.epmet.dto; import java.io.Serializable; import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -65,6 +68,7 @@ public class IcNatDTO implements Serializable { /** * 检测时间,精确到分钟 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date natTime; /** @@ -122,4 +126,13 @@ public class IcNatDTO implements Serializable { */ private Date updatedTime; + /** + * 通知渠道 0小程序通知,1短信通知,多选是数组 + */ + private List channel; + /** + * 通知内容 + */ + private String content; + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index f291477154..6000b6a969 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -20,6 +20,10 @@ public class AddIcNatFormDTO implements Serializable { public interface Nat extends CustomerClientShowGroup { } + /** + * 核酸记录Id,修改时使用 + */ + private String icNatId; /** * 当前网格所属组织Id */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index 7d5eb73285..b19a1d9caf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -16,6 +16,12 @@ public class MyNatListFormDTO implements Serializable { public interface MyNat extends CustomerClientShowGroup { } + public interface Detail extends CustomerClientShowGroup { + } + public interface Del extends CustomerClientShowGroup { + } + public interface Synchro extends CustomerClientShowGroup { + } /** * 身份证号 @@ -49,6 +55,12 @@ public class MyNatListFormDTO implements Serializable { private Integer pageNo = 1; private Integer pageSize = 10; + /** + * 核酸记录Id + */ + @NotBlank(message = "核酸记录Id不能为空", groups = { Detail.class, Del.class, Synchro.class}) + private String icNatId; + //token信息 private String customerId; private String userId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 38cb884864..929e95ce4b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -36,43 +36,6 @@ public class IcNatController { @Autowired private IcNatService icNucleinService; - @RequestMapping("page") - public Result> page(@RequestParam Map params) { - PageData page = icNucleinService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id) { - IcNatDTO data = icNucleinService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcNatDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icNucleinService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcNatDTO dto) { - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icNucleinService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids) { - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icNucleinService.delete(ids); - return new Result(); - } /** * @Author sun @@ -117,8 +80,9 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("detail") - public Result detail(@RequestBody MyNatListFormDTO formDTO) { - return new Result().ok(icNucleinService.detail(formDTO)); + public Result detail(@RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Detail.class); + return new Result().ok(icNucleinService.detail(formDTO)); } /** @@ -127,7 +91,7 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("edit") - public Result edit(@RequestBody MyNatListFormDTO formDTO) { + public Result edit(@RequestBody AddIcNatFormDTO formDTO) { icNucleinService.edit(formDTO); return new Result(); } @@ -138,7 +102,8 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("del") - public Result del(@RequestBody MyNatListFormDTO formDTO) { + public Result del(@RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Del.class); icNucleinService.del(formDTO); return new Result<>(); } @@ -149,7 +114,10 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("synchro") - public Result synchro(@RequestBody MyNatListFormDTO formDTO) { + public Result synchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); icNucleinService.synchro(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 5d292bb229..91ce606f2d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -6,12 +6,12 @@ import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; /** * 核酸上报记录 - * * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 @@ -30,4 +30,10 @@ public interface IcNatDao extends BaseDao { * @Description 【核酸】核酸检测信息列表 **/ List getNatList(MyNatListFormDTO formDTO); + + /** + * @Author sun + * @Description 删除/取消同步操作--物理删除业务数据 + **/ + boolean delById(@Param("icNatId") String icNatId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 1bc5c22b63..2da059b99f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -20,66 +20,6 @@ import java.util.Map; */ public interface IcNatService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-03-25 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-03-25 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return IcNucleinDTO - * @author generator - * @date 2022-03-25 - */ - IcNatDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-03-25 - */ - void save(IcNatDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-03-25 - */ - void update(IcNatDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-03-25 - */ - void delete(String[] ids); - /** * @Author sun * @Description 核酸检测-上报核酸记录 @@ -102,13 +42,13 @@ public interface IcNatService extends BaseService { * @Author sun * @Description 【核酸】核酸检测信息详情 **/ - NatListResultDTO detail(MyNatListFormDTO formDTO); + IcNatDTO detail(MyNatListFormDTO formDTO); /** * @Author sun * @Description 【核酸】核酸检测信息修改 **/ - void edit(MyNatListFormDTO formDTO); + void edit(AddIcNatFormDTO formDTO); /** * @Author sun diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index d2bafa5070..8a7061152e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -23,6 +24,7 @@ import com.epmet.entity.IcNatEntity; import com.epmet.service.IcNatService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -38,61 +40,10 @@ import java.util.Map; * @since v1.0.0 2022-03-25 */ @Service +@Slf4j public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService { - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcNatDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public IcNatDTO get(String id) { - IcNatEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, IcNatDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcNatDTO dto) { - IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(IcNatDTO dto) { - IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - /** * @Author sun * @Description 核酸检测-上报核酸记录 @@ -158,9 +109,19 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 【核酸】核酸检测信息详情 **/ @Override - public NatListResultDTO detail(MyNatListFormDTO formDTO) { + public IcNatDTO detail(MyNatListFormDTO formDTO) { + IcNatDTO resultDTO = new IcNatDTO(); + //1.查询核酸记录信息 + IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId()); + if (null == resultDTO) { + return resultDTO; + } + resultDTO = ConvertUtils.sourceToTarget(entity, IcNatDTO.class); - return null; + //2.查询对应的通知记录信息 + //TODO + + return resultDTO; } /** @@ -168,8 +129,18 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 【核酸】核酸检测信息修改 **/ @Override - public void edit(MyNatListFormDTO formDTO) { + public void edit(AddIcNatFormDTO formDTO) { + //1.更新核酸记录表数据 + IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); + if (!updateById(entity)) { + log.error(String.format("数据修改失败,核酸记录Id->", formDTO.getIcNatId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败"); + } + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO) { + //TODO + } } /** @@ -178,7 +149,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp **/ @Override public void del(MyNatListFormDTO formDTO) { - + //1.物理删除业务数据 + if (baseDao.delById(formDTO.getIcNatId())) { + log.error(String.format("数据删除/取消同步失败,核酸记录Id->", formDTO.getIcNatId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据操作失败"); + } } /** @@ -187,7 +162,25 @@ public class IcNatServiceImpl extends BaseServiceImpl imp **/ @Override public void synchro(MyNatListFormDTO formDTO) { - + //1.根据核酸记录Id查询业务数据并进行必要校验 + IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId()); + if (null == entity || formDTO.getAgencyId().equals(entity.getAgencyId()) + || (!"import".equals(entity.getUserType()) && !"synchro".equals(entity.getUserType()))) { + log.error(String.format("数据同步失败,核酸记录Id->", formDTO.getIcNatId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,不是导入数据或非本组织数据"); + } + //2.获取工作人员缓存数据 + //获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //3.待同步组织新增业务数据 + entity.setId(""); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setPids(staffInfo.getAgencyPIds()); + entity.setUserType("synchro"); + insert(entity); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 0d49f7d6c3..b0e8a01607 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -61,4 +61,8 @@ + + DELETE FROM ic_nat WHERE id = #{icNatId} + + \ No newline at end of file From 53d395c46e286de43a79778c98b47bcfdbc23ea7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Mar 2022 15:39:28 +0800 Subject: [PATCH 13/33] list --- .../com/epmet/dto/form/NatListFormDTO.java | 6 ++ .../dto/form/VaccinationListFormDTO.java | 26 +++++- .../dto/result/VaccinationListResultDTO.java | 67 ++++++++++++++++ .../IcEpidemicSpecialAttentionController.java | 59 +------------- .../dao/IcEpidemicSpecialAttentionDao.java | 22 +++++- .../IcEpidemicSpecialAttentionService.java | 10 +-- ...IcEpidemicSpecialAttentionServiceImpl.java | 47 ++++++++--- .../mapper/IcEpidemicSpecialAttentionDao.xml | 79 ++++++++++++++----- 8 files changed, 216 insertions(+), 100 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java index c1b77eb9f3..85b56ecb29 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/NatListFormDTO.java @@ -42,5 +42,11 @@ public class NatListFormDTO extends PageFormDTO implements Serializable { private String remark; private String userId; + private String customerId; + + /** + * user所属组织ID + */ + private String orgId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java index ed5e1bd5ef..ec8d2a3932 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java @@ -17,6 +17,14 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable private static final long serialVersionUID = -498378993902522370L; + public interface VaccinationListForm{} + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + @NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class) + private Integer attentionType; + /** * 手机号 */ @@ -33,10 +41,26 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable private String idCard; /** - * 疫苗接种次数 + * 疫苗接种次数,疫苗接种关注名单,此字段可填可不填 */ private Integer vaccinationCount; + /** + * 原因,核酸检测关注名单,此字段可填可不填 + */ + private String reason; + + /** + * 备注,核酸检测关注名单,此字段可填可不填 + */ + private String remark; + private String userId; + private String customerId; + + /** + * user所属组织ID + */ + private String orgId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java new file mode 100644 index 0000000000..a0b10a13d3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/28 14:14 + * @DESC + */ +@Data +public class VaccinationListResultDTO implements Serializable { + + private static final long serialVersionUID = -4368151917259903449L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 接种针次 + */ + private Integer vaccinationCount; + + /** + * 姓名 + */ + private String name; + + /** + * 电话 + */ + private String mobile; + + /** + * 身份证 + */ + private String idCard; + + /** + * 备注 + */ + private String remark; + + /** + * 原因 + */ + private String reason; + + /** + * 最后一次通知时间 + */ + private String lastInformTime; + + public VaccinationListResultDTO() { + this.vaccinationCount = NumConstant.ZERO; + this.name = ""; + this.mobile = ""; + this.idCard = ""; + this.remark = ""; + this.lastInformTime = ""; + this.reason = ""; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 5959d82d0f..cf91237a2d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -39,73 +39,20 @@ public class IcEpidemicSpecialAttentionController { @Autowired private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icEpidemicSpecialAttentionService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcEpidemicSpecialAttentionDTO data = icEpidemicSpecialAttentionService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcEpidemicSpecialAttentionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icEpidemicSpecialAttentionService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcEpidemicSpecialAttentionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icEpidemicSpecialAttentionService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icEpidemicSpecialAttentionService.delete(ids); - return new Result(); - } - /** - * Desc: 【疫苗接种关注名单】列表 + * Desc: 【疫苗接种关注名单,疫苗接种关注名单】列表 * @param formDTO * @author zxc * @date 2022/3/28 10:29 */ - @PostMapping("vaccination-list") + @PostMapping("list") public Result vaccinationList(@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, VaccinationListFormDTO.VaccinationListForm.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); return new Result().ok(icEpidemicSpecialAttentionService.vaccinationList(formDTO)); } - /** - * Desc: 【疫苗接种关注名单】列表 - * @param formDTO - * @param tokenDto - * @author zxc - * @date 2022/3/28 10:42 - */ - @PostMapping("nat-list") - public Result natList(@RequestBody NatListFormDTO formDTO,@LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setUserId(tokenDto.getUserId()); - return new Result().ok(icEpidemicSpecialAttentionService.natList(formDTO)); - } - /** * Desc:【疫苗接种关注名单,核酸检测关注名单】新增 * @param list diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java index 7da733ebe3..cc1d3ba4a1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -1,9 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.VaccinationListFormDTO; +import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 疫情特别关注 * @@ -12,5 +16,21 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcEpidemicSpecialAttentionDao extends BaseDao { - + + /** + * Desc: 疫苗接种关注名单 + * @param formDTO + * @author zxc + * @date 2022/3/28 14:19 + */ + List vaccinationList(VaccinationListFormDTO formDTO); + + /** + * Desc: 核酸检测关注名单 + * @param formDTO + * @author zxc + * @date 2022/3/28 15:23 + */ + List natList(VaccinationListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index 4cb1cca09d..c1f051233d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -4,7 +4,6 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.CancelAttentionFormDTO; -import com.epmet.dto.form.NatListFormDTO; import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; @@ -81,20 +80,13 @@ public interface IcEpidemicSpecialAttentionService extends BaseService pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List list = baseDao.vaccinationList(formDTO); + result.setList(list); + result.setTotal(list.size()); + } + }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + if (formDTO.isPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List list = baseDao.natList(formDTO); + result.setList(list); + result.setTotal(list.size()); + } + } return result; } - /** - * Desc: 【疫苗接种关注名单】列表 - * @param formDTO - * @author zxc - * @date 2022/3/28 10:42 - */ - @Override - public PageData natList(NatListFormDTO formDTO) { - return null; - } - /** * Desc:【疫苗接种关注名单,核酸检测关注名单】新增 * @param formDTO diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 21b940fe58..63c556f0c0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -3,26 +3,65 @@ - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file From e831d56eb0409be4e9f246936a64a171592a8ac3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 28 Mar 2022 16:07:50 +0800 Subject: [PATCH 14/33] =?UTF-8?q?=E9=98=B2=E7=96=AB=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/UserMessageTypeConstant.java | 4 + .../main/java/com/epmet/dto/IcNoticeDTO.java | 17 ++- .../com/epmet/dto/form/SendNoticeFormDTO.java | 63 ++++++++++ .../epmet/controller/IcNoticeController.java | 14 ++- .../java/com/epmet/entity/IcNoticeEntity.java | 12 +- .../com/epmet/service/IcNoticeService.java | 20 ++++ .../service/impl/IcNoticeServiceImpl.java | 108 +++++++++++++++++- 7 files changed, 228 insertions(+), 10 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index c4f703049c..57ac759211 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java @@ -164,6 +164,10 @@ public interface UserMessageTypeConstant { */ String PROJECT_REMIND="project_remind"; + /** + * 防疫通知 + */ + String ANTIEPIDEMIC="antiepidemic"; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java index 6e0fb6b20b..0a67cd4875 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java @@ -1,8 +1,11 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -30,12 +33,21 @@ public class IcNoticeDTO implements Serializable { * 通知渠道 0小程序通知,1短信通知 */ private String channel; - + private List channelList; /** * 通知来源 0行程上报,1疫苗接种,2核酸检测 */ private String origin; + /** + * 用户ID + */ + private String userId; + /** + * 手机号 + */ + private String mobile; + /** * 被通知人身份证号 */ @@ -69,6 +81,7 @@ public class IcNoticeDTO implements Serializable { /** * 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createdTime; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java new file mode 100644 index 0000000000..0d038cf71a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.DefaultGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/28 14:14 + */ +@NoArgsConstructor +@Data +public class SendNoticeFormDTO implements Serializable { + private static final long serialVersionUID = 4800907725063604885L; + private String customerId; + /** + * 用户列表 + */ + @NotNull(message = "用户列表不能为空", groups = DefaultGroup.class) + private List userList; + /** + * 通知渠道通知渠道 0小程序通知,1短信通知 + */ + @NotNull(message = "通知渠道不能为空", groups = DefaultGroup.class) + private List channel; + /** + * 通知来源 0 行程上报,1 疫苗接种,2 核酸检测 + */ + @NotNull(message = "通知来源不能为空", groups = DefaultGroup.class) + private String origin; + /** + * 通知内容 + */ + @NotNull(message = "通知内容不能为空", groups = DefaultGroup.class) + private String content; + /** + * 组织名 + */ + @NotNull(message = "组织名不能为空", groups = DefaultGroup.class) + private String orgName; + + @NoArgsConstructor + @Data + public static class UserListBean { + /** + * 用户ID + */ + private String userId; + /** + * 手机号 + */ + private String mobile; + /** + * 身份证 + */ + private String idCard; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java index 11000e575d..644c768530 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java @@ -1,19 +1,21 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; 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; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.service.IcNoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.List; import java.util.Map; @@ -68,6 +70,12 @@ public class IcNoticeController { return new Result(); } - + @PostMapping("sendNotice") + public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icNoticeService.sendNotice(formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java index 0114b3c5e7..133d56dfcd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java @@ -1,13 +1,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 防疫通知 * @@ -36,6 +33,15 @@ public class IcNoticeEntity extends BaseEpmetEntity { */ private String origin; + /** + * 用户ID + */ + private String userId; + /** + * 手机号 + */ + private String mobile; + /** * 被通知人身份证号 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java index 82d94c16d9..9bbcd2428e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.entity.IcNoticeEntity; import java.util.List; @@ -75,4 +76,23 @@ public interface IcNoticeService extends BaseService { * @date 2022-03-28 */ void delete(String[] ids); + + /** + * 发送通知 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/3/28 14:19 + */ + void sendNotice(SendNoticeFormDTO formDTO); + + /** + * 获取人员最新一条通知 + * @Param idCard + * @Return {@link IcNoticeDTO} + * @Author zhaoqifeng + * @Date 2022/3/28 15:43 + */ + IcNoticeDTO getNotice(String customerId, String idCard); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index 9c1d1c4628..ddd101c46b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -1,23 +1,36 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.constant.*; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcNoticeDao; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; +import com.epmet.dto.form.SendNoticeFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.entity.IcNoticeEntity; +import com.epmet.feign.MessageFeignClient; import com.epmet.service.IcNoticeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 防疫通知 @@ -25,9 +38,13 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-28 */ +@Slf4j @Service public class IcNoticeServiceImpl extends BaseServiceImpl implements IcNoticeService { + @Resource + private MessageFeignClient messageFeignClient; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -80,4 +97,91 @@ public class IcNoticeServiceImpl extends BaseServiceImpl entityList = formDTO.getUserList().stream().map(item -> { + IcNoticeEntity entity = new IcNoticeEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setChannel(channel); + entity.setContent(formDTO.getContent()); + entity.setOrigin(entity.getOrigin()); + entity.setUserId(item.getUserId()); + entity.setMobile(entity.getMobile()); + entity.setIdCard(item.getIdCard()); + entity.setOrgName(formDTO.getOrgName()); + return entity; + }).collect(Collectors.toList()); + insertBatch(entityList); + + //通知 + List msgList = new ArrayList<>(); + //短信消息 + List smsList = new ArrayList<>(); + + entityList.forEach(item -> { + if (StringUtils.isNotBlank(item.getUserId())) { + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(item.getCustomerId()); + messageFormDTO.setApp(AppClientConstant.APP_GOV); + messageFormDTO.setGridId(StrConstant.STAR); + messageFormDTO.setUserId(item.getUserId()); + messageFormDTO.setTitle("您有一条通知消息!"); + messageFormDTO.setMessageContent(item.getContent()); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC); + messageFormDTO.setTargetId(item.getId()); + msgList.add(messageFormDTO); + } + //TODO + if (StringUtils.isNotBlank(item.getMobile())) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(item.getCustomerId()); + sms.setMobile(item.getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_OVERDUE); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + + Result result = messageFeignClient.saveUserMessageList(msgList); + if (!result.success()) { + log.error("发送小程序消息失败" + JSON.toJSONString(result)); + } + } + + /** + * 获取人员最新一条通知 + * + * @param idCard + * @Param idCard + * @Return {@link IcNoticeDTO} + * @Author zhaoqifeng + * @Date 2022/3/28 15:43 + */ + @Override + public IcNoticeDTO getNotice(String customerId, String idCard) { + IcNoticeDTO result = new IcNoticeDTO(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNoticeEntity::getCustomerId, customerId); + wrapper.eq(IcNoticeEntity::getIdCard, idCard); + wrapper.orderByDesc(IcNoticeEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + result = ConvertUtils.sourceToTarget(list.get(NumConstant.ZERO), IcNoticeDTO.class); + result.setChannelList(Arrays.asList(result.getChannel().split(StrConstant.COMMA))); + } + return result; + } + } \ No newline at end of file From 4740324be7d5bed1d016dba8c101fd5c4df25ef3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 16:22:45 +0800 Subject: [PATCH 15/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNatDTO.java | 5 ++-- .../com/epmet/dto/form/AddIcNatFormDTO.java | 7 ++--- .../com/epmet/controller/IcNatController.java | 2 +- .../src/main/java/com/epmet/dao/IcNatDao.java | 2 +- .../java/com/epmet/entity/IcNatEntity.java | 2 +- .../epmet/service/impl/IcNatServiceImpl.java | 26 +++++++++++-------- .../src/main/resources/mapper/IcNatDao.xml | 2 ++ 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index df1f7db433..9c98833ed4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -129,10 +130,10 @@ public class IcNatDTO implements Serializable { /** * 通知渠道 0小程序通知,1短信通知,多选是数组 */ - private List channel; + private List channel = new ArrayList<>(); /** * 通知内容 */ - private String content; + private String content = ""; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index 6000b6a969..73928633fb 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -6,6 +6,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -56,7 +57,7 @@ public class AddIcNatFormDTO implements Serializable { /** * 检测时间 */ - @NotBlank(message = "检测时间不能为空", groups = Nat.class) + //@NotBlank(message = "检测时间不能为空", groups = Nat.class) @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date natTime; /** @@ -83,11 +84,11 @@ public class AddIcNatFormDTO implements Serializable { /** * 通知渠道 0小程序通知,1短信通知,多选是数组 */ - private List channel; + private List channel = new ArrayList<>(); /** * 通知内容 */ - private String content; + private String content = ""; //token中信息 private String customerId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 929e95ce4b..3f39c2500d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -41,7 +41,7 @@ public class IcNatController { * @Author sun * @Description 核酸检测-上报核酸记录 **/ - @NoRepeatSubmit + //@NoRepeatSubmit @PostMapping("add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 91ce606f2d..5ab06f865d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -35,5 +35,5 @@ public interface IcNatDao extends BaseDao { * @Author sun * @Description 删除/取消同步操作--物理删除业务数据 **/ - boolean delById(@Param("icNatId") String icNatId); + int delById(@Param("icNatId") String icNatId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index d1f62275b1..84d875c391 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -74,7 +74,7 @@ public class IcNatEntity extends BaseEpmetEntity { /** * 检测地点 */ - private String natOAddress; + private String natAddress; /** * 文件名 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 8a7061152e..400b52f5fd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -49,6 +49,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 核酸检测-上报核酸记录 **/ @Override + @Transactional(rollbackFor = Exception.class) public void add(AddIcNatFormDTO formDTO) { //1.获取所填居民所属组织缓存信息 AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); @@ -63,6 +64,8 @@ public class IcNatServiceImpl extends BaseServiceImpl imp //3.新增通知表信息 if (formDTO.getChannel().size() > NumConstant.ZERO) { //TODO + + } } @@ -132,8 +135,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp public void edit(AddIcNatFormDTO formDTO) { //1.更新核酸记录表数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); + entity.setId(formDTO.getIcNatId()); if (!updateById(entity)) { - log.error(String.format("数据修改失败,核酸记录Id->", formDTO.getIcNatId())); + log.error(String.format("数据修改失败,核酸记录Id->%s", formDTO.getIcNatId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败"); } @@ -150,8 +154,8 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Override public void del(MyNatListFormDTO formDTO) { //1.物理删除业务数据 - if (baseDao.delById(formDTO.getIcNatId())) { - log.error(String.format("数据删除/取消同步失败,核酸记录Id->", formDTO.getIcNatId())); + if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) { + log.error(String.format("数据删除/取消同步失败,核酸记录Id->%s", formDTO.getIcNatId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据操作失败"); } } @@ -162,19 +166,19 @@ public class IcNatServiceImpl extends BaseServiceImpl imp **/ @Override public void synchro(MyNatListFormDTO formDTO) { + //1.获取工作人员缓存数据 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } //1.根据核酸记录Id查询业务数据并进行必要校验 IcNatEntity entity = baseDao.selectById(formDTO.getIcNatId()); - if (null == entity || formDTO.getAgencyId().equals(entity.getAgencyId()) + if (null == entity || staffInfo.getAgencyId().equals(entity.getAgencyId()) || (!"import".equals(entity.getUserType()) && !"synchro".equals(entity.getUserType()))) { - log.error(String.format("数据同步失败,核酸记录Id->", formDTO.getIcNatId())); + log.error(String.format("数据同步失败,核酸记录Id->%s", formDTO.getIcNatId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,不是导入数据或非本组织数据"); } - //2.获取工作人员缓存数据 - //获取工作人员缓存信息 - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); - if (null == staffInfo) { - throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); - } + //3.待同步组织新增业务数据 entity.setId(""); entity.setAgencyId(staffInfo.getAgencyId()); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index b0e8a01607..7899c84227 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -22,6 +22,7 @@ del_flag = '0' AND customer_id = #{customerId} AND id_card = #{idCard} + ORDER BY nat_time DESC From d299af5789f32721adef1fe33a13708443e146ed Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 16:33:02 +0800 Subject: [PATCH 16/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IcNatController.java | 11 ++--- .../java/com/epmet/service/IcNatService.java | 2 - .../epmet/service/impl/IcNatServiceImpl.java | 49 ++++++++++++++----- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 3f39c2500d..5384a76dbb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -2,14 +2,9 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; -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; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; @@ -17,10 +12,12 @@ import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.service.IcNatService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; -import java.util.Map; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 2da059b99f..50bf30b6f8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -1,7 +1,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; @@ -10,7 +9,6 @@ import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import java.util.List; -import java.util.Map; /** * 核酸上报记录 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 400b52f5fd..40e1c49d5c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -1,37 +1,35 @@ 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.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcNatDao; import com.epmet.dto.IcNatDTO; +import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; import com.epmet.service.IcNatService; +import com.epmet.service.IcNoticeService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; -import java.util.Map; /** * 核酸上报记录 @@ -42,7 +40,8 @@ import java.util.Map; @Service @Slf4j public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService { - + @Autowired + private IcNoticeService icNoticeService; /** * @Author sun @@ -63,9 +62,15 @@ public class IcNatServiceImpl extends BaseServiceImpl imp //3.新增通知表信息 if (formDTO.getChannel().size() > NumConstant.ZERO) { - //TODO - - + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userList = new ArrayList<>(); + userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setUserList(userList); + dto.setChannel(formDTO.getChannel()); + dto.setOrigin("2"); + dto.setContent(formDTO.getContent()); + dto.setOrgName(agencyInfo.getOrganizationName()); + icNoticeService.sendNotice(dto); } } @@ -122,7 +127,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp resultDTO = ConvertUtils.sourceToTarget(entity, IcNatDTO.class); //2.查询对应的通知记录信息 - //TODO + IcNoticeDTO dto = icNoticeService.getNotice(entity.getCustomerId(), entity.getIdCard()); + if (null != dto) { + resultDTO.setChannel(dto.getChannelList()); + resultDTO.setContent(dto.getContent()); + } return resultDTO; } @@ -143,7 +152,21 @@ public class IcNatServiceImpl extends BaseServiceImpl imp //3.新增通知表信息 if (formDTO.getChannel().size() > NumConstant.ZERO) { - //TODO + IcNatEntity icNatEntity = baseDao.selectById(formDTO.getIcNatId()); + //1.获取所填居民所属组织缓存信息 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(icNatEntity.getAgencyId()); + if (null == agencyInfo) { + throw new RenException(String.format("获取组织缓存信息失败%s", icNatEntity.getAgencyId())); + } + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userList = new ArrayList<>(); + userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setUserList(userList); + dto.setChannel(formDTO.getChannel()); + dto.setOrigin("2"); + dto.setContent(formDTO.getContent()); + dto.setOrgName(agencyInfo.getOrganizationName()); + icNoticeService.sendNotice(dto); } } From 1bdfbf6acd9e275414f47792993a0b796089e25e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 28 Mar 2022 16:48:04 +0800 Subject: [PATCH 17/33] =?UTF-8?q?=E9=98=B2=E7=96=AB=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/ChannelEnum.java | 57 +++++++++++++++++++ .../main/java/com/epmet/dto/IcNoticeDTO.java | 12 ++++ .../com/epmet/dto/form/IcNoticeFormDTO.java | 21 +++++++ .../epmet/controller/IcNoticeController.java | 8 +-- .../com/epmet/service/IcNoticeService.java | 5 +- .../service/impl/IcNoticeServiceImpl.java | 36 +++++++++--- 6 files changed, 124 insertions(+), 15 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java new file mode 100644 index 0000000000..389338f717 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java @@ -0,0 +1,57 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +/** + * @author Administrator + */ +public enum ChannelEnum { + //通知渠道 0小程序通知,1短信通知 + APP("0", "小程序通知"), + MESSAGE("1", "短信通知"), + ALL("2", "小程序通知,短信通知"); + private String code; + private String name; + + + ChannelEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + ChannelEnum[] houseTypeEnums = values(); + for (ChannelEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getCode() == code) { + return houseTypeEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public static String getCode(String name) { + ChannelEnum[] houseTypeEnums = values(); + for (ChannelEnum houseTypeEnum : houseTypeEnums) { + if (houseTypeEnum.getName().equals(name)) { + return houseTypeEnum.getCode(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java index 0a67cd4875..72520ef800 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -22,11 +23,13 @@ public class IcNoticeDTO implements Serializable { /** * 唯一标识 */ + @JsonIgnore private String id; /** * 客户Id customer.id */ + @JsonIgnore private String customerId; /** @@ -37,20 +40,24 @@ public class IcNoticeDTO implements Serializable { /** * 通知来源 0行程上报,1疫苗接种,2核酸检测 */ + @JsonIgnore private String origin; /** * 用户ID */ + @JsonIgnore private String userId; /** * 手机号 */ + @JsonIgnore private String mobile; /** * 被通知人身份证号 */ + @JsonIgnore private String idCard; /** @@ -66,16 +73,19 @@ public class IcNoticeDTO implements Serializable { /** * 删除标识:0.未删除 1.已删除 */ + @JsonIgnore private Integer delFlag; /** * 乐观锁 */ + @JsonIgnore private Integer revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** @@ -87,11 +97,13 @@ public class IcNoticeDTO implements Serializable { /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java new file mode 100644 index 0000000000..057ee17921 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/28 16:13 + */ +@Data +public class IcNoticeFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 7392894573654015338L; + private String customerId; + @NotBlank(message = "身份证号不能为空", groups = DefaultGroup.class) + private String idCard; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java index 644c768530..f7cb128fc4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java @@ -11,13 +11,12 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.IcNoticeFormDTO; import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.service.IcNoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Map; - /** * 防疫通知 @@ -33,8 +32,9 @@ public class IcNoticeController { private IcNoticeService icNoticeService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icNoticeService.page(params); + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + PageData page = icNoticeService.page(formDTO); return new Result>().ok(page); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java index 9bbcd2428e..937cca916a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.IcNoticeFormDTO; import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.entity.IcNoticeEntity; @@ -20,12 +21,12 @@ public interface IcNoticeService extends BaseService { /** * 默认分页 * - * @param params + * @param dto * @return PageData * @author generator * @date 2022-03-28 */ - PageData page(Map params); + PageData page(IcNoticeFormDTO formDTO); /** * 默认查询 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index ddd101c46b..64fe1016c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -3,9 +3,9 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.constant.*; +import com.epmet.commons.tools.enums.ChannelEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -13,12 +13,15 @@ import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcNoticeDao; import com.epmet.dto.IcNoticeDTO; +import com.epmet.dto.form.IcNoticeFormDTO; import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendNoticeFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.entity.IcNoticeEntity; import com.epmet.feign.MessageFeignClient; import com.epmet.service.IcNoticeService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -46,12 +49,27 @@ public class IcNoticeServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcNoticeDTO.class); + public PageData page(IcNoticeFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNoticeEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcNoticeEntity::getIdCard, formDTO.getIdCard()); + wrapper.orderByDesc(IcNoticeEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + List dtoList = ConvertUtils.sourceToTarget(list, IcNoticeDTO.class); + + if (CollectionUtils.isNotEmpty(dtoList)) { + dtoList.forEach(item -> { + List channelList = Arrays.asList(item.getChannel().split(StrConstant.COMMA)); + if (channelList.size() == NumConstant.ONE) { + item.setChannel(ChannelEnum.getName(channelList.get(0))); + } else { + item.setChannel(ChannelEnum.getName(NumConstant.TWO_STR)); + } + }); + } + return new PageData<>(dtoList, pageInfo.getTotal()); } @Override @@ -115,9 +133,9 @@ public class IcNoticeServiceImpl extends BaseServiceImpl Date: Mon, 28 Mar 2022 16:53:20 +0800 Subject: [PATCH 18/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/IcNatController.java | 3 ++- .../main/java/com/epmet/service/impl/IcNatServiceImpl.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 5384a76dbb..0f6f799dd4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -88,7 +88,8 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("edit") - public Result edit(@RequestBody AddIcNatFormDTO formDTO) { + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); icNucleinService.edit(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 40e1c49d5c..f367748156 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -65,6 +65,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp SendNoticeFormDTO dto = new SendNoticeFormDTO(); List userList = new ArrayList<>(); userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setCustomerId(formDTO.getCustomerId()); dto.setUserList(userList); dto.setChannel(formDTO.getChannel()); dto.setOrigin("2"); @@ -141,6 +142,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 【核酸】核酸检测信息修改 **/ @Override + @Transactional(rollbackFor = Exception.class) public void edit(AddIcNatFormDTO formDTO) { //1.更新核酸记录表数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); @@ -161,6 +163,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp SendNoticeFormDTO dto = new SendNoticeFormDTO(); List userList = new ArrayList<>(); userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setCustomerId(formDTO.getCustomerId()); dto.setUserList(userList); dto.setChannel(formDTO.getChannel()); dto.setOrigin("2"); @@ -175,6 +178,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 【核酸】核酸检测信息删除/取消同步 **/ @Override + @Transactional(rollbackFor = Exception.class) public void del(MyNatListFormDTO formDTO) { //1.物理删除业务数据 if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) { @@ -188,6 +192,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Description 【核酸】核酸检测信息同步 **/ @Override + @Transactional(rollbackFor = Exception.class) public void synchro(MyNatListFormDTO formDTO) { //1.获取工作人员缓存数据 CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); From d8666c408f094fd9d9e8c3f0752c8759fb1e9964 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Mar 2022 16:55:39 +0800 Subject: [PATCH 19/33] add --- .../dto/form/CancelAttentionFormDTO.java | 6 +++ .../form/CancelAttentionPackageFormDTO.java | 20 ++++++++++ .../IcEpidemicSpecialAttentionController.java | 18 ++++----- .../IcEpidemicSpecialAttentionService.java | 3 +- ...IcEpidemicSpecialAttentionServiceImpl.java | 38 +++++++++++++++---- 5 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java index e1fcde9b28..bd9e48906c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java @@ -2,6 +2,8 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; @@ -15,13 +17,17 @@ public class CancelAttentionFormDTO implements Serializable { private static final long serialVersionUID = 2252387281427013057L; + public interface CancelAttentionForm{} + /** * 身份证 */ + @NotBlank(message = "idCard不能为空",groups = CancelAttentionForm.class) private String idCard; /** * 关注类型,核酸检测:2,疫苗接种:1 */ + @NotNull(message = "attentionType不能为空",groups = CancelAttentionForm.class) private Integer attentionType ; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java new file mode 100644 index 0000000000..db47f3520a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/28 16:48 + * @DESC + */ +@Data +public class CancelAttentionPackageFormDTO implements Serializable { + + private static final long serialVersionUID = 2198470055930997870L; + @Valid + private List list; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index cf91237a2d..f7325eca20 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -12,10 +12,7 @@ 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.IcEpidemicSpecialAttentionDTO; -import com.epmet.dto.form.CancelAttentionFormDTO; -import com.epmet.dto.form.NatListFormDTO; -import com.epmet.dto.form.VaccinationAddFormDTO; -import com.epmet.dto.form.VaccinationListFormDTO; +import com.epmet.dto.form.*; import com.epmet.service.IcEpidemicSpecialAttentionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -55,15 +52,13 @@ public class IcEpidemicSpecialAttentionController { /** * Desc:【疫苗接种关注名单,核酸检测关注名单】新增 - * @param list + * @param formDTO * @param tokenDto * @author zxc * @date 2022/3/28 13:35 */ @PostMapping("vaccination-add") - public Result vaccinationAdd(@RequestBody List list,@LoginUser TokenDto tokenDto){ - VaccinationAddFormDTO formDTO = new VaccinationAddFormDTO(); - formDTO.setList(list); + public Result vaccinationAdd(@RequestBody VaccinationAddFormDTO formDTO,@LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(formDTO, VaccinationAddFormDTO.VaccinationAddForm.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); @@ -85,13 +80,14 @@ public class IcEpidemicSpecialAttentionController { /** * Desc: 取消关注 - * @param list + * @param formDTO * @author zxc * @date 2022/3/28 13:51 */ @PostMapping("cancel-attention") - public Result cancelAttention(@RequestBody List list){ - icEpidemicSpecialAttentionService.cancelAttention(list); + public Result cancelAttention(@RequestBody CancelAttentionPackageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CancelAttentionFormDTO.CancelAttentionForm.class); + icEpidemicSpecialAttentionService.cancelAttention(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index c1f051233d..2ed2223152 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.CancelAttentionFormDTO; +import com.epmet.dto.form.CancelAttentionPackageFormDTO; import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; @@ -110,5 +111,5 @@ public interface IcEpidemicSpecialAttentionService extends BaseService list); + void cancelAttention(CancelAttentionPackageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index d9651531f1..f87b2c3184 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -7,15 +7,14 @@ import com.epmet.commons.tools.constant.NumConstant; 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.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; -import com.epmet.dto.form.CancelAttentionFormDTO; -import com.epmet.dto.form.NatListFormDTO; -import com.epmet.dto.form.VaccinationAddFormDTO; -import com.epmet.dto.form.VaccinationListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.service.IcEpidemicSpecialAttentionService; @@ -100,10 +99,10 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl result = new PageData(new ArrayList(), NumConstant.ZERO_L); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); if (null == staffInfo){ - throw new EpmetException("为查询到工作人员信息"+formDTO.getUserId()); + throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId()); } formDTO.setOrgId(staffInfo.getAgencyId()); // 关注类型,核酸检测:2,疫苗接种:1 @@ -128,6 +127,11 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl entities = ConvertUtils.sourceToTarget(formDTO.getList(), IcEpidemicSpecialAttentionEntity.class); + entities.forEach(e -> { + e.setIsAttention(NumConstant.ONE); + e.setOrgId(agencyInfo.getId()); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setCustomerId(formDTO.getCustomerId()); + }); + insertBatch(entities); + //TODO 发送通知 } /** @@ -162,7 +184,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl list) { + public void cancelAttention(CancelAttentionPackageFormDTO formDTO) { } From cdb8ec7e286a7b1d8bdfcc060d26522049beab15 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Mar 2022 17:06:18 +0800 Subject: [PATCH 20/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IcNatController.java | 36 ++++++++++++++++-- .../src/main/resources/excel/ic_nat.xlsx | Bin 0 -> 9114 bytes 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 0f6f799dd4..35d3511196 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -11,12 +11,16 @@ import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.service.IcNatService; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.*; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; import java.util.List; @@ -120,5 +124,29 @@ public class IcNatController { return new Result(); } + /** + * @Author sun + * @Description 【核酸】核酸检测信息下载模板 + **/ + @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("社区自组织导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/ic_nat.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..4d7df5944a91e416a31a21891975ba1778567252 GIT binary patch literal 9114 zcmaJ{1yo$ivc-ZE+}+(>g1fuB1s~jlyCpzyf(8jraCaxT6Wrb1J|zF$d&9r~^;&1n ztTRq;@`M=X#~RI+u)$ZgYzH&sERL3Wigj#PWtp?2rgriGH! z9Ob*Y!2VXrCc&_5khuZ&>&-Cc7O7R&OJidNQS{n$HFO{_Ui;d`ah!vOn(}7vpl;c8d2`k^!MCv-<|IpV+Gc)sjg9Qhy*XcfxH&nv zprc!%x!oyF=-8Iu17+L+RoDk_@asg3)M?M@#%gy{5&!57Bp1~BPN-dmBb*f|_lr>T z<7(}W8vEUi&B>cT(N)4w$OSY;I+yS<)8#{I}Y+!A^DF;ap&QmF+9}A**Te)VpL83`S5X}}L zzZHVK1F)Y!iwrT-sxO#Pj6mUNCQPewvVUer!?QMOb%&yZCOM#Bf5YVppy-am=Vwd+ z3x2!WTpo5~TZPIN(NYd=8=osx)XLn((}BytMvV9++V7+Inav&^0Y?xPirEo^1mxqT zds+X3#t1cXUd*F$yYyDAQuVSwNBu|HsP1a(Sm&u8$Q!7|cR%?qvbz;syt{zo>Xtui z={J{~3^+P{miESLC+tBct-Y1^M-@hy8zGz!aZ6fQv}VsA9HR*z*GMg{4v=Tc)3}{0 z_nL6A4u(Kgtxb3$quVhQ*kVUseIvhlJzX&H%6o?*b*dkparJt}82Jx;og5qi*1sJ1 zlYpE*1B%ZP*<*0-)tF*C&et+XD|Gl|4j1wqD;YDXIX|Q|?;2ySBRsw41o|ZptE)_K z2AI9Cqi-UJL3~GkIx42aTs!k*(1H!s)LTMiivXjqESEI47|~Bfw7XN{KtdltyPkLr zGCJQADeqR3>UM{OsBzjGvuOF2c5I;CQ-j zx_@;_Z7CV2Be{XU`{fNoGdDm=QZX!sB0R<{_A6$GcgV_;U(5>Y!ENm+_KP?EdrAO( zM$6Ue7o7ht@bqdy{C3ayXwAW{yX6Q4iK@8<{e^f&rk_}-{uPWofIn4$+JrnvkW4LmglYRbFE?E=!8mw!kc=60m?Yq!k z5Qt(-6Ta=~)xnscOwhjmkVe{YVg_w~TlNU%2mKC_wM?0n9N6xT&jMJ|2Rss6#EyOt z6&Sz^lG@Dms@yJeu_@I3=2_;@RicY>gx?DTZ1bt3GEOJ2(3M!5Gm|BkAnhy%zxW%P zA*eHV(@U^ujY4e@JVK?|)K$n2;`)H0#w^^SO%6KuFV?^`%?byV!O;rlP4%v8JUJ==Br@A8`B~H*=Q

GE`lEva968# zZFvh_>Z^oVn;_`ywZbSzjd?yB9<+J#!{_@Y?sWOT{mjbPi7Zsb(_0R*Yk~9DA9aF$ zRy@^)R9Z2z-#DFNfjsp9*_1l~XjwTi!xMr5vw+q*5bDUlLQ>c%R6>cUL`pgZskpvV zLn%uqA(54oD^8eJe!B(K7o-ZhT#Is!CcV2FgCp!pUIr%{Rm?*o2@5~BLk3aH4*%-D z47F<^f86rOWXo#WuJjPYxt}@TtIJ`u7RtpsPNA->f!{5Z!htz^xju`Ro|0Qqpv$LR zI+MN>>b-5UN^_y!d$-$6pTMr9v0mcT@C!=vn_|n&9QE`qk#F?*ipB<)SR_Cp?-ijn zi0f%t!@-$xs`b63?^4oL`k?Sy8mI#wkI%2KmP(h7((#^JSHwFqVlcs-v>EW7K)_Uh zf?$ZyVL?_M-`+qz&_y&m!VG>eQ&3N37wjl0pC-L0ryNAxCywwi@VIN884er?)?kQ` z1(=Eqo)&wJtv&t!G5xa5KgYDAnTfT@t3)Y{8$UAt1_+1%^LL{BOYE2MuRuM}kO5$` zBQ&9Jd#mp^MH}xCGZ8^l^RALPBMD1};e6AvNI-O{BcSB2N9`-;_sudNmGWJ5r!4?GptYq6y{UwFAw4VFSLG?VE#M4DuP!JLUb1D151;17#{A9|ID) za@f3Mt9DmE63-0<()Deyd$P*!D#dKnP(I+KHg$LOK=ZYGF0>v@TQqLRfl$E8#!|y~D$17@k659LfcyElJg+pH z4w3`e?*XNDiBg09{)A=l*#cKz= zomZ2|{pMnvFOBcR&5teb$Ky`mr8P6Fb}^E+_J&ZoMs6D4s-4!E!IQ+6q%I24&hPw; z*Uq(v12Z6tsl>bO2S(hkR~+IYFs{~@t*cxSH_}KwgY2uFAb5Jxgnyb#8A}JKd2F`6x!;u}A@o zW>EKNcbf!T)Xbi|OGi>JPv@sMa!~vw3p@0^R;RX(jMq*)1SxR)IlF=d(_7!LWY_}v z_si;W*}35k7+&W)GfC^O5Jgo+_9Wd0^txhX!^$49>T!k&uW%vhc7y%Ix+oj3X&=|H z?`*%H(kT3fZAym+(zoGSr4ZE-DX_V1YUvhBwP0Bt-F!j^Niok(XdrDGJLCMxj22ww z)A<9I-zGt(+NG*`B`yse^;NiXaXFBMiRyB|dRtw=8vCw3h^Vc#AWATmoLd3<>|~#3 zO41^VbRkH=v0`?x5iS6EPJTgO+)hw>bZ8x(<^OE_2 z&zk4T6k+NZESd>VkzFDVaL$Eu{7OocX1iY;?>C)6CCT_TdeU1DaCylvC!*xZwS7^t{iC}%h&IgMYlTjCfQno%u-e6R>9u~s+~ z;ig~o=zhFSm%1ug zuSVCbv6rQ200V1`NYCC&%O=E_h>z8nKv{FbR87{2m}@dBZ)MK^k|%*tu%un96RI^! zoI2jN9LU8tQ>;o0D}%NriEIAQ5qJXwip>XfvfbA36Elto9TINt0pia;CAw#Hdq=b@Y23-%Ck-0Uk*z%?c_bcq~5LWd3@R9 zSYV5q_cU9*UUV38NOL%>qaW)2(UDpBv%-Jmq$#SPSWTtt(%oz6L}5YRt1W9 zU{9;$XcqUP_w8g#ir&+lCrfD%8I>0u;3QLbc@-jga%F~e!u}(Sb`Pu&+ntros|7`6noj1b~;3KRKx)~ zE${_DRhn;Nqw$+gHqgn}e>iQ-)s*NIE~+ek^1R5d;?#?|v|Puxc{*qa(+s^>jmyu8 z%TSyy6h3wel$4}{Y+7pMZ1E;u;4}Zi#&q~$bN=&r($R2EM7(NHaH2*ST)k`)A#k~1 zQ$ro&aZ_iXJ8EM@iIq(NfclCC{W_0$#G`o+LK2Jxgx+!nZfbMruI3eo1?}nPbn`l&u@7vrn>}qhg;}Dl6U>vAIo?W2c1t;@ zGB4T5AUDOE>f&BBO6!{XN;Ii4k6M~<{&0ua>w{~6`HF-F+S)IQ7*x*T^Hm!%ro2@O z9~i8p62W=Em~7w&jzqrsGUtK4gQTpx4X}o0LUQM(dN5Imo5V!th9G2I=vsXdLEx#M z_UuoNvaH^>Jjl(e+jrbz5c1z#n!gv#}pGK>no3z#Y8F>3j6)kLaYwgU+*#^-SLgyJtEz3x1}?pMHWRtE4r~~; z3rnFbO$*JPVZK+@S!g*S>vmnEqN7Pks|dI}^xS=j@ab+(BGo`yjr%n%2t|>P{i{q^=upq6@vMXuYhxQACS8FT&>bL4z z6?44d*@SfS!%!58r%7j(KyJ1Zt`R)~ho?9&^t=TB+`wNV(}NpJ^OAg;ja}OVp^b&w z_VRM{sh5vGmX0s%p0II;dn)ZngRZf-lXmqfpLAckjZ9fA^74cXNkg+-G+M3(j%u51 z&f~C29im9^usFlC$mFo8GtpD4RTLB2?&*Vf<=&hR4r7dpaoM0Bx(5(G*j(TS>_Ia# z78B=Z6k{j@1;p|pKdt<3EiU)WkUpm&t8g6jA8fr26IS6O)`NCxXc1N=fQ-88QI-Ok z>=JfJg7E&dV8Hj=Mv7+b@UG(xESeDdX+s5U5zibnn4h1`VxTcsE=49o-sIh8HLmQ( z7$^T^tFYZ->tlCNtvZ{df|)lSHdWBHqcuGkL?kR{%Io66-WdTVRv30(m^bUaZu5Z? z6UB~MSn-)(4JJk~E5*R&u~)vE@vZjn-N}5|!}F}{%RO5m zXwY&D@^RMkzw&GebFy8=`v741Sp|xW|D{!PxlqfMK!$fIj8&Yj3H3U9A^h0jEz6KD zzl7tQAJw-GP9J-!K4J|`QUgjxUnH`5sL#h;INs=6dK8(+IX>qOpEWU|-Ylz@Wcv>9 zteZfAe1)1Nfl@&Bqqa*GI|N@C*s+0|idbC*VZ-92RpTVGAA#a3_AFcBfJ7Yhp)U5Q8!K1UBxR+bFr-+) z0q<#Jx=Hazii;+NdoL^1wghyNs;F2L5U+J$p>1oKgA1-e7s2@rN`%uh(SJRrT&SmY zM_GPw3TS<|5+t`v6Y49d+^|A{_*iCE{3@9lBtF`dt))rq<5(_sNMIolwVUonfed1u za+JMkC^!yi&M`H+n6UXhRT-*@5;PqaeraMqkEK+@+g{XEHDiwDu-vgI@Q_+NI}jFe zB(w>|Gf@o#1)I7zD8obcv_|#{!#7wm!^k)*X`CD-MZAdpYfL-6#nwKW;j3n7O*B>+ z1&{r3c|XASOJl(btTi$U-SaIKbh(AzG8BV9w}1EJGW2Fyw!q{>CK)zUam+|0lC^R*9vb! zg^8sA2x8}=5^T|09byUS)oB-g;5;Shr>&NncTYUHd{1sP=y4qqFrGsUw5lNJ$RS~^ zU)|vFyJTv-AMz5`^d9U_KVBIonNh{EwC6pITQlu|JmxqG?6BGUsD+_kt~++)U4j>#rurD5)eo(bP#D!z@7(`6_pI@9OYHMGc8H)ZIo z<$q`1EBENcQ}@)O&cxdmcOA&%l4`nlJ+9>3(o3a-r5^k7Nbb>-$?N>?qyr)rp6|W2 z2-S|FXcmt1J*H)hq~Ta4`_1w7el{N!6fBXQ{-mVe=J`&~`<^4&L%zVTd^gKS(iy!; z^~ycca%Ib)+F)|xJF*w1j38EP*wGL&vpcht3N3B;X#`1OGI!Pxz_Yc_U#`lyBZ;i#jchn~FUodIr0L<~5k zKv)%m8(26Jk`A+sDX*W{)tetV3)1NiPWKHiB2g2H_c1X{%%tB5p+&)Un+ZQoc|XCK z_0yo6zmby`rx`XT?(c`LOGi>vntjN9z{HaHgDgGV!PUv!s)9|<&%+Jqz? z^_S20XZ5~Ys?D7MW(COE1`xy}1u2UP1%KO{T&Q39|0ju1=%B+oxVjoH(`l-l(vV zQb=~`3NZUu()tLy4AXg_FsWbC_HlvzVWf35HS1kA@VbF;*}ywNVTJ&RTsKJ2eIqNNz$xW4H0mldfCQ;2${_*eJzqoUVwWJ3T6(?YXB}*)2pQd$Pv{F7Blc z@)o8{I;)`?T_o?6M8)p%PMS9;pefyaw@DMTuZq?vAy3W=4152CQjK5j4g4pD>-9?? zDW38B`Fz3u#_*+vYX|^X{wl{R$jEgtz%~(|;1exrG}x>eX>y0sm%}83?c*W2M8?yT zQsO@0)l6cD$zE2hZC#~K-kP!8wIjq;kV=ztGE}xpm|T&1HuC8$fP{x?^;K1MSXhD#jLG? zff>KThf`7#*D6M?>CYBP0?aB$!pGJxmakehR*Q|xc=$lg{`D^3*Boy=RvF3!irKHE z!@&TUrt+~_CAr?EqS2@5mbDHJ%)N#?P={yQqnFDhXHQrDAVpbF;U|h4U&@0UUt(?@ zArm)+`yM=F&fcY+kQ61nl!(Mk?@p^N7P5A@wf+YTyrHddzjNsKBG@3ftG-;M5tefJ zN)JH)f0YgV8B{%c6RXz+aSsmX#;51smY%sDn7?G`UL=cSh9x^05W0_^eRi{1#sw8| z){&lQU&i=@PonhG2pMvW#zAwFfC9}#J;cYPo6VFZPvZvc1p-~h+^9xBCj~!#K(BMN z!m+2T`huT$QPU)-o3d>?Si|nA;a!0LCeP#xpFf?ORV0s- z&xqKct;t5-rvFs5I~`A6hNo+hD#W7!+>Rr#@df}W*c)1Ymy|6u%uKzm9R0<~>Jw^& zzi0ML3&Mp6I5_99y%X=ik&9$-QL!m4oQQT{qEgt;4eb^?nxr0WS^O~4j2}1r_2j0i;=bPb5q|o$K*#ysUcS_NTOkF8@E4|68&AH#j$rvoH>xVXS|K6YKf@ zoC|)7{nMNOgRaH1OLrgnH~Ei#up5hH6#b&xoiSbP0c1q&ZDt4|rIk{X-kYhB;h3Ne zn;y_|L_RRTPD5I^UxX>}0uI)Bnm38w^G#%bQ2RhtyY4?Ty z(h>sLIGWfv>M6U~nmFjZ1bp%50a*}6l%OlJ=8msg%u2Qf5eE7zCf`U_K_@O-SrNQEaBCyVqh)PZH)a~6tB@naKC(@+xwl-gY( zShYaEj~?GzFla!u`W4_#6-iL?*hYN^rY<`L#`z)rp^|8nVaOH1p3bxt;L*fQ*Ce&9 zn4}5EhQrgQOe0N|rgrYJM&c)+%4368U6dS(5D`xlt<>ze>!WA`g{rd2I7^{wG5NNi04Gdxzj#-{Xjzpa%p*hL!A7x8`R9s~gjE1($G$+XME ze4Oy6i|8rv#|3`0cLK7G-+ZKm^a98@T_vPQN?&cP{QF<@|0h z6uk`g-wEhXqpwrYi_UMOc7N&o3Yq_A>?J0Dw-;kC?H{iW{Aus?%L6aMzwMF#Q|*6W zC3p?dYjXT=?Z9W3{>$ipsPfn9uesm9)i<6~#^36HF~R?B(l2!A@AfijWU&7wM_;D< z?@RJ0N=Z2XNKmf_`Z|-n*!hi8>p#{0PhNZ7&+F6C-~CiR6R`hwR(jpT>&oBXJzzc4 zy)QldRR{cUVEsAwt!D!GS@l1x)1Mylns@r!;# Date: Mon, 28 Mar 2022 17:30:57 +0800 Subject: [PATCH 21/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-user-server/src/main/resources/mapper/IcNatDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 7899c84227..f8b162ee5c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -43,7 +43,7 @@ del_flag = '0' AND customer_id = #{customerId} - AND pids like concat('%', #{agencyId}, '%') + AND (agency_id = #{agencyId} OR pids like concat('%', #{agencyId}, '%')) AND name like concat('%', #{name}, '%') From 567479cb6f82d56b8cd5422d1a91740d65297ad4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 28 Mar 2022 17:35:26 +0800 Subject: [PATCH 22/33] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A0=B8=E9=85=B8?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-commons/epmet-commons-tools/pom.xml | 20 ++++ .../data-report/data-report-server/pom.xml | 6 - .../com/epmet/dto/form/MyNatListFormDTO.java | 13 +- .../epmet/dto/result/NatListResultDTO.java | 111 ++++++++++-------- epmet-user/epmet-user-server/pom.xml | 19 --- .../com/epmet/controller/IcNatController.java | 53 ++++++++- .../src/main/java/com/epmet/dao/IcNatDao.java | 4 +- .../java/com/epmet/service/IcNatService.java | 8 +- .../epmet/service/impl/IcNatServiceImpl.java | 16 ++- .../src/main/resources/mapper/IcNatDao.xml | 4 +- 10 files changed, 152 insertions(+), 102 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 7f1fb8e728..e516c5fba7 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -24,6 +24,7 @@ 2.8.6 1.11.3 1.18.4 + 3.0.3 @@ -177,6 +178,25 @@ javase 3.4.1 + + com.alibaba + easyexcel + ${easyexcel.version} + + + poi + org.apache.poi + + + poi-ooxml + org.apache.poi + + + poi-ooxml-schemas + org.apache.poi + + + diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 472525e5e7..cf8312e897 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -100,12 +100,6 @@ 2.0.0 compile - - com.alibaba - easyexcel - 3.0.3 - compile - diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index b19a1d9caf..e9620dc5d2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -1,17 +1,17 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; -import java.io.Serializable; /** * @Description 核酸检测-我的上报记录 * @Author sun */ @Data -public class MyNatListFormDTO implements Serializable { +public class MyNatListFormDTO extends PageFormDTO { private static final long serialVersionUID = 9156247659994638103L; public interface MyNat extends CustomerClientShowGroup { @@ -49,11 +49,6 @@ public class MyNatListFormDTO implements Serializable { * 检测结束时间yyyy-MM-dd HH:mm间yy-mm-dd */ private String endTime; - /** - * 分页参数 - */ - private Integer pageNo = 1; - private Integer pageSize = 10; /** * 核酸记录Id @@ -61,7 +56,9 @@ public class MyNatListFormDTO implements Serializable { @NotBlank(message = "核酸记录Id不能为空", groups = { Detail.class, Del.class, Synchro.class}) private String icNatId; - //token信息 + /** + * token里设置 + */ private String customerId; private String userId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java index d3cbead954..7a62c359a8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -1,12 +1,13 @@ package com.epmet.dto.result; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; -import java.util.ArrayList; import java.util.Date; -import java.util.List; /** * @Description 核酸检测-我的上报记录 @@ -16,61 +17,69 @@ import java.util.List; public class NatListResultDTO implements Serializable { private static final long serialVersionUID = 1L; - //总条数 - private Integer total; - List list = new ArrayList<>(); + /** + * 核酸记录Id + */ + @ExcelIgnore + private String icNatId; + /** + * 组织Id + */ + @ExcelIgnore + private String agencyId; + /** + * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 + */ + @ExcelIgnore + private String userId; + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + */ + @ExcelIgnore + private String userType; - @Data - public static class NatListDTO { + /** + * 姓名 + */ + @ColumnWidth(20) + @ExcelProperty("姓名") + private String name; - /** - * 核酸记录Id - */ - private String icNatId; - /** - * 组织Id - */ - private String agencyId; - /** - * 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 - */ - private String userId; - /** - * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other - */ - private String userType; + /** + * 手机号 + */ + @ColumnWidth(20) + @ExcelProperty("手机号") + private String mobile; - /** - * 姓名 - */ - private String name; + /** + * 身份证号 + */ + @ColumnWidth(25) + @ExcelProperty("身份证号") + private String idCard; - /** - * 手机号 - */ - private String mobile; + /** + * 检测时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ColumnWidth(25) + @ExcelProperty("检测时间") + private Date natTime; - /** - * 身份证号 - */ - private String idCard; + /** + * 检测结果 + */ + @ColumnWidth(20) + @ExcelProperty("检测结果") + private String natResult; - /** - * 检测时间,yyyy-MM-dd HH:mm - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") - private Date natTime; + /** + * 检测地点 + */ + @ColumnWidth(30) + @ExcelProperty("检测地点") + private String natAddress; - /** - * 检测结果 - */ - private String natResult; - - /** - * 检测地点 - */ - private String natAddress; - - } } diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 0189ee8ce0..fb8ea8e9b4 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -18,25 +18,6 @@ epmet-admin-client 2.0.0 - - com.alibaba - easyexcel - 3.0.3 - - - poi - org.apache.poi - - - poi-ooxml - org.apache.poi - - - poi-ooxml-schemas - org.apache.poi - - - com.epmet epmet-user-client diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 35d3511196..a52e4e2a59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -1,8 +1,14 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcNatDTO; @@ -11,6 +17,8 @@ import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.service.IcNatService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; @@ -30,6 +38,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@Slf4j @RestController @RequestMapping("icNat") public class IcNatController { @@ -69,10 +78,10 @@ public class IcNatController { **/ @NoRepeatSubmit @PostMapping("natlist") - public Result natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { + public Result> natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); - return new Result().ok(icNucleinService.natList(formDTO)); + return new Result>().ok(icNucleinService.natList(formDTO)); } /** @@ -148,5 +157,45 @@ public class IcNatController { } + /** + * @Author sun + * @Description 【核酸】核酸检测信息列表 + **/ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + + //formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + //formDTO.setUserId("73ae6280e46a6653a5605d51d5462725"); + + formDTO.setPage(false); + + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String fileName = "核酸检测信息.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response),NatListResultDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + PageData data = null; + do { + data = icNucleinService.natList(formDTO); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize()); + + }catch (Exception e){ + log.error("export exception", e); + }finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 5ab06f865d..4ac7359f2e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -29,11 +29,11 @@ public interface IcNatDao extends BaseDao { * @Author sun * @Description 【核酸】核酸检测信息列表 **/ - List getNatList(MyNatListFormDTO formDTO); + List getNatList(MyNatListFormDTO formDTO); /** * @Author sun * @Description 删除/取消同步操作--物理删除业务数据 **/ int delById(@Param("icNatId") String icNatId); -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 50bf30b6f8..736cb505df 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; import com.epmet.dto.form.MyNatListFormDTO; @@ -33,8 +34,9 @@ public interface IcNatService extends BaseService { /** * @Author sun * @Description 【核酸】核酸检测信息列表 - **/ - NatListResultDTO natList(MyNatListFormDTO formDTO); + * + * @return*/ + PageData natList(MyNatListFormDTO formDTO); /** * @Author sun @@ -59,4 +61,4 @@ public interface IcNatService extends BaseService { * @Description 【核酸】核酸检测信息同步 **/ void synchro(MyNatListFormDTO formDTO); -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index f367748156..f022f10d9b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; @@ -90,10 +91,10 @@ public class IcNatServiceImpl extends BaseServiceImpl imp /** * @Author sun * @Description 【核酸】核酸检测信息列表 - **/ + * + * @return*/ @Override - public NatListResultDTO natList(MyNatListFormDTO formDTO) { - NatListResultDTO resultDTO = new NatListResultDTO(); + public PageData natList(MyNatListFormDTO formDTO) { //1.根据orgType值判断是查询当前组织下还是整个客户下数据 if ("current".equals(formDTO.getOrgType())) { //获取工作人员缓存信息 @@ -105,12 +106,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } //2.按条件查询业务数据 - PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage()) .doSelectPageInfo(() -> baseDao.getNatList(formDTO)); - resultDTO.setTotal((int) data.getTotal()); - resultDTO.setList(data.getList()); - - return resultDTO; + return new PageData(data.getList(),data.getTotal()); } /** @@ -215,4 +213,4 @@ public class IcNatServiceImpl extends BaseServiceImpl imp insert(entity); } -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index f8b162ee5c..a16f593941 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -25,7 +25,7 @@ ORDER BY nat_time DESC - SELECT id icNatId, agency_id agencyId, @@ -67,4 +67,4 @@ DELETE FROM ic_nat WHERE id = #{icNatId} - \ No newline at end of file + From 68529ce18a627dc2678567396f6be5fa24503cdb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Mar 2022 17:40:27 +0800 Subject: [PATCH 23/33] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CancelAttentionFormDTO.java | 33 ------------------- .../form/CancelAttentionPackageFormDTO.java | 19 +++++++++-- .../IcEpidemicSpecialAttentionController.java | 2 +- .../dao/IcEpidemicSpecialAttentionDao.java | 19 +++++++++++ .../IcEpidemicSpecialAttentionService.java | 3 +- ...IcEpidemicSpecialAttentionServiceImpl.java | 23 +++++++++++-- .../mapper/IcEpidemicSpecialAttentionDao.xml | 28 ++++++++++++++++ 7 files changed, 87 insertions(+), 40 deletions(-) delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java deleted file mode 100644 index bd9e48906c..0000000000 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionFormDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.epmet.dto.form; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * @Author zxc - * @DateTime 2022/3/28 13:47 - * @DESC - */ -@Data -public class CancelAttentionFormDTO implements Serializable { - - private static final long serialVersionUID = 2252387281427013057L; - - public interface CancelAttentionForm{} - - /** - * 身份证 - */ - @NotBlank(message = "idCard不能为空",groups = CancelAttentionForm.class) - private String idCard; - - /** - * 关注类型,核酸检测:2,疫苗接种:1 - */ - @NotNull(message = "attentionType不能为空",groups = CancelAttentionForm.class) - private Integer attentionType ; -} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java index db47f3520a..f0c8f9a900 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java @@ -3,6 +3,8 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; @@ -15,6 +17,19 @@ import java.util.List; public class CancelAttentionPackageFormDTO implements Serializable { private static final long serialVersionUID = 2198470055930997870L; - @Valid - private List list; + + public interface CancelAttentionPackageForm{} + + + /** + * 身份证 + */ + @NotNull(message = "idCard不能为空",groups = CancelAttentionPackageForm.class) + private List idCards; + + /** + * 关注类型,核酸检测:2,疫苗接种:1 + */ + @NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class) + private Integer attentionType ; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index f7325eca20..42fcc20c23 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -86,7 +86,7 @@ public class IcEpidemicSpecialAttentionController { */ @PostMapping("cancel-attention") public Result cancelAttention(@RequestBody CancelAttentionPackageFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, CancelAttentionFormDTO.CancelAttentionForm.class); + ValidatorUtils.validateEntity(formDTO, CancelAttentionPackageFormDTO.CancelAttentionPackageForm.class); icEpidemicSpecialAttentionService.cancelAttention(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java index cc1d3ba4a1..11b6b3ab09 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -5,6 +5,7 @@ import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -33,4 +34,22 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao natList(VaccinationListFormDTO formDTO); + /** + * Desc: 取消关注 + * @param list + * @param attentionType + * @author zxc + * @date 2022/3/28 16:59 + */ + void cancelAttention(@Param("list")List list,@Param("attentionType")Integer attentionType); + + /** + * Desc: 查询已经存在的关注 + * @param attentionType + * @param list + * @author zxc + * @date 2022/3/28 17:29 + */ + List getExistList(@Param("attentionType")Integer attentionType,@Param("list")List list); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index 2ed2223152..3690df2640 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -3,7 +3,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; -import com.epmet.dto.form.CancelAttentionFormDTO; import com.epmet.dto.form.CancelAttentionPackageFormDTO; import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.form.VaccinationListFormDTO; @@ -107,7 +106,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService entities = ConvertUtils.sourceToTarget(formDTO.getList(), IcEpidemicSpecialAttentionEntity.class); + List idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); + Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType(); + List existList = baseDao.getExistList(attentionType, idCards); + if (CollectionUtils.isNotEmpty(existList)){ + for (String s : existList) { + for (int i = NumConstant.ZERO; i < entities.size(); i++) { + if (s.equals(entities.get(i).getIdCard())){ + entities.remove(i); + continue; + } + } + } + } entities.forEach(e -> { + e.setIsAttention(NumConstant.ONE); e.setOrgId(agencyInfo.getId()); e.setPid(agencyInfo.getPid()); @@ -179,13 +195,16 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl + + + UPDATE ic_epidemic_special_attention + SET UPDATED_TIME = NOW(), + IS_ATTENTION = 0 + WHERE del_flag = 0 + AND attention_type = #{attentionType} + AND id_card IN ( + + #{l} + + ) + + + + + \ No newline at end of file From 9c8cb15b5f37320dea1549400b43e2d0cf1f5c01 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 28 Mar 2022 18:32:10 +0800 Subject: [PATCH 24/33] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A0=B8=E9=85=B8?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/NatListResultDTO.java | 3 +++ .../src/main/java/com/epmet/controller/IcNatController.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java index 7a62c359a8..a65563bb5b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -3,6 +3,8 @@ package com.epmet.dto.result; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -13,6 +15,7 @@ import java.util.Date; * @Description 核酸检测-我的上报记录 * @Author sun */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) @Data public class NatListResultDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index a52e4e2a59..db7de0852b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -179,7 +179,7 @@ public class IcNatController { // 这里 需要指定写用哪个class去写 String fileName = "核酸检测信息.xlsx"; excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response),NatListResultDTO.class).build(); - WriteSheet writeSheet = EasyExcel.writerSheet().build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); PageData data = null; do { data = icNucleinService.natList(formDTO); From 788f6b2671466a574f3b689e334856357ca43719 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 28 Mar 2022 22:09:53 +0800 Subject: [PATCH 25/33] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E4=BF=A1=E6=81=AF=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/security/user/LoginUserUtil.java | 87 ++++++------ .../epmet/commons/tools/utils/FileUtils.java | 41 ++++++ .../epmet/constants/ImportTaskConstants.java | 4 + .../dto/form/ImportTaskCommonFormDTO.java | 4 + .../dto/form/LoginUserDetailsFormDTO.java | 4 + .../deploy/docker-compose-dev.yml | 1 + .../deploy/docker-compose-prod.yml | 1 + .../deploy/docker-compose-test.yml | 1 + .../com/epmet/controller/IcNatController.java | 79 ++++++++++- .../java/com/epmet/entity/IcNatEntity.java | 5 +- .../excel/data/IcNatImportExcelData.java | 61 ++++++++ .../handler/IcNatExcelImportListener.java | 126 +++++++++++++++++ .../java/com/epmet/service/IcNatService.java | 7 + .../epmet/service/impl/IcNatServiceImpl.java | 131 +++++++++++++++++- 14 files changed, 503 insertions(+), 49 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index 70307f6551..ce92400ae0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -1,11 +1,9 @@ package com.epmet.commons.tools.security.user; import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.utils.HttpContextUtils; -import org.apache.commons.lang3.StringUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import org.springframework.stereotype.Component; -import javax.servlet.http.HttpServletRequest; import java.util.List; /** @@ -14,24 +12,21 @@ import java.util.List; @Component public class LoginUserUtil { - //@Autowired - //private - /** * 查询登录用户的id * @return */ public String getLoginUserId() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - - String userId = request.getHeader(AppClientConstant.USER_ID); - if (StringUtils.isBlank(userId)) { - return null; - } - return userId; + //HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + //if (request == null) { + // return null; + //} + // + //String userId = request.getHeader(AppClientConstant.USER_ID); + //if (StringUtils.isBlank(userId)) { + // return null; + //} + return EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); } /** @@ -39,16 +34,16 @@ public class LoginUserUtil { * @return */ public String getLoginUserApp() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - - String app = request.getHeader(AppClientConstant.APP); - if (StringUtils.isBlank(app)) { - return null; - } - return app; + //HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + //if (request == null) { + // return null; + //} + // + //String app = request.getHeader(AppClientConstant.APP); + //if (StringUtils.isBlank(app)) { + // return null; + //} + return EpmetRequestHolder.getHeader(AppClientConstant.APP); } /** @@ -56,16 +51,16 @@ public class LoginUserUtil { * @return */ public String getLoginUserClient() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - - String client = request.getHeader(AppClientConstant.CLIENT); - if (StringUtils.isBlank(client)) { - return null; - } - return client; + //HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + //if (request == null) { + // return null; + //} + // + //String client = request.getHeader(AppClientConstant.CLIENT); + //if (StringUtils.isBlank(client)) { + // return null; + //} + return EpmetRequestHolder.getHeader(AppClientConstant.CLIENT); } /** @@ -73,16 +68,16 @@ public class LoginUserUtil { * @return */ public String getLoginUserCustomerId() { - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - if (request == null) { - return null; - } - - String client = request.getHeader(AppClientConstant.CUSTOMER_ID); - if (StringUtils.isBlank(client)) { - return null; - } - return client; + //HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + //if (request == null) { + // return null; + //} + // + //String client = request.getHeader(AppClientConstant.CUSTOMER_ID); + //if (StringUtils.isBlank(client)) { + // return null; + //} + return EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID); } /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java index b8a12015bb..00784bc7db 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/FileUtils.java @@ -15,6 +15,47 @@ import java.nio.file.Paths; @Slf4j public class FileUtils { + /** + * epmet文件根路径 + */ + private static Path epmetFilePath; + + static { + // linux || mac + epmetFilePath = Paths.get("/opt/epmet_files"); + // windows + } + + /** + * 获取在epmetfiles下的文件路径,输入相对路径即可获取完整绝对路径 + * @param pathParts 目录片段,可以是文件夹或者文件名 + * @return + */ + public static Path getPathUnderEpmetFilesDir(String... pathParts) { + Path path; + if (pathParts == null || pathParts.length == 0) { + path = epmetFilePath.resolve("temp"); + } else { + path = Paths.get(epmetFilePath.toString(), pathParts); + } + return path; + } + + /** + * 创建并且返回epmet_files下的文件夹 + * @param dirParts 文件夹列表 + * @return + * @throws IOException + */ + public static Path getAndCreateDirUnderEpmetFilesDir(String... dirParts) throws IOException { + Path pathUnderEpmetFilesDir = getPathUnderEpmetFilesDir(dirParts); + if (Files.notExists(pathUnderEpmetFilesDir)) { + Files.createDirectories(pathUnderEpmetFilesDir); + } + + return pathUnderEpmetFilesDir; + } + /** * 创建临时文件 * diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index 6212a35cb6..8e7ef7eedb 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -15,6 +15,10 @@ public interface ImportTaskConstants { String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org"; String BIZ_TYPE_PARTY_UNIT = "party_unit"; String BIZ_TYPE_PARTY_ACTIVITY = "party_activity"; + /** + * 核酸检测 + */ + String BIZ_TYPE_IC_NAT = "ic_nat"; /** * 处理状态:处理中 diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java index 9eea1fe6c2..08fc2f0995 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java @@ -2,10 +2,14 @@ package com.epmet.dto.form; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.validator.group.QueryGroup; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; +@AllArgsConstructor +@NoArgsConstructor @Data public class ImportTaskCommonFormDTO extends PageFormDTO { diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java index 7c1af89a00..76e5c31d4d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java @@ -1,8 +1,12 @@ package com.epmet.dto.form; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; @Data +@AllArgsConstructor +@NoArgsConstructor public class LoginUserDetailsFormDTO { private String app; private String client; diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index b5421e4e4e..154960f1db 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -8,6 +8,7 @@ services: network_mode: host # 不会创建新的网络 volumes: - "/opt/epmet-cloud-logs/dev:/logs" + - "/opt/epmet_files/:/opt/epmet_files" environment: RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index bc63091248..1fbe59593f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -8,6 +8,7 @@ services: network_mode: host # 不会创建新的网络 volumes: - "/opt/epmet-cloud-logs/prod:/logs" + - "/opt/epmet_files/:/opt/epmet_files" environment: RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./epmet-user.jar" restart: "unless-stopped" diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 5537d14081..c880913294 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -8,6 +8,7 @@ services: network_mode: host # 不会创建新的网络 volumes: - "/opt/epmet-cloud-logs/test:/logs" + - "/opt/epmet_files/:/opt/epmet_files" environment: RUN_INSTRUCT: "java -Xms32m -Xmx512m -jar ./epmet-user.jar" restart: "unless-stopped" diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 929e95ce4b..7491f946c1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -2,25 +2,44 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcNatService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Map; +import java.util.UUID; /** @@ -29,13 +48,17 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@Slf4j @RestController @RequestMapping("icNat") -public class IcNatController { +public class IcNatController implements ResultDataResolver { @Autowired private IcNatService icNucleinService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + /** * @Author sun @@ -122,5 +145,59 @@ public class IcNatController { return new Result(); } + /** + * 导入excel + * @return + */ + @PostMapping("importExcel") + public Result importExcel(MultipartFile file) { + String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【核酸检测导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + e.printStackTrace(); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOperatorId(userId); + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_IC_NAT); + importTaskForm.setOriginFileName(originalFilename); + + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel导入核酸检测信息错误", + "导入居民核酸检测信息失败"); + + // 3.执行导入 + icNucleinService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); + + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index d1f62275b1..1fee4076a4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -1,5 +1,7 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; @@ -24,6 +26,7 @@ public class IcNatEntity extends BaseEpmetEntity { /** * 客户Id CUSTOMER.id */ + @TableField(fill = FieldFill.INSERT) private String customerId; /** @@ -74,7 +77,7 @@ public class IcNatEntity extends BaseEpmetEntity { /** * 检测地点 */ - private String natOAddress; + private String natAddress; /** * 文件名 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java new file mode 100644 index 0000000000..6e8d252c1f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java @@ -0,0 +1,61 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.epmet.dto.form.AddIcNatFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 核酸检测信息导入excel数据 + */ +@Data +public class IcNatImportExcelData { + + @NotBlank(message = "姓名为必填项") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "手机号为必填项") + @ExcelProperty("手机号") + private String mobile; + + @NotBlank(message = "身份证号为必填项") + @ExcelProperty("身份证号") + private String idCard; + + @NotNull(message = "检测时间为必填项") + @ExcelProperty("检测时间") + private Date natTime; + + @NotBlank(message = "检测地点为必填项") + @ExcelProperty("检测地点") + private String natAddress; + + @NotBlank(message = "检测结果为必填项") + @ExcelProperty("检测结果") + private String natResultZh; + + @Data + public static class ErrorRow { + + @ExcelProperty("姓名") + @ColumnWidth(20) + private String name; + + @ExcelProperty("手机号") + @ColumnWidth(20) + private String mobile; + + @ColumnWidth(20) + @ExcelProperty("身份证号") + private String idCard; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java new file mode 100644 index 0000000000..f6c83e9440 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -0,0 +1,126 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.IcNatEntity; +import com.epmet.excel.data.IcNatImportExcelData; +import com.epmet.service.impl.IcNatServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 核酸检测excel导入监听器 + */ +@Slf4j +public class IcNatExcelImportListener implements ReadListener { + + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 2; + + private String currentUserId; + /** + * 当前组织ID + */ + private String currentAgencyId; + + private String currentAgencyPids; + + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + + private IcNatServiceImpl icNatService; + + public IcNatExcelImportListener(String currentUserId, String currentAgencyId, String currentAgencyPids, IcNatServiceImpl icNatService) { + this.currentUserId = currentUserId; + this.currentAgencyId = currentAgencyId; + this.currentAgencyPids = currentAgencyPids; + this.icNatService = icNatService; + } + + @Override + public void invoke(IcNatImportExcelData data, AnalysisContext context) { + + try { + // 先校验数据 + ValidatorUtils.validateEntity(data); + + String natResult = "0"; + String natResultZh = data.getNatResultZh(); + if (StringUtils.isNotBlank(natResultZh)) { + natResult = natResultZh.equals("阴性") ? "0" : "1"; + } + + IcNatEntity icNatEntity = ConvertUtils.sourceToTarget(data, IcNatEntity.class); + icNatEntity.setAgencyId(currentAgencyId); + icNatEntity.setPids(currentAgencyPids); + icNatEntity.setUserId(currentUserId); + icNatEntity.setUserType("other"); + icNatEntity.setNatResult(natResult); + icNatEntity.setAttachmentType(""); + icNatEntity.setAttachmentUrl(""); + datas.add(icNatEntity); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【核酸检测信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + errorRow.setName(data.getName()); + errorRow.setMobile(data.getMobile()); + errorRow.setIdCard(data.getIdCard()); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { + icNatService.batchPersist(datas); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 2da059b99f..872e178f7f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -9,6 +9,7 @@ import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.entity.IcNatEntity; +import java.nio.file.Path; import java.util.List; import java.util.Map; @@ -61,4 +62,10 @@ public interface IcNatService extends BaseService { * @Description 【核酸】核酸检测信息同步 **/ void synchro(MyNatListFormDTO formDTO); + + /** + * 执行Excel导入 + * @param filePath + */ + void execAsyncExcelImport(Path filePath, String importTaskId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 8a7061152e..6414431035 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -1,37 +1,67 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; 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.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcNatDao; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.MyNatListFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.IcNatEntity; +import com.epmet.excel.data.IcNatImportExcelData; +import com.epmet.excel.handler.IcNatExcelImportListener; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.service.IcNatService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.commons.CommonsMultipartFile; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.UUID; /** * 核酸上报记录 @@ -41,8 +71,16 @@ import java.util.Map; */ @Service @Slf4j -public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService { +public class IcNatServiceImpl extends BaseServiceImpl implements IcNatService, ResultDataResolver { + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private OssFeignClient ossFeignClient; /** * @Author sun @@ -183,4 +221,95 @@ public class IcNatServiceImpl extends BaseServiceImpl imp insert(entity); } + @Async + @Override + public void execAsyncExcelImport(Path filePath, String importTaskId) { + String userId = null; + + try { + userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + String app = EpmetRequestHolder.getHeader(AppClientConstant.APP); + String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT); + + LoginUserDetailsFormDTO ludf = new LoginUserDetailsFormDTO(app, client, userId); + LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(ludf), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), "调用user出错", ""); + + IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, loginUserDetails.getAgencyId(), loginUserDetails.getOrgIdPath(), this); + + EasyExcel.read(filePath.toFile(), IcNatImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead(); + + Path errorDescFile = null; + String errorDesFileUrl = null; + List errorRows = listener.getErrorRows(); + + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + errorDescFile = errorDescDir.resolve(fileName); + + FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); + OutputStream os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcNatImportExcelData.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + if (Files.exists(errorDescFile)) { + Files.delete(errorDescFile); + } + } + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(errorRows.size() <= 0 ? ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS : ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc(""); + importFinishTaskForm.setResultDescFilePath(errorDesFileUrl); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【核酸检测导入】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【核酸检测导入】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc("导入失败"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【核酸检测导入】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + } + + /** + * 批量持久化 + * @param entities + */ + public void batchPersist(List entities) { + insertBatch(entities); + } } \ No newline at end of file From caa1fa5408c6e788c5321ced1dee8ca737d78e49 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 29 Mar 2022 09:23:43 +0800 Subject: [PATCH 26/33] =?UTF-8?q?=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcTripReportRecordDTO.java | 13 ++----------- .../com/epmet/entity/IcTripReportRecordEntity.java | 10 ---------- .../com/epmet/excel/IcTripReportRecordExcel.java | 6 ------ 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java index 7c452c6e8f..dd9c513896 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -51,16 +52,6 @@ public class IcTripReportRecordDTO implements Serializable { */ private String userType; - /** - * 0:未加入;1:已加入 - */ - private Integer heSuanCheck; - - /** - * 最近一次通知时间 - */ - private Date latestNoticeTime; - /** * 现居地编码 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java index 6ca87717fa..ee0e00b81f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java @@ -51,16 +51,6 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity { */ private String userType; - /** - * 0:未加入;1:已加入 - */ - private Integer heSuanCheck; - - /** - * 最近一次通知时间 - */ - private Date latestNoticeTime; - /** * 现居地编码 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java index c904a6c244..446ba0075a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExcel.java @@ -35,12 +35,6 @@ public class IcTripReportRecordExcel { @Excel(name = "居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other") private String userType; - @Excel(name = "0:未加入;1:已加入") - private Integer heSuanCheck; - - @Excel(name = "最近一次通知时间") - private Date latestNoticeTime; - @Excel(name = "现居地编码") private String presentAddressCode; From d23c07ef764c2a940ec1af8b5ffe08f6d12bf919 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 29 Mar 2022 09:24:37 +0800 Subject: [PATCH 27/33] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A0=B8=E9=85=B8?= =?UTF-8?q?=E6=A3=80=E6=B5=8Bexcel=20url=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/IcNatController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index fd3d23f2f6..30e3461ae0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -163,7 +163,7 @@ public class IcNatController implements ResultDataResolver { * 导入excel * @return */ - @PostMapping("importExcel") + @PostMapping("import") public Result importExcel(MultipartFile file) { String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); From 723def7686bf9f1ba058f5aa6737f3331754c339 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 29 Mar 2022 09:38:18 +0800 Subject: [PATCH 28/33] =?UTF-8?q?=E3=80=90=E6=A0=B8=E9=85=B8=E3=80=91?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=20bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/IcNatServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index e1c2e4d395..2df0bd7017 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -46,6 +46,7 @@ import com.epmet.service.IcNoticeService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; @@ -197,7 +198,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } //3.新增通知表信息 - if (formDTO.getChannel().size() > NumConstant.ZERO) { + if (CollectionUtils.isNotEmpty(formDTO.getChannel())) { IcNatEntity icNatEntity = baseDao.selectById(formDTO.getIcNatId()); //1.获取所填居民所属组织缓存信息 AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(icNatEntity.getAgencyId()); From f0c358fdb9399083c50dd321977e970b5c57aa05 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Mar 2022 10:20:37 +0800 Subject: [PATCH 29/33] update --- .../dto/IcEpidemicSpecialAttentionDTO.java | 25 ++++++++++++++----- .../epmet/dto/form/VaccinationAddFormDTO.java | 2 -- .../IcEpidemicSpecialAttentionController.java | 12 ++++----- ...IcEpidemicSpecialAttentionServiceImpl.java | 13 ++++++++-- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java index cceed0a556..43a40b0d90 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -2,6 +2,8 @@ package com.epmet.dto; import java.io.Serializable; import java.util.Date; +import java.util.List; + import lombok.Data; import javax.validation.constraints.NotBlank; @@ -19,7 +21,8 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { private static final long serialVersionUID = 1L; - public interface IcEpidemicSpecialAttention{} + public interface IcEpidemicSpecialAttentionUpdate{} + public interface IcEpidemicSpecialAttentionAdd{} /** * ID @@ -49,30 +52,30 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { /** * 是否关注 1:关注,0:取消关注 */ - @NotNull(message = "isAttention不能为空",groups = IcEpidemicSpecialAttention.class) private Integer isAttention; /** * 关注类型,核酸检测:2,疫苗接种:1 */ - private Integer attentionType; + @NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) + private Integer attentionType; /** * 姓名 */ - @NotBlank(message = "name不能为空",groups = IcEpidemicSpecialAttention.class) + @NotBlank(message = "name不能为空",groups = IcEpidemicSpecialAttentionAdd.class) private String name; /** * 手机号 */ - @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttention.class) + @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class) private String mobile; /** * 身份证号 */ - @NotBlank(message = "idCard不能为空",groups = IcEpidemicSpecialAttention.class) + @NotBlank(message = "idCard不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) private String idCard; /** @@ -115,4 +118,14 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { */ private Date updatedTime; + /** + * 通知渠道 0小程序通知,1短信通知 + */ + private List channel; + + /** + * 通知内容 + */ + private String content; + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java index 2bc2194083..9206dbac24 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationAddFormDTO.java @@ -21,8 +21,6 @@ public class VaccinationAddFormDTO implements Serializable { private static final long serialVersionUID = -4786942219804246138L; - public interface VaccinationAddForm{} - @Valid private List list; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 42fcc20c23..14c48ce05e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -6,11 +6,7 @@ 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; -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.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.*; import com.epmet.service.IcEpidemicSpecialAttentionService; @@ -19,8 +15,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; /** @@ -58,8 +52,9 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:35 */ @PostMapping("vaccination-add") + @NoRepeatSubmit public Result vaccinationAdd(@RequestBody VaccinationAddFormDTO formDTO,@LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(formDTO, VaccinationAddFormDTO.VaccinationAddForm.class); + ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionAdd.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); icEpidemicSpecialAttentionService.vaccinationAdd(formDTO); @@ -73,7 +68,9 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:45 */ @PostMapping("vaccination-update") + @NoRepeatSubmit public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class); icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO); return new Result(); } @@ -85,6 +82,7 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:51 */ @PostMapping("cancel-attention") + @NoRepeatSubmit public Result cancelAttention(@RequestBody CancelAttentionPackageFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, CancelAttentionPackageFormDTO.CancelAttentionPackageForm.class); icEpidemicSpecialAttentionService.cancelAttention(formDTO); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index aac9eceb61..dc72e683ea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -169,7 +170,6 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl { - e.setIsAttention(NumConstant.ONE); e.setOrgId(agencyInfo.getId()); e.setPid(agencyInfo.getPid()); @@ -189,8 +189,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); + IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity(); + w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard()) + .eq(IcEpidemicSpecialAttentionEntity::getAttentionType,formDTO.getAttentionType()); + e.setMobile(formDTO.getMobile()); + e.setReason(formDTO.getReason()); + e.setRemark(formDTO.getRemark()); + update(e,w); + //TODO 通知 } /** From a1409758c84c6f74fcc7b9d3dcef4d763a847e1e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Mar 2022 10:53:36 +0800 Subject: [PATCH 30/33] export --- .../IcEpidemicSpecialAttentionController.java | 19 ++++++++-- .../java/com/epmet/excel/NatExportExcel.java | 35 +++++++++++++++++++ .../epmet/excel/VaccinationExportExcel.java | 35 +++++++++++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 14c48ce05e..a995ff482f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -2,13 +2,19 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; 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.ExcelPoiUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.*; +import com.epmet.excel.NatExportExcel; +import com.epmet.excel.UserResiRegisterVisitExcel; +import com.epmet.excel.VaccinationExportExcel; import com.epmet.service.IcEpidemicSpecialAttentionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -102,7 +108,7 @@ public class IcEpidemicSpecialAttentionController { } /** - * Desc: 【疫苗接种关注名单】导出 + * Desc: 【疫苗接种关注名单,核酸检测关注名单】导出 * @param response * @param formDTO * @param tokenDto @@ -110,10 +116,19 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:57 */ @PostMapping("vaccination-export") - public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception { ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); + formDTO.setPage(false); + PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO); + // 关注类型,核酸检测:2,疫苗接种:1 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class); + }else { + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class); + } + } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java new file mode 100644 index 0000000000..cc3d827af0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java @@ -0,0 +1,35 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class NatExportExcel { + + @Excel(name = "排序",width = 10) + private Integer sort; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "备注",width = 40) + private String remark; + + @Excel(name = "关注原因",width = 40) + private String reason; + + @Excel(name = "最近一次通知时间",width = 20) + private String lastInformTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java new file mode 100644 index 0000000000..65534756cd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java @@ -0,0 +1,35 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class VaccinationExportExcel { + + @Excel(name = "排序",width = 10) + private Integer sort; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "备注",width = 40) + private String remark; + + @Excel(name = "接种针次",width = 10) + private Integer vaccinationCount; + + @Excel(name = "最近一次通知时间",width = 20) + private String lastInformTime; + +} From c6f48c7461b08b4754f63fd34d64de9130b00320 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Mar 2022 10:56:08 +0800 Subject: [PATCH 31/33] export --- .../IcEpidemicSpecialAttentionController.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index a995ff482f..ad948c1999 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -143,21 +143,4 @@ public class IcEpidemicSpecialAttentionController { return new Result(); } - /** - * Desc: 【核酸检测关注名单】导出 - * @param response - * @param formDTO - * @param tokenDto - * @author zxc - * @date 2022/3/28 13:59 - */ - @PostMapping("nat-export") - public void natExport(HttpServletResponse response,@RequestBody NatListFormDTO formDTO,@LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setUserId(tokenDto.getUserId()); - - } - - } From 50c39d2cf29306c77db8469938b2c25a87656c38 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Mar 2022 11:14:14 +0800 Subject: [PATCH 32/33] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IcEpidemicSpecialAttentionController.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index ad948c1999..8035d509b3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -96,13 +96,13 @@ public class IcEpidemicSpecialAttentionController { } /** - * Desc: 【疫苗接种关注名单】导入 + * Desc: 【疫苗接种关注名单,核酸检测关注名单】导入 * @param * @author zxc * @date 2022/3/28 13:40 */ @PostMapping("vaccination-import") - public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file){ + public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){ return new Result(); } @@ -131,16 +131,4 @@ public class IcEpidemicSpecialAttentionController { } - /** - * Desc: 【核酸检测关注名单】导入 - * @param - * @author zxc - * @date 2022/3/28 13:40 - */ - @PostMapping("nat-import") - public Result natImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file){ - - return new Result(); - } - } From bf070bc979279110dc65464407db8e5917e07db2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 29 Mar 2022 13:34:14 +0800 Subject: [PATCH 33/33] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=99=BB=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/IcResiCollectFormDTO.java | 4 +- .../dto/form/IcResiCollectMemFormDTO.java | 10 +- .../dto/form/LatestSubmitCollectFormDTO.java | 22 ++++ .../epmet/dto/form/ResiCollectFormDTO.java | 105 ++++++++++++++++++ .../epmet/dto/result/LatestCollectResDTO.java | 82 ++++++++++++++ .../controller/IcResiCollectController.java | 32 ++++++ .../java/com/epmet/dao/IcResiCollectDao.java | 10 +- .../java/com/epmet/dao/IcResiMemberDao.java | 7 +- .../epmet/service/IcResiCollectService.java | 17 ++- .../impl/IcResiCollectServiceImpl.java | 93 +++++++++++++++- .../resources/mapper/IcResiCollectDao.xml | 32 +++++- .../main/resources/mapper/IcResiMemberDao.xml | 17 ++- 12 files changed, 414 insertions(+), 17 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java index 21f2244129..9acd851ab3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectFormDTO.java @@ -82,9 +82,9 @@ public class IcResiCollectFormDTO implements Serializable { private String address; /** - * 1自由0租住 + * 1自有0租住 */ - @NotBlank(message = "房子属于自由还是组织?", groups = {InternalShowGroup.class, ExternalShowGroup.class}) + @NotBlank(message = "房子属于自有还是租住?", groups = {InternalShowGroup.class, ExternalShowGroup.class}) private String houseType; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 2dccf23b59..a3fca9b02b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -17,13 +18,13 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1姓名 */ - // @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotBlank(message = "姓名不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String name; /** * 居住成员1身份证号 */ - // @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotBlank(message = "身份证号不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String idNum; /** @@ -43,4 +44,9 @@ public class IcResiCollectMemFormDTO implements Serializable { */ // @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private Integer ymjz; + + /** + * 社区居民信息登记-查询返参用 + */ + private String id; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java new file mode 100644 index 0000000000..547e469085 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LatestSubmitCollectFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 社区居民信息登记-查询 + */ +@Data +public class LatestSubmitCollectFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class) + private String gridId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java new file mode 100644 index 0000000000..fdd712970f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java @@ -0,0 +1,105 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 社区居民信息登记-提交 入参 + */ +@Data +public class ResiCollectFormDTO implements Serializable { + + private static final long serialVersionUID = -4026681095438180447L; + + public interface AddUserInternalGroup { + } + + public interface InternalShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户Id customer.id + */ + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 网格ID_后端接口赋值 + */ + @NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class) + private String gridId; + + /** + * 组织Id_后端接口赋值 + */ + @NotBlank(message = "agencyId不能为空", groups = AddUserInternalGroup.class) + private String agencyId; + + /** + * 组织的pid_后端接口赋值 + */ + private String pids; + + /** + * 所属小区ID + */ + @NotBlank(message = "小区不能为空", groups = InternalShowGroup.class) + private String villageId; + + /** + * 所属楼宇Id + */ + @NotBlank(message = "楼栋不能为空", groups = InternalShowGroup.class) + private String buildId; + + /** + * 单元id + */ + @NotBlank(message = "单元不能为空", groups = InternalShowGroup.class) + private String unitId; + + /** + * 所属家庭Id + */ + @NotBlank(message = "家庭不能为空", groups = InternalShowGroup.class) + private String homeId; + + /** + * 详细地址 + */ + @NotBlank(message = "家庭地址不能为空", groups = {InternalShowGroup.class}) + private String address; + + /** + * 1自有0租住 + */ + @NotBlank(message = "房子属于自有还是租住?", groups = {InternalShowGroup.class}) + private String houseType; + + /** + * 户主姓名 + */ + @NotBlank(message = "户主姓名不能为空", groups = {InternalShowGroup.class}) + private String houseHolderName; + + /** + * 居住成员人数 + */ + @NotNull(message = "居住成员人数不能为空", groups = {InternalShowGroup.class}) + private Integer totalResi; + + @Valid + @NotEmpty(message = "成员信息不能为空", groups = {InternalShowGroup.class}) + private List memberList; + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java new file mode 100644 index 0000000000..f7d698badd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCollectResDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result; + +import com.epmet.dto.form.IcResiCollectMemFormDTO; +import lombok.Data; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 社区居民信息登记-返参 + */ +@Data +public class LatestCollectResDTO implements Serializable { + private String resiCollectId; + private String agencyId; + private String agencyName; + private String pids; + private String gridId; + private String customerId; + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 详细地址 + */ + private String address; + + /** + * 1自有0租住 + */ + private String houseType; + + /** + * 户主姓名 + */ + private String houseHolderName; + + /** + * 居住成员人数 + */ + private Integer totalResi; + + @Valid + private List memberList; + + public LatestCollectResDTO() { + this.resiCollectId = ""; + this.agencyId = ""; + this.agencyName = ""; + this.pids = ""; + this.gridId = ""; + this.customerId = ""; + this.villageId = ""; + this.buildId = ""; + this.unitId=""; + this.homeId=""; + this.address=""; + this.houseType=""; + this.houseHolderName=""; + this.totalResi=0; + this.memberList=new ArrayList<>(); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java index 7b8df6ad1d..ccf831e0aa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java @@ -11,9 +11,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CollectListFormDTO; import com.epmet.dto.form.IcResiCollectFormDTO; +import com.epmet.dto.form.LatestSubmitCollectFormDTO; +import com.epmet.dto.form.ResiCollectFormDTO; import com.epmet.dto.result.CollectListExcelResultDTO; import com.epmet.dto.result.CollectListMemberExcelResultDTO; import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.dto.result.LatestCollectResDTO; import com.epmet.service.IcResiCollectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -108,4 +111,33 @@ public class IcResiCollectController { ExcelUtils.exportExcelToTarget(response, null, list, CollectListExcelResultDTO.class); } + /** + * 居民端小程序:社区居民信息登记-提交 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("save-resi") + public Result saveResi(@LoginUser TokenDto tokenDto, @RequestBody ResiCollectFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ResiCollectFormDTO.InternalShowGroup.class, ResiCollectFormDTO.AddUserInternalGroup.class); + icResiCollectService.saveResi(formDTO); + return new Result(); + } + + /** + * 居民端小程序:社区居民信息登记-查询 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("latest-submit") + public Result latestSubmit(@LoginUser TokenDto tokenDto, @RequestBody LatestSubmitCollectFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class); + return new Result().ok(icResiCollectService.latestSubmit(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java index f70f0e04ff..2602b5858a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java @@ -23,7 +23,8 @@ public interface IcResiCollectDao extends BaseDao { int updateRec(@Param("id") String id, @Param("houseType") String houseType, @Param("houseHolderName") String houseHolderName, - @Param("totalResi") Integer totalResi); + @Param("totalResi") Integer totalResi, + @Param("updatedBy") String updatedBy); /** * Desc: 查询采集居民信息 @@ -33,4 +34,11 @@ public interface IcResiCollectDao extends BaseDao { */ List getCollectList(CollectListFormDTO formDTO); + /** + * 我上次提交的主表记录 + * @param customerId + * @param userId + * @return + */ + String selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java index e4748e01b2..e61539e1da 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java @@ -1,8 +1,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcResiCollectMemFormDTO; import com.epmet.entity.IcResiMemberEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 居民信息成员表 @@ -12,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcResiMemberDao extends BaseDao { - + + List selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java index 4c0bca4fa5..9129b34675 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java @@ -4,11 +4,12 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.CollectListFormDTO; import com.epmet.dto.form.IcResiCollectFormDTO; +import com.epmet.dto.form.LatestSubmitCollectFormDTO; +import com.epmet.dto.form.ResiCollectFormDTO; import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.dto.result.LatestCollectResDTO; import com.epmet.entity.IcResiCollectEntity; -import java.util.List; - /** * 居民信息采集表 * @@ -36,4 +37,16 @@ public interface IcResiCollectService extends BaseService { */ PageData getCollectList(CollectListFormDTO formDTO); + /** + * 居民端小程序:社区居民信息登记-提交 + * @param formDTO + */ + void saveResi(ResiCollectFormDTO formDTO); + + /** + * 居民端小程序:社区居民信息登记-查询 + * @param formDTO + * @return + */ + LatestCollectResDTO latestSubmit(LatestSubmitCollectFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index b1895b608a..3343e5c4fc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -2,26 +2,30 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiCollectDao; import com.epmet.dao.IcResiMemberDao; import com.epmet.dto.IcNeighborHoodDTO; -import com.epmet.dto.form.CollectListFormDTO; -import com.epmet.dto.form.IcResiCollectFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.dto.result.LatestCollectResDTO; import com.epmet.entity.IcResiCollectEntity; import com.epmet.entity.IcResiMemberEntity; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcResiCollectService; -import org.apache.commons.collections4.MapUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -71,7 +75,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); //查询之前录入的成员表 Map memMap = queryOriginMem(origin.getId()); @@ -145,4 +149,85 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl memberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); + memberList.forEach(mem -> { + if (StringUtils.isNotBlank(mem.getName()) || StringUtils.isNotBlank(mem.getIdNum())) { + mem.setCustomerId(formDTO.getCustomerId()); + //姓名或份身份证号不为空时插入 + mem.setIcResiCollectId(insert.getId()); + icResiMemberDao.insert(mem); + } + }); + } else { + //更新主表 + baseDao.updateRec(origin.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),formDTO.getUserId()); + List newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); + //查询之前录入的成员表 + Map memMap = queryOriginMem(origin.getId()); + saveOrUpdateMem(newMemberList, memMap,origin.getId()); + } + } + + /** + * 居民端小程序:社区居民信息登记-查询 + * + * @param formDTO + * @return + */ + @Override + public LatestCollectResDTO latestSubmit(LatestSubmitCollectFormDTO formDTO) { + //张三、李四都住101房间 + //张三先登记了填写了2个成员的信息 + //李四登记后,会更新这2个成员的信息 + //李四下次进入页面,展示这2个成员。 + LatestCollectResDTO resDTO = new LatestCollectResDTO(); + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询网格信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + resDTO.setCustomerId(gridInfoCache.getCustomerId()); + resDTO.setGridId(formDTO.getGridId()); + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(gridInfoCache.getPid()); + resDTO.setAgencyId(gridInfoCache.getPid()); + resDTO.setPids(null != agencyInfoCache ? agencyInfoCache.getPids() : StrConstant.EPMETY_STR); + resDTO.setAgencyName(gridInfoCache.getAgencyName()); + String latestResiCollectId = baseDao.selectLastSubmitId(formDTO.getCustomerId(), formDTO.getUserId()); + if (StringUtils.isNotBlank(latestResiCollectId)) { + resDTO.setResiCollectId(latestResiCollectId); + //之前提交过 + IcResiCollectEntity entity = baseDao.selectById(latestResiCollectId); + if (null != entity) { + setCollectValue(resDTO, entity); + } + List memberList = icResiMemberDao.selectMySubmit(latestResiCollectId, formDTO.getUserId()); + resDTO.setMemberList(memberList); + } + return resDTO; + } + + private void setCollectValue(LatestCollectResDTO resDTO, IcResiCollectEntity entity) { + resDTO.setVillageId(entity.getVillageId()); + resDTO.setBuildId(entity.getBuildId()); + resDTO.setUnitId(entity.getUnitId()); + resDTO.setHomeId(entity.getHomeId()); + resDTO.setAddress(entity.getAddress()); + resDTO.setHouseType(entity.getHouseType()); + resDTO.setHouseHolderName(entity.getHouseHolderName()); + resDTO.setTotalResi(entity.getTotalResi()); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 0be0e43c13..98725fa04e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -55,11 +55,35 @@ UPDATE ic_resi_collect - SET UPDATED_TIME = NOW(), - HOUSE_TYPE = #{houseType}, - HOUSE_HOLDER_NAME = #{houseHolderName}, - TOTAL_RESI = #{totalResi} + SET + + HOUSE_TYPE = #{houseType}, + + + HOUSE_HOLDER_NAME = #{houseHolderName}, + + + TOTAL_RESI = #{totalResi}, + + + UPDATED_BY = #{updatedBy}, + + UPDATED_TIME = NOW() WHERE id = #{id} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml index 6423f7ecff..b76345774c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml @@ -4,5 +4,20 @@ - + \ No newline at end of file