Browse Source

Merge branch 'develop' into release_temp

master
sunyuchao 4 years ago
parent
commit
2064cae780
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  3. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  4. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  5. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  7. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  8. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java
  9. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java
  10. 29
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  11. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  12. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java
  13. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java
  14. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  15. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  16. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  17. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql
  18. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__update_ic_nat.sql
  19. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx
  20. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx
  21. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  22. 25
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  23. 3
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  24. 3
      epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -251,6 +251,7 @@ public enum EpmetErrorCode {
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
IC_NAT_IDCARD_NATTIME(8923,"核酸检测时间已存在相同记录"),
//通用错误码 start

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -78,4 +78,10 @@ public class HouseInfoDTO implements Serializable {
private String allName;
private String customerId;
private String agencyId;
/**
* eg市北区-阜新路街道-南宁社区
*/
private String agencyPathName;
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -291,4 +291,16 @@ public class HouseController implements ResultDataResolver {
return new Result();
}
/**
* 获取房屋信息
* @param houseId
* @return
*/
@PostMapping("gethouseinfo/{houseId}")
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){
if(StringUtils.isBlank(houseId)){
return new Result<>();
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId));
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -26,7 +26,6 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcHouseExcel;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
@ -79,4 +78,6 @@ public interface HouseService {
*/
void allDelete(NeighborHoodManageDelFormDTO formDTO);
HouseInfoDTO getHouseInfoDTO(String customerId,String houseId);
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -13,7 +13,9 @@ 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.feign.ResultDataResolver;
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.Result;
import com.epmet.constant.CustomerGridConstant;
@ -457,4 +459,16 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
}
}
@Override
public HouseInfoDTO getHouseInfoDTO(String customerId, String houseId) {
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId);
if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId());
houseInfo.setAgencyPathName(agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()));
} else {
houseInfo.setAgencyPathName(StrConstant.EPMETY_STR);
}
return houseInfo;
}
}

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -368,7 +368,8 @@
IFNULL(ib.LONGITUDE,'') as buildingLongitude,
IFNULL(ib.LATITUDE,'') as buildingLatitude,
ih.CUSTOMER_ID AS customerId,
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName,
n.AGENCY_ID as agencyId
FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0')
left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0')

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java

@ -68,7 +68,7 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 现居地编码
*/
@NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
@NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class})
private String presentAddressCode;
/**
@ -86,7 +86,7 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 来源地区编码
*/
@NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
@NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class})
private String sourceAddressCode;
/**

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java

@ -28,7 +28,10 @@ public class PageTripReportFormDTO extends PageFormDTO implements Serializable {
* 来源地区编码
*/
private String sourceAddressCode;
/**
* 来源地区名称
*/
private String sourceAddress;
/**
* 来到本地时间
*/

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java

@ -13,4 +13,5 @@ public class DemandUserResDTO implements Serializable {
private String gridId;
private String idCard;
private String agencyId;
private String houseId;
}

29
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java

@ -1,5 +1,6 @@
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.constant.NumConstant;
@ -7,6 +8,7 @@ import com.epmet.commons.tools.dto.form.PageFormDTO;
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.ValidatorUtils;
@ -15,7 +17,9 @@ import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.NatExportExcel;
import com.epmet.excel.NatImportExcel;
import com.epmet.excel.VaccinationExportExcel;
import com.epmet.excel.VaccinationImportExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import lombok.extern.slf4j.Slf4j;
@ -26,6 +30,9 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
@ -83,9 +90,9 @@ public class IcEpidemicSpecialAttentionController {
*/
@PostMapping("vaccination-update")
@NoRepeatSubmit
public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){
public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class);
icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO);
icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto);
return new Result();
}
@ -173,4 +180,22 @@ public class IcEpidemicSpecialAttentionController {
}
@PostMapping("export-template")
public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams();
String fileName = "";
Map<String,Object> map = new HashMap<>();
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx");
fileName = "疫苗接种关注名单导入模板";
map.put("maplist",new ArrayList<VaccinationImportExcel>());
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
templatePath.setTemplateUrl("excel/attention_nat_template.xlsx");
fileName = "核酸检测关注名单导入模板";
map.put("maplist",new ArrayList<NatImportExcel>());
}
ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response);
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java

@ -1,6 +1,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
@ -42,4 +43,10 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
* @param e
*/
void insertOrUpdate(IcNatEntity e);
/**
* @Author sun
* @Description 按条件查询业务数据
**/
IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java

@ -0,0 +1,30 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class NatImportExcel extends ExcelVerifyInfo {
@Excel(name = "姓名")
private String name;
@Excel(name = "电话")
private String mobile;
@Excel(name = "身份证")
private String idCard;
@Excel(name = "备注")
private String remark;
@Excel(name = "关注原因")
private String reason;
}

27
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java

@ -0,0 +1,27 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/3/29 10:24
* @DESC
*/
@Data
public class VaccinationImportExcel extends ExcelVerifyInfo {
@Excel(name = "姓名")
private String name;
@Excel(name = "电话")
private String mobile;
@Excel(name = "身份证")
private String idCard;
@Excel(name = "备注")
private String remark;
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java

@ -104,7 +104,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
* @author zxc
* @date 2022/3/28 13:45
*/
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO);
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto);
/**
* Desc: 取消关注

93
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.CancelAttentionPackageFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.VaccinationAddFormDTO;
import com.epmet.dto.form.VaccinationListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
@ -35,6 +32,7 @@ import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.epmet.service.IcNoticeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -71,6 +69,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private IcNoticeService noticeService;
@Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
@ -207,7 +207,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setCustomerId(formDTO.getCustomerId());
});
insertBatch(entities);
//TODO 发送通知
//新增通知表信息
List<IcEpidemicSpecialAttentionDTO> needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSedNotice)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userListBeans = ConvertUtils.sourceToTarget(needSedNotice, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userListBeans);
dto.setChannel(needSedNotice.get(NumConstant.ZERO).getChannel());
dto.setOrigin(needSedNotice.get(NumConstant.ZERO).getAttentionType().toString());
dto.setContent(needSedNotice.get(NumConstant.ZERO).getContent());
dto.setStaffId(formDTO.getUserId());
noticeService.sendNotice(dto);
}
}
/**
@ -220,7 +232,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO) {
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto) {
LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>();
IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity();
w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard())
@ -229,7 +241,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setReason(formDTO.getReason());
e.setRemark(formDTO.getRemark());
update(e,w);
//TODO 通知
if (CollectionUtils.isNotEmpty(formDTO.getChannel())){
SendNoticeFormDTO dto = new SendNoticeFormDTO();
SendNoticeFormDTO.UserListBean userListBean = ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserList(Arrays.asList(userListBean));
dto.setChannel(formDTO.getChannel());
dto.setOrigin(formDTO.getAttentionType().toString());
dto.setContent(formDTO.getContent());
dto.setStaffId(tokenDto.getUserId());
noticeService.sendNotice(dto);
}
}
/**
@ -277,7 +299,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
for (int i = 0; i < list.size(); i++) {
list.get(i).setNum(i+1);
list.get(i).setAttentionType(attentionType);
list.get(i).setChannel(getChannel(list.get(i).getChannelString()));
// list.get(i).setChannel(getChannel(list.get(i).getChannelString()));
if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "姓名不能为空",i+1));
list.get(i).setAddStatus(true);
@ -294,26 +316,28 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
continue;
}
}
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting()));
groupByIdCard.forEach((idCard,count) -> {
if (Integer.valueOf(count.toString()).compareTo(1) != 0){
for (ImportEpidemicSpecialAttention i : list) {
if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
i.setAddStatus(true);
if (list.size() > errorInfo.size()){
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting()));
groupByIdCard.forEach((idCard,count) -> {
if (Integer.valueOf(count.toString()).compareTo(1) != 0){
for (ImportEpidemicSpecialAttention i : list) {
if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
i.setAddStatus(true);
}
}
}
}
});
List<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
List<String> existList = baseDao.getExistList(attentionType, idCards);
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < list.size(); i++) {
if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum()));
list.get(i).setAddStatus(true);
continue;
});
List<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
List<String> existList = baseDao.getExistList(attentionType, idCards);
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < list.size(); i++) {
if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum()));
list.get(i).setAddStatus(true);
continue;
}
}
}
}
@ -330,6 +354,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setCustomerId(tokenDto.getCustomerId());
});
insertBatch(entities);
// send msg 产品说导入不用发通知
/*List<ImportEpidemicSpecialAttention> needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSendList)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserList(userListBeans);
dto.setChannel(needSendList.get(NumConstant.ZERO).getChannel());
dto.setOrigin(needSendList.get(NumConstant.ZERO).getAttentionType().toString());
dto.setContent(needSendList.get(NumConstant.ZERO).getContent());
dto.setStaffId(tokenDto.getUserId());
noticeService.sendNotice(dto);
}*/
}
if (CollectionUtils.isNotEmpty(errorInfo)){
String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.class);
@ -399,8 +436,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
if(CollectionUtils.isEmpty(idCardSet)){
return new ArrayList<>();
}
//关注类型,核酸检测:2,疫苗接种:1
return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO);
//关注类型,核酸检测:2,疫苗接种:1,行程上报:0
return baseDao.getIdCardList(customerId,idCardSet,NumConstant.ZERO);
}
/**

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -89,6 +89,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void add(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检查时间校验数据是否存在
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
//1.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
@ -183,6 +188,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检测时间校验除当前数据是否还存在相同数据
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
}
//1.更新核酸记录表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
entity.setId(formDTO.getIcNatId());

2
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql

@ -0,0 +1,2 @@
alter table ic_trip_report_record MODIFY COLUMN PRESENT_ADDRESS_CODE VARCHAR(32) COMMENT '现居地编码';
alter table ic_trip_report_record MODIFY COLUMN SOURCE_ADDRESS_CODE VARCHAR(32) COMMENT '来源地区编码';

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__update_ic_nat.sql

@ -0,0 +1,3 @@
ALTER TABLE `ic_nat`
DROP INDEX `unq_nat` ,
ADD UNIQUE INDEX `unq_nat` (`ID_CARD`, `NAT_TIME`, `AGENCY_ID`) USING BTREE ;

BIN
epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx

Binary file not shown.

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -24,10 +24,10 @@
a.MOBILE,
a.ID_CARD,
a.REMARK,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime,
COUNT(v.ID) AS vaccinationCount
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime,
IFNULL(v.vaccinationCount,0) AS vaccinationCount
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_vaccine v ON (v.ID_CARD = a.ID_CARD AND v.DEL_FLAG = '0')
LEFT JOIN (SELECT id_card ,count(1) AS vaccinationCount FROM ic_resi_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD) v ON (v.ID_CARD = a.ID_CARD)
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
@ -54,7 +54,7 @@
a.ID_CARD,
a.REMARK,
a.REASON,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime
FROM ic_epidemic_special_attention a
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}

25
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml

@ -68,6 +68,31 @@
ORDER BY nat_time DESC
</select>
<select id="getNatDTO" resultType="com.epmet.dto.IcNatDTO">
SELECT
id,
agency_id,
user_id,
user_type,
`name`,
mobile,
id_card,
nat_time,
nat_result,
nat_address
FROM
ic_nat
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
AND DATE_FORMAT(nat_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{natTime}, '%Y-%m-%d %h:%i')
<if test='null != icNatId and "" != icNatId'>
AND id != #{icNatId}
</if>
LIMIT 1
</select>
<delete id="delById">
DELETE FROM ic_nat WHERE id = #{icNatId}
</delete>

3
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -302,7 +302,8 @@
concat(ir.`NAME`,'(',ir.MOBILE,')')as label,
ir.grid_id as gridId,
ir.ID_CARD as idCard,
ir.AGENCY_ID as agencyId
ir.AGENCY_ID as agencyId,
ir.HOME_ID as houseId
FROM
ic_resi_user ir
WHERE

3
epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

@ -47,6 +47,9 @@
<if test='null != sourceAddressCode and "" != sourceAddressCode'>
AND SOURCE_ADDRESS_CODE like concat(#{sourceAddressCode},'%')
</if>
<if test='null != sourceAddress and "" != sourceAddress'>
AND SOURCE_ADDRESS like concat('%',#{sourceAddress},'%')
</if>
<if test='null != startDate and "" != startDate'>
AND ARRIVE_DATE <![CDATA[ >= ]]> #{startDate}
</if>

Loading…
Cancel
Save