Commit 93755531 authored by huyuchen's avatar huyuchen

明细接口改造

parent a951fb43
package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -65,8 +66,8 @@ public class EkpDaprUtils {
* @Param
* @return
**/
public R<String> pushManagerInfoToEkp(EkpIncomeParamManage incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/pushManangerInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
public R<EkpIncomePushInfoVo> pushManagerInfoToEkp(EkpIncomeParamManage incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/pushManangerInfoToEkp", JSON.toJSONString(incomeParam), EkpIncomePushInfoVo.class, SecurityConstants.FROM_IN);
}
/**
......@@ -87,8 +88,8 @@ public class EkpDaprUtils {
* @Param
* @return
**/
public R<String> pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/pushRiskInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
public R<EkpIncomePushInfoVo> pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/pushRiskInfoToEkp", JSON.toJSONString(incomeParam), EkpIncomePushInfoVo.class, SecurityConstants.FROM_IN);
}
......
package com.yifu.cloud.plus.v1.ekp.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author huyc
* @Date 2024/2/29
* @Description 社保明细推送相关参数
* @Version 1.0
*/
@Data
public class EkpIncomePushInfoVo implements Serializable {
/**
* 社保id合并
**/
private String id;
}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
......@@ -36,7 +37,7 @@ public class TEkpManagerInfoController {
**/
@Inner
@PostMapping("/inner/pushManangerInfoToEkp")
public String pushManangerInfoToEkp(@RequestBody EkpIncomeParamManage incomeParam) {
public EkpIncomePushInfoVo pushManangerInfoToEkp(@RequestBody EkpIncomeParamManage incomeParam) {
return ekpManagerInfoService.pushManangerInfoToEkp(incomeParam);
}
......
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
......@@ -37,7 +38,7 @@ public class TEkpRiskInfoController {
**/
@Inner
@PostMapping("/inner/pushRiskInfoToEkp")
public String pushRiskInfoToEkp(@RequestBody EkpIncomeParamRisk incomeParam) {
public EkpIncomePushInfoVo pushRiskInfoToEkp(@RequestBody EkpIncomeParamRisk incomeParam) {
return ekpRiskInfoService.pushRiskInfoToEkp(incomeParam);
}
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import org.springframework.transaction.annotation.Transactional;
......@@ -17,7 +18,7 @@ import java.util.List;
public interface EkpManagerInfoService extends IService<EkpManagerInfo> {
@Transactional
String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam);
EkpIncomePushInfoVo pushManangerInfoToEkp(EkpIncomeParamManage incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParam);
}
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import org.springframework.transaction.annotation.Transactional;
......@@ -17,7 +18,7 @@ import java.util.List;
public interface EkpRiskInfoService extends IService<EkpRiskInfo> {
@Transactional
String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam);
EkpIncomePushInfoVo pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParam);
}
......@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
......@@ -33,7 +34,7 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper,
* //@Date: 2024-3-14
* //@return: void
**/
public String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam) {
public EkpIncomePushInfoVo pushManangerInfoToEkp(EkpIncomeParamManage incomeParam) {
//根据项目编码获取ekp所有项目信息
EkpDeptInfoVo deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
......@@ -67,7 +68,13 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper,
//创建时间
managerInfo.setCreateTime(DateUtil.getCurrentDateTime());
int i = baseMapper.insert(managerInfo);
return i <= 0 ? null : managerInfo.getFdId();
if (i>0) {
EkpIncomePushInfoVo infoVo = new EkpIncomePushInfoVo();
infoVo.setId(managerInfo.getFdId());
return infoVo;
}else {
return null;
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
......
......@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpRiskInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
......@@ -33,7 +34,7 @@ public class EkpRiskInfoServiceImpl extends ServiceImpl<EkpRiskInfoMapper, EkpRi
* //@Date: 2024-3-14
* //@return: void
**/
public String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
public EkpIncomePushInfoVo pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
//根据项目编码获取ekp所有项目信息
EkpDeptInfoVo deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
......@@ -66,7 +67,13 @@ public class EkpRiskInfoServiceImpl extends ServiceImpl<EkpRiskInfoMapper, EkpRi
//创建时间
riskInfoInfo.setCreateTime(DateUtil.getCurrentDateTime());
int i = baseMapper.insert(riskInfoInfo);
return i <= 0 ? null : riskInfoInfo.getFdId();
if (i>0) {
EkpIncomePushInfoVo infoVo = new EkpIncomePushInfoVo();
infoVo.setId(riskInfoInfo.getFdId());
return infoVo;
} else {
return null;
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
......
......@@ -27,6 +27,9 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
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.TIncomeSearchVo;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
......@@ -68,6 +71,8 @@ public interface TIncomeService extends IService<TIncome> {
* @Date: 2022/9/9 11:42
* @return:
**/
@Transactional
@ShardingTransactionType(TransactionType.BASE)
boolean saveBathDetail(TIncomeDetail tIncomeDetail, String paymentId);
void pushDetail();
......
......@@ -28,6 +28,7 @@ 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.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -299,20 +300,22 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId());
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
TIncomeDetail detail = new TIncomeDetail();
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId());
List<TIncomeDetail> detailList = tIncomeDetailService.getTIncomeDetailList(detail);
tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail);
// 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) {
return this.savePaymentIncomeNew(tIncomeDetail, paymentId);
} else {
// 核心判断
return this.copyCoreNew(tIncomeDetail, incomeList, detailList, paymentId, false);
synchronized (this) {
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
TIncomeDetail detail = new TIncomeDetail();
detail.setEmpIdcard(tIncomeDetail.getEmpIdcard());
detail.setDeptId(tIncomeDetail.getDeptId());
List<TIncomeDetail> detailList = tIncomeDetailService.getTIncomeDetailList(detail);
tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail);
// 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) {
return this.savePaymentIncome(tIncomeDetail, paymentId);
} else {
// 核心判断
return this.copyCore(tIncomeDetail, incomeList, detailList, paymentId, true);
}
}
}
......@@ -388,16 +391,16 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
if (CommonConstants.ONE_STRING.equals(income.getFeeType())) {
EkpIncomeParamManage sendParam = new EkpIncomeParamManage();
this.copyToEkpManage(income, sendParam);
R<String> info = ekpDaprUtil.pushManagerInfoToEkp(sendParam);
R<EkpIncomePushInfoVo> info = ekpDaprUtil.pushManagerInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
sendBack = info.getData();
sendBack = info.getData().getId();
}
} else {
EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk();
this.copyToEkpRisk(income, sendParam);
R<String> info = ekpDaprUtil.pushRiskInfoToEkp(sendParam);
R<EkpIncomePushInfoVo> info = ekpDaprUtil.pushRiskInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
sendBack = info.getData();
sendBack = info.getData().getId();
}
}
return sendBack;
......@@ -444,7 +447,6 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ZERO_STRING);
income.setApplyNo(tIncomeDetail.getApplyNo());
this.save(income);
long start = System.currentTimeMillis();
income.setSourceId(paymentId);
doJointSocialTask.asynchronousEkpIncomePaymentNew(income,paymentId);
return true;
......
package com.yifu.cloud.plus.v1.yifu.social.util;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
......@@ -108,7 +109,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -119,7 +120,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -153,7 +154,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -164,7 +165,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -207,7 +208,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -218,7 +219,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -254,7 +255,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -265,7 +266,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -298,7 +299,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -309,7 +310,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -326,18 +327,18 @@ public class DoJointSocialTask {
if (CommonConstants.ONE_STRING.equals(income.getFeeType())) {
EkpIncomeParamManage sendParam = new EkpIncomeParamManage();
this.copyToEkpManage(income, sendParam);
R<String> info = ekpDaprUtil.pushManagerInfoToEkp(sendParam);
R<EkpIncomePushInfoVo> info = ekpDaprUtil.pushManagerInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
return info.getData();
return info.getData().getId();
} else {
return "管理费推送失败";
}
} else {
EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk();
this.copyToEkpRisk(income, sendParam);
R<String> info = ekpDaprUtil.pushRiskInfoToEkp(sendParam);
R<EkpIncomePushInfoVo> info = ekpDaprUtil.pushRiskInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
return info.getData();
return info.getData().getId();
} else {
return "风险金推送失败";
}
......@@ -1444,7 +1445,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -1455,7 +1456,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......@@ -1480,7 +1481,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
......@@ -1491,7 +1492,7 @@ public class DoJointSocialTask {
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
tSendEkpErrorService.save(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
......
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