diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java index aedf4def93..4d956d1fca 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java @@ -13,4 +13,5 @@ public interface IcResiUserConstant { */ String USER_TYPE_RESI="resi"; String USER_TYPE_IC_RESI="icresi"; + String USER_TYPE_OTHER="other"; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java index 0088bb3183..45fc03e76b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java @@ -9,7 +9,9 @@ import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * 行程上报居民端入参 @@ -22,6 +24,12 @@ public class IcTripReportFormDTO implements Serializable { public interface ResiUserRequired extends CustomerClientShowGroup { } + public interface PcInternalGroup { + } + public interface PcRequired extends CustomerClientShowGroup { + } + public interface IcResiInternalGroup { + } /** * 客户Id */ @@ -30,49 +38,54 @@ public class IcTripReportFormDTO implements Serializable { /** * 姓名 */ - @NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String name; /** * 手机号 */ - @NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String mobile; /** * 身份证号 */ - @NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String idCard; + /** + * 是否添加到核算检测关注名单,true加入;默认false不加入 + */ + @NotNull(message = "是否添加到核算检测关注名单", groups = {PcRequired.class}) + private Boolean heSuanCheck; /** * 现居地编码 */ - @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String presentAddressCode; /** * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 */ - @NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String presentAddress; /** * 详细地址 */ - @NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String detailAddress; /** * 来源地区编码 */ - @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String sourceAddressCode; /** * 来源地区地址 */ - @NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class}) + @NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private String sourceAddress; /** @@ -80,7 +93,7 @@ public class IcTripReportFormDTO implements Serializable { */ @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") - @NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class}) + @NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class,PcRequired.class}) private Date arriveDate; /** @@ -93,23 +106,56 @@ public class IcTripReportFormDTO implements Serializable { /** * 备注信息 */ - @Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class}) + @Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class,PcRequired.class}) private String remark; - @NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class}) + /** + * userType=icresi时,必填,取值居民所属的网格ID; + * 居民端小程序上报前端赋值当前用户所在的网格id + */ + @NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class,IcResiInternalGroup.class}) private String gridId; - //后端自己赋值 /** * 用户id + * 居民端上报时后端自己赋值 + * pc录入如果是从居民信息选择,此列有值 */ + @NotBlank(message = "userId不能为空", groups = {IcResiInternalGroup.class}) private String userId; /** * 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other + * 居民端上报是后端赋值; + * pc录入是前端赋值 */ + @NotBlank(message = "数字社区的居民:icresi;其他:other", groups = {PcInternalGroup.class}) private String userType; + /** + * userType=icresi时,必填。 + * 居民所属的组织id + */ + @NotBlank(message = "agencyId不能为空", groups = {IcResiInternalGroup.class}) + private String agencyId; + + /** + * pc录入时用 + */ + private String currentStaffId; + + /** + * pc录入时用 + * 通知渠道 0小程序通知,1短信通知 + */ + private List channel = new ArrayList<>(); + /** + * pc录入时用 + * 通知内容 + */ + private String content = ""; + + } 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 index 0d038cf71a..c4113e4f9b 100644 --- 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 @@ -18,6 +18,7 @@ import java.util.List; public class SendNoticeFormDTO implements Serializable { private static final long serialVersionUID = 4800907725063604885L; private String customerId; + private String staffId; /** * 用户列表 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java index e0ea875623..0639371186 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java @@ -40,9 +40,9 @@ public class EpidemicPreventionResultDTO implements Serializable { /** * 疫苗接种次数 */ - private Double vaccineCount; + private Integer vaccineCount; /** * 核酸检测次数 */ - private Double natCount; + private Integer natCount; } 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 30e3461ae0..95814147cb 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 @@ -6,22 +6,19 @@ 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.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; 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.constant.NumConstant; 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.ExcelUtils; +import com.epmet.commons.tools.utils.FileUtils; 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.commons.tools.validator.group.UpdateGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.AddIcNatFormDTO; @@ -33,8 +30,6 @@ 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 lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -42,16 +37,14 @@ import org.springframework.http.HttpHeaders; 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 javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; +import java.nio.file.Path; import java.util.List; -import java.util.Map; import java.util.UUID; @@ -263,6 +256,7 @@ public class IcNatController implements ResultDataResolver { PageData data = null; do { data = icNucleinService.natList(formDTO); + data.getList().forEach(o->o.setNatResult(NumConstant.ONE_STR.equals(o.getNatResult())?"阳性":"阴性")); formDTO.setPageNo(++pageNo); excelWriter.write(data.getList(), writeSheet); } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize()); 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 eb40b5fe23..b0b8a31553 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 @@ -74,6 +74,7 @@ public class IcNoticeController { public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); icNoticeService.sendNotice(formDTO); 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 index 45fe80dc05..0e7ee6b100 100644 --- 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 @@ -8,7 +8,6 @@ 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.constant.IcResiUserConstant; @@ -59,16 +58,20 @@ public class IcTripReportRecordController { /** * pc: 行程上报-新增 - * @param dto + * @param formDTO * @return */ @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcTripReportRecordDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icTripReportRecordService.save(dto); - return new Result(); + public Result save(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcRequired.class,IcTripReportFormDTO.PcInternalGroup.class); + if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){ + ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class); + } + String id=icTripReportRecordService.save(formDTO); + return new Result().ok(id); } @NoRepeatSubmit 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 index 001b3d65e4..5c8142cfbe 100644 --- 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 @@ -50,14 +50,14 @@ public interface IcTripReportRecordService extends BaseService page(PageTripReportFormDTO formDTO) { //1.获取工作人员缓存信息 - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); - if (null == staffInfo) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); - } + CustomerStaffInfoCacheResult staffInfo=queryCurrentStaff(formDTO.getCustomerId(),formDTO.getUserId()); formDTO.setAgencyId(staffInfo.getAgencyId()); //2.按条件查询业务数据 PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage()) @@ -86,6 +84,14 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl list(Map params) { List entityList = baseDao.selectList(getWrapper(params)); @@ -108,11 +114,69 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userList = new ArrayList<>(); + //注意这里的userId是指的pc平台的居民 + userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserList(userList); + dto.setChannel(formDTO.getChannel()); + //通知来源 0 行程上报,1 疫苗接种,2 核酸检测 + dto.setOrigin(NumConstant.ZERO_STR); + dto.setContent(formDTO.getContent()); + dto.setOrgName(agencyInfoCache.getOrganizationName()); + icNoticeService.sendNotice(dto); + } + return entity.getId(); + } + + /** + * 加入核算检测关注 + * @param formDTO + */ + private void vaccinationAdd(IcTripReportFormDTO formDTO) { + VaccinationAddFormDTO vaccinationAddFormDTO=new VaccinationAddFormDTO(); + vaccinationAddFormDTO.setCustomerId(formDTO.getCustomerId()); + vaccinationAddFormDTO.setUserId(formDTO.getCurrentStaffId()); + List list =new ArrayList<>(); + IcEpidemicSpecialAttentionDTO dto=new IcEpidemicSpecialAttentionDTO(); + dto.setName(formDTO.getName()); + dto.setIdCard(formDTO.getIdCard()); + dto.setMobile(formDTO.getMobile()); + //避免再发通知,赋值个空集合吧 + dto.setChannel(Collections.emptyList()); + //关注类型,核酸检测:2,疫苗接种:1;行程上报:0 + dto.setAttentionType(NumConstant.ZERO); + list.add(dto); + vaccinationAddFormDTO.setList(list); + epidemicSpecialAttentionService.vaccinationAdd( vaccinationAddFormDTO); } @Override