Commit beb5cb5a authored by hongguangwu's avatar hongguangwu

Merge branch 'MVP1.6.5' into MVP1.6.6

parents 3db2b3db 29a95cb7
......@@ -347,7 +347,6 @@ public interface CommonConstants {
public static final String JAR_TYPE = "jar";
int BATCH_COUNT = 100;
int BATCH_COUNT_TAX = 400;
int BATCH_COUNT1 = 2000;
String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(常见错误:1.日期格式:yyyy-MM-dd,2.比例为整数且不含%)";
......
......@@ -32,6 +32,14 @@ public class EkpPushSocialParam implements Serializable {
* 项目名称
**/
private String fd_3adfe8c8468e54;
/**
* 项目编码-原
**/
private String fd_3cfe2da7e35daa;
/**
* 项目名称-原
**/
private String fd_3cfe2db5015d6e;
/**
* 单号
**/
......
......@@ -39,6 +39,15 @@ public class EkpSocialInfo {
@Schema(description ="项目名称")
private String fd_3adfe8c8468e54;
/**
* 项目编码-原
**/
private String fd_3cfe2da7e35daa;
/**
* 项目名称-原
**/
private String fd_3cfe2db5015d6e;
@Schema(description ="单号")
private String fd_3adfe95c169c48;
......
package com.yifu.cloud.plus.v1.ekp.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
/**
* @auther huyc
* @date 2024/5/24
* 聚富通基本配置
*/
@RefreshScope
@ConfigurationProperties(prefix = "icbc")
@Data
public class IcbcConfigProperties {
/**
* @Description: 聚富通分配的接入id
**/
private String appId;
/**
* @Description: 聚富通分配的应用方私钥
**/
private String appPrivateKey;
/**
* @Description: 指定环境请求url
**/
private String serverUrl;
/**
* @Description: 网关公钥
**/
private String apigwPublicKey;
/**
* @Description: 应用方加密串
**/
private String aesKey;
/**
* @Description: 企业编号
**/
private String companyNo;
/**
* 异步通知地址
*/
private String notifyUrl="/fdd/notifyUrl";
}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowIssueService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 聚富通代发工资相关
*
* @author huyc
* @date 2024-05-23 10:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/icbcIssue" )
@Tag(name = "聚富通代发工资相关")
public class IcbcTransactionFlowIssueController {
private final IcbcTransactionFlowIssueService icbcTransactionFlowIssueService;
/**
* 聚富通代发工资确认提交
*
* @param
* @param
* @return
*/
@Operation(summary = "聚富通代发工资确认提交接口", description = "聚富通代发工资确认提交接口")
@PostMapping("/submit")
public R submitIcbcTransactionFlow() {
return icbcTransactionFlowIssueService.submitIcbcTransactionFlow();
}
/**
* 代发工资明细查询
*
* @param
* @param
* @return
*/
@Operation(summary = "代发工资明细查询", description = "代发工资明细查询")
@PostMapping("/page")
public R selectIcbcTransactionFlowInfo() {
return icbcTransactionFlowIssueService.selectIcbcTransactionFlowInfo();
}
}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 聚富通到账通知交易流水查询
*
* @author huyc
* @date 2024-05-23 10:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/icbcQuery" )
@Tag(name = "聚富通到账通知交易流水查询")
public class IcbcTransactionFlowQueryController {
private final IcbcTransactionFlowQueryService icbcTransactionFlowQueryService;
/**
* 交易流水查询
*
* @param
* @return
*/
@Operation(summary = "交易流水查询", description = "交易流水查询")
@PostMapping("/page")
public R getIcbcTransactionFlow() {
return icbcTransactionFlowQueryService.getIcbcTransactionFlow();
}
/**
* 预订单接口
*
* @param
* @return
*/
@Operation(summary = "预订单接口", description = "预订单接口")
@PostMapping("/save")
public R saveIcbcManagerCard() {
return icbcTransactionFlowQueryService.saveIcbcManagerCard();
}
}
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* 聚富通代发工资相关
*
* @author huyc
* @date 2024-05-24 10:55:24
*/
public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo> {
R submitIcbcTransactionFlow();
R selectIcbcTransactionFlowInfo();
}
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* 聚富通到账通知交易流水查询
*
* @author huyc
* @date 2024-05-23 11:21:56
*/
public interface IcbcTransactionFlowQueryService extends IService<EkpSocialInfo> {
R getIcbcTransactionFlow();
R saveIcbcManagerCard();
}
......@@ -261,6 +261,10 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
socialInfo.setFd_3adfe8c70d3fd4(socialParam.getFd_3adfe8c70d3fd4());
//项目名称
socialInfo.setFd_3adfe8c8468e54(socialParam.getFd_3adfe8c8468e54());
//项目编码-原 fxj 20240527 add
socialInfo.setFd_3cfe2da7e35daa(socialParam.getFd_3adfe8c70d3fd4());
//项目名称-原 fxj 20240527 add
socialInfo.setFd_3cfe2db5015d6e(socialParam.getFd_3adfe8c8468e54());
//单号
socialInfo.setFd_3adfe95c169c48(socialParam.getFd_3adfe95c169c48());
//客户编码
......
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.UiIcbcClient;
import com.icbc.api.request.JftApiPayrollQueryDetailRequestV1;
import com.icbc.api.request.JftUiPayrollComfirmSubmitRequestV1;
import com.icbc.api.response.JftApiPayrollQueryDetailResponseV1;
import com.yifu.cloud.plus.v1.ekp.config.IcbcConfigProperties;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowIssueService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* 聚富通到账通知交易流水查询
*
* @author huyc
* @date 2024-05-23 11:21:56
*/
@Log4j2
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties(IcbcConfigProperties.class)
public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialInfoMapper, EkpSocialInfo> implements IcbcTransactionFlowIssueService {
@Autowired
private IcbcConfigProperties icbcConfigProperties;
public R submitIcbcTransactionFlow() {
UiIcbcClient client = new UiIcbcClient(icbcConfigProperties.getAppId(), IcbcConstants.SIGN_TYPE_RSA2, icbcConfigProperties.getAppPrivateKey(),
IcbcConstants.CHARSET_UTF8);
JftUiPayrollComfirmSubmitRequestV1 request = new JftUiPayrollComfirmSubmitRequestV1();
request.setServiceUrl("https://apipcs3.dccnet.com.cn/ui/jft/ui/payroll/comfirmsubmit/V1");
JftUiPayrollComfirmSubmitRequestV1.JjftUiPayrolComfirmSubmitRequestV1BizV1 bizContent =
new JftUiPayrollComfirmSubmitRequestV1.JjftUiPayrolComfirmSubmitRequestV1BizV1();
bizContent.setAppId(icbcConfigProperties.getAppId());
//HR系统名称
bizContent.setAppName("HRO");
//企业编号
bizContent.setOutVendorId(icbcConfigProperties.getCompanyNo());
//操作类型:1-受理 2-审核
bizContent.setOprType("1");
bizContent.setTotalAmt("1000");
bizContent.setTotalCount("1");
bizContent.setAppSerialno("21900");
bizContent.setLocalFilepath("D:/icbcFile/955888_21900_0_20240524.xls");
bizContent.setFileMdcode(getMdCode("D:/icbcFile/955888_21900_0_20240524.xls"));
bizContent.setFileType("1");
bizContent.setNotifyUrl(null);
bizContent.setAppRemark("备注");
bizContent.setBusinessType(null);
bizContent.setFileCheckSign(null);
request.setBizContent(bizContent);
try {
String result = client.buildPostForm(request);
if (Common.isNotNull(result)) {
return R.ok();
}
} catch (IcbcApiException e) {
e.printStackTrace();
return R.failed();
}
return R.ok();
}
public R selectIcbcTransactionFlowInfo() {
DefaultIcbcClient client = new DefaultIcbcClient(icbcConfigProperties.getAppId(), IcbcConstants.SIGN_TYPE_RSA2,
icbcConfigProperties.getAppPrivateKey(), IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON,
icbcConfigProperties.getApigwPublicKey(), IcbcConstants.ENCRYPT_TYPE_AES, icbcConfigProperties.getAesKey(), null, null);
JftApiPayrollQueryDetailRequestV1 request = new JftApiPayrollQueryDetailRequestV1();
request.setServiceUrl("https://apipcs3.dccnet.com.cn/api/jft/api/payroll/querydetail/V1");
JftApiPayrollQueryDetailRequestV1.JftApiPayrollQueryDetailRequestV1Biz bizContent = new
JftApiPayrollQueryDetailRequestV1.JftApiPayrollQueryDetailRequestV1Biz();
bizContent.setAppId(icbcConfigProperties.getAppId());
bizContent.setOutVendorId(icbcConfigProperties.getCompanyNo());
bizContent.setType("2");
//批次号,appSerialno为空时,必输
bizContent.setAppBatserialno("21900");
//内部批次号,组成规则:批次号-顺序号,appBatserialno为空时必输
// bizContent.setAppSerialno("230921");
bizContent.setStartId("0");
bizContent.setEndId("10");
request.setBizContent(bizContent);
try {
JftApiPayrollQueryDetailResponseV1 responseV1 = client.execute(request);
if (Common.isNotNull(responseV1)) {
return R.ok();
}
} catch (IcbcApiException e) {
e.printStackTrace();
return R.failed();
}
return R.ok();
}
public String getMdCode(String filePath) {
try {
MessageDigest md5Digest = MessageDigest.getInstance("MD5");
byte[] buffer = new byte[8192];
try (FileInputStream fis = new FileInputStream(filePath)) {
int bytesRead;
while ((bytesRead = fis.read(buffer)) != -1) {
md5Digest.update(buffer, 0, bytesRead);
}
}
byte[] md5Bytes = md5Digest.digest();
// Convert the byte to hex format
StringBuilder result = new StringBuilder();
for (byte md5Byte : md5Bytes) {
result.append(Integer.toString((md5Byte & 0xff) + 0x100, 16).substring(1));
}
return result.toString();
} catch (NoSuchAlgorithmException | IOException e) {
//Handle the exception according to your requirements
e.printStackTrace();
return null;
}
}
}
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.request.JftApiB2bpayTransqueryRequestV1;
import com.icbc.api.request.JftApiPayB2bpayGenpreorderRequestV1;
import com.icbc.api.response.JftApiB2bpayTransqueryResponseV1;
import com.icbc.api.response.JftApiPayB2bpayGenpreorderResponseV1;
import com.yifu.cloud.plus.v1.ekp.config.IcbcConfigProperties;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 聚富通到账通知交易流水查询
*
* @author huyc
* @date 2024-05-23 11:21:56
*/
@Log4j2
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties(IcbcConfigProperties.class)
public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialInfoMapper, EkpSocialInfo> implements IcbcTransactionFlowQueryService {
@Autowired
private IcbcConfigProperties icbcConfigProperties;
public R getIcbcTransactionFlow() {
//应用id 应用方私钥 网关公钥 应用方加密串
String APP_ID = "11000000000000015602";
//应用方私钥
String MY_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCudy1tOyVTSCjJD9ej/IXmIKHTBLJ3FPYyhUnAt65hXgTD7OJso3+1cc+AakLGTLrSm9pxxd2AsUkVbdYFsXyq0rQOkG71ULPrzYI/XfbIcjf8dleFkTlEi+bVNN3J3LzbY4uPhPztDbkcwBoawl1jhcGTkFdIUCfJ8s9zXAAKgHjeNLXwrdnfvlTn8sfJX3JvrQ9W1Ji2NhCzAg7/fgJ9wAmS+aWKKBuc3ge5DQYcTtIe8hBeKSh6WZkjdUOja6ytOwEGCA3KiCVTw42rP/njrMAR3rh2ptXQtlLekMIEtiN3QAnIWp8IDg8uBEKr0aye6m/IfKMNpbbyaKqaeBUhAgMBAAECggEAOp0rk+ElHx/FJBfAeQWj7rbT51NSqhNOy5ZgOvD7ExdFPpXdVGZxx4HfFuOcX4bz1UIrV8IEMvJc/WgTWYJRwgpcF/CKdryQVg6LTcLB4IIPMTCJIwSxWsgt2z+Rq/oPMR32i1dAqlvL707S9l6KhZ8wc+UwjcjwNTbwX29vTBdiTsFS6QJBaUytu+nHoHvVrpg4botifiokHR1JX0hWjxP/Dh29aooaIbSu80A2sRPLIvRtCzxGjfcZP+H1ZtE439SCguuI+pOqWWLmzUV743PkGPpYPnYXadajrYBz8R5Uysm0tRwV4Ir4TxeH9axUP4Z/agldDNk/xBtK+PcgAQKBgQDwtUjrnzm29w/IwZHHCNDYtqZV2N42WrZZQusUbJ92QXsPFJpe4LCG4Ek7OYONuKuGfK/KJ2vZzlf+HlxlG7D+Xq/5Cb5LbZtIdIkLceOt+omfwHDVTqCM0jodNWKoYBQtI6PsksHpWtAkzP5kGSj7IabaJwKD0wxcbHvs5VFWoQKBgQC5jJFEfUAFGlPSoABdq8BQoaJZg976msnAy2QJMZRG/iEMywHTKFhMBkk3d0qpphdgHJQUr/gMcUtx9zlRBbvY30IOnpM9+nYqRXXlffqYIByM+PeO7AyihYrFpWlVdOO/ezp0VN0QZ8XwlkaYcvADae53C8K7DKtkLlDV71qugQKBgQDstzspDIMznbAWG9aCx/aqyKS3k/ijt33QNnD8uv3uy+J7KCXP3GN9oKAj8CGhg9SbA4/U3APCRJxgOfdfL2ZWIUQpQx2zC+1DyebkLHJdrB8fzZ6pBxP4qN2hz9hgAWyWH5CbnI+6Lya2qioawmt83NE7hFWC0lA7rCwLAlGFQQKBgBmpf03hpMEP6xfuWR6banW8ZR/MRUKTteOcPbGn0cIf06JZUV9K7StWkznAnerotcLtMO3LiJrv8GdKsfqquFg+SHyNIgAoa79c6/lZexcfGdPFezehHf48Sf0b632ONRF+kY8VTZ2/PHkRz6G2A8v1Eq4USlJkZi/s1/E+sWQBAoGAMU8mm9SGWka1hPYOI3ONCzeBbRBNulcS7B7luGcEbhPwi0p77xciSUy64GSVjZboD/DX9n3m7rU2GIqr50gkpQuTW9N9PNr7z74Tk36bCp5MpEeybMOgv8hovEQBa5PoTbAm9qMf9Xm1whQXUzhjcWR7vT4qAg1A+QXX58G9EkA=";
//网关公钥
String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
//应用方加密串
String AES_Key = "5xGJdh7qb+B95SUoxDlatg==";
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2,
MY_PRIVATE_KEY, IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON, APIGW_PUBLIC_KEY,
AES_Key, icbcConfigProperties.getAesKey(), "", "");
JftApiB2bpayTransqueryRequestV1 request = new JftApiB2bpayTransqueryRequestV1();
request.setServiceUrl("https://apipcs3.dccnet.com.cn/api/jft/api/b2bpay/transquery/V1");
JftApiB2bpayTransqueryRequestV1.JftApiB2bpayTransqueryRequestV1Biz bizContent = new
JftApiB2bpayTransqueryRequestV1.JftApiB2bpayTransqueryRequestV1Biz();
bizContent.setAppId(APP_ID);
// bizContent.setOutVendorId("955888");
// bizContent.setOutUserId("874");
bizContent.setCardNo("9558830200003786563");
// bizContent.setPayAccount("0200000309200211917");
bizContent.setStartTrxDate("20240401");
bizContent.setEndTrxDate("20240730");
bizContent.setStartId("1");
bizContent.setEndId("50");
request.setBizContent(bizContent);
JftApiB2bpayTransqueryResponseV1 response;
try {
//到账通知交易流水查询
response = client.execute(request);
log.info(request.toString());
log.info(response.toString());
if ("00".equals(response.getStatus())) {
return R.ok();
} else {
return R.failed();
}
} catch (IcbcApiException e) {
e.printStackTrace();
return R.ok();
}
}
public R saveIcbcManagerCard() {
//应用id 应用方私钥 网关公钥 应用方加密串
String APP_ID = "11000000000000015602";
//应用方私钥
String MY_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCudy1tOyVTSCjJD9ej/IXmIKHTBLJ3FPYyhUnAt65hXgTD7OJso3+1cc+AakLGTLrSm9pxxd2AsUkVbdYFsXyq0rQOkG71ULPrzYI/XfbIcjf8dleFkTlEi+bVNN3J3LzbY4uPhPztDbkcwBoawl1jhcGTkFdIUCfJ8s9zXAAKgHjeNLXwrdnfvlTn8sfJX3JvrQ9W1Ji2NhCzAg7/fgJ9wAmS+aWKKBuc3ge5DQYcTtIe8hBeKSh6WZkjdUOja6ytOwEGCA3KiCVTw42rP/njrMAR3rh2ptXQtlLekMIEtiN3QAnIWp8IDg8uBEKr0aye6m/IfKMNpbbyaKqaeBUhAgMBAAECggEAOp0rk+ElHx/FJBfAeQWj7rbT51NSqhNOy5ZgOvD7ExdFPpXdVGZxx4HfFuOcX4bz1UIrV8IEMvJc/WgTWYJRwgpcF/CKdryQVg6LTcLB4IIPMTCJIwSxWsgt2z+Rq/oPMR32i1dAqlvL707S9l6KhZ8wc+UwjcjwNTbwX29vTBdiTsFS6QJBaUytu+nHoHvVrpg4botifiokHR1JX0hWjxP/Dh29aooaIbSu80A2sRPLIvRtCzxGjfcZP+H1ZtE439SCguuI+pOqWWLmzUV743PkGPpYPnYXadajrYBz8R5Uysm0tRwV4Ir4TxeH9axUP4Z/agldDNk/xBtK+PcgAQKBgQDwtUjrnzm29w/IwZHHCNDYtqZV2N42WrZZQusUbJ92QXsPFJpe4LCG4Ek7OYONuKuGfK/KJ2vZzlf+HlxlG7D+Xq/5Cb5LbZtIdIkLceOt+omfwHDVTqCM0jodNWKoYBQtI6PsksHpWtAkzP5kGSj7IabaJwKD0wxcbHvs5VFWoQKBgQC5jJFEfUAFGlPSoABdq8BQoaJZg976msnAy2QJMZRG/iEMywHTKFhMBkk3d0qpphdgHJQUr/gMcUtx9zlRBbvY30IOnpM9+nYqRXXlffqYIByM+PeO7AyihYrFpWlVdOO/ezp0VN0QZ8XwlkaYcvADae53C8K7DKtkLlDV71qugQKBgQDstzspDIMznbAWG9aCx/aqyKS3k/ijt33QNnD8uv3uy+J7KCXP3GN9oKAj8CGhg9SbA4/U3APCRJxgOfdfL2ZWIUQpQx2zC+1DyebkLHJdrB8fzZ6pBxP4qN2hz9hgAWyWH5CbnI+6Lya2qioawmt83NE7hFWC0lA7rCwLAlGFQQKBgBmpf03hpMEP6xfuWR6banW8ZR/MRUKTteOcPbGn0cIf06JZUV9K7StWkznAnerotcLtMO3LiJrv8GdKsfqquFg+SHyNIgAoa79c6/lZexcfGdPFezehHf48Sf0b632ONRF+kY8VTZ2/PHkRz6G2A8v1Eq4USlJkZi/s1/E+sWQBAoGAMU8mm9SGWka1hPYOI3ONCzeBbRBNulcS7B7luGcEbhPwi0p77xciSUy64GSVjZboD/DX9n3m7rU2GIqr50gkpQuTW9N9PNr7z74Tk36bCp5MpEeybMOgv8hovEQBa5PoTbAm9qMf9Xm1whQXUzhjcWR7vT4qAg1A+QXX58G9EkA=";
//网关公钥
String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB";
//应用方加密串
String AES_Key = "5xGJdh7qb+B95SUoxDlatg==";
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2,
MY_PRIVATE_KEY, IcbcConstants.CHARSET_UTF8, IcbcConstants.FORMAT_JSON,
APIGW_PUBLIC_KEY, IcbcConstants.ENCRYPT_TYPE_AES, AES_Key, null, null);
JftApiPayB2bpayGenpreorderRequestV1 request = new JftApiPayB2bpayGenpreorderRequestV1();
request.setServiceUrl("https://apipcs3.dccnet.com.cn/api/jft/api/pay/b2bpay/genpreorder/V1");
JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz bizContent =
new JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz();
bizContent.setAppId(APP_ID);
bizContent.setOutOrderId("202406200000066688");
bizContent.setPayMethod("05");
bizContent.setMultiRecFlag("0");
bizContent.setStlFlag("0");
bizContent.setAsynFlag("0");
bizContent.setOutVendorId("158742714");
bizContent.setOutUserId("0202401200000000039");
// bizContent.setRecAcctId("123654123");
// bizContent.setPayerAcctId("1001765234");
bizContent.setTradeTime("2024-06-21 10:41:56");
bizContent.setTrxChannel("01");
bizContent.setTrxIp("172.16.24.98");
bizContent.setPayModeTool("5");
bizContent.setPayPhoneno("18856151558");
bizContent.setPayerType("1");
bizContent.setOrderAmount("2.00");
bizContent.setPayAmount("2.00");
bizContent.setFloatRate("888");
bizContent.setProvince("安徽");
bizContent.setCity("合肥市");
bizContent.setCounty("包河区");
bizContent.setEmail("123456@icbc.com");
bizContent.setPhone("1388888888");
bizContent.setAddress("安徽");
bizContent.setPost("5168845");
bizContent.setPayRem("试一下");
bizContent.setOrderRem("食品");
bizContent.setAddRemark("食品");
bizContent.setPayerName("aigc科技集团");
bizContent.setPayerAcctNum("0200062009212528888");
bizContent.setCurrency("001");
bizContent.setPayerWalletId("1234567890123456789012");
bizContent.setPayerWalletName("XXXXX有限公司");
bizContent.setNotifyUrl("http://www.xxx.com");
bizContent.setJumpUrl("http://www.xxx.com");
JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.Good
goodsInfo = new JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.Good();
goodsInfo.setGoodsSeqno("1");
goodsInfo.setGoodsName("牛肉干");
goodsInfo.setGoodsNum("10");
goodsInfo.setGoodsAmt("10");
goodsInfo.setWeight("肉干");
goodsInfo.setPrice("50");
goodsInfo.setSellerAddress("13866668");
goodsInfo.setSellerName("牛大");
goodsInfo.setUnits("斤");
goodsInfo.setOutVendorId("158742714");
// JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.Good
// goodsInfo2 = new JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.Good();
// goodsInfo2.setGoodsSeqno("2");
// goodsInfo2.setGoodsName("商品");
// goodsInfo2.setGoodsNum("10");
// goodsInfo2.setGoodsAmt("10");
// goodsInfo2.setWeight("商品规格");
// goodsInfo2.setPrice("50");
// goodsInfo2.setSellerAddress("13866668");
// goodsInfo2.setSellerName("张三");
// goodsInfo2.setUnits("斤");
// goodsInfo2.setOutVendorId("158742714");
List<JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.Good> goodList = new ArrayList<>();
goodList.add(goodsInfo);
// goodList.add(goodsInfo2);
bizContent.setGoodsInfo(goodList);
JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.RecInfo
recInfo1 = new JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.RecInfo();
recInfo1.setOutVendorId("158742714");
recInfo1.setRecAcctId("123654123");
recInfo1.setTrxAmount("2.00");
recInfo1.setOrderAmount("2.00");
// JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.RecInfo
// recInfo2 = new JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.RecInfo();
// recInfo2.setOutVendorId("158742714");
// recInfo2.setRecAcctId("04187335");
// recInfo2.setTrxAmount("1.00");
// recInfo2.setOrderAmount("1.00");
List<JftApiPayB2bpayGenpreorderRequestV1.JftApiPayB2bpayGenpreorderRequestV1Biz.RecInfo> recList = new ArrayList<>();
recList.add(recInfo1);
// recList.add(recInfo2);
bizContent.setRecList(recList);
bizContent.setSummary("测试一下");
bizContent.setPurpose("测试一下");
request.setBizContent(bizContent);
try {
JftApiPayB2bpayGenpreorderResponseV1 responseV1 = client.execute(request);
if ("00".equals(responseV1.getStatus())) {
return R.ok();
} else {
return R.failed();
}
} catch (IcbcApiException e) {
e.printStackTrace();
return R.ok();
}
}
}
......@@ -4463,6 +4463,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
util = new ExcelUtil<>(InsuredListVo.class);
TInsuranceReplace one;
TInsuranceDetail byId;
ProjectSetInfoVo coverObject = null;
for (InsuredListVo vo:list){
//被替换人
one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
......@@ -4487,9 +4488,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
vo.setCoverEmpName(byId.getEmpName());
vo.setCoverEmpIdcardNo(byId.getEmpIdcardNo());
vo.setCoverProjectName(byId.getDeptName());
ProjectSetInfoVo coverObject = dataReplace.get(byId.getDeptNo());
coverObject = null;
if (Common.isNotNull(dataReplace)){
coverObject = dataReplace.get(byId.getDeptNo());
}
if (null != coverObject) {
vo.setCoverInvoiceTitle(Optional.ofNullable(coverObject.getInvoiceTitleInsurance()).orElse(""));
}else {
vo.setCoverInvoiceTitle("未获取到对应项目信息");
}
}
}
......
......@@ -194,5 +194,64 @@ public class SocialTask {
log.info("------------2定时任务推送社保士兵-定时任务结束------------");
}
/**
* @Description: 3每日定时任务推送社保士兵审核结果查询
* @Author: hgw
* @Date: 2024-5-30 17:33:35
* @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: 2024-5-30 17:33:35
* @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每日定时任务获取社保士兵审核结果查询-定时任务结束------------");
}
/**
* @Description: 5每月5号推送工资申报、调整(实缴使用)
* @Author: hgw
* @Date: 2024-5-30 17:33:35
* @return: void
**/
public void doInnerPushSalaryByShenBao() {
log.info("------------5每月5号推送工资申报、调整(实缴使用)-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doInnerPushSalaryByShenBao","", Object.class, SecurityConstants.FROM_IN);
log.info("------------5每月5号推送工资申报、调整(实缴使用)-定时任务结束------------");
}
/**
* @Description: 6每月6号0点推送实缴3张表查询
* @Author: hgw
* @Date: 2024-6-6 10:54:39
* @return: void
**/
public void doPushPaymentThree() {
log.info("------------6每月6号1点推送实缴3张表查询-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doPushPaymentThree","", Object.class, SecurityConstants.FROM_IN);
log.info("------------6每月6号1点推送实缴3张表查询-定时任务结束------------");
}
/**
* @Description: 7每月6号3点定时任务获取社保士兵实缴3张表
* @Author: hgw
* @Date: 2024-6-6 10:54:43
* @return: void
**/
public void doInnerGetPaymentThree() {
log.info("------------7每月6号3点定时任务获取社保士兵实缴3张表-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doInnerGetPaymentThree","", Object.class, SecurityConstants.FROM_IN);
log.info("------------7每月6号3点定时任务获取社保士兵实缴3张表-定时任务结束------------");
}
}
......@@ -451,9 +451,17 @@ public class TSalaryStandard extends BaseEntity {
*/
@Schema(description = "收入月份")
private String incomeMonth;
//方案名称ID
@Schema(description = "配置ID")
private String setId;
//方案名称
@Schema(description = "方案名称")
private String setName;
//原表类型
@Schema(description = "原表类型")
private String originalSetName;
@Schema(description = "删除人(汉字名)")
private String deleteUser;
@Schema(description = "删除时间")
......
......@@ -44,4 +44,10 @@ public class SalaryUploadParamVo {
// 表格类型 0 薪资原表 1 系统模板
String excelType;
// 方案名称
String setName;
// 原表类型
String originalSetName;
}
/*
* 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.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeFourExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String status;
@ExcelProperty("项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptName;
@ExcelProperty("项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptNo;
@ExcelProperty("发放月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String settlementMonth;
@ExcelProperty("薪酬月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryMonth;
@ExcelProperty("员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
private String empName;
@ExcelProperty("身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
private String empIdcard;
@ExcelProperty("手机号码")
@HeadFontStyle(fontHeightInPoints = 11)
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("稿酬")
@HeadFontStyle(fontHeightInPoints = 11)
private String relaySalary;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTax;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal actualSalary;
//稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
@HeadFontStyle(fontHeightInPoints = 11)
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String haveSalaryFlag;
@ExcelProperty("支出结算状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String paySettleFlag;
}
/*
* 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.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeThreeExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,劳务费,工资发放时间,是否个人承担部分税费
// 个税-个人承担,个税-单位承担,公司应发,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String status;
@ExcelProperty("项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptName;
@ExcelProperty("项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptNo;
@ExcelProperty("发放月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String settlementMonth;
@ExcelProperty("薪酬月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryMonth;
@ExcelProperty("员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
private String empName;
@ExcelProperty("身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
private String empIdcard;
@ExcelProperty("手机号码")
@HeadFontStyle(fontHeightInPoints = 11)
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("劳务费")
@HeadFontStyle(fontHeightInPoints = 11)
private String relaySalary;
// 工资发放时间(0立即发、1暂停发)
@ExcelProperty("工资发放时间")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryGiveTime;
/**
* 是否个人承担部分税费
* 公司承担全部税费0
* 个人承担部分税费1
* 个人承担全部税费2
*/
@ExcelProperty("是否个人承担部分税费")
@HeadFontStyle(fontHeightInPoints = 11)
private String isPersonTax;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税-个人承担")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTax;
/**
* 个税-单位承担
*/
@ExcelProperty("个税-单位承担")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTaxUnit;
/**
* 公司应发
*/
@ExcelProperty("公司应发")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal relaySalaryUnit;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal actualSalary;
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
@HeadFontStyle(fontHeightInPoints = 11)
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String haveSalaryFlag;
@ExcelProperty("支出结算状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String paySettleFlag;
}
......@@ -197,4 +197,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
List<TSalaryAccount> allYearExport(@Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -213,4 +213,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
TSalaryAccountSumVo getAccountSumBySalaryId(String salaryId);
List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -299,6 +299,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
s.setBusinessThirdType(dept.getBusinessThirdType());
if (configSalary != null) {
s.setSetId(configSalary.getId());
s.setSetName(configSalary.getName());
if (Common.isNotNull(configSalary.getIncomeMonth())) {
s.setIncomeMonth(DateUtil.addMonth(configSalary.getIncomeMonth()));
}
......@@ -352,6 +353,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (Common.isNotNull(vo.getExcelType())) {
salary.setExcelType(vo.getExcelType());
}
if (Common.isNotNull(vo.getOriginalSetName())){
salary.setOriginalSetName(vo.getOriginalSetName());
}
// 薪资导入、删除前加锁:
TSalaryLock lock = salaryLockService.lambdaQuery()
.eq(TSalaryLock::getDeptId, dept.getId())
......
......@@ -396,4 +396,14 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
public List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount) {
return baseMapper.allYearExport(tSalaryAccount);
}
@Override
public List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo) {
return baseMapper.getAccountThreeListByApplyNo(applyNo);
}
@Override
public List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo) {
return baseMapper.getAccountFourListByApplyNo(applyNo);
}
}
......@@ -30,14 +30,19 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAttaMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -291,46 +296,79 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
* @Date: 2024/4/18 17:05
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo
**/
@Async
@Override
public synchronized SalaryAttaVo getSalaryAccountToExcel(String applyNo) {
SalaryAttaVo returnVo = new SalaryAttaVo();
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
String filePath = "salaryAccountFile";
String fileName = "薪资报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
EasyExcelFactory.write(filePath, TSalaryAccountExportByEkpVo.class).sheet("薪资报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key,null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TSalaryAtta salaryAtta = this.saveTSalaryAtta(fileName, key, file.length(), applyNo, 14, null, null, null);
try {
this.save(salaryAtta);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
}
URL url = ossUtil.getObjectUrl(null, salaryAtta.getAttaSrc());
returnVo.setAttaUrl(url.toString());
returnVo.setAttaName(salaryAtta.getAttaName());
return returnVo;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
TSalaryStandard standard = tSalaryStandardService.getOne(Wrappers.<TSalaryStandard>query().lambda()
.eq(TSalaryStandard::getApplyNo,applyNo).last(CommonConstants.LAST_ONE_SQL));
// 默认薪资
String formType = CommonConstants.ZERO_STRING;
String preFileName = "薪资";
if (Common.isNotNull(standard)){
formType = standard.getFormType();
}
//薪资
if (CommonConstants.ZERO_STRING.equals(formType)){
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryAccountExportByEkpVo.class);
}
}
//劳务费
if (CommonConstants.THREE_STRING.equals(formType)){
List<TSalaryTypeThreeExportEkpVo> accountList = tSalaryAccountService.getAccountThreeListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeThreeExportEkpVo.class);
}
}
//稿酬
if (CommonConstants.FOUR_STRING.equals(formType)){
List<TSalaryTypeFourExportEkpVo> accountList = tSalaryAccountService.getAccountFourListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeFourExportEkpVo.class);
}
}
return returnVo;
}
private <T> SalaryAttaVo getSalaryAttaVo(String applyNo, SalaryAttaVo returnVo, String preFileName, List<T> accountList,Class<T> tClass) {
String filePath = "salaryAccountFile";
String fileName = preFileName + "报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
;
EasyExcelFactory.write(filePath, tClass).sheet(preFileName + "报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key,null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TSalaryAtta salaryAtta = this.saveTSalaryAtta(fileName, key, file.length(), applyNo, 14, null, null, null);
try {
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
this.save(salaryAtta);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
}
URL url = ossUtil.getObjectUrl(null, salaryAtta.getAttaSrc());
returnVo.setAttaUrl(url.toString());
returnVo.setAttaName(salaryAtta.getAttaName());
return returnVo;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
try {
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
}
}
return returnVo;
return null;
}
}
......@@ -574,6 +574,25 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
**/
private HashMap<String, Object> setSendEkpStandardParam(TSalaryStandard s) {
HashMap<String, Object> sendMap = new HashMap<>();
//表单类型 fd_3cfb06799adc3a 表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬 fxj 20240523
if (CommonConstants.ZERO_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "薪资");
}
if (CommonConstants.ONE_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "绩效");
}
if (CommonConstants.TWO_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "其他");
}
if (CommonConstants.THREE_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "劳务费");
}
if (CommonConstants.FOUR_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "稿酬");
}
//表格类型 fd_3cfb067af80082 表格类型 0 薪资原表 1 系统模板 fxj 20240523
sendMap.put("fd_3cfb067af80082", CommonConstants.ZERO_STRING.equals(s.getExcelType())?"薪资原表":"系统模板");
sendMap.put("fd_3b3bf2c3b1a6cc", s.getDeptName());
sendMap.put("fd_3b3bf2c426cfc8", s.getDeptNo());
sendMap.put("fd_3b3bf2c4975776", s.getApplyNo() == null ? "" : s.getApplyNo());
......@@ -658,6 +677,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
socialParam.setFd_3adfe8c70d3fd4(account.getFd_3adfedf98ccba2());
//项目名称
socialParam.setFd_3adfe8c8468e54(account.getFd_3adfedf9d2bf1c());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(account.getFd_3adfedf98ccba2());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(account.getFd_3adfedf9d2bf1c());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
......@@ -1409,4 +1409,80 @@
order by a.SALARY_MONTH desc
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountThreeListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo">
select
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime,
if(a.IS_PERSON_TAX='1','个人承担部分税费',if(a.IS_PERSON_TAX='2','个人承担全部税费','公司承担全部税费')) as isPersonTax,
a.SALARY_TAX as salaryTax,
a.SALARY_TAX_UNIT as salaryTaxUnit,
a.RELAY_SALARY_UNIT as relaySalaryUnit,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountFourListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo">
select
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
a.SALARY_TAX as salaryTax,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
</mapper>
......@@ -85,6 +85,8 @@
<result property="deleteUser" column="DELETE_USER"/>
<result property="deleteDate" column="DELETE_DATE"/>
<result property="excelType" column="EXCEL_TYPE"/>
<result property="setName" column="SET_NAME"/>
<result property="originalSetName" column="ORIGINAL_SET_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -147,7 +149,9 @@
a.SET_ID,
a.DELETE_USER,
a.DELETE_DATE,
a.EXCEL_TYPE
a.EXCEL_TYPE,
a.SET_NAME,
a.ORIGINAL_SET_NAME
</sql>
<sql id="tSalaryStandard_where">
<if test="tSalaryStandard != null">
......@@ -298,6 +302,12 @@
<if test="tSalaryStandard.excelType != null and tSalaryStandard.excelType.trim() != ''">
AND a.EXCEL_TYPE = #{tSalaryStandard.excelType}
</if>
<if test="tSalaryStandard.setName != null and tSalaryStandard.setName.trim() != ''">
AND a.SET_NAME = #{tSalaryStandard.setName}
</if>
<if test="tSalaryStandard.originalSetName != null and tSalaryStandard.originalSetName.trim() != ''">
AND a.ORIGINAL_SET_NAME = #{tSalaryStandard.originalSetName}
</if>
</if>
</sql>
<!--tSalaryStandard简单分页查询-->
......
/*
* 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.ExcelIgnore;
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;
import java.math.BigDecimal;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
@TableName("t_auto_payment_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化实缴记录表")
public class TAutoPaymentDetail extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelIgnore
@Schema(description = "id")
private String id;
/**
* 是否重新办理 0 是 1 否
*/
@ExcelAttribute(name = "是否重新办理 0 是 1 否", maxLength = 1)
@Length(max = 1, message = "是否重新办理 0 是 1 否不能超过1个字符")
@ExcelProperty("是否重新办理")
@Schema(description = "是否重新办理 0 是 1 否")
private String repeatHandleFlag;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 证件类型
*/
@ExcelAttribute(name = "证件类型", maxLength = 50)
@Length(max = 50, message = "证件类型不能超过50个字符")
@ExcelProperty("证件类型")
@Schema(description = "证件类型")
private String certType;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50)
@Length(max = 50, message = "证件号码不能超过50个字符")
@ExcelProperty("证件号码")
@Schema(description = "证件号码")
private String certNum;
/**
* 缴费工资
*/
@ExcelAttribute(name = "缴费工资")
@ExcelProperty("缴费工资")
@Schema(description = "缴费工资")
private BigDecimal paymentSalary;
/**
* 缴费基数
*/
@ExcelAttribute(name = "缴费基数")
@ExcelProperty("缴费基数")
@Schema(description = "缴费基数")
private BigDecimal paymentBase;
/**
* 费率
*/
@ExcelAttribute(name = "费率", maxLength = 10)
@Length(max = 10, message = "费率不能超过10个字符")
@ExcelProperty("费率")
@Schema(description = "费率")
private String rate;
/**
* 应缴费额
*/
@ExcelAttribute(name = "应缴费额")
@ExcelProperty("应缴费额")
@Schema(description = "应缴费额")
private BigDecimal payLimit;
/**
* 人员编号
*/
@ExcelAttribute(name = "人员编号", maxLength = 32)
@Length(max = 32, message = "人员编号不能超过32个字符")
@ExcelProperty("人员编号")
@Schema(description = "人员编号")
private String empCode;
/**
* 险种
*/
@ExcelAttribute(name = "险种", maxLength = 50)
@Length(max = 50, message = "险种不能超过50个字符")
@ExcelProperty("险种")
@Schema(description = "险种")
private String insuranceType;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份", maxLength = 10)
@Length(max = 10, message = "社保缴纳月份不能超过10个字符")
@ExcelProperty("社保缴纳月份")
@Schema(description = "社保缴纳月份")
private String payMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份", maxLength = 10)
@Length(max = 10, message = "社保生成月份不能超过10个字符")
@ExcelProperty("社保生成月份")
@Schema(description = "社保生成月份")
private String createMonth;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地", maxLength = 50)
@Length(max = 50, message = "社保缴纳地不能超过50个字符")
@ExcelProperty("社保缴纳地")
@Schema(description = "社保缴纳地")
private String socialAddress;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", maxLength = 100)
@Length(max = 100, message = "社保户不能超过100个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialSecurityAccount;
/**
* 资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询;4单位缴费明细下载
*/
@ExcelAttribute(name = "资源类型", maxLength = 100)
@Length(max = 100, message = "资源类型不能超过100个字符")
@ExcelProperty("资源类型")
@Schema(description = "资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询;4单位缴费明细下载")
private String sourceType;
/**
* 主表ID
*/
@ExcelAttribute(name = "主表ID", isNotEmpty = true, errorInfo = "主表ID不能为空", maxLength = 32)
@NotBlank(message = "主表ID不能为空")
@Length(max = 32, message = "主表ID不能超过32个字符")
@ExcelIgnore
@Schema(description = "主表ID")
private String parentId;
}
/*
* 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.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
@Data
@TableName("t_auto_payment_error")
@Schema(description = "社保士兵实缴核验错误反馈表")
public class TAutoPaymentError {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
@ExcelIgnore
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")
@ExcelIgnore
private String parentId;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50)
@Length(max = 50, message = "证件号码不能超过50个字符")
@ExcelProperty("证件号码")
@Schema(description = "证件号码")
private String certNum;
/**
* 险种
*/
@ExcelAttribute(name = "险种", maxLength = 50)
@Length(max = 50, message = "险种不能超过50个字符")
@ExcelProperty("险种")
@Schema(description = "险种")
private String insuranceType;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", maxLength = 100)
@Length(max = 100, message = "社保户不能超过100个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialSecurityAccount;
/**
* 错误信息
*/
@ExcelAttribute(name = "错误信息", maxLength = 50)
@Length(max = 50, message = "错误信息不能超过50个字符")
@ExcelProperty("错误信息")
@Schema(description = "错误信息")
private String errorInfo;
}
/*
* 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.alibaba.excel.annotation.write.style.HeadFontStyle;
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 fxj
* @date 2024-05-24 10:56:42
*/
@Data
@TableName("t_auto_payment_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化实缴记录表")
public class TAutoPaymentInfo extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 生成月
*/
@ExcelAttribute(name = "生成月", maxLength = 6)
@Length(max = 1, message = "生成月不能超过6个字符")
@ExcelProperty("生成月")
@Schema(description = "生成月")
private String createMonth;
/**
* 数据整合之日常申报:0未整合1整合中2已整合3整合失败
*/
@ExcelAttribute(name = "数据整合之日常申报", maxLength = 1)
@Length(max = 1, message = "数据整合之日常申报不能超过1个字符")
@ExcelProperty("数据整合之日常申报")
@Schema(description = "数据整合之日常申报:0未整合1整合中2已整合3整合失败")
private String dataOneFlag;
/**
* 数据整合之人员缴费明细:0未整合1整合中2已整合3整合失败
*/
@ExcelAttribute(name = "数据整合之人员缴费明细", maxLength = 1)
@Length(max = 1, message = "数据整合之人员缴费明细不能超过1个字符")
@ExcelProperty("数据整合之人员缴费明细")
@Schema(description = "数据整合之人员缴费明细:0未整合1整合中2已整合3整合失败")
private String dataTwoFlag;
/**
* 数据整合之单位缴费明细:0未整合1整合中2已整合3整合失败
*/
@ExcelAttribute(name = "数据整合之单位缴费明细", maxLength = 1)
@Length(max = 1, message = "数据整合之单位缴费明细不能超过1个字符")
@ExcelProperty("数据整合之单位缴费明细")
@Schema(description = "数据整合之单位缴费明细:0未整合1整合中2已整合3整合失败")
private String dataThreeFlag;
/**
* 数据整合之日常申报的备注
*/
@ExcelAttribute(name = "数据整合之日常申报的备注", maxLength = 100)
@Length(max = 100, message = "数据整合之日常申报的备注不能超过100个字符")
@ExcelProperty("数据整合之日常申报的备注")
@Schema(description = "数据整合之日常申报的备注")
private String dataOneRemark;
/**
* 数据整合之人员缴费明细的备注
*/
@ExcelAttribute(name = "数据整合之人员缴费明细的备注", maxLength = 100)
@Length(max = 100, message = "数据整合之人员缴费明细的备注不能超过100个字符")
@ExcelProperty("数据整合之人员缴费明细的备注")
@Schema(description = "数据整合之人员缴费明细的备注")
private String dataTwoRemark;
/**
* 数据整合之单位缴费明细的备注
*/
@ExcelAttribute(name = "数据整合之单位缴费明细的备注", maxLength = 100)
@Length(max = 100, message = "数据整合之单位缴费明细的备注不能超过100个字符")
@ExcelProperty("数据整合之单位缴费明细的备注")
@Schema(description = "数据整合之单位缴费明细的备注")
private String dataThreeRemark;
/**
* 系统复核:0未复核1复核中2复核成功3复核失败
*/
@ExcelAttribute(name = "系统复核", maxLength = 1)
@Length(max = 1, message = "系统复核不能超过1个字符")
@ExcelProperty("系统复核:0未复核1复核中2复核成功3复核失败")
@Schema(description = "系统复核:0未复核1复核中2复核成功3复核失败")
private String systemReviewFlag;
/**
* 重新复核状态 0未复核1复核中2复核成功3复核失败
*/
@ExcelAttribute(name = "重新复核状态", maxLength = 1)
@Length(max = 1, message = "重新复核状态不能超过1个字符")
@ExcelProperty("重新复核状态 0未复核1复核中2复核成功3复核失败")
@Schema(description = "重新复核状态 0未复核1复核中2复核成功3复核失败")
private String repeatReviewFlag;
/**
* 资源路径
*/
@ExcelAttribute(name = "资源路径", maxLength = 200)
@Length(max = 200, message = "资源路径不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源路径")
private String attaSrc;
/**
* 资源地址
*/
@ExcelAttribute(name = "资源地址", maxLength = 100)
@Length(max = 100, message = "资源地址不能超过100个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源地址")
private String attaUrl;
/**
* 原表资源地址1
*/
@ExcelAttribute(name = "原表资源地址1", maxLength = 200)
@Length(max = 200, message = "原表资源地址1不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("原表资源地址1")
private String attaUrlOne;
/**
* 原表资源地址2
*/
@ExcelAttribute(name = "原表资源地址2", maxLength = 200)
@Length(max = 200, message = "原表资源地址2不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("原表资源地址2")
private String attaUrlTwo;
/**
* 原表资源地址3
*/
@ExcelAttribute(name = "原表资源地址3", maxLength = 200)
@Length(max = 200, message = "原表资源地址3不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("原表资源地址3")
private String attaUrlThree;
/**
* 原表资源地址4
*/
@ExcelAttribute(name = "原表资源地址4", maxLength = 200)
@Length(max = 200, message = "原表资源地址4不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("原表资源地址4")
private String attaUrlFour;
}
......@@ -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)
......
/*
* 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-5-30 09:53:57
*/
@Data
@TableName("t_social_soldier_shen_bao_task")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "社保工资申报、调整推送记录表")
public class TSocialSoldierShenBaoTask 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 addId;
/**
* 1申报;2调整
*/
@ExcelAttribute(name = "1申报;2调整", isNotEmpty = true, errorInfo = "1申报;2调整", maxLength = 2)
@NotBlank(message = "1申报;2调整不能为空")
@Length(max = 2, message = "1申报;2调整不能超过1个字符")
@ExcelProperty("1申报;2调整")
@Schema(description = "1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询;6:实缴3单位缴费明细下载")
private String type;
/**
* 拉取状态:0未拉取;1已拉取
*/
@ExcelAttribute(name = "拉取状态:0未拉取;1已拉取", maxLength = 1)
@Length(max = 1, message = "拉取状态:0未拉取;1已拉取不能超过1个字符")
@ExcelProperty("拉取状态:0未拉取;1已拉取")
@Schema(description = "拉取状态:0未拉取;1已拉取")
private String dataStatus;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵实缴3张表查询1_合肥-社保费管理客户端-日常申报导出
* @Date 2024-5-29 18:20:26
**/
@Data
public class SocialSoldierPaymentSelectOneVo implements Serializable {
// 单位编号 单位名称 是否截图(日常申报) 费款所属期 单企业多Sheet 单企业单Sheet 多企业单Sheet 有效期起 有效期止 是否查询职工缴费工资 回传信息
// 单位编号 单位名称 是否截图(日常申报) 费款所属期 是否下载人员明细 单企业多Sheet 单企业单Sheet 多企业单Sheet 有效期起 有效期止 是否查询职工缴费工资 回传信息
@ExcelProperty("单位编号")
private String companyNo;
@ExcelProperty("单位名称")
private String companyName;
@ExcelProperty("是否截图(日常申报)")
private String isPrint;
@ExcelProperty("费款所属期")
private String createMonth;
@ExcelProperty("是否下载人员明细")
private String isDownLoad;
@ExcelProperty("单企业多Sheet")
private String danDuoSheet;
@ExcelProperty("单企业单Sheet")
private String danDanSheet;
@ExcelProperty("多企业单Sheet")
private String duoDanSheet;
@ExcelProperty("有效期起")
private String startDate;
@ExcelProperty("有效期止")
private String endDate;
@ExcelProperty("是否查询职工缴费工资")
private String isSalary;
@ExcelProperty("回传信息")
private String returnInfo;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵实缴3张表查询3_合肥-医保-单位缴费明细查询
* @Date 2024-5-29 18:20:26
**/
@Data
public class SocialSoldierPaymentSelectThreeVo implements Serializable {
// 企业名称 对应费款所属期 险种类型 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("对应费款所属期")
private String createMonth;
@ExcelProperty("险种类型")
private String paymentType;
@ExcelProperty("回传信息")
private String returnInfo;
@ExcelProperty("回传信息1")
private String returnInfoOne;
@ExcelProperty("回传信息2")
private String returnInfoTwo;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵实缴3张表查询2_合肥-社保-单位个人缴费信息查询
* @Date 2024-5-29 18:20:26
**/
@Data
public class SocialSoldierPaymentSelectTwoVo implements Serializable {
// 企业名称 参险类型 业务年月 回传信息 回传信息1 回传信息2
// 2024-6-7 11:29:15 变模版:
// 企业名称 证件号码 姓名 险种类型 人员状态 开始日期 结束日期 回传信息 回传信息1 回传信息2
// 2024-6-11 15:20:59 陈红确认 使用 B社会保险-单位个人缴费信息查询 => 合肥-社保-单位个人缴费信息查询
@ExcelProperty("企业名称")
private String companyName;
@ExcelProperty("参险类型")
private String paymentType;
@ExcelProperty("业务年月")
private String payMonth;
@ExcelProperty("回传信息")
private String returnInfo;
@ExcelProperty("回传信息1")
private String returnInfoOne;
@ExcelProperty("回传信息2")
private String returnInfoTwo;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵实缴前置-工资申报
* @Date 2024-5-29 18:20:26
**/
@Data
public class SocialSoldierSalaryShenBaoVo implements Serializable {
// #单位编号 单位名称 *姓名 *身份证件类型代码 *身份证件号码 分组 原申报工资 *新缴费工资 养老保险缴费工资
// #失业保险险缴费工资 医疗保险缴费工资 大额医疗补助缴费工资 工伤保险缴费工资 申报方式 回传信息
@ExcelProperty("单位编号")
private String companyNo;
@ExcelProperty("单位名称")
private String companyName;
@ExcelProperty("*姓名")
private String empName;
@ExcelProperty("*身份证件类型代码")
private String empIdCardType;
@ExcelProperty("*身份证件号码")
private String empIdCard;
@ExcelProperty("分组")
private String fenZu;
@ExcelProperty("原申报工资")
private String oldSalary;
@ExcelProperty("*新缴费工资")
private String newSalary;
@ExcelProperty("养老保险缴费工资")
private String yangLao;
@ExcelProperty("失业保险险缴费工资")
private String shiYe;
@ExcelProperty("医疗保险缴费工资")
private String yiLiao;
@ExcelProperty("大额医疗补助缴费工资")
private String daBing;
@ExcelProperty("工伤保险缴费工资")
private String gongShang;
@ExcelProperty("申报方式")
private String shenBaoType;
@ExcelProperty("回传信息")
private String returnInfo;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Description 社保士兵实缴前置-工资调整
* @Date 2024-5-29 18:20:26
**/
@Data
public class SocialSoldierSalaryTiaoZhengVo implements Serializable {
// 单位编号 单位名称 生效年份 *姓名 *身份证件类型代码 *身份证件号码 分组 原申报工资 *新缴费工资 养老保险缴费工资
// 失业保险险缴费工资 医疗保险缴费工资 工伤保险缴费工资 申报方式 回传信息
@ExcelProperty("单位编号")
private String companyNo;
@ExcelProperty("单位名称")
private String companyName;
@ExcelProperty("生效年份")
private String shengXiaoYear;
@ExcelProperty("*姓名")
private String empName;
@ExcelProperty("*身份证件类型代码")
private String empIdCardType;
@ExcelProperty("*身份证件号码")
private String empIdCard;
@ExcelProperty("分组")
private String fenZu;
@ExcelProperty("原申报工资")
private String oldSalary;
@ExcelProperty("*新缴费工资")
private String newSalary;
@ExcelProperty("养老保险缴费工资")
private String yangLao;
@ExcelProperty("失业保险险缴费工资")
private String shiYe;
@ExcelProperty("医疗保险缴费工资")
private String yiLiao;
@ExcelProperty("工伤保险缴费工资")
private String gongShang;
@ExcelProperty("申报方式")
private String shenBaoType;
@ExcelProperty("回传信息")
private String returnInfo;
}
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;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentDetailSearchVo extends TAutoPaymentDetail {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.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.vo.RowIndex;
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 com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentDetailVo extends RowIndex implements Serializable {
/**
* 是否重新办理 0 是 1 否
*/
@ExcelAttribute(name = "是否重新办理", maxLength = 1,readConverterExp = "0=是,1=否",isNotEmpty = true)
@Schema(description = "是否重新办理 0 是 1 否")
@ExcelProperty("是否重新办理")
private String repeatHandleFlag;
/**
* 姓名
*/
@Length(max = 32, message = "姓名 不能超过32 个字符")
@ExcelAttribute(name = "姓名", maxLength = 32,isNotEmpty = true)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50,isNotEmpty = true)
@Schema(description = "证件号码")
@ExcelProperty("证件号码")
private String certNum;
/**
* 社保户
*/
@Length(max = 100, message = "社保户 不能超过100 个字符")
@ExcelAttribute(name = "社保户", maxLength = 100,isNotEmpty = true)
@Schema(description = "社保户")
@ExcelProperty("社保户")
private String socialSecurityAccount;
}
/*
* 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.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
@Data
public class TAutoPaymentErrorSearchVo extends TAutoPaymentError {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentInfoSearchVo extends TAutoPaymentInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* 创建时间起
*/
@TableField(exist = false)
@Schema(description = "创建时间起")
private LocalDateTime createTimeStart;
/**
* 创建时间止
*/
@TableField(exist = false)
@Schema(description = "创建时间止")
private LocalDateTime createTimeEnd;
/**
* 更新时间起
*/
@TableField(exist = false)
@Schema(description = "更新时间起")
private LocalDateTime updateTimeStart;
/**
* 更新时间止
*/
@TableField(exist = false)
@Schema(description = "更新时间止")
private LocalDateTime updateTimeEnd;
}
/*
* 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.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentInfoVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 数据整合:1 整合中 2已整合
*/
@Length(max = 1, message = "数据整合:1 整合中 2已整合 不能超过1 个字符")
@ExcelAttribute(name = "数据整合:1 整合中 2已整合", maxLength = 1)
@Schema(description = "数据整合:1 整合中 2已整合")
@ExcelProperty("数据整合:1 整合中 2已整合")
private String dataIntegrationFlag;
/**
* 系统复核:0复核中1复核成功2复核失败
*/
@Length(max = 1, message = "系统复核:0复核中1复核成功2复核失败 不能超过1 个字符")
@ExcelAttribute(name = "系统复核:0复核中1复核成功2复核失败", maxLength = 1)
@Schema(description = "系统复核:0复核中1复核成功2复核失败")
@ExcelProperty("系统复核:0复核中1复核成功2复核失败")
private String systemReviewFlag;
/**
* 重新复核状态 0 复核中 1复核成功 2复核失败
*/
@Length(max = 1, message = "重新复核状态 0 复核中 1复核成功 2复核失败 不能超过1 个字符")
@ExcelAttribute(name = "重新复核状态 0 复核中 1复核成功 2复核失败", maxLength = 1)
@Schema(description = "重新复核状态 0 复核中 1复核成功 2复核失败")
@ExcelProperty("重新复核状态 0 复核中 1复核成功 2复核失败")
private String repeatReviewFlag;
/**
* 创建人id
*/
@Length(max = 32, message = "创建人id 不能超过32 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 32)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 32, message = "创建人姓名 不能超过32 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 32)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private Date createTime;
/**
* 更新人id
*/
@Length(max = 32, message = "更新人id 不能超过32 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 32)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private Date updateTime;
}
/*
* 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,10 @@ 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(sheBaoArrObj.get("label"))) {
sheMap.put("单位个人缴费信息查询", sheBaoArrObj.getString("value"));
}
}
} else if ("医保".equals(childrenArrObj.get("label"))) {
......@@ -125,6 +129,24 @@ 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(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"))) {
sheBaoArr = (JSONArray) childrenArrObj.get("children");
for (int k = 0; k<sheBaoArr.size(); k++) {
sheBaoArrObj = (JSONObject) sheBaoArr.get(k);
if ("年度缴费工资申报".equals(sheBaoArrObj.get("label"))) {
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 +290,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 +323,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);
}
......
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentDetailService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentDetailSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化实缴明细表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tautopaymentdetail")
@Tag(name = "自动化实缴明细表")
public class TAutoPaymentDetailController {
private final TAutoPaymentDetailService tAutoPaymentDetailService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TAutoPaymentDetail>> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, TAutoPaymentDetailSearchVo tAutoPaymentDetail) {
return new R<>(tAutoPaymentDetailService.getTAutoPaymentDetailPage(page, tAutoPaymentDetail));
}
/**
* 不分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TAutoPaymentDetail>> getTAutoPaymentDetailNoPage(@RequestBody TAutoPaymentDetailSearchVo tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.noPageDiy(tAutoPaymentDetail));
}
/**
* 通过id查询自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tautopaymentdetail_get')")
@GetMapping("/{id}")
public R<TAutoPaymentDetail> getById(@PathVariable("id") String id) {
return R.ok(tAutoPaymentDetailService.getById(id));
}
/**
* 新增自动化实缴记录表
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return R
*/
@Operation(summary = "新增自动化实缴记录表", description = "新增自动化实缴记录表:hasPermission('social_tautopaymentdetail_add')")
@SysLog("新增自动化实缴记录表")
@PostMapping
public R<Boolean> save(@RequestBody TAutoPaymentDetail tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.save(tAutoPaymentDetail));
}
/**
* 修改自动化实缴记录表
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return R
*/
@Operation(summary = "修改自动化实缴记录表", description = "修改自动化实缴记录表:hasPermission('social_tautopaymentdetail_edit')")
@SysLog("修改自动化实缴记录表")
@PutMapping
public R<Boolean> updateById(@RequestBody TAutoPaymentDetail tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.updateById(tAutoPaymentDetail));
}
/**
* 通过id删除自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化实缴记录表", description = "通过id删除自动化实缴记录表:hasPermission('social_tautopaymentdetail_del')")
@SysLog("通过id删除自动化实缴记录表")
@DeleteMapping("/{id}")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAutoPaymentDetailService.removeById(id));
}
/**
* 自动化实缴记录表 批量导入
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@SneakyThrows
@Operation(description = "标记重新办理数据")
@SysLog("标记重新办理数据")
@PostMapping("/importListAdd")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String parentId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)) {
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.FUND_IMPORT_HANDLE_LOCK + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key, "10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA + CommonConstants.DOWN_LINE_STRING + e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
return tAutoPaymentDetailService.importDiy(file.getInputStream(),parentId);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
} finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* 自动化实缴记录表 批量导出
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@Operation(description = "导出自动化实缴记录表 hasPermission('social_tautopaymentdetail-export')")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody TAutoPaymentDetailSearchVo searchVo) {
tAutoPaymentDetailService.listExport(response, searchVo);
}
}
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentErrorSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tautopaymenterror")
@Tag(name = "社保士兵实缴核验错误反馈表管理")
public class TAutoPaymentErrorController {
private final TAutoPaymentErrorService tAutoPaymentErrorService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TAutoPaymentError>> getTAutoPaymentErrorPage(Page<TAutoPaymentError> page, TAutoPaymentErrorSearchVo tAutoPaymentError) {
return new R<>(tAutoPaymentErrorService.getTAutoPaymentErrorPage(page, tAutoPaymentError));
}
/**
* 不分页查询
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('social_tautopaymenterror_get')" )
public R<List<TAutoPaymentError>> getTAutoPaymentErrorNoPage(@RequestBody TAutoPaymentErrorSearchVo tAutoPaymentError) {
return R.ok(tAutoPaymentErrorService.noPageDiy(tAutoPaymentError));
}
/**
* 通过id查询社保士兵实缴核验错误反馈表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tautopaymenterror_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymenterror_get')")
public R<TAutoPaymentError> getById(@PathVariable("id") String id) {
return R.ok(tAutoPaymentErrorService.getById(id));
}
/**
* 新增社保士兵实缴核验错误反馈表
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return R
*/
@Operation(summary = "新增社保士兵实缴核验错误反馈表", description = "新增社保士兵实缴核验错误反馈表:hasPermission('social_tautopaymenterror_add')")
@SysLog("新增社保士兵实缴核验错误反馈表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymenterror_add')")
public R<Boolean> save(@RequestBody TAutoPaymentError tAutoPaymentError) {
return R.ok(tAutoPaymentErrorService.save(tAutoPaymentError));
}
/**
* 修改社保士兵实缴核验错误反馈表
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return R
*/
@Operation(summary = "修改社保士兵实缴核验错误反馈表", description = "修改社保士兵实缴核验错误反馈表:hasPermission('social_tautopaymenterror_edit')")
@SysLog("修改社保士兵实缴核验错误反馈表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymenterror_edit')")
public R<Boolean> updateById(@RequestBody TAutoPaymentError tAutoPaymentError) {
return R.ok(tAutoPaymentErrorService.updateById(tAutoPaymentError));
}
/**
* 通过id删除社保士兵实缴核验错误反馈表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保士兵实缴核验错误反馈表", description = "通过id删除社保士兵实缴核验错误反馈表:hasPermission('social_tautopaymenterror_del')")
@SysLog("通过id删除社保士兵实缴核验错误反馈表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymenterror_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAutoPaymentErrorService.removeById(id));
}
/**
* 社保士兵实缴核验错误反馈表 批量导出
*
* @author hgw
* @date 2024-06-06 20:55:31
**/
@Operation(description = "导出社保士兵实缴核验错误反馈表 hasPermission('social_tautopaymenterror-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tautopaymenterror-export')")
public void export(HttpServletResponse response, @RequestBody TAutoPaymentErrorSearchVo searchVo) {
if (Common.isNotNull(searchVo.getParentId())) {
tAutoPaymentErrorService.listExport(response, searchVo);
}
}
}
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.net.URL;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tautopaymentinfo")
@Tag(name = "自动化实缴记录表管理")
public class TAutoPaymentInfoController {
private final TAutoPaymentInfoService tAutoPaymentInfoService;
private final OSSUtil ossUtil;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TAutoPaymentInfo>> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return new R<>(tAutoPaymentInfoService.getTAutoPaymentInfoPage(page, tAutoPaymentInfo));
}
/**
* 获取附件下载地址
* @Author hgw
* @Date 2024-6-6 09:42:47
**/
@Schema(description = "附件预览下载地址")
@SysLog("附件预览下载地址")
@PostMapping("/getOssFileUrl")
public R<String> ossFileUrl(@RequestParam String attaSrc) {
URL url = ossUtil.getObjectUrl(null, attaSrc);
String urlStr = url.toString().replace("http","https");
return new R<>(urlStr);
}
/**
* 不分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TAutoPaymentInfo>> getTAutoPaymentInfoNoPage(@RequestBody TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.noPageDiy(tAutoPaymentInfo));
}
/**
* 通过id查询自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tautopaymentinfo_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_get')")
public R<TAutoPaymentInfo> getById(@PathVariable("id") String id) {
return R.ok(tAutoPaymentInfoService.getById(id));
}
/**
* 新增自动化实缴记录表
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return R
*/
@Operation(summary = "新增自动化实缴记录表", description = "新增自动化实缴记录表:hasPermission('social_tautopaymentinfo_add')")
@SysLog("新增自动化实缴记录表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_add')")
public R<Boolean> save(@RequestBody TAutoPaymentInfo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.save(tAutoPaymentInfo));
}
/**
* 修改自动化实缴记录表
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return R
*/
@Operation(summary = "修改自动化实缴记录表", description = "修改自动化实缴记录表:hasPermission('social_tautopaymentinfo_edit')")
@SysLog("修改自动化实缴记录表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_edit')")
public R<Boolean> updateById(@RequestBody TAutoPaymentInfo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.updateById(tAutoPaymentInfo));
}
/**
* 通过id删除自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化实缴记录表", description = "通过id删除自动化实缴记录表:hasPermission('social_tautopaymentinfo_del')")
@SysLog("通过id删除自动化实缴记录表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAutoPaymentInfoService.removeById(id));
}
/**
* 自动化实缴记录表 批量导入
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@SneakyThrows
@Operation(description = "批量新增自动化实缴记录表 hasPermission('social_tautopaymentinfo-batch-import')")
@SysLog("批量新增自动化实缴记录表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tAutoPaymentInfoService.importDiy(file.getInputStream());
}
/**
* 自动化实缴记录表 批量导出
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@Operation(description = "导出自动化实缴记录表 hasPermission('social_tautopaymentinfo-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo-export')")
public void export(HttpServletResponse response, @RequestBody TAutoPaymentInfoSearchVo searchVo) {
tAutoPaymentInfoService.listExport(response, searchVo);
}
}
......@@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
......@@ -79,7 +80,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 +94,118 @@ 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("4每日定时任务获取社保士兵审核结果查询")
@Inner
public R<String> doInnerGetSixJobByAudit() {
return tSocialSoldierService.getSixJobByAudit();
}
/**
* @Description: 5推送工资申报、调整(实缴使用)
* @Author: hgw
* @Date: 2024-5-30 17:32:43
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "5每月5号推送工资申报、调整(实缴使用)")
@PostMapping("/inner/doInnerPushSalaryByShenBao")
@SysLog("5每月5号推送工资申报、调整(实缴使用)")
@Inner
public R<String> doInnerPushSalaryByShenBao() {
return tSocialSoldierPushService.pushSalaryByShenBao();
}
/**
* @Description: 6每月6号推送实缴3张表查询
* @Author: hgw
* @Date: 2024-5-31 16:04:09
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "6每月6号1点推送实缴3张表查询")
@PostMapping("/inner/doPushPaymentThree")
@SysLog("6每月6号推送实缴3张表查询")
@Inner
public R<String> doPushPaymentThree() {
return tSocialSoldierPushService.pushPaymentThree(null,false);
}
/**
* @Description: 7每月6号定时任务获取社保士兵实缴3张表
* @Author: hgw
* @Date: 2024-5-30 18:00:00
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "7每月6号3点定时任务获取社保士兵实缴3张表")
@PostMapping("/inner/doInnerGetPaymentThree")
@SysLog("7每月6号定时任务获取社保士兵实缴3张表")
@Inner
public R<String> doInnerGetPaymentThree() {
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) {
tSocialSoldierService.getReHandle(parentId);
return R.ok("正在执行中,请耐心等待!");
}
/**
* @Description: 文件组装zip的Demo(测试附件使用,不删除)
* @Author: hgw
* @Date: 2024-6-11 14:27:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "文件组装zip的Demo")
@PostMapping("/getZip")
public R<String> getZip(@RequestBody MultipartFile zipFile) {
return tSocialSoldierService.getZip(zipFile);
}
}
/*
* 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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Mapper
public interface TAutoPaymentDetailMapper extends BaseMapper<TAutoPaymentDetail> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentDetail> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, @Param("tAutoPaymentDetail") TAutoPaymentDetail tAutoPaymentDetail);
/**
* @param parentId
* @Description: 删除明细表
* @Author: hgw
* @Date: 2024/6/6 9:55
* @return: void
**/
void deleteByParentId(@Param("parentId") String parentId, @Param("sourceType") int sourceType);
List<TAutoPaymentDetail> getListByParentId(@Param("parentId") String parentId);
}
/*
* 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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
@Mapper
public interface TAutoPaymentErrorMapper extends BaseMapper<TAutoPaymentError> {
/**
* 社保士兵实缴核验错误反馈表简单分页查询
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return
*/
IPage<TAutoPaymentError> getTAutoPaymentErrorPage(Page<TAutoPaymentError> page, @Param("tAutoPaymentError") TAutoPaymentError tAutoPaymentError);
void deleteByParentId(@Param("parentId") String parentId);
}
/*
* 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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Mapper
public interface TAutoPaymentInfoMapper extends BaseMapper<TAutoPaymentInfo> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, @Param("tAutoPaymentInfo") TAutoPaymentInfo tAutoPaymentInfo);
/**
* @Description: 获取当前月的主表
* @Author: hgw
* @Date: 2024/6/4 16:12
* @return: com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo
**/
TAutoPaymentInfo getThisMonthMainAuto();
void setUrlToNullByRePayment(@Param("parentId") String parentId);
}
......@@ -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,67 @@ 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();
/**
* @Description: 工资申报
* @Author: hgw
* @Date: 2024/5/29 18:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
List<SocialSoldierSalaryShenBaoVo> getSoldierSalaryByShenBaoList();
/**
* @Description: 工资调整
* @Author: hgw
* @Date: 2024/5/29 18:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
List<SocialSoldierSalaryTiaoZhengVo> getSoldierSalaryByTiaoZhengList();
/**
* @Description: 实缴3张表之日常申报
* @Author: hgw
* @Date: 2024/5/29 18:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
List<SocialSoldierPaymentSelectOneVo> getSoldierPaymentSelectOneList();
/**
* @Description: 实缴3张表之日常申报
* @Author: hgw
* @Date: 2024/5/29 18:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
List<SocialSoldierPaymentSelectTwoVo> getSoldierPaymentSelectTwoList();
/**
* @Description: 实缴3张表之日常申报
* @Author: hgw
* @Date: 2024/5/29 18:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
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);
}
/*
* 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.TSocialSoldierShenBaoTask;
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 TSocialSoldierShenBaoTaskMapper extends BaseMapper<TSocialSoldierShenBaoTask> {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialSoldierShenBaoTask 社保自动化审核提交后的审核结果查询记录表
* @return
*/
List<TSocialSoldierShenBaoTask> getTSocialSoldierShenBaoTaskList(@Param("tSocialSoldierShenBaoTask") TSocialSoldierShenBaoTask tSocialSoldierShenBaoTask);
List<TSocialSoldierShenBaoTask> getTSocialSoldierTaskListByRe();
TSocialSoldierShenBaoTask getSoldierTaskAddIdByType(@Param("type") String type);
void deleteByPayment();
void deleteByRePayment();
}
/*
* 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.TAutoPaymentDetail;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentDetailSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
public interface TAutoPaymentDetailService extends IService<TAutoPaymentDetail> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentDetail> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, TAutoPaymentDetailSearchVo tAutoPaymentDetail);
R<List<ErrorMessage>> importDiy(InputStream inputStream,String parentId);
void listExport(HttpServletResponse response, TAutoPaymentDetailSearchVo searchVo);
List<TAutoPaymentDetail> noPageDiy(TAutoPaymentDetailSearchVo searchVo);
/**
* @param: sourceType 资源类型:1日常申报导出;2人员缴费明细打印;3单位缴费明细查询;4单位缴费明细下载
* @Description: 清空明细表
* @Author: hgw
* @Date: 2024/6/6 9:54
* @return: void
**/
void deleteByParentId(String parentId, int sourceType);
/**
* @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);
}
/*
* 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentErrorSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
public interface TAutoPaymentErrorService extends IService<TAutoPaymentError> {
/**
* 社保士兵实缴核验错误反馈表简单分页查询
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return
*/
IPage<TAutoPaymentError> getTAutoPaymentErrorPage(Page<TAutoPaymentError> page, TAutoPaymentErrorSearchVo tAutoPaymentError);
void listExport(HttpServletResponse response, TAutoPaymentErrorSearchVo searchVo);
List<TAutoPaymentError> noPageDiy(TAutoPaymentErrorSearchVo searchVo);
void deleteByParentId(String parentId);
}
/*
* 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.TAutoPaymentInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
public interface TAutoPaymentInfoService extends IService<TAutoPaymentInfo> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TAutoPaymentInfoSearchVo searchVo);
List<TAutoPaymentInfo> noPageDiy(TAutoPaymentInfoSearchVo searchVo);
/**
* @Description: 获取当前月的主表
* @Author: hgw
* @Date: 2024/6/4 16:12
* @return: com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo
**/
TAutoPaymentInfo getThisMonthMainAuto();
/**
* @param parentId
* @Description: 复核发起时,清空url
* @Author: hgw
* @Date: 2024/6/7 17:30
* @return: void
**/
void setUrlToNullByRePayment(String parentId);
}
......@@ -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,28 @@ 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();
/**
* @Description: 推送工资申报、调整(实缴使用)
* @Author: hgw
* @Date: 2024-5-29 17:47:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> pushSalaryByShenBao();
/**
* @Description: 6每月6号推送实缴3张表查询
* @Author: hgw
* @Date: 2024-5-31 16:04:54
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> pushPaymentThree(String parentId, boolean isReHandle);
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 社保士兵
......@@ -39,4 +40,30 @@ 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();
/**
* @Description: 获取实缴3张表的数据
* @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> 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);
R<String> getZip(MultipartFile zipFile);
}
/*
* 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.TSocialSoldierShenBaoTask;
import java.util.List;
/**
* 社保自动化审核提交后的审核结果查询记录表
*
* @author hgw
* @date 2024-05-23 17:40:37
*/
public interface TSocialSoldierShenBaoTaskService extends IService<TSocialSoldierShenBaoTask> {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialSoldierShenBaoTask 社保自动化审核提交后的审核结果查询记录表
* @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
* @Description: 获取实缴3张表推送后的任务ID,以用来拉取数据
* @Author: hgw
* @Date: 2024/5/31 18:13
* @return: java.lang.String
**/
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();
}
/*
* 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.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentDetailMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentDetailService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentDetailSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Log4j2
@AllArgsConstructor
@Service
public class TAutoPaymentDetailServiceImpl extends ServiceImpl<TAutoPaymentDetailMapper, TAutoPaymentDetail> implements TAutoPaymentDetailService {
@Autowired
private RedisUtil redisUtil;
private final TAutoPaymentInfoMapper paymentInfoMapper;
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
@Override
public IPage<TAutoPaymentDetail> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, TAutoPaymentDetailSearchVo tAutoPaymentDetail) {
return baseMapper.getTAutoPaymentDetailPage(page, tAutoPaymentDetail);
}
/**
* 自动化实缴记录表批量导出
*
* @param searchVo 自动化实缴记录表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TAutoPaymentDetailSearchVo searchVo) {
String fileName = "自动化实缴记录表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TAutoPaymentDetail> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
YifuUser user = SecurityUtils.getUser();
String key = CacheConstants.PAYMENT_SOCIAL_EXPORT + CommonConstants.DOWN_LINE_STRING +user.getId() ;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
if (Common.isNotNull(redisUtil.get(key))) {
out.write(CommonConstants.SOCIAL_EXPORT_CONTINUE.getBytes("GBK"));
out.close();
return;
} else {
redisUtil.set(key, user.getId(), 600L);
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TAutoPaymentDetail.class).build();
WriteSheet writeSheet;
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TAutoPaymentDetail> util = new ExcelUtil<>(TAutoPaymentDetail.class);
for (TAutoPaymentDetail vo : list) {
util.convertEntity(vo, null, null, null);
}
writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
redisUtil.remove(key);
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
redisUtil.remove(key);
} catch (IOException e) {
redisUtil.remove(key);
log.error("执行异常", e);
}
}
}
@Override
public List<TAutoPaymentDetail> noPageDiy(TAutoPaymentDetailSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentDetail> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentDetail::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
@Override
public void deleteByParentId(String parentId, int sourceType) {
baseMapper.deleteByParentId(parentId, sourceType);
}
@Override
public List<TAutoPaymentDetail> getListByParentId(String parentId) {
return baseMapper.getListByParentId(parentId);
}
private Long noPageCountDiy(TAutoPaymentDetailSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentDetail> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentDetail::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TAutoPaymentDetailSearchVo entity) {
LambdaQueryWrapper<TAutoPaymentDetail> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TAutoPaymentDetail::getCreateTime, entity.getCreateTimes()[0])
.le(TAutoPaymentDetail::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TAutoPaymentDetail::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream,String parentId) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TAutoPaymentDetailVo> util1 = new ExcelUtil<>(TAutoPaymentDetailVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TAutoPaymentDetailVo.class, new ReadListener<TAutoPaymentDetailVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TAutoPaymentDetailVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TAutoPaymentDetailVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessage.setData(data);
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTAutoPaymentDetail(cachedDataList, errorMessageList,parentId);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTAutoPaymentDetail(List<TAutoPaymentDetailVo> excelVOList, List<ErrorMessage> errorMessageList,String parentId) {
// 执行数据插入操作 组装
TAutoPaymentDetailVo excel;
TAutoPaymentDetail detail;
TAutoPaymentInfo paymentInfo = paymentInfoMapper.selectById(parentId);
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
if (Common.isEmpty(paymentInfo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.PARAM_IS_NOT_ERROR,excel));
continue;
}
if (CommonConstants.ZERO_STRING.equals(paymentInfo.getRepeatReviewFlag())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "重新复核中,禁止更新!",excel));
continue;
}
// 数据合法情况
if (!CommonConstants.IS_TRUE.equals(excel.getRepeatHandleFlag())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "'是否重新办理'填写不正确!",excel));
continue;
}
detail = baseMapper.selectOne(Wrappers.<TAutoPaymentDetail>query().lambda()
.eq(TAutoPaymentDetail::getParentId,parentId)
.eq(TAutoPaymentDetail::getEmpName,excel.getEmpName())
.eq(TAutoPaymentDetail::getCertNum,excel.getCertNum())
.eq(TAutoPaymentDetail::getSocialSecurityAccount,excel.getSocialSecurityAccount())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(detail)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "对应姓名+证件号码+社保户的数据不存在!",excel));
continue;
}
detail.setRepeatHandleFlag("0");
// 插入
baseMapper.updateById(detail);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS,excel));
}
}
}
/*
* 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.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentErrorMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentErrorSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 社保士兵实缴核验错误反馈表
*
* @author hgw
* @date 2024-06-06 20:55:31
*/
@Log4j2
@Service
public class TAutoPaymentErrorServiceImpl extends ServiceImpl<TAutoPaymentErrorMapper, TAutoPaymentError> implements TAutoPaymentErrorService {
/**
* 社保士兵实缴核验错误反馈表简单分页查询
*
* @param tAutoPaymentError 社保士兵实缴核验错误反馈表
* @return
*/
@Override
public IPage<TAutoPaymentError> getTAutoPaymentErrorPage(Page<TAutoPaymentError> page, TAutoPaymentErrorSearchVo tAutoPaymentError) {
return baseMapper.getTAutoPaymentErrorPage(page, tAutoPaymentError);
}
/**
* 社保士兵实缴核验错误反馈表批量导出
*
* @param searchVo 社保士兵实缴核验错误反馈表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TAutoPaymentErrorSearchVo searchVo) {
String fileName = "社保士兵实缴核验错误反馈表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TAutoPaymentError> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, TAutoPaymentError.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TAutoPaymentError> util = new ExcelUtil<>(TAutoPaymentError.class);
for (TAutoPaymentError vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("社保士兵实缴核验错误反馈表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i += CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("社保士兵实缴核验错误反馈表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public void deleteByParentId(String parentId) {
baseMapper.deleteByParentId(parentId);
}
@Override
public List<TAutoPaymentError> noPageDiy(TAutoPaymentErrorSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentError> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentError::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(TAutoPaymentError::getCertNum);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TAutoPaymentErrorSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentError> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentError::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TAutoPaymentErrorSearchVo entity) {
LambdaQueryWrapper<TAutoPaymentError> wrapper = Wrappers.lambdaQuery();
return wrapper;
}
}
/*
* 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.TAutoPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentInfoService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Log4j2
@Service
public class TAutoPaymentInfoServiceImpl extends ServiceImpl<TAutoPaymentInfoMapper, TAutoPaymentInfo> implements TAutoPaymentInfoService {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Override
public IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return baseMapper.getTAutoPaymentInfoPage(page, tAutoPaymentInfo);
}
/**
* 自动化实缴记录表批量导出
*
* @param searchVo 自动化实缴记录表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TAutoPaymentInfoSearchVo searchVo) {
String fileName = "自动化实缴记录表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TAutoPaymentInfo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TAutoPaymentInfo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TAutoPaymentInfo> util = new ExcelUtil<>(TAutoPaymentInfo.class);
for (TAutoPaymentInfo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<TAutoPaymentInfo> noPageDiy(TAutoPaymentInfoSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentInfo::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
/**
* @Description: 获取当前月的主表
* @Author: hgw
* @Date: 2024/6/4 16:12
* @return: com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo
**/
@Override
public TAutoPaymentInfo getThisMonthMainAuto() {
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());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentInfo::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TAutoPaymentInfoSearchVo entity) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TAutoPaymentInfo::getCreateTime, entity.getCreateTimes()[0])
.le(TAutoPaymentInfo::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TAutoPaymentInfo::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TAutoPaymentInfoVo> util1 = new ExcelUtil<>(TAutoPaymentInfoVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TAutoPaymentInfoVo.class, new ReadListener<TAutoPaymentInfoVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TAutoPaymentInfoVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TAutoPaymentInfoVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTAutoPaymentInfo(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTAutoPaymentInfo(List<TAutoPaymentInfoVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TAutoPaymentInfoVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TAutoPaymentInfoVo excel) {
TAutoPaymentInfo insert = new TAutoPaymentInfo();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
......@@ -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
......
......@@ -26,11 +26,10 @@ 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.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.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.service.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.IOUtils;
......@@ -43,10 +42,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 社保士兵-推送
......@@ -62,6 +58,9 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
private RestTemplate restTemplate = new RestTemplate();
private final SocialConfig socialConfig;
private final TSocialInfoService tSocialInfoService;
private final TSocialSoldierShenBaoTaskService tSocialSoldierShenBaoTaskService;
private final TAutoPaymentInfoService tAutoPaymentInfoService;
private final TAutoPaymentErrorService tAutoPaymentErrorService;
/**
* @param socialList
......@@ -99,6 +98,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;
......@@ -109,7 +114,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
if (type == 2) {
List<SocialSoldierSetVo> setList = new ArrayList<>();
SocialSoldierSetVo vo = new SocialSoldierSetVo();
vo.setIsAutoSubmit("");
vo.setIsAutoSubmit("");
vo.setIsAutoInsert("否");
vo.setIsAutoUpload("否");
vo.setIsDoShenBao("否");
......@@ -223,4 +228,297 @@ 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> getOneAppGetModuleDetailByShenBao(TSocialSoldierShenBaoTask task, 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);
task.setAddId(addId);
tSocialSoldierShenBaoTaskService.save(task);
}
}
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 getFile(List list, Class clazz, String sheetName) {
String fileName = "soldierFile" + DateUtil.getThisTime() + new Date().getTime() + CommonConstants.XLSX;
if (list != null) {
EasyExcelFactory.write(fileName, clazz).sheet(sheetName).doWrite(list);
File file = new File(fileName);
return getMultipartFile(file);
}
return null;
}
/**
* @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);
}
/**
* @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> pushSalaryByShenBao() {
// 工资申报
List<SocialSoldierSalaryShenBaoVo> shenBaolist = baseMapper.getSoldierSalaryByShenBaoList();
log.info("工资申报列表="+shenBaolist);
String sheetName = "年度缴费工资申报";
if (shenBaolist != null && !shenBaolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaolist, SocialSoldierSalaryShenBaoVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
task.setType(CommonConstants.ONE_STRING);
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
// 工资调整
List<SocialSoldierSalaryTiaoZhengVo> tiaoZhenglist = baseMapper.getSoldierSalaryByTiaoZhengList();
log.info("工资调整列表="+tiaoZhenglist);
sheetName = "年度缴费工资调整";
if (tiaoZhenglist != null && !tiaoZhenglist.isEmpty()) {
MultipartFile file = this.getFile(tiaoZhenglist, SocialSoldierSalaryTiaoZhengVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
task.setType(CommonConstants.TWO_STRING);
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
if (shenBaolist == null && tiaoZhenglist == null) {
return R.failed("无数据,推送结束!");
}
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(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);
String sheetName = "日常申报导出";
if (shenBaolist != null && !shenBaolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaolist, SocialSoldierPaymentSelectOneVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
// 实缴3张表之2:人员缴费明细打印
List<SocialSoldierPaymentSelectTwoVo> shenBaoTwolist = baseMapper.getSoldierPaymentSelectTwoList();
log.info("实缴3张表之2:单位个人缴费信息查询list="+shenBaoTwolist);
sheetName = "单位个人缴费信息查询";
if (shenBaoTwolist != null && !shenBaoTwolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoTwolist, SocialSoldierPaymentSelectTwoVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
// 实缴3张表之3:单位缴费明细查询
List<SocialSoldierPaymentSelectThreeVo> shenBaoThreelist = baseMapper.getSoldierPaymentSelectThreeList();
log.info("实缴3张表之3:单位缴费明细查询list="+shenBaoThreelist);
sheetName = "单位缴费明细查询";
if (shenBaoThreelist != null && !shenBaoThreelist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoThreelist, SocialSoldierPaymentSelectThreeVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
// 实缴3张表之3-2:单位缴费明细下载
List<SocialSoldierPaymentSelectThreeVo> shenBaoFourlist = baseMapper.getSoldierPaymentSelectThreeList();
log.info("实缴3张表之3-2:单位缴费明细下载list="+shenBaoFourlist);
sheetName = "单位缴费明细下载";
if (shenBaoFourlist != null && !shenBaoFourlist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoFourlist, SocialSoldierPaymentSelectThreeVo.class, sheetName);
if (Common.isNotNull(file)) {
TSocialSoldierShenBaoTask task = new TSocialSoldierShenBaoTask();
// 1申报;2调整;3:实缴1日常申报导出;4:实缴2人员缴费明细打印;5:实缴3单位缴费明细查询;6:实缴3单位缴费明细下载
task.setType(String.valueOf(type));
type++;
task.setDataStatus(CommonConstants.ZERO_STRING);
this.getOneAppGetModuleDetailByShenBao(task, file, sheetName);
}
}
if (shenBaolist == null && shenBaoTwolist == null && shenBaoThreelist == null && shenBaoFourlist == null) {
return R.failed("无数据,推送结束!");
}
return R.ok("推送成功!!");
}
}
......@@ -16,40 +16,49 @@
*/
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;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.config.SocialConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.FailReasonConfig;
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.entity.*;
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;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
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.ss.usermodel.*;
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.scheduling.annotation.Async;
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 org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
/**
* 社保士兵
......@@ -68,7 +77,1323 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
private final TSocialInfoService tSocialInfoService;
private final FailReasonConfigService failReasonConfigService;
private final TAuditInfoService tAuditInfoService;
private final TSocialSoldierShenBaoTaskService tSocialSoldierShenBaoTaskService;
private final TAutoPaymentInfoService tAutoPaymentInfoService;
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
@Async
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);
}
}
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);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailROne = this.readZipByPayment(reFlag, oneMap, inRiChang, 1, mainAuto);
if (detailROne != null && CommonConstants.SUCCESS.equals(detailROne.getCode())) {
if (detailROne.getData() != null && !detailROne.getData().isEmpty()) {
detailListOne = detailROne.getData();
if (detailListOne != null && !detailListOne.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListOne);
}
}
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_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);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRTwo = this.readZipByPayment(reFlag, twoMap, inRenYuan, 2, mainAuto);
if (detailRTwo != null && CommonConstants.SUCCESS.equals(detailRTwo.getCode())) {
if (detailRTwo.getData() != null && !detailRTwo.getData().isEmpty()) {
detailListTwo = detailRTwo.getData();
if (detailListTwo != null && !detailListTwo.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListTwo);
}
}
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_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);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRThree = this.readZipByPayment(reFlag, threeMap, inDanWei, 3, mainAuto);
if (detailRThree != null && CommonConstants.SUCCESS.equals(detailRThree.getCode())) {
if (detailRThree.getData() != null && !detailRThree.getData().isEmpty()) {
detailListThree = detailRThree.getData();
if (detailListThree != null && !detailListThree.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListThree);
}
}
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_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);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRFour = this.readZipByPayment(reFlag, fourMap, inDanWeiXiaZai, 4, mainAuto);
if (detailRFour != null && CommonConstants.SUCCESS.equals(detailRFour.getCode())) {
if (detailRFour.getData() != null && !detailRFour.getData().isEmpty()) {
detailListFour = detailRFour.getData();
if (detailListFour != null && !detailListFour.isEmpty()) {
tAutoPaymentDetailService.updateBatchById(detailListFour);
}
}
mainAuto.setRepeatReviewFlag(CommonConstants.TWO_STRING);
addIdSixTask.setDataStatus(CommonConstants.ONE_STRING);
tSocialSoldierShenBaoTaskService.updateById(addIdSixTask);
}
}
}
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();
}
} catch (Exception e) {
e.printStackTrace();
}
}
} else {
return R.failed("未找到推送任务,请先推送!");
}
return R.ok();
}
/**
* @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> doInnerGetPaymentThree() {
// 3:实缴1日常申报导出;4:实缴2单位个人缴费信息查询;5:实缴3单位缴费明细查询
int type = 3;
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)) {
boolean reFlag = false;
try {
// 1查询主表
TAutoPaymentInfo mainAuto = tAutoPaymentInfoService.getThisMonthMainAuto();
if (mainAuto == null || Common.isEmpty(mainAuto.getId())) {
mainAuto = new TAutoPaymentInfo();
mainAuto.setCreateBy(CommonConstants.ONE_STRING);
mainAuto.setCreateName("定时任务生成");
mainAuto.setCreateTime(LocalDateTime.now());
mainAuto.setSystemReviewFlag(CommonConstants.ZERO_STRING);
mainAuto.setRepeatReviewFlag(CommonConstants.ZERO_STRING);
mainAuto.setCreateMonth(DateUtil.getThisMonth());
mainAuto.setDataOneFlag(CommonConstants.ZERO_STRING);
mainAuto.setDataTwoFlag(CommonConstants.ZERO_STRING);
mainAuto.setDataThreeFlag(CommonConstants.ZERO_STRING);
tAutoPaymentInfoService.save(mainAuto);
}
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);
mainAuto.setDataOneFlag(CommonConstants.ONE_STRING);
// 清空明细表
tAutoPaymentDetailService.deleteByParentId(mainAuto.getId(), 1);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailROne = this.readZipByPayment(reFlag, null, inRiChang, 1, mainAuto);
if (detailROne != null && CommonConstants.SUCCESS.equals(detailROne.getCode())) {
if (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.TWO_STRING);
} else {
mainAuto.setDataOneFlag(CommonConstants.THREE_STRING);
}
}
}
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);
mainAuto.setDataTwoFlag(CommonConstants.ONE_STRING);
// 清空明细表
tAutoPaymentDetailService.deleteByParentId(mainAuto.getId(), 2);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRTwo = this.readZipByPayment(reFlag, null, inRenYuan, 2, mainAuto);
if (detailRTwo != null && CommonConstants.SUCCESS.equals(detailRTwo.getCode())) {
if (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.TWO_STRING);
} else {
mainAuto.setDataTwoFlag(CommonConstants.THREE_STRING);
}
}
}
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);
mainAuto.setDataThreeFlag(CommonConstants.ONE_STRING);
// 清空明细表
tAutoPaymentDetailService.deleteByParentId(mainAuto.getId(), 3);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRThree = this.readZipByPayment(reFlag, null, inDanWei, 3, mainAuto);
if (detailRThree != null && CommonConstants.SUCCESS.equals(detailRThree.getCode())) {
if (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.TWO_STRING);
} else {
mainAuto.setDataThreeFlag(CommonConstants.THREE_STRING);
}
}
}
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);
mainAuto.setDataThreeFlag(CommonConstants.ONE_STRING);
// 清空明细表
tAutoPaymentDetailService.deleteByParentId(mainAuto.getId(), 4);
// 实际读取文件内容
R<List<TAutoPaymentDetail>> detailRFour = this.readZipByPayment(reFlag, null, inDanWeiXiaZai, 4, mainAuto);
if (detailRFour != null && CommonConstants.SUCCESS.equals(detailRFour.getCode())) {
if (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.TWO_STRING);
} else {
mainAuto.setDataThreeFlag(CommonConstants.THREE_STRING);
}
}
}
tAutoPaymentInfoService.updateById(mainAuto);
// 核验
if (detailListOne != null && !detailListOne.isEmpty()
|| detailListTwo != null && !detailListTwo.isEmpty()
|| detailListThree != null && !detailListThree.isEmpty()
|| detailListFour != null && !detailListFour.isEmpty()
) {
// 核验1:
baseMapper.getSoldierPaymentErrorInfoOne(mainAuto.getId());
// 核验2:
baseMapper.getSoldierPaymentErrorInfoTwo(mainAuto.getId());
mainAuto.setSystemReviewFlag(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();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return R.ok();
}
@Override
public R<String> getZip(MultipartFile zipFile) {
// 3:实缴1日常申报导出;4:实缴2单位个人缴费信息查询;5:实缴3单位缴费明细查询
TSocialSoldierShenBaoTask addIdOneTask = tSocialSoldierShenBaoTaskService.getSoldierTaskAddIdByType(CommonConstants.THREE_STRING);
String addIdOne = null;
if (addIdOneTask != null && Common.isNotNull(addIdOneTask.getId())) {
addIdOne = addIdOneTask.getAddId();
}
HttpURLConnection conn;
InputStream inRiChang = null;
// 1日常申报导出;2单位个人缴费信息查询;3单位缴费明细查询
R<String> resultFile = socialConfig.getFiveJob(restTemplate, addIdOne, RESULT_ANNEX);
if (Common.isNotNull(resultFile)) {
try {
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日常申报流
this.readZipByPayment(inRiChang, zipFile);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
return R.ok();
}
/**
* @Description: 实验接口使用的,不删除
* @Author: hgw
* @Date: 2024/6/13 17:45
* @return: void
**/
public void readZipByPayment(InputStream inputStream, MultipartFile zipFileOld) {
ZipFile zipFile = null;
Workbook workbook = null;
InputStream is = null;
try {
String pathName = System.getProperty("java.io.tmpdir");
String dec = System.getProperty("java.io.tmpdir");
String pname = System.currentTimeMillis() + "_实缴4张表";
pathName = pathName + pname;
File file = new File(pathName);
FileUtils.copyInputStreamToFile(inputStream, file);
/*String fileName = System.currentTimeMillis() + "_" + file.getName();
boolean flag = ossUtil.uploadFileByFile(file, fileName, null);*/
zipFile = new ZipFile(file, CharsetUtil.CHARSET_GBK);
Enumeration<?> entries = zipFile.entries();
ZipEntry entry;
String empInfo;
while (entries.hasMoreElements()) {
entry = (ZipEntry) entries.nextElement();
// 如果是文件夹,就创建个文件夹
if (!entry.isDirectory()) {
//添加进filesName
empInfo = entry.getName();
System.out.println(empInfo);
// 将压缩文件内容写入到这个文件中
is = zipFile.getInputStream(entry);
workbook = WorkbookFactory.create(is);
Sheet sheet = workbook.getSheetAt(0);
Row row;
String cellValue;
int nameNum = 0;
// 循环每个sheet
if (sheet != null && Common.isNotNull(sheet.getSheetName())) {
for (int rowNum = 0; rowNum <= sheet.getLastRowNum(); rowNum++) {
row = sheet.getRow(rowNum);
// 循环当前行的内容
if (rowNum == 0) {
for (int cellNum = 0; cellNum < row.getLastCellNum(); cellNum++) {
cellValue = this.getCellValue(row, cellNum);
if ("姓名".equals(cellValue)) {
nameNum = cellNum;
}
}
} else if (rowNum < 10) {
cellValue = this.getCellValue(row, nameNum);
System.out.println(cellValue);
}
}
}
// 关流顺序,先打开的后关闭
is.close();
}
}
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder(dec);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (workbook != null) {
workbook.close();
}
if (is != null) {
is.close();
}
if (zipFile != null) {
zipFile.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
/**
* 根据路径删除指定的目录或文件,无论存在与否
*
* @param path 要删除的目录或文件路径
* @return 删除成功返回 true,否则返回 false
*/
public static void deleteFolder(String path) {
File file = new File(path);
// 判断目录或文件是否存在
if (file.exists()) {
// 判断是否为文件
if (file.isFile()) { // 为文件时调用删除文件方法
deleteFile(path);
} else { // 为目录时调用删除目录方法
deleteDirectory(path);
}
}
}
/**
* 删除单个文件
*/
private static boolean deleteFile(String path) {
File file = new File(path);
// 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) {
file.delete();
return true;
}
return false;
}
/**
* 删除目录(文件夹)以及目录下的文件
*/
private static boolean deleteDirectory(String path) {
//如果path不以文件分隔符结尾,自动添加文件分隔符
if (!path.endsWith(File.separator)) {
path = path + File.separator;
}
File dirFile = new File(path);
//如果dir对应的文件不存在,或者不是一个目录,则退出
if (!dirFile.exists() || !dirFile.isDirectory()) {
return false;
}
boolean flag = true;
//删除文件夹下的所有文件(包括子目录)
File[] files = dirFile.listFiles();
for (File file : files) {
//删除子文件
if (file.isFile()) {
flag = deleteFile(file.getAbsolutePath());
} //删除子目录
else {
flag = deleteDirectory(file.getAbsolutePath());
}
if (!flag) {
break;
}
}
if (!flag) {
return false;
}
//删除当前目录
return dirFile.delete();
}
/**
* @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(boolean reFlag, Map<String, TAutoPaymentDetail> oldMap
, InputStream inputStream, int type, TAutoPaymentInfo mainAuto) {
TAutoPaymentDetail oldDetail;
TAutoPaymentDetail detail;
TAutoPaymentDetail detailPerson;
List<TAutoPaymentDetail> voList = new ArrayList<>();
ZipFile zipFile = null;
Workbook workbook = null;
InputStream is = null;
Sheet sheet = null;
Row row;
// 塞生成月份所用
String nowMonth = DateUtil.getThisMonth();
// 资源类型:1日常申报导出;2单位个人缴费信息查询;3单位缴费明细查询
String sourceType = String.valueOf(type);
String dec = System.getProperty("java.io.tmpdir");
try {
String pathName = dec;
String pname = System.currentTimeMillis() + "_实缴4张表";
pathName = pathName + pname;
File file = new File(pathName);
FileUtils.copyInputStreamToFile(inputStream, file);
/*String fileName =
System.currentTimeMillis() + "_" + file.getName()
boolean flag = ossUtil.uploadFileByFile(file, fileName, null)*/
zipFile = new ZipFile(file, CharsetUtil.CHARSET_GBK);
Enumeration<?> entries = zipFile.entries();
ZipEntry entry;
String name;
while (entries.hasMoreElements()) {
entry = (ZipEntry) entries.nextElement();
// 如果是文件夹,就创建个文件夹
if (!entry.isDirectory()) {
name = entry.getName();
if (Common.isNotNull(name) && (name.endsWith(".xls") || name.endsWith(".xlsx")) && (name.contains("全部") || name.contains("汇总"))) {
is = zipFile.getInputStream(entry);
workbook = WorkbookFactory.create(is);
sheet = workbook.getSheetAt(0);
// 每个单元格内容
String cellValue;
// 错误信息 所在列
Integer errorInfoNum = null;
// 1、2姓名3人员姓名 所在列
Integer empNameNum = null;
// 1证件号码2社会保障号码 所在列
Integer certNumNum = null;
// 1缴费基数2个人缴费基数 所在列
Integer paymentBaseNum = null;
// 应缴费额 所在列
Integer payLimitNum = null;
// 单位缴费额 所在列
Integer unitLimitNum = null;
// 单位利息 所在列
Integer unitLiXiNum = null;
// 单位滞纳金 所在列
Integer unitZhiNaJinNum = null;
// 个人缴费额 所在列
Integer personLimitNum = null;
// 单位利息 所在列
Integer personLiXiNum = null;
// 单位滞纳金 所在列
Integer personZhiNaJinNum = null;
// 1险种2参保险种3险种类型 所在列
Integer insuranceTypeNum = null;
// 单位名称(社保户) 所在列
Integer socialSecurityAccountNum = null;
// 1费款所属期2缴费年月3起始费款所属期(社保缴纳月份) 所在列
Integer payMonthNum = null;
// 2生成月份3对应费款所属期
Integer createMonthNum = null;
// 3缴费总金额
Integer allMoneyNum = null;
// 3参保身份
Integer shenFenNum = null;
// 错误信息
String errorInfo;
// 姓名
String empName;
// 证件号码
String certNum;
// 缴费基数
String paymentBase;
// 应缴费额
String payLimit;
// 单位缴费额
String unitLimit;
// 单位利息
String unitLiXi;
// 单位滞纳金
String unitZhiNaJin;
// 个人缴费额
String personLimit;
// 单位利息
String personLiXi;
// 单位滞纳金
String personZhiNaJin;
// 1险种2参保险种
String insuranceType;
// 单位名称(社保户)
String socialSecurityAccount;
// 费款所属期(社保缴纳月份)
String payMonth;
// 2业务年月(社保生成月份)
String createMonth;
// 3缴费总金额
String allMoney;
// 3参保身份
String shenFen;
// 金额累计使用
BigDecimal money;
// 循环每个sheet
if (sheet != null && Common.isNotNull(sheet.getSheetName())) {
for (int rowNum = 0; rowNum <= sheet.getLastRowNum(); rowNum++) {
row = sheet.getRow(rowNum);
if (row != null) {
// 初始化
empName = null;
certNum = null;
paymentBase = null;
payLimit = null;
insuranceType = null;
socialSecurityAccount = null;
payMonth = null;
createMonth = null;
unitLimit = null;
unitLiXi = null;
unitZhiNaJin = null;
personLimit = null;
personLiXi = null;
personZhiNaJin = null;
allMoney = null;
shenFen = null;
money = null;
// 循环当前行的内容
if (rowNum == 0) {
for (int cellNum = 0; cellNum < row.getLastCellNum(); cellNum++) {
cellValue = this.getCellValue(row, cellNum);
if ("错误信息".equals(cellValue)) {
errorInfoNum = cellNum;
} else if ("姓名".equals(cellValue) || "人员姓名".equals(cellValue)) {
empNameNum = cellNum;
} else if ("证件号码".equals(cellValue) || "社会保障号码".equals(cellValue)) {
certNumNum = cellNum;
} else if ("缴费基数".equals(cellValue) || "个人缴费基数".equals(cellValue)) {
paymentBaseNum = cellNum;
} else if ("应缴费额".equals(cellValue)) {
payLimitNum = cellNum;
} else if ("缴费总金额".equals(cellValue)) {
allMoneyNum = cellNum;
} else if ("参保身份".equals(cellValue)) {
shenFenNum = cellNum;
}
// 2单位个人缴费信息查询 独有
else if ("单位缴费额".equals(cellValue) || "单位实缴金额".equals(cellValue)) {
unitLimitNum = cellNum;
} else if ("单位利息".equals(cellValue)) {
unitLiXiNum = cellNum;
} else if ("单位滞纳金".equals(cellValue)) {
unitZhiNaJinNum = cellNum;
} else if ("个人缴费额".equals(cellValue) || "个人实缴金额".equals(cellValue)) {
personLimitNum = cellNum;
} else if ("个人利息".equals(cellValue)) {
personLiXiNum = cellNum;
} else if ("个人滞纳金".equals(cellValue)) {
personZhiNaJinNum = cellNum;
} else if ("险种".equals(cellValue) || "参保险种".equals(cellValue) || "险种类型".equals(cellValue)) {
insuranceTypeNum = cellNum;
} else if ("单位名称".equals(cellValue)) {
socialSecurityAccountNum = cellNum;
} else if ("费款所属期".equals(cellValue) || "缴费年月".equals(cellValue) || "起始费款所属期".equals(cellValue)) {
payMonthNum = cellNum;
} else if ("业务年月".equals(cellValue) || "对应费款所属期".equals(cellValue)) {
createMonthNum = cellNum;
}
}
} else {
if (Common.isEmpty(errorInfoNum) && Common.isEmpty(certNumNum)) {
return R.failed("未找到对应表头!");
} else {
if (Common.isNotNull(errorInfoNum)) {
errorInfo = getCellValue(row, errorInfoNum);
return R.failed("数据错误:" + errorInfo);
} else {
// 参保身份类别为退休和缴费总金额为0,2者有其一则不合并
if (Common.isNotNull(allMoneyNum)) {
allMoney = getCellValue(row, allMoneyNum);
if (Common.isNotNull(allMoney) && BigDecimal.ZERO.equals(this.getBigDecimal(allMoney))) {
continue;
}
}
if (Common.isNotNull(shenFenNum)) {
shenFen = getCellValue(row, shenFenNum);
if (Common.isNotNull(shenFen) && "退休".equals(shenFen.trim())) {
continue;
}
}
if (Common.isNotNull(empNameNum)) {
empName = getCellValue(row, empNameNum);
}
if (Common.isNotNull(certNumNum)) {
certNum = getCellValue(row, certNumNum);
if (Common.isEmpty(certNum) || certNum.contains("合计")) {
break;
}
} else {
break;
}
if (Common.isNotNull(paymentBaseNum)) {
paymentBase = getCellValue(row, paymentBaseNum);
}
if (Common.isNotNull(payLimitNum)) {
payLimit = getCellValue(row, payLimitNum);
}
if (Common.isNotNull(unitLimitNum)) {
unitLimit = getCellValue(row, unitLimitNum);
}
if (Common.isNotNull(unitLiXiNum)) {
unitLiXi = getCellValue(row, unitLiXiNum);
}
if (Common.isNotNull(unitZhiNaJinNum)) {
unitZhiNaJin = getCellValue(row, unitZhiNaJinNum);
}
if (Common.isNotNull(personLimitNum)) {
personLimit = getCellValue(row, personLimitNum);
}
if (Common.isNotNull(personLiXiNum)) {
personLiXi = getCellValue(row, personLiXiNum);
}
if (Common.isNotNull(personZhiNaJinNum)) {
personZhiNaJin = getCellValue(row, personZhiNaJinNum);
}
if (Common.isNotNull(insuranceTypeNum)) {
insuranceType = getCellValue(row, insuranceTypeNum);
}
if (Common.isNotNull(socialSecurityAccountNum)) {
socialSecurityAccount = getCellValue(row, socialSecurityAccountNum);
}
if (Common.isNotNull(payMonthNum)) {
payMonth = getCellValue(row, payMonthNum);
if (Common.isNotNull(payMonth)) {
payMonth = payMonth.replace("-", "");
}
}
if (Common.isNotNull(createMonthNum)) {
createMonth = getCellValue(row, createMonthNum);
}
detail = new TAutoPaymentDetail();
detail.setParentId(mainAuto.getId());
detail.setSourceType(sourceType);
detail.setEmpName(empName);
detail.setCertNum(certNum);
if (Common.isNotNull(paymentBase)) {
detail.setPaymentBase(this.getBigDecimal(paymentBase));
}
if (Common.isNotNull(payLimit)) {
detail.setPayLimit(this.getBigDecimal(payLimit));
}
if (Common.isNotNull(unitLimit)) {
money = this.getBigDecimal(unitLimit);
if (Common.isNotNull(unitLiXi)) {
money = BigDecimalUtils.safeAdd(money, this.getBigDecimal(unitLiXi));
}
if (Common.isNotNull(unitZhiNaJin)) {
money = BigDecimalUtils.safeAdd(money, this.getBigDecimal(unitZhiNaJin));
}
detail.setPayLimit(money);
}
detail.setInsuranceType(insuranceType);
if (Common.isNotNull(unitLimit)) {
detail.setInsuranceType("单位" + insuranceType);
}
detail.setSocialSecurityAccount(socialSecurityAccount);
detail.setPayMonth(payMonth);
if (Common.isNotNull(createMonth)) {
detail.setCreateMonth(createMonth);
} else {
detail.setCreateMonth(nowMonth);
}
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 = this.getBigDecimal(personLimit);
if (Common.isNotNull(personLiXi)) {
money = BigDecimalUtils.safeAdd(money, this.getBigDecimal(personLiXi));
}
if (Common.isNotNull(personZhiNaJin)) {
money = BigDecimalUtils.safeAdd(money, this.getBigDecimal(personZhiNaJin));
}
detailPerson = new TAutoPaymentDetail();
detailPerson.setParentId(mainAuto.getId());
detailPerson.setSourceType(sourceType);
detailPerson.setPayLimit(money);
detailPerson.setEmpName(empName);
detailPerson.setCertNum(certNum);
if (Common.isNotNull(paymentBase)) {
detailPerson.setPaymentBase(this.getBigDecimal(paymentBase));
}
detailPerson.setInsuranceType("个人" + insuranceType);
detailPerson.setSocialSecurityAccount(socialSecurityAccount);
detailPerson.setPayMonth(payMonth);
if (Common.isNotNull(createMonth)) {
detailPerson.setCreateMonth(createMonth);
} else {
detailPerson.setCreateMonth(nowMonth);
}
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);
}
}
}
}
}
}
}
}
}
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder(dec);
if (workbook != null) {
workbook.close();
}
if (is != null) {
is.close();
}
if (zipFile != null) {
zipFile.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
return R.ok(voList);
}
private BigDecimal getBigDecimal(String paymentBase) {
if (paymentBase.contains(",")) {
paymentBase = paymentBase.replace(",", "");
}
try {
return new BigDecimal(paymentBase);
} catch (Exception e) {
log.error("社保士兵的文件里有错误的数字,需要调整代码:" + paymentBase);
return new BigDecimal("-1");
}
}
/**
* @Description: 解码URL
* @Author: hgw
* @Date: 2024/6/3 11:01
* @return: java.lang.String
**/
private String getEncodeUrl(String 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;
return dowloadUrl;
}
/**
* @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, RESULT_ANNEX);
log.info("resultFileByAudit=" + resultFile);
try {
// 解决中文文件名的乱码问题
String fileTeturnUrl = resultFile.getData();
if (Common.isNotNull(fileTeturnUrl)) {
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
URL url = new URL(fileTeturnUrl);
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;
ZipEntry ze;
//循环读取压缩包里面的文件
while ((ze = zin.getNextEntry()) != null) {
String name = ze.getName();
if ((ze.toString().endsWith(".xls") || ze.toString().endsWith(".xlsx")) && 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++) {
// 标题行
cellValue = this.getCellValue(row, cellNum);
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
......@@ -112,22 +1437,14 @@ 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 {
// 解决中文文件名的乱码问题
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);
fileTeturnUrl = this.getEncodeUrl(fileTeturnUrl);
URL url = new URL(fileTeturnUrl);
conn = (HttpURLConnection) url.openConnection();
//设置超时间为30秒
conn.setConnectTimeout(30 * 1000);
......@@ -322,6 +1639,251 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
return cellValue;
}
private String getCellValue(Row row, int cellNum) {
Cell 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;
}
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;
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);
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;
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);
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 +1914,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 +1969,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 +1996,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 +2005,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 +2071,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 +2101,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 +2111,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 +2219,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
/**
* 加办理记录
*
* @param handleRemark
* @Author hgw
* @Date 2024-5-16 11:43:33
......
/*
* 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.TSocialSoldierShenBaoTask;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierShenBaoTaskMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierShenBaoTaskService;
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 TSocialSoldierShenBaoTaskServiceImpl extends ServiceImpl<TSocialSoldierShenBaoTaskMapper, TSocialSoldierShenBaoTask> implements TSocialSoldierShenBaoTaskService {
/**
* 社保自动化审核提交后的审核结果查询记录表简单分页查询
*
* @param tSocialSoldierShenBaoTask 社保自动化审核提交后的审核结果查询记录表
* @return
*/
@Override
public List<TSocialSoldierShenBaoTask> getTSocialSoldierShenBaoTaskList(TSocialSoldierShenBaoTask tSocialSoldierShenBaoTask) {
return baseMapper.getTSocialSoldierShenBaoTaskList(tSocialSoldierShenBaoTask);
}
@Override
public List<TSocialSoldierShenBaoTask> getTSocialSoldierTaskListByRe() {
return baseMapper.getTSocialSoldierTaskListByRe();
}
/**
* 获取任务id
* @return
*/
@Override
public TSocialSoldierShenBaoTask getSoldierTaskAddIdByType(String type) {
return baseMapper.getSoldierTaskAddIdByType(type);
}
@Override
public void deleteByPayment() {
baseMapper.deleteByPayment();
}
@Override
public void deleteByRePayment() {
baseMapper.deleteByRePayment();
}
}
......@@ -567,6 +567,10 @@ public class DoJointSocialTask {
socialParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getSettleDomainName());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(library.getSettleDomainCode());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(library.getSettleDomainName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......@@ -1080,6 +1084,10 @@ public class DoJointSocialTask {
socialParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getDeptName());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(library.getDeptNo());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(library.getDeptName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
<?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.TAutoPaymentDetailMapper">
<resultMap id="tAutoPaymentDetailMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail">
<id property="id" column="ID"/>
<result property="repeatHandleFlag" column="REPEAT_HANDLE_FLAG"/>
<result property="empName" column="EMP_NAME"/>
<result property="certType" column="CERT_TYPE"/>
<result property="certNum" column="CERT_NUM"/>
<result property="paymentSalary" column="PAYMENT_SALARY"/>
<result property="paymentBase" column="PAYMENT_BASE"/>
<result property="rate" column="RATE"/>
<result property="payLimit" column="PAY_LIMIT"/>
<result property="empCode" column="EMP_CODE"/>
<result property="insuranceType" column="INSURANCE_TYPE"/>
<result property="payMonth" column="PAY_MONTH"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="socialAddress" column="SOCIAL_ADDRESS"/>
<result property="socialSecurityAccount" column="SOCIAL_SECURITY_ACCOUNT"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<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,
a.REPEAT_HANDLE_FLAG,
a.EMP_NAME,
a.CERT_TYPE,
a.CERT_NUM,
a.PAYMENT_SALARY,
a.PAYMENT_BASE,
a.RATE,
a.PAY_LIMIT,
a.EMP_CODE,
a.INSURANCE_TYPE,
a.PAY_MONTH,
a.CREATE_MONTH,
a.SOCIAL_ADDRESS,
a.SOCIAL_SECURITY_ACCOUNT,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.SOURCE_TYPE,
a.PARENT_ID
</sql>
<sql id="tAutoPaymentDetail_where">
<if test="tAutoPaymentDetail != null">
<if test="tAutoPaymentDetail.id != null and tAutoPaymentDetail.id.trim() != ''">
AND a.ID = #{tAutoPaymentDetail.id}
</if>
<if test="tAutoPaymentDetail.repeatHandleFlag != null and tAutoPaymentDetail.repeatHandleFlag.trim() != ''">
AND a.REPEAT_HANDLE_FLAG = #{tAutoPaymentDetail.repeatHandleFlag}
</if>
<if test="tAutoPaymentDetail.empName != null and tAutoPaymentDetail.empName.trim() != ''">
AND a.EMP_NAME = #{tAutoPaymentDetail.empName}
</if>
<if test="tAutoPaymentDetail.certType != null and tAutoPaymentDetail.certType.trim() != ''">
AND a.CERT_TYPE = #{tAutoPaymentDetail.certType}
</if>
<if test="tAutoPaymentDetail.certNum != null and tAutoPaymentDetail.certNum.trim() != ''">
AND a.CERT_NUM = #{tAutoPaymentDetail.certNum}
</if>
<if test="tAutoPaymentDetail.paymentSalary != null">
AND a.PAYMENT_SALARY = #{tAutoPaymentDetail.paymentSalary}
</if>
<if test="tAutoPaymentDetail.paymentBase != null">
AND a.PAYMENT_BASE = #{tAutoPaymentDetail.paymentBase}
</if>
<if test="tAutoPaymentDetail.rate != null and tAutoPaymentDetail.rate.trim() != ''">
AND a.RATE = #{tAutoPaymentDetail.rate}
</if>
<if test="tAutoPaymentDetail.payLimit != null">
AND a.PAY_LIMIT = #{tAutoPaymentDetail.payLimit}
</if>
<if test="tAutoPaymentDetail.empCode != null and tAutoPaymentDetail.empCode.trim() != ''">
AND a.EMP_CODE = #{tAutoPaymentDetail.empCode}
</if>
<if test="tAutoPaymentDetail.insuranceType != null and tAutoPaymentDetail.insuranceType.trim() != ''">
AND a.INSURANCE_TYPE = #{tAutoPaymentDetail.insuranceType}
</if>
<if test="tAutoPaymentDetail.payMonth != null and tAutoPaymentDetail.payMonth.trim() != ''">
AND a.PAY_MONTH = #{tAutoPaymentDetail.payMonth}
</if>
<if test="tAutoPaymentDetail.createMonth != null and tAutoPaymentDetail.createMonth.trim() != ''">
AND a.CREATE_MONTH = #{tAutoPaymentDetail.createMonth}
</if>
<if test="tAutoPaymentDetail.socialAddress != null and tAutoPaymentDetail.socialAddress.trim() != ''">
AND a.SOCIAL_ADDRESS = #{tAutoPaymentDetail.socialAddress}
</if>
<if test="tAutoPaymentDetail.socialSecurityAccount != null and tAutoPaymentDetail.socialSecurityAccount.trim() != ''">
AND a.SOCIAL_SECURITY_ACCOUNT = #{tAutoPaymentDetail.socialSecurityAccount}
</if>
<if test="tAutoPaymentDetail.createBy != null and tAutoPaymentDetail.createBy.trim() != ''">
AND a.CREATE_BY = #{tAutoPaymentDetail.createBy}
</if>
<if test="tAutoPaymentDetail.createName != null and tAutoPaymentDetail.createName.trim() != ''">
AND a.CREATE_NAME = #{tAutoPaymentDetail.createName}
</if>
<if test="tAutoPaymentDetail.createTime != null">
AND a.CREATE_TIME = #{tAutoPaymentDetail.createTime}
</if>
<if test="tAutoPaymentDetail.updateBy != null and tAutoPaymentDetail.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tAutoPaymentDetail.updateBy}
</if>
<if test="tAutoPaymentDetail.updateTime != null">
AND a.UPDATE_TIME = #{tAutoPaymentDetail.updateTime}
</if>
<if test="tAutoPaymentDetail.parentId != null and tAutoPaymentDetail.parentId.trim() != ''">
AND a.PARENT_ID = #{tAutoPaymentDetail.parentId}
</if>
</if>
</sql>
<!--tAutoPaymentDetail简单分页查询-->
<select id="getTAutoPaymentDetailPage" resultMap="tAutoPaymentDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_detail a
<where>
1=1
<include refid="tAutoPaymentDetail_where"/>
</where>
</select>
<delete id="deleteByParentId">
delete from t_auto_payment_detail where PARENT_ID = #{parentId} and SOURCE_TYPE = #{sourceType}
</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>
<?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.TAutoPaymentErrorMapper">
<resultMap id="tAutoPaymentErrorMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentError">
<id property="id" column="ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="certNum" column="CERT_NUM"/>
<result property="insuranceType" column="INSURANCE_TYPE"/>
<result property="errorInfo" column="ERROR_INFO"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.PARENT_ID,
a.EMP_NAME,
a.CERT_NUM,
a.INSURANCE_TYPE,
a.SOCIAL_SECURITY_ACCOUNT,
a.ERROR_INFO
</sql>
<sql id="tAutoPaymentError_where">
<if test="tAutoPaymentError != null">
<if test="tAutoPaymentError.id != null and tAutoPaymentError.id.trim() != ''">
AND a.ID = #{tAutoPaymentError.id}
</if>
<if test="tAutoPaymentError.parentId != null and tAutoPaymentError.parentId.trim() != ''">
AND a.PARENT_ID = #{tAutoPaymentError.parentId}
</if>
<if test="tAutoPaymentError.empName != null and tAutoPaymentError.empName.trim() != ''">
AND a.EMP_NAME = #{tAutoPaymentError.empName}
</if>
<if test="tAutoPaymentError.socialSecurityAccount != null and tAutoPaymentError.socialSecurityAccount.trim() != ''">
AND a.SOCIAL_SECURITY_ACCOUNT = #{tAutoPaymentError.socialSecurityAccount}
</if>
<if test="tAutoPaymentError.certNum != null and tAutoPaymentError.certNum.trim() != ''">
AND a.CERT_NUM = #{tAutoPaymentError.certNum}
</if>
<if test="tAutoPaymentError.insuranceType != null and tAutoPaymentError.insuranceType.trim() != ''">
AND a.INSURANCE_TYPE = #{tAutoPaymentError.insuranceType}
</if>
<if test="tAutoPaymentError.errorInfo != null and tAutoPaymentError.errorInfo.trim() != ''">
AND a.ERROR_INFO = #{tAutoPaymentError.errorInfo}
</if>
</if>
</sql>
<!--tAutoPaymentError简单分页查询-->
<select id="getTAutoPaymentErrorPage" resultMap="tAutoPaymentErrorMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_error a
<where>
1=1
<include refid="tAutoPaymentError_where"/>
</where>
</select>
<delete id="deleteByParentId">
delete from t_auto_payment_error where PARENT_ID = #{parentId}
</delete>
</mapper>
<?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.TAutoPaymentInfoMapper">
<resultMap id="tAutoPaymentInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo">
<id property="id" column="ID"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="dataOneFlag" column="DATA_ONE_FLAG"/>
<result property="dataTwoFlag" column="DATA_TWO_FLAG"/>
<result property="dataThreeFlag" column="DATA_THREE_FLAG"/>
<result property="dataOneRemark" column="DATA_ONE_REMARK"/>
<result property="dataTwoRemark" column="DATA_TWO_REMARK"/>
<result property="dataThreeRemark" column="DATA_THREE_REMARK"/>
<result property="systemReviewFlag" column="SYSTEM_REVIEW_FLAG"/>
<result property="repeatReviewFlag" column="REPEAT_REVIEW_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="attaSrc" column="ATTA_SRC"/>
<result property="attaUrl" column="ATTA_URL"/>
<result property="attaUrlOne" column="ATTA_URL_ONE"/>
<result property="attaUrlTwo" column="ATTA_URL_TWO"/>
<result property="attaUrlThree" column="ATTA_URL_THREE"/>
<result property="attaUrlFour" column="ATTA_URL_FOUR"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.CREATE_MONTH,
a.DATA_ONE_FLAG,
a.DATA_TWO_FLAG,
a.DATA_THREE_FLAG,
a.DATA_ONE_REMARK,
a.DATA_TWO_REMARK,
a.DATA_THREE_REMARK,
a.SYSTEM_REVIEW_FLAG,
a.REPEAT_REVIEW_FLAG,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.ATTA_SRC,
a.ATTA_URL,
a.ATTA_URL_ONE,
a.ATTA_URL_TWO,
a.ATTA_URL_THREE,
a.ATTA_URL_FOUR
</sql>
<sql id="tAutoPaymentInfo_where">
<if test="tAutoPaymentInfo != null">
<if test="tAutoPaymentInfo.id != null and tAutoPaymentInfo.id.trim() != ''">
AND a.ID = #{tAutoPaymentInfo.id}
</if>
<if test="tAutoPaymentInfo.createMonth != null and tAutoPaymentInfo.createMonth.trim() != ''">
AND a.CREATE_MONTH = #{tAutoPaymentInfo.createMonth}
</if>
<if test="tAutoPaymentInfo.dataOneFlag != null and tAutoPaymentInfo.dataOneFlag.trim() != ''">
AND a.DATA_ONE_FLAG = #{tAutoPaymentInfo.dataOneFlag}
</if>
<if test="tAutoPaymentInfo.dataTwoFlag != null and tAutoPaymentInfo.dataTwoFlag.trim() != ''">
AND a.DATA_TWO_FLAG = #{tAutoPaymentInfo.dataTwoFlag}
</if>
<if test="tAutoPaymentInfo.dataThreeFlag != null and tAutoPaymentInfo.dataThreeFlag.trim() != ''">
AND a.DATA_THREE_FLAG = #{tAutoPaymentInfo.dataThreeFlag}
</if>
<if test="tAutoPaymentInfo.systemReviewFlag != null and tAutoPaymentInfo.systemReviewFlag.trim() != ''">
AND a.SYSTEM_REVIEW_FLAG = #{tAutoPaymentInfo.systemReviewFlag}
</if>
<if test="tAutoPaymentInfo.repeatReviewFlag != null and tAutoPaymentInfo.repeatReviewFlag.trim() != ''">
AND a.REPEAT_REVIEW_FLAG = #{tAutoPaymentInfo.repeatReviewFlag}
</if>
<if test="tAutoPaymentInfo.createBy != null and tAutoPaymentInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tAutoPaymentInfo.createBy}
</if>
<if test="tAutoPaymentInfo.createName != null and tAutoPaymentInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tAutoPaymentInfo.createName}
</if>
<if test="tAutoPaymentInfo.createTime != null">
AND a.CREATE_TIME = #{tAutoPaymentInfo.createTime}
</if>
<if test="tAutoPaymentInfo.updateBy != null and tAutoPaymentInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tAutoPaymentInfo.updateBy}
</if>
<if test="tAutoPaymentInfo.updateTime != null">
AND a.UPDATE_TIME = #{tAutoPaymentInfo.updateTime}
</if>
<if test="tAutoPaymentInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[ >= ]]> #{tAutoPaymentInfo.createTimeStart}
</if>
<if test="tAutoPaymentInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tAutoPaymentInfo.createTimeEnd}
</if>
<if test="tAutoPaymentInfo.updateTimeStart != null">
AND a.UPDATE_TIME <![CDATA[ >= ]]> #{tAutoPaymentInfo.updateTimeStart}
</if>
<if test="tAutoPaymentInfo.updateTimeEnd != null">
AND a.UPDATE_TIME <![CDATA[ <= ]]> #{tAutoPaymentInfo.updateTimeEnd}
</if>
</if>
</sql>
<!--tAutoPaymentInfo简单分页查询-->
<select id="getTAutoPaymentInfoPage" resultMap="tAutoPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_info a
<where>
1=1
<include refid="tAutoPaymentInfo_where"/>
</where>
</select>
<!--获取当前月的主表-->
<select id="getThisMonthMainAuto" resultMap="tAutoPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
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>
......@@ -1227,8 +1227,8 @@
SELECT
if(a.TYPE='0','派增','派减') TYPE,
case SUBSTRING_INDEX(GROUP_CONCAT(a.SOCIAL_HANDLE_STATUS ORDER BY a.CREATE_TIME desc),',',1) when '0' then '未办理' when '1' then '全部办理成功' when '2' then '全部办理失败' when '3' then '部分办理成功' when '4' then '办理中' else '-' end socialHandleStatus,
case s.ygs_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' else '-' end ygsHandleStatus,
case s.ysd_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' else '-' end ysdHandleStatus,
case s.ygs_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' when '7' then '提交成功' else '-' end ygsHandleStatus,
case s.ysd_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' when '7' then '提交成功' else '-' end ysdHandleStatus,
s.YGS_REMARK ygsRemark,s.YSD_REMARK ysdRemark,
SUBSTRING_INDEX(GROUP_CONCAT(a.APPLY_NO ORDER BY a.CREATE_TIME desc),',',1) dispatchCode,
a.EMP_NAME empName,
......
......@@ -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,668 @@
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>
<!-- 工资申报 -->
<select id="getSoldierSalaryByShenBaoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo">
select
a.companyNo,a.companyName,a.empName,a.empIdCardType,a.empIdCard,a.fenZu,a.oldSalary
,a.newSalary,a.yangLao,a.shiYe,a.yiLiao,a.daBing,a.gongShang,a.shenBaoType,a.returnInfo
from (
select
'' companyNo,s.SOCIAL_HOUSEHOLD_NAME companyName,s.EMP_NAME empName,'201 - 居民身份证' empIdCardType
,s.EMP_IDCARD empIdCard,'' fenZu,'' oldSalary,s.RECORD_BASE newSalary,s.UNIT_PENSION_CARDINAL yangLao
,s.UNIT_UNEMPLOYMENT_CARDINAL shiYe,s.UNIT_MEDICAL_CARDINAL yiLiao,s.UNIT_BIGAILMENT_CARDINAL daBing
,s.UNIT_WORK_INJURY_CARDINAL gongShang,'按人申报' shenBaoType,'1' returnInfo
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
'' companyNo,s.SOCIAL_HOUSEHOLD_NAME companyName,s.EMP_NAME empName,'201 - 居民身份证' empIdCardType
,s.EMP_IDCARD empIdCard,'' fenZu,'' oldSalary,s.RECORD_BASE newSalary,s.UNIT_PENSION_CARDINAL yangLao
,s.UNIT_UNEMPLOYMENT_CARDINAL shiYe,s.UNIT_MEDICAL_CARDINAL yiLiao,s.UNIT_BIGAILMENT_CARDINAL daBing
,s.UNIT_WORK_INJURY_CARDINAL gongShang,'按人申报' shenBaoType,'2' returnInfo
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>
<!-- 工资调整 -->
<select id="getSoldierSalaryByTiaoZhengList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryTiaoZhengVo">
select
a.companyNo,a.companyName,a.shengXiaoYear,a.empName,a.empIdCardType,a.empIdCard,a.fenZu,a.oldSalary
,a.newSalary,a.yangLao,a.shiYe,a.yiLiao,a.gongShang,a.shenBaoType,a.returnInfo
from (
select
'' companyNo,s.SOCIAL_HOUSEHOLD_NAME companyName,'' shengXiaoYear,s.EMP_NAME empName,'201 - 居民身份证' empIdCardType
,s.EMP_IDCARD empIdCard,'' fenZu,'' oldSalary,s.RECORD_BASE newSalary,s.UNIT_PENSION_CARDINAL yangLao
,s.UNIT_UNEMPLOYMENT_CARDINAL shiYe,s.UNIT_MEDICAL_CARDINAL yiLiao
,s.UNIT_WORK_INJURY_CARDINAL gongShang,'按人申报' shenBaoType,'1' returnInfo
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(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y12')
union all
select
'' companyNo,s.SOCIAL_HOUSEHOLD_NAME companyName,'' shengXiaoYear,s.EMP_NAME empName,'201 - 居民身份证' empIdCardType
,s.EMP_IDCARD empIdCard,'' fenZu,'' oldSalary,s.RECORD_BASE newSalary,s.UNIT_PENSION_CARDINAL yangLao
,s.UNIT_UNEMPLOYMENT_CARDINAL shiYe,s.UNIT_MEDICAL_CARDINAL yiLiao
,s.UNIT_WORK_INJURY_CARDINAL gongShang,'按人申报' shenBaoType,'2' returnInfo
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(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y12')
) a GROUP BY a.empIdCard
</select>
<!-- 社保士兵实缴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
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'
</select>
<!-- 社保士兵实缴3张表查询3_合肥-医保-单位缴费明细查询 -->
<select id="getSoldierPaymentSelectThreeList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierPaymentSelectThreeVo">
select
s.NAME companyName
,'' createMonth
,'' paymentType
,'' returnInfo
,'' returnInfoOne
,'' returnInfoTwo
from sys_house_hold_info s
where s.DEL_FLAG='0' and s.TYPE = '0' and s.AUTO_STATUS = '0'
</select>
<!-- 核验1户 -->
<insert id="getSoldierPaymentErrorInfoOne">
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 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="getSoldierPaymentErrorInfoTwo">
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.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.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.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.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.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.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.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.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.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.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>
<!-- 复核-核验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>
<?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.TSocialSoldierShenBaoTaskMapper">
<resultMap id="tSocialSoldierShenBaoTaskMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask">
<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"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.ADD_ID,
a.TYPE,
a.DATA_STATUS,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME
</sql>
<sql id="tSocialSoldierShenBaoTask_where">
<if test="tSocialSoldierShenBaoTask != null">
<if test="tSocialSoldierShenBaoTask.id != null and tSocialSoldierShenBaoTask.id.trim() != ''">
AND a.ID = #{tSocialSoldierShenBaoTask.id}
</if>
<if test="tSocialSoldierShenBaoTask.addId != null and tSocialSoldierShenBaoTask.addId.trim() != ''">
AND a.ADD_ID = #{tSocialSoldierShenBaoTask.addId}
</if>
<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>
<if test="tSocialSoldierShenBaoTask.updateBy != null and tSocialSoldierShenBaoTask.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialSoldierShenBaoTask.updateBy}
</if>
<if test="tSocialSoldierShenBaoTask.createName != null and tSocialSoldierShenBaoTask.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialSoldierShenBaoTask.createName}
</if>
<if test="tSocialSoldierShenBaoTask.updateTime != null">
AND a.UPDATE_TIME = #{tSocialSoldierShenBaoTask.updateTime}
</if>
<if test="tSocialSoldierShenBaoTask.createTime != null">
AND a.CREATE_TIME = #{tSocialSoldierShenBaoTask.createTime}
</if>
</if>
</sql>
<!--list-->
<select id="getTSocialSoldierShenBaoTaskList" resultMap="tSocialSoldierShenBaoTaskMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_shen_bao_task a
<where>
1=1
<include refid="tSocialSoldierShenBaoTask_where"/>
</where>
</select>
<!--获取任务id-->
<select id="getSoldierTaskAddIdByType" resultMap="tSocialSoldierShenBaoTaskMap">
SELECT
<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>
......@@ -102,6 +102,13 @@ public class SysDictItem extends BaseEntity {
@Schema(description = "删除标记,1:已删除,0:正常")
private String delFlag;
/**
* 启用禁用 0 启用 1禁用
*/
@TableField
@Schema(description = "启用禁用 0 启用 1禁用")
private String disable;
/**
* 上级字典项标签
*/
......
......@@ -189,6 +189,17 @@ public class DictController {
public R<Map<String, Object>> getParentDictItemByTypes(String itemTypes) {
return sysDictItemService.getParentDictItemByTypes(itemTypes);
}
/**
* 通过id查询父级字典的字典值
* @param itemTypes
* @return R
*/
@SysLog("通过id查询父级字典的字典值")
@GetMapping("/getDictItemsByTypes")
public R<Map<String, List>> getDictItemsByTypes(String itemTypes) {
return sysDictItemService.getDictItemsByTypes(itemTypes);
}
/**
* 通过id查询字典项
* @param id id
......@@ -222,7 +233,8 @@ public class DictController {
if (Common.isNotNull(dict.getParentItemType())){
return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getType,dict.getParentItemType())
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)));
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)
.eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING)));
}
return R.ok();
}
......@@ -345,7 +357,8 @@ public class DictController {
@PostMapping("/inner/getDictList")
public R<List<SysDictItem>> getDictList(@RequestParam(value = "itemType", required = false) String itemType) {
List<SysDictItem> allList = sysDictItemService.list(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)
.eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING));
return new R<>(allList);
}
}
......@@ -38,6 +38,7 @@ public class DictItemRedisInit {
@PostConstruct
public void init(){
log.info("字典数据加入缓存初始化开始...");
//不含禁用状态的字段
Map<String, Object> dictItem = dictItemService.getAllDictItemSub();
if (Common.isNotNull(dictItem)){
for (Map.Entry<String,Object> entry:dictItem.entrySet()){
......@@ -48,6 +49,7 @@ public class DictItemRedisInit {
}
log.info("字典数据加入缓存初始化结束...");
log.info("转义字典数据加入缓存初始化开始...");
// 包含禁用状态的字段数据
List<DictRedisVo> lables = dictItemService.getDictRedisVo();
if (Common.isNotNull(lables)){
Map<String,String> lableMap = new HashMap<>();
......
......@@ -89,4 +89,6 @@ public interface SysDictItemService extends IService<SysDictItem> {
R<String> getLableFronValue(String value,String type);
List<DictRedisVo> getDictRedisVo();
R<Map<String, List>> getDictItemsByTypes(String itemTypes);
}
......@@ -47,6 +47,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -132,7 +133,8 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public R<String> getLableFronValue(String value, String type) {
SysDictItem sysDictItem = baseMapper.selectOne(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getType,type).eq(SysDictItem::getValue,value)
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)
.eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING));
if (Common.isNotNull(sysDictItem)) {
return R.ok(sysDictItem.getLabel());
}
......@@ -147,7 +149,8 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
private void updateDictItem(String type, Map<String,Object> resultMap){
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,type)
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)
.eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING));
extractedCache(allList, resultMap);
}
......@@ -228,7 +231,8 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@Override
public Map<String, Object> getAllDictItemSub(){
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING)
.eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING));
Map<String, Object> resultMap = new HashMap<>();
extracted(allList, resultMap);
return resultMap;
......@@ -289,7 +293,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
private Map<String, Map<String, String>> getStringMapMap(boolean type) {
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getDelFlag,CommonConstants.STATUS_NORMAL));
.eq(SysDictItem::getDelFlag,CommonConstants.STATUS_NORMAL).eq(SysDictItem::getDisable,CommonConstants.ZERO_STRING));
Map<String, Map<String, String>> resultMap = new HashMap<>();
doAssemble(allList, resultMap, type);
return resultMap;
......@@ -354,5 +358,30 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return node;
};
}
@Override
public R<Map<String, List>> getDictItemsByTypes(String itemTypes) {
if (Common.isEmpty(itemTypes)){
return R.failed(CommonConstants.RESULT_EMPTY);
}
Map<String, List> resultMap = new HashMap<>();
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,Common.initStrToList(itemTypes,CommonConstants.COMMA_STRING))
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(allList)){
List temp;
for (SysDictItem item : allList) {
String dictCode = item.getType();
if (resultMap.get(dictCode) == null) {
List list = new ArrayList<>();
list.add(item);
resultMap.put(dictCode, list);
} else {
temp = resultMap.get(dictCode);
temp.add(item);
resultMap.put(dictCode, temp);
}
}
}
return R.ok(resultMap);
}
}
......@@ -54,6 +54,7 @@
WHERE
a.type = #{type}
AND i.`value` = a.parent_id
AND a.disable ='0'
AND a.`value` = #{value}
AND i.del_flag='0' limit 1
</select>
......
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