Browse Source

Merge remote-tracking branch 'origin/dev'

dev
yinzuomei 3 years ago
parent
commit
cc4c9ed2e6
  1. 4
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  2. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java
  3. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  4. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java
  5. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcVaccineImportExcelData.java
  6. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  7. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  8. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

4
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<ImportTaskCommonResultDTO> createImportTask(@RequestBody ImportTaskCommonFormDTO input);
/**

2
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<ImportTaskCommonResultDTO> createTask(@RequestBody ImportTaskCommonFormDTO input) {
ValidatorUtils.validateEntity(input, ImportTaskCommonFormDTO.Create.class);
String operatorId = input.getOperatorId();

4
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();
}
}

1
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 = "身份证号为必填项")

3
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 = "接种时间为必填项")

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

@ -99,5 +99,5 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
* 执行Excel导入
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId);
void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -424,6 +424,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
String idCard = columnAndValues.get("ID_CARD");
// 执行指定的检查
specifiedCheck(columnAndValues);
Map<String, String> existingResiMap = icResiUserDao.selectResiInfoMap(idCard, null);
if (existingResiMap == null) {
@ -526,6 +529,33 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
}
}
/**
* 执行指定的检查
* @param columnAndValues
*/
private void specifiedCheck(LinkedHashMap<String, String> columnAndValues) {
String idCard = columnAndValues.get("ID_CARD");
String mobile = columnAndValues.get("MOBILE");
List<String> 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 数据库列包装信息

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

@ -334,12 +334,8 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
@Async
@Override
public void execAsyncExcelImport(Path filePath, String importTaskId) {
String userId = null;
String customerId=null;
public void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId) {
try {
userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID);
//获取当前登录用户所属组织id
CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(customerId,userId);

Loading…
Cancel
Save