|
|
@@ -45,14 +45,14 @@ public class ImportDataController {
|
|
|
private TSysUserService sysUserService;
|
|
|
@Resource
|
|
|
private PolicySystemService policySystemService;
|
|
|
- private final static String errorMsg_null = "excel中缺失有效数据";
|
|
|
- private final static String errorMsg_hang = "该行数据存在必填字段未输入";
|
|
|
- private final static String errorMsg_docNo = "政策文号已经存在,请勿重复填写";
|
|
|
- private final static String errorMsg_docNo_2 = "政策文号填写错误,查不到对应的政策分享数据";
|
|
|
- private final static String errorMsg_createName = "填报人或者填报人联系方式填写错误";
|
|
|
- private final static String errorMsg_yjTime = "预计完成时间格式填写错误";
|
|
|
- private final static String errorMsg_sjTime = "实际完成时间格式填写错误";
|
|
|
- private final static String errorMsg_businessNo = "项目编号填写错误,查不到对应的政策争取";
|
|
|
+ public final static String ERRORMSG_NULL = "excel中缺失有效数据";
|
|
|
+ public final static String ERRORMSG_HANG = "该行数据存在必填字段未输入";
|
|
|
+ public final static String ERRORMSG_DOCNO = "政策文号已经存在,请勿重复填写";
|
|
|
+ public final static String ERRORMSG_DOCNO_2 = "政策文号填写错误,查不到对应的政策分享数据";
|
|
|
+ public final static String ERRORMSG_CREATENAME = "填报人或者填报人联系方式填写错误";
|
|
|
+ public final static String ERRORMSG_YJTIME = "预计完成时间格式填写错误";
|
|
|
+ public final static String ERRORMSG_SJTIME = "实际完成时间格式填写错误";
|
|
|
+ public final static String ERRORMSG_BUSINESSNO = "项目编号填写错误,查不到对应的政策争取";
|
|
|
|
|
|
|
|
|
@PostMapping("/policyShare")
|
|
|
@@ -63,14 +63,14 @@ public class ImportDataController {
|
|
|
List<PolicyShareExcelVO> list = ExcelUtil.readPolicyShareFromXls(byteFromUrl);
|
|
|
|
|
|
if (list.isEmpty()) {
|
|
|
- throw new Exception(errorMsg_null);
|
|
|
+ throw new Exception(ERRORMSG_NULL);
|
|
|
}
|
|
|
list = list.stream().filter(model -> StringUtil.isNotEmpty(model.getIndex())).collect(Collectors.toList());
|
|
|
List<PolicyShareExcelVO> excelVOList = new ArrayList<>();
|
|
|
for (PolicyShareExcelVO model : list) {
|
|
|
try {
|
|
|
if (!StringUtil.checkFieldsNotEmpty(model)) {
|
|
|
- throw new Exception(errorMsg_hang);
|
|
|
+ throw new Exception(ERRORMSG_HANG);
|
|
|
}
|
|
|
|
|
|
PolicyShareVO shareVO = new PolicyShareVO();
|
|
|
@@ -82,14 +82,14 @@ public class ImportDataController {
|
|
|
wrapper.eq("DOC_NO", model.getDocNo());
|
|
|
long count = policyShareService.count(wrapper);
|
|
|
if (count > 0) {
|
|
|
- throw new Exception(errorMsg_docNo);
|
|
|
+ throw new Exception(ERRORMSG_DOCNO);
|
|
|
}
|
|
|
QueryWrapper<SysUser> userWrapper = new QueryWrapper<>();
|
|
|
userWrapper.eq("MOBILE", model.getContactPhone());
|
|
|
userWrapper.eq("NAME", model.getCreateName());
|
|
|
SysUser createUser = sysUserService.getOne(userWrapper);
|
|
|
if (StringUtil.isEmpty(createUser.getId())) {
|
|
|
- throw new Exception(errorMsg_createName);
|
|
|
+ throw new Exception(ERRORMSG_CREATENAME);
|
|
|
}
|
|
|
shareVO.setCreateId(Long.valueOf(createUser.getId()));
|
|
|
shareVO.setUpdateId(Long.valueOf(createUser.getId()));
|
|
|
@@ -120,14 +120,14 @@ public class ImportDataController {
|
|
|
List<PolicyStriveExcelVO> list = ExcelUtil.readPolicyStriveFromXls(byteFromUrl);
|
|
|
|
|
|
if (list.isEmpty()) {
|
|
|
- throw new Exception(errorMsg_null);
|
|
|
+ throw new Exception(ERRORMSG_NULL);
|
|
|
}
|
|
|
list = list.stream().filter(model -> StringUtil.isNotEmpty(model.getIndex())).collect(Collectors.toList());
|
|
|
List<PolicyStriveExcelVO> excelVOList = new ArrayList<>();
|
|
|
for (PolicyStriveExcelVO model : list) {
|
|
|
try {
|
|
|
if(!StringUtil.checkFieldsNotEmpty(model)){
|
|
|
- throw new Exception(errorMsg_hang);
|
|
|
+ throw new Exception(ERRORMSG_HANG);
|
|
|
}
|
|
|
|
|
|
PolicyStriveVO striveVO = new PolicyStriveVO();
|
|
|
@@ -137,7 +137,7 @@ public class ImportDataController {
|
|
|
Date yjFinishTime = DateUtil.parse(model.getYjFinishTime(), DateUtil.PATTERN_DATE);
|
|
|
striveVO.setYjFinishTime(yjFinishTime);
|
|
|
} catch (RuntimeException re) {
|
|
|
- throw new Exception(errorMsg_yjTime);
|
|
|
+ throw new Exception(ERRORMSG_YJTIME);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -147,7 +147,7 @@ public class ImportDataController {
|
|
|
wrapper.eq("DOC_NO", model.getDocNo());
|
|
|
long count = policyShareService.count(wrapper);
|
|
|
if (count == 0) {
|
|
|
- throw new Exception(errorMsg_docNo_2);
|
|
|
+ throw new Exception(ERRORMSG_DOCNO_2);
|
|
|
}
|
|
|
|
|
|
QueryWrapper<SysUser> userWrapper = new QueryWrapper<>();
|
|
|
@@ -155,7 +155,7 @@ public class ImportDataController {
|
|
|
userWrapper.eq("NAME", model.getCreateName());
|
|
|
SysUser createUser = sysUserService.getOne(userWrapper);
|
|
|
if (StringUtil.isEmpty(createUser.getId())) {
|
|
|
- throw new Exception(errorMsg_createName);
|
|
|
+ throw new Exception(ERRORMSG_CREATENAME);
|
|
|
}
|
|
|
striveVO.setCreateId(Long.valueOf(createUser.getId()));
|
|
|
striveVO.setUpdateId(Long.valueOf(createUser.getId()));
|
|
|
@@ -186,14 +186,14 @@ public class ImportDataController {
|
|
|
List<PolicyStriveMonthExcelVO> list = ExcelUtil.readPolicyStriveMonthFromXls(byteFromUrl);
|
|
|
|
|
|
if (list.isEmpty()) {
|
|
|
- throw new Exception(errorMsg_null);
|
|
|
+ throw new Exception(ERRORMSG_NULL);
|
|
|
}
|
|
|
list = list.stream().filter(model -> StringUtil.isNotEmpty(model.getIndex())).collect(Collectors.toList());
|
|
|
List<PolicyStriveMonthExcelVO> excelVOList = new ArrayList<>();
|
|
|
for (PolicyStriveMonthExcelVO model : list) {
|
|
|
try {
|
|
|
if (!StringUtil.checkFieldsNotEmpty(model)) {
|
|
|
- throw new Exception(errorMsg_hang);
|
|
|
+ throw new Exception(ERRORMSG_HANG);
|
|
|
}
|
|
|
|
|
|
PolicyStriveVO striveVO = new PolicyStriveVO();
|
|
|
@@ -203,7 +203,7 @@ public class ImportDataController {
|
|
|
striveWrapper.eq("BUSINESS_NO", model.getBusinessNo());
|
|
|
PolicyStrive existStrive = policyStriveService.getOne(striveWrapper);
|
|
|
if(StringUtil.isEmpty(existStrive.getId())){
|
|
|
- throw new Exception(errorMsg_businessNo);
|
|
|
+ throw new Exception(ERRORMSG_BUSINESSNO);
|
|
|
}
|
|
|
striveVO.setId(existStrive.getId());
|
|
|
|
|
|
@@ -213,7 +213,7 @@ public class ImportDataController {
|
|
|
Date sjFinishTime = DateUtil.parse(model.getSjFinishTime(), DateUtil.PATTERN_DATE);
|
|
|
striveVO.setSjFinishTime(sjFinishTime);
|
|
|
} catch (RuntimeException re) {
|
|
|
- throw new Exception(errorMsg_sjTime);
|
|
|
+ throw new Exception(ERRORMSG_SJTIME);
|
|
|
}
|
|
|
} else {
|
|
|
striveVO.setIsLand(0);
|
|
|
@@ -238,7 +238,7 @@ public class ImportDataController {
|
|
|
userWrapper.eq("NAME", model.getCreateName());
|
|
|
SysUser createUser = sysUserService.getOne(userWrapper);
|
|
|
if (StringUtil.isEmpty(createUser.getId())) {
|
|
|
- throw new Exception(errorMsg_createName);
|
|
|
+ throw new Exception(ERRORMSG_CREATENAME);
|
|
|
}
|
|
|
striveVO.setUpdateId(Long.valueOf(createUser.getId()));
|
|
|
striveVO.setUpdateTime(new Date());
|