diff --git a/resource/sqlupgrade/DM/sql202312130203.sql b/resource/sqlupgrade/DM/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/DM/sql202401080103.sql b/resource/sqlupgrade/DM/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/GS/sql202312130203.sql b/resource/sqlupgrade/GS/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202401080103.sql b/resource/sqlupgrade/GS/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/JC/sql202312130203.sql b/resource/sqlupgrade/JC/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202401080103.sql b/resource/sqlupgrade/JC/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql new file mode 100644 index 000000000..15acb233a --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; diff --git a/resource/sqlupgrade/Mysql/sql202401080103.sql b/resource/sqlupgrade/Mysql/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312130203.sql b/resource/sqlupgrade/Oracle/sql202312130203.sql new file mode 100644 index 000000000..f62d861b8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401080103.sql b/resource/sqlupgrade/Oracle/sql202401080103.sql new file mode 100644 index 000000000..fc148da4a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202206090403.sql b/resource/sqlupgrade/PG/sql202206090403.sql index 679a8cc59..8f5d32f79 100644 --- a/resource/sqlupgrade/PG/sql202206090403.sql +++ b/resource/sqlupgrade/PG/sql202206090403.sql @@ -1,3 +1,3 @@ -ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int NOT NULL ; +ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int ; -ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int NOT NULL ; \ No newline at end of file +ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int ; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312130203.sql b/resource/sqlupgrade/PG/sql202312130203.sql new file mode 100644 index 000000000..9b9630ce6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401080103.sql b/resource/sqlupgrade/PG/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312130203.sql b/resource/sqlupgrade/SQLServer/sql202312130203.sql new file mode 100644 index 000000000..0738202b3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar(10) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401080103.sql b/resource/sqlupgrade/SQLServer/sql202401080103.sql new file mode 100644 index 000000000..ff92fddf9 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312130203.sql b/resource/sqlupgrade/ST/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/ST/sql202401080103.sql b/resource/sqlupgrade/ST/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java index 7d6d22fb7..838c4c494 100644 --- a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java +++ b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java @@ -1,12 +1,14 @@ package com.engine.salary.action; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryAcctRecordService; import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; import weaver.interfaces.workflow.action.Action; @@ -59,8 +61,19 @@ public class FileSalaryAcctRecordAction implements Action { } User user = new User(); user.setUid(1); + Long acctRecordId = Long.valueOf(salaryAcctRecordId); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(acctRecordId); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() > 1) { + BaseBean baseBean = new BaseBean(); + baseBean.writeLog("核算记录归档action, 该核算记录已经归档:" + salaryAcctRecordPO.getId()); + return SUCCESS; + } try { - getSalaryAcctRecordService(user).file(Long.valueOf(salaryAcctRecordId)); + getSalaryAcctRecordService(user).file(acctRecordId); } catch (Exception e) { requestInfo.getRequestManager().setMessage(e.getMessage()); return FAILURE_AND_CONTINUE; diff --git a/src/com/engine/salary/action/SendSalaryAction.java b/src/com/engine/salary/action/SendSalaryAction.java new file mode 100644 index 000000000..f0f3ef154 --- /dev/null +++ b/src/com/engine/salary/action/SendSalaryAction.java @@ -0,0 +1,118 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.biz.SalarySendInfoBiz; +import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.SalaryBillService; +import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.service.impl.SalaryBillServiceImpl; +import com.engine.salary.service.impl.SalarySendServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName FileSalaryAcctRecordAction + * @date 2023/12/13 9:17 + * @description 工资单发放action + */ +@Slf4j +public class SendSalaryAction implements Action { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySendService getSalarySendService(User user) { + return ServiceUtil.getService(SalarySendServiceImpl.class, user); + } + + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); + } + + private SalarySendInfoBiz salarySendInfoMapper = new SalarySendInfoBiz(); + + private SalaryBillService getSalaryBillService(User user) { + return ServiceUtil.getService(SalaryBillServiceImpl.class, user); + } + + + /** + * 发放id(核算记录id,工资单id)流程字段名 + */ + private String idFieldName; + + /** + * 根据什么id(核算记录id,工资单id)发工资单 + */ + private String sendBy; + + + @Override + public String execute(RequestInfo requestInfo) { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + String idStr = fieldMap.get(idFieldName); + if (StringUtils.isBlank(idStr)) { + requestInfo.getRequestManager().setMessage("核算记录id或工资单id不能为空"); + return FAILURE_AND_CONTINUE; + } + User user = new User(); + user.setUid(1); + Long id = Long.valueOf(idStr); + SalarySendPO salarySendPO; + if(!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salaryAcctRecordId")) { + // 根据核算记录id发 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(id); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() == 1) { + requestInfo.getRequestManager().setMessage("核算记录还未归档,请先归档"); + return FAILURE_AND_CONTINUE; + } + // 获取工资单id + List salarySendPOList = getSalarySendService(user).listSome(SalarySendPO.builder().salaryAccountingId(id).sendStatus(0).build()); + salarySendPO = salarySendPOList.get(0); + } else if (!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salarySendId")) { + // 根据工资单发 + salarySendPO = getSalarySendService(user).getById(id); + } else { + requestInfo.getRequestManager().setMessage("请先维护根据什么id发放工资单的sendBy参数"); + return FAILURE_AND_CONTINUE; + } + + if (salarySendPO == null || salarySendPO.getId() == null) { + requestInfo.getRequestManager().setMessage("工资单不存在或已被删除!"); + return FAILURE_AND_CONTINUE; + } + try { + // 全部发放 + getSalaryBillService(user).grant(SalarySendGrantParam.builder().salarySendId(salarySendPO.getId()).build()); + } catch (Exception e) { + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 34b6aae17..7c661b682 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -7,7 +7,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; @@ -631,11 +630,13 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -719,7 +720,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -742,10 +749,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -787,6 +795,7 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -794,6 +803,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -876,7 +886,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -899,10 +915,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -945,12 +962,14 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1036,7 +1055,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1059,10 +1084,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1510,7 +1536,6 @@ public class SIAccountBiz extends Service { } else { accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); } - } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { @@ -1532,11 +1557,13 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -1611,7 +1638,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1626,10 +1659,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1671,6 +1705,7 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -1678,6 +1713,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -1751,7 +1787,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1766,10 +1808,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1812,12 +1855,14 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1896,7 +1941,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1911,10 +1962,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1964,6 +2016,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 528849995..ff5fe4727 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1,5 +1,6 @@ package com.engine.salary.biz; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; @@ -13,8 +14,8 @@ import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; @@ -37,6 +38,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.enums.OpenEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -65,6 +70,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl @@ -113,6 +121,10 @@ public class SIArchivesBiz { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -266,15 +278,22 @@ public class SIArchivesBiz { */ public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + //判断是否要自动调整基数 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; default: } @@ -289,17 +308,47 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getOtherPaymentBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getOtherPaymentComBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -311,18 +360,49 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getFundPaymentBaseString()) + ? JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getFundPaymentComBaseString()) + ? JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } + List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -334,18 +414,48 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getSchemePaymentBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getSchemePaymentComBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -361,9 +471,27 @@ public class SIArchivesBiz { if (schemeId == null) { return new ArrayList<>(); } - List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new) - ); + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + SICategoryBiz siCategoryBiz = new SICategoryBiz(); + list.forEach(insuranceSchemeDetail -> { + ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); SICategoryBiz siCategoryBiz = new SICategoryBiz(); list.forEach(insuranceSchemeDetail -> { ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); @@ -621,17 +749,20 @@ public class SIArchivesBiz { * @param param * @param employeeId */ - public void insert(InsuranceArchivesSaveParam param, long employeeId) { + public void insert(InsuranceArchivesSaveParam param, User user) { SalaryAssert.notNull(param.getWelfareType(), "福利类型为空"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (param.getWelfareType()) { case SOCIAL_SECURITY: - socialSave(param, employeeId); + socialSave(param, user, welBaseDiffSign); break; case ACCUMULATION_FUND: - fundSave(param, employeeId); + fundSave(param, user, welBaseDiffSign); break; case OTHER: - otherSave(param, employeeId); + otherSave(param, user, welBaseDiffSign); break; default: throw new SalaryRunTimeException("福利类型不存在"); @@ -641,9 +772,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void otherSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); @@ -666,6 +798,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getOtherSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -677,6 +810,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); //新数据 InsuranceArchivesOtherSchemePO updateOtherInfo = InsuranceArchivesOtherSchemePO.builder() @@ -696,9 +830,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.updateById(updateOtherInfo); //更新base_info表状态 @@ -706,8 +848,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -732,9 +875,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.insert(insertOtherInfo); sqlSession.commit(); @@ -768,9 +919,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void fundSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); @@ -792,6 +944,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getFundSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -803,6 +956,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); //新数据 InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() .id(oldFundInfo.getId()) @@ -823,9 +977,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.updateById(updateFundInfo); //更新base_info表状态 @@ -833,8 +995,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -861,9 +1024,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.insert(insertFundInfo); sqlSession.commit(); @@ -899,10 +1070,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void socialSave(InsuranceArchivesSaveParam paramReq, long employeeId) { - + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); @@ -929,6 +1100,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getSocialSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -942,6 +1114,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); //新数据 InsuranceArchivesSocialSchemePO updateSocialInfo = InsuranceArchivesSocialSchemePO.builder() @@ -962,9 +1135,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.updateById(updateSocialInfo); //更新base_info表状态 @@ -972,8 +1153,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() @@ -1000,9 +1182,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.insert(insertSocialInfo); sqlSession.commit(); @@ -1040,14 +1230,11 @@ public class SIArchivesBiz { * @param paymentBaseString * @return */ - public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString) { + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { if (primaryId ==null || paymentBaseString == null) { return true; } - //设置缴纳对象和缴费状态 -// Integer paymentScope = 2; -// Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -1071,7 +1258,7 @@ public class SIArchivesBiz { return false; } List isPaymentList = insuranceSchemeDetailPOList.stream() - .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); if (isPaymentList.size() > 0) { InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); @@ -1097,6 +1284,64 @@ public class SIArchivesBiz { return true; } + + /** + * 校验福利基数是否符合上下限要求,并返回符合要求的数据 + * @param primaryId + * @param paymentBaseString + * @return + */ + public String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return paymentBaseString; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + Map newPaymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + if (paymentBaseJson == null) { + return null; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + + //判断福利值是否为空/数字 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("福利值非数字!"); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + //根据福利方案id、险种id + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + List checkList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (checkList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = checkList.get(0); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //数值低于对应福利明细下限 + log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}!", entry.getKey(), entry.getValue(), lowerLimit); + newPaymentBaseJson.put(entry.getKey(), lowerLimit); + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //数值高于对应福利明细上限 + log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} !", entry.getKey(), entry.getValue(), upperLimit); + newPaymentBaseJson.put(entry.getKey(), upperLimit); + } + } + } + return JSON.toJSONString(newPaymentBaseJson); + } + /** * 档案列表 *

@@ -1279,6 +1524,7 @@ public class SIArchivesBiz { * @return */ public List buildWeaTableColumns(List insuranceArchivesEmployeePOS, long operateId) { + Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId); List list = new ArrayList<>(); WeaTableColumn nameColumn = new WeaTableColumn("100px", "姓名", "employeeName"); @@ -1318,6 +1564,9 @@ public class SIArchivesBiz { * @return */ public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId) { + + boolean welBaseDiffSign = isDiffWelBase(); + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); @@ -1333,16 +1582,17 @@ public class SIArchivesBiz { Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); -// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); -// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); -// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; if (socialList.size() > 0) { for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { @@ -1351,6 +1601,14 @@ public class SIArchivesBiz { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } } @@ -1361,6 +1619,14 @@ public class SIArchivesBiz { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } } @@ -1371,11 +1637,20 @@ public class SIArchivesBiz { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); @@ -1385,34 +1660,76 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); + + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() .sorted(Map.Entry.comparingByKey()) @@ -1426,6 +1743,23 @@ public class SIArchivesBiz { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1448,6 +1782,9 @@ public class SIArchivesBiz { * @return */ public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + + boolean welBaseDiffSign = isDiffWelBase(); + List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -1495,16 +1832,39 @@ public class SIArchivesBiz { map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); map.put("socialEndTime", socialItem.getSocialEndTime()); @@ -1514,16 +1874,39 @@ public class SIArchivesBiz { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); map.put("fundEndTime", fundItem.getFundEndTime()); @@ -1533,16 +1916,39 @@ public class SIArchivesBiz { map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); } @@ -1565,6 +1971,19 @@ public class SIArchivesBiz { } return insuranceIdList; } + + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + /** * 获取信息提示 */ @@ -1906,6 +2325,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getSocialSchemeId()) .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1915,6 +2335,7 @@ public class SIArchivesBiz { InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); @@ -1936,6 +2357,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getFundSchemeId()) .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1945,6 +2367,7 @@ public class SIArchivesBiz { InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!")); @@ -1965,6 +2388,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getOtherSchemeId()) .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1974,6 +2398,7 @@ public class SIArchivesBiz { InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!")); @@ -1987,6 +2412,8 @@ public class SIArchivesBiz { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); + boolean welBaseDiffSign = isDiffWelBase(); + List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2005,6 +2432,7 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2039,12 +2467,75 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } } + //如果系统应用设置拆分了个人和公司福利基数,则对adjustBeforeComBaseJson,adjustAfterComBaseJson也进行处理 + if (welBaseDiffSign) { + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } return toCreateAdjustHistoryList; } @@ -2123,4 +2614,12 @@ public class SIArchivesBiz { list.add(new WeaTableColumn("150px", "操作时间", "operatorTime")); return list; } + + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } } diff --git a/src/com/engine/salary/component/WeaTableColumnGroup.java b/src/com/engine/salary/component/WeaTableColumnGroup.java index dac9a3569..0dcd305af 100644 --- a/src/com/engine/salary/component/WeaTableColumnGroup.java +++ b/src/com/engine/salary/component/WeaTableColumnGroup.java @@ -18,6 +18,11 @@ public class WeaTableColumnGroup extends WeaTableColumn { */ private Integer pattern; + /** + * 字段类型 + */ + private String dataType; + private List children; public WeaTableColumnGroup() { @@ -40,6 +45,13 @@ public class WeaTableColumnGroup extends WeaTableColumn { this.pattern = pattern; } + public WeaTableColumnGroup(String width, String text, String column, String lockStatus, Integer pattern, String dataType) { + super(width, text, column); + this.lockStatus = lockStatus; + this.pattern = pattern; + this.dataType = dataType; + } + public WeaTableColumnGroup(String width, String text, String column, List children) { super(width, text, column); diff --git a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java index 6a23857a5..06cb10a8a 100644 --- a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java +++ b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java @@ -62,7 +62,6 @@ public class SalaryAcctResultReportBO { .collect(Collectors.toList()); } - public static List convert2ReportPO(Collection temps, Map emps) { // Map longDataCollectionEmployeeMap = SalaryEntityUtil.convert2Map(emps, DataCollectionEmployee::getEmployeeId); if (CollectionUtils.isEmpty(temps)) { diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java index 6075a27f7..8f016b34f 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java @@ -368,7 +368,8 @@ public class SalaryBillBO { return; } - content = content.replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate())); + content = content.replace("\n", "\r\n") + .replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate())); for (SalaryTemplateSalaryItemListDTO item : salaryBillSendParam.getEmployeeInformation().getItems()) { content = content.replace("{" + item.getName() + "}", item.getSalaryItemValue()); @@ -644,7 +645,7 @@ public class SalaryBillBO { boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString())) || (isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString()) - && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString()))==0); + && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0); if (!isHide) { // 4.2.薪资项目 emailContent.append(""); @@ -724,7 +725,7 @@ public class SalaryBillBO { boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString())) || (isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString()) - && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString()))==0); + && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0); if (!isHide) { // 4.2.薪资项目 emailContent.append(""); diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 74835472d..8251ea51f 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryacct.bo; +import cn.hutool.core.util.NumberUtil; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.common.LocalDateRange; import com.engine.salary.constant.SalaryFormulaFieldConstant; @@ -18,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum; @@ -551,6 +553,10 @@ public class CalculateFormulaVarBO { } // 填充到返回结果集中 employeeMap.forEach((key, po) -> { + // 获取po的状态 + if(po.getStatus() != null && NumberUtil.isNumber(po.getStatus())) { + po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(po.getStatus()))); + } List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); Map map = JsonUtil.parseMap(po, String.class); formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 392ac81e6..b5fc42b95 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -27,6 +27,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; @@ -170,7 +171,7 @@ public class SalaryAcctResultBO { List columns = Lists.newArrayList(); // 员工信息字段 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName()), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName(), 0), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); } // 薪资项目分组下的薪资项目 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { @@ -180,29 +181,29 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } - WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName()), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName(), 0), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); columns.add(weaTableColumnWapper); } // 没有分类的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } // 回算的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } @@ -417,7 +418,8 @@ public class SalaryAcctResultBO { List salarySobBackItemPOS, List salaryBackItemPOS, Map salaryBackItemFormula, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { // 员工信息字段 Map employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee); @@ -446,7 +448,7 @@ public class SalaryAcctResultBO { List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(), Collections.emptyList()); if (CollectionUtils.isNotEmpty(groupItems)) { List items = groupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(groupPO.getId()) @@ -459,7 +461,7 @@ public class SalaryAcctResultBO { List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(0L) @@ -529,7 +531,8 @@ public class SalaryAcctResultBO { private static SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO convert2SalaryAcctResultDetailItemDTO(SalarySobItemPO salarySobItemPO, SalaryItemPO salaryItemPO, Map resultValueMap, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0)); String itemFormulaContent; @@ -549,6 +552,7 @@ public class SalaryAcctResultBO { // .canEdit(Objects.equals(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getUseInEmployeeSalary).orElse(0), 0)) .canEdit(true) .pattern(salarySobItemPO.getPattern()) + .lockStatus(lockItems.contains(salarySobItemPO.getSalaryItemId()) ? LockStatusEnum.LOCK.getValue() : LockStatusEnum.UNLOCK.getValue()) .build(); } @@ -615,6 +619,34 @@ public class SalaryAcctResultBO { .collect(Collectors.toList()); } + + public static List batchEditConvert2PO(Map salaryAcctResultOldPOMap, + List items, + SalaryAcctEmployeePO salaryAcctEmployee, + Long employeeId) { + if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { + return Collections.emptyList(); + } + Date now = new Date(); + return items.stream() + .map(e -> SalaryAcctResultPO.builder() + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(e.getSalaryItemId()) + .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .resultValue(StringUtils.trim(e.getResultValue())) + .originResultValue(salaryAcctResultOldPOMap.get(salaryAcctEmployee.getId() + "-" + e.getSalaryItemId())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()) + .collect(Collectors.toList()); + } + public static Map buildEmployeeFieldName() { Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields(); Map employeeFieldNameMap = Maps.newHashMapWithExpectedSize(declaredFields.length); diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 1929494a9..8fadd2670 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -71,6 +71,9 @@ public class SalaryAcctResultDetailDTO { // 保留小数位数 private Integer pattern; + + // 锁定状态 + private String lockStatus; } @Data diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java new file mode 100644 index 000000000..89c06ad5e --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @ClassName SalaryAcctResultBatchUpdateParam + * @author Harryxzy + * @date 2023/12/4 13:48 + * @description 批量更新参数 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SalaryAcctResultBatchUpdateParam { + + //薪资核算记录的id + @DataCheck(require = true, message = "薪资核算记录ID不得为空") + private Long salaryAcctRecordId; + + //薪资项目的Id + @DataCheck(require = true, message = "薪资项目id不得为空") + private Long salaryItemId; + + // 薪资核算人员id + private List idList; + + //薪资项目值 + private String value; + +} diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index 12a02998d..505ce3264 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -88,4 +89,25 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { */ private boolean extSalaryArchiveList; + + private String payStartDateStartDateStr; + private String payStartDateEndDateStr; + + // 起始发薪日期起 + private Date payStartDateStartDate; + + // 起始发薪日期止 + private Date payStartDateEndDate; + + // 最后发薪日期起 + private String payEndDateStartDateStr; + // 最后发薪日期止 + private String payEndDateEndDateStr; + + // 最后发薪日期起 + private Date payEndDateStartDate; + + // 最后发薪日期止 + private Date payEndDateEndDate; + } diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index f65c9f924..c11c58954 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -117,6 +117,7 @@ public class SalaryItemBO { .description(salaryItemPO.getDescription()) .canDelete(true) .canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE)) + .width(salaryItemPO.getWidth()) .build(); } ).collect(Collectors.toList()); @@ -200,7 +201,8 @@ public class SalaryItemBO { .setCanEdit(salaryItemPO.getCanEdit()) .setTaxAgentIds(salaryItemPO.getTaxAgentIds()) .setSharedType(salaryItemPO.getSharedType()) - .setSortedIndex(salaryItemPO.getSortedIndex()); + .setSortedIndex(salaryItemPO.getSortedIndex()) + .setWidth(salaryItemPO.getWidth()); } /** @@ -280,6 +282,7 @@ public class SalaryItemBO { .sharedType(Optional.ofNullable(saveParam.getSharedType()).orElse(0)) .taxAgentIds(saveParam.getTaxAgentIds()) .sortedIndex(saveParam.getSortedIndex()) + .width(saveParam.getWidth()) .build(); // 开启了"薪资档案引用",取值方式固定为输入 // if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 5101bf2e4..da0c6d4d5 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -95,4 +95,7 @@ public class SalaryItemFormDTO { private String taxAgentIds; private Integer sortedIndex; + + // 宽度 + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index adb0dc4b1..1e0af69d4 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -105,6 +105,9 @@ public class SalaryItemListDTO { @TableTitle(title = "显示顺序",dataIndex = "sortedIndex",key = "sortedIndex") private Integer sortedIndex; + // 宽度 + private Integer width; + @SalaryTableColumn(text = "操作", width = "20%", column = "operate") private String operate; } diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 916342dfd..a200cea77 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -102,4 +102,9 @@ public class SalaryItemSaveParam { * 排序 */ private Integer sortedIndex; + + /** + * 宽度 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index 1514cc3c5..5dbd8e3b8 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -181,4 +181,9 @@ public class SalaryItemPO { * 排序 */ private Integer sortedIndex; + + /** + * 宽度 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index be5bcf6c3..511e946c7 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -143,6 +143,7 @@ public class SalarySobItemAggregateBO { .sortedIndex(salarySobItemPO.getSortedIndex()) .canEdit(openFormulaForcedEditing || Objects.equals(salaryItemPO.getCanEdit(), 1)) .canDelete(openFormulaForcedEditing || salaryItemPO.getCanDelete() == null || Objects.equals(salaryItemPO.getCanDelete(), 1)) + .width(salaryItemPO.getWidth()) .build()); } } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index 81bbc138a..8b23d6446 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -109,4 +109,7 @@ public class SalarySobItemDTO { * 保留小数位数 */ private Integer pattern; + + // 显示宽度 + private Integer width; } diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 6a85ddd20..c6e6b40a3 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -41,7 +41,7 @@ public class InsuranceComparisonResultBO { * 构建福利核算结果列表的表头(线下对比) * */ - public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet) { + public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, boolean welBaseDiffSign) { List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); @@ -67,21 +67,63 @@ public class InsuranceComparisonResultBO { columns.add(new Column("社保账号", "socialAccount", "socialAccount")); columns.add(new Column("社保方案名称", "socialSchemeName", "socialSchemeName")); //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "socialPerBase", po.getId() + "socialPerBase")); + socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "socialComBase", po.getId() + "socialComBase")); + } + columns.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + } } +// for (ICategoryPO po : socialWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); +// } columns.add(new Column("公积金账号", "fundAccount", "fundAccount")); columns.add(new Column("公积金方案名称", "fundSchemeName", "fundSchemeName")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "fundPerBase", po.getId() + "fundPerBase")); + fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "fundComBase", po.getId() + "fundComBase")); + } + columns.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + } } +// for (ICategoryPO po : fundWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); +// } columns.add(new Column("补充公积金账号", "supplementFundAccount", "supplementFundAccount")); columns.add(new Column("其他福利方案名称", "otherSchemeName", "otherSchemeName")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "otherPerBase", po.getId() + "otherPerBase")); + otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "otherComBase", po.getId() + "otherComBase")); + } + columns.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + } } +// for (ICategoryPO po : otherWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); +// } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -127,7 +169,8 @@ public class InsuranceComparisonResultBO { * 构建福利核算线下对比结果 * */ - public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap) { + public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS + , Map schemeIdNameMap, boolean welBaseDiffSign) { Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); @@ -177,12 +220,28 @@ public class InsuranceComparisonResultBO { if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); } - //社保基数,socialPaymentBaseString - welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); - //公积金基数,fundPaymentBaseString - welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); - //其他福利基数,otherPaymentBaseString - welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + if (welBaseDiffSign) { + //社保基数-个人,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1); + //公积金基数-个人,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2); + //其他福利基数-个人,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3); + + //社保基数-公司,socialPaymentComBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1); + //公积金基数-公司,fundPaymentComBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2); + //其他福利基数-公司,otherPaymentComBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3); + } else { + //社保基数,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); + //公积金基数,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); + //其他福利基数,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + } //社保个人socialPerJson welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1); //公积金个人fundPerJson diff --git a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java index 17b926b08..7a9090845 100644 --- a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java +++ b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java @@ -25,5 +25,6 @@ public class ExcelInsuranceImportParam { /** * 账单月份 */ - private String billMonth; + private String billMonth; + private String paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java index 4e7889544..9660b8602 100644 --- a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java @@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index e8f7ce98f..9cd2ad7f0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -106,6 +106,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -117,6 +123,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -128,6 +140,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 50897c6b2..dc8c1c2c0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; /** * 公积金方案ID */ @@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java index a96b96aad..710038513 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java @@ -35,6 +35,7 @@ public class InsuranceArchivesBO { .socialStartTime(po.getSocialStartTime()) .schemeAccount(po.getSocialAccount()) .schemePaymentBaseString(po.getSocialPaymentBaseString()) + .schemePaymentComBaseString(po.getSocialPaymentComBaseString()) .underTake(po.getUnderTake() == null ? null : String.valueOf(po.getUnderTake())) .build(); } @@ -52,6 +53,7 @@ public class InsuranceArchivesBO { .fundSchemeId(po.getFundSchemeId()) .paymentOrganization(po.getPaymentOrganization()) .fundPaymentBaseString(po.getFundPaymentBaseString()) + .fundPaymentComBaseString(po.getFundPaymentComBaseString()) .fundStartTime(po.getFundStartTime()) .supplementFundAccount(po.getSupplementFundAccount()) .nonPayment(po.getNonPayment()) @@ -72,6 +74,7 @@ public class InsuranceArchivesBO { .otherName(po.getOtherSchemeId() == null ? null : String.valueOf(po.getOtherSchemeId())) .otherSchemeId(po.getOtherSchemeId()) .otherPaymentBaseString(po.getOtherPaymentBaseString()) + .otherPaymentComBaseString(po.getOtherPaymentComBaseString()) .otherStartTime(po.getOtherStartTime()) .otherEndTime(po.getOtherEndTime()) .paymentOrganization(po.getPaymentOrganization()) diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java index 259cc3e54..a0c2d57e8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java @@ -70,12 +70,18 @@ public class InsuranceArchivesBaseHistoryDTO { private String adjustAfterBaseJson; + private String adjustBeforeComBaseJson; + + private String adjustAfterComBaseJson; + @TableTitle(title = "对象", dataIndex = "employeeName", key = "employeeName") private String employeeName; @TableTitle(title = "个税扣缴义务人", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName") private String paymentOrganizationName; @TableTitle(title = "福利项名称", dataIndex = "welfareItemName", key = "welfareItemName") private String welfareItemName; + @TableTitle(title = "缴费对象", dataIndex = "paymentScope", key = "paymentScope") + private String paymentScope; @TableTitle(title = "调整前方案", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName") private String adjustBeforeSchemeName; @TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue") diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java index f85206c01..4fcfdbcd1 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java @@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO { //缴纳基数 private String fundPaymentBaseString; + + private String fundPaymentComBaseString; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java index a3c55fee5..3fa89c1c2 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java @@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO { private String otherPaymentBaseString; + private String otherPaymentComBaseString; + //private WeaForm otherPaymentBase; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java index 1be1afbca..d4fc1dae8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java @@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO { //社保缴纳基数 private String schemePaymentBaseString; + //社保缴纳基数——单位 + private String schemePaymentComBaseString; + } diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java index 7e4e46fb7..8d086b1ad 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java @@ -23,4 +23,6 @@ public class InsuranceArchivesSaveParam { private String baseForm; private String paymentForm; + + private String paymentComForm; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java index 6939c2258..52d31f804 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java @@ -77,4 +77,6 @@ public class InsuranceArchivesBaseHistoryPO { private Date createTime; private Date updateTime; + + private String paymentScope; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java index 7b333f4e6..fc171c94b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -87,6 +87,13 @@ public class InsuranceArchivesFundSchemePO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java index 76146719d..9ad9d9668 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -77,6 +77,12 @@ public class InsuranceArchivesOtherSchemePO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java index e6f4ff038..645e5215b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -83,6 +83,12 @@ public class InsuranceArchivesSocialSchemePO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java index 75b1b3191..696a3f9f7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -31,59 +32,69 @@ public class TaxDeclarationAnnualListDTO { text = "工号", width = "10%", column = "jobNum" ) @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum") + @ExcelHead(title ="工号",dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "姓名", width = "10%", column = "username" ) @TableTitle(title ="姓名",dataIndex = "username",key = "username") + @ExcelHead(title ="姓名",dataIndex = "username") private String username; @SalaryTableColumn( text = "证件类型", width = "10%", column = "cardType" ) @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType") + @ExcelHead(title ="证件类型",dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "证件号码", width = "10%", column = "cardNum" ) @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum") + @ExcelHead(title ="证件号码",dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "全年一次性奖金额", width = "10%", column = "annualIncome" ) @TableTitle(title ="全年一次性奖金额",dataIndex = "annualIncome",key = "annualIncome") + @ExcelHead(title ="全年一次性奖金额",dataIndex = "annualIncome") private String annualIncome; @SalaryTableColumn( text = "免税收入", width = "10%", column = "annualTaxFreeIncome" ) @TableTitle(title ="免税收入",dataIndex = "annualTaxFreeIncome",key = "annualTaxFreeIncome") + @ExcelHead(title ="免税收入",dataIndex = "annualTaxFreeIncome") private String annualTaxFreeIncome; @SalaryTableColumn( text = "其他", width = "10%", column = "annualOther" ) @TableTitle(title ="其他",dataIndex = "annualOther",key = "annualOther") + @ExcelHead(title ="其他",dataIndex = "annualOther") private String annualOther; @SalaryTableColumn( text = "准予扣除的捐赠额", width = "10%", column = "annualDonateTax" ) @TableTitle(title ="准予扣除的捐赠额",dataIndex = "annualDonateTax",key = "annualDonateTax") + @ExcelHead(title ="准予扣除的捐赠额",dataIndex = "annualDonateTax") private String annualDonateTax; @SalaryTableColumn( text = "减免税额", width = "10%", column = "annualTaxSavings" ) @TableTitle(title ="减免税额",dataIndex = "annualTaxSavings",key = "annualTaxSavings") + @ExcelHead(title ="减免税额",dataIndex = "annualTaxSavings") private String annualTaxSavings; @SalaryTableColumn( text = "备注", width = "10%", column = "annualRemark" ) @TableTitle(title ="备注",dataIndex = "annualRemark",key = "annualRemark") + @ExcelHead(title ="备注",dataIndex = "annualRemark") private String annualRemark; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java index 73872aa0a..ce03fd52c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -30,78 +31,91 @@ public class TaxDeclarationLaborListDTO { @SalaryTableColumn( text = "工号", width = "10%", column = "jobNum" ) - @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "姓名", width = "10%", column = "username" ) - @TableTitle(title ="姓名",dataIndex = "username",key = "username") + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelHead(title = "姓名", dataIndex = "username") private String username; @SalaryTableColumn( text = "证件类型", width = "10%", column = "cardType" ) - @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType") + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "证件类型", dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "证件号码", width = "10%", column = "cardNum" ) - @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum") + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "所得项目", width = "10%", column = "incomeItems" ) - @TableTitle(title ="所得项目",dataIndex = "incomeItems",key = "incomeItems") + @TableTitle(title = "所得项目", dataIndex = "incomeItems", key = "incomeItems") + @ExcelHead(title = "所得项目", dataIndex = "incomeItems") private String incomeItems; @SalaryTableColumn( text = "劳务收入", width = "10%", column = "laborIncome" ) - @TableTitle(title ="劳务收入",dataIndex = "laborIncome",key = "laborIncome") + @TableTitle(title = "劳务收入", dataIndex = "laborIncome", key = "laborIncome") + @ExcelHead(title = "劳务收入", dataIndex = "laborIncome") private String laborIncome; @SalaryTableColumn( text = "劳务免税收入", width = "10%", column = "laborTaxFreeIncome" ) - @TableTitle(title ="劳务免税收入",dataIndex = "laborTaxFreeIncome",key = "laborTaxFreeIncome") + @TableTitle(title = "劳务免税收入", dataIndex = "laborTaxFreeIncome", key = "laborTaxFreeIncome") + @ExcelHead(title = "劳务免税收入", dataIndex = "laborTaxFreeIncome") private String laborTaxFreeIncome; @SalaryTableColumn( text = "商业健康保险", width = "10%", column = "commercialHealthInsurance" ) - @TableTitle(title ="商业健康保险",dataIndex = "commercialHealthInsurance",key = "commercialHealthInsurance") + @TableTitle(title = "商业健康保险", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance") + @ExcelHead(title = "商业健康保险", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn( text = "税延养老保险", width = "10%", column = "taxDeferredEndowmentInsurance" ) - @TableTitle(title ="税延养老保险",dataIndex = "taxDeferredEndowmentInsurance",key = "taxDeferredEndowmentInsurance") + @TableTitle(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance") + @ExcelHead(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn( text = "其他", width = "10%", column = "other" ) - @TableTitle(title ="其他",dataIndex = "other",key = "other") + @TableTitle(title = "其他", dataIndex = "other", key = "other") + @ExcelHead(title = "其他", dataIndex = "other") private String other; @SalaryTableColumn( text = "准予扣除的捐赠额", width = "10%", column = "allowedDonation" ) - @TableTitle(title ="准予扣除的捐赠额",dataIndex = "allowedDonation",key = "allowedDonation") + @TableTitle(title = "准予扣除的捐赠额", dataIndex = "allowedDonation", key = "allowedDonation") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn( text = "减免税额", width = "10%", column = "taxDeduction" ) - @TableTitle(title ="减免税额",dataIndex = "taxDeduction",key = "taxDeduction") + @TableTitle(title = "减免税额", dataIndex = "taxDeduction", key = "taxDeduction") + @ExcelHead(title = "减免税额", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn( text = "备注", width = "10%", column = "description" ) - @TableTitle(title ="备注",dataIndex = "description",key = "description") + @TableTitle(title = "备注", dataIndex = "description", key = "description") + @ExcelHead(title = "备注", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java index 3725aaf27..419f8f1e0 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java @@ -4,6 +4,7 @@ import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,101 +36,126 @@ public class TaxDeclarationWageListDTO { @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelHead(title = "姓名", dataIndex = "username") private String username; @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "证件类型", dataIndex = "cardType") private String cardType; @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn(text = "本期收入", width = "10%", column = "income") @TableTitle(title = "本期收入", dataIndex = "income", key = "income") + @ExcelHead(title = "本期收入", dataIndex = "income") private String income; @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "taxFreeIncome") @TableTitle(title = "本期免税收入", dataIndex = "taxFreeIncome", key = "taxFreeIncome") + @ExcelHead(title = "本期免税收入", dataIndex = "taxFreeIncome") private String taxFreeIncome; @SalaryTableColumn(text = "基本养老保险费", width = "10%", column = "endowmentInsurance") @TableTitle(title = "基本养老保险费", dataIndex = "endowmentInsurance", key = "endowmentInsurance") + @ExcelHead(title = "基本养老保险费", dataIndex = "endowmentInsurance") private String endowmentInsurance; @SalaryTableColumn(text = "基本医疗保险费", width = "10%", column = "medicalInsurance") @TableTitle(title = "基本医疗保险费", dataIndex = "medicalInsurance", key = "medicalInsurance") + @ExcelHead(title = "基本医疗保险费", dataIndex = "medicalInsurance") private String medicalInsurance; @SalaryTableColumn(text = "失业保险费", width = "10%", column = "unemploymentInsurance") @TableTitle(title = "失业保险费", dataIndex = "unemploymentInsurance", key = "unemploymentInsurance") + @ExcelHead(title = "失业保险费", dataIndex = "unemploymentInsurance") private String unemploymentInsurance; @SalaryTableColumn(text = "住房公积金", width = "10%", column = "housingProvidentFund") @TableTitle(title = "住房公积金", dataIndex = "housingProvidentFund", key = "housingProvidentFund") + @ExcelHead(title = "住房公积金", dataIndex = "housingProvidentFund") private String housingProvidentFund; @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation") @TableTitle(title = "累计子女教育", dataIndex = "addUpChildEducation", key = "addUpChildEducation") + @ExcelHead(title = "累计子女教育", dataIndex = "addUpChildEducation") private String addUpChildEducation; @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest") @TableTitle(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") + @ExcelHead(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest") private String addUpHousingLoanInterest; @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent") @TableTitle(title = "累计住房租金", dataIndex = "addUpHousingRent", key = "addUpHousingRent") + @ExcelHead(title = "累计住房租金", dataIndex = "addUpHousingRent") private String addUpHousingRent; @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation") @TableTitle(title = "累计继续教育", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") + @ExcelHead(title = "累计继续教育", dataIndex = "addUpContinuingEducation") private String addUpContinuingEducation; @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly") @TableTitle(title = "累计赡养老人", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") + @ExcelHead(title = "累计赡养老人", dataIndex = "addUpSupportElderly") private String addUpSupportElderly; @SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical") @TableTitle(title = "累计大病医疗", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") + @ExcelHead(title = "累计大病医疗", dataIndex = "addUpIllnessMedical") private String addUpIllnessMedical; @SalaryTableColumn(text = "累计3岁以下婴幼儿照护", width = "10%", column = "addUpInfantCare") @TableTitle(title = "累计3岁以下婴幼儿照护", dataIndex = "addUpInfantCare", key = "addUpInfantCare") + @ExcelHead(title = "累计3岁以下婴幼儿照护", dataIndex = "addUpInfantCare") private String addUpInfantCare; @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "addUpPrivatePension") @TableTitle(title = "累计个人养老金", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") + @ExcelHead(title = "累计个人养老金", dataIndex = "addUpPrivatePension") private String addUpPrivatePension; @SalaryTableColumn(text = "企业(职业)年金", width = "10%", column = "annuity") @TableTitle(title = "企业(职业)年金", dataIndex = "annuity", key = "annuity") + @ExcelHead(title = "企业(职业)年金", dataIndex = "annuity") private String annuity; @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "commercialHealthInsurance") @TableTitle(title = "商业健康保险", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance") + @ExcelHead(title = "商业健康保险", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDeferredEndowmentInsurance") @TableTitle(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance") + @ExcelHead(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn(text = "其他", width = "10%", column = "other") @TableTitle(title = "其他", dataIndex = "other", key = "other") + @ExcelHead(title = "其他", dataIndex = "other") private String other; @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "allowedDonation") @TableTitle(title = "准予扣除的捐赠额", dataIndex = "allowedDonation", key = "allowedDonation") + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn(text = "减免税额", width = "10%", column = "taxDeduction") @TableTitle(title = "减免税额", dataIndex = "taxDeduction", key = "taxDeduction") + @ExcelHead(title = "减免税额", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn(text = "备注", width = "10%", column = "description") @TableTitle(title = "备注", dataIndex = "description", key = "description") + @ExcelHead(title = "备注", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 03facc683..c08dd87e2 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -183,6 +183,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -264,6 +276,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -346,6 +370,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index a88ac1600..17e371c33 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -956,7 +956,7 @@ #{tenantKey}, - #{sms_setting}, + #{smsSetting}, diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index 7dd705c72..93ec756ca 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -51,7 +51,8 @@ t.shared_type, t.tax_agent_ids, t.sorted_index, - t.hide_default + t.hide_default, + t.width @@ -217,6 +218,9 @@ sorted_index, + + width, + @@ -288,6 +292,9 @@ #{sortedIndex}, + + #{width}, + @@ -359,6 +366,9 @@ tax_agent_ids=#{taxAgentIds}, + + width=#{width}, + sorted_index=#{sortedIndex}, WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index d45fdec16..15ac635ce 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -157,7 +157,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -204,7 +205,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -213,7 +217,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.id,jdbcType=DOUBLE}, @@ -259,7 +264,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -269,7 +277,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.id}, @@ -315,7 +324,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 2e52ce986..925718b0b 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -18,10 +18,13 @@ + + + @@ -69,10 +72,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -117,10 +123,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -420,7 +429,8 @@ t.other_com_json,t.social_per_sum,t.social_com_sum, t.fund_per_sum,t.fund_com_sum,t.other_per_sum, t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization, - t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string + t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string, + t.social_payment_com_base_string, t.fund_payment_com_base_string, t.other_payment_com_base_string FROM hrsa_bill_detail t WHERE t.delete_type = 0 @@ -711,7 +721,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -757,7 +768,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -766,7 +780,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.employeeId,jdbcType=DOUBLE}, @@ -811,7 +826,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -821,7 +839,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -866,7 +885,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml index f99461416..19b6fb3e5 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml @@ -18,10 +18,13 @@ + + + @@ -68,10 +71,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -130,7 +136,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -175,7 +182,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -184,7 +194,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select @@ -229,7 +240,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -239,7 +253,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -283,7 +298,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index fc91b8885..afdde68a1 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -14,6 +14,7 @@ + @@ -35,6 +36,7 @@ , t.payment_organization , t.under_take , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -135,6 +137,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -154,6 +157,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -175,6 +179,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -193,6 +198,7 @@ #{item.fundEndTime,jdbcType=VARCHAR}, #{item.fundStartTime,jdbcType=VARCHAR}, #{item.fundPaymentBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, #{item.supplementFundAccount,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -215,6 +221,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -233,6 +240,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -311,6 +319,7 @@ welfare_type = #{welfareType}, fund_payment_base_string = #{fundPaymentBaseString}, + fund_payment_com_base_string = #{fundPaymentComBaseString}, fund_scheme_id = #{fundSchemeId}, fund_end_time = #{fundEndTime}, fund_start_time = #{fundStartTime}, @@ -353,6 +362,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -371,6 +381,7 @@ #{fundEndTime}, #{fundStartTime}, #{fundPaymentBaseString}, + #{fundPaymentComBaseString}, #{supplementFundAccount}, #{createTime}, #{creator}, diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml index da02c83b5..0752177a1 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml @@ -12,6 +12,7 @@ + @@ -33,6 +34,7 @@ , t.adjust_before_base_value , t.adjust_after_base_value , t.adjust_welfare_item_id + , t.payment_scope , t.operator , t.operate_time , t.create_time @@ -48,7 +50,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( @@ -67,7 +69,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -77,7 +80,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) select #{item.id,jdbcType=DOUBLE}, @@ -95,7 +98,8 @@ #{item.creator,jdbcType=DOUBLE}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} from dual @@ -106,7 +110,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( #{item.id}, @@ -124,7 +128,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -148,6 +153,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -180,6 +186,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -216,6 +223,7 @@ , eo.lastname as operatorName , ee.username as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrsa_external_employee ee on ee.id = t.employee_id diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index d1a18db07..2d67257b4 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -12,6 +12,7 @@ + @@ -31,6 +32,7 @@ , t.payment_organization , t.under_take , t.other_payment_base_string + , t.other_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -129,7 +131,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( @@ -146,7 +149,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -165,7 +169,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) select #{item.otherSchemeId,jdbcType=DOUBLE}, @@ -181,7 +186,8 @@ #{item.nonPayment,jdbcType=INTEGER}, #{item.creator,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE}, - #{item.otherPaymentBaseString,jdbcType=VARCHAR} + #{item.otherPaymentBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -201,7 +207,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{item.otherSchemeId}, @@ -217,7 +224,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -292,6 +300,7 @@ welfare_type = #{welfareType}, other_payment_base_string = #{otherPaymentBaseString}, + other_payment_com_base_string = #{otherPaymentComBaseString}, other_scheme_id = #{otherSchemeId}, other_end_time = #{otherEndTime}, other_start_time = #{otherStartTime}, @@ -340,7 +349,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{otherSchemeId}, @@ -356,7 +366,8 @@ #{nonPayment}, #{creator}, #{paymentOrganization}, - #{otherPaymentBaseString} + #{otherPaymentBaseString}, + #{otherPaymentComBaseString} ) \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 8472020a2..79562932f 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ , t.payment_organization , t.under_take , t.social_payment_base_string + , t.social_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -128,6 +130,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -146,6 +149,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -166,6 +170,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -183,6 +188,7 @@ #{item.welfareType,jdbcType=INTEGER}, #{item.deleteType,jdbcType=INTEGER}, #{item.socialPaymentBaseString,jdbcType=VARCHAR}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialSchemeId,jdbcType=DOUBLE}, #{item.createTime,jdbcType=DATE}, #{item.socialEndTime,jdbcType=VARCHAR}, @@ -204,6 +210,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -221,6 +228,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -955,6 +963,7 @@ welfare_type = #{welfareType}, social_payment_base_string = #{socialPaymentBaseString}, + social_payment_com_base_string = #{socialPaymentComBaseString}, social_scheme_id = #{socialSchemeId}, social_end_time = #{socialEndTime}, social_start_time = #{socialStartTime}, @@ -994,6 +1003,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -1011,6 +1021,7 @@ #{welfareType}, #{deleteType}, #{socialPaymentBaseString}, + #{socialPaymentComBaseString}, #{socialSchemeId}, #{createTime}, #{socialEndTime}, diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml index 84e424805..b39f69b49 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml @@ -38,6 +38,31 @@ + + + + AND id IN + + #{id} + + + + AND name like '%'||#{param.name}||'%' + + + + + + AND id IN + + #{id} + + + + AND name like '%'+#{param.name}+'%' + + +