Commit 8c656a17 authored by fangxinjiang's avatar fangxinjiang

Merge branch 'develop'

parents 6aa977d7 bf195c6c
package com.yifu.cloud.plus.v1.yifu.archives.vo; package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable; import java.io.Serializable;
......
...@@ -154,6 +154,11 @@ public interface CommonConstants { ...@@ -154,6 +154,11 @@ public interface CommonConstants {
*/ */
int ZERO_INT = 0; int ZERO_INT = 0;
/**
* number 5000
*/
int FIVES_INT = 5000;
/** /**
* number 1 * number 1
*/ */
......
...@@ -14,7 +14,7 @@ public class InsurancesConstants { ...@@ -14,7 +14,7 @@ public class InsurancesConstants {
/** /**
* 替换导出新增 * 替换导出新增
*/ */
public static final String ADD_ = "新增"; public static final String INSERT = "新增";
/** /**
* 离职 * 离职
*/ */
......
...@@ -7,7 +7,6 @@ import lombok.Data; ...@@ -7,7 +7,6 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* @author licancan * @author licancan
......
...@@ -938,7 +938,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -938,7 +938,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceExportListVO> list = new ArrayList<>(); List<InsuranceExportListVO> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(listVOS)){ if(CollectionUtils.isNotEmpty(listVOS)){
for (InsuranceExportListVO listVO : listVOS) { for (InsuranceExportListVO listVO : listVOS) {
listVO.setRemark(InsurancesConstants.ADD_); listVO.setRemark(InsurancesConstants.INSERT);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
...@@ -1127,7 +1127,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1127,7 +1127,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
try{ try{
updateInsuranceInfo(detail,settle); updateInsuranceInfo(detail,settle);
}catch (Exception e){ }catch (Exception e){
// todo 异常处理
log.error("收入数据同步处理失败:"+e); log.error("收入数据同步处理失败:"+e);
} }
...@@ -1332,8 +1331,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1332,8 +1331,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
successList.add(detail); successList.add(detail);
//生成收入数据
createInsuranceInfo(detail);
} }
} }
} }
...@@ -1612,6 +1609,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1612,6 +1609,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//可以改成批量更新 //可以改成批量更新
this.updateById(detail); this.updateById(detail);
detailList.add(detail); detailList.add(detail);
try {
if (detail.getBuyType() != CommonConstants.FOUR_INT) {
//生成收入数据
createInsuranceInfo(detail);
}
}catch (Exception e){
log.error("收入数据同步处理失败:"+e);
}
} }
} }
//操作记录 //操作记录
...@@ -3738,6 +3743,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3738,6 +3743,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
//更新项目编码 //更新项目编码
update(updateWrapper); update(updateWrapper);
//更换项目更新收入
TInsuranceDetail income = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
if (Common.isNotNull(income)) {
if (income.getBuyType() != CommonConstants.FOUR_INT) {
//判断是否存在当月的商险收入数据
TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(income.getId());
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& detailList.getData().getDetailList().size() > 0) {
//原项目生成红冲数据
for (TIncomeDetail detail : detailList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detail,detail1);
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detail.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
}
//新项目下生成收入数据
createInsuranceInfo(income);
}
}
}
//商险id //商险id
String insuranceDetailId = success.getId(); String insuranceDetailId = success.getId();
//旧结算信息id //旧结算信息id
...@@ -5938,8 +5967,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5938,8 +5967,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem() if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
.contains(CommonConstants.THREE_STRING)) { .contains(CommonConstants.THREE_STRING)) {
//预估模式 //预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
//预估模式只有按人次和人数收费 //预估模式只有按人次和人数收费
if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
isSum = 1; isSum = 1;
...@@ -5949,20 +5978,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5949,20 +5978,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee()); settleDomain.getManagementFee());
} }
}
} else {
BigDecimal gMoney = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
isSum = 2;
} else { } else {
gMoney = BigDecimalUtils.safeMultiply(insuranceDetail.getActualPremium(),settleDomain.getManagementFee()); BigDecimal gMoney = BigDecimal.ZERO;
} if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
if (!isExist || isSum ==2) { gMoney = settleDomain.getManagementFee();
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.ONE_STRING, } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney); gMoney = settleDomain.getManagementFee();
isSum = 2;
} else {
gMoney = BigDecimalUtils.safeMultiply(insuranceDetail.getActualPremium(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist || isSum == 2) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney);
}
} }
} }
} }
...@@ -5988,7 +6019,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5988,7 +6019,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
isSum = 4; isSum = 4;
} else { } else {
money = BigDecimalUtils.safeMultiply(insuranceDetail.getActualPremium(), settleDomain.getRiskFundFee()); money = BigDecimalUtils.safeMultiply(insuranceDetail.getActualPremium(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist || isSum == 4) { if (!isExist || isSum == 4) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING,
......
...@@ -4,19 +4,34 @@ spring: ...@@ -4,19 +4,34 @@ spring:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
config: config:
activate: activate:
on-profile: dev on-profile: test
redis: redis:
host: 127.0.0.1 host: 192.168.1.65
port: 6379 port: 22379
password: password: '@yf_2017'
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource insurances:
driver-class-name: com.mysql.cj.jdbc.Driver type: com.zaxxer.hikari.HikariDataSource
username: root driver-class-name: com.mysql.cj.jdbc.Driver
password: yf_zsk username: root
url: jdbc:mysql://192.168.1.65:22306/mvp_insurances?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true password: yf_zsk
jdbc-url: jdbc:mysql://192.168.1.65:22306/mvp_insurances?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
ekp:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread
password: 123456
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
ekp:
url: http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
fdModelId: '181d73279372e5a55438a47d7436ab7e'
fdFlowId: '18267f206233f29cbd3c5ee425c9408a'
docStatus: '20'
LoginName: 'admin'
docSubject : '接口发起流程'
\ No newline at end of file
...@@ -91,10 +91,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -91,10 +91,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}else { }else {
list = baseMapper.getOrderList(param,user.getUsername()); list = baseMapper.getOrderList(param,user.getUsername());
} }
if (CollectionUtils.isNotEmpty(list)){ if (CollectionUtils.isNotEmpty(list) && list.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
if(list.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){ return R.failed(OrderConstants.EXPORT_TOO_LONG);
return R.failed(OrderConstants.EXPORT_TOO_LONG);
}
} }
return R.ok(list); return R.ok(list);
} }
......
...@@ -19,5 +19,6 @@ public class SocialConstants { ...@@ -19,5 +19,6 @@ public class SocialConstants {
public static final String BIR = "生育"; public static final String BIR = "生育";
public static final String GS = "工伤"; public static final String GS = "工伤";
public static final String YB = "医保"; public static final String YB = "医保";
public static final String YEAR_1970 = "1970-02";
} }
...@@ -287,14 +287,4 @@ public class TForecastLibraryController { ...@@ -287,14 +287,4 @@ public class TForecastLibraryController {
public void createForecastFundInfo() { public void createForecastFundInfo() {
tForecastLibraryService.createForecastFundInfo(); tForecastLibraryService.createForecastFundInfo();
} }
@PostMapping("/createFundInfo")
public void createFundInfo() {
tForecastLibraryService.createForecastFundInfo();
}
@PostMapping("/createSocialInfo")
public void createSocialInfo() {
tForecastLibraryService.createForecastInfo();
}
} }
...@@ -341,16 +341,6 @@ public class TPaymentInfoController { ...@@ -341,16 +341,6 @@ public class TPaymentInfoController {
tPaymentInfoService.createPaymentFundInfo(); tPaymentInfoService.createPaymentFundInfo();
} }
@PostMapping("/createFundInfo")
public void createFundInfo() {
tPaymentInfoService.createPaymentFundInfo();
}
@PostMapping("/createSocialInfo")
public void createSocialInfo() {
tPaymentInfoService.createPaymentSocialInfo();
}
/** /**
* @Description: 定时生成缴费库的收入数据 * @Description: 定时生成缴费库的收入数据
* @Author: huyc * @Author: huyc
......
...@@ -55,4 +55,6 @@ public interface TIncomeMapper extends BaseMapper<TIncome> { ...@@ -55,4 +55,6 @@ public interface TIncomeMapper extends BaseMapper<TIncome> {
List<TIncome> getTIncomeList(@Param("tIncome") TIncome tIncome); List<TIncome> getTIncomeList(@Param("tIncome") TIncome tIncome);
void updateIncomeById(@Param("list") List<TIncome> list);
} }
...@@ -4052,27 +4052,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4052,27 +4052,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem() if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
.contains(CommonConstants.TWO_STRING)) { .contains(CommonConstants.TWO_STRING)) {
//预估模式 //预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
//预估模式只有按人次和人数收费 //预估模式只有按人次和人数收费
if (!isExist) { if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee()); settleDomain.getManagementFee());
} }
}
} else {
BigDecimal gMoney = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),settleDomain.getManagementFee()); BigDecimal gMoney = BigDecimal.ZERO;
} if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
if (!isExist) { gMoney = settleDomain.getManagementFee();
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney); gMoney = settleDomain.getManagementFee();
} else {
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney);
}
} }
} }
} }
...@@ -4094,7 +4096,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4094,7 +4096,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else { } else {
money = BigDecimalUtils.safeMultiply(library.getSumAll(), settleDomain.getRiskFundFee()); money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
......
...@@ -50,11 +50,13 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper; ...@@ -50,11 +50,13 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService; import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService; import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService; import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil; import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -92,6 +94,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -92,6 +94,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private final ArchivesDaprUtil archivesDaprUtil; private final ArchivesDaprUtil archivesDaprUtil;
private final TSendEkpErrorService tSendEkpErrorService;
/** /**
* 预估费用简单分页查询 * 预估费用简单分页查询
* *
...@@ -328,6 +332,31 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -328,6 +332,31 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true; isSaveAndUpdate = true;
} }
} }
//生成社保收入
TSocialFundInfo socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold()));
if (Common.isNotNull(socialFundInfo)) {
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//办理成功生成收入
createIncomeInfo(library);
}
}
//生成公积金收入
TSocialFundInfo socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold()));
if (Common.isNotNull(socialFundInfoF)) {
if (Common.isNotNull(socialFundInfoF.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus())) {
//办理成功生成收入
createIncomeInfo(library);
}
}
} }
if (isSaveAndUpdate) { if (isSaveAndUpdate) {
return R.ok(null, "执行成功!"); return R.ok(null, "执行成功!");
...@@ -2154,17 +2183,23 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2154,17 +2183,23 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true; isSaveAndUpdate = true;
} }
if (Common.isNotNull(socialFundInfo.getSocialId()) if ((Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) { || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))
|| (Common.isNotNull(socialFundInfo.getFundId())
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus()))) {
//获取所有的预估数据 //获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null; List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard) .eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain()) .eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getSocialPayMonth, payMonthList)); .and(obj -> obj
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.or()
.in(TForecastLibrary::getProvidentPayMonth, payMonthList))
);
if (Common.isNotNull(librarySocialInfoList)) { if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library : librarySocialInfoList) { for (TForecastLibrary library : librarySocialInfoList) {
//办理成功生成收入 //办理成功生成收入
...@@ -2234,11 +2269,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2234,11 +2269,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)); .eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT));
if (Common.isNotNull(unPushInfo)) { if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送 //推送数据封装并推送
List<String> pushList = initEkpPushSocialParam(unPushInfo); initEkpPushSocialParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
} }
...@@ -2250,16 +2281,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2250,16 +2281,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)); .eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT));
if (Common.isNotNull(unPushInfo)) { if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送 //推送数据封装并推送
List<String> pushList = initEkpPushFundParam(unPushInfo); initEkpPushFundParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
} }
public List<String> initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) { public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2481,16 +2509,62 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2481,16 +2509,62 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
socialParam.setFd_3b0afbe1f94a08(library.getId()); socialParam.setFd_3b0afbe1f94a08(library.getId());
String body = ekpSocialUtil.sendToEKP(socialParam); String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isNotNull(body)) { if (Common.isNotNull(body) && body.length() == 32) {
//更新推送状态为已推送的列表 //更新推送状态为已推送的列表
pushList.add(library.getId()); pushList.add(library.getId());
if (pushList.size() >= CommonConstants.FIVES_INT) {
baseMapper.updatePushStatus(pushList);
pushList.clear();
}
}else {
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
} }
} }
return pushList; //更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
public List<String> initEkpPushFundParam(List<TForecastLibrary> unPushInfo) { public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2608,12 +2682,57 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2608,12 +2682,57 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
fundParam.setFd_3b0afbaf10df2c(library.getId()); fundParam.setFd_3b0afbaf10df2c(library.getId());
String body = ekpFundUtil.sendToEKP(fundParam); String body = ekpFundUtil.sendToEKP(fundParam);
if (Common.isNotNull(body)) { if (Common.isNotNull(body) && body.length() == 32) {
//更新推送状态为已推送的列表 //更新推送状态为已推送的列表
pushList.add(library.getId()); pushList.add(library.getId());
if (pushList.size() >= CommonConstants.FIVES_INT) {
baseMapper.updatePushStatus(pushList);
pushList.clear();
}
}else {
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
} }
} }
return pushList; //更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
public void createIncomeInfo(TForecastLibrary library) { public void createIncomeInfo(TForecastLibrary library) {
...@@ -2667,27 +2786,29 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2667,27 +2786,29 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING) && CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(sourceType)))) { && CommonConstants.TWO_STRING.equals(sourceType)))) {
//预估模式 //预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (!isExist) { if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee(), sourceType); settleDomain.getManagementFee(), sourceType);
} }
}
} else {
BigDecimal gMoney;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(), settleDomain.getManagementFee()); BigDecimal gMoney;
} if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
if (!isExist) { gMoney = settleDomain.getManagementFee();
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING, } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), gMoney = settleDomain.getManagementFee();
gMoney, sourceType); } else {
gMoney = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
}
if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, sourceType);
}
} }
} }
} }
...@@ -2710,7 +2831,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2710,7 +2831,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) { } else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else { } else {
money = BigDecimalUtils.safeMultiply(library.getSumAll(), settleDomain.getRiskFundFee()); money = BigDecimalUtils.safeMultiply(library.getSumAll(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} }
if (!isExist) { if (!isExist) {
createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(library, settleDomain, CommonConstants.TWO_STRING,
......
...@@ -33,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*; ...@@ -33,6 +33,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.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;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError; import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
...@@ -279,6 +280,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -279,6 +280,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda() List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING));
String sendBack; String sendBack;
Map<String,Integer> map = new HashMap<>();
//收入更新
List<TIncome> updateList = new ArrayList<>();
for (TIncome income : list) { for (TIncome income : list) {
sendBack = this.getSendBack(income); sendBack = this.getSendBack(income);
income.setSendTime(new Date()); income.setSendTime(new Date());
...@@ -286,9 +290,52 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -286,9 +290,52 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ONE_STRING); income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0)); income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack); income.setEkpId(sendBack);
updateList.add(income);
if (updateList.size() >= CommonConstants.FIVES_INT) {
baseMapper.updateIncomeById(updateList);
updateList.clear();
}
} else {
if (map.get(sendBack) > 0) {
int i = map.get(sendBack) + 1;
map.put(sendBack,i);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updateIncomeById(updateList);
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(sendBack,1);
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
} }
this.updateById(income);
} }
baseMapper.updateIncomeById(updateList);
} }
/** /**
...@@ -384,14 +431,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -384,14 +431,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard()); sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard());
// 生成月份 // 生成月份
if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) { if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) {
sendParam.setFd_3ae0c23b2e9a92("1970-02"); sendParam.setFd_3ae0c23b2e9a92(SocialConstants.YEAR_1970);
} else { } else {
sendParam.setFd_3ae0c23b2e9a92(income.getCreateMonth().substring(0, 4) sendParam.setFd_3ae0c23b2e9a92(income.getCreateMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6)); + CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6));
} }
// 结算月份 // 结算月份
if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) { if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) {
sendParam.setFd_3ae0c23cb3fccc("1970-02"); sendParam.setFd_3ae0c23cb3fccc(SocialConstants.YEAR_1970);
} else { } else {
sendParam.setFd_3ae0c23cb3fccc(income.getPayMonth().substring(0, 4) sendParam.setFd_3ae0c23cb3fccc(income.getPayMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6)); + CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6));
...@@ -445,14 +492,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -445,14 +492,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard()); sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard());
// 生成月份 // 生成月份
if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) { if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) {
sendParam.setFd_3ae0c3032cffc8("1970-02"); sendParam.setFd_3ae0c3032cffc8(SocialConstants.YEAR_1970);
} else { } else {
sendParam.setFd_3ae0c3032cffc8(income.getCreateMonth().substring(0, 4) sendParam.setFd_3ae0c3032cffc8(income.getCreateMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6)); + CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6));
} }
// 结算月份 // 结算月份
if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) { if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) {
sendParam.setFd_3ae0c3044e5958("1970-02"); sendParam.setFd_3ae0c3044e5958(SocialConstants.YEAR_1970);
} else { } else {
sendParam.setFd_3ae0c3044e5958(income.getPayMonth().substring(0, 4) sendParam.setFd_3ae0c3044e5958(income.getPayMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6)); + CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6));
...@@ -630,14 +677,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -630,14 +677,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()); + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer maxNum = incomeMap.get(month + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType()); Integer maxNum = incomeMap.get(month + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 当明细的次数大于总次数,才可以新增统计 // 当明细的次数大于总次数,才可以新增统计
if (Common.isEmpty(maxNum) || nums >= maxNum) { if (Common.isEmpty(maxNum) || ifNullToZero(nums) >= maxNum) {
return this.saveIncome(tIncomeDetail); return this.saveIncome(tIncomeDetail);
} }
} else { } else {
// 红冲判断:当本类型是最大值,才可以红冲 // 红冲判断:当本类型是最大值,才可以红冲
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail); if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
} }
return false; return true;
} }
......
...@@ -55,6 +55,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.*; ...@@ -55,6 +55,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService; import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
...@@ -125,6 +126,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -125,6 +126,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired @Autowired
private ArchivesDaprUtil archivesDaprUtil; private ArchivesDaprUtil archivesDaprUtil;
@Autowired
private TSendEkpErrorService tSendEkpErrorService;
/** /**
* 缴费库简单分页查询 * 缴费库简单分页查询
* *
...@@ -2228,11 +2232,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2228,11 +2232,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(unPushInfo)) { if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送 //推送数据封装并推送
List<String> pushList = initEkpPushSocialParam(unPushInfo); initEkpPushSocialParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
} }
...@@ -2244,11 +2244,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2244,11 +2244,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.isNotNull(TPaymentInfo::getFundId)); .isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(unPushInfo)) { if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送 //推送数据封装并推送
List<String> pushList = initEkpPushFundParam(unPushInfo); initEkpPushFundParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
} }
...@@ -2257,7 +2253,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2257,7 +2253,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimal sumSocial = BigDecimal.ZERO; BigDecimal sumSocial = BigDecimal.ZERO;
//判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入 //判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入
List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.lt(TPaymentInfo::getCreateTime, LocalDateTimeUtils.getDayStart(LocalDateTime.now())) .between(TPaymentInfo::getCreateTime,LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)),
LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
for (TPaymentInfo paymentInfo: sumList) { for (TPaymentInfo paymentInfo: sumList) {
...@@ -2282,7 +2279,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2282,7 +2279,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override @Override
public void createPaymentFundIncome() { public void createPaymentFundIncome() {
List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.lt(TPaymentInfo::getCreateTime, LocalDateTimeUtils.getDayStart(LocalDateTime.now())) .between(TPaymentInfo::getCreateTime,LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)),
LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getFundId)); .isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
for (TPaymentInfo paymentInfo: sumList) { for (TPaymentInfo paymentInfo: sumList) {
...@@ -2303,8 +2301,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2303,8 +2301,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return paymentVo; return paymentVo;
} }
public List<String> initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library:unPushInfo) {
//获取项目信息 //获取项目信息
...@@ -2533,16 +2532,62 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2533,16 +2532,62 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
socialParam.setFd_3b0afbe1f94a08(library.getId()); socialParam.setFd_3b0afbe1f94a08(library.getId());
String body = ekpSocialUtil.sendToEKP(socialParam); String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isNotNull(body)) { if (Common.isNotNull(body) && body.length() == 32) {
//更新推送状态为已推送的列表 //更新推送状态为已推送的列表
pushList.add(library.getId()); pushList.add(library.getId());
if (pushList.size() >= CommonConstants.FIVES_INT) {
baseMapper.updatePushStatus(pushList);
pushList.clear();
}
}else {
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
} }
} }
return pushList; //更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
public List<String> initEkpPushFundParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushFundParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>();
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library:unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2662,12 +2707,57 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2662,12 +2707,57 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
fundParam.setFd_3b0afbaf10df2c(library.getId()); fundParam.setFd_3b0afbaf10df2c(library.getId());
String body = ekpFundUtil.sendToEKP(fundParam); String body = ekpFundUtil.sendToEKP(fundParam);
if (Common.isNotNull(body)) { if (Common.isNotNull(body) && body.length() == 32) {
//更新推送状态为已推送的列表 //更新推送状态为已推送的列表
pushList.add(library.getId()); pushList.add(library.getId());
if (pushList.size() >= CommonConstants.FIVES_INT) {
baseMapper.updatePushStatus(pushList);
pushList.clear();
}
}else {
if (map.get(body) > 0) {
int i = map.get(body) + 1;
map.put(body,i);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updatePushStatus(pushList);
for (String key: map.keySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(key);
error.setNums(map.get(key));
tSendEkpErrorService.saveError(error);
}
break;
}
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(i);
tSendEkpErrorService.saveError(error);
} else {
map.put(body,1);
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.THREE_STRING);
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(1);
tSendEkpErrorService.saveError(error);
}
} }
} }
return pushList; //更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
} }
public void createIncomeInfo(TPaymentInfo paymentInfo,String socialFundFlag) { public void createIncomeInfo(TPaymentInfo paymentInfo,String socialFundFlag) {
...@@ -2717,32 +2807,36 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2717,32 +2807,36 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING) && CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag)))) { && CommonConstants.TWO_STRING.equals(socialFundFlag)))) {
//预估模式 //预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
//预估模式只有按人次和人数收费 //预估模式只有按人次和人数收费
if (!exitFlag) { if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING, createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(), settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
settleDomain.getManagementFee(), socialFundFlag); settleDomain.getManagementFee(), socialFundFlag);
} }
}
} else {
BigDecimal gMoney = BigDecimal.ZERO;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) { BigDecimal gMoney = BigDecimal.ZERO;
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), settleDomain.getManagementFee()); if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else { } else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), settleDomain.getManagementFee()); if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
}
}
if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag);
} }
}
if (!exitFlag) {
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag);
} }
} }
} }
...@@ -2766,9 +2860,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2766,9 +2860,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
money = settleDomain.getRiskFundFee(); money = settleDomain.getRiskFundFee();
} else { } else {
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) { if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(), settleDomain.getRiskFundFee()); money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} else { } else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(), settleDomain.getRiskFundFee()); money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.THREE_INT, BigDecimal.ROUND_HALF_UP));
} }
} }
if (!exitFlag) { if (!exitFlag) {
......
...@@ -51,7 +51,10 @@ public class TSendEkpErrorServiceImpl extends ServiceImpl<TSendEkpErrorMapper, T ...@@ -51,7 +51,10 @@ public class TSendEkpErrorServiceImpl extends ServiceImpl<TSendEkpErrorMapper, T
if (error == null) { if (error == null) {
return this.save(tSendEkpError); return this.save(tSendEkpError);
} else { } else {
error.setNums(error.getNums()+ CommonConstants.ONE_INT); if (Common.isEmpty(tSendEkpError.getNums())) {
tSendEkpError.setNums(CommonConstants.ONE_INT);
}
error.setNums(error.getNums() + tSendEkpError.getNums());
return this.updateById(error); return this.updateById(error);
} }
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<result property="sendStatus" column="SEND_STATUS"/> <result property="sendStatus" column="SEND_STATUS"/>
<result property="sendTime" column="SEND_TIME"/> <result property="sendTime" column="SEND_TIME"/>
<result property="sendMonth" column="SEND_MONTH"/> <result property="sendMonth" column="SEND_MONTH"/>
<result property="ekpId" column="EKP_ID"/>
</resultMap> </resultMap>
<resultMap id="incomeExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo"> <resultMap id="incomeExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo">
<result property="empName" column="EMP_NAME"/> <result property="empName" column="EMP_NAME"/>
...@@ -230,4 +231,42 @@ ...@@ -230,4 +231,42 @@
and <![CDATA[sql]]> and <![CDATA[sql]]>
</if> </if>
</sql> </sql>
<update id="updateIncomeById" parameterType="java.util.List">
update t_income
<trim prefix="set" suffixOverrides=",">
<trim prefix="SEND_STATUS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.sendStatus!=null">
when ID=#{i.id} then #{i.sendStatus}
</if>
</foreach>
</trim>
<trim prefix="SEND_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.sendTime!=null">
when ID=#{i.id} then #{i.sendTime}
</if>
</foreach>
</trim>
<trim prefix="SEND_MONTH =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.sendMonth!=null">
when ID=#{i.id} then #{i.sendMonth}
</if>
</foreach>
</trim>
<trim prefix="EKP_ID =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.ekpId!=null">
when ID=#{i.id} then #{i.ekpId}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
ID=#{i.id}
</foreach>
</update>
</mapper> </mapper>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<select id="getByTitleTypeDay" resultMap="tSendEkpErrorMap"> <select id="getByTitleTypeDay" resultMap="tSendEkpErrorMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_provident_fund a FROM t_send_ekp_error a
<where> <where>
1=1 1=1
<include refid="tSendEkpError_where"/> <include refid="tSendEkpError_where"/>
......
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