Commit 315ecfc5 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.4-EXPORT' into MVP1.4-EXPORT

parents 305d71db b788582c
......@@ -190,6 +190,24 @@ public class TSettleDomainController {
return listVo;
}
/**
* @param
* @Author: wangan
* @Date: 2019/10/18
* @Description:获取所有客户单位的项目信息
**/
@Inner
@PostMapping("/selectAllSettleDomainSelectVo")
public TSettleDomainListVo selectAllSettleDomainSelectVo() {
List<TSettleDomainSelectVo> list = tSettleDomainService.selectAllSettleDomainSelectVos();
TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list);
if (Common.isNotNull(list)){
listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getId, k->k)));
}
return listVo;
}
/**
* @param
* @Author: wangan
......
......@@ -105,6 +105,21 @@ public class ArchivesDaprUtil {
return res;
}
/**
* @Author fxj
* @Description 获取所有客户单位的项目信息
* @Date 21:18 2022/7/18
* @Param
* @return
**/
public R<TSettleDomainListVo> selectAllSettleDomainSelectVo(){
R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVo","", TSettleDomainListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取所有客户单位的项目信息失败!");
}
return res;
}
/**
* @Author fxj
* @Description 获取所有客户单位的项目信息
......
......@@ -207,18 +207,18 @@ public class TPaymentInfoBatchVo {
@ExcelProperty("单位失业基数")
private BigDecimal unitUnemploymentSet;
/**
* 工伤基数
* 单位工伤基数
*/
@ExcelAttribute(name = "工伤基数")
@ExcelAttribute(name = "单位工伤基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数")
@ExcelProperty("单位工伤基数")
private BigDecimal unitInjurySet;
/**
* 生育基数
*/
@ExcelAttribute(name = "生育基数")
@ExcelAttribute(name = "单位生育基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数")
@ExcelProperty("单位生育基数")
private BigDecimal unitBirthSet;
/**
* 单位养老比例
......@@ -291,74 +291,74 @@ public class TPaymentInfoBatchVo {
@ExcelProperty("个人大病比例")
private BigDecimal personalBigailmentPer;
/**
* 单位养老金额
* 单位养老缴费
*/
@ExcelAttribute(name = "单位养老金额")
@ExcelAttribute(name = "单位养老缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老金额")
@ExcelProperty("单位养老缴费")
private BigDecimal unitPensionMoney;
/**
* 单位医疗金额
* 单位医疗缴费
*/
@ExcelAttribute(name = "单位医疗金额")
@ExcelAttribute(name = "单位医疗缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗金额")
@ExcelProperty("单位医疗缴费")
private BigDecimal unitMedicalMoney;
/**
* 单位失业金额
* 单位失业缴费
*/
@ExcelAttribute(name = "单位失业金额")
@ExcelAttribute(name = "单位失业缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业金额")
@ExcelProperty("单位失业缴费")
private BigDecimal unitUnemploymentMoney;
/**
* 单位工伤金额
* 单位工伤缴费
*/
@ExcelAttribute(name = "单位工伤金额")
@ExcelAttribute(name = "单位工伤缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤金额")
@ExcelProperty("单位工伤缴费")
private BigDecimal unitInjuryMoney;
/**
* 单位生育金额
* 单位生育缴费
*/
@ExcelAttribute(name = "单位生育金额")
@ExcelAttribute(name = "单位生育缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育金额")
@ExcelProperty("单位生育缴费")
private BigDecimal unitBirthMoney;
/**
* 单位大病金额
* 单位大病缴费
*/
@ExcelAttribute(name = "单位大病金额")
@ExcelAttribute(name = "单位大病缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额")
@ExcelProperty("单位大病缴费")
private BigDecimal unitBigmailmentMoney;
/**
* 个人养老金额
* 个人养老缴费
*/
@ExcelAttribute(name = "个人养老金额")
@ExcelAttribute(name = "个人养老缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人养老金额")
@ExcelProperty("个人养老缴费")
private BigDecimal personalPensionMoney;
/**
* 个人医疗金额
* 个人医疗缴费
*/
@ExcelAttribute(name = "个人医疗金额")
@ExcelAttribute(name = "个人医疗缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗金额")
@ExcelProperty("个人医疗缴费")
private BigDecimal personalMedicalMoney;
/**
* 个人失业金额
* 个人失业缴费
*/
@ExcelAttribute(name = "个人失业金额")
@ExcelAttribute(name = "个人失业缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
@ExcelProperty("个人失业缴费")
private BigDecimal personalUnemploymentMoney;
/**
* 个人大病金额
* 个人大病缴费
*/
@ExcelAttribute(name = "个人大病金额")
@ExcelAttribute(name = "个人大病缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额")
@ExcelProperty("个人大病缴费")
private BigDecimal personalBigmailmentMoney;
/**
......@@ -419,11 +419,11 @@ public class TPaymentInfoBatchVo {
@ExcelProperty("单位公积金比例")
private BigDecimal providentPercent;
/**
* 单位公积金费用
* 单位公积金缴费
*/
@ExcelAttribute(name = "单位公积金费用")
@ExcelAttribute(name = "单位公积金缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金费用")
@ExcelProperty("单位公积金缴费")
private BigDecimal unitProvidentSum;
/**
* 个人公积金基数
......@@ -433,11 +433,11 @@ public class TPaymentInfoBatchVo {
@ExcelProperty("个人公积金基数")
private BigDecimal personalProidentSet;
/**
* 个人公积金费用
* 个人公积金缴费
*/
@ExcelAttribute(name = "个人公积金费用")
@ExcelAttribute(name = "个人公积金缴费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金费用")
@ExcelProperty("个人公积金缴费")
private BigDecimal personalProvidentSum;
/**
......
......@@ -240,38 +240,38 @@ public class TPaymentInfoExportVo extends RowIndex implements Serializable {
/**
* 单位养老基数
*/
@ExcelAttribute(name = "养老基数")
@ExcelAttribute(name = "单位养老基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老基数")
@ExcelProperty("单位养老基数")
private BigDecimal unitPensionSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "医疗基数")
@ExcelAttribute(name = "单位医疗基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗基数")
@ExcelProperty("单位医疗基数")
private BigDecimal unitMedicalSet;
/**
* 单位失业基数
*/
@ExcelAttribute(name = "失业基数")
@ExcelAttribute(name = "单位失业基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业基数")
@ExcelProperty("单位失业基数")
private BigDecimal unitUnemploymentSet;
/**
* 单位工伤基数
*/
@ExcelAttribute(name = "工伤基数")
@ExcelAttribute(name = "单位工伤基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数")
@ExcelProperty("单位工伤基数")
private BigDecimal unitInjurySet;
/**
* 单位生育基数
*/
@ExcelAttribute(name = "生育基数")
@ExcelAttribute(name = "单位生育基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数")
private BigDecimal unitBirthSet;;
@ExcelProperty("单位生育基数")
private BigDecimal unitBirthSet;
/**
* 单位养老金额
*/
......
......@@ -936,7 +936,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo;
TSocialFundInfo socialInfo;
TSocialInfo tSocialInfo = new TSocialInfo();
TSocialInfo tSocialInfo = null;
String temp;
int res;
List<TSocialInfo> socialist;
......@@ -1495,6 +1495,25 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public R<List<ErrorDetailVO>> batchImportPaymentFundInfo(InputStream inputStream) {
List<ErrorDetailVO> errorMessageList = new ArrayList<>();
ExcelUtil<TPaymentInfoVo> util1 = new ExcelUtil<>(TPaymentInfoVo.class);
//批量插入的集合
List<TPaymentInfo> batchInsertList = new ArrayList<>();
//获取所有项目信息
Map<String, TSettleDomainSelectVo> domainMap = this.getSelectVoMapById();
//地区数据
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (Common.isNotNull(areaListR)) {
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
areaMap2.put(area.getAreaName() + CommonConstants.DOWN_LINE_STRING + (
null == area.getParentId() ? "null" : (0 == area.getParentId() ? "null" : Integer.toString(
area.getParentId()))), Integer.toString(area.getId()));
}
}
}
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......@@ -1537,10 +1556,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
batchSavePaymentFundInfo(cachedDataList, errorMessageList);
batchSavePaymentFundInfo(cachedDataList, errorMessageList, batchInsertList, areaMap, areaMap2,domainMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
//批量插入数据
if (!batchInsertList.isEmpty()) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
......@@ -1548,32 +1572,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return this.judgeAllMessage(errorMessageList);
}
private void batchSavePaymentFundInfo(List<TPaymentInfoVo> list, List<ErrorDetailVO> errorMessageList) {
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (Common.isNotNull(areaListR)) {
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
areaMap2.put(area.getAreaName() + CommonConstants.DOWN_LINE_STRING + (
null == area.getParentId() ? "null" : (0 == area.getParentId() ? "null" : Integer.toString(
area.getParentId()))), Integer.toString(area.getId()));
}
}
}
private void batchSavePaymentFundInfo(List<TPaymentInfoVo> list, List<ErrorDetailVO> errorMessageList,
List<TPaymentInfo> batchInsertList,HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,Map<String,TSettleDomainSelectVo> domainMap) {
try {
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo = null;
TSocialFundInfo fund;
String temp;
int res = -1;
List<TProvidentFund> fundlist;
TProvidentFund tProvidentFund = new TProvidentFund();
List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo;
TProvidentFund tProvidentFund = null;
//获取身份证列表
List<String> idcards = list.stream().map(TPaymentInfoVo::getEmpIdcard).collect(Collectors.toList());
......@@ -1605,7 +1613,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
String[] areaArray;
TSettleDomain domain;
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -1721,18 +1729,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setEmpIdcard(tProvidentFund.getEmpIdcard());
paymentInfo.setEmpName(tProvidentFund.getEmpName());
paymentInfo.setSettleDomainId(tProvidentFund.getSettleDomain());
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(tProvidentFund.getSettleDomain());
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo : settleDomainR) {
paymentInfo.setSettleDomainName(vo.getDepartName());
paymentInfo.setSettleDomainCode(vo.getDepartNo());
paymentInfo.setUnitId(vo.getCustomerId());
paymentInfo.setUnitName(vo.getCustomerName());
}
}
//获取项目信息
if (Common.isNotNull(domainMap)) {
domain = domainMap.get(tProvidentFund.getSettleDomain());
} else {
domain = null;
}
if (Common.isNotNull(domain)) {
paymentInfo.setSettleDomainName(domain.getDepartName());
paymentInfo.setSettleDomainCode(domain.getDepartNo());
paymentInfo.setUnitId(domain.getCustomerId());
paymentInfo.setUnitName(domain.getCustomerName());
}
paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
paymentInfo.setFundCity(tProvidentFund.getFundCity());
......@@ -1776,26 +1783,25 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setProvidentSum(null == infoVo.getProvidentSum() ? BigDecimal.ZERO : infoVo.getProvidentSum());
paymentInfo.setSumAll(paymentInfo.getProvidentSum());
paymentInfo.setFundId(UUID.randomUUID().toString());
res = insertAndSTimestamp(paymentInfo);
if (res < 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
, CommonConstants.SAVE_FAILED));
continue;
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
, CommonConstants.SAVE_SUCCESS));
if (Common.isNotNull(paymentInfo.getSocialCreateMonth()) && Common.isNotNull(paymentInfo.getSocialPayMonth())) {
paymentInfo.setSortTime(paymentInfo.getSocialCreateMonth().concat(paymentInfo.getSocialPayMonth()).concat(
String.valueOf(System.currentTimeMillis())));
}
if (Common.isNotNull(paymentInfo.getId()) && Common.isNotNull(paymentInfo.getFundId())) {
paymentInfoMap.put(paymentInfo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getProvidentPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getProvidentCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ BigDecimalUtils.safeAdd(paymentInfo.getProvidentSum()).doubleValue(), paymentInfo);
batchInsertList.add(paymentInfo);
//批量插入数据
if (batchInsertList.size() >= 100000) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
paymentInfoMap.put(paymentInfo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getProvidentPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getProvidentCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ BigDecimalUtils.safeAdd(paymentInfo.getProvidentSum()).doubleValue(), paymentInfo);
}
}
}
......@@ -2112,7 +2118,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) {
TPaymentInfo payExists;
TSocialFundInfo socialInfo = null;
TSocialInfo tSocialInfo = new TSocialInfo();
TSocialInfo tSocialInfo = null;
String temp;
List<TSocialInfo> socialist;
int res;
......@@ -3351,4 +3357,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
return mapSelectVo;
}
private Map<String, TSettleDomainSelectVo> getSelectVoMapById() {
R<TSettleDomainListVo> settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVo();
Map<String,TSettleDomainSelectVo> mapSelectVo = null;
if (Common.isNotNull(settleDomainR) && Common.isNotNull(settleDomainR.getData())){
mapSelectVo = settleDomainR.getData().getMapSelectVo();
}
if (Common.isEmpty(mapSelectVo)){
ServiceUtil.runTimeExceptionDiy(CommonConstants.SETTLE_DOMAIN_GET_ERROR);
}
return mapSelectVo;
}
}
......@@ -4,7 +4,7 @@ spring:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.65:43306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:43306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: yf_zsk
hikari:
......@@ -32,7 +32,7 @@ spring:
type: CLASS_BASED
tables:
t_payment_info:
actual-data-nodes: ds0.t_payment_info_20$->{17..22}
actual-data-nodes: ds0.t_payment_info_20$->{17..23}
key-generate-strategy:
column: ID
key-generator-name: snowflake
......
......@@ -4,7 +4,7 @@ spring:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.65:43306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.65:43306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: yf_zsk
hikari:
......@@ -32,7 +32,7 @@ spring:
type: CLASS_BASED
tables:
t_payment_info:
actual-data-nodes: ds0.t_payment_info_20$->{17..22}
actual-data-nodes: ds0.t_payment_info_20$->{17..23}
key-generate-strategy:
column: ID
key-generator-name: snowflake
......
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