Commit 209c9e78 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 4cb241c7 008ca5c0
......@@ -2335,6 +2335,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
audit.setLinkId(contract.getId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRootName("提交申请");
contractAuditMapper.insert(audit);
}
private void saveEmp(Map<String, EmpAddDispatchVo> empAddsMap) {
......
......@@ -431,7 +431,7 @@
${tEmployeeContractInfo.authSql}
</if>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</select>
<!--list-->
......@@ -443,7 +443,7 @@
a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</select>
<!--导出-->
......@@ -459,7 +459,7 @@
</if>
</where>
GROUP BY a.id
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</select>
<!--导出历史合并-->
......@@ -479,7 +479,7 @@
</if>
</where>
GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</select>
<!--tEmployeeContractInfo简单分页查询-->
......@@ -537,7 +537,7 @@
${tEmployeeContractInfo.authSql}
</if>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
<if test="tEmployeeContractInfo != null">
<if test="tEmployeeContractInfo.limitStart != null">
limit #{tEmployeeContractInfo.limitStart},#{tEmployeeContractInfo.limitEnd}
......
package com.yifu.cloud.plus.v1.yifu.common.core.config;
import ch.qos.logback.core.util.ExecutorServiceUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Configuration;
......@@ -35,7 +36,7 @@ public class AsyncConfig implements AsyncConfigurer {
* 1)<!-- 线程池维护线程的最少数量,即使没有任务需要执行,也会一直存活 -->
* 2)<!-- 设置allowCoreThreadTimeout=true(默认false)时,核心线程会超时关闭 -->
*/
taskExecutor.setCorePoolSize(2);
taskExecutor.setCorePoolSize(10);
/**
* <!-- 允许的空闲时间,当线程空闲时间达到keepAliveTime时,线程会退出,直到线程数量=corePoolSize -->
* <!-- 如果allowCoreThreadTimeout=true,则会直到线程数量=0 -->
......@@ -46,7 +47,7 @@ public class AsyncConfig implements AsyncConfigurer {
* <!-- 当线程数>=corePoolSize,且任务队列已满时。线程池会创建新线程来处理任务 -->
* <!-- 当线程数=maxPoolSize,且任务队列已满时,线程池会拒绝处理任务而抛出异常,异常见下
*/
taskExecutor.setMaxPoolSize(8);
taskExecutor.setMaxPoolSize(50);
/**
* <!-- 缓存队列(阻塞队列)当核心线程数达到最大时,新任务会放在队列中排队等待执行 -->
*/
......@@ -54,11 +55,13 @@ public class AsyncConfig implements AsyncConfigurer {
/**
* 建议配置threadNamePrefix属性,出问题时可以更方便的进行排查。
**/
taskExecutor.setThreadNamePrefix("CRM_TO_HRO_EXECUTOR");
taskExecutor.setThreadNamePrefix("HRO_TO_EKP_EXECUTOR");
// 捕捉线程队列满的 拒绝处理
taskExecutor.setRejectedExecutionHandler((Runnable r, ThreadPoolExecutor exe) -> {
log.info("当前任务线程池队列已满.");
});
taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
/* taskExecutor.setRejectedExecutionHandler((Runnable r, ThreadPoolExecutor exe) -> {
log.error("当前任务线程池队列已满.");
});*/
//初始化
taskExecutor.initialize();
return taskExecutor;
......
......@@ -62,6 +62,10 @@ public class Common {
return null == obj || "".equals(obj) || "null".equals(obj);
}
public static boolean isEmpty(List obj) {
return (null == obj || obj.size() == 0);
}
public static boolean isNotNull(Object obj) {
return null != obj && !"".equals(obj) && !"null".equals(obj);
}
......
ekpfund.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekpfund.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
ekpfund.fdModelId=181d741547a691aa68b16149a40de901
ekpfund.fdFlowId=18290af372be55308327273487abf72a
ekpfund.docStatus=20
......
income.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
#income.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
#income.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
income.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
income.fdModelIdManage=181d76db26e419a88dba97b0c406689e
income.fdFlowIdManage=182d3b6e522b2690119e70d4ff082136
income.fdModelIdRisk=181d76db26e4112e14b9bb4274d06ba1
......
insurance.insuranceUrl=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
#insurance.insuranceUrl=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
#insurance.insuranceUrl=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
insurance.insuranceUrl=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
insurance.insuranceFdModelId=181d73279372e5a55438a47d7436ab7e
insurance.insuranceFdFlowId=18267f206233f29cbd3c5ee425c9408a
insurance.insuranceDocStatus=20
......
ekporder.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
#ekporder.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
#ekporder.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekporder.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
ekporder.orderFdModelId=182f1b7ffe2e96f975564e44e559847d
ekporder.orderFdFlowId=182f1c098ce991ca96bc927408792beb
ekporder.replyFdModelId=182f1bb35bb2156fb9a02904bc88dd8a
......
ekp.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
#ekp.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
#ekp.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekp.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
ekp.fdModelId=181d7633ff8bc797276d0d3a54e80ad6
ekp.fdFlowId=182b40249c1bc940d7226b941c7a4183
ekp.docStatus=20
......
ekpsocial.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekpsocial.url=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
ekpsocial.fdModelId=181d741547a69ba9dbc12377948e98fd
ekpsocial.fdFlowId=18233028fe91511376b00f74b3a8f3a7
ekpsocial.docStatus=20
......
......@@ -1531,10 +1531,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryAccountItem sai;
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
a = new TSalaryAccount();
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 当月实发合计
BigDecimal actualSalarySum = BigDecimal.ZERO;
try {
SalaryAccountUtil.reflectionAttr(savList.get(i), a);
if (!haveSalaryFlag && a.getHaveSalaryFlag() != null && a.getHaveSalaryFlag() == CommonConstants.ONE_INT) {
......@@ -1549,11 +1545,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
for (int j = 0; j < savList.get(i).getSaiList().size(); j++) {
sai = new TSalaryAccountItem();
SalaryAccountUtil.reflectionAttr(savList.get(i).getSaiList().get(j), sai);
//个人实发合计
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(sai.getJavaFiedName())) {
actualSalarySum = actualSalarySum.add(sai.getSalaryMoney());
actualSalarySumNow = actualSalarySumNow.add(sai.getSalaryMoney());
}
saiList.add(sai);
}
}
......@@ -1645,7 +1636,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationLabor(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
private BigDecimal calculationLabor(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
List<TSalaryAccountItem> saiList, TSalaryAccount a) {
// B7 = 当月实发合计
// 税=ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
......@@ -1655,12 +1646,17 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal actualSalarySumT;
// 当月实发合计
BigDecimal actualSalarySum = BigDecimal.ZERO;
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
// 个人承担部分历史个税合计
BigDecimal sumOtherTax;
BigDecimal sumOtherTax = BigDecimal.ZERO;
// 历史应发合计
BigDecimal sumSalaryTax = BigDecimal.ZERO;
List<TSalaryAccount> list = tSalaryAccountService.list(Wrappers.<TSalaryAccount>query().lambda()
.eq(TSalaryAccount::getEmpIdcard,a.getEmpIdcard())
.eq(TSalaryAccount::getFormType,CommonConstants.THREE_STRING)
.eq(TSalaryAccount::getSalaryMonth,a.getSalaryMonth())
.eq(TSalaryAccount::getDeleteFlag,CommonConstants.ZERO_INT));
// 本次实发
for (TSalaryAccountItem item : itemList) {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
......@@ -1668,17 +1664,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
actualSalarySumNow = actualSalarySumNow.add(item.getSalaryMoney());
}
}
// 历史实发、个税
for (TSalaryAccountItem item : itemHistoryList) {
if (SalaryConstants.SALARY_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(item.getJavaFiedName())) {
sumSalaryTax = sumSalaryTax.add(item.getSalaryMoney());
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
actualSalarySum = actualSalarySum.add(item.getSalaryMoney());
}
for (TSalaryAccount account: list) {
sumOtherTax = sumOtherTax.add(BigDecimalUtils.safeAdd(account.getSalaryTax(),account.getSalaryTaxUnit()));
sumSalaryTax = sumSalaryTax.add(account.getRelaySalaryUnit());
actualSalarySum = actualSalarySum.add(account.getRelaySalary());
}
//个人承担部分税费
BigDecimal nowTaxT;
......@@ -1689,17 +1678,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 1个人承担部分
if (SalaryConstants.IS_PERSON_TAX_ARR[1].equals(a.getIsPersonTax())) {
nowTaxT = getNowTax(actualSalarySumNow);
if (actualSalarySum.compareTo(actualSalarySumNow) != 0) {
//计算历史税费
sumOtherTax = getNowTaxNew(sumSalaryTax);
//计算本月实发合计
if (sumSalaryTax.compareTo(BigDecimal.ZERO) != 0) {
//计算本月应发合计
actualSalarySumT = BigDecimalUtils.safeAdd(nowTaxT, sumSalaryTax, actualSalarySumNow).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
//累计税费
nowTaxY = getNowTaxNew(actualSalarySumT);
if (sumOtherTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
nowTaxY = BigDecimalUtils.safeSubtract(false,nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
salaryTax = BigDecimalUtils.safeSubtract(nowTaxY, nowTaxT);
salaryTax = BigDecimalUtils.safeSubtract(false,nowTaxY, nowTaxT);
} else {
nowTaxY = nowTaxT;
}
......@@ -1708,15 +1695,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
a.setSalaryTax(salaryTax);
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow, salaryTax));
a.setActualSalary(BigDecimalUtils.safeSubtract(false,actualSalarySumNow, salaryTax));
} else if (SalaryConstants.IS_PERSON_TAX_ARR[0].equals(a.getIsPersonTax())) {
// 0公司承担全部
nowTaxY = getNowTax(actualSalarySum);
a.setActualSalary(actualSalarySumNow);
if (sumSalaryTax.compareTo(BigDecimal.ZERO) != 0) {
if (sumOtherTax.compareTo(BigDecimal.ZERO) != 0) {
//历史应发税费
sumOtherTax = getNowTax(sumSalaryTax);
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
nowTaxY = BigDecimalUtils.safeSubtract(false,nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
a.setSalaryTaxUnit(nowTaxY);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
......
......@@ -408,7 +408,7 @@ public class TPreDispatchInfo extends BaseEntity {
* 小合同名称
*/
@Schema(description ="小合同名称")
@ExcelAttribute(name = "小合同名称", maxLength = 20)
@ExcelAttribute(name = "小合同名称", maxLength = 100)
private String contractMinorName;
/**
......
......@@ -26,7 +26,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
......@@ -40,7 +39,7 @@ import java.util.Date;
@Schema(description = "派单导出Vo")
public class TDispatchInfoExportVo {
@ExcelAttribute(name = "派单类型", readConverterExp = "0=增加派单,1=减少派单")
@ExcelAttribute(name = "派单类型", readConverterExp = "0=派增,1=派减")
@Schema(description = "派单类型:0派增1派减")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("派单类型")
......@@ -85,10 +84,9 @@ public class TDispatchInfoExportVo {
/**
* 合同类型(字典值)
*/
@NotNull(message = "合同类型不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="合同类型")
@ExcelAttribute(name = "合同类型",isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
@ExcelAttribute(name = "合同类型")
private String contractType;
/**
......@@ -130,7 +128,6 @@ public class TDispatchInfoExportVo {
/**
* 备案基数
*/
@Length(max = 255, message = "备案基数 不能超过255 个字符" )
@ExcelAttribute(name = "备案基数", isFloat = true,max = "999999999.99")
@Schema(description = "备案基数:购买社保时必填" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -189,7 +186,7 @@ public class TDispatchInfoExportVo {
@ExcelProperty("公积金停缴日期" )
private Date fundReduceDate;
@ExcelAttribute(name = "社保审核状态", readConverterExp = "0=待审核,1=审核通过,2=审核不通过")
@ExcelAttribute(name = "社保审核状态", readConverterExp = "0=未提交,1=待审核,2=审核通过,3=审核不通过,4=已办结")
@Schema(description = "社保审核状态:1待审核2审核通过3审核不通过4已办结")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保审核状态")
......@@ -224,7 +221,6 @@ public class TDispatchInfoExportVo {
/**
* 社保办理时间
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "社保办理时间", isDate = true)
@Schema(description = "社保办理时间" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -234,7 +230,7 @@ public class TDispatchInfoExportVo {
/**
* 审核状态(0待审核/1已审核)
*/
@ExcelAttribute(name = "公积金审核状态",readConverterExp = "0=未审核,1=审核通过,2=审核不通过")
@ExcelAttribute(name = "公积金审核状态",readConverterExp = "0=未提交,1=待审核,2=审核通过,3=审核不通过,4=已办结")
@Schema(description = "公积金审核状态:(0待审核/1已审核)" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金审核状态" )
......@@ -258,7 +254,6 @@ public class TDispatchInfoExportVo {
/**
* 公积金办理人
*/
@Length(max = 32, message = "公积金办理人 不能超过32个字符" )
@ExcelAttribute(name = "公积金办理人", maxLength = 32)
@Schema(description = "公积金办理人" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -267,7 +262,6 @@ public class TDispatchInfoExportVo {
/**
* 公积金办理时间
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "公积金办理时间", isDate = true)
@Schema(description = "公积金办理时间" )
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -348,7 +342,7 @@ public class TDispatchInfoExportVo {
* 减少原因
*/
@Length(max = 32, message = "减少原因 不能超过32个字符" )
@ExcelAttribute(name = "减少原因", maxLength = 32)
@ExcelAttribute(name = "减少原因", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.REDUCE_SOCIAL_REASON)
@Schema(description = "减少原因" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("减少原因" )
......@@ -366,10 +360,10 @@ public class TDispatchInfoExportVo {
private String organName;
/**
* 0未提交1待审核2审核通过3审核不通过4办理完成
* 0未提交1待审核2审核通过3审核不通过4已办结
*/
@ExcelAttribute(name = "派单状态",readConverterExp = "0=未提交,1=待审核,2=审核通过,3=审核不通过,4=办理完成")
@Schema(description = "0未提交1待审核2审核通过3审核不通过4办理完成" )
@ExcelAttribute(name = "派单状态",readConverterExp = "0=未提交,1=待审核,2=审核通过,3=审核不通过,4=已办结")
@Schema(description = "0未提交1待审核2审核通过3审核不通过4已办结" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("派单状态" )
private String status;
......@@ -380,8 +374,8 @@ public class TDispatchInfoExportVo {
@ExcelProperty("申请编码")
private String applyNo;
@ExcelAttribute(name = "社保办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=部分办理成功,4=办理中")
@Schema(description = "社保办理状态 0 待办理 1 办理成功 2 办理失败 3 部分办理成功 4 办理中")
@ExcelAttribute(name = "社保办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=部分办理失败,4=办理中")
@Schema(description = "社保办理状态 0 待办理 1 办理成功 2 办理失败 3 部分办理失败 4 办理中")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保办理状态")
private String socialHandleStatus;
......@@ -432,7 +426,6 @@ public class TDispatchInfoExportVo {
/**
* 审核时间
*/
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "派单审核时间", isDate = true)
@Schema(description = "派单审核时间" )
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -359,7 +359,7 @@ public class TPreDispatchReduceVo {
* 小合同名称
*/
@Schema(description ="小合同名称")
@ExcelAttribute(name = "小合同名称", maxLength = 20)
@ExcelAttribute(name = "小合同名称", maxLength = 100)
private String contractMinorName;
/**
......
......@@ -284,8 +284,8 @@ public class TPreDispatchUpdateVo extends TPreDispatchInfo {
/**
* 小合同名称
*/
@Length(max = 20, message = "小合同名称不能超过20个字符")
@ExcelAttribute(name = "小合同名称", maxLength = 20)
@Length(max = 100, message = "小合同名称不能超过100个字符")
@ExcelAttribute(name = "小合同名称", maxLength = 100)
private String contractMinorName;
/**
* 唯一号
......
......@@ -87,9 +87,9 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
if (CommonConstants.ONE_STRING.equals(hold.getDelFlag())
&& baseSetInfoMapper.selectCount(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, hold.getType())
.eq(SysBaseSetInfo::getBaseType, holdInfo.getType())
.le(SysBaseSetInfo::getApplyStartDate, DateUtil.getCurrentDateTime())
.in(SysBaseSetInfo::getDepartId,hold.getId())
.in(SysBaseSetInfo::getDepartId,holdInfo.getId())
.eq(SysBaseSetInfo::getStatus,CommonConstants.ZERO_STRING)
.eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.and(obj-> obj.isNull(SysBaseSetInfo::getApplyEndDate).or()
......
......@@ -1025,9 +1025,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setSettleDomain(setInfoVo.getId());
socialFund.setSettleDomainName(setInfoVo.getDepartName());
socialFund.setSettleDomainCode(setInfoVo.getDepartNo());
socialFund.setSettleDomainFund(setInfoVo.getId());
socialFund.setSettleDomainNameFund(setInfoVo.getDepartName());
socialFund.setSettleDomainCodeFund(setInfoVo.getDepartNo());
socialFund.setUnitName(setInfoVo.getCustomerName());
socialFund.setUnitId(setInfoVo.getCustomerId());
socialFund.setUnitIdFund(setInfoVo.getCustomerId());
......
......@@ -43,6 +43,7 @@ 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.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.util.DoJointSocialTask;
import com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo;
......@@ -79,6 +80,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Autowired
private TPaymentInfoMapper tPaymentInfoMapper;
@Autowired
private DoJointSocialTask doJointSocialTask;
/**
* 收入明细表简单分页查询
*
......@@ -729,29 +733,12 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
TIncome income = new TIncome();
BeanUtil.copyProperties(tIncomeDetail, income);
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
if (Common.isEmpty(sendBack) || sendBack.length() != 32) {
sendBack = this.getSendBack(income);
}
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FOUR_STRING);
error.setCreateUserName("收入表推送");
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
}
income.setApplyNo(tIncomeDetail.getApplyNo());
return this.updateById(income);
this.save(income);
long start = System.currentTimeMillis();
doJointSocialTask.asynchronousEkpIncome(income);
log.error("线程执行耗时:"+ (System.currentTimeMillis()-start));
return true;
}
/**
......
package com.yifu.cloud.plus.v1.yifu.social.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
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.service.TSendEkpErrorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 主要执行人员档案的员工类型同步更新
* @author huyc
* @Date 2022-07-08
* @Description 多线程的执行demo
*/
@Slf4j
@Component
public class DoJointSocialTask {
@Autowired
private EkpIncomeUtil ekpIncomeUtil;
@Autowired
private TSendEkpErrorService tSendEkpErrorService;
@Autowired
private TIncomeMapper incomeMapper;
/**
* @Description: 合同-批量更换负责人
* @Author: huyc
* @Date: 2022-7-8
* @return: void
**/
@Async
public void asynchronousEkpIncome(TIncome income) {
log.info("推送收入到EKP-线程开始");
try {
String sendBack = this.getSendBack(income);
if (Common.isEmpty(sendBack) || sendBack.length() != 32) {
sendBack = this.getSendBack(income);
}
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
incomeMapper.updateById(income);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FOUR_STRING);
error.setCreateUserName("收入表推送");
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FOUR_STRING);
error.setCreateUserName("收入表推送");
error.setLinkId(income.getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
log.error("推送收入到EKP错误", e);
}
log.info("推送收入到EKP结束");
}
/**
* @param income
* @Description: 判断类型发送
* @Author: hgw
* @Date: 2022/9/6 15:15
* @return: java.lang.String
**/
private String getSendBack(TIncome income) {
String sendBack;
if (CommonConstants.ONE_STRING.equals(income.getFeeType())) {
EkpIncomeParamManage sendParam = new EkpIncomeParamManage();
this.copyToEkpManage(income, sendParam);
sendBack = ekpIncomeUtil.sendToEkpManage(sendParam);
} else {
EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk();
this.copyToEkpRisk(income, sendParam);
sendBack = ekpIncomeUtil.sendToEkpRisk(sendParam);
}
return sendBack;
}
/**
* @param income 收入
* @param sendParam 目标格式
* @Description: 转化格式,传到EKP
* @Author: hgw
* @Date: 2022/9/5 16:57
* @return: void
**/
private void copyToEkpManage(TIncome income, EkpIncomeParamManage sendParam) {
// 项目编码
sendParam.setFd_3adfef5e5b9d34(income.getDeptNo());
// 项目名称
sendParam.setFd_3adfef5eb6691c(income.getDeptName());
// 单号
sendParam.setFd_3adfef7f5d2b52("");
// 客户编码
sendParam.setFd_3adfef80202ab2(income.getUnitNo());
// 客户名称
sendParam.setFd_3adfef7fc1c886(income.getUnitName());
// 类型:单选(人,人次,比例,固定值,总额)
// feeMode收费方式:1按比例2金额-人数3金额-人次
if (CommonConstants.ONE_STRING.equals(income.getFeeMode())) {
sendParam.setFd_3adda3037e3bda("比例");
} else if (CommonConstants.TWO_STRING.equals(income.getFeeMode())) {
sendParam.setFd_3adda3037e3bda("人数");
} else {
sendParam.setFd_3adda3037e3bda("人次");
}
// 产生来源:单选(社保,工资,商险)
// sourceType1社保2公积金3商险4薪资
if (CommonConstants.THREE_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("商险");
} else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("工资");
} else {
sendParam.setFd_3adda320daef5a("社保");
}
// 姓名
sendParam.setFd_3adfef948da848(income.getEmpName());
// 身份证号
sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard());
// 生成月份
if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) {
sendParam.setFd_3ae0c23b2e9a92(SocialConstants.YEAR_1970);
} else {
sendParam.setFd_3ae0c23b2e9a92(income.getCreateMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6));
}
// 结算月份
if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) {
sendParam.setFd_3ae0c23cb3fccc(SocialConstants.YEAR_1970);
} else {
sendParam.setFd_3ae0c23cb3fccc(income.getPayMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6));
}
// 管理费、风险金金额
sendParam.setFd_3adfef963bae28(String.valueOf(income.getMoney()));
// 应收
sendParam.setFd_3adfefa3daae72(String.valueOf(income.getMoney()));
// 结算状态
sendParam.setFd_3adfefaaa3bbd0("未结算");
// 收款状态
sendParam.setFd_3adfefaaef583e("未收");
// 结算单号
sendParam.setFd_3aead3c68b1078("");
// 收款单号
sendParam.setFd_3aeae58b14691c("");
// 管理费id
sendParam.setFd_3b13dae9bd70f8(income.getId());
// 薪酬申请编号
sendParam.setFd_3b3bf13759b850(income.getApplyNo()==null?"":income.getApplyNo());
}
private void copyToEkpRisk(TIncome income, EkpIncomeParamRisk sendParam) {
// 项目编码
sendParam.setFd_3adfef5e5b9d34(income.getDeptNo());
// 项目名称
sendParam.setFd_3adfef5eb6691c(income.getDeptName());
// 单号
sendParam.setFd_3adfef7f5d2b52("");
// 客户编码
sendParam.setFd_3adfef80202ab2(income.getUnitNo());
// 客户名称
sendParam.setFd_3adfef7fc1c886(income.getUnitName());
// 类型:单选(人,人次,比例,固定值,总额)
// feeMode收费方式:1按比例2金额-人数3金额-人次
if (CommonConstants.ONE_STRING.equals(income.getFeeMode())) {
sendParam.setFd_3adda3037e3bda("比例");
} else if (CommonConstants.TWO_STRING.equals(income.getFeeMode())) {
sendParam.setFd_3adda3037e3bda("人数");
} else {
sendParam.setFd_3adda3037e3bda("人次");
}
// 产生来源:单选(社保,工资,商险)
// sourceType1社保2公积金3商险4薪资
if (CommonConstants.THREE_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("商险");
} else if (CommonConstants.FOUR_STRING.equals(income.getSourceType())) {
sendParam.setFd_3adda320daef5a("工资");
} else {
sendParam.setFd_3adda320daef5a("社保");
}
// 姓名
sendParam.setFd_3adfef948da848(income.getEmpName());
// 身份证号
sendParam.setFd_3adfef94dcdbb4(income.getEmpIdcard());
// 生成月份
if (Common.isEmpty(income.getCreateMonth()) || income.getCreateMonth().length() != 6) {
sendParam.setFd_3ae0c3032cffc8(SocialConstants.YEAR_1970);
} else {
sendParam.setFd_3ae0c3032cffc8(income.getCreateMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getCreateMonth().substring(4, 6));
}
// 结算月份
if (Common.isEmpty(income.getPayMonth()) || income.getPayMonth().length() != 6) {
sendParam.setFd_3ae0c3044e5958(SocialConstants.YEAR_1970);
} else {
sendParam.setFd_3ae0c3044e5958(income.getPayMonth().substring(0, 4)
+ CommonConstants.CENTER_SPLIT_LINE_STRING + income.getPayMonth().substring(4, 6));
}
// 管理费、风险金金额
sendParam.setFd_3adfef963bae28(String.valueOf(income.getMoney()));
// 应收
sendParam.setFd_3adfefa3daae72(String.valueOf(income.getMoney()));
// 结算状态
sendParam.setFd_3adfefaaa3bbd0("未结算");
// 收款状态
sendParam.setFd_3adfefaaef583e("未收");
// 结算单号
sendParam.setFd_3aead7204bb594("");
// 收款单号
sendParam.setFd_3aeae59b70fe5a("");
// 风险金id
sendParam.setFd_3b13dac4c03022(income.getId());
// 薪酬申请编号
sendParam.setFd_3b3bf0e75ef6c4(income.getApplyNo()==null?"":income.getApplyNo());
}
}
......@@ -119,6 +119,7 @@
<result property="unemployHandle" column="UNEMPLOY_HANDLE"/>
<result property="workInjuryHandle" column="WORK_INJURY_HANDLE"/>
<result property="birthHandle" column="BIRTH_HANDLE"/>
<result property="fundReduceDate" column="FUND_REDUCE_DATE"/>
<result property="bigailmentHandle" column="BIGAILMENT_HANDLE"/>
<result property="fundHandleStatus" column="FUND_HANDLE_STATUS"/>
<result property="createName" column="CREATE_NAME"/>
......@@ -569,15 +570,11 @@
a.SOCIAL_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME
FROM t_dispatch_info a
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
left join t_socialfund_house_res p on p.USER_ID = #{tDispatchInfo.createBy}
</if>
<where>
1=1
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
1=1
<include refid="tDispatchInfo_where"/>
</where>
order by a.APPLY_NO desc
</select>
<!--tDispatchInfo简单分页查询-->
......@@ -592,7 +589,7 @@
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</select>
<!-- 派单导出 -->
......@@ -607,17 +604,17 @@
a.SOCIAL_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME,
a.SOCIAL_HANDLE_STATUS,
s.PENSION_HANDLE,
s.MEDICAL_HANDLE,
s.UNEMPLOY_HANDLE,
s.WORK_INJURY_HANDLE,
s.BIRTH_HANDLE,
s.BIGAILMENT_HANDLE,
IF(a.TYPE='0',s.PENSION_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as PENSION_HANDLE,
IF(a.TYPE='0',s.MEDICAL_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as MEDICAL_HANDLE,
IF(a.TYPE='0',s.UNEMPLOY_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as UNEMPLOY_HANDLE,
IF(a.TYPE='0',s.WORK_INJURY_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as WORK_INJURY_HANDLE,
IF(a.TYPE='0',s.BIRTH_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as BIRTH_HANDLE,
IF(a.TYPE='0',s.BIGAILMENT_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as BIGAILMENT_HANDLE,
a.FUND_HANDLE_STATUS,
a.CREATE_NAME,
a.ORGAN_NAME,
a.CREATE_TIME,
a.CONTRACT_TYPE,
a.CONTRACT_NAME AS CONTRACT_TYPE,
a.CONTRACT_SUB_NAME,
a.CONTRACT_TERM,
a.CONTRACT_START,
......@@ -631,15 +628,16 @@
a.AUDIT_TIME,
a.FUND_HANDLE_REMARK,
a.SOCIAL_HANDLE_REMARK,
a.FUND_REDUCE_DATE,
c.PROVIDENT_START,
c.AUDIT_STATUS as FUND_AUDIT_STATUS,
if(a.FUND_ID = NULL,'',a.STATUS) as FUND_AUDIT_STATUS,
c.AUDIT_USER as FUND_AUDIT_USER,
c.HANDLE_USER as FUND_HANDLE_USER,
c.HANDLE_TIME as FUND_HANDLE_TIME,
s.AUDIT_USER as AUDIT_USER_NAME,
s.AUDIT_STATUS,
if(a.SOCIAL_ID =NULL,'',a.STATUS) as AUDIT_STATUS,
s.SOCIAL_START_DATE,
s.SOCIAL_REDUCE_DATE,
a.SOCIAL_REDUCE_DATE,
s.RECORD_BASE,
s.HANDLE_USER,
s.HANDLE_TIME,
......@@ -656,7 +654,7 @@
a.DELETE_FLAG = '0'
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
<if test="tDispatchInfo.limitStart != null">
limit #{tDispatchInfo.limitStart},#{tDispatchInfo.limitEnd}
</if>
......@@ -708,7 +706,7 @@
a.DELETE_FLAG = '0' and a.STATUS = '1'
<include refid="tDispatchInfoAudit_where"/>
</where>
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
<if test="tDispatchInfo.limitStart != null">
limit #{tDispatchInfo.limitStart},#{tDispatchInfo.limitEnd}
</if>
......@@ -918,9 +916,6 @@
</select>
<sql id="where_getSocialRecordRoster">
FROM t_dispatch_info a
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
left join t_socialfund_house_res p on p.USER_ID = #{tDispatchInfo.createBy}
</if>
left join t_social_info s on a.SOCIAL_ID = s.id
<where>
s.DELETE_FLAG = 0
......@@ -1026,15 +1021,12 @@
</if>
</if>
group by a.id
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</where>
</sql>
<sql id="where_getFundRecord">
FROM t_dispatch_info a
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
left join t_socialfund_house_res p on p.USER_ID = #{tDispatchInfo.createBy}
</if>
left join t_provident_fund f on a.FUND_ID = f.id
<where>
a.DELETE_FLAG = 0
......@@ -1139,7 +1131,7 @@
</if>
</if>
group by a.id
order by a.CREATE_TIME desc
order by a.APPLY_NO desc
</where>
</sql>
......
......@@ -629,7 +629,8 @@
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
</resultMap>
<!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoPage" resultMap="tPaymentInfoMap">
<select id="getTPaymentInfoPage" resultMap="tPaymentInfoMap"
resultType="com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo">
SELECT
a.ID,
a.EMP_NAME,
......
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