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 9c461a1f18..4072db576c 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 @@ -20,6 +20,7 @@ public interface ImportTaskConstants { String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination"; String BIZ_TYPE_IC_PARTY_MEMBER = "ic_party_member"; String IC_POINT_NUCLEIC_MONITORING = "ic_point_nucleic_monitoring"; + String IC_POINT_VACCINES_INOCULATION = "ic_point_vaccines_inoculation"; /** * 核酸检测 */ 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 08991d8a8b..b94b1b252a 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 @@ -169,6 +169,16 @@ public interface UserMessageTypeConstant { */ String ANTIEPIDEMIC="antiepidemic"; + /** + * 核酸检测点通知 + */ + String NUCLEIC="nucleic"; + + /** + * 疫苗接种点通知 + */ + String VACCINES="vaccines"; + /** * 发布党建声音 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgListTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgListTreeResultDTO.java new file mode 100644 index 0000000000..d6df3d9b87 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgListTreeResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + + +import com.epmet.commons.tools.utils.NodeTree; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OrgListTreeResultDTO extends NodeTree implements Serializable { + + private static final long serialVersionUID = -1993037593855768962L; + + /** + * 父id + */ + private String pid; + + /** + * 名字 + */ + private String label; + + /** + * 值 + */ + private String value; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index e917eacf59..b6a6ec5ec4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -467,6 +467,18 @@ public class AgencyController { return new Result>().ok(agencyService.getCommunityList(tokenDto)); } + /** + * Desc: 查询工作人员所属组织下的所有街道社区 + * + * @param tokenDto + * @author wgf + * @date 2022/6/23 09:13 + */ + @PostMapping("getOrgTreeListByCustomerId") + public Result> getOrgTreeListByCustomerId(@LoginUser TokenDto tokenDto) { + return new Result>().ok(agencyService.getOrgTreeListByCustomerId(tokenDto)); + } + /** * 通讯录树状结构 * diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 24008e536e..153ffb26fe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -475,5 +475,17 @@ public class CustomerAgencyController { return customerAgencyService.getCommunityInfo(orgName); } + /** + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 根据用户ID查询所属组织信息 + * @Date 2022/6/21 22:41 + **/ + @GetMapping("getCommunityInfoByUserId/{userId}") + public Result getCommunityInfoByUserId(@PathVariable("userId") String userId) { + return customerAgencyService.getCommunityInfoByUserId(userId); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 17fb8356f3..0a6875acbc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -331,6 +331,8 @@ public interface CustomerAgencyDao extends BaseDao { */ List getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto); + List getOrgTreeListByCustomerId(@Param("customerId") String customerId); + /** * 通讯录树 * @@ -346,5 +348,7 @@ public interface CustomerAgencyDao extends BaseDao { List getDelAgencyIdList(@Param("agencyId") String agencyId); CommunityInfoResultDTO getCommunityInfo(@Param("orgName") String orgName); + + CommunityInfoResultDTO getCommunityInfoByUserId(@Param("userId") String userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index ea43abd53e..34bd0c7b55 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -150,6 +150,15 @@ public interface AgencyService { */ List getCommunityList(TokenDto tokenDto); + /** + * Desc: 查询工作人员所属组织下的所有街道社区 + * + * @param tokenDto + * @author wgf + * @date 2022/6/23 09:13 + */ + List getOrgTreeListByCustomerId(TokenDto tokenDto); + /** * 通讯录树状结构 * @@ -160,4 +169,4 @@ public interface AgencyService { * @date 2022/5/16 10:43 */ List getAddressTree(String name, String customerId); -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index d6651bc29b..bc950586a9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -327,4 +327,13 @@ public interface CustomerAgencyService extends BaseService * @Date 2022/6/21 22:41 **/ Result getCommunityInfo(String orgName); + + /** + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 根据用户ID查询所属组织信息 + * @Date 2022/6/21 22:41 + **/ + Result getCommunityInfoByUserId(String userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index ceee6804eb..aff8e76bb3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -870,6 +870,15 @@ public class AgencyServiceImpl implements AgencyService { return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId); } + @Override + public List getOrgTreeListByCustomerId(TokenDto tokenDto) { + if (null == tokenDto.getCustomerId()) { + throw new EpmetException("未查询到工作人员信息"); + } + List list = customerAgencyDao.getOrgTreeListByCustomerId(tokenDto.getCustomerId()); + return NodeTreeUtils.build(list); + } + /** * 通讯录树 * diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 7c6cfa6d50..3b6317e4f4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1573,4 +1573,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl().ok(communityInfoResultDTO); } + @Override + public Result getCommunityInfoByUserId(String userId) { + CommunityInfoResultDTO communityInfoResultDTO = baseDao.getCommunityInfoByUserId(userId); + + return new Result().ok(communityInfoResultDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index e5d635d88f..a167a9e803 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -756,6 +756,16 @@ AND CUSTOMER_ID = #{customerId} AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%') + + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointVaccinesInoculationDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointVaccinesInoculationDTO.java index d1f397a84b..2d1c465ecb 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointVaccinesInoculationDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointVaccinesInoculationDTO.java @@ -79,7 +79,7 @@ public class IcPointVaccinesInoculationDTO implements Serializable { /** * 暂无疫苗(1:是;2:否) */ - private Integer noAvailableVaccines; + private String noAvailableVaccines; /** * 咨询电话 @@ -102,7 +102,7 @@ public class IcPointVaccinesInoculationDTO implements Serializable { private String latitude; /** - * + * */ private Integer delFlag; @@ -131,4 +131,4 @@ public class IcPointVaccinesInoculationDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MapInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MapInfoFormDTO.java new file mode 100644 index 0000000000..d97acc0d24 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MapInfoFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 获取地图信息入参 + * + * @author wgf + * @since v1.0.0 2022-06-20 + */ +@Data +public class MapInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 地点类型(1:核酸检测点; 2:疫苗接种点) + */ + @NotBlank(message = "地点类型不能为空") + private String type; + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空") + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空") + private String latitude; + + /** + * 地点名称 + */ + private String name; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendPointNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendPointNoticeFormDTO.java new file mode 100644 index 0000000000..52eb7ca00a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendPointNoticeFormDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author wgf + * @Date 2022/3/28 14:14 + */ +@NoArgsConstructor +@Data +public class SendPointNoticeFormDTO implements Serializable { + private static final long serialVersionUID = 4800907725063604885L; + private String customerId; + private String staffId; + /** + * 用户列表 + */ + private List userList; + /** + * 通知渠道通知渠道 0小程序通知,1短信通知 + */ + @NotEmpty(message = "请选择通知渠道", groups = CustomerClientShowGroup.class) + private List channel; + /** + * 通知来源 0 行程上报,1 疫苗接种,2 核酸检测,3核酸检测点,4疫苗接种点 + */ + @NotEmpty(message = "通知来源不能为空", groups = CustomerClientShowGroup.class) + private String origin; + /** + * 通知内容 + */ + @Size(min = 1, max = 500, message = "通知内容不超过500字", groups = CustomerClientShowGroup.class) + private String content; + /** + * 组织名 + */ + 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-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java new file mode 100644 index 0000000000..896d1195fc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取地图信息返参 + * + * @author wgf + * @since v1.0.0 2022-06-20 + */ +@Data +public class MapInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 时间随机数标识 + */ + private Integer markerId; + + /** + * 疫苗接种点名称 + */ + private String name; + + /** + * 距离当前位置千米数 + */ + private String km; + + /** + * 暂无疫苗(1:是;2:否) + */ + private String noAvailableVaccines; + + /** + * 距离(1:1公里以内;3:3公里以内;5:5公里以内;99:5公里以外) + */ + private String kmNum; + + /** + * 日期 + */ + private String date; + + /** + * 上午时间 + */ + private String moTime; + + /** + * 下午时间 + */ + private String afTime; + + /** + * 电话 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SendPointNoticeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SendPointNoticeResultDTO.java new file mode 100644 index 0000000000..04f8b2b4f9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SendPointNoticeResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author wgf + * @Date 2022/3/28 14:14 + */ +@Data +public class SendPointNoticeResultDTO implements Serializable { + private static final long serialVersionUID = 4800907725063604885L; + + + /** + * 用户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 ab0529b158..325eb71c31 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 @@ -4,6 +4,7 @@ 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.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -14,10 +15,16 @@ 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.dto.form.SendPointNoticeFormDTO; +import com.epmet.dto.result.CommunityInfoResultDTO; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.IcNoticeService; +import com.epmet.service.IcResiUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 防疫通知 @@ -32,6 +39,12 @@ public class IcNoticeController { @Autowired private IcNoticeService icNoticeService; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + @Autowired + private IcResiUserService icResiUserService; + @RequestMapping("page") public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -80,4 +93,19 @@ public class IcNoticeController { return new Result(); } + @PostMapping("sendPointNotice") + public Result sendPointNotice(@LoginUser TokenDto tokenDto, @RequestBody SendPointNoticeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerClientShowGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + // 查询用户列表 + Result communityInfoResultDTOResult = govOrgFeignClient.getCommunityInfoByUserId(tokenDto.getUserId()); + // 能点击发送按钮的人肯定有社区ID + String communityId = communityInfoResultDTOResult.getData().getDeptId(); + List userList = icResiUserService.getUserListByCommunityId(communityId); + formDTO.setUserList(userList); + icNoticeService.sendPointNotice(formDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java new file mode 100644 index 0000000000..babae7655b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java @@ -0,0 +1,47 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +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.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; +import com.epmet.service.IcPointAppService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 核酸监测点 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-20 + */ +@RestController +@RequestMapping("appPoint") +@Slf4j +public class IcPointAppController { + + @Autowired + private IcPointAppService icPointAppService; + + /** + * 根据地点类型获取地图数据 + * @param formDTO + * @return + */ + @PostMapping("getMapInfoByPointType") + public Result> getMapInfoByPointType(@RequestBody MapInfoFormDTO formDTO){ + // 效验数据 + ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); + + return icPointAppService.getMapInfoByPointType(formDTO); + } + + + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java index b1bc4385a3..c320c5cb56 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java @@ -18,9 +18,11 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPointNucleicMonitoringDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.result.CommunityInfoResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcPointNucleicMonitoringExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.IcPointNucleicMonitoringService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; @@ -52,9 +54,13 @@ public class IcPointNucleicMonitoringController { @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @RequestMapping("page") public Result> page(@RequestParam Map params){ - PageData page = icPointNucleicMonitoringService.page(params); +// PageData page = icPointNucleicMonitoringService.page(params); + PageData page = icPointNucleicMonitoringService.getPhrasePage(params); return new Result>().ok(page); } @@ -65,7 +71,7 @@ public class IcPointNucleicMonitoringController { } @NoRepeatSubmit - @PostMapping("save") + @PostMapping public Result save(@RequestBody IcPointNucleicMonitoringDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -74,7 +80,7 @@ public class IcPointNucleicMonitoringController { } @NoRepeatSubmit - @PutMapping("update") + @PutMapping public Result update(@RequestBody IcPointNucleicMonitoringDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -96,6 +102,16 @@ public class IcPointNucleicMonitoringController { ExcelUtils.exportExcelToTarget(response, null, list, IcPointNucleicMonitoringExcel.class); } + /** + * 获取【发送通知】按钮显示隐藏状态 + * @param tokenDto + * @return + */ + @PostMapping("getShowType") + public Result getShowType(@LoginUser TokenDto tokenDto){ + return govOrgFeignClient.getCommunityInfoByUserId(tokenDto.getUserId()); + } + /** * Desc: 【核酸检测点】导入 @@ -103,8 +119,8 @@ public class IcPointNucleicMonitoringController { * @author wgf * @date 2022/6/21 13:40 */ - @PostMapping("pointNucleicMonitoringImport") - public Result pointNucleicMonitoringImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){ + @PostMapping("pointImport") + public Result pointImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){ if (file.isEmpty()) { throw new EpmetException("请上传文件"); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java index 79e71f1dd8..141bb3e75d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java @@ -1,7 +1,12 @@ package com.epmet.controller; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetException; 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.AssertUtils; @@ -9,13 +14,22 @@ 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.constants.ImportTaskConstants; import com.epmet.dto.IcPointVaccinesInoculationDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcPointVaccinesInoculationExcel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcPointVaccinesInoculationService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FilenameUtils; 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.io.InputStream; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -28,14 +42,19 @@ import java.util.Map; */ @RestController @RequestMapping("icPointVaccinesInoculation") +@Slf4j public class IcPointVaccinesInoculationController { @Autowired private IcPointVaccinesInoculationService icPointVaccinesInoculationService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @RequestMapping("page") public Result> page(@RequestParam Map params){ - PageData page = icPointVaccinesInoculationService.page(params); +// PageData page = icPointVaccinesInoculationService.page(params); + PageData page = icPointVaccinesInoculationService.getPhrasePage(params); return new Result>().ok(page); } @@ -46,7 +65,7 @@ public class IcPointVaccinesInoculationController { } @NoRepeatSubmit - @PostMapping("save") + @PostMapping() public Result save(@RequestBody IcPointVaccinesInoculationDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -55,7 +74,7 @@ public class IcPointVaccinesInoculationController { } @NoRepeatSubmit - @PutMapping("update") + @PutMapping() public Result update(@RequestBody IcPointVaccinesInoculationDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -77,6 +96,57 @@ public class IcPointVaccinesInoculationController { ExcelUtils.exportExcelToTarget(response, null, list, IcPointVaccinesInoculationExcel.class); } + /** + * Desc: 【疫苗接种点】导入 + * @param + * @author wgf + * @date 2022/6/21 13:40 + */ + @PostMapping("pointImport") + public Result pointImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){ + if (file.isEmpty()) { + throw new EpmetException("请上传文件"); + } + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new EpmetException("文件类型不匹配"); + } + + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOriginFileName(file.getOriginalFilename()); + importTaskForm.setOperatorId(tokenDto.getUserId()); + importTaskForm.setBizType(ImportTaskConstants.IC_POINT_VACCINES_INOCULATION); + Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm); + if (!result.success()) { + throw new EpmetException(9999,"存在进行中的导入"); + } + InputStream inputStream = null; + try { + inputStream = file.getInputStream(); + }catch (Exception e){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(tokenDto.getUserId()); + input.setTaskId(result.getData().getTaskId()); + input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + commonServiceOpenFeignClient.finishImportTask(input); + log.error("读取文件失败"); + } + icPointVaccinesInoculationService.importFile(tokenDto,inputStream,result.getData().getTaskId()); + return new Result(); + } + + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams("excel/ic_point_vaccines_inoculation.xlsx"); + ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"疫苗接种点录入表",response); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java index 563d33553d..995ac2a81e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java @@ -1,10 +1,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPointNucleicMonitoringDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; import com.epmet.entity.IcPointNucleicMonitoringEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; /** * 核酸监测点 @@ -21,4 +25,18 @@ public interface IcPointNucleicMonitoringDao extends BaseDao getAllAddressName(); + /** + * 条件查询 + * @param params + * @return + */ + List getPhrasePage(Map params); + + /** + * 获取地图信息 + * @param formDTO + * @return + */ + List getMapInfoList(MapInfoFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java index 4541f80cde..debf41daeb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java @@ -1,9 +1,15 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPointVaccinesInoculationDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; import com.epmet.entity.IcPointVaccinesInoculationEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + /** * 疫苗接种点 * @@ -12,5 +18,25 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPointVaccinesInoculationDao extends BaseDao { - -} \ No newline at end of file + + /** + * 获取所有地点名称 + * @return + */ + List getAllAddressName(); + + /** + * 条件查询 + * @param params + * @return + */ + List getPhrasePage(Map params); + + /** + * 获取地图信息 + * @param formDTO + * @return + */ + List getMapInfoList(MapInfoFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index f145fadd97..1208d07507 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; -import com.epmet.dto.form.EpidemicPreventionFormDTO; -import com.epmet.dto.form.MoveOutMemberFormDTO; -import com.epmet.dto.form.RentTenantDataFormDTO; -import com.epmet.dto.form.ResiUserQueryValueDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; @@ -370,4 +367,11 @@ public interface IcResiUserDao extends BaseDao { * @return com.epmet.entity.IcResiUserEntity */ IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + + /** + * 通过社区ID获取所属人员 + * @param communityId + * @return + */ + List getUserListByCommunityId(@Param("communityId") String communityId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java index c08d24575f..3f31a38485 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java @@ -79,7 +79,7 @@ public class IcPointVaccinesInoculationEntity extends BaseEpmetEntity { /** * 暂无疫苗(1:是;2:否) */ - private Integer noAvailableVaccines; + private String noAvailableVaccines; /** * 咨询电话 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java index 08bbb31df3..e88e19b906 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java @@ -51,7 +51,7 @@ public class IcPointVaccinesInoculationExcel { private String afEndTime; @Excel(name = "暂无疫苗(1:是;2:否)") - private Integer noAvailableVaccines; + private String noAvailableVaccines; @Excel(name = "咨询电话") private String mobile; @@ -84,4 +84,4 @@ public class IcPointVaccinesInoculationExcel { private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationImportExcel.java new file mode 100644 index 0000000000..bbc7e202b9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationImportExcel.java @@ -0,0 +1,71 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; +import lombok.Data; + +/** + * 疫苗接种点 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-20 + */ +@Data +public class IcPointVaccinesInoculationImportExcel { + +// @Excel(name = "所属组织名称") +// private String orgName; + + @Excel(name = "疫苗接种点名称") + private String name; + + @Excel(name = "接种日期") + private String inoculationDate; + + @Excel(name = "接种上午开始时间") + private String moStartTime; + + @Excel(name = "接种上午结束时间") + private String moEndTime; + + @Excel(name = "接种下午开始时间") + private String afStartTime; + + @Excel(name = "接种下午结束时间") + private String afEndTime; + + @Excel(name = "暂无疫苗", replace = {"否_1","是_2"}) + private String noAvailableVaccines; + + @Excel(name = "咨询电话") + private String mobile; + + @Excel(name = "接种点地址") + private String address; + + @ExcelIgnore + private Boolean addStatus = false; + + @ExcelIgnore + private Integer num; + + /** + * 所属组织ID + */ +// @ExcelIgnore +// private String orgId; + + /** + * 组织ID上级 + */ +// @ExcelIgnore +// private String pid; + + /** + * 组织ID所有上级 + */ +// @ExcelIgnore +// private String pids; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/PointVaccinesInoculationErrorModel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/PointVaccinesInoculationErrorModel.java new file mode 100644 index 0000000000..7f7d3c3109 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/PointVaccinesInoculationErrorModel.java @@ -0,0 +1,50 @@ +package com.epmet.excel.error; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author wgf + * @DateTime 2022/6/21 16:57 + * @DESC + */ +@Data +public class PointVaccinesInoculationErrorModel { + + @Excel(name = "行号",width = 10) + private Integer num; + +// @Excel(name = "所属组织名称",width = 30) +// private String orgName; + + @Excel(name = "核酸监测点名称",width = 30) + private String name; + + @Excel(name = "接种日期",width = 30) + private String inoculationDate; + + @Excel(name = "接种上午开始时间",width = 30) + private String moStartTime; + + @Excel(name = "接种上午结束时间",width = 30) + private String moEndTime; + + @Excel(name = "接种下午开始时间",width = 30) + private String afStartTime; + + @Excel(name = "接种下午结束时间",width = 30) + private String afEndTime; + + @Excel(name = "暂无疫苗",width = 20, replace = {"否_1","是_2"}) + private String noAvailableVaccines; + + @Excel(name = "电话",width = 30) + private String mobile; + + @Excel(name = "监测点地址",width = 40) + private String address; + + @Excel(name = "错误信息", width = 200) + private String errorMsg; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index b364fa689d..4d97431514 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -74,4 +74,14 @@ public interface GovOrgFeignClient { @GetMapping("/gov/org/customeragency/getCommunityInfo/{orgName}") Result getCommunityInfo(@PathVariable("orgName") String orgName); + /** + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 根据社区名称查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customeragency/getCommunityInfoByUserId/{userId}") + Result getCommunityInfoByUserId(@PathVariable("userId") String userId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index f01da41601..b2968f313f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -45,4 +45,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result getCommunityInfo(String orgName) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfo",orgName); } + + @Override + public Result getCommunityInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfoByUserId",userId); + } } 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 3f72855558..9c65229972 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 @@ -5,6 +5,7 @@ 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.dto.form.SendPointNoticeFormDTO; import com.epmet.entity.IcNoticeEntity; import java.util.Date; @@ -89,6 +90,16 @@ public interface IcNoticeService extends BaseService { */ void sendNotice(SendNoticeFormDTO formDTO); + /** + * 发送通知(疫苗,核酸地点) + * + * @Param formDTO + * @Return + * @Author wgf + * @Date 2022/6/23 14:19 + */ + void sendPointNotice(SendPointNoticeFormDTO formDTO); + /** * 获取人员最新一条通知 * @Param idCard @@ -104,4 +115,4 @@ public interface IcNoticeService extends BaseService { * @return */ Map getUserLatestNoticeTime(String customerId,List idCardSet); -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java new file mode 100644 index 0000000000..6d6f7626d9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java @@ -0,0 +1,33 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +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.dto.IcPointNucleicMonitoringDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; +import com.epmet.entity.IcPointNucleicMonitoringEntity; +import org.springframework.web.bind.annotation.RequestBody; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +/** + * 地图信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-20 + */ +public interface IcPointAppService { + + /** + * 根据地点类型获取地图数据 + * @param formDTO + * @return + */ + Result> getMapInfoByPointType(MapInfoFormDTO formDTO); + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java index d74f89f861..8aaf21fe7d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java @@ -4,6 +4,8 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPointNucleicMonitoringDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; import com.epmet.entity.IcPointNucleicMonitoringEntity; import java.io.InputStream; @@ -28,6 +30,13 @@ public interface IcPointNucleicMonitoringService extends BaseService page(Map params); + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + /** * 默认查询 * @@ -86,4 +95,14 @@ public interface IcPointNucleicMonitoringService extends BaseService + * @author wgf + * @date 2022-06-20 + */ + List getMapInfoList(MapInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java index f9bd63cc05..9dc56f6779 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java @@ -2,9 +2,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPointVaccinesInoculationDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.MapInfoResultDTO; import com.epmet.entity.IcPointVaccinesInoculationEntity; +import java.io.InputStream; import java.util.List; import java.util.Map; @@ -26,6 +30,13 @@ public interface IcPointVaccinesInoculationService extends BaseService page(Map params); + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + /** * 默认查询 * @@ -75,4 +86,25 @@ public interface IcPointVaccinesInoculationService extends BaseService + * @author wgf + * @date 2022-06-20 + */ + List getMapInfoList(MapInfoFormDTO formDTO); + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 3ef76601bc..51619b8579 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -436,4 +436,11 @@ public interface IcResiUserService extends BaseService { * @Date 2022/6/16 15:30 */ List getUserId(String icResiUserId); + + /** + * 根据社区ID获取该社区下的所有用户 + * @param communityId + * @return + */ + List getUserListByCommunityId(String communityId); } 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 28fd02753b..1abb00b5f3 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 @@ -16,10 +16,7 @@ import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcNoticeDao; import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.UserBaseInfoDTO; -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.dto.form.*; import com.epmet.entity.IcNoticeEntity; import com.epmet.feign.MessageFeignClient; import com.epmet.service.IcNoticeService; @@ -197,6 +194,91 @@ public class IcNoticeServiceImpl extends BaseServiceImpl userBeanList = formDTO.getUserList().stream().collect(Collectors.collectingAndThen( + Collectors.toCollection(() -> new TreeSet<>( + Comparator.comparing( SendPointNoticeFormDTO.UserListBean::getIdCard))), ArrayList::new)); + List entityList = userBeanList.stream().map(item -> { + IcNoticeEntity entity = new IcNoticeEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setChannel(channel); + entity.setContent(formDTO.getContent()); + entity.setOrigin(formDTO.getOrigin()); + entity.setUserId(item.getUserId()); + entity.setMobile(item.getMobile()); + entity.setIdCard(item.getIdCard()); + entity.setOrgName(finalOrgName); + return entity; + }).collect(Collectors.toList()); + insertBatch(entityList); + + //通知 + List msgList = new ArrayList<>(); + //短信消息 + List smsList = new ArrayList<>(); + + entityList.forEach(item -> { + if (StringUtils.isNotBlank(item.getIdCard())) { + //根据身份证获取居民ID + List userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard()); + if (CollectionUtils.isNotEmpty(userList)) { + userList.forEach(user -> { + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(item.getCustomerId()); + messageFormDTO.setApp(AppClientConstant.APP_GOV); + messageFormDTO.setGridId(StrConstant.STAR); + messageFormDTO.setUserId(user.getUserId()); + messageFormDTO.setTitle("您有一条通知消息!"); + messageFormDTO.setMessageContent(item.getContent()); + messageFormDTO.setReadFlag(Constant.UNREAD); + if("3".equals(formDTO.getOrigin())){ + // 核酸检测点 + messageFormDTO.setMessageType(UserMessageTypeConstant.NUCLEIC); + }else{ + // 疫苗接种点 + messageFormDTO.setMessageType(UserMessageTypeConstant.VACCINES); + } + 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)); + } + //TODO 发送短信 + } + /** * 获取人员最新一条通知 * @@ -244,4 +326,4 @@ public class IcNoticeServiceImpl extends BaseServiceImpl> getMapInfoByPointType(MapInfoFormDTO formDTO) { + List mapInfoResultDTO = new ArrayList(); + // 地点类型(1:核酸检测点; 2:疫苗接种点) + if("1".equals(formDTO.getType())){ + // 核酸检测点地图数据 + mapInfoResultDTO = icPointNucleicMonitoringService.getMapInfoList(formDTO); + + }else if("2".equals(formDTO.getType())){ + // 疫苗接种点地图数据 + mapInfoResultDTO = icPointVaccinesInoculationService.getMapInfoList(formDTO); + } + return new Result>().ok(mapInfoResultDTO); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java index 9256d6f9fa..a5dacb5bc6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java @@ -22,7 +22,9 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPointNucleicMonitoringDao; import com.epmet.dto.IcPointNucleicMonitoringDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.MapInfoFormDTO; import com.epmet.dto.result.CommunityInfoResultDTO; +import com.epmet.dto.result.MapInfoResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.entity.IcPointNucleicMonitoringEntity; @@ -85,6 +87,18 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl getPhrasePage(Map params) { + IPage page = getPage(params); + List list = baseDao.getPhrasePage(params); + return new PageData<>(list, page.getTotal()); + } + @Override public List list(Map params) { List entityList = baseDao.selectList(getWrapper(params)); @@ -229,7 +243,7 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl getMapInfoList(MapInfoFormDTO formDTO) { + List list = baseDao.getMapInfoList(formDTO); + return list; + } + + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java index 1d5dca7b45..9b89513936 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java @@ -1,24 +1,57 @@ package com.epmet.service.impl; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPointVaccinesInoculationDao; import com.epmet.dto.IcPointVaccinesInoculationDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.MapInfoFormDTO; +import com.epmet.dto.result.CommunityInfoResultDTO; +import com.epmet.dto.result.MapInfoResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.IcPointVaccinesInoculationEntity; +import com.epmet.excel.IcPointVaccinesInoculationImportExcel; +import com.epmet.excel.error.PointVaccinesInoculationErrorModel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.redis.IcPointVaccinesInoculationRedis; import com.epmet.service.IcPointVaccinesInoculationService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +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.apache.poi.ss.usermodel.Workbook; 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.util.Arrays; -import java.util.List; -import java.util.Map; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.*; +import java.util.stream.Collectors; /** * 疫苗接种点 @@ -27,11 +60,21 @@ import java.util.Map; * @since v1.0.0 2022-06-20 */ @Service +@Slf4j public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl implements IcPointVaccinesInoculationService { @Autowired private IcPointVaccinesInoculationRedis icPointVaccinesInoculationRedis; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + @Autowired + private OssFeignClient ossFeignClient; + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -41,6 +84,18 @@ public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl getPhrasePage(Map params) { + IPage page = getPage(params); + List list = baseDao.getPhrasePage(params); + return new PageData<>(list, page.getTotal()); + } + @Override public List list(Map params) { List entityList = baseDao.selectList(getWrapper(params)); @@ -84,4 +139,226 @@ public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl errorInfo = new ArrayList<>(); + + try { + List list = ExcelPoiUtils.importExcel(inputStream, 0,1,IcPointVaccinesInoculationImportExcel.class); + if (CollectionUtils.isEmpty(list)){ + closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + return; + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId()); + } + // 获取所有地点名称 + List addressList = baseDao.getAllAddressName(); + for (int i = 0; i < list.size(); i++) { + list.get(i).setNum(i+1); +// if (StringUtils.isBlank(list.get(i).getOrgName()) && !list.get(i).getAddStatus()){ +// errorInfo.add(getErrorInfo(list.get(i), "所属组织名称不能为空",i+1)); +// list.get(i).setAddStatus(true); +// continue; +// } + if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "核酸监测点名称不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getInoculationDate()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "接种日期不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getMoStartTime()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "接种上午开始时间不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getMoEndTime()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "接种上午结束时间不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getAfStartTime()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "接种下午开始时间不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getAfEndTime()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "接种下午结束时间不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (list.get(i).getNoAvailableVaccines() == null && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "暂无疫苗不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getMobile()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "咨询电话不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getAddress()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "监测点地址不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + // 校验数据库是否存在该地点名称 + if (addressList.contains(list.get(i).getName()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "核酸监测点名称已存在",i+1)); + list.get(i).setAddStatus(true); + continue; + } + + // 校验所属组织通过名称能否匹配到ID +// Result resultDTOResult = govOrgFeignClient.getCommunityInfo(list.get(i).getOrgName()); +// CommunityInfoResultDTO communityInfoResultDTO = resultDTOResult.getData(); +// if(communityInfoResultDTO == null && !list.get(i).getAddStatus()){ +// errorInfo.add(getErrorInfo(list.get(i), "所属组织匹配失败",i+1)); +// list.get(i).setAddStatus(true); +// continue; +// }else{ +// list.get(i).setOrgId(communityInfoResultDTO.getDeptId()); +// list.get(i).setPid(communityInfoResultDTO.getPid()); +// list.get(i).setPids(communityInfoResultDTO.getPids()); +// } + + } + if (list.size() > errorInfo.size()){ + Map groupByName = list.stream().collect(Collectors.groupingBy(IcPointVaccinesInoculationImportExcel::getName, Collectors.counting())); + groupByName.forEach((name,count) -> { + if (Integer.valueOf(count.toString()).compareTo(1) != 0){ + for (IcPointVaccinesInoculationImportExcel i : list) { + if (name.equals(i.getName()) && !i.getAddStatus()){ + errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); + i.setAddStatus(true); + } + } + } + }); + } + Map> groupByStatus = list.stream().collect(Collectors.groupingBy(IcPointVaccinesInoculationImportExcel::getAddStatus)); + List needInsert = groupByStatus.get(false); + if (CollectionUtils.isNotEmpty(needInsert)){ + List entities = ConvertUtils.sourceToTarget(needInsert, IcPointVaccinesInoculationEntity.class); + entities.forEach(e -> { + // 设置客户ID + e.setCustomerId(tokenDto.getCustomerId()); + }); + insertBatch(entities); + } + if (CollectionUtils.isNotEmpty(errorInfo)){ + String url = importOssUpload(errorInfo, PointVaccinesInoculationErrorModel.class); + closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url); + }else { + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,""); + } + }catch (Exception e){ + log.error(e.getMessage()); + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + } + } + + /** + * Desc: 关闭任务 + * @param taskId + * @param userId + * @param status + * @param url + * @author wgf + * @date 2022/3/30 09:05 + */ + public void closeTask(String taskId,String userId,String status,String url){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(userId); + input.setTaskId(taskId); + input.setProcessStatus(status); + input.setResultDescFilePath(url); + commonServiceOpenFeignClient.finishImportTask(input); + } + + /** + * Desc: 构造错误信息 + * @param dto + * @param info + * @param num + * @author wgf + * @date 2022/3/29 17:17 + */ + public PointVaccinesInoculationErrorModel getErrorInfo(IcPointVaccinesInoculationImportExcel dto, String info, Integer num){ + PointVaccinesInoculationErrorModel result = ConvertUtils.sourceToTarget(dto, PointVaccinesInoculationErrorModel.class); + result.setErrorMsg(info); + result.setNum(num); + return result; + } + + /** + * Desc: 文件上传并返回url + * @param errorRows + * @param tClass + * @author zxc + * @date 2022/3/30 09:16 + */ + public String importOssUpload(Collection errorRows, Class tClass) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"), + tClass, errorRows); + + // 文件名 + String resultDescFileName = UUID.randomUUID().toString().concat(".xls"); + + FileItemFactory factory = new DiskFileItemFactory(16, null); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName); + OutputStream os = fileItem.getOutputStream(); + Result uploadResult = null; + try { + workbook.write(os); + uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件:{}", errormsg); + } finally { + try { + os.close(); + } catch (IOException e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件关闭输出流:{}", errormsg); + } + try { + fileItem.delete(); + } catch (Exception e) { + String errormsg = ExceptionUtils.getErrorStackTrace(e); + log.error("上传错误描述文件删除临时文件:{}", errormsg); + } + } + + if (uploadResult == null || !uploadResult.success()) { + log.error("调用OSS上传结果描述文件失败"); + return null; + } + return uploadResult.getData().getUrl(); + } + + @Override + public List getMapInfoList(MapInfoFormDTO formDTO) { + List list = baseDao.getMapInfoList(formDTO); + return list; + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index a7d1183196..80f5a27910 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -2631,4 +2631,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getAllUserIds(String idCard, String customerId) { return baseDao.getAllUserIds(idCard, customerId); } + + @Override + public List getUserListByCommunityId(String communityId) { + List userList = baseDao.getUserListByCommunityId(communityId); + List list = ConvertUtils.sourceToTarget(userList,SendPointNoticeFormDTO.UserListBean.class); + return list; + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_nucleic_monitoring.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_nucleic_monitoring.xlsx index 5afef2dc0a..bec686be9d 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_nucleic_monitoring.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_nucleic_monitoring.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_vaccines_inoculation.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_vaccines_inoculation.xlsx new file mode 100644 index 0000000000..3901ecd5f4 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_point_vaccines_inoculation.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml index 2cb4e10db6..490a890faa 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml @@ -31,5 +31,65 @@ where DEL_FLAG = 0 + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml index 4d9d2fa764..d44fa7358c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml @@ -29,5 +29,77 @@ + - \ No newline at end of file + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index edb2455bee..2d9dc76c92 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1132,4 +1132,16 @@ AND customer_id = #{customerId} AND DEL_FLAG = '0' + +