Commit 1d4f71a4 authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent ba7fd2d7
......@@ -703,7 +703,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据
if (null != preVo.getDispatchInfoPreVo()) {
initSocialPreInfo(registration, preVo.getDispatchInfoPreVo(), user, domainR.getData());
}
socialDaprUtils.saveSocialPreInfo(preVo);
}
}
......
......@@ -24,7 +24,7 @@ public class TEmployeeInsuranceWorkDayVo implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private Date priDisDate;
@Schema(description = "类型 1 前一个工作日 2 后一个工作日")
@Schema(description = "类型 1 前一个工作日 2 后一个工作日 3当天")
private String type;
@Schema(description = "类型 1 新增 2 其他")
......
......@@ -243,6 +243,7 @@ public class TSocialFundInfoController {
* @return
**/
@Operation(summary = "查询是否存在正常或者在途的社保", description = "查询是否存在正常或者在途的保")
@Inner
@PostMapping("/selectExitEmpSocial")
public Boolean selectExitEmpCopntract(@RequestBody TEmployeeAutoRegistCheckVo cardVo) {
return tSocialFundInfoService.selectExitEmpSocail(cardVo);
......
......@@ -359,10 +359,13 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
.atZone(java.time.ZoneId.systemDefault())
.toLocalDate();
//查找入职日期的前一个工作日
//查找入职日期的前一个/后一个工作日
TEmployeeInsuranceWorkDayVo newVo = new TEmployeeInsuranceWorkDayVo();
newVo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(), CommonConstants.ONE_INT_NEGATE));
newVo.setType(CommonConstants.ONE_STRING);
newVo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(),
null != vo.getType() && CommonConstants.THREE_STRING.equals(vo.getType()) ?
CommonConstants.ZERO_INT : CommonConstants.ONE_INT_NEGATE));
newVo.setType(null != vo.getType() && CommonConstants.THREE_STRING.equals(vo.getType()) ?
CommonConstants.TWO_STRING : CommonConstants.ONE_STRING);
getWorkDay(holidayMap, newVo);
//判断前一个工作日是否大于今天
......
......@@ -1324,7 +1324,7 @@
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保士兵数据查询-->
<!-- 优化后的getSocialSoldierList查询 - 使用EXISTS方案获取最新记录 -->
<select id="getSocialSoldierList" resultMap="socialSoldierExportMap">
SELECT
a.TYPE,
......@@ -1388,11 +1388,22 @@
,if(a.type ='0',DATE_FORMAT(YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',DATE_FORMAT(YSD_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YSD_SOCIAL_START_DATE_NEXT
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
<include refid="where_getSocialSoldier"/>
group by s.id
order by a.AUDIT_TIME desc
LEFT JOIN t_social_info s ON a.SOCIAL_ID = s.id
LEFT JOIN t_dispatch_social_fund_info h ON a.id = h.REDUCE_SOCIAL_FUND_ID
WHERE a.DELETE_FLAG = '0'
AND a.social_id is not null
and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
AND NOT EXISTS (
SELECT 1
FROM t_dispatch_info d2
WHERE d2.SOCIAL_ID = a.SOCIAL_ID
AND d2.DELETE_FLAG = '0'
AND d2.social_id is not null
and (d2.AUTO_FLAG = '0' or d2.AUTO_FLAG_YSD = '0')
AND d2.CREATE_TIME > a.CREATE_TIME
)
<include refid="where_getSocialSoldier_new"/>
ORDER BY a.AUDIT_TIME DESC
</select>
<!--tDispatchInfo 自动化办理查询导出-->
......@@ -1545,10 +1556,9 @@
<result property="backFileFlag" column="BACK_FILE_FLAG"/>
</resultMap>
<!-- hgw 2024-5-10 10:42:33 社保士兵列表查询 -->
<select id="getTSocialSoldierHandlePage" resultMap="socialSoldierPageMap">
SELECT
SUBSTRING_INDEX(GROUP_CONCAT(a.ID ORDER BY a.CREATE_TIME desc),',',1) ID,
a.ID,
a.EMP_ID,
a.EMP_NAME,
a.EMP_NO,
......@@ -1557,8 +1567,8 @@
a.EMP_MOBILE,
a.EMP_NATIONAL,
a.STATUS,
SUBSTRING_INDEX(GROUP_CONCAT(a.TYPE ORDER BY a.CREATE_TIME desc),',',1) TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(a.SOCIAL_ID ORDER BY a.CREATE_TIME desc),',',1) SOCIAL_ID,
a.TYPE,
a.SOCIAL_ID,
a.FUND_ID,
a.TYPE_SUB,
a.PROCESS_INST_ID,
......@@ -1584,7 +1594,7 @@
a.FILE_CITY,
a.FILE_TOWN,
a.CONTRACT_TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(a.SOCIAL_HANDLE_STATUS ORDER BY a.CREATE_TIME desc),',',1) SOCIAL_HANDLE_STATUS,
a.SOCIAL_HANDLE_STATUS,
a.FUND_HANDLE_STATUS,
a.HANDLE_REMARK,
a.AUDIT_REMARK,
......@@ -1620,33 +1630,48 @@
a.ID_CARD_CITY,
a.ID_CARD_TOWN,
a.ID_CARD_ADDRESS,
SUBSTRING_INDEX(GROUP_CONCAT(a.APPLY_NO ORDER BY a.CREATE_TIME desc),',',1) APPLY_NO,
a.APPLY_NO,
a.ORDER_ID,
a.SCHOOL_NAME,
a.MAJOR,
a.FIRST_PAY_TIME,
a.GRADUATION_TIME
,a.SOCIAL_HOUSEHOLD_NAME,s.YGS_HANDLE_STATUS,s.YSD_HANDLE_STATUS
,s.YGS_REMARK,s.YSD_REMARK,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID
,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT
,a.BACK_FILE_FLAG
,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG
,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE_YSD ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_AUTO_LEAVE_DOC ORDER BY a.CREATE_TIME desc),',',1) IS_AUTO_LEAVE_DOC
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YGS ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YGS
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YSD
a.GRADUATION_TIME,
a.SOCIAL_HOUSEHOLD_NAME,
s.YGS_HANDLE_STATUS,
s.YSD_HANDLE_STATUS,
s.YGS_REMARK,
s.YSD_REMARK,
s.YGS_REMARK_OLD,
s.YSD_REMARK_OLD,
s.YGS_REQUEST_ID,
s.YSD_REQUEST_ID,
if(a.type ='0',s.YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT,
if(a.type ='0',s.YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT,
a.BACK_FILE_FLAG,
a.AUTO_FLAG,
a.AUTO_FLAG_YSD,
a.IS_SINGLE,
a.IS_SINGLE_YSD,
a.IS_AUTO_LEAVE_DOC,
a.ROSTER_AUTO_FLAG_YGS,
a.ROSTER_AUTO_FLAG_YSD
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
<include refid="where_getSocialSoldier"/>
group by s.id
order by a.AUDIT_TIME desc
LEFT JOIN t_social_info s ON a.SOCIAL_ID = s.id
LEFT JOIN t_dispatch_social_fund_info h ON a.id = h.REDUCE_SOCIAL_FUND_ID
WHERE a.DELETE_FLAG = '0'
AND a.social_id is not null
and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
AND NOT EXISTS (
SELECT 1
FROM t_dispatch_info d2
WHERE d2.SOCIAL_ID = a.SOCIAL_ID
AND d2.DELETE_FLAG = '0'
AND d2.social_id is not null
and (d2.AUTO_FLAG = '0' or d2.AUTO_FLAG_YSD = '0')
AND d2.CREATE_TIME > a.CREATE_TIME
)
<include refid="where_getSocialSoldier_new"/>
ORDER BY a.AUDIT_TIME DESC
</select>
<!-- hgw 2025-4-25 18:09:12 自动化办理查询——派单维度 -->
......@@ -2220,6 +2245,54 @@
</where>
</sql>
<!-- 社保士兵列表查询 -->
<sql id="where_getSocialSoldier_new">
<include refid="where_getSocialRecordRoster_base"/>
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.backFileFlag != null and tDispatchInfo.backFileFlag.trim() != '' and tDispatchInfo.backFileFlag.trim() != '--'">
AND a.BACK_FILE_FLAG = #{tDispatchInfo.backFileFlag} AND a.type ='0'
</if>
<if test='tDispatchInfo.backFileFlag != null and tDispatchInfo.backFileFlag.trim() == "--"'>
AND a.type ='1'
</if>
<if test="tDispatchInfo.ygsHandleStatus != null and tDispatchInfo.ygsHandleStatus.trim() != ''">
AND s.YGS_HANDLE_STATUS = #{tDispatchInfo.ygsHandleStatus}
</if>
<if test="tDispatchInfo.ysdHandleStatus != null and tDispatchInfo.ysdHandleStatus.trim() != ''">
AND s.YSD_HANDLE_STATUS = #{tDispatchInfo.ysdHandleStatus}
</if>
<if test="tDispatchInfo.ygsRemark != null and tDispatchInfo.ygsRemark.trim() != ''">
AND s.YGS_REMARK like concat('%',#{tDispatchInfo.ygsRemark},'%')
</if>
<if test="tDispatchInfo.ysdRemark != null and tDispatchInfo.ysdRemark.trim() != ''">
AND s.YSD_REMARK like concat('%',#{tDispatchInfo.ysdRemark},'%')
</if>
<if test="tDispatchInfo.ygsYsdHandleStatusArr != null and tDispatchInfo.ygsYsdHandleStatusArr.length > 0">
AND (
s.YGS_HANDLE_STATUS in
<foreach item="idStr" index="index" collection="tDispatchInfo.ygsYsdHandleStatusArr" open="(" separator="," close=")">
#{idStr}
</foreach>
or s.YSD_HANDLE_STATUS in
<foreach item="idStr" index="index" collection="tDispatchInfo.ygsYsdHandleStatusArr" open="(" separator="," close=")">
#{idStr}
</foreach>
)
</if>
<if test="tDispatchInfo.socialHandleStatusArr != null and tDispatchInfo.socialHandleStatusArr.length > 0">
AND a.SOCIAL_HANDLE_STATUS in
<foreach item="idStr" index="index" collection="tDispatchInfo.socialHandleStatusArr" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</if>
</sql>
<sql id="where_getSocialRecordRoster_base">
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
......
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