Commit 33a54073 authored by hongguangwu's avatar hongguangwu

MVP1.7.9-离职日期按字典

parent 4c4a6906
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
* 离职原因税友自动化配置表
*
* @author hgw
* @date 2025-04-14 11:57:06
*/
@Data
@TableName("t_social_friend_reduce_set")
@Schema(description = "离职原因税友自动化配置表")
public class TSocialFriendReduceSet {
/**
* 减少原因ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("减少原因ID")
@Schema(description = "减少原因ID")
private String id;
/**
* 减少原因
*/
@ExcelAttribute(name = "减少原因", maxLength = 32)
@Length(max = 32, message = "减少原因不能超过32个字符")
@ExcelProperty("减少原因")
@Schema(description = "减少原因")
private String reduceReasonName;
/**
* 中断原因
*/
@ExcelAttribute(name = "中断原因", maxLength = 32)
@Length(max = 32, message = "中断原因不能超过32个字符")
@ExcelProperty("中断原因")
@Schema(description = "中断原因")
private String tbyy;
/**
* 劳动用工备案解除/终止原因
*/
@ExcelAttribute(name = "劳动用工备案解除/终止原因", maxLength = 32)
@Length(max = 32, message = "劳动用工备案解除/终止原因不能超过32个字符")
@ExcelProperty("劳动用工备案解除/终止原因")
@Schema(description = "劳动用工备案解除/终止原因")
private String zzyy;
/**
* 备案解除二级原因
*/
@ExcelAttribute(name = "备案解除二级原因", maxLength = 32)
@Length(max = 32, message = "备案解除二级原因不能超过32个字符")
@ExcelProperty("备案解除二级原因")
@Schema(description = "备案解除二级原因")
private String bajcejyy;
}
......@@ -106,4 +106,7 @@ public class SociaFriendYgsAddVo implements Serializable {
@ExcelProperty("派单类型")
private String type;
@ExcelProperty("备案解除二级原因")
private String bajcejyy;
}
......@@ -474,6 +474,7 @@ public class SocialFriendConfig {
// 办理项目
blxmlbOne.put("blxm", blxm);
// 中断原因 除死亡以外,其他停保原因默认:“在职人员解除/终止劳动合同” 死亡对应“死亡或失踪”
// 2025-4-14 16:03:54 陈红提的:tbyy 、 zzyy 、 bajcejyy 改为按t_social_friend_reduce_set配置来
blxmlbOne.put("tbyy", vo.getTbyy());
// 中断时间 yyyy-MM-dd 默认当前时间
blxmlbOne.put("tbsj", DateUtil.getLastDay());
......@@ -484,6 +485,7 @@ public class SocialFriendConfig {
tszdxx = new JSONObject();
// 劳动用工备案解除/终止原因 数据字典文档 法律依据 [社保]必填;
tszdxx.put("zzyy", vo.getZzyy());
tszdxx.put("bajcejyy", vo.getBajcejyy());
// 社保个人身份材料 无
// tszdxx.put("shjycl", )
// 医保个人身份材料 无
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 离职原因税友自动化配置表
*
* @author hgw
* @date 2025-04-14 11:57:06
*/
@Mapper
public interface TSocialFriendReduceSetMapper extends BaseMapper<TSocialFriendReduceSet> {
/**
* @Description: 获取全量信息
* @Author: hgw
* @Date: 2025/4/14 15:24
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet>
**/
List<TSocialFriendReduceSet> getTSocialFriendReduceSetList();
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet;
import java.util.Map;
/**
* 离职原因税友自动化配置表
*
* @author hgw
* @date 2025-04-14 11:57:06
*/
public interface TSocialFriendReduceSetService extends IService<TSocialFriendReduceSet> {
/**
* @Description: 查找List并组装Map
* @Author: hgw
* @Date: 2025/4/14 15:23
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet>
**/
Map<String, TSocialFriendReduceSet> getFriendReduceMap();
}
......@@ -66,6 +66,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private final TSocialSoldierLogService tSocialSoldierLogService;
private final TSocialFriendBackLogService tSocialFriendBackLogService;
private final TSocialFreindSetService tSocialFreindSetService;
private final TSocialFriendReduceSetService tSocialFriendReduceSetService;
private final TSocialInfoMapper socialMapper;
private final AtomicInteger atomicPushFriend = new AtomicInteger(0);
......@@ -98,6 +99,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
TSocialFreindSet set = tSocialFreindSetService.getById("1");
if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) {
Map<String, TSocialFriendReduceSet> reduceMap = tSocialFriendReduceSetService.getFriendReduceMap();
// 获取时间限制配置(获取 当月启用 的配置)
Map<String, TSocialDeadlineInfo> socialSetMap = tSocialDeadlineInfoService.getSocialSetByAreaId();
......@@ -105,23 +108,23 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 养工失新增列表
List<SociaFriendYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList);
if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsAddlist, 1);
this.doPushSocialAndLogYgs(socialSetMap, ygsAddlist, 1, reduceMap);
}
// 养工失减少列表
List<SociaFriendYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList);
if (ygsReducelist != null && !ygsReducelist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsReducelist, 2);
this.doPushSocialAndLogYgs(socialSetMap, ygsReducelist, 2, reduceMap);
}
// 医生大新增列表
List<SociaFriendYgsAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
this.doPushSocialAndLogYsd(socialSetMap, ysdAddlist, 3);
this.doPushSocialAndLogYsd(socialSetMap, ysdAddlist, 3, reduceMap);
}
// 医生大减少列表
List<SociaFriendYgsAddVo> ysdReducelist = baseMapper.getSocialSoldierYsdReduceVoList(dispatchIdList);
if (ysdReducelist != null && !ysdReducelist.isEmpty()) {
this.doPushSocialAndLogYsd(socialSetMap, ysdReducelist, 4);
this.doPushSocialAndLogYsd(socialSetMap, ysdReducelist, 4, reduceMap);
}
if ((ygsAddlist == null || ygsAddlist.isEmpty())
&& (ygsReducelist == null || ygsReducelist.isEmpty())
......@@ -148,7 +151,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @return: void
**/
private void doPushSocialAndLogYgs(Map<String, TSocialDeadlineInfo> socialSetMap
, List<SociaFriendYgsAddVo> ygsAddlist, int type) {
, List<SociaFriendYgsAddVo> ygsAddlist, int type, Map<String, TSocialFriendReduceSet> reduceMap) {
int canPushType;
TSocialInfo socialInfo;
String typeStr = "提交";
......@@ -170,8 +173,29 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
boolean nextFlag = false;
SociaFriendYgsAddVo vo;
int i=1;
TSocialFriendReduceSet reduceSet;
for (int index = 0 ; index < ygsAddlist.size(); index++) {
vo = ygsAddlist.get(index);
// 派减离职原因转化:
if (type == 2 && Common.isNotNull(vo.getTbyy())) {
reduceSet = reduceMap.get(vo.getTbyy());
if (reduceSet != null) {
vo.setTbyy(reduceSet.getTbyy());
vo.setZzyy(reduceSet.getZzyy());
vo.setBajcejyy(reduceSet.getBajcejyy());
} else {
remark = "超出离职原因的配置,转人工!配置为:"+vo.getTbyy();
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
logList.add(socialLog);
}
continue;
}
}
// 0:未到时间不动; 1:推送; 2:转人工
canPushType = this.getCanPushType(socialSetMap, vo);
if (1 == canPushType) {
......@@ -261,7 +285,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @return: void
**/
private void doPushSocialAndLogYsd(Map<String, TSocialDeadlineInfo> socialSetMap
, List<SociaFriendYgsAddVo> ysdAddlist, int type) {
, List<SociaFriendYgsAddVo> ysdAddlist, int type, Map<String, TSocialFriendReduceSet> reduceMap) {
int canPushType;
TSocialInfo socialInfo;
String typeStr = "提交";
......@@ -284,10 +308,12 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
boolean nextFlag = false;
SociaFriendYgsAddVo vo;
int i=1;
TSocialFriendReduceSet reduceSet;
for (int index = 0 ; index < ysdAddlist.size(); index++) {
vo = ysdAddlist.get(index);
// 0:未到时间不动; 1:推送; 2:转人工
if ("劳动者死亡".equals(vo.getTbyy())) {
if ("16".equals(vo.getTbyy())) {
remark = "劳动者死亡,转人工!";
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
......@@ -298,6 +324,26 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
logList.add(socialLog);
}
} else {
// 派减离职原因转化:
if (type == 2 && Common.isNotNull(vo.getTbyy())) {
reduceSet = reduceMap.get(vo.getTbyy());
if (reduceSet != null) {
vo.setTbyy(reduceSet.getTbyy());
vo.setZzyy(reduceSet.getZzyy());
vo.setBajcejyy(reduceSet.getBajcejyy());
} else {
remark = "超出医保离职原因的配置,转人工!配置为:"+vo.getTbyy();
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
logList.add(socialLog);
}
continue;
}
}
canPushType = this.getCanPushTypeYsd(socialSetMap, vo);
if (1 == canPushType) {
try {
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFriendReduceSetMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendReduceSetService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 离职原因税友自动化配置表
*
* @author hgw
* @date 2025-04-14 11:57:06
*/
@Log4j2
@Service
public class TSocialFriendReduceSetServiceImpl extends ServiceImpl<TSocialFriendReduceSetMapper, TSocialFriendReduceSet> implements TSocialFriendReduceSetService {
@Override
public Map<String, TSocialFriendReduceSet> getFriendReduceMap() {
List<TSocialFriendReduceSet> list = baseMapper.getTSocialFriendReduceSetList();
// 将list转化为map
if (list != null && !list.isEmpty()) {
Map<String, TSocialFriendReduceSet> map = Maps.newHashMap();
for (TSocialFriendReduceSet reduceSet : list) {
map.put(reduceSet.getId(), reduceSet);
}
return map;
}
return null;
}
}
......@@ -74,18 +74,12 @@
when '2' then '无固定期限劳动合同'
else '固定期限劳动合同' end contractTypeTwo,
a.CONTRACT_END contractEnd,
if(a.REDUCE_REASON = '16','其他原因中断缴费','在职人员主动解除劳动合同') tbyy,
case a.REDUCE_REASON
when '21' then '职工与用人单位协商一致解除劳动合同(18条1款)'
when '5' then '第四十四条第二项,劳动者开始依法享受基本养老保险待遇'
when '16' then '劳动者死亡,或者被人民法院宣告死亡或者宣告失踪'
when '1' then '劳动者提前30天书面通知解除或试用期提前3天通知解除合同'
when '2' then '劳动者严重违反用人单位的规章制度'
else '法律、行政法规规定的其他情形' end zzyy,
s.SOCIAL_PROVINCE socialProvince,
s.SOCIAL_CITY socialCity,
s.SOCIAL_TOWN socialTown,
a.SCHOOL_NAME byyx
a.REDUCE_REASON tbyy,
a.REDUCE_REASON zzyy,
s.SOCIAL_PROVINCE socialProvince,
s.SOCIAL_CITY socialCity,
s.SOCIAL_TOWN socialTown,
a.SCHOOL_NAME byyx
</sql>
......@@ -222,14 +216,8 @@
when '2' then '无固定期限劳动合同'
else '固定期限劳动合同' end contractTypeTwo,
a.CONTRACT_END contractEnd,
if(a.REDUCE_REASON = '16','劳动者死亡','在职人员解除/终止劳动合同') tbyy,
case a.REDUCE_REASON
when '21' then '职工与用人单位协商一致解除劳动合同(18条1款)'
when '5' then '第四十四条第二项,劳动者开始依法享受基本养老保险待遇'
when '16' then '劳动者死亡,或者被人民法院宣告死亡或者宣告失踪'
when '1' then '劳动者提前30天书面通知解除或试用期提前3天通知解除合同'
when '2' then '劳动者严重违反用人单位的规章制度'
else '法律、行政法规规定的其他情形' end zzyy,
a.REDUCE_REASON tbyy,
a.REDUCE_REASON zzyy,
s.SOCIAL_PROVINCE socialProvince,
s.SOCIAL_CITY socialCity,
s.SOCIAL_TOWN socialTown,
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFriendReduceSetMapper">
<resultMap id="tSocialFriendReduceSetMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendReduceSet">
<id property="id" column="ID"/>
<result property="reduceReasonName" column="REDUCE_REASON_NAME"/>
<result property="tbyy" column="TBYY"/>
<result property="zzyy" column="ZZYY"/>
<result property="bajcejyy" column="BAJCEJYY"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.TBYY,
a.ZZYY,
a.BAJCEJYY
</sql>
<!--tSocialFriendReduceSet简单分页查询-->
<select id="getTSocialFriendReduceSetList" resultMap="tSocialFriendReduceSetMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_friend_reduce_set a
</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