Commit 12c4ca2a authored by hongguangwu's avatar hongguangwu

MVP1.5.4-SSC审核

parent 8e41410c
......@@ -140,12 +140,12 @@ public class TDispatchInfo extends BaseEntity {
/**
* 0未提交1待审核2审核通过3审核不通过4办理完成
*/
@NotBlank(message = "0未提交1待审核2审核通过3审核不通过4办理完成不能为空" )
@Length(max = 1, message = "0未提交1待审核2审核通过3审核不通过4办理完成 不能超过1个字符" )
@ExcelAttribute(name = "0未提交1待审核2审核通过3审核不通过4办理完成", isNotEmpty = true, errorInfo = "0未提交1待审核2审核通过3审核不通过4办理完成不能为空", maxLength = 1)
@Schema(description = "0未提交1待审核2审核通过3审核不通过4办理完成" )
@NotBlank(message = "0未提交1待审核2审核通过3审核不通过4办理完成不能为空5待SSC审核" )
@Length(max = 1, message = "0未提交1待审核2审核通过3审核不通过4办理完成5待SSC审核 不能超过1个字符" )
@ExcelAttribute(name = "0未提交1待审核2审核通过3审核不通过4办理完成5待SSC审核", isNotEmpty = true, errorInfo = "0未提交1待审核2审核通过3审核不通过4办理完成5待SSC审核不能为空", maxLength = 1)
@Schema(description = "0未提交1待审核2审核通过3审核不通过4办理完成5待SSC审核" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("0未提交1待审核2审核通过3审核不通过4办理完成" )
@ExcelProperty("0未提交1待审核2审核通过3审核不通过4办理完成5待SSC审核" )
private String status;
/**
* 0派增1派减
......@@ -741,4 +741,13 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("公积金是否已导出" )
private String exportFundFlag;
/**
* @Description: SSC 审核,不审核自己创建的
* @Author: hgw
* @Date: 2023/5/18 16:18
* @return:
**/
@TableField(exist = false)
private String noCreateUser;
}
......@@ -189,6 +189,13 @@ public class TDispatchInfoController {
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
tDispatchInfo.setStatus(CommonConstants.ONE_STRING);
YifuUser user = SecurityUtils.getUser();
// SSC派单组-1659015946137583618L SSC审核组-1659016108176130049L
long roleId = 1659016108176130049L;
boolean isSsc = tDispatchInfoService.haveRole(user, roleId);
if (isSsc) {
tDispatchInfo.setStatus(CommonConstants.FIVE_STRING);
tDispatchInfo.setNoCreateUser(user.getId());
}
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql())) {
if (tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......@@ -374,9 +381,16 @@ public class TDispatchInfoController {
public void auditExport(HttpServletResponse response, @RequestBody TDispatchInfoSearchVo searchVo,
@RequestParam(required = false,name = "mId") String mId) {
searchVo.setDeleteFlag(CommonConstants.ZERO_STRING);
YifuUser user = SecurityUtils.getUser();
searchVo.setStatus(CommonConstants.ONE_STRING);
// SSC派单组-1659015946137583618L SSC审核组-1659016108176130049L
long roleId = 1659016108176130049L;
boolean isSsc = tDispatchInfoService.haveRole(user, roleId);
if (isSsc) {
searchVo.setStatus(CommonConstants.FIVE_STRING);
searchVo.setNoCreateUser(user.getId());
}
searchVo.setMId(mId);
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......
......@@ -114,4 +114,14 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<Boolean> updateExportSocialFlagById(String id,String status);
R<Boolean> updateExportFundFlagById(String id,String status);
/**
* @param user
* @param roleId SSC派单组-1659015946137583618L SSC审核组-1659016108176130049L
* @Description: 判断用户是否含有某个角色
* @Author: hgw
* @Date: 2023/5/18 16:15
* @return: boolean
**/
boolean haveRole(YifuUser user, long roleId);
}
......@@ -37,10 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -1195,7 +1192,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
int num = 3 - nowNums.length();
return zeroArr[num] + nowNums;
}
private boolean initDispatchAddInfo(YifuUser user,
private boolean initDispatchAddInfo(YifuUser user,
Map<String, TDispatchInfo> dispatchMap,
DispatchEmpVo empVo,
SysBaseSetInfo socialSet,
......@@ -1203,6 +1200,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchImportVo excel,
TSocialFundInfo socialFund,
boolean injury) {
// 是否SSC:SSC派单组-1659015946137583618L SSC审核组-1659016108176130049L
long roleId = 1659015946137583618L;
boolean isSsc = haveRole(user, roleId);
TDispatchInfo dispatch = new TDispatchInfo();
// 初始化派单项
dispatch.setOrderId(excel.getOrderId());
......@@ -1247,6 +1247,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
// 默认待审核
dispatch.setStatus(CommonConstants.ONE_STRING);
if (isSsc) {
dispatch.setStatus(CommonConstants.FIVE_STRING);
}
dispatch.setStatus(CommonConstants.ONE_STRING);
dispatch.setDeleteFlag(CommonConstants.ZERO_STRING);
// 封装项目客户信息
dispatch.setBelongUnit(excel.getCustomerId());
......@@ -2716,6 +2720,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchReduceVo excel;
TSocialFundInfo socialFund;
ProjectSetInfoVo setInfoVo;
// 是否SSC:SSC派单组-1659015946137583618L SSC审核组-1659016108176130049L
long roleId = 1659015946137583618L;
boolean isSsc = haveRole(user, roleId);
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
socialFund = null;
......@@ -2756,6 +2763,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
baseMapper.updateById(dispatchInfo);
}
dispatch.setStatus(CommonConstants.ONE_STRING);
if (isSsc) {
dispatch.setStatus(CommonConstants.FIVE_STRING);
}
baseMapper.insert(dispatch);
socialFundMapper.updateById(socialFund);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
......@@ -3071,7 +3081,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Date now = new Date();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int forecastFlag;
// 是否SSC,true是
boolean isSSC;
for (TDispatchInfo dis : dispatchs) {
isSSC = CommonConstants.FIVE_STRING.equals(dis.getStatus());
forecastFlag = getForecastFlag(dis);
auditInfo = new TAuditInfo();
remarkTemp = "";
......@@ -3090,7 +3103,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorList.add(new ErrorMessage(-1, "找不到员工社保派单数据:" + dis.getEmpName()));
continue;
}
if (!CommonConstants.ONE_STRING.equals(dis.getStatus())){
if (!CommonConstants.ONE_STRING.equals(dis.getStatus()) && !isSSC){
errorList.add(new ErrorMessage(-1, "派单非待审核状态,禁止操作:" + dis.getEmpName()));
continue;
}
......@@ -3099,10 +3112,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())){
//派增审核通过
if (CommonConstants.ZERO_INT == flag) {
socialInfo.setAuditStatus(CommonConstants.ONE_STRING);
// 待办理
sf.setSocialAddStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.ONE_STRING);
if (!isSSC) {
socialInfo.setAuditStatus(CommonConstants.ONE_STRING);
// 待办理
sf.setSocialAddStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.ONE_STRING);
}
//派增审核不通过 需要处理预估数据
} else if (CommonConstants.ONE_INT == flag) {
socialInfo.setDeleteFlag(CommonConstants.ONE_STRING);
......@@ -3120,12 +3135,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType())){
//派减审核通过
if (CommonConstants.ZERO_INT == flag) {
socialInfo.setReduceCan(CommonConstants.ONE_STRING);
// 待办理
sf.setSocialReduceStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.SEVEN_STRING);
// 各个明细项的可派减项为待办理
initReduceStatus(sf,socialInfo);
if (!isSSC) {
socialInfo.setReduceCan(CommonConstants.ONE_STRING);
// 待办理
sf.setSocialReduceStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.SEVEN_STRING);
// 各个明细项的可派减项为待办理
initReduceStatus(sf, socialInfo);
}
//派减审核不通过 需要处理预估数据
} else if (CommonConstants.ONE_INT == flag) {
// 作废更新:社保状态、同步预估数据 8 审核不通过直接作废
......@@ -3164,9 +3181,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())){
// 审核通过
if (CommonConstants.ZERO_INT == flag) {
providentFund.setAuditStatus(CommonConstants.ONE_STRING);
sf.setFundAddStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.ONE_STRING);
if (!isSSC) {
providentFund.setAuditStatus(CommonConstants.ONE_STRING);
sf.setFundAddStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.ONE_STRING);
}
// 审核不通过
} else if (CommonConstants.ONE_INT == flag) {
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据
......@@ -3183,9 +3202,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType())){
// 审核通过
if (CommonConstants.ZERO_INT == flag) {
providentFund.setReduceCan(CommonConstants.ONE_STRING);
sf.setFundReduceStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.SIX_STRING);
if (!isSSC) {
providentFund.setReduceCan(CommonConstants.ONE_STRING);
sf.setFundReduceStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.SIX_STRING);
}
// 审核不通过
} else if (CommonConstants.ONE_INT == flag) {
// 作废更新:公积金状态、同步档案的公积金状态
......@@ -3204,6 +3225,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else {
remarkTemp += DispatchConstants.DISPATCH_REDUCE;
}
if (isSSC) {
remarkTemp += "SSC";
}
// 派单状态信息拼接
if (CommonConstants.ZERO_INT == flag) {
remarkTemp += "审核通过:" + Common.isNullToString(auditRemark);
......@@ -3219,7 +3243,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//更新派单状态
if (CommonConstants.ZERO_INT == flag) {
//审核通过
dis.setStatus(CommonConstants.TWO_STRING);
if (!isSSC) {
dis.setStatus(CommonConstants.TWO_STRING);
} else {
dis.setStatus(CommonConstants.ONE_STRING);
}
} else if (CommonConstants.ONE_INT == flag) {
//审核不通过
dis.setStatus(CommonConstants.THREE_STRING);
......@@ -3254,13 +3282,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 派增审核通过 要更新 人员档案 项目档案 合同的状态信息
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())){
R<Boolean> res = null;
if (CommonConstants.ZERO_INT == flag){
if (CommonConstants.ZERO_INT == flag && !isSSC){
res = archivesDaprUtil.updateEmpInfo(dis.getEmpIdcard(),dis.getSettleDomainCode(),dis.getContractId(),CommonConstants.ZERO_STRING,remarkTemp);
}
if (CommonConstants.ONE_INT == flag){
res = archivesDaprUtil.updateEmpInfo(dis.getEmpIdcard(),dis.getSettleDomainCode(),dis.getContractId(),CommonConstants.ONE_STRING,remarkTemp);
}
if (Common.isEmpty(res) || CommonConstants.SUCCESS != res.getCode()){
if ((Common.isEmpty(res) || CommonConstants.SUCCESS != res.getCode()) && !isSSC){
ServiceUtil.runTimeExceptionDiy("更新人员档案、项目档案、合同状态异常:" + (Common.isNotNull(res)?res.getMsg():CommonConstants.EMPTY_STRING));
}
}
......@@ -5110,4 +5138,23 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(baseMapper.updateExportFundFlagById(id,status) >= 0);
}
/**
* @param user
* @param roleId
* @Description: 判断用户是否含有某个角色
* @Author: hgw
* @Date: 2023/5/18 15:49
* @return: boolean
**/
@Override
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == roleId) {
return true;
}
}
return false;
}
}
......@@ -520,6 +520,9 @@
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
<if test="tDispatchInfo.noCreateUser != null and tDispatchInfo.noCreateUser.trim() != ''">
AND a.CREATE_BY != #{tDispatchInfo.noCreateUser}
</if>
</if>
</sql>
......@@ -778,6 +781,7 @@
when a.STATUS = 2 then "审核通过"
when a.STATUS = 3 then "审核不通过"
when a.STATUS = 4 then "已办结"
when a.STATUS = 5 then "待SSC审核"
else null end as STATUS,
a.AUDIT_USER_NAME as AUDIT_USER,
a.AUDIT_TIME,
......
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