diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index 7dc71f336e..4214e77cf8 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -22,7 +22,7 @@ import java.util.Map; * @date 2020/6/4 10:28 */ @FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class) - //@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class, url = "http://192.168.1.132:8103") + //@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallbackFactory = EpmetCommonServiceOpenFeignClientFallbackFactory.class, url = "http://localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO @@ -131,7 +131,7 @@ public interface EpmetCommonServiceOpenFeignClient { * @param input * @return */ - @RequestMapping("/commonservice/import-task/create") + @PostMapping("/commonservice/import-task/create") Result createImportTask(@RequestBody ImportTaskCommonFormDTO input); /** diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java index 8af4083542..8b03c4465b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java @@ -39,7 +39,7 @@ public class ImportTaskController { * @param input * @return */ - @RequestMapping("create") + @PostMapping("create") public Result createTask(@RequestBody ImportTaskCommonFormDTO input) { ValidatorUtils.validateEntity(input, ImportTaskCommonFormDTO.Create.class); String operatorId = input.getOperatorId(); 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 663b425f4e..f6b0df98cc 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 @@ -227,7 +227,7 @@ public class IcTripReportRecordController implements ResultDataResolver { * @return */ @PostMapping("import") - public Result importExcel(MultipartFile file) { + public Result importExcel(@LoginUser TokenDto tokenDto, MultipartFile file) { String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); // 1.暂存文件 @@ -271,7 +271,7 @@ public class IcTripReportRecordController implements ResultDataResolver { "行程上报导入失败"); // 3.执行导入 - icTripReportRecordService.execAsyncExcelImport(fileSavePath, rstData.getTaskId()); + icTripReportRecordService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId()); return new Result(); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java index 385d02b171..052b0cb1eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java @@ -21,6 +21,7 @@ public class IcNatImportExcelData { @NotBlank(message = "手机号为必填项") @ExcelProperty("手机号") + @Length(max = 15, message = "手机号长度不正确,应小于15位") private String mobile; @NotBlank(message = "身份证号为必填项") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java index 6dca8bc4bb..60a83b2582 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java @@ -23,11 +23,12 @@ public class IcVaccineImportExcelData implements Serializable { @NotBlank(message = "手机号为必填项") @ExcelProperty("手机号") + @Length(max = 15, message = "手机号长度不正确") private String mobile; @NotBlank(message = "身份证号为必填项") @ExcelProperty("身份证号") - @Length(max = 18, message = "身份证号长度不正确,应小于18位") + @Length(max = 18, message = "身份证号长度不正确") private String idCard; @NotNull(message = "接种时间为必填项") 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 66ec0d9f9e..ffd9f3db8d 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 @@ -99,5 +99,5 @@ public interface IcTripReportRecordService extends BaseService existingResiMap = icResiUserDao.selectResiInfoMap(idCard, null); if (existingResiMap == null) { @@ -526,6 +529,33 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } } + /** + * 执行指定的检查 + * @param columnAndValues + */ + private void specifiedCheck(LinkedHashMap columnAndValues) { + String idCard = columnAndValues.get("ID_CARD"); + String mobile = columnAndValues.get("MOBILE"); + + List errors = new ArrayList<>(); + + if (idCard.length() > 18) { + // 身份证号超长了哦,不可以的 + errors.add("身份证号过长,限制18位"); + } + + if (StringUtils.isNotBlank(mobile) && mobile.length() > 15) { + // 手机号超长也是不可以的 + errors.add("手机号过长,限制15位"); + } + + if (errors.size() > 0) { + // 有错误 + String errorMsg = String.join(";", errors); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + /** * 持久化IC居民附加信息 * @param headerColumnWrapper 数据库列包装信息 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java index 5be16161fc..e1d29a4a43 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -334,12 +334,8 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl