Commit a8c97a60 authored by huyuchen's avatar huyuchen

缴费库收入生成修改

parent 1d0a3850
......@@ -7,8 +7,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
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.TIncomeDetailReturnVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -71,7 +73,7 @@ public class SocialDaprUtils {
/**
* @Author huyc
* @Description 更新缴费库
* @Description 更新社保公积金明细
* @Date 2022/8/15
* @Param
* @return
......@@ -82,13 +84,17 @@ public class SocialDaprUtils {
/**
* @Author huyc
* @Description 生成收入数据
* @Description 查询人员收入数据
* @Date 2022/9/2
* @Param
* @return
**/
public void createTIncomeDetail(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/createTIncomeDetail", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
public R<TIncomeDetailReturnVo> getTIncomeDetailList(TIncomeDetail infoVo) {
R<TIncomeDetailReturnVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getTIncomeDetailList", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(listVo)){
return R.failed("查询人员收入数据失败!");
}
return listVo;
}
/**
......@@ -98,11 +104,33 @@ public class SocialDaprUtils {
* @Param
* @return
**/
public R<TIncomeDetailReturnVo> getTIncomeDetailList(TIncomeDetail infoVo) {
R<TIncomeDetailReturnVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getTIncomeDetailList", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
public R<Boolean> createTIncomeDetail(TIncomeDetail infoVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/saveDetail", JSON.toJSONString(infoVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 查询人员缴费库数据
* @Date 2022/9/2
* @Param
* @return
**/
public R<TPaymentVo> getPaymentSocialAndFound(TPaymentInfo infoVo) {
R<TPaymentVo> listVo = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/getPaymentSocialAndFound", JSON.toJSONString(infoVo), TPaymentInfo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(listVo)){
return R.failed("查询人员收入数据失败!");
return R.failed("查询人员缴费库数据失败!");
}
return listVo;
}
/**
* @Author huyc
* @Description 通过收入id删除收入数据
* @Date 2022/9/2
* @Param
* @return
**/
public void deleteById(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/deleteById", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
}
}
......@@ -105,9 +105,9 @@ public class SocialTask {
* @return: void
**/
public void createPaymentInfoIncome() {
log.info("------------定时生成缴费库的收入数据-定时任务开始------------");
log.info("------------定时生成缴费库社保的收入数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentInfoIncome","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成缴费库的收入数据-定时任务结束------------");
log.info("------------定时生成缴费库社保的收入数据-定时任务结束------------");
}
/**
......@@ -117,8 +117,20 @@ public class SocialTask {
* @return: void
**/
public void createPaymentFundIncome() {
log.info("------------定时生成缴费库的收入数据-定时任务开始------------");
log.info("------------定时生成缴费库公积金的收入数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentFundIncome","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成缴费库的收入数据-定时任务结束------------");
log.info("------------定时生成缴费库公积金的收入数据-定时任务结束------------");
}
/**
* @Description: 定时任务生成统计表数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void pushDetail() {
log.info("------------定时任务生成统计表数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/pushDetail","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时任务生成统计表数据-定时任务结束------------");
}
}
......@@ -162,4 +162,15 @@ public class TIncomeController {
return tIncomeService.saveDetail(tIncomeDetail);
}
/**
* @Description: 定时任务统计表未推送数据推送;
* @Author: huyc
* @Date: 2022/9/5 16:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping("/inner/pushDetail")
public void pushDetail() {
tIncomeService.pushDetail();
}
}
......@@ -56,4 +56,26 @@ public class TIncomeDetailController {
return vo;
}
/**
* @Description: 生成收入数据
* @Author: huyc
* @Date: 2022-9-2
**/
@Inner
@PostMapping("/inner/createTIncomeDetail")
public void createTIncomeDetail(@RequestBody TIncomeDetail detail) {
tIncomeDetailService.save(detail);
}
/**
* 通过id删除收入明细表
*
* @param tIncomeDetail
* @return R
*/
@Inner
@PostMapping("/deleteById")
public void deleteById(@RequestBody TIncomeDetail tIncomeDetail) {
tIncomeDetailService.removeById(tIncomeDetail.getId());
}
}
......@@ -57,4 +57,6 @@ public interface TIncomeService extends IService<TIncome> {
**/
boolean saveDetail(TIncomeDetail tIncomeDetail);
void pushDetail();
}
......@@ -25,15 +25,14 @@ 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.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.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.config.EkpIncomeProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParam;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig;
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.mapper.TIncomeMapper;
......@@ -44,10 +43,8 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo;
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 javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -275,6 +272,24 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
}
@Override
public void pushDetail() {
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING));
for (TIncome income : list) {
EkpIncomeParam sendParam = new EkpIncomeParam();
this.copyToEkp(income, sendParam);
String sendBack = ekpIncomeUtil.sendToEKP(sendParam, income.getFeeType());
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
}
this.updateById(income);
}
}
// 复制并保存
private boolean saveIncome(TIncomeDetail tIncomeDetail) {
TIncome income = new TIncome();
......
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