Commit d6265406 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/fxj-dev' into fxj-dev

parents 822d5d3c efeb0380
...@@ -5,9 +5,7 @@ import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; ...@@ -5,9 +5,7 @@ import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
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.common.dapr.config.DaprEkpProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprEkpProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.*;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import lombok.extern.log4j.Log4j2; 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;
...@@ -59,4 +57,49 @@ public class EkpDaprUtils { ...@@ -59,4 +57,49 @@ public class EkpDaprUtils {
public R<Boolean> pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList) { public R<Boolean> pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpSalaryPush/inner/pushSalaryInfoToEkp", JSON.toJSONString(unPushList), Boolean.class, SecurityConstants.FROM_IN); return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpSalaryPush/inner/pushSalaryInfoToEkp", JSON.toJSONString(unPushList), Boolean.class, SecurityConstants.FROM_IN);
} }
/**
* @Author huyc
* @Description 新增管理费明细数据
* @Date 9:23 2024/03/14
* @Param
* @return
**/
public R<String> pushManagerInfoToEkp(EkpIncomeParamManage incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/pushManangerInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 新增管理费明细数据
* @Date 9:23 2024/03/14
* @Param
* @return
**/
public R<EkpSocialPushInfoVo> jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/jobPushManagerInfoToEkp", JSON.toJSONString(incomeParam), EkpSocialPushInfoVo.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 新增风险金明细数据
* @Date 11:15 2024/03/18
* @Param
* @return
**/
public R<String> pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/pushRiskInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 新增风险金明细数据
* @Date 11:15 2024/03/18
* @Param
* @return
**/
public R<EkpSocialPushInfoVo> jobpushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/jobPushRiskInfoToEkp", JSON.toJSONString(incomeParam), EkpSocialPushInfoVo.class, SecurityConstants.FROM_IN);
}
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author huyc
* @date 2024-03-13 16:14:37
*/
@Data
@TableName("ekp_manager_info")
@EqualsAndHashCode()
@Schema(description = "管理费明细表")
public class EkpManagerInfo {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private String fdId;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String fd_3adfef5e5b9d34;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String fd_3adfef5eb6691c;
/**
* 单号
*/
@Schema(description = "单号")
private String fd_3adfef7f5d2b52;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String fd_3adfef80202ab2;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String fd_3adfef7fc1c886;
/**
* 类型
*/
@Schema(description = "类型")
private String fd_3adda3037e3bda;
/**
* 产生来源
*/
@Schema(description = "产生来源")
private String fd_3adda320daef5a;
/**
* 姓名
*/
@Schema(description = "姓名")
private String fd_3adfef948da848;
/**
* 身份证号
*/
@Schema(description = "身份证号")
private String fd_3adfef94dcdbb4;
/**
* 管理费金额
*/
@Schema(description = "管理费金额")
private Double fd_3adfef963bae28;
/**
* 应收
*/
@Schema(description = "应收")
private Double fd_3adfefa3daae72;
/**
* 结算状态
*/
@Schema(description = "结算状态")
private String fd_3adfefaaa3bbd0;
/**
* 收款状态
*/
@Schema(description = "收款状态")
private String fd_3adfefaaef583e;
/**
* 实际结算月份
*/
@Schema(description = "实际结算月份")
private String fd_3ae0c23cb3fccc;
/**
* 生成月份
*/
@Schema(description = "生成月份")
private String fd_3ae0c23b2e9a92;
/**
* 结算单号
*/
@Schema(description = "结算单号")
private String fd_3aead3c68b1078;
/**
* 收款单号
*/
@Schema(description = "收款单号")
private String fd_3aeae58b14691c;
/**
* 数据来源
*/
@Schema(description = "数据来源")
private String fd_3b0b7231bb5896;
/**
* 是否全部结算
*/
@Schema(description = "是否全部结算")
private String fd_3b13b15f5b63fa;
/**
* 管理费ID
*/
@Schema(description = "管理费ID")
private String fd_3b13dc864a3052;
/**
* HRO结算月
*/
@Schema(description = "HRO结算月")
private String fd_3b13dd215b55b2;
/**
* 项目台账ID(ID)
*/
@Schema(description = "项目台账ID(ID)")
private String fd_3b16e47cb6874c;
/**
* 项目台账ID
*/
@Schema(description = "项目台账ID")
private String fd_3b16e47cb6874c_text;
/**
* 薪酬申请编号
*/
@Schema(description = "薪酬申请编号")
private String fd_3b3bf110837a96;
/**
* 变更记录
*/
@Schema(description = "变更记录")
private String fd_3b3e43a10ab4b2;
@Schema(description = "创建时间")
private Date createTime;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.ekp.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author huyc
* @date 2024-03-13 16:14:37
*/
@Data
@TableName("ekp_risk_info")
@EqualsAndHashCode()
@Schema(description = "风险金明细表")
public class EkpRiskInfo {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private String fdId;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String fd_3adfef5e5b9d34;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String fd_3adfef5eb6691c;
/**
* 单号
*/
@Schema(description = "单号")
private String fd_3adfef7f5d2b52;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String fd_3adfef80202ab2;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String fd_3adfef7fc1c886;
/**
* 类型
*/
@Schema(description = "类型")
private String fd_3adda3037e3bda;
/**
* 产生来源
*/
@Schema(description = "产生来源")
private String fd_3adda320daef5a;
/**
* 姓名
*/
@Schema(description = "姓名")
private String fd_3adfef948da848;
/**
* 身份证号
*/
@Schema(description = "身份证号")
private String fd_3adfef94dcdbb4;
/**
* 风险金金额
*/
@Schema(description = "风险金金额")
private Double fd_3adfef963bae28;
/**
* 应收
*/
@Schema(description = "应收")
private Double fd_3adfefa3daae72;
/**
* 结算状态
*/
@Schema(description = "结算状态")
private String fd_3adfefaaa3bbd0;
/**
* 收款状态
*/
@Schema(description = "收款状态")
private String fd_3adfefaaef583e;
/**
* 生成月份
*/
@Schema(description = "生成月份")
private String fd_3ae0c3032cffc8;
/**
* 实际结算月份
*/
@Schema(description = "实际结算月份")
private String fd_3ae0c3044e5958;
/**
* 结算单号
*/
@Schema(description = "结算单号")
private String fd_3aead7204bb594;
/**
* 收款单号
*/
@Schema(description = "收款单号")
private String fd_3aeae59b70fe5a;
/**
* 数据来源
*/
@Schema(description = "数据来源")
private String fd_3b0b7210ce9432;
/**
* 是否全部结算
*/
@Schema(description = "是否全部结算")
private String fd_3b13b218b76a36;
/**
* HRO结算月份
*/
@Schema(description = "HRO结算月份")
private String fd_3b13b2093b95ec;
/**
* 风险金ID
*/
@Schema(description = "风险金ID")
private String fd_3b13db120a8224;
/**
* 项目台账ID
*/
@Schema(description = "项目台账ID")
private String fd_3b16e4cd2c9a86_text;
/**
* 项目台账ID(ID)
*/
@Schema(description = "项目台账ID(ID)")
private String fd_3b16e4cd2c9a86;
/**
* 薪酬申请编号
*/
@Schema(description = "薪酬申请编号")
private String fd_3b3bf0c3198840;
/**
* 变更记录
*/
@Schema(description = "变更记录")
private String fd_3b3e4252b16714;
@Schema(description = "创建时间")
private Date createTime;
}
package com.yifu.cloud.plus.v1.ekp.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author huyc
* @Date 2024/3/15
* @Description 社保明细更新相关参数
* @Version 1.0
*/
@Data
public class EkpSocialStatusUpdateVo implements Serializable {
/**
* 社保明细
**/
private List<Object> param;
/**
* 更新sql
**/
private String updateSql;
}
...@@ -80,16 +80,16 @@ ...@@ -80,16 +80,16 @@
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.apache.shardingsphere</groupId> <!-- <groupId>org.apache.shardingsphere</groupId>-->
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId> <!-- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<version>5.1.2</version> <!-- <version>5.1.2</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.apache.shardingsphere</groupId> <!-- <groupId>org.apache.shardingsphere</groupId>-->
<artifactId>sharding-transaction-base-seata-at</artifactId> <!-- <artifactId>sharding-transaction-base-seata-at</artifactId>-->
<version>4.1.1</version> <!-- <version>4.1.1</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.yifu.cloud.plus.v1</groupId> <groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId> <artifactId>yifu-common-core</artifactId>
......
package com.yifu.cloud.plus.v1.ekp.config; //package com.yifu.cloud.plus.v1.ekp.config;
//
import com.google.common.collect.Range; //import com.google.common.collect.Range;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; //import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue; //import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue; //import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm; //import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import java.time.format.DateTimeFormatter; //import java.time.format.DateTimeFormatter;
import java.util.*; //import java.util.*;
//
@Component //@Component
public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<String> { //public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<String> {
//
private static final DateTimeFormatter yyyy = DateTimeFormatter.ofPattern("yyyy"); // private static final DateTimeFormatter yyyy = DateTimeFormatter.ofPattern("yyyy");
//
/** // /**
* 数据插入 // * 数据插入
* @param collection // * @param collection
* @param preciseShardingValue // * @param preciseShardingValue
* @Author hyc // * @Author hyc
* @Date 2022-07-21 // * @Date 2022-07-21
* @return // * @return
*/ // */
@Override // @Override
public String doSharding(Collection<String> collection, PreciseShardingValue<String> preciseShardingValue) { // public String doSharding(Collection<String> collection, PreciseShardingValue<String> preciseShardingValue) {
//
String value = preciseShardingValue.getValue(); // String value = preciseShardingValue.getValue();
String tableSuffix = value.substring(0,4); // String tableSuffix = value.substring(0,4);
String logicTableName = preciseShardingValue.getLogicTableName(); // String logicTableName = preciseShardingValue.getLogicTableName();
String table = logicTableName.concat("_").concat(tableSuffix); // String table = logicTableName.concat("_").concat(tableSuffix);
return collection.stream().filter(s -> s.equals(table)).findFirst().orElseThrow(() -> new RuntimeException("逻辑分表不存在")); // return collection.stream().filter(s -> s.equals(table)).findFirst().orElseThrow(() -> new RuntimeException("逻辑分表不存在"));
} // }
//
/** // /**
* 【范围】数据查询 // * 【范围】数据查询
* @param collection // * @param collection
* @param rangeShardingValue // * @param rangeShardingValue
* @Author hyc // * @Author hyc
* @Date 2022-07-21 // * @Date 2022-07-21
* @return // * @return
*/ // */
@Override // @Override
public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<String> rangeShardingValue) { // public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<String> rangeShardingValue) {
// 逻辑表名 // // 逻辑表名
String logicTableName = rangeShardingValue.getLogicTableName(); // String logicTableName = rangeShardingValue.getLogicTableName();
//
// 范围参数 // // 范围参数
Range<String> valueRange = rangeShardingValue.getValueRange(); // Range<String> valueRange = rangeShardingValue.getValueRange();
Set<String> queryRangeTables = extracted(logicTableName, valueRange.lowerEndpoint(), valueRange.upperEndpoint()); // Set<String> queryRangeTables = extracted(logicTableName, valueRange.lowerEndpoint(), valueRange.upperEndpoint());
ArrayList<String> tables = new ArrayList<>(collection); // ArrayList<String> tables = new ArrayList<>(collection);
tables.retainAll(queryRangeTables); // tables.retainAll(queryRangeTables);
return tables; // return tables;
} // }
//
/** // /**
* 根据范围计算表名 // * 根据范围计算表名
* @param logicTableName 逻辑表明 // * @param logicTableName 逻辑表明
* @param lowerEndpoint 范围起点 // * @param lowerEndpoint 范围起点
* @param upperEndpoint 范围终端 // * @param upperEndpoint 范围终端
* @Author hyc // * @Author hyc
* @Date 2022-07-21 // * @Date 2022-07-21
* @return 物理表名集合 // * @return 物理表名集合
*/ // */
private Set<String> extracted(String logicTableName, String lowerEndpoint, String upperEndpoint) { // private Set<String> extracted(String logicTableName, String lowerEndpoint, String upperEndpoint) {
Set<String> rangeTable = new HashSet<>(); // Set<String> rangeTable = new HashSet<>();
while (DateUtil.stringToDate(lowerEndpoint + "01").before(DateUtil.stringToDate(upperEndpoint + "01"))) { // while (DateUtil.stringToDate(lowerEndpoint + "01").before(DateUtil.stringToDate(upperEndpoint + "01"))) {
String str = getTableNameByDate(lowerEndpoint, logicTableName); // String str = getTableNameByDate(lowerEndpoint, logicTableName);
rangeTable.add(str); // rangeTable.add(str);
lowerEndpoint = DateUtil.dateToString(DateUtil.dateIncreaseByYear(DateUtil.stringToDate(lowerEndpoint + "01"),1),DateUtil.DATETIME_YYYYMM); // lowerEndpoint = DateUtil.dateToString(DateUtil.dateIncreaseByYear(DateUtil.stringToDate(lowerEndpoint + "01"),1),DateUtil.DATETIME_YYYYMM);
} // }
// 获取物理表明 // // 获取物理表明
String tableName = getTableNameByDate(upperEndpoint, logicTableName); // String tableName = getTableNameByDate(upperEndpoint, logicTableName);
rangeTable.add(tableName); // rangeTable.add(tableName);
return rangeTable; // return rangeTable;
} // }
//
/** // /**
* 根据日期获取表明 // * 根据日期获取表明
* @param dateTime 日期 // * @param dateTime 日期
* @param logicTableName 逻辑表名 // * @param logicTableName 逻辑表名
* @Author hyc // * @Author hyc
* @Date 2022-07-21 // * @Date 2022-07-21
* @return 物理表名 // * @return 物理表名
*/ // */
private String getTableNameByDate(String dateTime, String logicTableName) { // private String getTableNameByDate(String dateTime, String logicTableName) {
String tableSuffix = dateTime.substring(0,4); // String tableSuffix = dateTime.substring(0,4);
return logicTableName.concat("_").concat(tableSuffix); // return logicTableName.concat("_").concat(tableSuffix);
} // }
//
@Override // @Override
public Properties getProps() { // public Properties getProps() {
return null; // return null;
} // }
//
@Override // @Override
public void init(Properties properties) { // public void init(Properties properties) {
//
} // }
} //}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/ekpmanagerinfo" )
@Tag(name = "管理费明细")
public class TEkpManagerInfoController {
private final EkpManagerInfoService ekpManagerInfoService;
/**
* @param incomeParam
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/pushManangerInfoToEkp")
public String pushManangerInfoToEkp(@RequestBody EkpIncomeParamManage incomeParam) {
return ekpManagerInfoService.pushManangerInfoToEkp(incomeParam);
}
/**
* @param incomeParamList
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/jobPushManagerInfoToEkp")
public EkpSocialPushInfoVo jobPushManagerInfoToEkp(@RequestBody List<EkpIncomeParamManage> incomeParamList) {
return ekpManagerInfoService.jobPushManagerInfoToEkp(incomeParamList);
}
}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/ekpriskinfo" )
@Tag(name = "风险金明细")
public class TEkpRiskInfoController {
private final EkpRiskInfoService ekpRiskInfoService;
/**
* @param incomeParam
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/pushRiskInfoToEkp")
public String pushRiskInfoToEkp(@RequestBody EkpIncomeParamRisk incomeParam) {
return ekpRiskInfoService.pushRiskInfoToEkp(incomeParam);
}
/**
* @param incomeParam
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/jobPushRiskInfoToEkp")
public EkpSocialPushInfoVo jobPushRiskInfoToEkp(@RequestBody List<EkpIncomeParamRisk> incomeParam) {
return ekpRiskInfoService.jobPushRiskInfoToEkp(incomeParam);
}
}
package com.yifu.cloud.plus.v1.ekp.controller; package com.yifu.cloud.plus.v1.ekp.controller;
import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
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.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -11,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -11,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List; import java.util.List;
...@@ -39,4 +47,24 @@ public class TEkpSocialInfoController { ...@@ -39,4 +47,24 @@ public class TEkpSocialInfoController {
public EkpSocialPushInfoVo pushSocialInfoToEkp(@RequestBody List<EkpPushSocialParam> unPushList) { public EkpSocialPushInfoVo pushSocialInfoToEkp(@RequestBody List<EkpPushSocialParam> unPushList) {
return socialInfoService.pushSocialInfoToEkp(unPushList); return socialInfoService.pushSocialInfoToEkp(unPushList);
} }
/**
* 修改项目表--EKP调用接口
* @author hyc
* @param jsonStr 社保订单明细
* @return R
*/
@Operation(summary = "更新社保明细状态--EKP调用接口", description = "更新社保明细状态--EKP调用接口")
@SysLog("更新社保明细状态--EKP调用接口")
@PostMapping("/updateScoialStatus")
public R updateScoialStatus(@RequestBody String jsonStr) {
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<EkpSocialStatusUpdateVo> list= JSONObject.parseArray(jsonStr, EkpSocialStatusUpdateVo.class);
return socialInfoService.updateScoialStatus(list);
}
} }
package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
@Mapper
public interface EkpManagerInfoMapper extends BaseMapper<EkpManagerInfo> {
/**
* 根据身项目编码获取ekp项目明细
* @param
* @return
*/
EkpDeptInfoVo getEkpDeptInfoByNo(@Param("deptNo") String getEkpDeptInfoByNo);
}
package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
@Mapper
public interface EkpRiskInfoMapper extends BaseMapper<EkpRiskInfo> {
/**
* 根据身项目编码获取ekp项目明细
* @param
* @return
*/
EkpDeptInfoVo getEkpDeptInfoByNo(@Param("deptNo") String getEkpDeptInfoByNo);
}
...@@ -31,4 +31,6 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> { ...@@ -31,4 +31,6 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
* @return * @return
*/ */
EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth); EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth);
void updateSocialStatus(@Param("sql") String sql);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpFundInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpFundInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -15,5 +16,6 @@ import java.util.List; ...@@ -15,5 +16,6 @@ import java.util.List;
*/ */
public interface EkpFundInfoService extends IService<EkpFundInfo> { public interface EkpFundInfoService extends IService<EkpFundInfo> {
@Transactional
EkpSocialPushInfoVo pushFundInfoToEkp(List<EkpPushFundParam> unPushList); EkpSocialPushInfoVo pushFundInfoToEkp(List<EkpPushFundParam> unPushList);
} }
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
public interface EkpManagerInfoService extends IService<EkpManagerInfo> {
String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParam);
}
package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
*
* @author huyc
* @date 2024-03-13 16:14:37
*/
public interface EkpRiskInfoService extends IService<EkpRiskInfo> {
String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParam);
}
...@@ -3,8 +3,6 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -3,8 +3,6 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -18,6 +16,6 @@ import java.util.List; ...@@ -18,6 +16,6 @@ import java.util.List;
public interface EkpSalaryInfoService extends IService<EkpSalaryInfo> { public interface EkpSalaryInfoService extends IService<EkpSalaryInfo> {
@Transactional @Transactional
@ShardingTransactionType(TransactionType.BASE) // @ShardingTransactionType(TransactionType.BASE)
Boolean pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList); Boolean pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList);
} }
...@@ -3,9 +3,9 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -3,9 +3,9 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -19,6 +19,8 @@ import java.util.List; ...@@ -19,6 +19,8 @@ import java.util.List;
public interface EkpSocialInfoService extends IService<EkpSocialInfo> { public interface EkpSocialInfoService extends IService<EkpSocialInfo> {
@Transactional @Transactional
@ShardingTransactionType(TransactionType.BASE) // @ShardingTransactionType(TransactionType.BASE)
EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList); EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList);
R updateScoialStatus(List<EkpSocialStatusUpdateVo> list);
} }
...@@ -11,11 +11,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -11,11 +11,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -264,6 +266,9 @@ public class EkpFundInfoServiceImpl extends ServiceImpl<EkpFundInfoMapper, EkpFu ...@@ -264,6 +266,9 @@ public class EkpFundInfoServiceImpl extends ServiceImpl<EkpFundInfoMapper, EkpFu
socialInfo.setFd_3add9eed23894a("未付"); socialInfo.setFd_3add9eed23894a("未付");
//支出结算状态 //支出结算状态
socialInfo.setFd_3add9edfbc6f7e("未结算"); socialInfo.setFd_3add9edfbc6f7e("未结算");
//单号
socialInfo.setFd_3adfe95c169c48("GJJ" + LocalDateTimeUtils.formatTime(LocalDateTime.now(),DateUtil.DATE_PATTERN)
+ "_" + socialInfo.getFd_3b10b38f90d138());
} }
/** /**
......
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @author huyc
* @date 2024-03-14 10:14:37
*/
@Log4j2
@Service
public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper, EkpManagerInfo> implements EkpManagerInfoService {
/**
* //@Description: 管理费明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam) {
//根据项目编码获取ekp所有项目信息
EkpDeptInfoVo deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
EkpManagerInfo managerInfoCount;
try {
//去重 防止重复推送
managerInfoCount = baseMapper.selectOne(Wrappers.<EkpManagerInfo>query().lambda()
.eq(EkpManagerInfo::getFd_3b13dc864a3052, incomeParam.getFd_3b13dae9bd70f8())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(managerInfoCount).isPresent()) {
return null;
}
EkpManagerInfo managerInfo = new EkpManagerInfo();
//对象信息赋值
copyManagerProperties(incomeParam, managerInfo);
//项目信息
managerInfo.setFd_3b16e47cb6874c_text(deptInfo.getDeptName());
managerInfo.setFd_3b16e47cb6874c(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(incomeParam.getFd_3ae0c23cb3fccc());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c23cb3fccc(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
managerInfo.setFd_3ae0c23cb3fccc("");
}
//是否全部结算
managerInfo.setFd_3b13b15f5b63fa("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
managerInfo.setCreateTime(DateUtil.getCurrentDateTime());
int i = baseMapper.insert(managerInfo);
return i <= 0 ? null : managerInfo.getFdId();
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
}
/**
* //@Description: 管理费明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public EkpSocialPushInfoVo jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParamList) {
List<EkpManagerInfo> managerInfolist = new ArrayList<>();
EkpManagerInfo managerInfoCount;
EkpDeptInfoVo deptInfo;
List<String> paymentIds = new ArrayList<>();
try {
for (EkpIncomeParamManage incomeParam : incomeParamList) {
//根据项目编码获取ekp所有项目信息
deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
//去重 防止重复推送
managerInfoCount = baseMapper.selectOne(Wrappers.<EkpManagerInfo>query().lambda()
.eq(EkpManagerInfo::getFd_3b13dc864a3052, incomeParam.getFd_3b13dae9bd70f8())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(managerInfoCount).isPresent()) {
return null;
}
EkpManagerInfo managerInfo = new EkpManagerInfo();
//对象信息赋值
copyManagerProperties(incomeParam, managerInfo);
//项目信息
managerInfo.setFd_3b16e47cb6874c_text(deptInfo.getDeptName());
managerInfo.setFd_3b16e47cb6874c(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(incomeParam.getFd_3ae0c23cb3fccc());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c23cb3fccc(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
managerInfo.setFd_3ae0c23cb3fccc("");
}
//是否全部结算
managerInfo.setFd_3b13b15f5b63fa("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
managerInfo.setCreateTime(DateUtil.getCurrentDateTime());
managerInfolist.add(managerInfo);
paymentIds.add(managerInfo.getFd_3b13dc864a3052());
}
if (!managerInfolist.isEmpty()) {
boolean flag = this.saveBatch(managerInfolist);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
return null;
}
private void copyManagerProperties(EkpIncomeParamManage incomeParam, EkpManagerInfo managerInfo) {
//项目编码
managerInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34());
//项目名称
managerInfo.setFd_3adfef5eb6691c(incomeParam.getFd_3adfef5eb6691c());
//单号
managerInfo.setFd_3adfef7f5d2b52(incomeParam.getFd_3adfef7f5d2b52());
//客户编码
managerInfo.setFd_3adfef80202ab2(incomeParam.getFd_3adfef80202ab2());
//客户名称
managerInfo.setFd_3adfef7fc1c886(incomeParam.getFd_3adfef7fc1c886());
//类型
managerInfo.setFd_3adda3037e3bda(incomeParam.getFd_3adda3037e3bda());
//产生来源
managerInfo.setFd_3adda320daef5a(incomeParam.getFd_3adda320daef5a());
//薪酬申请编号
managerInfo.setFd_3b3bf110837a96(incomeParam.getFd_3b3bf13759b850());
//姓名
managerInfo.setFd_3adfef948da848(incomeParam.getFd_3adfef948da848());
//身份证号
managerInfo.setFd_3adfef94dcdbb4(incomeParam.getFd_3adfef94dcdbb4());
//生成月份
managerInfo.setFd_3ae0c23b2e9a92(incomeParam.getFd_3ae0c23b2e9a92());
//HRO结算月
managerInfo.setFd_3b13dd215b55b2(incomeParam.getFd_3ae0c23cb3fccc());
//数据来源
managerInfo.setFd_3b0b7231bb5896("HRO");
//管理费ID
managerInfo.setFd_3b13dc864a3052(incomeParam.getFd_3b13dae9bd70f8());
//管理费金额
managerInfo.setFd_3adfef963bae28(CommonConstants.EMPTY_STRING.equals(incomeParam.getFd_3adfef963bae28()) ? null : Double.parseDouble(incomeParam.getFd_3adfef963bae28()));
//应收
managerInfo.setFd_3adfefa3daae72(CommonConstants.EMPTY_STRING.equals(incomeParam.getFd_3adfefa3daae72()) ? null : Double.parseDouble(incomeParam.getFd_3adfefa3daae72()));
//结算状态
managerInfo.setFd_3adfefaaa3bbd0("未结算");
//收款状态
managerInfo.setFd_3adfefaaef583e("未收");
//单号
managerInfo.setFd_3adfef7f5d2b52("GLF" + LocalDateTimeUtils.formatTime(LocalDateTime.now(), DateUtil.DATE_PATTERN)
+ "_" + managerInfo.getFd_3b13dc864a3052());
}
}
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpRiskInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @author huyc
* @date 2024-03-13 16:14:37
*/
@Log4j2
@Service
public class EkpRiskInfoServiceImpl extends ServiceImpl<EkpRiskInfoMapper, EkpRiskInfo> implements EkpRiskInfoService {
/**
* //@Description: 风险金明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
//根据项目编码获取ekp所有项目信息
EkpDeptInfoVo deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
EkpRiskInfo riskInfoCount;
try {
//去重 防止重复推送
riskInfoCount = baseMapper.selectOne(Wrappers.<EkpRiskInfo>query().lambda()
.eq(EkpRiskInfo::getFd_3b13db120a8224, incomeParam.getFd_3b13dac4c03022())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(riskInfoCount).isPresent()) {
return null;
}
EkpRiskInfo riskInfoInfo = new EkpRiskInfo();
//对象信息赋值
copyManagerProperties(incomeParam, riskInfoInfo);
//项目信息
riskInfoInfo.setFd_3b16e4cd2c9a86_text(deptInfo.getDeptName());
riskInfoInfo.setFd_3b16e4cd2c9a86(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(incomeParam.getFd_3ae0c3044e5958());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c3044e5958(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
riskInfoInfo.setFd_3ae0c3044e5958("");
}
//是否全部结算
riskInfoInfo.setFd_3b13b218b76a36("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
riskInfoInfo.setCreateTime(DateUtil.getCurrentDateTime());
int i = baseMapper.insert(riskInfoInfo);
return i <= 0 ? null : riskInfoInfo.getFdId();
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
}
/**
* //@Description: 风险金明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public EkpSocialPushInfoVo jobPushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParamList) {
List<String> paymentIds = new ArrayList<>();
List<EkpRiskInfo> riskInfoList = new ArrayList();
EkpRiskInfo riskInfoCount;
EkpDeptInfoVo deptInfo;
try {
for (EkpIncomeParamRisk incomeParam : incomeParamList) {
//根据项目编码获取ekp所有项目信息
deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
//去重 防止重复推送
riskInfoCount = baseMapper.selectOne(Wrappers.<EkpRiskInfo>query().lambda()
.eq(EkpRiskInfo::getFd_3b13db120a8224, incomeParam.getFd_3b13dac4c03022())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(riskInfoCount).isPresent()) {
return null;
}
EkpRiskInfo riskInfoInfo = new EkpRiskInfo();
//对象信息赋值
copyManagerProperties(incomeParam, riskInfoInfo);
//项目信息
riskInfoInfo.setFd_3b16e4cd2c9a86_text(deptInfo.getDeptName());
riskInfoInfo.setFd_3b16e4cd2c9a86(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(incomeParam.getFd_3ae0c3044e5958());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c3044e5958(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
riskInfoInfo.setFd_3ae0c3044e5958("");
}
//是否全部结算
riskInfoInfo.setFd_3b13b218b76a36("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
riskInfoInfo.setCreateTime(DateUtil.getCurrentDateTime());
paymentIds.add(riskInfoInfo.getFd_3b13db120a8224());
riskInfoList.add(riskInfoInfo);
}
if (!riskInfoList.isEmpty()) {
boolean flag = this.saveBatch(riskInfoList);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
return null;
}
private void copyManagerProperties(EkpIncomeParamRisk incomeParam, EkpRiskInfo riskInfoInfo) {
//项目编码
riskInfoInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34());
//项目名称
riskInfoInfo.setFd_3adfef5eb6691c(incomeParam.getFd_3adfef5eb6691c());
//单号
riskInfoInfo.setFd_3adfef7f5d2b52(incomeParam.getFd_3adfef7f5d2b52());
//客户编码
riskInfoInfo.setFd_3adfef80202ab2(incomeParam.getFd_3adfef80202ab2());
//客户名称
riskInfoInfo.setFd_3adfef7fc1c886(incomeParam.getFd_3adfef7fc1c886());
//类型
riskInfoInfo.setFd_3adda3037e3bda(incomeParam.getFd_3adda3037e3bda());
//产生来源
riskInfoInfo.setFd_3adda320daef5a(incomeParam.getFd_3adda320daef5a());
//薪酬申请编号
riskInfoInfo.setFd_3b3bf0c3198840(incomeParam.getFd_3b3bf0e75ef6c4());
//姓名
riskInfoInfo.setFd_3adfef948da848(incomeParam.getFd_3adfef948da848());
//身份证号
riskInfoInfo.setFd_3adfef94dcdbb4(incomeParam.getFd_3adfef94dcdbb4());
//生成月份
riskInfoInfo.setFd_3ae0c3032cffc8(incomeParam.getFd_3ae0c3032cffc8());
//HRO结算月
riskInfoInfo.setFd_3b13b2093b95ec(incomeParam.getFd_3ae0c3044e5958());
//数据来源
riskInfoInfo.setFd_3b0b7210ce9432("HRO");
//风险金ID
riskInfoInfo.setFd_3b13db120a8224(incomeParam.getFd_3b13dac4c03022());
//管理费金额
riskInfoInfo.setFd_3adfef963bae28(CommonConstants.EMPTY_STRING.equals(incomeParam.getFd_3adfef963bae28()) ? null : Double.parseDouble(incomeParam.getFd_3adfef963bae28()));
//应收
riskInfoInfo.setFd_3adfefa3daae72(CommonConstants.EMPTY_STRING.equals(incomeParam.getFd_3adfefa3daae72()) ? null : Double.parseDouble(incomeParam.getFd_3adfefa3daae72()));
//结算状态
riskInfoInfo.setFd_3adfefaaa3bbd0("未结算");
//收款状态
riskInfoInfo.setFd_3adfefaaef583e("未收");
//单号
riskInfoInfo.setFd_3adfef7f5d2b52("FXJ" + LocalDateTimeUtils.formatTime(LocalDateTime.now(), DateUtil.DATE_PATTERN)
+ "_" + riskInfoInfo.getFd_3b13db120a8224());
}
}
...@@ -10,11 +10,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -10,11 +10,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -29,7 +31,7 @@ import java.util.stream.Collectors; ...@@ -29,7 +31,7 @@ import java.util.stream.Collectors;
public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, EkpSalaryInfo> implements EkpSalaryInfoService { public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, EkpSalaryInfo> implements EkpSalaryInfoService {
/** /**
//@Description: 社保明细推送至ekp //@Description: 工资明细推送至ekp
//@Author: huyc //@Author: huyc
//@Date: 2024-3-11 //@Date: 2024-3-11
//@return: void //@return: void
...@@ -92,7 +94,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -92,7 +94,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
} }
} }
}catch (Exception e) { }catch (Exception e) {
log.error("工资明细推送失败"); log.error("工资明细推送失败:",e);
return false; return false;
} }
return false; return false;
...@@ -238,10 +240,12 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E ...@@ -238,10 +240,12 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
//实发合计应支出 //实发合计应支出
salaryInfo.setFd_3adfeec730ec44(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfee20fe5ba4()) ? null : Double.parseDouble(salaryParam.getFd_3adfee20fe5ba4())); salaryInfo.setFd_3adfeec730ec44(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfee20fe5ba4()) ? null : Double.parseDouble(salaryParam.getFd_3adfee20fe5ba4()));
//企业年金单位应支出 //企业年金单位应支出
salaryInfo.setFd_3adfeec782070a(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfeec782070a()) ? null : Double.parseDouble(salaryParam.getFd_3adfeec782070a())); salaryInfo.setFd_3adfeec782070a(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfee1ff1ca6a()) ? null : Double.parseDouble(salaryParam.getFd_3adfee1ff1ca6a()));
//企业年金个人应支出 //企业年金个人应支出
salaryInfo.setFd_3adfeec7ccdd1c(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfee203f86b2()) ? null : Double.parseDouble(salaryParam.getFd_3adfee203f86b2())); salaryInfo.setFd_3adfeec7ccdd1c(CommonConstants.EMPTY_STRING.equals(salaryParam.getFd_3adfee203f86b2()) ? null : Double.parseDouble(salaryParam.getFd_3adfee203f86b2()));
//单号
salaryInfo.setFd_3adfedfa4410aa("GZ" + LocalDateTimeUtils.formatTime(LocalDateTime.now(),DateUtil.DATE_PATTERN)
+ "_" + salaryInfo.getFd_3b10afe8c70742());
} }
/** /**
......
...@@ -7,17 +7,17 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper; ...@@ -7,17 +7,17 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush; import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -233,6 +233,19 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -233,6 +233,19 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
return null; return null;
} }
@Override
public R updateScoialStatus(List<EkpSocialStatusUpdateVo> list) {
if (Optional.ofNullable(list).isPresent()) {
for (EkpSocialStatusUpdateVo socialStatusUpdateVo : list) {
String updateSql = socialStatusUpdateVo.getUpdateSql().replaceAll("\\?","%s");
String sql = String.format(updateSql, socialStatusUpdateVo.getParam().toArray());
baseMapper.updateSocialStatus(sql);
}
return R.ok();
}
return null;
}
private void copySocialProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) { private void copySocialProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) {
//订单类型 //订单类型
socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8()); socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8());
...@@ -277,7 +290,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -277,7 +290,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
//预估单位养老 //预估单位养老
socialInfo.setFd_3af9f257b1b586(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ec80a9de7a()) ? null : Double.valueOf(socialParam.getFd_3af9ec80a9de7a())); socialInfo.setFd_3af9f257b1b586(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ec80a9de7a()) ? null : Double.valueOf(socialParam.getFd_3af9ec80a9de7a()));
//预估单位医疗 //预估单位医疗
socialInfo.setFd_3af9f25b851e94(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5899c90()) ? null : Double.valueOf(socialParam.getFd_3af9ec80a9de7a())); socialInfo.setFd_3af9f25b851e94(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5899c90()) ? null : Double.valueOf(socialParam.getFd_3af9eba5899c90()));
//预估单位失业 //预估单位失业
socialInfo.setFd_3af9f25f5e9cc4(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5f6e19e()) ? null : Double.valueOf(socialParam.getFd_3af9eba5f6e19e())); socialInfo.setFd_3af9f25f5e9cc4(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5f6e19e()) ? null : Double.valueOf(socialParam.getFd_3af9eba5f6e19e()));
//预估单位工伤 //预估单位工伤
...@@ -342,6 +355,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -342,6 +355,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
socialInfo.setFd_3add9edfbc6f7e("未结算"); socialInfo.setFd_3add9edfbc6f7e("未结算");
//付款状态 //付款状态
socialInfo.setFd_3add9eed23894a("未付"); socialInfo.setFd_3add9eed23894a("未付");
//单号
socialInfo.setFd_3adfe95c169c48("SB" + LocalDateTimeUtils.formatTime(LocalDateTime.now(),DateUtil.DATE_PATTERN)
+ "_" + socialParam.getFd_3b0afbe1f94a08());
} }
......
## 数据源配置
#spring:
# shardingsphere:
# datasource:
# ds0:
# type: com.zaxxer.hikari.HikariDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
# username: root
# password: ll_mysql
# hikari:
# driver-class-name: ${spring.datasource.driver-class-name}
# jdbc-url: ${spring.datasource.url}
# username: ${spring.datasource.username}
# password: ${spring.datasource.password}
# pool-name: AmytangHikariCP
# minimum-idle: 10 # 最小空闲连接数量
# idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
# maximum-pool-size: 12 # 连接池最大连接数,默认是10
# auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
# max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# names: ds0
# rules:
# sharding:
# key-generators:
# snowflake:
# type: SNOWFLAKE
# sharding-algorithms:
# t-payment-inline:
# props:
# strategy: standard
# algorithmClassName: com.yifu.cloud.plus.v1.ekp.config.OTAStrategyShardingAlgorithm
# type: CLASS_BASED
# tables:
# ekp_social_info:
# actual-data-nodes: ds0.ekp_social_info_20$->{23..24}
# key-generate-strategy:
# column: fd_id
# key-generator-name: snowflake
# table-strategy:
# standard:
# sharding-column: fd_3adfe8cb96c41e
# sharding-algorithm-name: t-payment-inline
#
# mvc:
# pathmatch:
# matching-strategy: ant_path_matcher
# config:
# activate:
# on-profile: test
# redis:
# host: 192.168.1.65
# port: 22379
# password: '@yf_2017'
### spring security 配置
#security:
# oauth2:
# resource:
# loadBalanced: true
# token-info-uri: http://127.0.0.1:3000/oauth/check_token
# # 直接放行URL
# ignore:
# urls:
# - /v3/api-docs
# - /actuator/**
# - /swagger-ui/**
# 数据源配置 # 数据源配置
spring: spring:
shardingsphere:
datasource:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: ll_mysql
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
names: ds0
rules:
sharding:
key-generators:
snowflake:
type: SNOWFLAKE
sharding-algorithms:
t-payment-inline:
props:
strategy: standard
algorithmClassName: com.yifu.cloud.plus.v1.ekp.config.OTAStrategyShardingAlgorithm
type: CLASS_BASED
tables:
ekp_social_info:
actual-data-nodes: ds0.ekp_social_info_20$->{23..24}
key-generate-strategy:
column: fd_id
key-generator-name: snowflake
table-strategy:
standard:
sharding-column: fd_3adfe8cb96c41e
sharding-algorithm-name: t-payment-inline
mvc: mvc:
pathmatch: pathmatch:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
...@@ -52,6 +76,22 @@ spring: ...@@ -52,6 +76,22 @@ spring:
host: 192.168.1.65 host: 192.168.1.65
port: 22379 port: 22379
password: '@yf_2017' password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: ll_mysql
url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置 ## spring security 配置
security: security:
oauth2: oauth2:
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
</resultMap> </resultMap>
<!--tPaymentInfo合并查询--> <!--查询项目信息-->
<select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo"> <select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo">
SELECT SELECT
a.fd_id as fdId, a.fd_id as fdId,
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
group by fd_3a37fe508071fe group by fd_3a37fe508071fe
</select> </select>
<!--tPaymentInfo合并查询--> <!--查询公积金明细信息-->
<select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo"> <select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo">
SELECT SELECT
round(sum(ifnull(fd_3adfeb52a4d2e2,0)),2) as ygPersonSum, round(sum(ifnull(fd_3adfeb52a4d2e2,0)),2) as ygPersonSum,
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper">
<resultMap id="ekpManagerInfoMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo">
<id property="fdId" column="fd_id"/>
<result property="fd_3adfef5e5b9d34" column="fd_3adfef5e5b9d34"/>
<result property="fd_3adfef5eb6691c" column="fd_3adfef5eb6691c"/>
<result property="fd_3adfef7f5d2b52" column="fd_3adfef7f5d2b52"/>
<result property="fd_3adfef80202ab2" column="fd_3adfef80202ab2"/>
<result property="fd_3adfef7fc1c886" column="fd_3adfef7fc1c886"/>
<result property="fd_3adda3037e3bda" column="fd_3adda3037e3bda"/>
<result property="fd_3adda320daef5a" column="fd_3adda320daef5a"/>
<result property="fd_3adfef948da848" column="fd_3adfef948da848"/>
<result property="fd_3adfef94dcdbb4" column="fd_3adfef94dcdbb4"/>
<result property="fd_3adfef963bae28" column="fd_3adfef963bae28"/>
<result property="fd_3adfefa3daae72" column="fd_3adfefa3daae72"/>
<result property="fd_3adfefaaa3bbd0" column="fd_3adfefaaa3bbd0"/>
<result property="fd_3adfefaaef583e" column="fd_3adfefaaef583e"/>
<result property="fd_3ae0c23cb3fccc" column="fd_3ae0c23cb3fccc"/>
<result property="fd_3ae0c23b2e9a92" column="fd_3ae0c23b2e9a92"/>
<result property="fd_3aead3c68b1078" column="fd_3aead3c68b1078"/>
<result property="fd_3aeae58b14691c" column="fd_3aeae58b14691c"/>
<result property="fd_3b0b7231bb5896" column="fd_3b0b7231bb5896"/>
<result property="fd_3b13b15f5b63fa" column="fd_3b13b15f5b63fa"/>
<result property="fd_3b13dc864a3052" column="fd_3b13dc864a3052"/>
<result property="fd_3b13dd215b55b2" column="fd_3b13dd215b55b2"/>
<result property="fd_3b16e47cb6874c" column="fd_3b16e47cb6874c"/>
<result property="fd_3b16e47cb6874c_text" column="fd_3b16e47cb6874c_text"/>
<result property="fd_3b3bf110837a96" column="fd_3b3bf110837a96"/>
<result property="fd_3b3e43a10ab4b2" column="fd_3b3e43a10ab4b2"/>
<result property="createTime" column="create_time"/>
</resultMap>
<!--查询项目信息-->
<select id="getEkpDeptInfoByNo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo">
SELECT
a.fd_id as fdId,
a.fd_3b1480cd9dcb60 as settleType,
a.fd_3b15f64dd59a28 as isBpo,
a.fd_3b13b29acea0e6 as socialType,
a.fd_3a2b38c61ef9aa as deptName,
a.fd_3a37fe508071fe as deptNo
from ekp_24a8e6a7fc143bb8c48a a
where a.fd_3a37fe508071fe = #{deptNo} limit 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.ekp.mapper.EkpRiskInfoMapper">
<resultMap id="ekpRiskInfoMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo">
<id property="fdId" column="fd_id"/>
<result property="fd_3adfef5e5b9d34" column="fd_3adfef5e5b9d34"/>
<result property="fd_3adfef5eb6691c" column="fd_3adfef5eb6691c"/>
<result property="fd_3adfef7f5d2b52" column="fd_3adfef7f5d2b52"/>
<result property="fd_3adfef80202ab2" column="fd_3adfef80202ab2"/>
<result property="fd_3adfef7fc1c886" column="fd_3adfef7fc1c886"/>
<result property="fd_3adda3037e3bda" column="fd_3adda3037e3bda"/>
<result property="fd_3adda320daef5a" column="fd_3adda320daef5a"/>
<result property="fd_3adfef948da848" column="fd_3adfef948da848"/>
<result property="fd_3adfef94dcdbb4" column="fd_3adfef94dcdbb4"/>
<result property="fd_3adfef963bae28" column="fd_3adfef963bae28"/>
<result property="fd_3adfefa3daae72" column="fd_3adfefa3daae72"/>
<result property="fd_3adfefaaa3bbd0" column="fd_3adfefaaa3bbd0"/>
<result property="fd_3adfefaaef583e" column="fd_3adfefaaef583e"/>
<result property="fd_3ae0c3032cffc8" column="fd_3ae0c3032cffc8"/>
<result property="fd_3ae0c3044e5958" column="fd_3ae0c3044e5958"/>
<result property="fd_3aead7204bb594" column="fd_3aead7204bb594"/>
<result property="fd_3aeae59b70fe5a" column="fd_3aeae59b70fe5a"/>
<result property="fd_3b0b7210ce9432" column="fd_3b0b7210ce9432"/>
<result property="fd_3b13b218b76a36" column="fd_3b13b218b76a36"/>
<result property="fd_3b13b2093b95ec" column="fd_3b13b2093b95ec"/>
<result property="fd_3b13db120a8224" column="fd_3b13db120a8224"/>
<result property="fd_3b16e4cd2c9a86_text" column="fd_3b16e4cd2c9a86_text"/>
<result property="fd_3b16e4cd2c9a86" column="fd_3b16e4cd2c9a86"/>
<result property="fd_3b3bf0c3198840" column="fd_3b3bf0c3198840"/>
<result property="fd_3b3e4252b16714" column="fd_3b3e4252b16714"/>
<result property="createTime" column="create_time"/>
</resultMap>
<!--查询项目信息-->
<select id="getEkpDeptInfoByNo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo">
SELECT
a.fd_id as fdId,
a.fd_3b1480cd9dcb60 as settleType,
a.fd_3b15f64dd59a28 as isBpo,
a.fd_3b13b2b48cc506 as socialType,
a.fd_3a2b38c61ef9aa as deptName,
a.fd_3a37fe508071fe as deptNo
from ekp_24a8e6a7fc143bb8c48a a
where a.fd_3a37fe508071fe = #{deptNo} limit 1
</select>
</mapper>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<result property="fd_3c3e5ff65115a2" column="fd_3c3e5ff65115a2"/> <result property="fd_3c3e5ff65115a2" column="fd_3c3e5ff65115a2"/>
</resultMap> </resultMap>
<!--tPaymentInfo合并查询--> <!--查询项目信息-->
<select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo"> <select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo">
SELECT SELECT
a.fd_id as fdId, a.fd_id as fdId,
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
group by fd_3a37fe508071fe group by fd_3a37fe508071fe
</select> </select>
<!--tPaymentInfo合并查询--> <!--查询工资明细信息-->
<select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo"> <select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo">
SELECT SELECT
round(sum(ifnull(fd_3af9f2883941b4,0)),2) as ygSum, round(sum(ifnull(fd_3af9f2883941b4,0)),2) as ygSum,
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
</resultMap> </resultMap>
<!--tPaymentInfo合并查询--> <!--查询项目信息-->
<select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo"> <select id="getAllEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo">
SELECT SELECT
a.fd_id as fdId, a.fd_id as fdId,
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
group by fd_3a37fe508071fe group by fd_3a37fe508071fe
</select> </select>
<!--tPaymentInfo合并查询--> <!--查询社保明细信息-->
<select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo"> <select id="getCostSumInfo" resultType="com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo">
SELECT SELECT
round(sum(ifnull(fd_3af9f2883941b4,0)),2) as ygSum, round(sum(ifnull(fd_3af9f2883941b4,0)),2) as ygSum,
...@@ -113,4 +113,7 @@ ...@@ -113,4 +113,7 @@
where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month} where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month}
</select> </select>
<update id="updateSocialStatus">
#{sql}
</update>
</mapper> </mapper>
...@@ -693,8 +693,8 @@ ...@@ -693,8 +693,8 @@
,ifnull(withholidingPersonFund.SALARY_MONEY,'') fd_3b16ce4b7fc42a ,ifnull(withholidingPersonFund.SALARY_MONEY,'') fd_3b16ce4b7fc42a
,ifnull(withholidingUnitSocial.SALARY_MONEY,'') fd_3bcd41d857b764 ,ifnull(withholidingUnitSocial.SALARY_MONEY,'') fd_3bcd41d857b764
,ifnull(withholidingUnitFund.SALARY_MONEY,'') fd_3bcd41d77e4812 ,ifnull(withholidingUnitFund.SALARY_MONEY,'') fd_3bcd41d77e4812
,ifnull(withholidingUnitSocial.SALARY_MONEY,'0')+ifnull(withholidingPersonSocial.SALARY_MONEY,'0') social_sum ,round(ifnull(withholidingUnitSocial.SALARY_MONEY,'0')+ifnull(withholidingPersonSocial.SALARY_MONEY,'0'),2) social_sum
,ifnull(withholidingUnitFund.SALARY_MONEY,'0')+ifnull(withholidingPersonFund.SALARY_MONEY,'0') fund_sum ,round(ifnull(withholidingUnitFund.SALARY_MONEY,'0')+ifnull(withholidingPersonFund.SALARY_MONEY,'0'),2) fund_sum
,concat(left(ifnull(a.DEDU_SOCIAL_MONTH,'1970'),4),'-',right(ifnull(a.DEDU_SOCIAL_MONTH,'02'),2)) DEDU_SOCIAL_MONTH ,concat(left(ifnull(a.DEDU_SOCIAL_MONTH,'1970'),4),'-',right(ifnull(a.DEDU_SOCIAL_MONTH,'02'),2)) DEDU_SOCIAL_MONTH
,concat(left(ifnull(a.DEDU_PROVIDENT_MONTH,'1970'),4),'-',right(ifnull(a.DEDU_PROVIDENT_MONTH,'02'),2)) DEDU_PROVIDENT_MONTH ,concat(left(ifnull(a.DEDU_PROVIDENT_MONTH,'1970'),4),'-',right(ifnull(a.DEDU_PROVIDENT_MONTH,'02'),2)) DEDU_PROVIDENT_MONTH
,ifnull(s.BPO_FLAG,'') fd_3b178f0ded2114 ,ifnull(s.BPO_FLAG,'') fd_3b178f0ded2114
......
...@@ -73,6 +73,8 @@ public interface TIncomeMapper extends BaseMapper<TIncome> { ...@@ -73,6 +73,8 @@ public interface TIncomeMapper extends BaseMapper<TIncome> {
**/ **/
int deleteIncomeDetailByApplyNo(@Param("applyNo") String applyNo); int deleteIncomeDetailByApplyNo(@Param("applyNo") String applyNo);
void updateIncomeByIdList(@Param("list") List<String> list);
/** /**
* @param idSet * @param idSet
* @param dept * @param dept
......
...@@ -2424,15 +2424,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2424,15 +2424,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> pushList; List<TForecastLibrary> pushList;
int k = 0; int k = 0;
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
if (j == i - 1) { synchronized (this) {
pushList = unPushInfo.subList(k, unPushInfo.size()); if (j == i - 1) {
} else { pushList = unPushInfo.subList(k, unPushInfo.size());
pushList = unPushInfo.subList(k, k + 1000); } else {
} pushList = unPushInfo.subList(k, k + 1000);
k = k + 1000; }
if (Common.isNotNull(pushList)) { k = k + 1000;
//推送数据封装并推送 if (Common.isNotNull(pushList)) {
initEkpPushSocialParam(pushList, true, selectVoMap); //推送数据封装并推送
initEkpPushSocialParam(pushList, true, selectVoMap);
}
} }
} }
} }
...@@ -2465,15 +2467,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2465,15 +2467,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> pushList; List<TForecastLibrary> pushList;
int k = 0; int k = 0;
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
if (j == i - 1) { synchronized (this) {
pushList = unPushInfo.subList(k, unPushInfo.size()); if (j == i - 1) {
} else { pushList = unPushInfo.subList(k, unPushInfo.size());
pushList = unPushInfo.subList(k, k + 1000); } else {
} pushList = unPushInfo.subList(k, k + 1000);
k = k + 1000; }
if (Common.isNotNull(pushList)) { k = k + 1000;
//推送数据封装并推送 if (Common.isNotNull(pushList)) {
initEkpPushFundParam(pushList, true, selectVoMap); //推送数据封装并推送
initEkpPushFundParam(pushList, true, selectVoMap);
}
} }
} }
} }
...@@ -2496,15 +2500,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2496,15 +2500,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> pushList; List<TForecastLibrary> pushList;
int k = 0; int k = 0;
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
if (j == i - 1) { synchronized (this) {
pushList = library.subList(k, library.size()); if (j == i - 1) {
} else { pushList = library.subList(k, library.size());
pushList = library.subList(k, k + 1000); } else {
} pushList = library.subList(k, k + 1000);
k = k + 1000; }
if (Common.isNotNull(pushList)) { k = k + 1000;
//推送数据封装并推送 if (Common.isNotNull(pushList)) {
initEkpPushSocialParam(pushList,synFlag, selectVoMap); //推送数据封装并推送
initEkpPushSocialParam(pushList, synFlag, selectVoMap);
}
} }
} }
} }
...@@ -2527,15 +2533,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2527,15 +2533,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> pushList; List<TForecastLibrary> pushList;
int k = 0; int k = 0;
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
if (j == i - 1) { synchronized (this) {
pushList = library.subList(k, library.size()); if (j == i - 1) {
} else { pushList = library.subList(k, library.size());
pushList = library.subList(k, k + 1000); } else {
} pushList = library.subList(k, k + 1000);
k = k + 1000; }
if (Common.isNotNull(pushList)) { k = k + 1000;
//推送数据封装并推送 if (Common.isNotNull(pushList)) {
initEkpPushFundParam(pushList,synFlag, selectVoMap); //推送数据封装并推送
initEkpPushFundParam(pushList, synFlag, selectVoMap);
}
} }
} }
} }
......
...@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.EkpDaprUtils;
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;
...@@ -38,7 +39,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo; ...@@ -38,7 +39,6 @@ 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;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService; import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
...@@ -84,6 +84,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -84,6 +84,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Autowired @Autowired
private TPaymentInfoMapper tPaymentInfoMapper; private TPaymentInfoMapper tPaymentInfoMapper;
@Autowired
private EkpDaprUtils ekpDaprUtil;
/** /**
* 收入明细表简单分页查询 * 收入明细表简单分页查询
* *
...@@ -317,62 +320,61 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -317,62 +320,61 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Override @Override
public void pushDetail() { public void pushDetail() {
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda() //管理费处理
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)); long count = baseMapper.selectCount(Wrappers.<TIncome>query().lambda()
Map<String, Integer> map = new HashMap<>(); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
Map<String, String> idMap = new HashMap<>(); .eq(TIncome::getFeeType, CommonConstants.ONE_STRING));
//收入更新 if (count > 0) {
List<TIncome> updateList = new ArrayList<>(); List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
for (TIncome income : list) { .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
String sendBack = this.getSendBack(income); .eq(TIncome::getFeeType, CommonConstants.ONE_STRING));
income.setSendTime(new Date()); int i = (int) Math.ceil((double) count / CommonConstants.ONE_THOUSAND_INT);
if (Common.isNotNull(sendBack) && sendBack.length() == 32) { if (!list.isEmpty()) {
income.setSendStatus(CommonConstants.ONE_STRING); List<TIncome> pushList;
income.setSendMonth(DateUtil.addMonth(0)); int k = 0;
income.setEkpId(sendBack); for (int j = 0; j < i; j++) {
updateList.add(income); synchronized (this) {
if (updateList.size() >= CommonConstants.FIVES_INT) { if (j == i - 1) {
baseMapper.updateIncomeById(updateList); pushList = list.subList(k, list.size());
updateList.clear(); } else {
} pushList = list.subList(k, k + 1000);
} else { }
if (Common.isNotNull(map.get(sendBack)) && map.get(sendBack) > 0) { k = k + 1000;
int i = map.get(sendBack) + 1; if (Common.isNotNull(pushList)) {
map.put(sendBack, i); //推送数据封装并推送
idMap.put(sendBack, income.getId()); doJointSocialTask.asynchronousEkpIncomePush(pushList);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updateIncomeById(updateList);
for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(entry.getKey());
error.setNums(entry.getValue());
tSendEkpErrorService.save(error);
} }
break;
} }
} else {
map.put(sendBack, 1);
idMap.put(sendBack, income.getId());
} }
} }
} }
for (Map.Entry<String, Integer> entry : map.entrySet()) { //风险金处理
TSendEkpError error = new TSendEkpError(); long countRisk = baseMapper.selectCount(Wrappers.<TIncome>query().lambda()
error.setCreateTime(new Date()); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
error.setCreateDay(DateUtil.getThisDay()); .eq(TIncome::getFeeType, CommonConstants.TWO_STRING));
error.setType(CommonConstants.FIVE_STRING); if (countRisk > 0) {
error.setLinkId(idMap.get(entry.getKey())); List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
error.setTitle(entry.getKey()); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
error.setNums(entry.getValue()); .eq(TIncome::getFeeType, CommonConstants.TWO_STRING));
tSendEkpErrorService.save(error); int i = (int) Math.ceil((double) countRisk / CommonConstants.ONE_THOUSAND_INT);
} if (!list.isEmpty()) {
if (Common.isNotNull(updateList)){ List<TIncome> pushList;
baseMapper.updateIncomeById(updateList); int k = 0;
for (int j = 0; j < i; j++) {
synchronized (this) {
if (j == i - 1) {
pushList = list.subList(k, list.size());
} else {
pushList = list.subList(k, k + 1000);
}
k = k + 1000;
if (Common.isNotNull(pushList)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpIncomeRiskPush(pushList);
}
}
}
}
} }
} }
...@@ -384,15 +386,21 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -384,15 +386,21 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
* @return: java.lang.String * @return: java.lang.String
**/ **/
private String getSendBack(TIncome income) { private String getSendBack(TIncome income) {
String sendBack; String sendBack="";
if (CommonConstants.ONE_STRING.equals(income.getFeeType())) { if (CommonConstants.ONE_STRING.equals(income.getFeeType())) {
EkpIncomeParamManage sendParam = new EkpIncomeParamManage(); EkpIncomeParamManage sendParam = new EkpIncomeParamManage();
this.copyToEkpManage(income, sendParam); this.copyToEkpManage(income, sendParam);
sendBack = ekpIncomeUtil.sendToEkpManage(sendParam); R<String> info = ekpDaprUtil.pushManagerInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
sendBack = info.getData();
}
} else { } else {
EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk(); EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk();
this.copyToEkpRisk(income, sendParam); this.copyToEkpRisk(income, sendParam);
sendBack = ekpIncomeUtil.sendToEkpRisk(sendParam); R<String> info = ekpDaprUtil.pushRiskInfoToEkp(sendParam);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
sendBack = info.getData();
}
} }
return sendBack; return sendBack;
} }
...@@ -465,6 +473,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -465,6 +473,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
sendParam.setFd_3adda320daef5a("商险"); sendParam.setFd_3adda320daef5a("商险");
} else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) { } else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("工资"); sendParam.setFd_3adda320daef5a("工资");
} else if (CommonConstants.TWO_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("公积金");
} else { } else {
sendParam.setFd_3adda320daef5a("社保"); sendParam.setFd_3adda320daef5a("社保");
} }
...@@ -530,6 +540,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -530,6 +540,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
sendParam.setFd_3adda320daef5a("商险"); sendParam.setFd_3adda320daef5a("商险");
} else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) { } else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("工资"); sendParam.setFd_3adda320daef5a("工资");
} else if (CommonConstants.TWO_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("公积金");
} else { } else {
sendParam.setFd_3adda320daef5a("社保"); sendParam.setFd_3adda320daef5a("社保");
} }
......
...@@ -318,4 +318,16 @@ ...@@ -318,4 +318,16 @@
</foreach> </foreach>
</update> </update>
<!-- ekp收入更新 -->
<update id="updateIncomeByIdList">
update t_income p
set p.SEND_STATUS = '1'
,p.SEND_MONTH = DATE_FORMAT(CURRENT_DATE(),'%Y%m')
,p.SEND_TIME = now()
where p.id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper> </mapper>
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