Commit 273d749e authored by huyuchen's avatar huyuchen

结算状态同步

parent 20a97615
......@@ -8,6 +8,8 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.List;
/**
* @Author fxj
* @Date 2022/8/17
......@@ -27,7 +29,7 @@ public class SalaryDaprUtil {
* @Param
* @return
**/
public void updateSalarySettleStatus(EkpSocialViewVo infoVo) {
public void updateSalarySettleStatus(List<EkpSocialViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateSalarySettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
}
......@@ -143,7 +143,7 @@ public class SocialDaprUtils {
* @Param
* @return
**/
public void updateSocialSettleStatus(EkpSocialViewVo infoVo) {
public void updateSocialSettleStatus(List<EkpSocialViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/updateSocialSettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
......@@ -154,7 +154,7 @@ public class SocialDaprUtils {
* @Param
* @return
**/
public void updateIncomeSettleStatus(EkpInsuranceViewVo infoVo) {
public void updateIncomeSettleStatus(List<EkpInsuranceViewVo> infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateIncomeSettleStatus", JSON.toJSONString(infoVo), EkpInsuranceViewVo.class, SecurityConstants.FROM_IN);
}
}
......@@ -6,6 +6,8 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhaji
* @description TODO
......@@ -23,16 +25,16 @@ public interface EkpSettleMapper {
SettleVo getSettle(String id);
EkpInsuranceViewVo selectSettleStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpInsuranceViewVo> selectSettleStatusBySettleNo(@Param("settleNo") String settleNo, @Param("payFlag") String payFlag);
EkpSocialViewVo selectSocialViewStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpSocialViewVo> selectSocialViewStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpSocialViewVo selectFundViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpSocialViewVo> selectFundViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpInsuranceViewVo selectFIncomelViewBySettleNo(@Param("settleNo") String settleNo);
List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(@Param("settleNo") String settleNo);
EkpInsuranceViewVo selectIncomeViewBySettleNo(@Param("settleNo") String settleNo);
List<EkpInsuranceViewVo> selectIncomeViewBySettleNo(@Param("settleNo") String settleNo);
EkpSocialViewVo selectSalarylViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
List<EkpSocialViewVo> selectSalarylViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
}
......@@ -7,6 +7,8 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import java.util.List;
/**
* @author zhaji
* @description TODO
......@@ -27,32 +29,32 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> {
* 根据结算单编号查询商险视图信息
*
*/
EkpInsuranceViewVo selectViewBySettleNo(String settleNo,String payFlag);
List<EkpInsuranceViewVo> selectViewBySettleNo(String settleNo, String payFlag);
/**
* 根据结算单编号查询社保视图信息
*
*/
EkpSocialViewVo selectSocialViewBySettleNo(String settleNo,String payFlag);
List<EkpSocialViewVo> selectSocialViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询公积金视图信息
*
*/
EkpSocialViewVo selectFundViewBySettleNo(String settleNo,String payFlag);
List<EkpSocialViewVo> selectFundViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询管理费视图信息
*
*/
EkpInsuranceViewVo selectIncomelViewBySettleNo(String settleNo);
List<EkpInsuranceViewVo> selectIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询风险金视图信息
*
*/
EkpInsuranceViewVo selectFIncomelViewBySettleNo(String settleNo);
List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询薪资视图信息
*
*/
EkpSocialViewVo selectSalarylViewBySettleNo(String settleNo,String payFlag);
List<EkpSocialViewVo> selectSalarylViewBySettleNo(String settleNo,String payFlag);
}
......@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
......@@ -31,32 +32,32 @@ public class EkpSettleServiceImpl implements EkpSettleService {
}
@Override
public EkpInsuranceViewVo selectViewBySettleNo(String settleNo,String payFlag) {
public List<EkpInsuranceViewVo> selectViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSettleStatusBySettleNo(settleNo,payFlag);
}
@Override
public EkpSocialViewVo selectSocialViewBySettleNo(String settleNo,String payFlag) {
public List<EkpSocialViewVo> selectSocialViewBySettleNo(String settleNo, String payFlag) {
return ekpSettleMapper.selectSocialViewStatusBySettleNo(settleNo,payFlag);
}
@Override
public EkpSocialViewVo selectFundViewBySettleNo(String settleNo,String payFlag) {
public List<EkpSocialViewVo> selectFundViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectFundViewBySettleNo(settleNo,payFlag);
}
@Override
public EkpInsuranceViewVo selectFIncomelViewBySettleNo(String settleNo) {
public List<EkpInsuranceViewVo> selectFIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectFIncomelViewBySettleNo(settleNo);
}
@Override
public EkpInsuranceViewVo selectIncomelViewBySettleNo(String settleNo) {
public List<EkpInsuranceViewVo> selectIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectIncomeViewBySettleNo(settleNo);
}
@Override
public EkpSocialViewVo selectSalarylViewBySettleNo(String settleNo,String payFlag) {
public List<EkpSocialViewVo> selectSalarylViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSalarylViewBySettleNo(settleNo,payFlag);
}
......
......@@ -6501,26 +6501,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpInsuranceViewVo viewVo;
List<EkpInsuranceViewVo> viewVoList;
TInsuranceDetail detail;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
viewVo = ekpSettleService.selectViewBySettleNo(vo.getSettleNo(),payFlag);
if (Common.isNotNull(viewVo)) {
//获取所有的明细id
detail = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(detail)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(vo.getPayFlag())) {
detail.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
}else {
detail.setPaySettleFlag(viewVo.getPaySettleFlag());
detail.setPayCollectFlag(viewVo.getPayCollectFlag());
viewVoList = ekpSettleService.selectViewBySettleNo(vo.getSettleNo(),vo.getPayFlag());
if (!viewVoList.isEmpty()) {
for (EkpInsuranceViewVo viewVo : viewVoList) {
//获取所有的明细id
detail = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(detail)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(vo.getPayFlag())) {
detail.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
detail.setPaySettleFlag(viewVo.getPaySettleFlag());
detail.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(detail);
}
baseMapper.updateById(detail);
}
}
}catch (Exception e) {
......@@ -6534,18 +6534,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpSocialViewVo viewVo;
List<EkpSocialViewVo> viewVo;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
if (CommonConstants.ZERO_STRING.equals(vo.getTypeFlag())) {
viewVo = ekpSettleService.selectSocialViewBySettleNo(vo.getSettleNo(),payFlag);
viewVo = ekpSettleService.selectSocialViewBySettleNo(vo.getSettleNo(),vo.getPayFlag());
} else {
viewVo = ekpSettleService.selectFundViewBySettleNo(vo.getSettleNo(),payFlag);
viewVo = ekpSettleService.selectFundViewBySettleNo(vo.getSettleNo(),vo.getPayFlag());
}
if (Common.isNotNull(viewVo)) {
viewVo.setPayFlag(vo.getPayFlag());
if (!viewVo.isEmpty()) {
viewVo.forEach(e ->{
e.setPayFlag(vo.getPayFlag());});
socialDaprUtils.updateSocialSettleStatus(viewVo);
}
}catch (Exception e) {
......@@ -6559,7 +6558,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpInsuranceViewVo viewVo;
List<EkpInsuranceViewVo> viewVo;
try {
//根据结算单号获取明细id和结算状态;判断是管理费还是风险金
if (CommonConstants.ZERO_STRING.equals(vo.getTypeFlag())) {
......@@ -6567,7 +6566,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else {
viewVo = ekpSettleService.selectFIncomelViewBySettleNo(vo.getSettleNo());
}
if (Common.isNotNull(viewVo)) {
if (!viewVo.isEmpty()) {
socialDaprUtils.updateIncomeSettleStatus(viewVo);
}
}catch (Exception e) {
......@@ -6582,14 +6581,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpSocialViewVo viewVo;
List<EkpSocialViewVo> viewVo;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
viewVo = ekpSettleService.selectSalarylViewBySettleNo(vo.getSettleNo(),payFlag);
if (Common.isNotNull(viewVo)) {
viewVo.setPayFlag(vo.getPayFlag());
viewVo = ekpSettleService.selectSalarylViewBySettleNo(vo.getSettleNo(),vo.getPayFlag());
if (!viewVo.isEmpty()) {
viewVo.forEach(e ->{
e.setPayFlag(vo.getPayFlag());});
salaryDaprUtil.updateSalarySettleStatus(viewVo);
}
}catch (Exception e) {
......
......@@ -301,7 +301,7 @@ public class TSalaryAccountController {
**/
@Inner
@PostMapping("/inner/updateSalarySettleStatus")
public void updateSalarySettleStatus(@RequestBody EkpSocialViewVo viewVo) {
public void updateSalarySettleStatus(@RequestBody List<EkpSocialViewVo> viewVo) {
tSalaryAccountService.updateSalarySettleStatus(viewVo);
}
}
......@@ -132,5 +132,5 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @Date: 2022/12/26 17:56
* @return: R
**/
void updateSalarySettleStatus(EkpSocialViewVo viewVo);
void updateSalarySettleStatus(List<EkpSocialViewVo> viewVo);
}
......@@ -235,18 +235,23 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
}
@Override
public void updateSalarySettleStatus(EkpSocialViewVo viewVo) {
//根据明细id更新结算状态
TSalaryAccount account = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(account)) {
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
account.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
account.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
account.setPaySettleFlag(viewVo.getPaySettleFlag());
account.setPayCollectFlag(viewVo.getPayCollectFlag());
public void updateSalarySettleStatus(List<EkpSocialViewVo> viewVoList) {
TSalaryAccount account;
if (!viewVoList.isEmpty()) {
for (EkpSocialViewVo viewVo: viewVoList) {
//根据明细id更新结算状态
account = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(account)) {
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
account.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
account.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
account.setPaySettleFlag(viewVo.getPaySettleFlag());
account.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(account);
}
}
baseMapper.updateById(account);
}
}
......
......@@ -27,7 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
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.service.TIncomeService;
......@@ -231,7 +231,7 @@ public class TIncomeController {
**/
@Inner
@PostMapping("/inner/updateIncomeSettleStatus")
public void updateSocialSettleStatus(@RequestBody EkpSocialViewVo viewVo) {
public void updateSocialSettleStatus(@RequestBody List<EkpInsuranceViewVo> viewVo) {
tIncomeService.updateIncomeSettleStatus(viewVo);
}
}
......@@ -456,7 +456,7 @@ public class TPaymentInfoController {
**/
@Inner
@PostMapping("/inner/updateSocialSettleStatus")
public void updateSocialSettleStatus(@RequestBody EkpSocialViewVo viewVo) {
public void updateSocialSettleStatus(@RequestBody List<EkpSocialViewVo> viewVo) {
tPaymentInfoService.updateSocialSettleStatus(viewVo);
}
}
......@@ -23,7 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
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.insurances.vo.EkpSocialViewVo;
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;
......@@ -98,6 +98,6 @@ public interface TIncomeService extends IService<TIncome> {
* @Date: 2022/12/26 17:56
* @return:
**/
void updateIncomeSettleStatus(EkpSocialViewVo viewVo);
void updateIncomeSettleStatus(List<EkpInsuranceViewVo> viewVo);
}
......@@ -169,6 +169,6 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
**/
R<String> changeDeptByEkp(ChangeDeptVo changeDeptVo);
void updateSocialSettleStatus(EkpSocialViewVo viewVo);
void updateSocialSettleStatus(List<EkpSocialViewVo> viewVo);
}
......@@ -34,7 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
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;
......@@ -802,13 +802,18 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
}
@Override
public void updateIncomeSettleStatus(EkpSocialViewVo viewVo) {
//根据明细id更新结算状态
TIncome income = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(income)) {
income.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
income.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
baseMapper.updateById(income);
public void updateIncomeSettleStatus(List<EkpInsuranceViewVo> viewVoList) {
if (!viewVoList.isEmpty()) {
TIncome income;
for (EkpInsuranceViewVo viewVo : viewVoList) {
//根据明细id更新结算状态
income = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(income)) {
income.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
income.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
baseMapper.updateById(income);
}
}
}
}
......
......@@ -3273,35 +3273,41 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
@Override
public void updateSocialSettleStatus(EkpSocialViewVo viewVo) {
//判断预估还是实缴
if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_THR)) {
//根据明细id更新结算状态
TPaymentInfo paymentInfo = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(paymentInfo)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
paymentInfo.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
paymentInfo.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
paymentInfo.setPaySettleFlag(viewVo.getPaySettleFlag());
paymentInfo.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(paymentInfo);
}
} else if(viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_ONE)){
//根据明细id更新结算状态
TForecastLibrary library = tForecastLibraryMapper.selectById(viewVo.getId());
if (Common.isNotNull(library)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
library.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
library.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
library.setPaySettleFlag(viewVo.getPaySettleFlag());
library.setPayCollectFlag(viewVo.getPayCollectFlag());
public void updateSocialSettleStatus(List<EkpSocialViewVo> viewVoList) {
if (!viewVoList.isEmpty()) {
TPaymentInfo paymentInfo;
TForecastLibrary library;
for (EkpSocialViewVo viewVo: viewVoList) {
//判断预估还是实缴
if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_THR)) {
//根据明细id更新结算状态
paymentInfo = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(paymentInfo)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
paymentInfo.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
paymentInfo.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
paymentInfo.setPaySettleFlag(viewVo.getPaySettleFlag());
paymentInfo.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(paymentInfo);
}
} else if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_ONE)) {
//根据明细id更新结算状态
library = tForecastLibraryMapper.selectById(viewVo.getId());
if (Common.isNotNull(library)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
library.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
library.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
library.setPaySettleFlag(viewVo.getPaySettleFlag());
library.setPayCollectFlag(viewVo.getPayCollectFlag());
}
tForecastLibraryMapper.updateById(library);
}
}
tForecastLibraryMapper.updateById(library);
}
}
}
......
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