Commit 273d749e authored by huyuchen's avatar huyuchen

结算状态同步

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