Browse Source

程序调整

dev
sunyuchao 3 years ago
parent
commit
afa5738b9b
  1. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  2. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  3. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

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

@ -33,6 +33,10 @@ public class IcTripReportFormDTO implements Serializable {
public interface PcUpdateRequired extends CustomerClientShowGroup { public interface PcUpdateRequired extends CustomerClientShowGroup {
} }
public interface PsAdd extends CustomerClientShowGroup {
}
public interface XzzAdd extends CustomerClientShowGroup {
}
@NotBlank(message = "主键不能为空", groups = {PcUpdateRequired.class}) @NotBlank(message = "主键不能为空", groups = {PcUpdateRequired.class})
private String id; private String id;
@ -179,7 +183,7 @@ public class IcTripReportFormDTO implements Serializable {
/** /**
* 交通方式来源字典表(traffic_type) * 交通方式来源字典表(traffic_type)
*/ */
@NotBlank(message = "返回方式不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "返回方式不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
private String trafficType; private String trafficType;
/** /**
* 其他返回方式交通方式为其他时此列需要有值 * 其他返回方式交通方式为其他时此列需要有值
@ -188,19 +192,22 @@ public class IcTripReportFormDTO implements Serializable {
/** /**
* 来源地详细信息 source_address字段的说明 * 来源地详细信息 source_address字段的说明
*/ */
@NotBlank(message = "来自地区不能为空", groups = {ResiUserRequired.class}) @NotBlank(message = "来自地区不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
private String sourceDetailAddress; private String sourceDetailAddress;
/** /**
* 疫苗接种针次 (0针 1针 2针 3针)小寨子 * 疫苗接种针次 (0针 1针 2针 3针)小寨子
*/ */
@NotBlank(message = "疫苗接种针次不能为空", groups = {XzzAdd.class})
private String vaccineNum; private String vaccineNum;
/** /**
* 是否有48小时核算记录 0: 1: 小寨子 * 是否有48小时核算记录 0: 1: 小寨子
*/ */
@NotBlank(message = "48小时核算记录不能为空", groups = {XzzAdd.class})
private String isNatRecord; private String isNatRecord;
/** /**
* 户籍地 磐石 * 户籍地 磐石
*/ */
@NotBlank(message = "户籍地不能为空", groups = {PsAdd.class})
private String registeredResidence; private String registeredResidence;
/** /**
* 年龄磐石 * 年龄磐石
@ -209,10 +216,12 @@ public class IcTripReportFormDTO implements Serializable {
/** /**
* 来曹事由磐石 * 来曹事由磐石
*/ */
private String describe; @NotBlank(message = "来曹事由不能为空", groups = {PsAdd.class})
private String describeContent;
/** /**
* 48小时核算检查结果(阴性 阳性)磐石 * 48小时核算检查结果(阴性 阳性)磐石
*/ */
@NotBlank(message = "48小时核算检测不能为空", groups = {PsAdd.class})
private String natOutcome; private String natOutcome;
/** /**
* 7天内旅居史情况字典表(sojourn_history)磐石 * 7天内旅居史情况字典表(sojourn_history)磐石

20
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java

@ -116,6 +116,16 @@ public class IcTripReportRecordController implements ResultDataResolver {
if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){ if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class); ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class);
} }
//磐石客户
if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PsAdd.class);
}else {
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.XzzAdd.class);
}
//校验参数
if ("5".equals(formDTO.getTrafficType()) && StringUtils.isBlank(formDTO.getTrafficTypeExplain())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "返回方式为其他时,“其他返回方式”为必填", "返回方式为其他时,“其他返回方式”为必填");
}
String id=icTripReportRecordService.save(formDTO); String id=icTripReportRecordService.save(formDTO);
return new Result().ok(id); return new Result().ok(id);
} }
@ -170,6 +180,16 @@ public class IcTripReportRecordController implements ResultDataResolver {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"请输入正确的证件号","请输入正确的证件号"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"请输入正确的证件号","请输入正确的证件号");
} }
} }
//磐石客户
if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PsAdd.class);
}else {
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.XzzAdd.class);
}
//校验参数
if ("5".equals(formDTO.getTrafficType()) && StringUtils.isBlank(formDTO.getTrafficTypeExplain())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "返回方式为其他时,“其他返回方式”为必填", "返回方式为其他时,“其他返回方式”为必填");
}
return new Result().ok(icTripReportRecordService.resiSave(formDTO)); return new Result().ok(icTripReportRecordService.resiSave(formDTO));
} }

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

@ -206,19 +206,9 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String save(IcTripReportFormDTO formDTO) { public String save(IcTripReportFormDTO formDTO) {
//按客户校验参数
if ("5".equals(formDTO.getTrafficType()) && StringUtils.isBlank(formDTO.getTrafficTypeExplain())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "返回方式为其他时,“其他返回方式”为必填", "返回方式为其他时,“其他返回方式”为必填");
}
//磐石 //磐石
//if(StrConstant.PS_CUSTOMER_ID.equals(formDTO.getCustomerId())){ //if(StrConstant.PS_CUSTOMER_ID.equals(formDTO.getCustomerId())){
if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){ if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){
if(StringUtils.isEmpty(formDTO.getRegisteredResidence())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "户籍地为必填", "户籍地为必填");
}
if(StringUtils.isEmpty(formDTO.getNatOutcome())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "48小时核算记录为必填", "48小时核算记录为必填");
}
//判断是磐石客户的7天内旅居史情况没值的按逻辑赋值 //判断是磐石客户的7天内旅居史情况没值的按逻辑赋值
if (StringUtils.isEmpty(formDTO.getSojournHistory())) { if (StringUtils.isEmpty(formDTO.getSojournHistory())) {
//风险地区数据 //风险地区数据
@ -242,10 +232,6 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
formDTO.setSojournHistory("3");//无风险 formDTO.setSojournHistory("3");//无风险
} }
} }
}else {//其他客户
if(StringUtils.isEmpty(formDTO.getVaccineNum())||StringUtils.isEmpty(formDTO.getIsNatRecord())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "疫苗接种针次和48小时核算记录为必填", "疫苗接种针次和48小时核算记录为必填");
}
} }
//如果是单个录入的,默认数据属于当前用户所属组织id //如果是单个录入的,默认数据属于当前用户所属组织id
if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){ if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){
@ -368,19 +354,9 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String resiSave(IcTripReportFormDTO formDTO) { public String resiSave(IcTripReportFormDTO formDTO) {
//按客户校验参数
if ("5".equals(formDTO.getTrafficType()) && StringUtils.isBlank(formDTO.getTrafficTypeExplain())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "返回方式为其他时,“其他返回方式”为必填", "返回方式为其他时,“其他返回方式”为必填");
}
//磐石 //磐石
//if(StrConstant.PS_CUSTOMER_ID.equals(formDTO.getCustomerId())){ //if(StrConstant.PS_CUSTOMER_ID.equals(formDTO.getCustomerId())){
if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){ if("45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())){
if(StringUtils.isEmpty(formDTO.getRegisteredResidence())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "户籍地为必填", "户籍地为必填");
}
if(StringUtils.isEmpty(formDTO.getNatOutcome())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "48小时核算记录为必填", "48小时核算记录为必填");
}
//判断是磐石客户的7天内旅居史情况没值的按逻辑赋值 //判断是磐石客户的7天内旅居史情况没值的按逻辑赋值
if (StringUtils.isEmpty(formDTO.getSojournHistory())) { if (StringUtils.isEmpty(formDTO.getSojournHistory())) {
//风险地区数据 //风险地区数据
@ -404,10 +380,6 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
formDTO.setSojournHistory("3");//无风险 formDTO.setSojournHistory("3");//无风险
} }
} }
}else {//其他客户
if(StringUtils.isEmpty(formDTO.getVaccineNum())||StringUtils.isEmpty(formDTO.getIsNatRecord())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "疫苗接种针次和48小时核算记录为必填", "疫苗接种针次和48小时核算记录为必填");
}
} }
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfoCache) { if (null == gridInfoCache) {

Loading…
Cancel
Save