Commit aa07d490 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.10' into MVP1.6.10

parents 2875a0f9 4f783f90
...@@ -217,7 +217,7 @@ public class EmployeeInsertVO extends RowIndex implements Serializable { ...@@ -217,7 +217,7 @@ public class EmployeeInsertVO extends RowIndex implements Serializable {
/** /**
* 通信地址省 * 通信地址省
*/ */
@ExcelAttribute(name = "通信地址-省",isArea = true, isNotEmpty = true) @ExcelAttribute(name = "通信地址-省",isArea = true)
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("通信地址-省") @ExcelProperty("通信地址-省")
private String contactProvince; private String contactProvince;
......
...@@ -14,7 +14,7 @@ public class EmployeeConstants { ...@@ -14,7 +14,7 @@ public class EmployeeConstants {
public static final String VALIDITY_END_FORMAT = "身份证截止日期只能为日期格式:yyyy-MM-dd或者固定值:长期"; public static final String VALIDITY_END_FORMAT = "身份证截止日期只能为日期格式:yyyy-MM-dd或者固定值:长期";
public static final String EMP_NATIONAL = "民族必填"; public static final String EMP_NATIONAL = "民族必填";
public static final String ID_PROVINCE = "户籍所在地必填"; public static final String ID_PROVINCE = "户籍所在地必填";
public static final String FILE_PROVINCE = "档案所在地必填"; public static final String FILE_PROVINCE = "档案所在地(省市县)必填";
public static final String CONTACT_PROVINCE = "通信地址(省市县)必填"; public static final String CONTACT_PROVINCE = "通信地址(省市县)必填";
public static final String EMP_REGIS_TYPE = "户口性质必填"; public static final String EMP_REGIS_TYPE = "户口性质必填";
public static final String IS_COLLEGE = "是否大专及以上必填"; public static final String IS_COLLEGE = "是否大专及以上必填";
......
...@@ -343,8 +343,9 @@ public class TEmployeeInfoController { ...@@ -343,8 +343,9 @@ public class TEmployeeInfoController {
@SysLog("批量更新人员档案") @SysLog("批量更新人员档案")
@PostMapping("/batchUpdateEmployee") @PostMapping("/batchUpdateEmployee")
@PreAuthorize("@pms.hasPermission('employee_batch_update')") @PreAuthorize("@pms.hasPermission('employee_batch_update')")
public R<List<ErrorMessage>> batchUpdateEmployee(@RequestBody MultipartFile file) { public R<List<ErrorMessage>> batchUpdateEmployee(@RequestBody MultipartFile file,
return tEmployeeInfoService.batchUpdateEmployee(file.getInputStream()); @RequestParam(name = "exportFields", required = true) String[] exportFields) {
return tEmployeeInfoService.batchUpdateEmployee(file.getInputStream(),exportFields);
} }
/** /**
......
...@@ -167,7 +167,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -167,7 +167,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
* @Date: 2022/6/22 20:30 * @Date: 2022/6/22 20:30
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/ **/
R<List<ErrorMessage>> batchUpdateEmployee(InputStream inputStream); R<List<ErrorMessage>> batchUpdateEmployee(InputStream inputStream,String[] exportFields);
void updateEducationOfEmp(EmpEducationUpdateVO education); void updateEducationOfEmp(EmpEducationUpdateVO education);
......
...@@ -21,6 +21,7 @@ import cn.hutool.core.collection.CollUtil; ...@@ -21,6 +21,7 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
...@@ -971,6 +972,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -971,6 +972,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg.add(EmployeeConstants.FILE_PROVINCE); errorMsg.add(EmployeeConstants.FILE_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE)); errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
} }
if (Common.isEmpty(employeeInfo.getFileTown())) {
errorMsg.add(EmployeeConstants.FILE_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getContactTown())) { if (Common.isEmpty(employeeInfo.getContactTown())) {
errorMsg.add(EmployeeConstants.CONTACT_PROVINCE); errorMsg.add(EmployeeConstants.CONTACT_PROVINCE);
...@@ -1620,7 +1625,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1620,7 +1625,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
@Override @Override
public R<List<ErrorMessage>> batchUpdateEmployee(InputStream inputStream) { public R<List<ErrorMessage>> batchUpdateEmployee(InputStream inputStream,String[] exportFields) {
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmployeeInsertVO> util1 = new ExcelUtil<>(EmployeeInsertVO.class); ExcelUtil<EmployeeInsertVO> util1 = new ExcelUtil<>(EmployeeInsertVO.class);
// 写法2: // 写法2:
...@@ -1669,7 +1674,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1669,7 +1674,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
if (!cachedDataList.isEmpty()) { if (!cachedDataList.isEmpty()) {
batchUpdateCore(cachedDataList, errorMessageList); batchUpdateCore(cachedDataList, errorMessageList,exportFields);
} }
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
...@@ -1685,7 +1690,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1685,7 +1690,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
private R<List<ErrorMessage>> batchUpdateCore(List<EmployeeInsertVO> excelVOList, List<ErrorMessage> errorMessageList) { private R<List<ErrorMessage>> batchUpdateCore(List<EmployeeInsertVO> excelVOList,
List<ErrorMessage> errorMessageList,
String[] exportFields) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
Set<String> errorMsg; Set<String> errorMsg;
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
...@@ -1700,6 +1707,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1700,6 +1707,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMessageList.add(new ErrorMessage(2L, errorMsg)); errorMessageList.add(new ErrorMessage(2L, errorMsg));
return R.failed(errorMessageList); return R.failed(errorMessageList);
} }
//初试化表头用于校验省市县
HashMap<String,String> headMap = new HashMap<>();
if (Common.isNotNull(exportFields)){
for (int i=0; i < exportFields.length; i++){
headMap.put(exportFields[i],exportFields[i]);
}
}
// 通用校验获取失败的数据 // 通用校验获取失败的数据
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>(); Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
...@@ -1991,6 +2006,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1991,6 +2006,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp.setContactAddress(excel.getContactAddress()); saveEmp.setContactAddress(excel.getContactAddress());
} }
} }
// 档案地和通信地址 校验
if (Common.isNotNull(headMap.get("档案所在省"))
|| Common.isNotNull(headMap.get("档案所在市"))
|| Common.isNotNull(headMap.get("档案所在县"))){
if (Common.isEmpty(excel.getFileTown())) {
errorMsg.add(EmployeeConstants.FILE_PROVINCE);
}
}
if (Common.isNotNull(headMap.get("通信地址-省"))
|| Common.isNotNull(headMap.get("通信地址-市"))
|| Common.isNotNull(headMap.get("通信地址-区/县"))){
if (Common.isEmpty(excel.getContactTown())) {
errorMsg.add(EmployeeConstants.CONTACT_PROVINCE);
}
}
if (Common.isNotNull(headMap.get("通信地址-详细地址"))){
if (Common.isEmpty(excel.getContactAddress())) {
errorMsg.add(EmployeeConstants.CONTACT_ADDRESS);
}
}
if (Common.isNotNull(excel.getRemark())) { if (Common.isNotNull(excel.getRemark())) {
if (excel.getRemark().length() > 200) { if (excel.getRemark().length() > 200) {
errorMsg.add(EmployeeConstants.REMARL_LENGTH); errorMsg.add(EmployeeConstants.REMARL_LENGTH);
......
...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; ...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
**/ **/
@Data @Data
@Component @Component
@PropertySource("classpath:ekpFundConfig.properties") @PropertySource("classpath:ekpFundConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "ekpfund", ignoreInvalidFields = false) @ConfigurationProperties(value = "ekpfund", ignoreInvalidFields = false)
public class EkpFundProperties { public class EkpFundProperties {
......
...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; ...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
**/ **/
@Data @Data
@Component @Component
@PropertySource("classpath:ekpIncomeConfig.properties") @PropertySource("classpath:ekpIncomeConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "income", ignoreInvalidFields = false) @ConfigurationProperties(value = "income", ignoreInvalidFields = false)
public class EkpIncomeProperties { public class EkpIncomeProperties {
......
...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; ...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
*/ */
@Data @Data
@Component @Component
@PropertySource("classpath:ekpInsuranceConfig.properties") @PropertySource("classpath:ekpInsuranceConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "insurance",ignoreInvalidFields = false) @ConfigurationProperties(value = "insurance",ignoreInvalidFields = false)
public class EkpInsuranceProperties { public class EkpInsuranceProperties {
......
...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; ...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
*/ */
@Data @Data
@Component @Component
@PropertySource("classpath:ekpOrderConfig.properties") @PropertySource("classpath:ekpOrderConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "ekporder",ignoreInvalidFields = false) @ConfigurationProperties(value = "ekporder",ignoreInvalidFields = false)
public class EkpOrderProperties { public class EkpOrderProperties {
......
...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; ...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
**/ **/
@Data @Data
@Component @Component
@PropertySource("classpath:ekpSalaryConfig.properties") @PropertySource("classpath:ekpSalaryConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "ekp", ignoreInvalidFields = false) @ConfigurationProperties(value = "ekp", ignoreInvalidFields = false)
public class EkpSalaryProperties { public class EkpSalaryProperties {
......
...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; ...@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
**/ **/
@Data @Data
@Component @Component
@PropertySource("classpath:ekpSocialConfig.properties") @PropertySource("classpath:ekpSocialConfig-${spring.profiles.active}.properties")
@ConfigurationProperties(value = "ekpsocial", ignoreInvalidFields = false) @ConfigurationProperties(value = "ekpsocial", ignoreInvalidFields = false)
public class EkpSocialProperties { public class EkpSocialProperties {
......
#ekpfund.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
ekpfund.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
ekpfund.fdModelId=181d741547a691aa68b16149a40de901
ekpfund.fdFlowId=18290af372be55308327273487abf72a
ekpfund.docStatus=20
ekpfund.LoginName=admin
ekpfund.docSubject=\u516C\u79EF\u91D1\u660E\u7EC6\u6570\u636E\u63A5\u53E3
#income.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
income.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
income.fdModelIdManage=181d76db26e419a88dba97b0c406689e
income.fdFlowIdManage=182d3b6e522b2690119e70d4ff082136
income.fdModelIdRisk=181d76db26e4112e14b9bb4274d06ba1
income.fdFlowIdRisk=182d3bdadab3a52be024e154e99b5f8b
income.docStatus=20
income.loginName=admin
income.docSubject=\u6536\u5165\u660E\u7EC6\u6570\u636E\u63A5\u53E3
#insurance.insuranceUrl=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
insurance.insuranceUrl=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
insurance.insuranceFdModelId=181d73279372e5a55438a47d7436ab7e
insurance.insuranceFdFlowId=18267f206233f29cbd3c5ee425c9408a
insurance.insuranceDocStatus=20
insurance.insuranceLoginName=admin
insurance.insuranceDocSubject=\u5546\u9669\u63A8\u9001ekp\u63A5\u53E3
insurance.insuranceUpdateDocSubject=\u5546\u9669\u63A8\u9001ekp\u4FEE\u6539\u63A5\u53E3
insurance.insuranceUpdateFdModelId=1850410ac0201ed20e5f09b46b0b109c
insurance.insuranceUpdateFdFlowId=185189155a87e1d4739d82b4d3c80358
#ekporder.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
ekporder.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
ekporder.orderFdModelId=182f1b7ffe2e96f975564e44e559847d
ekporder.orderFdFlowId=182f1c098ce991ca96bc927408792beb
ekporder.replyFdModelId=182f1bb35bb2156fb9a02904bc88dd8a
ekporder.replyFdFlowId=182f1c3d6f5724e335b88d544be8c993
ekporder.replyAttachKey=fd_3ac904c9342fe2
ekporder.docStatus=20
ekporder.LoginName=admin
ekporder.orderDocSubject=\u7528\u4E8E\u9879\u76EE\u8BA2\u5355\u66F4\u65B0\u63A5\u53E3
ekporder.replyDocSubject=\u7528\u4E8E\u8BA2\u5355\u56DE\u590D\u63A5\u53E3
#ekp.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
ekp.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
ekp.fdModelId=181d7633ff8bc797276d0d3a54e80ad6
ekp.fdFlowId=182b40249c1bc940d7226b941c7a4183
ekp.docStatus=20
ekp.loginName=admin
ekp.docSubject=\u85AA\u8D44\u8BA2\u5355\u660E\u7EC6\u6570\u636E\u63A5\u53E3
ekp.standardFdModelId=184326e4b122e5fa3068628470285b71
ekp.standardFdFlowId=1843272d8103adae6d332a54bce88255
ekp.backSalaryFdModelId=18433d5df69433ea9073400476c9cb8b
ekp.backSalaryFdFlowId=18433d7d9f83e800bd292984488ac770
\ No newline at end of file
ekpsocial.url=http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
#ekpsocial.url=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
ekpsocial.fdModelId=181d741547a69ba9dbc12377948e98fd
ekpsocial.fdFlowId=18233028fe91511376b00f74b3a8f3a7
ekpsocial.docStatus=20
ekpsocial.LoginName=admin
ekpsocial.docSubject=\u793E\u4FDD\u660E\u7EC6\u6570\u636E\u63A5\u53E3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment