Commit 5bcdad22 authored by fangxinjiang's avatar fangxinjiang

批量办理 100%

parent b4afd0dd
...@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
...@@ -110,12 +111,14 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -110,12 +111,14 @@ public class TEmployeeContractInfo extends BaseEntity {
@NotBlank(message = "合同起始时间不能为空") @NotBlank(message = "合同起始时间不能为空")
@ExcelAttribute(name = "合同起始时间", needExport = true) @ExcelAttribute(name = "合同起始时间", needExport = true)
@Schema(description = "合同起始时间", name = "contractStart") @Schema(description = "合同起始时间", name = "contractStart")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private Date contractStart; private Date contractStart;
/** /**
* 合同到期时间 * 合同到期时间
*/ */
@ExcelAttribute(name = "合同到期时间", needExport = true) @ExcelAttribute(name = "合同到期时间", needExport = true)
@Schema(description = "合同到期时间", name = "contractEnd") @Schema(description = "合同到期时间", name = "contractEnd")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private Date contractEnd; private Date contractEnd;
/** /**
* 项目名称 * 项目名称
...@@ -204,6 +207,7 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -204,6 +207,7 @@ public class TEmployeeContractInfo extends BaseEntity {
*/ */
@ExcelAttribute(name = "入职日期") @ExcelAttribute(name = "入职日期")
@Schema(description = "入职日期", name = "enjoinDate") @Schema(description = "入职日期", name = "enjoinDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime enjoinDate; private LocalDateTime enjoinDate;
/** /**
...@@ -291,12 +295,14 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -291,12 +295,14 @@ public class TEmployeeContractInfo extends BaseEntity {
*/ */
@ExcelAttribute(name = "试用期开始时间") @ExcelAttribute(name = "试用期开始时间")
@Schema(description = "合同试用期开始时间", name = "periodStart") @Schema(description = "合同试用期开始时间", name = "periodStart")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date periodStart; private Date periodStart;
/** /**
* 合同试用期结束时间 * 合同试用期结束时间
*/ */
@ExcelAttribute(name = "试用期结束时间") @ExcelAttribute(name = "试用期结束时间")
@Schema(description = "合同试用期结束时间", name = "periodEnd") @Schema(description = "合同试用期结束时间", name = "periodEnd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date periodEnd; private Date periodEnd;
/** /**
* 试用期工资元/月 * 试用期工资元/月
......
...@@ -291,7 +291,7 @@ public class TEmployeeContractInfoController { ...@@ -291,7 +291,7 @@ public class TEmployeeContractInfoController {
@Operation(summary = "通过id查询", description = "通过id查询员工合同") @Operation(summary = "通过id查询", description = "通过id查询员工合同")
@Inner @Inner
@PostMapping("/getContractById") @PostMapping("/getContractById")
public R<TEmployeeContractInfo> getContractById(@RequestBody String id) { public TEmployeeContractInfo getContractById(@RequestBody String id) {
return R.ok(tEmployeeContractInfoService.getById(id)); return tEmployeeContractInfoService.getById(id);
} }
} }
...@@ -420,6 +420,8 @@ public interface CommonConstants { ...@@ -420,6 +420,8 @@ public interface CommonConstants {
public static final int TWENTY_INT = 20; public static final int TWENTY_INT = 20;
public static final int TWENTY_ONE_STRING = 21;
public static final String ERROR_MSG_PRFIX = "error="; public static final String ERROR_MSG_PRFIX = "error=";
public static final String SUCCESS_MSG_PREFIX = "success="; public static final String SUCCESS_MSG_PREFIX = "success=";
......
...@@ -449,11 +449,19 @@ public interface ErrorCodes { ...@@ -449,11 +449,19 @@ public interface ErrorCodes {
*/ */
String EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR = "emp.dispatch.social.date.limit.error"; String EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR = "emp.dispatch.social.date.limit.error";
/** /**
* 派增异常: 社保各项起缴月份需为可补缴月份,请确认后操作 * 派增异常: 社保各项起缴月份需为可补缴月份,请确认后操作
*/ */
String EMP_DISPATCH_SOCIAL_START_IS_ERROR = "emp.dispatch.social.start.is.error"; String EMP_DISPATCH_SOCIAL_START_IS_ERROR = "emp.dispatch.social.start.is.error";
/** /**
* 派增异常: 公积金起缴月份需为可补缴月份,请确认后操作 * 派增异常: 公积金起缴月份需为可补缴月份,请确认后操作
*/ */
String EMP_DISPATCH_FUND_DATE_LIMIT_ERROR = "emp.dispatch.fund.start.is.error"; String EMP_DISPATCH_FUND_DATE_LIMIT_ERROR = "emp.dispatch.fund.start.is.error";
/**
* 派增异常: 合同相关信息不可为空
*/
String EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY = "emp.dispatch.emp.contract.not.empty";
/**
* 派增异常: 系统无对应项目档案,档案相关同色字段必填
*/
String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty";
} }
...@@ -171,6 +171,9 @@ emp.dispatch.social.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u ...@@ -171,6 +171,9 @@ emp.dispatch.social.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u
emp.dispatch.fund.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u516C\u79EF\u91D1\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01 emp.dispatch.fund.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u516C\u79EF\u91D1\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01
emp.dispatch.emp.contract.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.emp.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u7CFB\u7EDF\u65E0\u5BF9\u5E94\u9879\u76EE\u6863\u6848\uFF0C\u6863\u6848\u76F8\u5173\u540C\u8272\u5B57\u6BB5\u5FC5\u586B
......
...@@ -156,7 +156,7 @@ public class ArchivesDaprUtil { ...@@ -156,7 +156,7 @@ public class ArchivesDaprUtil {
public R<TEmployeeContractInfo> getContractById(String id) { public R<TEmployeeContractInfo> getContractById(String id) {
R<TEmployeeContractInfo> res = HttpDaprUtil.invokeMethodPost( R<TEmployeeContractInfo> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId() daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeeinfo/inner/getContractById" , id, TEmployeeContractInfo.class, SecurityConstants.FROM_IN); ,"/temployeecontractinfo/getContractById" , id, TEmployeeContractInfo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取档案信息失败!"); return R.failed("获取档案信息失败!");
} }
......
...@@ -761,7 +761,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -761,7 +761,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchInfo dispatch; TDispatchInfo dispatch;
dispatch = new TDispatchInfo(); dispatch = new TDispatchInfo();
dispatch.setOrganName(user.getDeptName()); dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getNickname()); dispatch.setCreateBy(user.getId());
dispatch.setCreateTime(LocalDateTime.now()); dispatch.setCreateTime(LocalDateTime.now());
dispatch.setContractSubName(excel.getContractSubName()); dispatch.setContractSubName(excel.getContractSubName());
dispatch.setContractName(excel.getContractName()); dispatch.setContractName(excel.getContractName());
...@@ -821,6 +821,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -821,6 +821,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setFileTown(empVo.getFileTown()); dispatch.setFileTown(empVo.getFileTown());
dispatch.setContractId(empVo.getContractId()); dispatch.setContractId(empVo.getContractId());
dispatch.setEmpType(empVo.getEmpNatrue()); dispatch.setEmpType(empVo.getEmpNatrue());
dispatch.setSettleDomainCode(empVo.getDeptNo());
dispatch.setSettleDomain(empVo.getDeptId());
if (Common.isNotNull(empVo.getIdProvince())){ if (Common.isNotNull(empVo.getIdProvince())){
dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince())); dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity())); dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
...@@ -846,6 +848,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -846,6 +848,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo)){ if (Common.isNotNull(empVo)){
fund.setEmpId(empVo.getId()); fund.setEmpId(empVo.getId());
fund.setEmpNo(empVo.getEmpNo()); fund.setEmpNo(empVo.getEmpNo());
fund.setSettleDomain(empVo.getDeptId());
} }
fund.setEmpIdcard(excel.getEmpIdcard()); fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName()); fund.setEmpName(excel.getEmpName());
...@@ -1144,7 +1147,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1144,7 +1147,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
.eq(SysBaseSetInfo::getBaseType, CommonConstants.ZERO_STRING) .eq(SysBaseSetInfo::getBaseType, CommonConstants.ZERO_STRING)
.le(SysBaseSetInfo::getApplyStartDate, now) .le(SysBaseSetInfo::getApplyStartDate, now)
.in(SysBaseSetInfo::getDepartName,socialholds) .in(SysBaseSetInfo::getDepartName,socialholds)
.eq(SysBaseSetInfo::getStatus,CommonConstants.ZERO_STRING)
.eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING) .eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.and(obj-> obj.isNotNull(SysBaseSetInfo::getApplyEndDate).or().ge(SysBaseSetInfo::getApplyEndDate,now))
.groupBy(SysBaseSetInfo::getDepartName)); .groupBy(SysBaseSetInfo::getDepartName));
if (Common.isNotNull(socialBases)) { if (Common.isNotNull(socialBases)) {
for (SysBaseSetInfo set:socialBases){ for (SysBaseSetInfo set:socialBases){
...@@ -1354,6 +1359,27 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1354,6 +1359,27 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
return true; return true;
} }
if (Common.isEmpty(empVo)){
if (Common.isEmpty(excel.getFileProvince())
|| Common.isEmpty(excel.getFileCity())
|| Common.isEmpty(excel.getWorkingHours())
|| Common.isEmpty(excel.getEmpNational())
|| Common.isEmpty(excel.getEmpMobile())
|| Common.isEmpty(excel.getEmpType())
|| Common.isEmpty(excel.getPost())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_EMPTY)));
return true;
}
if (Common.isEmpty(excel.getContractName()) && validContractInfo(errorMessageList,excel,empVo)){
return true;
}
}
/*项目档案有可用状态的合同:
不对合同做判断,取值:项目档案的合同;
项目档案无可用状态的合同:
合同类型必填、业务细分(合同类型为其他时必填)、签订期限必填
签订期限:无固定期限 合同到期时间、合同期限非必填,合同开始时间必填;
签订期限:固定期限、已完成一定工作任务为期限 合同期限非必填,合同开始时间、合同到期时间都必填*/
if (Common.isNotNull(empVo)){ if (Common.isNotNull(empVo)){
if (CommonConstants.ONE_STRING.equals(empVo.getProjectStatus())){ if (CommonConstants.ONE_STRING.equals(empVo.getProjectStatus())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_PROJECT_NOT_USED))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_PROJECT_NOT_USED)));
...@@ -1363,8 +1389,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1363,8 +1389,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED)));
return true; return true;
} }
if (Common.isEmpty(empVo.getContractStart()) && Common.isEmpty(excel.getContractStart())){ // 档案无合同 合同起日期、合同类型必填
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED))); if (Common.isEmpty(empVo.getContractName()) && validContractInfo(errorMessageList,excel,empVo)){
return true; return true;
} }
excel.setEmpType(empVo.getEmpNatrue()); excel.setEmpType(empVo.getEmpNatrue());
...@@ -1375,6 +1401,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1375,6 +1401,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excel.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince())); excel.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity())); excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity())); excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
excel.setEmpNational(empVo.getEmpNational());
excel.setEmpRegisType(empVo.getEmpRegisType());
excel.setPost(empVo.getPost());
if (Common.isNotNull(empVo.getContractStart())){
excel.setContractStart(empVo.getContractStart());
excel.setContractEnd(empVo.getContractEnd());
excel.setContractType(empVo.getContractType());
excel.setContractSubName(empVo.getContractSubName());
excel.setContractName(empVo.getEmpName());
excel.setContractTerm(empVo.getContractTerm());
}
} }
excel.setSettleDomainId(setInfoVo.getId()); excel.setSettleDomainId(setInfoVo.getId());
excel.setDepartName(setInfoVo.getDepartName()); excel.setDepartName(setInfoVo.getDepartName());
...@@ -1473,6 +1510,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1473,6 +1510,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
return false; return false;
} }
private boolean validContractInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo){
// 合同起缴时间、合同类型、签订期限必填
if ((Common.isEmpty(excel.getContractStart())
|| Common.isEmpty(excel.getContractType())
|| Common.isEmpty(excel.getContractName()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
// 业务细分(合同类型为其他时必填)
if (excel.getContractType().equals(CommonConstants.TWENTY_ONE_STRING)
&& Common.isEmpty(excel.getContractSubName())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
// 签订期限:固定期限、已完成一定工作任务为期限 合同期限非必填,合同开始时间、合同到期时间都必填
if ((excel.getContractType().equals(CommonConstants.ONE_STRING)
|| excel.getContractType().equals(CommonConstants.ZERO_STRING))
&& Common.isEmpty(excel.getContractEnd())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
return false;
}
private boolean validSocialBaseInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo, SysBaseSetInfo socialSet) { private boolean validSocialBaseInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType()) if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())
......
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