Commit 9864817b authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 59333327 b7ea25da
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import lombok.Data;
import java.io.Serializable;
/**
* 项目档案更新记录需要的信息
*
* @author huyc
* @date 2022-06-20 17:54:40
*/
@Data
public class EmployeeProjectNewOldVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 变更前的项目档案
*/
private TEmployeeProject oldProjectEmployee;
/**
* 变更后的项目档案
*/
private TEmployeeProject newProjectEmployee;
}
......@@ -115,7 +115,7 @@ public class EmployeeProjectUpdateVO extends RowIndex implements Serializable {
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期",maxLength = 4)
@ExcelAttribute(name = "入职日期")
@ExcelProperty(value ="入职日期")
@Past
@DateTimeFormat("yyyy-MM-dd")
......
......@@ -109,6 +109,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
}
List<TEmployeeProject> updateList = new ArrayList<>();
Set<String> errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
......@@ -120,21 +121,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmpChangeInfoVO excel = excelVOList.get(i);
if (Common.isNotNull(excel.getChangeStartMonth()) && excel.getChangeStartMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
errorMsg.add("第" + (i + 2) + "行划转起始月长度不能超过6位");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月长度不能超过6位"));
errorMsg.add("划转起始月长度不能超过6位");
}
if (!Common.isEmpty(excel.getChangeStartMonth()) && !PATTERN.matcher(excel.getChangeStartMonth()).matches()) {
errorMsg.add("第" + (i + 2) + "行划转起始月格式错误");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月格式错误"));
errorMsg.add("划转起始月格式错误");
}
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add("第" + (i + 2) + "行划转起始月不能为空");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月不能为空"));
errorMsg.add("划转起始月不能为空");
} else if (PATTERN.matcher(excel.getChangeStartMonth()).matches()) {
if (Integer.parseInt(excel.getChangeStartMonth()) > Integer.parseInt(DateUtil.getThisMonth())) {
errorMsg.add("第" + (i + 2) + "行划转起始月要小于等于当前月");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月要小于等于当前月"));
errorMsg.add("划转起始月要小于等于当前月");
}
}
}
......@@ -174,7 +171,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitNo(tCustomerInfo.getCustomerCode());
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
}
tEmployeeProjectService.updateById(updateTEmployeePro);
updateList.add(updateTEmployeePro);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
......@@ -182,13 +179,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
} else {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_SEARCH_EXIT, excel.getOldSettleCode()));
}
} else {
// 数据不合法
}
if (!CollUtil.isEmpty(errorMsg)) {
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
} else {
tEmployeeProjectService.updateBatchById(updateList);
}
return R.ok();
}
......
......@@ -296,7 +296,7 @@ public interface ErrorCodes {
*/
String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist";
/**
* 存在其他草稿/已审核的状态的项目,不允许同步减档
* 该人员存在其他进行中的项目,禁止同步减档!
*/
String QT_PROJECT_CHANGE_NOT_EXIST = "qt.project.change.not.exist";
/**
......
......@@ -98,7 +98,7 @@ archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B
archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A
qt.project.change.not.exist=\u5B58\u5728\u5176\u4ED6\u8349\u7A3F/\u5DF2\u5BA1\u6838\u7684\u72B6\u6001\u7684\u9879\u76EE\uFF0C\u4E0D\u5141\u8BB8\u540C\u6B65\u51CF\u6863
qt.project.change.not.exist=\u8BE5\u4EBA\u5458\u5B58\u5728\u5176\u4ED6\u8FDB\u884C\u4E2D\u7684\u9879\u76EE\uFF0C\u7981\u6B62\u540C\u6B65\u51CF\u6863
project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\uFF0C\u8BF7\u6838\u5B9E
change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A
......
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