Commit 9fd50f62 authored by hongguangwu's avatar hongguangwu

MVP1.6.5-社保士兵审核结果查询推送以及拉取以及处理

parent cd3ff24d
......@@ -194,5 +194,28 @@ public class SocialTask {
log.info("------------2定时任务推送社保士兵-定时任务结束------------");
}
/**
* @Description: 3每日定时任务推送社保士兵审核结果查询
* @Author: hgw
* @Date: 2022/7/27 19:39
* @return: void
**/
public void doInnerPushSoldierByAudit() {
log.info("------------3每日定时任务推送社保士兵审核结果查询-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doInnerPushSoldierByAudit","", Object.class, SecurityConstants.FROM_IN);
log.info("------------3每日定时任务推送社保士兵审核结果查询-定时任务结束------------");
}
/**
* @Description: 4每日定时任务获取社保士兵审核结果查询
* @Author: hgw
* @Date: 2022/7/27 19:39
* @return: void
**/
public void doInnerGetSixJobByAudit() {
log.info("------------4每日定时任务获取社保士兵审核结果查询-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doInnerGetSixJobByAudit","", Object.class, SecurityConstants.FROM_IN);
log.info("------------4每日定时任务获取社保士兵审核结果查询-定时任务结束------------");
}
}
/*
* 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 com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 社保自动化审核提交后的审核结果查询记录表
*
* @author hgw
* @date 2024-05-23 17:40:37
*/
@Data
@TableName("t_social_auto_audit_task")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "社保自动化审核提交后的审核结果查询记录表")
public class TSocialAutoAuditTask extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 审核查询的任务ID
*/
@ExcelAttribute(name = "审核查询的任务ID", isNotEmpty = true, errorInfo = "审核查询的任务ID不能为空", maxLength = 32)
@NotBlank(message = "审核查询的任务ID不能为空")
@Length(max = 32, message = "审核查询的任务ID不能超过32个字符")
@ExcelProperty("审核查询的任务ID")
@Schema(description = "审核查询的任务ID")
private String auditId;
/**
* 1养工失;2医生大
*/
@ExcelAttribute(name = "1养工失;2医生大", isNotEmpty = true, errorInfo = "1养工失;2医生大不能为空", maxLength = 1)
@NotBlank(message = "1养工失;2医生大不能为空")
@Length(max = 1, message = "1养工失;2医生大不能超过1个字符")
@ExcelProperty("1养工失;2医生大")
@Schema(description = "1养工失;2医生大")
private String type;
}
......@@ -975,7 +975,7 @@ public class TSocialInfo extends BaseEntity {
@NotBlank(message = "养工失状态不能为空" )
@Length(max = 32, message = "养工失状态 不能超过32个字符" )
@ExcelAttribute(name = "养工失状态", isNotEmpty = true, errorInfo = "办理状态不能为空", maxLength = 32)
@Schema(description = "养工失状态:(0空、1待办理、2自动办理中、3继续办理、4终止办理、5人工处理、6成功)" )
@Schema(description = "养工失状态:(0空、1待办理、2自动办理中、3继续办理、4终止办理、5人工处理、6成功。7提交成功)" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养工失状态" )
private String ygsHandleStatus;
......@@ -985,7 +985,7 @@ public class TSocialInfo extends BaseEntity {
@NotBlank(message = "医生大状态不能为空" )
@Length(max = 32, message = "医生大状态 不能超过32个字符" )
@ExcelAttribute(name = "医生大状态", isNotEmpty = true, errorInfo = "办理状态不能为空", maxLength = 32)
@Schema(description = "医生大状态:(0空、1待办理、2自动办理中、3继续办理、4终止办理、5人工处理、6成功)" )
@Schema(description = "医生大状态:(0空、1待办理、2自动办理中、3继续办理、4终止办理、5人工处理、6成功。7提交成功)" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医生大状态" )
private String ysdHandleStatus;
......@@ -1017,7 +1017,7 @@ public class TSocialInfo extends BaseEntity {
@ExcelProperty("养工失反馈-原反馈" )
private String ygsRemarkOld;
/**
* 医生大反馈-原反馈
* 医生大反馈-原反馈——额外作用:新增(初次在缴纳地参保)、续保
*/
@Length(max = 500, message = "医生大反馈-原反馈 不能超过500个字符" )
@ExcelAttribute(name = "医生大反馈-原反馈", maxLength = 500)
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵养工失审核结果查询模板
* @Date 2024-5-24 10:47:25
**/
@Data
public class SocialSoldierYgsAuditVo implements Serializable {
// 社保id,用于回写
@ExcelIgnore
private String socialId;
// #企业名称 业务类型 开始日期 结束日期 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String socialHouseholdName;
@ExcelProperty("业务类型")
private String type;
@ExcelProperty("开始日期")
private String startDate;
@ExcelProperty("结束日期")
private String endDate;
@ExcelProperty("回传信息")
private String backInfo;
@ExcelProperty("回传信息1")
private String backInfoOne;
@ExcelProperty("回传信息2")
private String backInfoTwo;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵医生大审核结果查询模板
* @Date 2024-5-24 10:47:25
**/
@Data
public class SocialSoldierYsdAuditVo implements Serializable {
// 社保id,用于回写
@ExcelIgnore
private String socialId;
// #企业名称 业务类型 申办日期起 申办日期止 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String socialHouseholdName;
@ExcelProperty("业务类型")
private String type;
@ExcelProperty("申办日期起")
private String startDate;
@ExcelProperty("申办日期止")
private String endDate;
@ExcelProperty("回传信息")
private String backInfo;
@ExcelProperty("回传信息1")
private String backInfoOne;
@ExcelProperty("回传信息2")
private String backInfoTwo;
}
/*
* 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.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import lombok.Data;
import java.io.Serializable;
/**
* 社保士兵审核结果反馈文件解析
*
* @author hgw
* @date 2024-5-27 11:14:07
*/
@Data
public class TSocialSoldierReturnAuditErrorVo extends RowIndex implements Serializable {
@ExcelProperty("错误信息")
private String errorInfo;
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("证件号码")
private String idCard;
@ExcelProperty("姓名")
private String empName;
@ExcelProperty("审核状态")
private String auditStatus;
// 医保有值,社保没值
@ExcelProperty("审核意见")
private String ysdRemark;
// 社保独有的列
@ExcelProperty("操作")
private String ygsOperation;
}
......@@ -115,6 +115,8 @@ public class SocialConfig {
sheMap.put("社保增员", sheBaoArrObj.getString("value"));
} else if ("社保减员".equals(sheBaoArrObj.get("label"))) {
sheMap.put("社保减员", sheBaoArrObj.getString("value"));
} else if ("审核数据查询".equals(sheBaoArrObj.get("label"))) {
sheMap.put("审核数据查询", sheBaoArrObj.getString("value"));
}
}
} else if ("医保".equals(childrenArrObj.get("label"))) {
......@@ -125,6 +127,8 @@ public class SocialConfig {
sheMap.put("医保增员", sheBaoArrObj.getString("value"));
} else if ("医保减员".equals(sheBaoArrObj.get("label"))) {
sheMap.put("医保减员", sheBaoArrObj.getString("value"));
} else if ("审核数据信息查询".equals(sheBaoArrObj.get("label"))) {
sheMap.put("审核数据信息查询", sheBaoArrObj.getString("value"));
}
}
}
......@@ -268,12 +272,13 @@ public class SocialConfig {
}
/**
* @param: fileKey : resultFile 查看文件; resultAnnex 查看附件
* @Description: 5:任务查询接口
* @Author: hgw
* @Date: 2024-5-8 15:07:45
* @return: java.lang.String
**/
public R<String> getFiveJob(RestTemplate restTemplate, String addId) {
public R<String> getFiveJob(RestTemplate restTemplate, String addId, String fileKey) {
if (Common.isEmpty(addId)) {
return null;
}
......@@ -300,7 +305,7 @@ public class SocialConfig {
if (!"完成".equals(statusStr)) {
return R.failed(statusStr);
}
resultFile = dataObject.getString("resultFile");
resultFile = dataObject.getString(fileKey);
if (Common.isEmpty(resultFile)) {
return R.failed(resultFile);
}
......
......@@ -79,7 +79,7 @@ public class TSocialSoldierController {
**/
@Operation(description = "1定时任务获取社保士兵状态")
@PostMapping("/inner/doInnerGetFiveJob")
@SysLog("每日1定时任务获取社保士兵状态")
@SysLog("1每日定时任务获取社保士兵状态")
@Inner
public R<String> doInnerGetFiveJob() {
return tSocialSoldierService.getFiveJob(null);
......@@ -93,9 +93,38 @@ public class TSocialSoldierController {
**/
@Operation(description = "2定时任务推送社保士兵")
@PostMapping("/inner/doInnerPushSoldier")
@SysLog("每日2定时任务推送社保士兵")
@SysLog("2每日定时任务推送社保士兵")
@Inner
public R<String> doInnerPushSoldier() {
return tSocialSoldierPushService.pushSoldier(null);
}
/**
* @Description: 3每日定时任务推送社保士兵审核结果查询
* @Author: hgw
* @Date: 2024-5-24 17:01:56
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "3每日定时任务推送社保士兵审核结果查询")
@PostMapping("/inner/doInnerPushSoldierByAudit")
@SysLog("4每日定时任务推送社保士兵审核结果查询")
@Inner
public R<String> doInnerPushSoldierByAudit() {
return tSocialSoldierPushService.pushSoldierByAudit();
}
/**
* @Description: 4每日定时任务获取社保士兵审核结果查询
* @Author: hgw
* @Date: 2024-5-24 17:02:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "4每日定时任务获取社保士兵审核结果查询")
@PostMapping("/inner/doInnerGetSixJobByAudit")
@SysLog("3每日定时任务获取社保士兵审核结果查询")
@Inner
public R<String> doInnerGetSixJobByAudit() {
return tSocialSoldierService.getSixJobByAudit();
}
}
/*
* 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.TSocialAutoAuditTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 社保自动化审核提交后的审核结果查询记录表
*
* @author hgw
* @date 2024-05-23 17:40:37
*/
@Mapper
public interface TSocialAutoAuditTaskMapper extends BaseMapper<TSocialAutoAuditTask> {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialAutoAuditTask 社保自动化审核提交后的审核结果查询记录表
* @return
*/
List<TSocialAutoAuditTask> getTSocialAutoAuditTaskList(@Param("tSocialAutoAuditTask") TSocialAutoAuditTask tSocialAutoAuditTask);
}
......@@ -50,6 +50,15 @@ public interface TSocialInfoMapper extends BaseMapper<TSocialInfo> {
**/
List<TSocialInfo> getSocialSoldierYgsAll();
List<TSocialInfo> getSocialSoldierYsdAll();
/**
* @param
* @Description: 获取所有需要社保局审核的社保
* @Author: hgw
* @Date: 2024-5-24 17:07:00
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo>
**/
List<TSocialInfo> getSocialSoldierYgsByAudit();
List<TSocialInfo> getSocialSoldierYsdByAudit();
/**
* @param addId 任务id
......
......@@ -59,4 +59,25 @@ public interface TSocialSoldierMapper extends BaseMapper<TSocialInfo> {
* @Date 2024-5-10 21:16:41
**/
List<SocialSoldierYgsAddVo> getSocialSoldierYsdReduceVoList(@Param("idsStr") List<String> idsStr);
/**
* 社保士兵养工失审核模板
* @Author hgw
* @Date 2024-5-24 16:39:43
**/
List<SocialSoldierYgsAuditVo> getSocialSoldierYgsAuditVoList();
/**
* 社保士兵医生大审核续保模板
* @Author hgw
* @Date 2024-5-24 16:39:43
**/
List<SocialSoldierYsdAuditVo> getSocialSoldierYsdAuditVoList();
/**
* 社保士兵医生大审核新增模板
* @Author hgw
* @Date 2024-5-24 16:39:43
**/
List<SocialSoldierYsdAuditVo> getSocialSoldierYsdAddAuditVoList();
}
/*
* 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.TSocialAutoAuditTask;
import java.util.List;
/**
* 社保自动化审核提交后的审核结果查询记录表
*
* @author hgw
* @date 2024-05-23 17:40:37
*/
public interface TSocialAutoAuditTaskService extends IService<TSocialAutoAuditTask> {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialAutoAuditTask 社保自动化审核提交后的审核结果查询记录表
* @return
*/
List<TSocialAutoAuditTask> getTSocialAutoAuditTaskList(TSocialAutoAuditTask tSocialAutoAuditTask);
}
......@@ -66,6 +66,14 @@ public interface TSocialInfoService extends IService<TSocialInfo> {
**/
List<TSocialInfo> getSocialSoldierYgsAll();
List<TSocialInfo> getSocialSoldierYsdAll();
/**
* @Description: 获取所有需要审核结果的社保
* @Author: hgw
* @Date: 2024-5-24 17:05:46
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo>
**/
List<TSocialInfo> getSocialSoldierYgsByAudit();
List<TSocialInfo> getSocialSoldierYsdByAudit();
/**
* @param addId 任务id
......
......@@ -49,4 +49,13 @@ public interface TSocialSoldierPushService extends IService<TSocialInfo> {
**/
R<String> pushSoldier(List<String> dispatchIdList);
/**
* @param
* @Description: 推送当月所有提交社保局后,待社保局审核的查询任务
* @Author: hgw
* @Date: 2024/5/23 18:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> pushSoldierByAudit();
}
......@@ -39,4 +39,12 @@ public interface TSocialSoldierService extends IService<TSocialInfo> {
**/
R<String> getFiveJob(String addId);
/**
* @Description: 查看社保士兵审核结果查询的反馈情况
* @Author: hgw
* @Date: 2024-5-24 17:02:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> getSixJobByAudit();
}
/*
* 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.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoAuditTask;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialAutoAuditTaskMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialAutoAuditTaskService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 社保自动化审核提交后的审核结果查询记录表
*
* @author hgw
* @date 2024-05-23 17:40:37
*/
@Log4j2
@Service
public class TSocialAutoAuditTaskServiceImpl extends ServiceImpl<TSocialAutoAuditTaskMapper, TSocialAutoAuditTask> implements TSocialAutoAuditTaskService {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialAutoAuditTask 社保自动化审核提交后的审核结果查询记录表
* @return
*/
@Override
public List<TSocialAutoAuditTask> getTSocialAutoAuditTaskList(TSocialAutoAuditTask tSocialAutoAuditTask) {
return baseMapper.getTSocialAutoAuditTaskList(tSocialAutoAuditTask);
}
}
......@@ -452,6 +452,28 @@ public class TSocialInfoServiceImpl extends ServiceImpl<TSocialInfoMapper, TSoci
public List<TSocialInfo> getSocialSoldierYsdAll() {
return baseMapper.getSocialSoldierYsdAll();
}
/**
* @param
* @Description: 获取所有需要社保局审核的社保
* @Author: hgw
* @Date: 2024/5/11 14:55
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo>
**/
@Override
public List<TSocialInfo> getSocialSoldierYgsByAudit() {
return baseMapper.getSocialSoldierYgsByAudit();
}
/**
* @param
* @Description: 获取所有需要社保局审核的社保
* @Author: hgw
* @Date: 2024/5/11 14:55
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo>
**/
@Override
public List<TSocialInfo> getSocialSoldierYsdByAudit() {
return baseMapper.getSocialSoldierYsdByAudit();
}
/**
* @param
......
......@@ -25,12 +25,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.social.config.SocialConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoAuditTask;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialAutoAuditTaskService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierPushService;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSetVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAddVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAuditVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.IOUtils;
......@@ -62,6 +66,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
private RestTemplate restTemplate = new RestTemplate();
private final SocialConfig socialConfig;
private final TSocialInfoService tSocialInfoService;
private final TSocialAutoAuditTaskService tSocialAutoAuditTaskService;
/**
* @param socialList
......@@ -99,6 +104,12 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
return R.ok("推送成功!");
}
/**
* @Description: 组装社保与医保的文件流
* @Author: hgw
* @Date: 2024/5/23 17:59
* @return: org.springframework.web.multipart.MultipartFile
**/
public MultipartFile getFile(List<SocialSoldierYgsAddVo> list, int type) {
if (list != null) {
String fileName = "soldierFile" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
......@@ -223,4 +234,115 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
return R.ok("推送成功!!");
}
/**
* @Description: 推送社保士兵审核结果查询文件
* @Author: hgw
* @Date: 2024-5-23 18:02:27
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> pushSoldierByAudit() {
// 养工失待审核列表
List<SocialSoldierYgsAuditVo> ygsAddlist = baseMapper.getSocialSoldierYgsAuditVoList();
log.info("养工失待审核列表="+ygsAddlist);
String sheetName = "审核数据查询";
if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
MultipartFile file = this.getFileByAudit(ygsAddlist, null, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYgsAuditVo vo : ygsAddlist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
// 医生大【续保】待审核列表
List<SocialSoldierYsdAuditVo> ysdXuBaolist = baseMapper.getSocialSoldierYsdAuditVoList();
log.info("医生大【续保】待审核列表="+ysdXuBaolist);
sheetName = "审核数据信息查询";
if (ysdXuBaolist != null && !ysdXuBaolist.isEmpty()) {
MultipartFile file = this.getFileByAudit(null, ysdXuBaolist, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYsdAuditVo vo : ysdXuBaolist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
// 医生大【新增】待审核列表
List<SocialSoldierYsdAuditVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddAuditVoList();
log.info("医生大【新增】待审核列表="+ysdAddlist);
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
MultipartFile file = this.getFileByAudit(null, ysdAddlist, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYsdAuditVo vo : ysdAddlist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
if (ygsAddlist == null || ysdXuBaolist == null|| ysdAddlist == null) {
return R.failed("无数据,推送结束!");
}
return R.ok("推送成功!!");
}
/**
* @Description: 推送审核结果的查询
* @Author: hgw
* @Date: 2024/5/23 18:09
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
public R<String> getOneAppGetModuleDetailByAudit(List<TSocialInfo> socialList, MultipartFile file, String type) {
// 1获取模板id——社保增员、社保减员、医保增员、医保减员
Map<String, String> moduleDetailMap = socialConfig.getOneModuleDetailMap(restTemplate);
if (moduleDetailMap != null && !moduleDetailMap.isEmpty() && moduleDetailMap.get(type) != null) {
// 2获取机器id
String terminalId = socialConfig.getTwoTerminalId(restTemplate, moduleDetailMap.get(type));
if (Common.isNotNull(terminalId)) {
// 3上传文件,获取文件地址
String fileAddUrl = socialConfig.getThreeTerminalId(restTemplate, file);
// 4 推送办理任务,返回任务id:
String addId = socialConfig.getFourAppAdd(restTemplate, fileAddUrl, moduleDetailMap.get(type), terminalId);
for (TSocialInfo socialInfo : socialList) {
if ("审核数据查询".equals(type)) {
socialInfo.setYgsAddId(addId);
} else {
socialInfo.setYsdAddId(addId);
}
}
tSocialInfoService.updateBatchById(socialList);
}
}
return R.ok("推送成功!");
}
/**
* @Description: 组装社保与医保的文件流
* @Author: hgw
* @Date: 2024/5/23 17:59
* @return: org.springframework.web.multipart.MultipartFile
**/
public MultipartFile getFileByAudit(List<SocialSoldierYgsAuditVo> listYgs, List<SocialSoldierYsdAuditVo> listYsd, String sheetName) {
String fileName = "soldierAuditFile" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
if (listYgs != null) {
EasyExcelFactory.write(fileName, SocialSoldierYgsAuditVo.class).sheet(sheetName).doWrite(listYgs);
} else {
EasyExcelFactory.write(fileName, SocialSoldierYsdAuditVo.class).sheet(sheetName).doWrite(listYsd);
}
File file = new File(fileName);
return getMultipartFile(file);
}
}
......@@ -16,6 +16,7 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import cn.hutool.core.util.CharsetUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -29,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TAuditInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierReturnAuditErrorVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierReturnErrorVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -37,19 +39,24 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* 社保士兵
......@@ -70,6 +77,265 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
private final TAuditInfoService tAuditInfoService;
/**
* @Description: 6 查看社保士兵审核结果查询的反馈情况
* @Author: hgw
* @Date: 2024/5/11 15:08
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> getSixJobByAudit() {
// 获取所有需要反馈的任务id
List<TSocialInfo> socialList = tSocialInfoService.getSocialSoldierYgsByAudit();
List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialSoldierYsdByAudit();
if (socialYsdList != null && !socialYsdList.isEmpty()) {
if (socialList != null && !socialList.isEmpty()) {
socialList.addAll(socialYsdList);
} else {
socialList = socialYsdList;
}
}
if (socialList != null && !socialList.isEmpty()) {
Map<String, TSocialInfo> idCardMap = new HashMap<>();
Set<String> addIdSet = new HashSet<>();
for (TSocialInfo socialInfo : socialList) {
if (Common.isNotNull(socialInfo.getYgsAddId())) {
addIdSet.add(socialInfo.getYgsAddId());
idCardMap.put(socialInfo.getYgsAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
if (Common.isNotNull(socialInfo.getYsdAddId())) {
addIdSet.add(socialInfo.getYsdAddId());
idCardMap.put(socialInfo.getYsdAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
}
HttpURLConnection conn;
InputStream in = null;
Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap();
if (!addIdSet.isEmpty()) {
for (String doAddId : addIdSet) {
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId, "resultAnnex");
log.info("resultFileByAudit=" + resultFile);
try {
// 解决中文文件名的乱码问题
String fileTeturnUrl = resultFile.getData();
if (Common.isNotNull(fileTeturnUrl)) {
String dowloadUrl = fileTeturnUrl;
int indexOf = fileTeturnUrl.lastIndexOf("/") + 1;
fileTeturnUrl = fileTeturnUrl.substring(indexOf);
try {
fileTeturnUrl = URLEncoder.encode(fileTeturnUrl, "UTF-8");
} catch (UnsupportedEncodingException e) {
log.info("编码异常!");
}
dowloadUrl = dowloadUrl.substring(0, indexOf) + fileTeturnUrl;
URL url = new URL(dowloadUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
in = conn.getInputStream();
// 实际读取文件内容
this.readZip(in, idCardMap, errorMap, doAddId);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
return R.ok();
}
public R<List<TSocialSoldierReturnAuditErrorVo>> readZip(InputStream inputStream, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
TSocialSoldierReturnAuditErrorVo vo;
List<TSocialSoldierReturnAuditErrorVo> voList = new ArrayList<>();
XSSFWorkbook sheets = null;
ZipInputStream zin = null;
BufferedInputStream bs = null;
try {
zin = new ZipInputStream(inputStream, CharsetUtil.CHARSET_GBK);
bs = new BufferedInputStream(zin);
byte[] bytes = null;
ZipEntry ze;
//循环读取压缩包里面的文件
while ((ze = zin.getNextEntry()) != null) {
String name = ze.getName();
if (ze.toString().endsWith(".xls") && Common.isNotNull(name) && name.contains("汇总")) {
//读取每个文件的字节,并放进数组
bytes = new byte[(int) ze.getSize()];
bs.read(bytes, 0, (int) ze.getSize());
//将文件转成流
InputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
sheets = new XSSFWorkbook(byteArrayInputStream);
// sheet
XSSFSheet sheetAt = sheets.getSheetAt(0);
XSSFRow row;
// 每个单元格内容
String cellValue;
XSSFCell cell;
// 循环每个sheet
if (sheetAt != null && Common.isNotNull(sheetAt.getSheetName())) {
// 错误信息 所在列
Integer errorInfoNum = null;
// 企业名称 所在列
Integer companyNameNum = null;
// 证件号码 所在列
Integer idCardNum = null;
// 姓名 所在列
Integer empNameNum = null;
// 审核状态 所在列
Integer auditStatusNum = null;
// 审核意见 所在列
Integer ysdRemarkNum = null;
// 操作 所在列
Integer ygsOperationNum = null;
// 错误信息
String errorInfo;
// 企业名称
String companyName;
// 证件号码
String idCard;
// 姓名
String empName;
// 审核状态 : // 空、待审核、撤回或作废数据、审核不通过、审核通过
String auditStatus;
// 审核意见
String ysdRemark;
// 操作
String ygsOperation;
for (int rowNum = 0; rowNum <= sheetAt.getLastRowNum(); rowNum++) {
row = sheetAt.getRow(rowNum);
if (row != null) {
// 初始化
ysdRemark = null;
ygsOperation = null;
// 循环当前行的内容
if (rowNum == 0) {
for (int cellNum = 0; cellNum < row.getLastCellNum(); cellNum++) {
// 标题行
cell = row.getCell(cellNum);
cellValue = "";
try {
if (cell != null) {
if (CellType.STRING == cell.getCellType()) {
cellValue = row.getCell(cellNum).getStringCellValue();
} else if (CellType.NUMERIC == cell.getCellType()) {
cellValue = String.valueOf(row.getCell(cellNum).getNumericCellValue());
if (cellValue.contains("E")) {
cellValue = String.valueOf(new DecimalFormat("#").format(row.getCell(cellNum).getNumericCellValue()));
}
}
}
} catch (NumberFormatException e) {
cell.setCellType(CellType.STRING);
cellValue = String.valueOf(row.getCell(cellNum).getStringCellValue());
}
if ("错误信息".equals(cellValue)) {
errorInfoNum = cellNum;
} else if ("企业名称".equals(cellValue)) {
companyNameNum = cellNum;
} else if ("证件号码".equals(cellValue)) {
idCardNum = cellNum;
} else if ("姓名".equals(cellValue)) {
empNameNum = cellNum;
} else if ("审核状态".equals(cellValue)) {
auditStatusNum = cellNum;
} else if ("审核意见".equals(cellValue)) {
// 医保
ysdRemarkNum = cellNum;
} else if ("操作".equals(cellValue)) {
// 社保
ygsOperationNum = cellNum;
}
}
} else {
if (Common.isEmpty(auditStatusNum) && Common.isEmpty(idCardNum)) {
return R.failed("未找到对应表头!");
} else {
if (Common.isNotNull(errorInfoNum)) {
errorInfo = getCellValue(row, errorInfoNum);
vo = new TSocialSoldierReturnAuditErrorVo();
vo.setErrorInfo(errorInfo);
voList.add(vo);
return R.failed("数据错误!!");
} else {
if (Common.isNotNull(idCardNum) && Common.isNotNull(companyNameNum)
&& Common.isNotNull(empNameNum) && Common.isNotNull(auditStatusNum)) {
companyName = getCellValue(row, companyNameNum);
idCard = getCellValue(row, idCardNum);
empName = getCellValue(row, empNameNum);
auditStatus = getCellValue(row, auditStatusNum);
if (Common.isNotNull(ysdRemarkNum)) {
ysdRemark = getCellValue(row, ysdRemarkNum);
}
if (Common.isNotNull(ygsOperationNum)) {
ygsOperation = getCellValue(row, ygsOperationNum);
}
vo = new TSocialSoldierReturnAuditErrorVo();
vo.setCompanyName(companyName);
vo.setIdCard(idCard);
vo.setEmpName(empName);
vo.setAuditStatus(auditStatus);
vo.setYsdRemark(ysdRemark);
vo.setYgsOperation(ygsOperation);
voList.add(vo);
}
}
}
}
}
}
}
}
}
zin.closeEntry();
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
if (sheets != null) {
try {
sheets.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
} finally {
try {
if (sheets != null) {
sheets.close();
}
if (zin != null) {
zin.close();
}
if (bs != null) {
bs.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
if (!voList.isEmpty()) {
importTSocialSoldierByAudit(voList, idCardMap, errorMap, doAddId);
}
return R.ok(voList);
}
/**
* @param addId
* @Description: 5 查看任务进度
......@@ -112,7 +378,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap();
if (!addIdSet.isEmpty()) {
for (String doAddId : addIdSet) {
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId);
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId, "resultFile");
log.info("resultFile=" + resultFile);
try {
// 解决中文文件名的乱码问题
......@@ -322,6 +588,264 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
return cellValue;
}
private String getCellValue(XSSFRow row, int cellNum) {
XSSFCell cell = row.getCell(cellNum);
String cellValue = "";
try {
if (cell != null) {
if (CellType.STRING == cell.getCellType()) {
cellValue = row.getCell(cellNum).getStringCellValue();
} else if (CellType.NUMERIC == cell.getCellType()) {
cellValue = String.valueOf(row.getCell(cellNum).getNumericCellValue());
if (cellValue.contains("E")) {
cellValue = String.valueOf(new DecimalFormat("#").format(row.getCell(cellNum).getNumericCellValue()));
}
}
}
} catch (NumberFormatException e) {
cell.setCellType(CellType.STRING);
cellValue = String.valueOf(row.getCell(cellNum).getStringCellValue());
}
return cellValue;
}
/**
* @Description: 社保士兵审核结果的处理
* @Author: hgw
* @Date: 2024/5/27 11:30
* @return: void
**/
private void importTSocialSoldierByAudit(List<TSocialSoldierReturnAuditErrorVo> excelVOList, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
// 个性化校验逻辑
// 执行数据插入操作 组装
TSocialSoldierReturnAuditErrorVo excel;
String empIdCard;
String auditRemark;
TSocialInfo socialInfo;
List<TSocialInfo> updateSocialList = new ArrayList<>();
TSocialInfo updateSocial;
// true养工失 false 医生大
boolean typeFlag = true;
FailReasonConfig failConfig;
String ygsHandleStatus;
String ysdHandleStatus;
// 养工失办理成功的单子
List<String> ygsList = new ArrayList<>();
// 养工失办理失败的单子
List<String> ygsFailList = new ArrayList<>();
// 医生大办理成功的单子
List<String> ysdList = new ArrayList<>();
// 医生大办理失败的单子
List<String> ysdFailList = new ArrayList<>();
Map<String, TSocialInfo> socialMap = new HashMap<>();
// 处理社保办理成功后的状态同步-成功
String typeSub = CommonConstants.ZERO_STRING;
String handleStatus;
String title = null;
String handleRemark = null;
String remark = null;
String socialType;
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("1", 1L, "", "社保士兵",
"社保士兵", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
empIdCard = excel.getIdCard();
auditRemark = excel.getYgsOperation();
if (Common.isEmpty(auditRemark)) {
auditRemark = excel.getYsdRemark();
typeFlag = false;
}
if (Common.isNotNull(empIdCard)) {
title = "社保";
socialInfo = idCardMap.get(doAddId + CommonConstants.DOWN_LINE_STRING + empIdCard);
if (socialInfo != null) {
if (typeFlag && CommonConstants.SEVEN_STRING.equals(socialInfo.getYgsHandleStatus())) {
updateSocial = socialMap.get(socialInfo.getId());
if (updateSocial == null) {
updateSocial = new TSocialInfo();
updateSocial.setId(socialInfo.getId());
}
// 空、待审核、撤回或作废数据、审核不通过、审核通过
if ("审核通过".equals(excel.getAuditStatus())) {
ygsHandleStatus = CommonConstants.SIX_STRING;
ygsList = new ArrayList<>();
ygsList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理成功!";
remark = handleRemark;
if (Common.isNotNull(auditRemark)) {
failConfig = getConfig(auditRemark, errorMap);
if (failConfig != null) {
updateSocial.setYgsRemark(failConfig.getSimpleReason());
}
updateSocial.setYgsRemarkOld(handleRemark);
} else {
updateSocial.setYgsRemark(handleRemark);
updateSocial.setYgsRemarkOld(auditRemark);
}
} else if ("审核不通过".equals(excel.getAuditStatus())) {
handleRemark = "社保士兵审核不通过转人工处理!";
remark = auditRemark;
handleRemark += remark;
updateSocial.setYgsRemark(handleRemark);
updateSocial.setYgsRemarkOld(auditRemark);
ygsHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title += "派增";
} else {
title += "派减";
}
title += "养老、工伤、失业" + handleRemark;
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
} else {
updateSocial.setYgsRemark(auditRemark);
updateSocial.setYgsRemarkOld(auditRemark);
/*// 过期自动变为终止
if (CommonConstants.ONE_STRING.equals(socialInfo.getYgsOverDueFlag())) {
handleRemark = "已过期,自动中止办理!";
updateSocial.setYgsRemarkOld(handleRemark);
ygsHandleStatus = CommonConstants.FOUR_STRING;
ygsFailList = new ArrayList<>();
ygsFailList.add(socialInfo.getDispatchId());
remark = handleRemark;
} else if (Common.isNotNull(auditRemark)) {*/
handleRemark = "社保士兵审核结果:" + excel.getAuditStatus();
remark = auditRemark;
handleRemark += remark;
updateSocial.setYgsRemark(handleRemark);
updateSocial.setYgsRemarkOld(handleRemark);
ygsHandleStatus = CommonConstants.SEVEN_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title += "派增";
} else {
title += "派减";
}
title += "养老、工伤、失业" + handleRemark;
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
//}
}
updateSocial.setYgsHandleStatus(ygsHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
} else if (!typeFlag && CommonConstants.SEVEN_STRING.equals(socialInfo.getYsdHandleStatus())) {
updateSocial = socialMap.get(socialInfo.getId());
if (updateSocial == null) {
updateSocial = new TSocialInfo();
updateSocial.setId(socialInfo.getId());
}
// 空、待审核、撤回或作废数据、审核不通过、审核通过
if ("审核通过".equals(excel.getAuditStatus())) {
ysdHandleStatus = CommonConstants.SIX_STRING;
ysdList = new ArrayList<>();
ysdList.add(socialInfo.getDispatchId());
handleRemark = "社保士兵自动办理成功!";
remark = handleRemark;
if (Common.isNotNull(auditRemark)) {
failConfig = getConfig(auditRemark, errorMap);
if (failConfig != null) {
updateSocial.setYsdRemark(failConfig.getSimpleReason());
}
updateSocial.setYsdRemarkOld(handleRemark);
} else {
updateSocial.setYsdRemark(handleRemark);
updateSocial.setYsdRemarkOld(auditRemark);
}
} else if ("审核不通过".equals(excel.getAuditStatus())) {
handleRemark = "社保士兵审核不通过转人工处理!";
remark = auditRemark;
handleRemark += remark;
updateSocial.setYsdRemark(handleRemark);
updateSocial.setYsdRemarkOld(auditRemark);
ysdHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title += "派增";
} else {
title += "派减";
}
title += "医疗、生育、大病" + handleRemark;
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
} else {
updateSocial.setYsdRemark(auditRemark);
// 过期自动变为终止——这块加查询sql影响性能,且暂时没有这要求 hgw 2024-5-27 15:54:24
/*if (CommonConstants.ONE_STRING.equals(socialInfo.getYsdOverDueFlag())) {
handleRemark = "已过期,自动中止办理!";
updateSocial.setYsdRemarkOld(handleRemark);
ysdHandleStatus = CommonConstants.FOUR_STRING;
ysdFailList = new ArrayList<>();
ysdFailList.add(socialInfo.getDispatchId());
remark = handleRemark;
} else if (Common.isNotNull(auditRemark)) {*/
handleRemark = "社保士兵审核结果:" + excel.getAuditStatus();
remark = auditRemark;
handleRemark += remark;
updateSocial.setYsdRemark(handleRemark);
// 此时不能更新old,因为医疗要判断是新增还是续期,要根据这个字段来判断
// updateSocial setYgsRemarkOld(handleRemark)
ysdHandleStatus = CommonConstants.SEVEN_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title += "派增";
} else {
title += "派减";
}
title += "医疗、生育、大病" + handleRemark;
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
//}
}
updateSocial.setYsdHandleStatus(ysdHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
}
// 处理社保办理成功或失败,
if (!updateSocialList.isEmpty()) {
tSocialInfoService.updateBatchById(updateSocialList);
updateSocialList = new ArrayList<>();
}
handleStatus = CommonConstants.ONE_STRING;
// 处理社保办理成功后的状态同步-成功
if (!ygsList.isEmpty()) {
socialType = "1,4,3";
this.doSocialAndDispatch(ygsList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
if (!ysdList.isEmpty()) {
socialType = "2,5,6";
this.doSocialAndDispatch(ysdList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
// 处理社保办理成功后的状态同步-失败
handleStatus = CommonConstants.TWO_STRING;
if (!ygsFailList.isEmpty()) {
socialType = "1,4,3";
this.doSocialAndDispatch(ygsFailList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
if (!ysdFailList.isEmpty()) {
socialType = "2,5,6";
this.doSocialAndDispatch(ysdFailList, typeSub, handleStatus, handleRemark, socialType, remark, user);
}
}
}
}
}
/**
* @Description: 社保士兵审核前的处理
* @Author: hgw
* @Date: 2024/5/27 11:29
* @return: void
**/
private void importTSocialInfo(List<TSocialSoldierReturnErrorVo> excelVOList, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
// 个性化校验逻辑
......@@ -352,7 +876,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
String title = null;
String handleRemark = null;
String remark = null;
String socialType ;
String socialType;
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
......@@ -407,19 +931,19 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYgsRemarkOld(handleRemark);
}*/
handleRemark = "社保士兵提交成功";
handleRemark = "社保士兵提交成功";
remark = handleRemark;
updateSocial.setYgsRemark(handleRemark);
updateSocial.setYgsRemarkOld(handleRemark);
ygsHandleStatus = CommonConstants.FIVE_STRING;
ygsHandleStatus = CommonConstants.SEVEN_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="养老、工伤、失业提交成功转人工处理!";
this.doSocialTAuditInfo(socialInfo, title, title, title,user);
title += "养老、工伤、失业提交成功!";
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
} else {
updateSocial.setYgsRemark(excel.getMsg());
updateSocial.setYgsRemarkOld(excel.getMsg());
......@@ -434,7 +958,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
remark = handleRemark;
} else if (Common.isNotNull(excel.getMsg())) {
// 如果找到了失败原因配置:
failConfig = getConfig(excel.getMsg(),errorMap);
failConfig = getConfig(excel.getMsg(), errorMap);
if (failConfig != null) {
updateSocial.setYgsRemark(failConfig.getSimpleReason());
// failConfig.getReplay() 1 继续办理 2 中止办理 3 人工办理
......@@ -443,40 +967,40 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ygsHandleStatus = CommonConstants.THREE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="养老、工伤、失业办理失败!继续办理:"+failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(),user);
title += "养老、工伤、失业办理失败!继续办理:" + failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(), user);
} else if (CommonConstants.TWO_STRING.equals(failConfig.getReplay())) {
ygsHandleStatus = CommonConstants.FOUR_STRING;
ygsFailList = new ArrayList<>();
ygsFailList.add(socialInfo.getDispatchId());
handleRemark = "中止办理:"+failConfig.getSimpleReason();
handleRemark = "中止办理:" + failConfig.getSimpleReason();
remark = "中止办理:" + failConfig.getSimpleReason();
} else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) {
ygsHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="养老、工伤、失业办理失败!人工处理:"+failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(),user);
title += "养老、工伤、失业办理失败!人工处理:" + failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(), user);
}
} else {
ygsHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="养老、工伤、失业办理失败!人工处理:"+excel.getMsg();
this.doSocialTAuditInfo(socialInfo, title, "养老、工伤、失业办理失败!人工处理:"+excel.getMsg(), excel.getMsg(),user);
title += "养老、工伤、失业办理失败!人工处理:" + excel.getMsg();
this.doSocialTAuditInfo(socialInfo, title, "养老、工伤、失业办理失败!人工处理:" + excel.getMsg(), excel.getMsg(), user);
}
}
}
......@@ -509,19 +1033,22 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYsdRemark(handleRemark);
updateSocial.setYsdRemarkOld(handleRemark);
}*/
handleRemark = "社保士兵提交成功";
handleRemark = "社保士兵提交成功:" + excel.getMsg();
remark = handleRemark;
updateSocial.setYsdRemark(handleRemark);
updateSocial.setYsdRemarkOld(handleRemark);
ysdHandleStatus = CommonConstants.FIVE_STRING;
updateSocial.setYsdRemarkOld("续保");
if (Common.isNotNull(excel.getMsg()) && excel.getMsg().contains("新增")) {
updateSocial.setYsdRemarkOld("新增");
}
ysdHandleStatus = CommonConstants.SEVEN_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="医疗、生育、大病提交成功转人工处理!";
this.doSocialTAuditInfo(socialInfo, title, title, title,user);
title += "医疗、生育、大病提交成功!";
this.doSocialTAuditInfo(socialInfo, title, title, title, user);
} else {
updateSocial.setYsdRemark(excel.getMsg());
......@@ -536,7 +1063,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
remark = handleRemark;
} else if (Common.isNotNull(excel.getMsg())) {
// 如果找到了失败原因配置:
failConfig = getConfig(excel.getMsg(),errorMap);
failConfig = getConfig(excel.getMsg(), errorMap);
if (failConfig != null) {
updateSocial.setYsdRemark(failConfig.getSimpleReason());
// failConfig.getReplay() 1 继续办理 2 中止办理 3 人工办理
......@@ -546,39 +1073,39 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="医疗、生育、大病办理失败!继续办理:"+failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(),user);
title += "医疗、生育、大病办理失败!继续办理:" + failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, title, failConfig.getSimpleReason(), user);
} else if (CommonConstants.TWO_STRING.equals(failConfig.getReplay())) {
ysdHandleStatus = CommonConstants.FOUR_STRING;
ysdFailList = new ArrayList<>();
ysdFailList.add(socialInfo.getDispatchId());
handleRemark = "中止办理:"+failConfig.getSimpleReason();
handleRemark = "中止办理:" + failConfig.getSimpleReason();
remark = "中止办理:" + failConfig.getSimpleReason();
} else if (CommonConstants.THREE_STRING.equals(failConfig.getReplay())) {
ysdHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="医疗、生育、大病办理失败!人工处理:"+failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, "医疗、生育、大病办理失败!人工处理:"+failConfig.getSimpleReason(), failConfig.getSimpleReason(),user);
title += "医疗、生育、大病办理失败!人工处理:" + failConfig.getSimpleReason();
this.doSocialTAuditInfo(socialInfo, title, "医疗、生育、大病办理失败!人工处理:" + failConfig.getSimpleReason(), failConfig.getSimpleReason(), user);
}
} else {
ysdHandleStatus = CommonConstants.FIVE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
title +="派增";
title += "派增";
} else {
title +="派减";
title += "派减";
}
title +="医疗、生育、大病办理失败!人工处理:"+excel.getMsg();
this.doSocialTAuditInfo(socialInfo, title, "医疗、生育、大病办理失败!人工处理:"+excel.getMsg(), excel.getMsg(),user);
title += "医疗、生育、大病办理失败!人工处理:" + excel.getMsg();
this.doSocialTAuditInfo(socialInfo, title, "医疗、生育、大病办理失败!人工处理:" + excel.getMsg(), excel.getMsg(), user);
}
}
}
......@@ -654,6 +1181,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
/**
* 加办理记录
*
* @param handleRemark
* @Author hgw
* @Date 2024-5-16 11:43:33
......
<?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.TSocialAutoAuditTaskMapper">
<resultMap id="tSocialAutoAuditTaskMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoAuditTask">
<id property="id" column="ID"/>
<result property="auditId" column="AUDIT_ID"/>
<result property="type" column="TYPE"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.AUDIT_ID,
a.TYPE,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME
</sql>
<sql id="tSocialAutoAuditTask_where">
<if test="tSocialAutoAuditTask != null">
<if test="tSocialAutoAuditTask.id != null and tSocialAutoAuditTask.id.trim() != ''">
AND a.ID = #{tSocialAutoAuditTask.id}
</if>
<if test="tSocialAutoAuditTask.auditId != null and tSocialAutoAuditTask.auditId.trim() != ''">
AND a.AUDIT_ID = #{tSocialAutoAuditTask.auditId}
</if>
<if test="tSocialAutoAuditTask.type != null and tSocialAutoAuditTask.type.trim() != ''">
AND a.TYPE = #{tSocialAutoAuditTask.type}
</if>
<if test="tSocialAutoAuditTask.createBy != null and tSocialAutoAuditTask.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialAutoAuditTask.createBy}
</if>
<if test="tSocialAutoAuditTask.updateBy != null and tSocialAutoAuditTask.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialAutoAuditTask.updateBy}
</if>
<if test="tSocialAutoAuditTask.createName != null and tSocialAutoAuditTask.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialAutoAuditTask.createName}
</if>
<if test="tSocialAutoAuditTask.updateTime != null">
AND a.UPDATE_TIME = #{tSocialAutoAuditTask.updateTime}
</if>
<if test="tSocialAutoAuditTask.createTime != null">
AND a.CREATE_TIME = #{tSocialAutoAuditTask.createTime}
</if>
</if>
</sql>
<!--list-->
<select id="getTSocialAutoAuditTaskList" resultMap="tSocialAutoAuditTaskMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_auto_audit_task a
<where>
1=1
<include refid="tSocialAutoAuditTask_where"/>
</where>
</select>
</mapper>
......@@ -627,6 +627,42 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
group by a.id
</select>
<!-- 获取所有需要社保局审核的养工失 -->
<select id="getSocialSoldierYgsByAudit" resultMap="tSocialInfoMap">
SELECT
a.ID,
a.EMP_IDCARD,
a.YGS_ADD_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YGS_ADD_ID is not null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YGS_HANDLE_STATUS = '7'
group by a.id
</select>
<!-- 获取所有需要社保局审核的医生大 -->
<select id="getSocialSoldierYsdByAudit" resultMap="tSocialInfoMap">
SELECT
a.ID,
a.EMP_IDCARD,
a.YSD_ADD_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YSD_ADD_ID is not null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YSD_HANDLE_STATUS = '7'
group by a.id
</select>
<!-- 根据任务ID,获取需要自动办理的社保 -->
<select id="getSocialSoldierByAddId" resultMap="tSocialInfoMap">
SELECT
......
......@@ -170,4 +170,55 @@
group by s.id
</select>
<!-- 社保士兵养工失神恶化结果查询的模板-->
<select id="getSocialSoldierYgsAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAuditVo">
SELECT
s.id as socialId,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','增员','减员') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m%d') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YGS_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
group by s.id
</select>
<!-- 社保士兵医生大审核结果【续保】查询的模板-->
<select id="getSocialSoldierYsdAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
s.id as socialId,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','参保人员增员申报','参保人员减员申报') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m%d') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YSD_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
and s.YSD_REMARK_OLD != "新增"
group by s.id
</select>
<!-- 社保士兵医生大审核结果【新增】查询的模板-->
<select id="getSocialSoldierYsdAddAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
s.id as socialId,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','职工新参保登记','参保人员减员申报') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m%d') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YSD_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
and s.YSD_REMARK_OLD = "新增"
group by s.id
</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