Commit 773bd917 authored by hongguangwu's avatar hongguangwu

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

parents 31402687 189b8b73
......@@ -18,6 +18,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
......@@ -25,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -34,6 +36,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -107,6 +110,7 @@ public class TAutoMainRelExportVo implements Serializable {
* 非数据库字段,查询时动态生成
*/
@TableField(exist = false)
@ExcelProperty("限制项")
@Schema(description = "限制项显示(拼接后的服务项目名称)")
private String restrictItemsDisplay;
......@@ -116,4 +120,14 @@ public class TAutoMainRelExportVo implements Serializable {
@Schema(description = "自动化配置项列表(记录配置了哪些服务项目)")
private String autoConfigItemsDisplay;
}
\ No newline at end of file
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
@Schema(description = "创建时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
@ColumnWidth(18)
private LocalDateTime createTime;
}
......@@ -2177,6 +2177,7 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
ErrorMessage errorMessage = excelUtil.checkEntity(excel, rowNum);
if (Common.isNotNull(errorMessage)) {
errorMessage.setData(excel);
errorMessageList.add(errorMessage);
continue;
}
......@@ -2232,9 +2233,43 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
// 获取当前要设置的值(使用Excel中的值,如果为null则使用实体当前值)
String newAutoFlag = Common.isNotNull(excel.getAutoFlag()) ? excel.getAutoFlag() : entity.getAutoFlag();
String newRestrictArchive = null ==excel.getRestrictArchive()?CommonConstants.ZERO_STRING:excel.getRestrictArchive();
String newRestrictInsurance = null == excel.getRestrictInsurance() ? CommonConstants.ZERO_STRING : excel.getRestrictInsurance();
String newRestrictContract = null == excel.getRestrictContract()?CommonConstants.ZERO_STRING:excel.getRestrictContract();
String newRestrictSocialFund = null == excel.getRestrictSocialFund()? CommonConstants.ZERO_STRING : excel.getRestrictSocialFund();
String newRestrictInsurance = excel.getRestrictInsurance();
String newRestrictContract = excel.getRestrictContract();
String newRestrictSocialFund = excel.getRestrictSocialFund();
// 校验autoFlag的值必须为0或1
if (!CommonConstants.ZERO_STRING.equals(newAutoFlag) && !CommonConstants.ONE_STRING.equals(newAutoFlag)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"是否限制值不合法,必须为0或1",excel));
return;
}
// 校验restrictInsurance的值必须为0或1
if (Common.isNotNull(newRestrictInsurance) &&
!CommonConstants.ZERO_STRING.equals(newRestrictInsurance) &&
!CommonConstants.ONE_STRING.equals(newRestrictInsurance)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"商险限制值不合法,必须为0或1",excel));
return;
}
// 校验restrictContract的值必须为0或1
if (Common.isNotNull(newRestrictContract) &&
!CommonConstants.ZERO_STRING.equals(newRestrictContract) &&
!CommonConstants.ONE_STRING.equals(newRestrictContract)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"合同限制值不合法,必须为0或1",excel));
return;
}
// 校验restrictSocialFund的值必须为0或1
if (Common.isNotNull(newRestrictSocialFund) &&
!CommonConstants.ZERO_STRING.equals(newRestrictSocialFund) &&
!CommonConstants.ONE_STRING.equals(newRestrictSocialFund)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"社保公积金限制值不合法,必须为0或1",excel));
return;
}
// 业务规则:如果是否限制为"是"(0),各限制分项不能为空,且至少有一项为限制(1)
if (CommonConstants.ZERO_STRING.equals(newAutoFlag)) {
......
......@@ -188,7 +188,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.failed(CommonConstants.USER_FAIL);
}
TSettleDomain domain = tSettleDomainService.getById(tEmployeeContractInfo.getSettleDomain());
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag()) && null != domain) {
if (Common.isNotNull(user) && null != domain) {
// 超管放行,不进行自动化限制检查
if (!isSuperAdmin(user)) {
String deptNo = domain.getDepartNo();
......@@ -1428,6 +1428,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* 项目编码自动化校验缓存,key: deptNo, value: true-已纳入自动化, false-未纳入
*/
private Map<String, Boolean> autoCheckCache = new HashMap<>();
private boolean notSuperAdmin = !isSuperAdmin(user);
@Override
public void invoke(EmployeeContractVO data, AnalysisContext context) {
......@@ -1440,7 +1442,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else {
// 导入时的自动化校验
String deptNo = data.getDeptNo();
if (Common.isNotNull(deptNo) && !isSuperAdmin(user)) {
if (Common.isNotNull(deptNo) && notSuperAdmin) {
// 先从缓存中获取
Boolean isAuto = autoCheckCache.get(deptNo);
if (isAuto == null) {
......
......@@ -89,6 +89,11 @@
<if test="tAutoMainRel.createTime != null">
AND a.CREATE_TIME = #{tAutoMainRel.createTime}
</if>
<!-- 创建时间区间查询 -->
<if test="tAutoMainRel.createTimes != null and tAutoMainRel.createTimes.length == 2">
AND a.CREATE_TIME &gt;= #{tAutoMainRel.createTimes[0]}
AND a.CREATE_TIME &lt;= #{tAutoMainRel.createTimes[1]}
</if>
<if test="tAutoMainRel.updateBy != null and tAutoMainRel.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tAutoMainRel.updateBy}
</if>
......@@ -245,6 +250,7 @@
SELECT
a.RULE_UPDATE_TIME,
a.RULE_UPDATE_PERSON,
a.CREATE_TIME,
b.DEPART_NAME,
IFNULL(b.cs_name,'') csUserName,
b.DEPART_NO dept_NO,
......
......@@ -490,6 +490,11 @@ public interface ErrorCodes {
* 派增异常: 社保各项基数不一致,委托备注必填
*/
String EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR = "emp.dispatch.social.base.limit.error";
/**
* 派增异常: 社保各项基数与备案基数不一致,自定义类型 备案基数需要与各项基数一致(不含大病)
*/
String EMP_DISPATCH_SOCIAL_BASE_RECORD_ERROR = "emp.dispatch.social.base.record.error";
/**
* 派增异常: 社保各项起缴日不一致,委托备注必填
*/
......
......@@ -178,6 +178,8 @@ emp.dispatch.fund.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u516C\u79EF\u91D1\
emp.dispatch.social.base.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5907\u6848\u57FA\u6570\u4E0E\u793E\u4FDD\u4EFB\u610F\u57FA\u6570\u4E0D\u4E00\u81F4\uFF0C\u59D4\u6258\u5907\u6CE8\u5FC5\u586B
emp.dispatch.social.base.record.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u5404\u9879\u57FA\u6570\u4E0E\u5907\u6848\u57FA\u6570\u4E0D\u4E00\u81F4\uFF0C\u81EA\u5B9A\u4E49\u7C7B\u578B \u5907\u6848\u57FA\u6570\u9700\u8981\u4E0E\u5404\u9879\u57FA\u6570\u4E00\u81F4\uFF08\u4E0D\u542B\u5927\u75C5\uFF09
emp.dispatch.social.date.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u9669\u79CD\u8D77\u7F34\u65E5\u671F\u4E0D\u4E00\u81F4\u65F6\uFF0C\u201C\u59D4\u6258\u5907\u6CE8\u201D\u5217\u5FC5\u586B\uFF0C\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.date.limit.error2=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u8D77\u59CB\u65E5\u671F\u4E0E\u793E\u4FDD\u8D77\u7F34\u65E5\u671F\u4E0D\u4E00\u81F4\u65F6\uFF0C\u201C\u59D4\u6258\u5907\u6CE8\u201D\u5217\u5FC5\u586B\uFF0C\u4E0D\u53EF\u4E3A\u7A7A
......
......@@ -117,9 +117,9 @@ public class SecurityUtils {
if (roleList == null || roleList.isEmpty()) {
return false;
}
// SSC开发组-1668092146875969537L 超管1
// 超管1
for (Long role : roleList) {
if (role == 1668092146875969537L || role == 1L) {
if (role == 1L) {
return true;
}
}
......
......@@ -19,6 +19,8 @@ public class RegistConstants {
public static final String EMP_PROJECT_EXIT_CHECK = "未找到该人员对应的在项信息!";
public static final String EMP_PROJECT_IS_EXIT_CHECK = "该人员存在在项的项目档案!";
public static final String EMP_CONTRACT_EXIT_CHECK = "已存在流程中的合同待签订数据!";
public static final String CONFIRM_SUBMIT = "确认接收";
......
......@@ -2156,22 +2156,25 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, registration.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, registration.getFeedbackType())
.orderByDesc(EmployeeRegistration::getCreateTime)
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
return RegistConstants.REGIST_SAME_CHECK;
}
//针对入职的判断是否存在流程中的合同待签订数据
//针对入职的判断
if (CommonConstants.ONE_STRING.equals(registration.getFeedbackType())) {
int nowDay = Integer.parseInt(DateUtil.getThisDay());
if (Common.isNot16Age(registration.getEmpIdcard(), nowDay)) {
return CommonConstants.UNDER_16_ERROR;
}
//针对入职的判断是否存在在项项目档案
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(registration.getEmpIdcard());
vo.setDeptNo(registration.getDeptNo());
if (Boolean.TRUE.equals(checkContractPreIsExit(vo))) {
return RegistConstants.EMP_CONTRACT_EXIT_CHECK;
EmpProjectStatusVo exitProject = getEmpProjectStatus(vo);
if (!Common.isEmpty(exitProject)) {
return RegistConstants.EMP_PROJECT_IS_EXIT_CHECK;
}
}
//针对离职的判断人员项目档案状态是否正常
......@@ -3187,33 +3190,25 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
//该人员入职/离职数据已登记,请勿重复操作
if (CommonConstants.TWO_STRING.equals(insert.getFeedbackType())){
exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, insert.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.last(CommonConstants.LAST_ONE_SQL));
} else {
// v1.7.23 新增:已处理 也要拒绝入职
exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, insert.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, Stream.of("0","1").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL));
}
exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, insert.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, insert.getDeptNo())
.eq(EmployeeRegistration::getFeedbackType, insert.getFeedbackType())
.in(EmployeeRegistration::getProcessStatus, CommonConstants.processStatus)
.orderByDesc(EmployeeRegistration::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
errorList.add(RegistConstants.REGIST_SAME_CHECK);
}
//针对入职的判断是否存在流程中的合同待签订数据
//针对入职的判断是否存在在项项目档案
if (CommonConstants.ONE_STRING.equals(insert.getFeedbackType())) {
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(insert.getEmpIdcard());
vo.setDeptNo(insert.getDeptNo());
if (Boolean.TRUE.equals(checkContractPreIsExit(vo))) {
errorList.add(RegistConstants.EMP_CONTRACT_EXIT_CHECK);
EmpProjectStatusVo exitProject = getEmpProjectStatus(vo);
if (!Common.isEmpty(exitProject)) {
errorList.add(RegistConstants.EMP_PROJECT_IS_EXIT_CHECK);
}
}
......
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