Commit 008795fc authored by huyuchen's avatar huyuchen

优化修改

parent a86851e9
......@@ -30,7 +30,7 @@ public class EmployeeConstants {
public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填";
public static final String FILE_CITY_MUST = "更新档案县,档案市必填";
public static final String DEPT_NO_ERROR = "项目编码错误";
public static final String DEPT_NO_EXIST = "根据项目编码未找到项目";
public static final String DEPT_NO_EXIST = "未找到对应的项目或者项目已停止合作,请核实";
public static final String CHECK_ERROR = "校验服务错误,请联系管理员!";
public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!";
public static final String SITUATION_SIX = "作废";
......
......@@ -670,6 +670,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isEmpty(fileSource)) {
return R.failed("人员档案来源必填!(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)");
}
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, employeeInfo.getDeptNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("对应项目编码的项目已停止合作");
}
TEmployeeInfo check = new TEmployeeInfo();
check.setEmpName(employeeInfo.getEmpName());
check.setEmpIdcard(employeeInfo.getEmpIdcard());
......
......@@ -6,12 +6,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils;
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.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.AllArgsConstructor;
......@@ -36,6 +37,7 @@ public class DoJointSalaryAsyncTask {
private final DaprSocialProperties socialProperties;
private final TSalaryStandardMapper salaryStandardMapper;
private final RedisUtil redisUtil;
/**
* @Description: 收入
......@@ -164,6 +166,7 @@ public class DoJointSalaryAsyncTask {
TIncomeDetail detail;
Integer value;
BigDecimal money;
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (TSalaryAccount account : salaryAccountList) {
value = detailMap.get(account.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING
+ account.getDeptId() + CommonConstants.DOWN_LINE_STRING + isManage
......@@ -171,6 +174,7 @@ public class DoJointSalaryAsyncTask {
+ CommonConstants.FOUR_STRING);
if (Common.isEmpty(value) || value == 0) {
detail = new TIncomeDetail();
detail.setRedisKey(redisKey);
detail.setPayMonth(account.getSalaryMonth());
detail.setDeptId(account.getDeptId());
detail.setDeptName(account.getDeptName());
......@@ -206,6 +210,18 @@ public class DoJointSalaryAsyncTask {
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
R<Boolean> saveR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tincome/inner/saveSalaryPushIncome", income, Boolean.class, SecurityConstants.FROM_IN);
if (saveR == null || saveR.getCode() == CommonConstants.ONE_INT || Boolean.FALSE.equals(saveR.getData())) {
return false;
}
}
redisUtil.remove(redisKey);
}
return true;
}
......
......@@ -242,4 +242,13 @@ public class TIncome{
@TableField(exist = false)
@ExcelIgnore
private String authSql;
@TableField(exist = false)
private String redisKey;
/**
* 来源id
*/
@TableField(exist = false)
private String sourceId;
}
......@@ -227,4 +227,7 @@ public class TIncomeDetail {
// 查询时框定范围使用
@TableField(exist = false)
private List<String> idCardList;
@TableField(exist = false)
private String redisKey;
}
......@@ -183,6 +183,18 @@ public class TIncomeController {
return tIncomeService.saveDetail(tIncomeDetail,false);
}
/**
* @Description: 薪资新增收入明细-详情表,同时统计;采用同步操作,因为薪资本身就是异步
* @Author: hgw
* @Date: 2022-11-29 17:29:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping("/inner/saveSalaryPushIncome")
public Boolean saveSalaryPushIncome(@RequestBody TIncome income) {
return tIncomeService.savePushIncome(income);
}
/**
* @Description: 定时任务统计表未推送数据推送;
* @Author: huyc
......
......@@ -25,7 +25,6 @@ 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.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import javax.servlet.http.HttpServletResponse;
......@@ -60,13 +59,15 @@ public interface TIncomeService extends IService<TIncome> {
**/
boolean saveDetail(TIncomeDetail tIncomeDetail,boolean synFlag);
boolean savePushIncome(TIncome income);
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: huyc
* @Date: 2022/9/9 11:42
* @return:
**/
boolean saveBathDetail(TIncomeDetail tIncomeDetail, TPaymentInfo paymentInfo);
boolean saveBathDetail(TIncomeDetail tIncomeDetail, String paymentId);
void pushDetail();
......
......@@ -85,6 +85,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private final ArchivesDaprUtil archivesDaprUtil;
private final RedisUtil redisUtil;
@Autowired
private DoJointSocialTask doJointSocialTask;
......@@ -317,6 +319,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (TForecastLibrary library : saveLibraryMap.values()) {
if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) {
continue;
......@@ -341,7 +344,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))) {
//办理成功生成收入
createIncomeInfo(library,true,mapSelectVo);
createIncomeInfo(library,true,mapSelectVo,redisKey);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
}
......@@ -354,12 +357,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(socialFundInfoF) && (Common.isNotNull(socialFundInfoF.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus()))) {
//办理成功生成收入
createIncomeInfo(library,true,mapSelectVo);
createIncomeInfo(library,true,mapSelectVo,redisKey);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomeT(income);
}
redisUtil.remove(redisKey);
}
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial,true, mapSelectVo);
......@@ -1615,14 +1626,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TIncomeDetail::getPayMonth, library.getSocialPayMonth())
.eq(TIncomeDetail::getMrSettleType, CommonConstants.ONE_STRING));
if (Common.isNotNull(updateList)) {
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setRedisKey(redisKey);
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail,false);
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomeAssoT(income);
}
redisUtil.remove(redisKey);
}
}
}
......@@ -1655,14 +1676,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TIncomeDetail::getPayMonth,library.getProvidentPayMonth())
.eq(TIncomeDetail::getMrSettleType, CommonConstants.ONE_STRING));
if (Common.isNotNull(updateList)) {
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setId(CommonConstants.NULL);
detail.setRedisKey(redisKey);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail,false);
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomeAssoT(income);
}
redisUtil.remove(redisKey);
}
}
}
......@@ -1887,13 +1918,22 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (TForecastLibrary library : librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library, synFlag, mapSelectVo);
createIncomeInfo(library, synFlag, mapSelectVo,redisKey);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
librarySocialInfoList1.add(library);
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomeT(income);
}
redisUtil.remove(redisKey);
}
if (Common.isNotNull(librarySocialInfoList1)) {
this.pushForecastInfo(librarySocialInfoList1,synFlag,mapSelectVo);
}
......@@ -2221,6 +2261,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
//社保收入
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
......@@ -2235,7 +2276,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library : librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library,true, mapSelectVo);
createIncomeInfo(library,true, mapSelectVo,redisKey);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
}
......@@ -2257,13 +2298,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library : libraryFundInfoList) {
//办理成功生成收入
createIncomeInfo(library,true, mapSelectVo);
createIncomeInfo(library,true, mapSelectVo,redisKey);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
}
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomeT(income);
}
redisUtil.remove(redisKey);
}
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial,true,mapSelectVo);
......@@ -2434,7 +2483,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
public void createIncomeInfo(TForecastLibrary library,boolean synFlag,Map<String,TSettleDomainSelectVo> mapSelectVo) {
public void createIncomeInfo(TForecastLibrary library,boolean synFlag,Map<String,TSettleDomainSelectVo> mapSelectVo,
String redisKey) {
//获取项目信息
TSettleDomain settleDomain = new TSettleDomain();
if (Common.isNotNull(mapSelectVo)) {
......@@ -2479,7 +2529,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//预估模式
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee(), sourceType, synFlag);
settleDomain.getManagementFee(), sourceType, synFlag,redisKey);
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
......@@ -2488,7 +2538,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//预估模式
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
settleDomain.getRiskFundFee(), sourceType, synFlag);
settleDomain.getRiskFundFee(), sourceType, synFlag,redisKey);
}
}
}
......@@ -2504,10 +2554,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void createIncomeInsurance(TForecastLibrary library, TSettleDomain settleDomain, String feeType,
String charges, String feeMode, BigDecimal money, String sourceType
,boolean synFlag) {
,boolean synFlag, String redisKey) {
//生成收入数据
TIncomeDetail detail = new TIncomeDetail();
detail.setCreateTime(DateUtil.getCurrentDateTime());
detail.setRedisKey(redisKey);
detail.setDeptName(settleDomain.getDepartName());
detail.setDeptNo(settleDomain.getDepartNo());
detail.setDeptId(settleDomain.getId());
......
......@@ -37,7 +37,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper;
......@@ -280,6 +279,12 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
}
@Override
public boolean savePushIncome(TIncome income) {
doJointSocialTask.asynchronousEkpIncomeAssoT(income);
return true;
}
/**
* @Description: 新增收入明细-详情表,同时统计;
* @Author: hgw
......@@ -287,7 +292,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean
**/
@Override
public boolean saveBathDetail(TIncomeDetail tIncomeDetail, TPaymentInfo paymentInfo) {
public boolean saveBathDetail(TIncomeDetail tIncomeDetail, String paymentId) {
if (Common.isEmpty(tIncomeDetail.getEmpIdcard())
|| Common.isEmpty(tIncomeDetail.getDeptId())
|| Common.isEmpty(tIncomeDetail.getPayMonth())) {
......@@ -309,10 +314,10 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
tIncomeDetailService.save(tIncomeDetail);
// 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) {
return this.savePaymentIncome(tIncomeDetail,paymentInfo);
return this.savePaymentIncome(tIncomeDetail,paymentId);
} else {
// 核心判断
return this.copyCore(tIncomeDetail, incomeList, detailList,paymentInfo,true);
return this.copyCore(tIncomeDetail, incomeList, detailList,paymentId,true);
}
}
......@@ -403,6 +408,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ZERO_STRING);
income.setApplyNo(tIncomeDetail.getApplyNo());
this.save(income);
if (Common.isNotNull(tIncomeDetail.getRedisKey())) {
income.setRedisKey(tIncomeDetail.getRedisKey());
}
long start = System.currentTimeMillis();
if (synFlag){
doJointSocialTask.asynchronousEkpIncome(income);
......@@ -414,14 +422,15 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
// 复制并保存
private boolean savePaymentIncome(TIncomeDetail tIncomeDetail, TPaymentInfo paymentInfo) {
private boolean savePaymentIncome(TIncomeDetail tIncomeDetail, String paymentId) {
TIncome income = new TIncome();
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
income.setApplyNo(tIncomeDetail.getApplyNo());
this.save(income);
long start = System.currentTimeMillis();
doJointSocialTask.asynchronousEkpIncomePayment(income,paymentInfo);
income.setSourceId(paymentId);
doJointSocialTask.asynchronousEkpIncomePayment(income,paymentId);
log.error("线程执行耗时:"+ (System.currentTimeMillis()-start));
return true;
}
......@@ -571,7 +580,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: boolean
**/
private boolean copyCore(TIncomeDetail tIncomeDetail, List<TIncome> incomeList, List<TIncomeDetail> detailList,
TPaymentInfo paymentInfo,boolean synFlag) {
String paymentId,boolean synFlag) {
if (Common.isNotNull(tIncomeDetail.getSourceId())) {
// 如果该id、该类型的金额已存在,则不允许重复生成推送
TIncomeDetail a = new TIncomeDetail();
......@@ -587,8 +596,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
// 判断,比例,直接加
if (CommonConstants.ONE_STRING.equals(tIncomeDetail.getFeeMode())) {
if (Common.isNotNull(paymentInfo)) {
return this.savePaymentIncome(tIncomeDetail,paymentInfo);
if (Common.isNotNull(paymentId)) {
return this.savePaymentIncome(tIncomeDetail,paymentId);
} else {
return this.saveIncome(tIncomeDetail,synFlag);
}
......@@ -643,8 +652,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (CommonConstants.ZERO_STRING.equals(tIncomeDetail.getRedData())) {
if (incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) == null
|| incomeMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()) <= CommonConstants.ZERO_INT) {
if (Common.isNotNull(paymentInfo)) {
return this.savePaymentIncome(tIncomeDetail,paymentInfo);
if (Common.isNotNull(paymentId)) {
return this.savePaymentIncome(tIncomeDetail,paymentId);
} else {
return this.saveIncome(tIncomeDetail,synFlag);
}
......@@ -652,8 +661,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
} else {
// 红冲判断:当本类型是最大值,才可以红冲
if (this.redDateJudge(tIncomeDetail, numMap)) {
if (Common.isNotNull(paymentInfo)) {
return this.savePaymentIncome(tIncomeDetail,paymentInfo);
if (Common.isNotNull(paymentId)) {
return this.savePaymentIncome(tIncomeDetail,paymentId);
} else {
return this.saveIncome(tIncomeDetail,synFlag);
}
......@@ -690,8 +699,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
}
}
if (Common.isNotNull(paymentInfo)) {
tPaymentInfoMapper.updateBySocialIncomeFlag(paymentInfo.getId());
if (Common.isNotNull(paymentId)) {
tPaymentInfoMapper.updateBySocialIncomeFlag(paymentId);
}
return true;
}
......
......@@ -2565,8 +2565,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
createPaymentSocialInfoReal(user, searchVo,mapSelectVo);
createPaymentFundInfoReal(user, searchVo,mapSelectVo);
//推送社保公积金收入数据
createPaymentInfoIncomeReal(user, searchVo,mapSelectVo);
createPaymentFundIncomeReal(user, searchVo,mapSelectVo);
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
createPaymentInfoIncomeReal(user, searchVo,mapSelectVo,redisKey);
createPaymentFundIncomeReal(user, searchVo,mapSelectVo,redisKey);
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
}
if (Common.isNotNull(mapSelectVo)) {
mapSelectVo.clear();
}
......@@ -2601,6 +2610,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (int j = 0; j < i; j++) {
//判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入
sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
......@@ -2610,10 +2620,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成收入
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo);
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo,redisKey);
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
}
if (Common.isNotNull(mapSelectVo)) {
mapSelectVo.clear();
}
......@@ -2631,6 +2649,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (int j = 0; j < i; j++) {
sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
......@@ -2639,10 +2658,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成公积金收入
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo);
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo,redisKey);
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
}
if (Common.isNotNull(mapSelectVo)) {
mapSelectVo.clear();
}
......@@ -2714,7 +2741,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
public void createPaymentInfoIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentSocialIncomeCount(searchVo,user.getId());
if (count > 0) {
......@@ -2725,7 +2752,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成收入
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo);
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo,redisKey);
}
}
}
......@@ -2733,7 +2760,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
public void createPaymentFundIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentFundIncomeCount(searchVo,user.getId());
if (count > 0) {
......@@ -2744,7 +2771,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成公积金收入
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo);
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo,redisKey);
}
}
}
......@@ -2804,7 +2831,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
public void createIncomeInfo(List<TPaymentInfo> updateList, String socialFundFlag,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
List<TIncomeDetail> exitIncome;
TSettleDomain settleDomain;
try {
......@@ -2877,7 +2904,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag);
gMoney, socialFundFlag,redisKey);
}
}
}
......@@ -2908,7 +2935,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag);
money, socialFundFlag,redisKey);
}
}
}
......@@ -2923,10 +2950,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType,
String charges, String feeMode, BigDecimal money, String sourceType) {
String charges, String feeMode, BigDecimal money, String sourceType,
String redisKey) {
//生成收入数据
TIncomeDetail detail = new TIncomeDetail();
detail.setCreateTime(DateUtil.getCurrentDateTime());
detail.setRedisKey(redisKey);
detail.setDeptName(settleDomain.getDepartName());
detail.setDeptNo(settleDomain.getDepartNo());
detail.setDeptId(settleDomain.getId());
......@@ -2952,7 +2981,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
incomeService.saveBathDetail(detail,library);
incomeService.saveBathDetail(detail,library.getId());
}
/**
......
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