Commit 83b811f1 authored by fangxinjiang's avatar fangxinjiang

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

parents 97835a0c 163c1a3f
......@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -353,4 +354,17 @@ public class TEmployeeProjectController {
public R<List<TSettleDomainDataVo>> selectSettleMentData(@RequestBody List<String> deptNoList) {
return tEmployeeProjectService.selectSettleMentData(deptNoList);
}
/**
* @param cardVo
* @Description: 判断员工是否存在在项的项目档案
* @Author: huyc
* @Date: 2025/1/15
* @return:
**/
@Inner
@PostMapping("/inner/selectExitEmpProject")
public Boolean selectExitEmpProject(@RequestBody TInsuranceUnpurchasePersonCardVo cardVo) {
return tEmployeeProjectService.selectExitEmpProject(cardVo);
}
}
......@@ -26,6 +26,7 @@ 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.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
......@@ -282,4 +283,6 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
**/
Map<String, TEmployeeProject> getMapByDeptIdAndDelete(String deptId);
Boolean selectExitEmpProject(TInsuranceUnpurchasePersonCardVo cardVo);
}
......@@ -52,6 +52,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -1942,4 +1943,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return proMap;
}
@Override
public Boolean selectExitEmpProject(TInsuranceUnpurchasePersonCardVo cardVo) {
long count = baseMapper.selectCount(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo, cardVo.getDeptNo())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getEmpIdcard, CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getDeleteFlag, cardVo.getEmpIdcardNo()));
return count > 0;
}
}
......@@ -634,6 +634,8 @@ public interface CommonConstants {
List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList());
List<String> deptList = Stream.of("安徽一册档案管理有限公司","安徽顾合企业管理咨询有限公司","安徽赤道线数字传媒科技有限公司","劳务业务中心","易服智享&研究院").collect(Collectors.toList());
String USER_DIR = "user.dir";
String DOUBLE_LINE = "//";
......
......@@ -13,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
......@@ -506,4 +507,15 @@ public class ArchivesDaprUtil {
}
return res;
}
/**
* @Author huyc
* @Description 判断是否存在正常的项目
* @Date 16:38 2025/1/15
* @Param
* @return
**/
public R<Boolean> selectExitEmpProject(TInsuranceUnpurchasePersonCardVo cardVo) {
return HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/temployeeproject/inner/selectExitEmpProject", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
}
}
......@@ -157,12 +157,24 @@ public class SocialDaprUtils {
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Description 判断是否存在正常的工伤缴费
* @Date 16:38 2025/1/15
* @Param
* @return
**/
public R<Boolean> selectExitSocialInjury(TInsuranceUnpurchasePersonCardVo cardVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/inner/selectExitSocialInjury", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Description: 查询社保已购买的身份证
* @Author: hgw
* @Date: 2025/1/15 16:11
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<ListStringVo> selectWorkInjuryHandleAll() {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId()
,"/tsocialfundinfo/inner/selectWorkInjuryHandleAll", null, ListStringVo.class, SecurityConstants.FROM_IN);
}
}
......@@ -140,5 +140,16 @@ public class SalaryTask {
log.info("------------定时生成【前12月平均工资】-定时任务结束------------");
}
/**
* @Author hgw
* @Description 定时任务刷新【不购买商险申请明细】里的社保状态
* @Date 2025-1-15 16:58:10
**/
public void doSocialWorkInjuryHandleAll() {
log.info("------------定时任务刷新不购买里的社保状态-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(),daprSalarylProperties.getAppId(),"/tinsuranceunpurchaseperson/inner/doSocialWorkInjuryHandleAll","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时任务刷新不购买里的社保状态-定时任务结束------------");
}
}
\ No newline at end of file
......@@ -95,7 +95,7 @@ public class TInsuranceUnpurchaseApply extends BaseEntity {
private List<String> attaIdList;
/**
* 暂存,提交,编辑区分
* 暂存,提交区分
*/
@TableField(exist = false)
private String saveFlag;
......
package com.yifu.cloud.plus.v1.yifu.salary.entity;
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.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -8,6 +9,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 含风险项目不购买申请明细表
*
......@@ -80,4 +83,12 @@ public class TInsuranceUnpurchasePerson extends BaseEntity {
@Schema(description ="服务项是否勾选商险 0 是 1 否")
private String insuranceFlag;
@Schema(description = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过")
private String status;
@Schema(description = "工资人员明细")
@TableField(exist = false)
private List<TInsuranceUnpurchasePersonSalary> personInfoList;
}
......@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.salary.vo;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @Description: list String vo
......
......@@ -24,4 +24,7 @@ public class TInsuranceUnpurchasePersonCardVo implements Serializable {
@Schema(description = "身份证号")
private String empIdcardNo;
@Schema(description = "身份证号")
private String deptNo;
}
......@@ -52,16 +52,16 @@ public class TInsuranceUnpurchasePersonVo implements Serializable {
@ExcelProperty("项目编码")
private String deptNo;
@ExcelAttribute(name = "事业部")
@Schema(description = "事业部")
@ExcelProperty("事业部")
private String division;
@ExcelAttribute(name = "事业部条线")
@Schema(description = "事业部条线")
@ExcelProperty("事业部条线")
private String newLine;
@ExcelAttribute(name = "事业部")
@Schema(description = "事业部")
@ExcelProperty("事业部")
private String division;
/**
* 姓名
*/
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
......@@ -55,7 +56,7 @@ public class TInsuranceUnpurchasePersonController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TInsuranceUnpurchasePerson> getById(@PathVariable("id" ) String id) {
return R.ok(tInsuranceUnpurchasePersonService.getById(id));
return tInsuranceUnpurchasePersonService.getPersonInfo(id);
}
/**
......@@ -84,4 +85,17 @@ public class TInsuranceUnpurchasePersonController {
return tInsuranceUnpurchasePersonService.getSocialWorkInjuryHandleById(id);
}
/**
* @Description: 定时任务刷新不购买里的社保状态
* @Author: hgw
* @Date: 2025/1/15 13:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "定时任务刷新不购买里的社保状态")
@PostMapping("/inner/doSocialWorkInjuryHandleAll")
@Inner
public void doSocialWorkInjuryHandleAll() {
tInsuranceUnpurchasePersonService.doSocialWorkInjuryHandleAll();
}
}
......@@ -51,4 +51,10 @@ public interface TInsuranceUnpurchasePersonMapper extends BaseMapper<TInsuranceU
List<TInsuranceUnpurchasePerson> getBuyList(@Param("deptId") String deptId, @Param("idCardList") List<String> idCardList);
List<String> getSocialBuyList();
void updateSocialStatusZero(@Param("idCardList") List<String> idCardList);
void updateSocialStatusOne(@Param("idCardList") List<String> idCardList);
}
......@@ -8,7 +8,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
......@@ -64,7 +63,6 @@ public interface TInsuranceUnpurchaseApplyService extends IService<TInsuranceUnp
R<String> auditAndCommit(TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String approvalResult, String approvalOpinion, YifuUser user)
throws CheckedException;
@Transactional
R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply);
R<TInsuranceUnpurchaseApply> getDetailInfoById(String id);
......
......@@ -40,4 +40,8 @@ public interface TInsuranceUnpurchasePersonService extends IService<TInsuranceUn
**/
R<String> getSocialWorkInjuryHandleById(String id);
R<TInsuranceUnpurchasePerson> getPersonInfo(String id);
void doSocialWorkInjuryHandleAll();
}
......@@ -16,6 +16,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
......@@ -67,6 +68,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource
private SocialDaprUtils socialDaprUtil;
@Resource
private ArchivesDaprUtil archivesDaprUtil;
@Resource
private CacheManager cacheManager;
@Resource
private TSalaryAttaService tSalaryAttaService;
......@@ -148,6 +151,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
@Override
@Transactional
public R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
YifuUser user = SecurityUtils.getUser();
//字段长度校验
......@@ -159,6 +163,18 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
String applyNo = getCode();
//获取明细当日最大申请编号
String applyDetail = baseMapper.getMaxInusuranceDetailCode();
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
if (Common.isNotNull(tInsuranceUnpurchaseApply.getDeptNo())) {
List<String> deptList = CommonConstants.deptList;
tInsuranceUnpurchaseApply.setCompanyFlag(deptList.stream().noneMatch(e -> e.equals(user.getDeptName())) ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
long count = baseMapper.selectCount(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchaseApply::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
tInsuranceUnpurchaseApply.setAuditFlag(count > 0 ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
tInsuranceUnpurchaseApply.setStatus(count > 0 ? CommonConstants.THREE_STRING : tInsuranceUnpurchaseApply.getStatus());
}
//暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
tInsuranceUnpurchaseApply.setCreateTime(null);
......@@ -195,51 +211,45 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
return R.failed(personList);
}
} else if (CommonConstants.THREE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
//同倩倩确认申请时间实时更新
tInsuranceUnpurchaseApply.setCreateTime(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
//同倩倩确认申请时间实时更新
tInsuranceUnpurchaseApply.setCreateTime(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
}
personService.saveBatch(personInfoList);
} else {
return R.failed(personList);
}
......@@ -277,38 +287,55 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
Map<String,String> sameCheckMap = new HashMap<>();
TInsuranceUnpurchaseApply exitApply;
TInsuranceUnpurchasePerson exit;
List<TInsuranceUnpurchasePersonAddVo> personList = tInsuranceUnpurchaseApply.getPersonList();
if (Common.isNotNull(personList) && !personList.isEmpty()) {
R<Boolean> flagSocial;
R<Boolean> flagArc;
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
StringBuilder sameCheck = new StringBuilder();
sameCheck.append(vo.getEmpIdcardNo());
sameCheck.append("_");
sameCheck.append(vo.getEmpName());
sameCheck.append("_");
sameCheck.append(vo.getPost());
if (null == sameCheckMap.get(sameCheck.toString())) {
sameCheckMap.put(sameCheck.toString(), "1");
} else {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":存在重复的身份证+姓名信息,可删除后再提交");
}
exit = personService.getOne(Wrappers.<TInsuranceUnpurchasePerson>query().lambda()
.eq(TInsuranceUnpurchasePerson::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchasePerson::getEmpIdcardNo, vo.getEmpIdcardNo())
exitApply = baseMapper.selectOne(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchaseApply::getDeleteFlag, CommonConstants.ZERO_STRING)
.ne(TInsuranceUnpurchaseApply::getStatus, CommonConstants.ZERO_STRING)
.ne(TInsuranceUnpurchaseApply::getId, tInsuranceUnpurchaseApply.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
continue;
if (Common.isNotNull(exitApply)) {
exit = personService.getOne(Wrappers.<TInsuranceUnpurchasePerson>query().lambda()
.eq(TInsuranceUnpurchasePerson::getParnetId, exitApply.getId())
.eq(TInsuranceUnpurchasePerson::getEmpIdcardNo, vo.getEmpIdcardNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
continue;
}
}
//人员有项目档案且未减项拦截
TInsuranceUnpurchasePersonCardVo cardVo = new TInsuranceUnpurchasePersonCardVo();
cardVo.setEmpIdcardNo(vo.getEmpIdcardNo());
cardVo.setEmpName(vo.getEmpName());
R<Boolean> flag = socialDaprUtil.selectExitSocialInjury(cardVo);
if (Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData())) {
flagSocial = socialDaprUtil.selectExitSocialInjury(cardVo);
if (Common.isEmpty(flagSocial) || Boolean.TRUE.equals(flagSocial.getData())) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":无正常参保或派单中的数据,禁止提交!");
continue;
}
cardVo.setDeptNo(tInsuranceUnpurchaseApply.getDeptNo());
flagArc = archivesDaprUtil.selectExitEmpProject(cardVo);
if (Common.isEmpty(flagArc) || Boolean.TRUE.equals(flagArc.getData())) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":人员正常在项,可项目档案减项后再次提交!");
}
}
}
......@@ -322,17 +349,21 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
person.setDeptNo(tInsuranceUnpurchaseApply.getDeptNo());
person.setDivision(tInsuranceUnpurchaseApply.getDivision());
person.setNewLine(tInsuranceUnpurchaseApply.getNewLine());
person.setReasonType(tInsuranceUnpurchaseApply.getReasonInfo());
person.setHasContainRisks(tInsuranceUnpurchaseApply.getReasonInfo());
person.setReasonInfo(tInsuranceUnpurchaseApply.getReasonInfo());
person.setCreateBy(tInsuranceUnpurchaseApply.getCreateBy());
person.setCreateName(tInsuranceUnpurchaseApply.getCreateName());
person.setCreateUserDeptName(tInsuranceUnpurchaseApply.getCreateUserDeptName());
person.setStatus(tInsuranceUnpurchaseApply.getStatus());
person.setCreateUserDeptId(tInsuranceUnpurchaseApply.getCreateUserDeptId());
}
private void updateFileId(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
if (Common.isNotNull(tInsuranceUnpurchaseApply.getAttaIdList())) {
TSalaryAtta atta;
for (String id : tInsuranceUnpurchaseApply.getAttaIdList()) {
TSalaryAtta atta = tSalaryAttaService.getById(id);
atta = tSalaryAttaService.getById(id);
atta.setLinkId(tInsuranceUnpurchaseApply.getId());
tSalaryAttaService.updateById(atta);
}
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -12,12 +13,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePersonSalary;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TInsuranceUnpurchasePersonMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TInsuranceUnpurchasePersonSalaryMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -26,7 +26,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 含风险项目不购买申请明细表
*
......@@ -39,6 +42,8 @@ public class TInsuranceUnpurchasePersonServiceImpl extends ServiceImpl<TInsuranc
@Resource
private SocialDaprUtils socialDaprUtil;
@Resource
TInsuranceUnpurchasePersonSalaryMapper salaryMapper;
/**
* 含风险项目不购买申请明细表简单分页查询
......@@ -132,5 +137,65 @@ public class TInsuranceUnpurchasePersonServiceImpl extends ServiceImpl<TInsuranc
return R.ok("成功");
}
@Override
public R<TInsuranceUnpurchasePerson> getPersonInfo(String id) {
TInsuranceUnpurchasePerson person = baseMapper.selectById(id);
if (Common.isNotNull(person)) {
List<TInsuranceUnpurchasePersonSalary> personInfoList = salaryMapper.selectList(
Wrappers.<TInsuranceUnpurchasePersonSalary>lambdaQuery()
.eq(TInsuranceUnpurchasePersonSalary::getParentId, id)
.eq(TInsuranceUnpurchasePersonSalary::getDeleteFlag, CommonConstants.ZERO_INT));
person.setPersonInfoList(personInfoList);
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return R.ok(person);
}
/**
* @Description: 刷新社保状态
* @Author: hgw
* @Date: 2025/1/15 13:22
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public void doSocialWorkInjuryHandleAll() {
List<String> personList = baseMapper.getSocialBuyList();
if (personList != null) {
R<ListStringVo> listVoR = socialDaprUtil.selectWorkInjuryHandleAll();
if (listVoR != null && listVoR.getData() != null
&& listVoR.getData().getListVo() != null && !listVoR.getData().getListVo().isEmpty()) {
List<String> socialList = listVoR.getData().getListVo();
Map<String, String> socialMap = new HashMap<>();
for (String s : socialList) {
socialMap.put(s, s);
}
// 更新为是在保
List<String> updateZero = new ArrayList<>();
// 更新为不在保
List<String> updateOne = new ArrayList<>();
for (String idCard : personList) {
if (socialMap.get(idCard) != null) {
updateZero.add(idCard);
} else {
updateOne.add(idCard);
}
}
if (!updateZero.isEmpty()) {
baseMapper.updateSocialStatusZero(updateZero);
}
if (!updateOne.isEmpty()) {
baseMapper.updateSocialStatusOne(updateOne);
}
// 清理信息
updateZero.clear();
updateOne.clear();
personList.clear();
socialList.clear();
socialMap.clear();
}
}
}
}
package com.yifu.cloud.plus.v1.yifu.salary.service.impl.process;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -8,10 +9,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.impl.AbastractAuditProcess;
import com.yifu.cloud.plus.v1.yifu.process.constant.ProcessConstants;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodePrimission;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRoute;
......@@ -19,7 +16,13 @@ import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRouteCondition;
import com.yifu.cloud.plus.v1.yifu.process.entity.TProcessNode;
import com.yifu.cloud.plus.v1.yifu.process.util.ProcessAuditUtil;
import com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.service.impl.AbastractAuditProcess;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
......@@ -42,6 +45,9 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
@Resource
private TInsuranceUnpurchaseApplyService tInsuranceUnpurchaseApplyService;
@Resource
private TInsuranceUnpurchasePersonService personService;
@Override
public R<String> auditSuccess(TInsuranceUnpurchaseApply entity, TAuditRecord approvalRecord, YifuUser loginUser) {
// 改实体审核状态为审核通过
......@@ -60,6 +66,12 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
auditNodeProocessService.remove(Wrappers.<TAuditNodeProocess>query().lambda().eq(TAuditNodeProocess::getDomainId, entity.getId())
.in(TAuditNodeProocess::getType, approvalRecord.getAuditType()));
}
//huych--更新明细审核状态
LambdaUpdateWrapper<TInsuranceUnpurchasePerson> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceUnpurchasePerson::getParnetId,entity.getId())
.set(TInsuranceUnpurchasePerson::getStatus, entity.getStatus());
personService.update(updateWrapper);
}
return R.ok("审核通过");
......
......@@ -156,12 +156,12 @@
APPLY_NO,
DEPT_NAME,
DEPT_NO,
DIVISION,
NEW_LINE,
DIVISION,
EMP_NAME,
EMP_IDCARD_NO,
if(a.REASON_TYPE = '1','已购买社保','人员已离职') REASON_TYPE,
if(a.SOCIAL_STATUS='0','是','否') SOCIAL_STATUS,
if(a.SOCIAL_STATUS='0','在保','不在保') SOCIAL_STATUS,
SALARY_NUM,
CREATE_NAME,
CREATE_TIME
......@@ -199,4 +199,32 @@
</foreach>
</select>
<!--不购买商险-社保,薪资定时任务刷社保状态使用 hgw-->
<select id="getSocialBuyList" resultType="java.lang.String">
SELECT
EMP_IDCARD_NO
FROM t_insurance_unpurchase_person a
where STATUS = '3' AND REASON_TYPE = '1'
</select>
<!--更新是否在保为0:在保 hgw-->
<update id="updateSocialStatusZero">
update t_insurance_unpurchase_person a
set a.SOCIAL_STATUS = '0'
where STATUS = '3' AND REASON_TYPE = '1' AND EMP_IDCARD_NO in
<foreach item="idStr" index="index" collection="idCardList" open="(" separator="," close=")">
#{idStr}
</foreach>
</update>
<!--更新是否在保为1:不在保 hgw-->
<update id="updateSocialStatusOne">
update t_insurance_unpurchase_person a
set a.SOCIAL_STATUS = '1'
where STATUS = '3' AND REASON_TYPE = '1' AND EMP_IDCARD_NO in
<foreach item="idStr" index="index" collection="idCardList" open="(" separator="," close=")">
#{idStr}
</foreach>
</update>
</mapper>
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
......@@ -195,4 +196,16 @@ public class TSocialFundInfoController {
return tSocialFundInfoService.selectExitSocialInjury(cardVo);
}
/**
* @Description: 获取存在的工伤社保数据
* @Author: hgw
* @Date: 2025-1-15 16:17:31
* @return:
**/
@Inner
@PostMapping("/inner/selectWorkInjuryHandleAll")
public ListStringVo selectWorkInjuryHandleAll() {
return tSocialFundInfoService.selectWorkInjuryHandleAll();
}
}
......@@ -88,4 +88,12 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
String selectSocialByContract(@Param("tSocialFundInfo") TSocialFundInfo tSocialFundInfo);
String selectFundByContract(@Param("tSocialFundInfo") TSocialFundInfo tSocialFundInfo);
/**
* @Description: 获取在保的全量数据,定时任务处理不购买商险
* @Author: hgw
* @Date: 2025/1/15 16:24
* @return: java.util.List<java.lang.String>
**/
List<String> getSocialWorkInjuryList();
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
......@@ -84,4 +85,12 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
Boolean selectExitSocialInjury(TInsuranceUnpurchasePersonCardVo cardVo);
/**
* @Description: 获取在保的全量数据,定时任务处理不购买商险
* @Author: hgw
* @Date: 2025/1/15 16:28
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo
**/
ListStringVo selectWorkInjuryHandleAll();
}
......@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
......@@ -918,4 +919,18 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
.last(CommonConstants.LAST_ONE_SQL));
return null != socialFundInfo;
}
/**
* @Description: 获取在保的全量数据,定时任务处理不购买商险
* @Author: hgw
* @Date: 2025/1/15 16:28
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo
**/
@Override
public ListStringVo selectWorkInjuryHandleAll() {
ListStringVo vo = new ListStringVo();
List<String> socialList = baseMapper.getSocialWorkInjuryList();
vo.setListVo(socialList);
return vo;
}
}
\ No newline at end of file
......@@ -1195,4 +1195,9 @@
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1
</select>
<!-- 获取在保的全量数据,定时任务处理不购买商险 -->
<select id="getSocialWorkInjuryList" resultType="java.lang.String">
SELECT EMP_IDCARD FROM t_social_fund_info s where s.WORK_INJURY_HANDLE in ('0','1','4','5')
</select>
</mapper>
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