Commit 61d407fe authored by fangxinjiang's avatar fangxinjiang

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

parents ef58dcc0 603daa7f
......@@ -161,12 +161,12 @@ public class TAutoPaymentDetail extends BaseEntity {
@Schema(description = "社保户")
private String socialSecurityAccount;
/**
* 资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询
* 资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询;4单位缴费明细下载
*/
@ExcelAttribute(name = "资源类型", maxLength = 100)
@Length(max = 100, message = "资源类型不能超过100个字符")
@ExcelProperty("资源类型")
@Schema(description = "资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询")
@Schema(description = "资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询;4单位缴费明细下载")
private String sourceType;
/**
......
......@@ -61,11 +61,11 @@ public class TSocialSoldierShenBaoTask extends BaseEntity {
/**
* 1申报;2调整
*/
@ExcelAttribute(name = "1申报;2调整", isNotEmpty = true, errorInfo = "1申报;2调整", maxLength = 1)
@ExcelAttribute(name = "1申报;2调整", isNotEmpty = true, errorInfo = "1申报;2调整", maxLength = 2)
@NotBlank(message = "1申报;2调整不能为空")
@Length(max = 1, message = "1申报;2调整不能超过1个字符")
@Length(max = 2, message = "1申报;2调整不能超过1个字符")
@ExcelProperty("1申报;2调整")
@Schema(description = "1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询")
@Schema(description = "1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询;6:实缴3单位缴费明细下载")
private String type;
/**
* 拉取状态:0未拉取;1已拉取
......
......@@ -14,12 +14,23 @@ import java.io.Serializable;
public class SocialSoldierPaymentSelectTwoVo implements Serializable {
// 企业名称 参险类型 业务年月 回传信息 回传信息1 回传信息2
// 2024-6-7 11:29:15 变模版:
// 企业名称 证件号码 姓名 险种类型 人员状态 开始日期 结束日期 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("参险类型")
@ExcelProperty("证件号码")
private String idCard;
@ExcelProperty("姓名")
private String empName;
@ExcelProperty("险种类型")
private String paymentType;
@ExcelProperty("业务年月")
private String payMonth;
@ExcelProperty("人员状态")
private String userStatus;
@ExcelProperty("开始日期")
private String startDate;
@ExcelProperty("结束日期")
private String endDate;
@ExcelProperty("回传信息")
private String returnInfo;
@ExcelProperty("回传信息1")
......
......@@ -152,7 +152,7 @@ public class TSocialSoldierController {
@SysLog("6每月6号推送实缴3张表查询")
@Inner
public R<String> pushPaymentThree() {
return tSocialSoldierPushService.pushPaymentThree();
return tSocialSoldierPushService.pushPaymentThree(null,false);
}
/**
......@@ -169,4 +169,29 @@ public class TSocialSoldierController {
return tSocialSoldierService.doInnerGetPaymentThree();
}
/**
* @Description: 推送重新办理任务
* @Author: hgw
* @Date: 2024/5/11 19:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "推送重新办理任务")
@GetMapping("/pushReHandle")
public R<String> pushReHandle(@RequestParam String parentId) {
return tSocialSoldierPushService.pushPaymentThree(parentId, true);
}
/**
* @param parentId 主表id
* @Description: 获取重新办理结果
* @Author: hgw
* @Date: 2024/5/11 19:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "获取重新办理结果")
@GetMapping("/getReHandle")
public R<String> getReHandle(@RequestParam String parentId) {
return tSocialSoldierService.getReHandle(parentId);
}
}
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自动化实缴记录表
*
......@@ -49,4 +51,6 @@ public interface TAutoPaymentDetailMapper extends BaseMapper<TAutoPaymentDetail>
**/
void deleteByParentId(@Param("parentId") String parentId);
List<TAutoPaymentDetail> getListByParentId(@Param("parentId") String parentId);
}
......@@ -39,4 +39,7 @@ public interface TAutoPaymentErrorMapper extends BaseMapper<TAutoPaymentError> {
* @return
*/
IPage<TAutoPaymentError> getTAutoPaymentErrorPage(Page<TAutoPaymentError> page, @Param("tAutoPaymentError") TAutoPaymentError tAutoPaymentError);
void deleteByParentId(@Param("parentId") String parentId);
}
......@@ -48,4 +48,6 @@ public interface TAutoPaymentInfoMapper extends BaseMapper<TAutoPaymentInfo> {
**/
TAutoPaymentInfo getThisMonthMainAuto();
void setUrlToNullByRePayment(@Param("parentId") String parentId);
}
......@@ -117,7 +117,9 @@ public interface TSocialSoldierMapper extends BaseMapper<TSocialInfo> {
List<SocialSoldierPaymentSelectThreeVo> getSoldierPaymentSelectThreeList();
void getSoldierPaymentErrorInfoOne(@Param("parentId") String parentId);
void getSoldierPaymentErrorInfoTwo(@Param("parentId") String parentId);
void getSoldierPaymentErrorInfoOneByRe(@Param("parentId") String parentId);
void getSoldierPaymentErrorInfoTwoByRe(@Param("parentId") String parentId);
}
......@@ -39,5 +39,8 @@ public interface TSocialSoldierShenBaoTaskMapper extends BaseMapper<TSocialSoldi
* @return
*/
List<TSocialSoldierShenBaoTask> getTSocialSoldierShenBaoTaskList(@Param("tSocialSoldierShenBaoTask") TSocialSoldierShenBaoTask tSocialSoldierShenBaoTask);
String getSoldierTaskAddIdByType(@Param("type") String type);
List<TSocialSoldierShenBaoTask> getTSocialSoldierTaskListByRe();
TSocialSoldierShenBaoTask getSoldierTaskAddIdByType(@Param("type") String type);
void deleteByPayment();
void deleteByRePayment();
}
......@@ -57,4 +57,14 @@ public interface TAutoPaymentDetailService extends IService<TAutoPaymentDetail>
* @return: void
**/
void deleteByParentId(String parentId);
/**
* @param parentId
* @Description: 获取被标记的明细,用来更新
* @Author: hgw
* @Date: 2024/6/7 17:50
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail>
**/
List<TAutoPaymentDetail> getListByParentId(String parentId);
}
......@@ -44,4 +44,7 @@ public interface TAutoPaymentErrorService extends IService<TAutoPaymentError> {
void listExport(HttpServletResponse response, TAutoPaymentErrorSearchVo searchVo);
List<TAutoPaymentError> noPageDiy(TAutoPaymentErrorSearchVo searchVo);
void deleteByParentId(String parentId);
}
......@@ -58,4 +58,13 @@ public interface TAutoPaymentInfoService extends IService<TAutoPaymentInfo> {
**/
TAutoPaymentInfo getThisMonthMainAuto();
/**
* @param parentId
* @Description: 复核发起时,清空url
* @Author: hgw
* @Date: 2024/6/7 17:30
* @return: void
**/
void setUrlToNullByRePayment(String parentId);
}
......@@ -71,6 +71,6 @@ public interface TSocialSoldierPushService extends IService<TSocialInfo> {
* @Date: 2024-5-31 16:04:54
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> pushPaymentThree();
R<String> pushPaymentThree(String parentId, boolean isReHandle);
}
......@@ -54,4 +54,12 @@ public interface TSocialSoldierService extends IService<TSocialInfo> {
**/
R<String> doInnerGetPaymentThree();
/**
* @Description: 重新办理
* @Author: hgw
* @Date: 2024/6/6 21:36
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> getReHandle(String parentId);
}
......@@ -36,6 +36,14 @@ public interface TSocialSoldierShenBaoTaskService extends IService<TSocialSoldie
* @return
*/
List<TSocialSoldierShenBaoTask> getTSocialSoldierShenBaoTaskList(TSocialSoldierShenBaoTask tSocialSoldierShenBaoTask);
/**
* @param
* @Description: 获取复核记录为未复核的情况
* @Author: hgw
* @Date: 2024/6/7 11:56
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask>
**/
List<TSocialSoldierShenBaoTask> getTSocialSoldierTaskListByRe();
/**
* @param type
......@@ -44,6 +52,22 @@ public interface TSocialSoldierShenBaoTaskService extends IService<TSocialSoldie
* @Date: 2024/5/31 18:13
* @return: java.lang.String
**/
String getSoldierTaskAddIdByType(String type);
TSocialSoldierShenBaoTask getSoldierTaskAddIdByType(String type);
/**
* @Description: 删除实缴推送
* @Author: hgw
* @Date: 2024/6/6 21:49
* @return: void
**/
void deleteByPayment();
/**
* @Description: 删除实缴再次推送
* @Author: hgw
* @Date: 2024/6/6 21:50
* @return: void
**/
void deleteByRePayment();
}
......@@ -181,6 +181,10 @@ public class TAutoPaymentDetailServiceImpl extends ServiceImpl<TAutoPaymentDetai
public void deleteByParentId(String parentId) {
baseMapper.deleteByParentId(parentId);
}
@Override
public List<TAutoPaymentDetail> getListByParentId(String parentId) {
return baseMapper.getListByParentId(parentId);
}
private Long noPageCountDiy(TAutoPaymentDetailSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentDetail> wrapper = buildQueryWrapper(searchVo);
......
......@@ -127,6 +127,11 @@ public class TAutoPaymentErrorServiceImpl extends ServiceImpl<TAutoPaymentErrorM
}
}
@Override
public void deleteByParentId(String parentId) {
baseMapper.deleteByParentId(parentId);
}
@Override
public List<TAutoPaymentError> noPageDiy(TAutoPaymentErrorSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentError> wrapper = buildQueryWrapper(searchVo);
......
......@@ -168,6 +168,11 @@ public class TAutoPaymentInfoServiceImpl extends ServiceImpl<TAutoPaymentInfoMap
return baseMapper.getThisMonthMainAuto();
}
@Override
public void setUrlToNullByRePayment(String parentId) {
baseMapper.setUrlToNullByRePayment(parentId);
}
private Long noPageCountDiy(TAutoPaymentInfoSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -28,9 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.social.config.SocialConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierShenBaoTaskService;
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.service.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -61,6 +59,8 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
private final SocialConfig socialConfig;
private final TSocialInfoService tSocialInfoService;
private final TSocialSoldierShenBaoTaskService tSocialSoldierShenBaoTaskService;
private final TAutoPaymentInfoService tAutoPaymentInfoService;
private final TAutoPaymentErrorService tAutoPaymentErrorService;
/**
* @param socialList
......@@ -395,6 +395,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
task.setType(CommonConstants.ONE_STRING);
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......@@ -407,6 +408,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
task.setType(CommonConstants.TWO_STRING);
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......@@ -416,14 +418,43 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
return R.ok("推送成功!!");
}
/**
* @param : isReHandle true:是重新办理
* @Description: 6每月6号推送实缴3张表查询
* @Author: hgw
* @Date: 2024-5-31 16:04:47
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> pushPaymentThree() {
public R<String> pushPaymentThree(String parentId, boolean isReHandle) {
// 先删除推送任务
int type = 3;
if (isReHandle) {
type = 7;
List<TSocialSoldierShenBaoTask> taskList = tSocialSoldierShenBaoTaskService.getTSocialSoldierTaskListByRe();
boolean canReTask = false;
if (taskList != null) {
for (TSocialSoldierShenBaoTask task : taskList) {
// 表示已经有过反馈了
if (CommonConstants.ONE_STRING.equals(task.getDataStatus())) {
canReTask = true;
}
}
if (!canReTask) {
return R.failed("上一次推送的还未获取结果,请先获取复核结果!");
} else {
// 清空原表url
if (Common.isNotNull(parentId)) {
tAutoPaymentErrorService.deleteByParentId(parentId);
tAutoPaymentInfoService.setUrlToNullByRePayment(parentId);
}
}
} else {
tSocialSoldierShenBaoTaskService.deleteByRePayment();
}
} else {
tSocialSoldierShenBaoTaskService.deleteByPayment();
}
// 实缴3张表之1:日常申报
List<SocialSoldierPaymentSelectOneVo> shenBaolist = baseMapper.getSoldierPaymentSelectOneList();
log.info("实缴3张表之1:日常申报list="+shenBaolist);
......@@ -433,7 +464,9 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(CommonConstants.THREE_STRING);
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......@@ -446,7 +479,9 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(CommonConstants.FOUR_STRING);
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......@@ -459,7 +494,9 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(CommonConstants.FIVE_STRING);
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......@@ -472,7 +509,9 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询;6:实缴3单位缴费明细下载
task.setType(CommonConstants.SIX_STRING);
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
......
......@@ -77,7 +77,316 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
private final TAutoPaymentDetailService tAutoPaymentDetailService;
private final OSSUtil ossUtil;
// 附件
private final String RESULT_ANNEX = "resultAnnex";
/**
* @Description: 6每月6号定时任务获取社保士兵实缴3张表
* @Author: hgw
* @Date: 2024-5-30 18:01:11
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> getReHandle(String parentId) {
TAutoPaymentInfo mainAuto = tAutoPaymentInfoService.getById(parentId);
if (mainAuto == null || Common.isEmpty(mainAuto.getId())) {
return R.failed("未找到主表");
} else {
mainAuto.setRepeatReviewFlag(CommonConstants.ZERO_STRING);
tAutoPaymentInfoService.updateById(mainAuto);
}
// 3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
int type = 7;
TSocialSoldierShenBaoTask addIdOneTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(String.valueOf(type));
type++;
TSocialSoldierShenBaoTask addIdTwoTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(String.valueOf(type));
type++;
TSocialSoldierShenBaoTask addIdThreeTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(String.valueOf(type));
type++;
TSocialSoldierShenBaoTask addIdSixTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(String.valueOf(type));
String addIdOne = null;
String addIdOTwo = null;
String addIdThree = null;
String addIdSix = null;
if (addIdOneTask != null && Common.isNotNull(addIdOneTask.getId())) {
addIdOne = addIdOneTask.getAddId();
}
if (addIdTwoTask != null && Common.isNotNull(addIdTwoTask.getId())) {
addIdOTwo = addIdTwoTask.getAddId();
}
if (addIdThreeTask != null && Common.isNotNull(addIdThreeTask.getId())) {
addIdThree = addIdThreeTask.getAddId();
}
if (addIdSixTask != null && Common.isNotNull(addIdSixTask.getId())) {
addIdSix = addIdSixTask.getAddId();
}
HttpURLConnection conn;
InputStream inRiChang = null;
InputStream inRenYuan = null;
InputStream inDanWei = null;
InputStream inDanWeiXiaZai = null;
// 1日常申报导出;2人员缴费明细打印;3单位缴费明细查询
R<String> resultFile = socialConfig.getFiveJob(restTemplate, addIdOne, RESULT_ANNEX);
R<String> resultFileTwo = socialConfig.getFiveJob(restTemplate, addIdOTwo, RESULT_ANNEX);
R<String> resultFileThree = socialConfig.getFiveJob(restTemplate, addIdThree, RESULT_ANNEX);
R<String> resultFileFour = socialConfig.getFiveJob(restTemplate, addIdSix, RESULT_ANNEX);
if (Common.isNotNull(resultFile) || Common.isNotNull(resultFileTwo)
|| Common.isNotNull(resultFileThree) || Common.isNotNull(resultFileFour)) {
// 获取需要更新的标记文件:
List<TAutoPaymentDetail> detailList = tAutoPaymentDetailService.getListByParentId(parentId);
if (detailList == null || detailList.isEmpty()) {
return R.failed("未找到标记数据!");
}
Map<String, TAutoPaymentDetail> oneMap = new HashMap<>();
Map<String, TAutoPaymentDetail> twoMap = new HashMap<>();
Map<String, TAutoPaymentDetail> threeMap = new HashMap<>();
Map<String, TAutoPaymentDetail> fourMap = new HashMap<>();
for (TAutoPaymentDetail detail : detailList) {
if (CommonConstants.ONE_STRING.equals(detail.getSourceType())) {
oneMap.put(detail.getCertNum() + CommonConstants.DOWN_LINE_STRING + detail.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING + detail.getInsuranceType(), detail);
}
if (CommonConstants.TWO_STRING.equals(detail.getSourceType())) {
twoMap.put(detail.getCertNum() + CommonConstants.DOWN_LINE_STRING + detail.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING + detail.getInsuranceType(), detail);
}
if (CommonConstants.THREE_STRING.equals(detail.getSourceType())) {
threeMap.put(detail.getCertNum() + CommonConstants.DOWN_LINE_STRING + detail.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING + detail.getInsuranceType(), detail);
}
if (CommonConstants.FOUR_STRING.equals(detail.getSourceType())) {
fourMap.put(detail.getCertNum() + CommonConstants.DOWN_LINE_STRING + detail.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING + detail.getInsuranceType(), detail);
}
}
ZipOutputStream zipOut = null;
try {
boolean reFlag = true;
List<TAutoPaymentDetail> detailListOne = null;
List<TAutoPaymentDetail> detailListTwo = null;
List<TAutoPaymentDetail> detailListThree = null;
List<TAutoPaymentDetail> detailListFour = null;
URL url;
String fileTeturnUrl;
// 解决中文文件名的乱码问题
if (Common.isNotNull(resultFile)) {
fileTeturnUrl = resultFile.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
inRiChang = conn.getInputStream();
// 原表ZIP-1日常申报流
mainAuto.setAttaUrlOne(fileTeturnUrl);
/*zipOut.putNextEntry(new ZipEntry("riChangShenBao_file.zip"));
int bytesRead;
while((bytesRead = inRiChang.read())!=-1) {
zipOut.write(bytesRead);
}
zipOut.closeEntry();*/
/*entry = new ZipEntry("riChangShenBao_file.zip");
bytes = new byte[20480000];
if (inRiChang != null) {
zipOut.putNextEntry(entry);
while ((len = inRiChang.read(bytes)) > 0) {
zipOut.write(bytes, 0, len);
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailROne = this.readZipByPayment(reFlag, oneMap, zipOut, inRiChang, 1, mainAuto);
if (detailROne != null && CommonConstants.SUCCESS.equals(detailROne.getCode()) && detailROne.getData() != null && !detailROne.getData().isEmpty()) {
detailListOne = detailROne.getData();
if (detailListOne != null && !detailListOne.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListOne);
}
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
addIdOneTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdOneTask);
}
}
}
if (Common.isNotNull(resultFileTwo)) {
fileTeturnUrl = resultFileTwo.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
inRenYuan = conn.getInputStream();
// 原表ZIP-2人员缴费明细打印;
mainAuto.setAttaUrlTwo(fileTeturnUrl);
/*if (inRenYuan != null) {
entry = new ZipEntry("renYuanMingXi_file.zip");
zipOut.putNextEntry(entry);
bytes = new byte[20480000];
while ((len = inRenYuan.read(bytes)) > 0) {
zipOut.write(bytes, 0, len);
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRTwo = this.readZipByPayment(reFlag, twoMap, zipOut, inRenYuan, 2, mainAuto);
if (detailRTwo != null && CommonConstants.SUCCESS.equals(detailRTwo.getCode()) && detailRTwo.getData() != null && !detailRTwo.getData().isEmpty()) {
detailListTwo = detailRTwo.getData();
if (detailListTwo != null && !detailListTwo.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListTwo);
}
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
addIdTwoTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdTwoTask);
}
}
}
if (Common.isNotNull(resultFileThree)) {
fileTeturnUrl = resultFileThree.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
inDanWei = conn.getInputStream();
// 原表ZIP-3单位缴费明细查询
mainAuto.setAttaUrlThree(fileTeturnUrl);
/*zipOut.putNextEntry(new ZipEntry("danWeiMingXi_file.zip"));
int bytesRead;
while((bytesRead = inDanWei.read())!=-1) {
zipOut.write(bytesRead);
}
zipOut.closeEntry();*/
/*if (inDanWei != null) {
entry = new ZipEntry("danWeiMingXi_file.zip");
zipOut.putNextEntry(entry);
bytes = new byte[20480000];
while ((len = inDanWei.read(bytes)) > 0) {
zipOut.write(bytes, 0, len);
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRThree = this.readZipByPayment(reFlag, threeMap, zipOut, inDanWei, 3, mainAuto);
if (detailRThree != null && CommonConstants.SUCCESS.equals(detailRThree.getCode()) && detailRThree.getData() != null && !detailRThree.getData().isEmpty()) {
detailListThree = detailRThree.getData();
if (detailListThree != null && !detailListThree.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListThree);
}
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
addIdThreeTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdThreeTask);
}
}
}
if ((detailListThree == null || detailListThree.isEmpty()) && Common.isNotNull(resultFileFour)) {
fileTeturnUrl = resultFileFour.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
inDanWeiXiaZai = conn.getInputStream();
// 原表ZIP-4单位缴费明细下载
mainAuto.setAttaUrlFour(fileTeturnUrl);
/*if (inDanWeiXiaZai != null) {
entry = new ZipEntry("danWeiXiaZai_file.zip");
zipOut.putNextEntry(entry);
bytes = new byte[20480000];
while ((len = inDanWeiXiaZai.read(bytes)) > 0) {
zipOut.write(bytes, 0, len);
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRFour = this.readZipByPayment(reFlag, fourMap, zipOut, inDanWeiXiaZai, 4, mainAuto);
if (detailRFour != null && CommonConstants.SUCCESS.equals(detailRFour.getCode()) && detailRFour.getData() != null && !detailRFour.getData().isEmpty()) {
detailListFour = detailRFour.getData();
if (detailListFour != null && !detailListFour.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListFour);
}
mainAuto.setRepeatReviewFlag(CommonConstants.ONE_STRING);
addIdSixTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdSixTask);
}
}
}
/*ByteArrayOutputStream baos = new ByteArrayOutputStream();
// 将ZipOutputStream的内容写入ByteArrayOutputStream
byte[] buffer = new byte[1024];
int reads;
while((reads = byteArrayInputStream.read(buffer)) != -1){
zipOut.write(buffer, 0, reads);
}
InputStream byteArrayInputStream = new ByteArrayInputStream(buffer);*/
// 上传Zip
/*boolean flag = ossUtil.uploadFileByFile(zipFile, key, null);
// 完成和释放资源
//baos.close();
if (flag) {
mainAuto.setAttaSrc(key);
} else {
return R.failed("failed:上传至存储空间失败");
}*/
tAutoPaymentInfoService.updateById(mainAuto);
// 核验
if (detailListOne != null && !detailListOne.isEmpty()
|| detailListTwo != null && !detailListTwo.isEmpty()
|| detailListThree != null && !detailListThree.isEmpty()
|| detailListFour != null && !detailListFour.isEmpty()
) {
// 复核-核验1:
baseMapper.getSoldierPaymentErrorInfoOneByRe(mainAuto.getId());
// 复核-核验2:
baseMapper.getSoldierPaymentErrorInfoTwoByRe(mainAuto.getId());
// 重新复核状态
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_STRING);
tAutoPaymentInfoService.updateById(mainAuto);
}
} catch(Exception e){
e.printStackTrace();
} finally{
try {
if (inRiChang != null) {
inRiChang.close();
}
if (inRenYuan != null) {
inRenYuan.close();
}
if (inDanWei != null) {
inDanWei.close();
}
if (inDanWeiXiaZai != null) {
inDanWeiXiaZai.close();
}
if (zipOut != null) {
zipOut.closeEntry();
zipOut.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return R.ok();
}
/**
* @Description: 6每月6号定时任务获取社保士兵实缴3张表
......@@ -88,23 +397,39 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
@Override
public R<String> doInnerGetPaymentThree() {
// 3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
String addIdOne = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.THREE_STRING);
String addIdOTwo = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.FOUR_STRING);
String addIdThree = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.FIVE_STRING);
String addIdSix = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.SIX_STRING);
TSocialSoldierShenBaoTask addIdOneTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.THREE_STRING);
TSocialSoldierShenBaoTask addIdTwoTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.FOUR_STRING);
TSocialSoldierShenBaoTask addIdThreeTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.FIVE_STRING);
TSocialSoldierShenBaoTask addIdSixTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.SIX_STRING);
String addIdOne = null;
String addIdOTwo = null;
String addIdThree = null;
String addIdSix = null;
if (addIdOneTask != null && Common.isNotNull(addIdOneTask.getId())) {
addIdOne = addIdOneTask.getAddId();
}
if (addIdTwoTask != null && Common.isNotNull(addIdTwoTask.getId())) {
addIdOTwo = addIdTwoTask.getAddId();
}
if (addIdThreeTask != null && Common.isNotNull(addIdThreeTask.getId())) {
addIdThree = addIdThreeTask.getAddId();
}
if (addIdSixTask != null && Common.isNotNull(addIdSixTask.getId())) {
addIdSix = addIdSixTask.getAddId();
}
HttpURLConnection conn;
InputStream inRiChang = null;
InputStream inRenYuan = null;
InputStream inDanWei = null;
InputStream inDanWeiXiaZai = null;
// 1日常申报导出;2人员缴费明细打印;3单位缴费明细查询
R<String> resultFile = socialConfig.getFiveJob(restTemplate, addIdOne, "resultAnnex");
R<String> resultFileTwo = socialConfig.getFiveJob(restTemplate, addIdOTwo, "resultAnnex");
R<String> resultFileThree = socialConfig.getFiveJob(restTemplate, addIdThree, "resultAnnex");
R<String> resultFileFour = socialConfig.getFiveJob(restTemplate, addIdSix, "resultAnnex");
R<String> resultFile = socialConfig.getFiveJob(restTemplate, addIdOne, RESULT_ANNEX);
R<String> resultFileTwo = socialConfig.getFiveJob(restTemplate, addIdOTwo, RESULT_ANNEX);
R<String> resultFileThree = socialConfig.getFiveJob(restTemplate, addIdThree, RESULT_ANNEX);
R<String> resultFileFour = socialConfig.getFiveJob(restTemplate, addIdSix, RESULT_ANNEX);
if (Common.isNotNull(resultFile) || Common.isNotNull(resultFileTwo)
|| Common.isNotNull(resultFileThree) || Common.isNotNull(resultFileFour)) {
boolean reFlag = false;
ZipOutputStream zipOut = null;
try {
// 1查询主表
......@@ -180,9 +505,14 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailROne = this.readZipByPayment(zipOut, inRiChang, 1, mainAuto);
R<List<TAutoPaymentDetail>> detailROne = this.readZipByPayment(reFlag, null, zipOut, inRiChang, 1, mainAuto);
if (detailROne != null && CommonConstants.SUCCESS.equals(detailROne.getCode()) && detailROne.getData() != null && !detailROne.getData().isEmpty()) {
detailListOne = detailROne.getData();
if (detailListOne != null && !detailListOne.isEmpty()) {
tAutoPaymentDetailService.saveBatch(detailListOne);
addIdOneTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdOneTask);
}
mainAuto.setDataOneFlag(CommonConstants.ONE_STRING);
}
}
......@@ -208,9 +538,14 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRTwo = this.readZipByPayment(zipOut, inRenYuan, 2, mainAuto);
R<List<TAutoPaymentDetail>> detailRTwo = this.readZipByPayment(reFlag, null, zipOut, inRenYuan, 2, mainAuto);
if (detailRTwo != null && CommonConstants.SUCCESS.equals(detailRTwo.getCode()) && detailRTwo.getData() != null && !detailRTwo.getData().isEmpty()) {
detailListTwo = detailRTwo.getData();
if (detailListTwo != null && !detailListTwo.isEmpty()) {
tAutoPaymentDetailService.saveBatch(detailListTwo);
addIdTwoTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdTwoTask);
}
mainAuto.setDataTwoFlag(CommonConstants.ONE_STRING);
}
}
......@@ -241,14 +576,19 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRThree = this.readZipByPayment(zipOut, inDanWei, 3, mainAuto);
R<List<TAutoPaymentDetail>> detailRThree = this.readZipByPayment(reFlag, null, zipOut, inDanWei, 3, mainAuto);
if (detailRThree != null && CommonConstants.SUCCESS.equals(detailRThree.getCode()) && detailRThree.getData() != null && !detailRThree.getData().isEmpty()) {
detailListThree = detailRThree.getData();
if (detailListThree != null && !detailListThree.isEmpty()) {
tAutoPaymentDetailService.saveBatch(detailListThree);
addIdThreeTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdThreeTask);
}
mainAuto.setDataThreeFlag(CommonConstants.ONE_STRING);
}
}
}
if (Common.isNotNull(resultFileFour)) {
if ((detailListThree == null || detailListThree.isEmpty()) && Common.isNotNull(resultFileFour)) {
fileTeturnUrl = resultFileFour.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
......@@ -268,9 +608,14 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}*/
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRFour = this.readZipByPayment(zipOut, inDanWeiXiaZai, 3, mainAuto);
R<List<TAutoPaymentDetail>> detailRFour = this.readZipByPayment(reFlag, null, zipOut, inDanWeiXiaZai, 4, mainAuto);
if (detailRFour != null && CommonConstants.SUCCESS.equals(detailRFour.getCode()) && detailRFour.getData() != null && !detailRFour.getData().isEmpty()) {
detailListFour = detailRFour.getData();
if (detailListFour != null && !detailListFour.isEmpty()) {
tAutoPaymentDetailService.saveBatch(detailListFour);
addIdSixTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdSixTask);
}
mainAuto.setDataThreeFlag(CommonConstants.ONE_STRING);
}
}
......@@ -311,6 +656,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
baseMapper.getSoldierPaymentErrorInfoOne(mainAuto.getId());
// 核验2:
baseMapper.getSoldierPaymentErrorInfoTwo(mainAuto.getId());
mainAuto.setSystemReviewFlag(CommonConstants.TWO_STRING);
tAutoPaymentInfoService.updateById(mainAuto);
}
} catch(Exception e){
e.printStackTrace();
......@@ -341,13 +688,17 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
/**
* @param reFlag true :复核
* @param oldMap 被标记的map
* @param type 1日常申报导出;2人员缴费明细打印;3单位缴费明细查询
* @Description: 读取实缴3张表
* @Author: hgw
* @Date: 2024/6/3 18:17
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail>>
**/
public R<List<TAutoPaymentDetail>> readZipByPayment(ZipOutputStream zipOut, InputStream inputStream, int type, TAutoPaymentInfo mainAuto) {
public R<List<TAutoPaymentDetail>> readZipByPayment(boolean reFlag, Map<String, TAutoPaymentDetail> oldMap, ZipOutputStream zipOut
, InputStream inputStream, int type, TAutoPaymentInfo mainAuto) {
TAutoPaymentDetail oldDetail;
TAutoPaymentDetail detail;
TAutoPaymentDetail detailPerson;
List<TAutoPaymentDetail> voList = new ArrayList<>();
......@@ -644,8 +995,20 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
} else {
detail.setCreateMonth(nowMonth);
}
voList.add(detail);
if (reFlag) {
if (oldMap != null) {
// 复核使用的
oldDetail = oldMap.get(detail.getCertNum() + CommonConstants.DOWN_LINE_STRING
+ detail.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING
+ detail.getInsuranceType());
if (oldDetail != null) {
detail.setId(oldDetail.getId());
voList.add(detail);
}
}
} else{
voList.add(detail);
}
// 个人的拆为第二条
if (Common.isNotNull(personLimit)) {
money = new BigDecimal(personLimit);
......@@ -672,7 +1035,20 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
} else {
detailPerson.setCreateMonth(nowMonth);
}
voList.add(detailPerson);
if (reFlag) {
if (oldMap != null) {
// 复核使用的
oldDetail = oldMap.get(detailPerson.getCertNum() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getInsuranceType());
if (oldDetail != null) {
detailPerson.setId(oldDetail.getId());
voList.add(detailPerson);
}
}
} else{
voList.add(detailPerson);
}
}
}
}
......@@ -911,9 +1287,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
ex.printStackTrace();
}
}
if (voList != null && !voList.isEmpty()) {
tAutoPaymentDetailService.saveBatch(voList);
}
return R.ok(voList);
}
......@@ -973,7 +1346,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, "resultAnnex");
R<String> resultFile = socialConfig.getFiveJob(restTemplate, doAddId, RESULT_ANNEX);
log.info("resultFileByAudit=" + resultFile);
try {
// 解决中文文件名的乱码问题
......
......@@ -44,13 +44,27 @@ public class TSocialSoldierShenBaoTaskServiceImpl extends ServiceImpl<TSocialSol
public List<TSocialSoldierShenBaoTask> getTSocialSoldierShenBaoTaskList(TSocialSoldierShenBaoTask tSocialSoldierShenBaoTask) {
return baseMapper.getTSocialSoldierShenBaoTaskList(tSocialSoldierShenBaoTask);
}
@Override
public List<TSocialSoldierShenBaoTask> getTSocialSoldierTaskListByRe() {
return baseMapper.getTSocialSoldierTaskListByRe();
}
/**
* 获取任务id
* @return
*/
@Override
public String getSoldierTaskAddIdByType(String type) {
public TSocialSoldierShenBaoTask getSoldierTaskAddIdByType(String type) {
return baseMapper.getSoldierTaskAddIdByType(type);
}
@Override
public void deleteByPayment() {
baseMapper.deleteByPayment();
}
@Override
public void deleteByRePayment() {
baseMapper.deleteByRePayment();
}
}
......@@ -45,6 +45,7 @@
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="parentId" column="PARENT_ID"/>
<result property="sourceType" column="SOURCE_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -67,6 +68,7 @@
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.SOURCE_TYPE,
a.PARENT_ID
</sql>
<sql id="tAutoPaymentDetail_where">
......@@ -151,4 +153,14 @@
delete from t_auto_payment_detail where PARENT_ID = #{parentId}
</delete>
<!--tAutoPaymentDetail简单分页查询-->
<select id="getListByParentId" resultMap="tAutoPaymentDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_detail a
where PARENT_ID = #{parentId} and REPEAT_HANDLE_FLAG = '0'
order by a.SOURCE_TYPE,a.CERT_NUM
</select>
</mapper>
......@@ -75,4 +75,9 @@
<include refid="tAutoPaymentError_where"/>
</where>
</select>
<delete id="deleteByParentId">
delete from t_auto_payment_error where PARENT_ID = #{parentId}
</delete>
</mapper>
......@@ -138,4 +138,10 @@
FROM t_auto_payment_info a
where a.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m')
</select>
<!-- 重新办理,清空url -->
<update id="setUrlToNullByRePayment" >
update t_auto_payment_info a set a.ATTA_URL_ONE = null,a.ATTA_URL_TWO = null,a.ATTA_URL_THREE = null,a.ATTA_URL_FOUR = null where id = #{parentId}
</update>
</mapper>
......@@ -283,17 +283,30 @@
<!-- 社保士兵实缴3张表查询1_合肥-社保费管理客户端-日常申报导出 -->
<select id="getSoldierPaymentSelectOneList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectOneVo">
select
'' companyNo ,s.NAME companyName,'' isPrint,'' createMonth,'是' isDownLoad,'' danDuoSheet
,'' danDanSheet,'' duoDanSheet,'' startDate,'' endDate,'' isSalary,'' returnInfo
'' companyNo ,s.NAME companyName,'' isPrint,'' createMonth,'是' isDownLoad,'' danDuoSheet
,'否' danDanSheet,'是' duoDanSheet,'' startDate,'' endDate,'' isSalary,'' returnInfo
from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0'
</select>
<!-- 社保士兵实缴3张表查询2_合肥-社保-人员缴费明细打印 -->
<select id="getSoldierPaymentSelectTwoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectTwoVo">
select
s.NAME companyName,'' paymentType,'' payMonth,'' returnInfo,'' returnInfoOne,'' returnInfoTwo
from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0'
a.companyName,a.empIdCard idCard,a.empName,'' paymentType,'' userStatus,'' startDate,'' endDate,'' returnInfo,'' returnInfoOne,'' returnInfoTwo
from (
select
s.SOCIAL_HOUSEHOLD_NAME companyName,s.EMP_NAME empName,s.EMP_IDCARD empIdCard
from t_social_info s
left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
union all
select
s.SOCIAL_HOUSEHOLD_NAME companyName,s.EMP_NAME empName,s.EMP_IDCARD empIdCard
from t_social_info s
left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
) a GROUP BY a.empIdCard
</select>
<!-- 社保士兵实缴3张表查询3_合肥-医保-单位缴费明细查询 -->
<select id="getSoldierPaymentSelectThreeList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectThreeVo">
......@@ -566,4 +579,272 @@
</insert>
<!-- 复核-核验1户 -->
<insert id="getSoldierPaymentErrorInfoOneByRe">
insert into t_auto_payment_error
select concat(d.id,'_1_',#{parentId}) id,#{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该员工的姓名、社保户与派单不一致' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT
and p.EMP_NAME = d.EMP_NAME
and p.EMP_IDCARD = d.CERT_NUM
)
and not EXISTS (
select 1 from t_social_info s
left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM
and s.EMP_NAME = d.EMP_NAME
and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
)
and not EXISTS (
select 1 from t_social_info s
left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM
and s.EMP_NAME = d.EMP_NAME
and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
)
</insert>
<!-- 复核-核验2险种 -->
<insert id="getSoldierPaymentErrorInfoTwoByRe">
insert into t_auto_payment_error
select concat(d.id,'_2_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '职工基本养老保险(单位缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_PENSION_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_PERSION_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_PERSION_MONEY > 0
)
union all
select concat(d.id,'_3_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '职工基本养老保险(个人缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.PERSONAL_PENSION_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_PERSION_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_PERSION_MONEY > 0
)
union all
select concat(d.id,'_4_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '失业保险(单位缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_UNEMPLOYMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_UNEMPLOYMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_UNEMPLOYMENT_MONEY > 0
)
union all
select concat(d.id,'_5_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '失业保险(个人缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.PERSONAL_UNEMPLOYMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_UNEMPLOYMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_UNEMPLOYMENT_MONEY > 0
)
union all
select concat(d.id,'_6_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '职工基本医疗保险(个人缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.PERSONAL_MEDICAL_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_MEDICAL_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_MEDICAL_MONEY > 0
)
union all
select concat(d.id,'_7_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '职工基本医疗保险(单位缴纳)'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_MEDICAL_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_MEDICAL_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_MEDICAL_MONEY > 0
)
union all
select concat(d.id,'_8_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '工伤保险'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_INJURY_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_INJURY_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_INJURY_MONEY > 0
)
union all
select concat(d.id,'_9_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '单位大病救助金'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_BIGMAILMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_BIGAILMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_BIGAILMENT_MONEY > 0
)
union all
select concat(d.id,'_10_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '个人大病救助金'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.PERSONAL_BIGMAILMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_BIGAILMENT_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.PERSONAL_BIGAILMENT_MONEY > 0
)
union all
select concat(d.id,'_11_', #{parentId}) id, #{parentId} PARENT_ID,d.CERT_NUM,d.EMP_NAME,d.SOCIAL_SECURITY_ACCOUNT,d.INSURANCE_TYPE,'该险种无此派单或该险种已减员' ERROR_INFO
from t_auto_payment_detail d where d.CREATE_MONTH = DATE_FORMAT(now(),'%Y%m') and d.REPEAT_HANDLE_FLAG = '0'
and d.INSURANCE_TYPE = '单位生育'
and not EXISTS (
select 1 from t_payment_info_2024 p where p.SOCIAL_CREATE_MONTH = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and p.SOCIAL_HOUSEHOLD = d.SOCIAL_SECURITY_ACCOUNT and p.EMP_NAME = d.EMP_NAME and p.EMP_IDCARD = d.CERT_NUM
and p.UNIT_BIRTH_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS in ('1','5','6','7') and d.type = '0' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_BIRTH_MONEY > 0
)
and not EXISTS (
select 1 from t_social_info s left join t_dispatch_info d on s.id=d.SOCIAL_ID
where DATE_FORMAT(d.CREATE_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and s.HANDLE_STATUS = '3' and d.type = '1' and DATE_FORMAT(s.SOCIAL_START_DATE,'%Y%m') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y%m')
and s.EMP_IDCARD = d.CERT_NUM and s.EMP_NAME = d.EMP_NAME and s.SOCIAL_HOUSEHOLD_NAME = d.SOCIAL_SECURITY_ACCOUNT
and s.UNIT_BIRTH_MONEY > 0
)
</insert>
</mapper>
......@@ -27,6 +27,7 @@
<id property="id" column="ID"/>
<result property="addId" column="ADD_ID"/>
<result property="type" column="TYPE"/>
<result property="dataStatus" column="DATA_STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
......@@ -37,6 +38,7 @@
a.ID,
a.ADD_ID,
a.TYPE,
a.DATA_STATUS,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
......@@ -54,6 +56,9 @@
<if test="tSocialSoldierShenBaoTask.type != null and tSocialSoldierShenBaoTask.type.trim() != ''">
AND a.TYPE = #{tSocialSoldierShenBaoTask.type}
</if>
<if test="tSocialSoldierShenBaoTask.dataStatus != null and tSocialSoldierShenBaoTask.dataStatus.trim() != ''">
AND a.DATA_STATUS = #{tSocialSoldierShenBaoTask.dataStatus}
</if>
<if test="tSocialSoldierShenBaoTask.createBy != null and tSocialSoldierShenBaoTask.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialSoldierShenBaoTask.createBy}
</if>
......@@ -82,11 +87,28 @@
</where>
</select>
<!--获取任务id-->
<select id="getSoldierTaskAddIdByType" resultType="java.lang.String">
<select id="getSoldierTaskAddIdByType" resultMap="tSocialSoldierShenBaoTaskMap">
SELECT
a.ADD_ID
<include refid="Base_Column_List"/>
FROM t_social_soldier_shen_bao_task a
where a.TYPE = #{type} and a.DATA_STATUS = '0'
ORDER BY a.CREATE_TIME desc limit 1
</select>
<!--list-->
<select id="getTSocialSoldierTaskListByRe" resultMap="tSocialSoldierShenBaoTaskMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_shen_bao_task a
where TYPE in ('7','8','9','10')
</select>
<delete id="deleteByPayment">
delete FROM t_social_soldier_shen_bao_task where TYPE in ('3','4','5','6')
</delete>
<delete id="deleteByRePayment">
delete FROM t_social_soldier_shen_bao_task where TYPE in ('7','8','9','10')
</delete>
</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