Commit 03546ea1 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 7bc9d6db
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -38,14 +39,16 @@ public class TEmpChangeInfoVO implements Serializable { ...@@ -38,14 +39,16 @@ public class TEmpChangeInfoVO implements Serializable {
/** /**
* 员工姓名 * 员工姓名
*/ */
@NotNull(message = "员工姓名不可为空") @NotNull(message = "员工姓名不能为空")
@ExcelAttribute(name = "员工姓名",isNotEmpty = true, errorInfo = "员工姓名不能为空",maxLength = 20)
@ExcelProperty(value ="员工姓名") @ExcelProperty(value ="员工姓名")
private String empName; private String empName;
/** /**
* 身份证号 * 身份证号
*/ */
@NotNull(message = "身份证号不可为空") @NotNull(message = "身份证号不能为空")
@ExcelAttribute(name = "身份证号",isNotEmpty = true, errorInfo = "身份证号不能为空",maxLength = 20)
@ExcelProperty(value ="身份证号") @ExcelProperty(value ="身份证号")
private String empIdcard; private String empIdcard;
...@@ -53,18 +56,23 @@ public class TEmpChangeInfoVO implements Serializable { ...@@ -53,18 +56,23 @@ public class TEmpChangeInfoVO implements Serializable {
* 原项目编码 * 原项目编码
*/ */
@ExcelProperty(value ="原项目编码") @ExcelProperty(value ="原项目编码")
@NotNull(message = "原项目编码不能为空")
@ExcelAttribute(name = "原项目编码",isNotEmpty = true, errorInfo = "原项目编码不能为空",maxLength = 20)
private String oldSettleCode; private String oldSettleCode;
/** /**
* 新项目编码 * 新项目编码
*/ */
@ExcelProperty(value ="新项目编码") @ExcelProperty(value ="新项目编码")
@NotNull(message = "新项目编码不能为空")
@ExcelAttribute(name = "新项目编码",isNotEmpty = true, errorInfo = "新项目编码不能为空",maxLength = 20)
private String newSettleCode; private String newSettleCode;
/** /**
* 已产生未结算费用 0:划转 1:不划转 * 已产生未结算费用 0:划转 1:不划转
*/ */
@ExcelProperty(value ="已产生未结算费用") @ExcelProperty(value ="已产生未结算费用")
@NotNull(message = "已产生未结算费用不能为空")
private String unsettleDeal; private String unsettleDeal;
/** /**
......
...@@ -115,6 +115,26 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -115,6 +115,26 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i); TEmpChangeInfoVO excel = excelVOList.get(i);
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_START_MONTH_EXIT, excel.getNewSettleCode()));
} else if (Integer.parseInt(excel.getChangeStartMonth()) > month ) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_LESS_MONTH_EXIT, excel.getNewSettleCode()));
}
}
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getNewSettleCode())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_SEARCH_NOT_EXIST, excel.getNewSettleCode()));
}
//待划转员工已在目标结算主体下不可划转 //待划转员工已在目标结算主体下不可划转
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getNewSettleCode()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getNewSettleCode())
...@@ -129,14 +149,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -129,14 +149,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getOldSettleCode()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getOldSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL)); .eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(updateTEmployeePro)) { if (Common.isNotNull(updateTEmployeePro)) {
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda() if (CommonConstants.ONE_STRING.equals(updateTEmployeePro.getProjectStatus())) {
.eq(TSettleDomain::getDepartNo,updateTEmployeePro.getDeptNo()).eq(TSettleDomain::getDeleteFlag,CommonConstants.STATUS_NORMAL)); errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_DELETE_EXIT, excel.getOldSettleCode()));
if (Common.isNotNull(tSettleDomain)) { } else if (Common.isNotNull(tSettleDomain)) {
updateTEmployeePro.setDeptNo(tSettleDomain.getDepartNo()); updateTEmployeePro.setDeptNo(tSettleDomain.getDepartNo());
updateTEmployeePro.setDeptId(tSettleDomain.getId()); updateTEmployeePro.setDeptId(tSettleDomain.getId());
updateTEmployeePro.setDeptName(tSettleDomain.getDepartName()); updateTEmployeePro.setDeptName(tSettleDomain.getDepartName());
TCustomerInfo tCustomerInfo = tCustomerInfoService.getById(tSettleDomain.getCustomerId()); TCustomerInfo tCustomerInfo = tCustomerInfoService.getById(tSettleDomain.getCustomerId());
if(Common.isNotNull(tCustomerInfo)) {; if (Common.isNotNull(tCustomerInfo)) {
updateTEmployeePro.setUnitId(tCustomerInfo.getId()); updateTEmployeePro.setUnitId(tCustomerInfo.getId());
updateTEmployeePro.setUnitNo(tCustomerInfo.getCustomerCode()); updateTEmployeePro.setUnitNo(tCustomerInfo.getCustomerCode());
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName()); updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
...@@ -146,6 +166,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -146,6 +166,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId()); TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
} }
} else {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_SEARCH_EXIT, excel.getOldSettleCode()));
} }
} else { } else {
// 数据不合法 // 数据不合法
......
...@@ -275,6 +275,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -275,6 +275,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
return R.failed("存在草稿/已审核的状态的项目,不允许同步减档"); return R.failed("存在草稿/已审核的状态的项目,不允许同步减档");
} }
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
code = CommonConstants.ONE_STRING; code = CommonConstants.ONE_STRING;
} }
......
...@@ -317,4 +317,7 @@ public interface CommonConstants { ...@@ -317,4 +317,7 @@ public interface CommonConstants {
* @author fxj * @author fxj
*/ */
int THREE_INT_NEGATE = -3; int THREE_INT_NEGATE = -3;
// 是否
String IS_CHANGE = "划转";
} }
...@@ -307,4 +307,21 @@ public interface ErrorCodes { ...@@ -307,4 +307,21 @@ public interface ErrorCodes {
* 不良记录费用损失和其他损失不可同时为空 * 不良记录费用损失和其他损失不可同时为空
*/ */
String ARCHIVES_PROJECT_EMP_LOSE_FEE_NOT_EMPTY = "archives.project.emp.lose.fee.not.empty"; String ARCHIVES_PROJECT_EMP_LOSE_FEE_NOT_EMPTY = "archives.project.emp.lose.fee.not.empty";
/**
* 划转起始月不能为空
*/
String CHANGE_START_MONTH_EXIT = "change.strat.month.exit";
/**
* 划转起始月要小于等于当前月
*/
String CHANGE_LESS_MONTH_EXIT = "change.less.month.exit";
/**
* 未找到该人员的项目档案,请核实
*/
String PROJECT_PERSON_SEARCH_EXIT = "project.person.search.exit";
/**
* 该人员项目档案已减项,不允许划转
*/
String PROJECT_PERSON_DELETE_EXIT = "project.person.delete.exit";
} }
...@@ -101,6 +101,12 @@ archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u63 ...@@ -101,6 +101,12 @@ archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u63
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=\u5B58\u5728\u5176\u4ED6\u8349\u7A3F/\u5DF2\u5BA1\u6838\u7684\u72B6\u6001\u7684\u9879\u76EE\uFF0C\u4E0D\u5141\u8BB8\u540C\u6B65\u51CF\u6863
project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\uFF0C\u8BF7\u6838\u5B9E 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
change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708
project.person.search.exit=\u672A\u627E\u5230\u8BE5\u4EBA\u5458\u7684\u9879\u76EE\u6863\u6848\uFF0C\u8BF7\u6838\u5B9E
project.person.delete.exit=\u8BE5\u4EBA\u5458\u9879\u76EE\u6863\u6848\u5DF2\u51CF\u9879\uFF0C\u4E0D\u5141\u8BB8\u5212\u8F6C
......
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