|
|
@ -8,20 +8,20 @@ import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.CrudServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.vaccine.common.uitls.ValidateUtils; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicReportUserInfoDao; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInoutRecordDao; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordDetailDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicReportUserInfoDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.SelectAreaDao; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.*; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInoutRecordEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicReportUserInfoService; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInoutRecordService; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; |
|
|
@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
@ -50,9 +51,20 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Autowired |
|
|
|
private EpidemicUserInoutRecordService inoutRecordService; |
|
|
|
@Autowired |
|
|
|
private EpidemicUserInoutRecordDao inoutRecordDao; |
|
|
|
@Autowired |
|
|
|
private VaccinationInfoService vaccinationInfoService; |
|
|
|
@Autowired |
|
|
|
public EpidemicUserInfoService epidemicUserInfoService; |
|
|
|
@Autowired |
|
|
|
public EpidemicUserInoutRecordService epidemicUserInoutRecordService; |
|
|
|
@Autowired |
|
|
|
public EpidemicReportUserInfoService epidemicReportUserInfoService; |
|
|
|
@Resource |
|
|
|
public SelectAreaDao selectAreaDao; |
|
|
|
@Resource |
|
|
|
private EpidemicUserInoutRecordDao inoutRecordDao; |
|
|
|
@Resource |
|
|
|
public EpidemicReportUserInfoDao epidemicReportUserInfoDao; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public QueryWrapper<EpidemicUserInfoEntity> getWrapper(Map<String, Object> params) { |
|
|
@ -226,7 +238,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
userInoutRecordDTO.setMobile(inoutRecordEntity.getMobile()); |
|
|
|
} else { |
|
|
|
String mobile = userInoutRecordDTO.getMobile(); |
|
|
|
Boolean isMobile = ValidateUtils.validateMobilePhone(mobile); |
|
|
|
Boolean isMobile = IdentityNoUtils.validateMobilePhone(mobile); |
|
|
|
if (!isMobile) { |
|
|
|
return new Result().error("电话号格式不正确"); |
|
|
|
} |
|
|
@ -243,7 +255,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
userInoutRecordDTO.setRelationPeopleMobile(inoutRecordEntity.getRelationPeopleMobile()); |
|
|
|
} else { |
|
|
|
String peopleMobile = userInoutRecordDTO.getRelationPeopleMobile(); |
|
|
|
boolean isMobile = ValidateUtils.validateMobilePhone(peopleMobile); |
|
|
|
boolean isMobile = IdentityNoUtils.validateMobilePhone(peopleMobile); |
|
|
|
if (!isMobile) { |
|
|
|
return new Result().error("关联人联系电话格式不正确"); |
|
|
|
} |
|
|
@ -257,6 +269,74 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public Result saveNew(EpidemicReportUserInfoDTO dto) { |
|
|
|
//基础信息dto
|
|
|
|
EpidemicUserInfoEntity userInfoDTO = new EpidemicUserInfoEntity(); |
|
|
|
//录入信息dto
|
|
|
|
EpidemicUserInoutRecordEntity userInoutRecordDTO = new EpidemicUserInoutRecordEntity(); |
|
|
|
try { |
|
|
|
//拷贝出入数据
|
|
|
|
BeanUtils.copyProperties(dto, userInfoDTO); |
|
|
|
BeanUtils.copyProperties(dto, userInoutRecordDTO); |
|
|
|
//1.校验 身份证号
|
|
|
|
String idCard = dto.getIdCard(); |
|
|
|
if (StringUtils.isEmpty(idCard)) { |
|
|
|
return new Result().error("请输入身份证号"); |
|
|
|
} |
|
|
|
if (StringUtils.isEmpty(dto.getMobile())) { |
|
|
|
return new Result().error("请输入手机号"); |
|
|
|
} |
|
|
|
// 存储需要逻辑删除的身份证号
|
|
|
|
List<String> deleteIdCardArr = new ArrayList<>(); |
|
|
|
deleteIdCardArr.add(dto.getIdCard()); |
|
|
|
|
|
|
|
EpidemicUserInfoEntity userEntity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoEntity.class); |
|
|
|
EpidemicUserInoutRecordEntity userRecordEntity = ConvertUtils.sourceToTarget(dto, EpidemicUserInoutRecordEntity.class); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(dto.getDestinationAddressCode()) && StringUtils.isNotBlank(dto.getDestinationAddressName())) { |
|
|
|
userRecordEntity.setOutLiveAddressName("在境外"); |
|
|
|
userRecordEntity.setOutLiveAddressCode("1"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getLiveAddressCode())) { |
|
|
|
userRecordEntity.setLiveAddressName(selectAreaDao.getLiveArea(dto.getLiveAddressCode()).getLabel()); |
|
|
|
} |
|
|
|
|
|
|
|
epidemicUserInfoService.insert(userEntity); |
|
|
|
epidemicUserInoutRecordService.insert(userRecordEntity); |
|
|
|
} catch (RenException e) { |
|
|
|
return new Result().error(e.getMsg()); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据省名称查询code |
|
|
|
* |
|
|
|
* @param orgName |
|
|
|
* @param flag (0:非必填项;1:必填项) |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private List<OrgDto> getProvinceCodeByName(int flag, String orgName) { |
|
|
|
List<OrgDto> list = new ArrayList<>(); |
|
|
|
list = epidemicReportUserInfoDao.getProvinceCodeByName(orgName); |
|
|
|
if (flag == 1 && list.size() != 1) { |
|
|
|
// 必填
|
|
|
|
list = new ArrayList<>(); |
|
|
|
} else if (list.size() != 1) { |
|
|
|
// 非必填
|
|
|
|
list = new ArrayList<>(); |
|
|
|
OrgDto od = new OrgDto(); |
|
|
|
od.setOrgCode(""); |
|
|
|
od.setOrgName(""); |
|
|
|
list.add(od); |
|
|
|
} |
|
|
|
|
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Result updateVaccinationInfo(VaccinationInfoDTO dto) { |
|
|
|
// 查询实际接种的次数
|
|
|
@ -353,7 +433,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
* 根据人员详情id 删除基础以及人员详细表中数据 |
|
|
|
* |
|
|
|
* @param ids |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @return io.pingyin.common.utils.Result |
|
|
|
* @author wk |
|
|
|
* @date 2021-01-29 14:19 |
|
|
|
*/ |
|
|
|