Merge branch 'release/2.9.9.2312.01' into custom/上海港湾
This commit is contained in:
commit
33bbb18f7d
|
|
@ -0,0 +1,39 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id NUMBER(20,0) NOT NULL,
|
||||
|
||||
employee_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
payment_organization NUMBER(11,0) NOT NULL,
|
||||
|
||||
welfare_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
adjust_before_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_after_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_before_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_after_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
operator NUMBER(20,0) NOT NULL,
|
||||
|
||||
operate_time DATE NULL,
|
||||
|
||||
create_time DATE NOT NULL,
|
||||
|
||||
update_time DATE NOT NULL,
|
||||
|
||||
creator NUMBER(20,0) NOT NULL,
|
||||
|
||||
delete_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
tenant_key VARCHAR2(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id NUMBER(20,0) NOT NULL,
|
||||
|
||||
employee_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
payment_organization NUMBER(11,0) NOT NULL,
|
||||
|
||||
welfare_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
adjust_before_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_after_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_before_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_after_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
operator NUMBER(20,0) NOT NULL,
|
||||
|
||||
operate_time DATE NULL,
|
||||
|
||||
create_time DATE NOT NULL,
|
||||
|
||||
update_time DATE NOT NULL,
|
||||
|
||||
creator NUMBER(20,0) NOT NULL,
|
||||
|
||||
delete_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
tenant_key VARCHAR2(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id NUMBER(20,0) NOT NULL,
|
||||
|
||||
employee_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
payment_organization NUMBER(11,0) NOT NULL,
|
||||
|
||||
welfare_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
adjust_before_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_after_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_before_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_after_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
operator NUMBER(20,0) NOT NULL,
|
||||
|
||||
operate_time DATE NULL,
|
||||
|
||||
create_time DATE NOT NULL,
|
||||
|
||||
update_time DATE NOT NULL,
|
||||
|
||||
creator NUMBER(20,0) NOT NULL,
|
||||
|
||||
delete_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
tenant_key VARCHAR2(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id bigint NOT NULL,
|
||||
|
||||
employee_id bigint NOT NULL,
|
||||
|
||||
payment_organization int NOT NULL,
|
||||
|
||||
welfare_type int NOT NULL,
|
||||
|
||||
adjust_before_scheme_id int NULL,
|
||||
|
||||
adjust_after_scheme_id int NULL,
|
||||
|
||||
adjust_before_base_value varchar(255) NULL,
|
||||
|
||||
adjust_after_base_value varchar(255) NULL,
|
||||
|
||||
adjust_welfare_item_id bigint NOT NULL,
|
||||
|
||||
operator bigint NOT NULL,
|
||||
|
||||
operate_time datetime NULL,
|
||||
|
||||
create_time datetime NOT NULL,
|
||||
|
||||
update_time datetime NOT NULL,
|
||||
|
||||
creator bigint NOT NULL,
|
||||
|
||||
delete_type int NOT NULL,
|
||||
|
||||
tenant_key varchar(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_salary_template ADD COLUMN sms_setting text NULL ;
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id NUMBER(20,0) NOT NULL,
|
||||
|
||||
employee_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
payment_organization NUMBER(11,0) NOT NULL,
|
||||
|
||||
welfare_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
adjust_before_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_after_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_before_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_after_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
operator NUMBER(20,0) NOT NULL,
|
||||
|
||||
operate_time DATE NULL,
|
||||
|
||||
create_time DATE NOT NULL,
|
||||
|
||||
update_time DATE NOT NULL,
|
||||
|
||||
creator NUMBER(20,0) NOT NULL,
|
||||
|
||||
delete_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
tenant_key VARCHAR2(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL
|
||||
/
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id bigint NOT NULL,
|
||||
|
||||
employee_id bigint NOT NULL,
|
||||
|
||||
payment_organization int NOT NULL,
|
||||
|
||||
welfare_type int NOT NULL,
|
||||
|
||||
adjust_before_scheme_id int,
|
||||
|
||||
adjust_after_scheme_id int,
|
||||
|
||||
adjust_before_base_value varchar(255),
|
||||
|
||||
adjust_after_base_value varchar(255),
|
||||
|
||||
adjust_welfare_item_id bigint NOT NULL,
|
||||
|
||||
operator bigint NOT NULL,
|
||||
|
||||
operate_time timestamp(0),
|
||||
|
||||
create_time timestamp(0) NOT NULL,
|
||||
|
||||
update_time timestamp(0) NOT NULL,
|
||||
|
||||
creator bigint NOT NULL,
|
||||
|
||||
delete_type int NOT NULL,
|
||||
|
||||
tenant_key varchar(10),
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_salary_template ADD COLUMN sms_setting text NULL ;
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
CREATE TABLE [hrsa_insurance_base_history] (
|
||||
|
||||
[id] bigint NOT NULL,
|
||||
|
||||
[employee_id] bigint NOT NULL,
|
||||
|
||||
[payment_organization] int NOT NULL,
|
||||
|
||||
[welfare_type] int NOT NULL,
|
||||
|
||||
[adjust_before_scheme_id] int NULL,
|
||||
|
||||
[adjust_after_scheme_id] int NULL,
|
||||
|
||||
[adjust_before_base_value] varchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||
|
||||
[adjust_after_base_value] varchar(255) COLLATE Chinese_PRC_CI_AS NULL,
|
||||
|
||||
[adjust_welfare_item_id] bigint NOT NULL,
|
||||
|
||||
[operator] bigint NOT NULL,
|
||||
|
||||
[operate_time] datetime NULL,
|
||||
|
||||
[create_time] datetime NOT NULL,
|
||||
|
||||
[update_time] datetime NOT NULL,
|
||||
|
||||
[creator] bigint NOT NULL,
|
||||
|
||||
[delete_type] int NOT NULL,
|
||||
|
||||
[tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
|
||||
|
||||
PRIMARY KEY ([id])
|
||||
|
||||
)
|
||||
|
||||
GO
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting text NULL
|
||||
GO
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
CREATE TABLE hrsa_insurance_base_history (
|
||||
|
||||
id NUMBER(20,0) NOT NULL,
|
||||
|
||||
employee_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
payment_organization NUMBER(11,0) NOT NULL,
|
||||
|
||||
welfare_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
adjust_before_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_after_scheme_id NUMBER(11,0) NULL,
|
||||
|
||||
adjust_before_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_after_base_value VARCHAR2(255) NULL,
|
||||
|
||||
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
|
||||
|
||||
operator NUMBER(20,0) NOT NULL,
|
||||
|
||||
operate_time DATE NULL,
|
||||
|
||||
create_time DATE NOT NULL,
|
||||
|
||||
update_time DATE NOT NULL,
|
||||
|
||||
creator NUMBER(20,0) NOT NULL,
|
||||
|
||||
delete_type NUMBER(11,0) NOT NULL,
|
||||
|
||||
tenant_key VARCHAR2(10) NULL,
|
||||
|
||||
PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
|
||||
/
|
||||
|
||||
|
|
@ -1958,7 +1958,7 @@ public class SIArchivesBiz {
|
|||
Date now = new Date();
|
||||
List<InsuranceArchivesBaseHistoryPO> toCreateAdjustHistoryList = new ArrayList<>();
|
||||
//旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。
|
||||
if(adjustInfo.getAdjustAfterBaseJson() != null && adjustInfo.getAdjustBeforeBaseJson() == null) {
|
||||
if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) {
|
||||
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
for (String key : adjustAfterBaseMap.keySet()) {
|
||||
|
|
@ -1976,36 +1976,43 @@ public class SIArchivesBiz {
|
|||
adjustItem.setId(IdGenerator.generate());
|
||||
toCreateAdjustHistoryList.add(adjustItem);
|
||||
}
|
||||
} else if (adjustInfo.getAdjustAfterBaseJson() != null && adjustInfo.getAdjustBeforeBaseJson() != null) {
|
||||
} else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) {
|
||||
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> adjustBeforeBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeBaseJson(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> reDealMap = new HashMap<>();
|
||||
reDealMap.putAll(adjustAfterBaseMap);
|
||||
reDealMap.putAll(adjustBeforeBaseMap);
|
||||
for (String key : reDealMap.keySet()) {
|
||||
String beforeValue = (String) adjustBeforeBaseMap.get(key);
|
||||
String afterValue = (String) adjustAfterBaseMap.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());
|
||||
|
||||
toCreateAdjustHistoryList.add(adjustItem);
|
||||
if (adjustAfterBaseMap != null) {
|
||||
reDealMap.putAll(adjustAfterBaseMap);
|
||||
}
|
||||
if (adjustBeforeBaseMap != null) {
|
||||
reDealMap.putAll(adjustBeforeBaseMap);
|
||||
}
|
||||
if (reDealMap.size() >0) {
|
||||
for (String key : reDealMap.keySet()) {
|
||||
String beforeValue = (String) adjustBeforeBaseMap.get(key);
|
||||
String afterValue = (String) adjustAfterBaseMap.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());
|
||||
|
||||
toCreateAdjustHistoryList.add(adjustItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return toCreateAdjustHistoryList;
|
||||
}
|
||||
|
|
@ -2059,8 +2066,14 @@ public class SIArchivesBiz {
|
|||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
|
||||
List<InsuranceArchivesBaseHistoryDTO> list = mapper.listByEmployeeIdAndOperator(operator, employeeId);
|
||||
return list;
|
||||
List<InsuranceArchivesBaseHistoryDTO> empList = mapper.listByEmployeeIdAndOperator(operator, employeeId);
|
||||
List<InsuranceArchivesBaseHistoryDTO> extEmpList = mapper.listByExtEmpIdAndOperator(operator, employeeId);
|
||||
if (extEmpList != null) {
|
||||
empList.addAll(extEmpList);
|
||||
empList = empList.stream().filter(f -> StringUtils.isNotBlank(f.getEmployeeName()))
|
||||
.sorted(Comparator.comparing(InsuranceArchivesBaseHistoryDTO::getOperateTime).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
return empList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ public class DataCollectionEmployee {
|
|||
|
||||
@SalaryFormulaVar(defaultLabel = "状态编码", labelId = 98624, dataType = "string")
|
||||
private String status;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "状态", labelId = 98622, dataType = "string")
|
||||
private String statusName;
|
||||
|
||||
//工号
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ import com.engine.salary.constant.SalaryArchiveConstant;
|
|||
import com.engine.salary.constant.SalaryBillConstant;
|
||||
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillSendDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
|
||||
import com.engine.salary.enums.salarybill.MessageChannelEnum;
|
||||
|
|
@ -27,6 +24,7 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.pdfbox.multipdf.PDFMergerUtility;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -42,6 +40,7 @@ import java.io.*;
|
|||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -129,21 +128,21 @@ public class SalaryBillBO {
|
|||
if (employeeInformation == null || simpleEmployee == null) {
|
||||
return;
|
||||
}
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
|
||||
if (CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
|
||||
//获取员工信息的字段名和中文描述的map关系
|
||||
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder().employeeId(simpleEmployee.getEmployeeId())
|
||||
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder()
|
||||
.employeeId(simpleEmployee.getEmployeeId())
|
||||
.taxAgentName(salaryBillSendParam.getTaxAgentName())
|
||||
.departmentName(simpleEmployee.getDepartmentName())
|
||||
.email(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
|
||||
// .gradeName(simpleEmployee.getGrade() == null ? "" : simpleEmployee.getGrade().getName())
|
||||
// .hireDate(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getHiredate()))
|
||||
// .sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex().getDescription())
|
||||
.mobile(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile())
|
||||
.jobtitleName(simpleEmployee.getJobtitleName())
|
||||
// .status(StringUtils.isEmpty(simpleEmployee.getPersonnelStatus()) ? "" : simpleEmployee.getPersonnelStatus())
|
||||
.telephone(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
|
||||
.username(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
|
||||
.email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
|
||||
.sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex())
|
||||
.mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile()).jobtitleName(simpleEmployee.getJobtitleName())
|
||||
.status(StringUtils.isEmpty(simpleEmployee.getStatus()) ? "" : simpleEmployee.getStatus())
|
||||
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
|
||||
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.build();
|
||||
List<SalaryTemplateSalaryItemListDTO> items = employeeInformation.getItems();
|
||||
// 1.SalaryAcctResultBO.buildEmployeeFieldName()的取法
|
||||
|
|
@ -152,7 +151,7 @@ public class SalaryBillBO {
|
|||
// Optional<Map.Entry<String, String>> entry = entries.stream().filter(f -> Objects.equals(e.getName(), f.getValue())).findFirst();
|
||||
// if (entry.isPresent()) {
|
||||
// String key = entry.get().getKey();
|
||||
// if (org.apache.commons.lang3.StringUtils.isNotBlank(key)) {
|
||||
// if (StringUtils.isNotBlank(key)) {
|
||||
// String getter = "get" + key.substring(0, 1).toUpperCase() + key.substring(1);
|
||||
// try {
|
||||
// Method method = salaryFormulaEmployeeDTO.getClass().getMethod(getter);
|
||||
|
|
@ -203,9 +202,7 @@ public class SalaryBillBO {
|
|||
}
|
||||
}
|
||||
|
||||
return theme
|
||||
.replace("${companyName}", companyName)
|
||||
.replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth));
|
||||
return theme.replace("${companyName}", companyName).replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth));
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
@ -289,7 +286,7 @@ public class SalaryBillBO {
|
|||
File touch = FileUtil.touch(htmlPath);
|
||||
FileUtil.appendUtf8String(content, touch);
|
||||
|
||||
String pdfPath = HrmSalaryPayrollConf.GEN_PATH + yyyyMM + File.separator+ sendId + File.separator + id + ".pdf";
|
||||
String pdfPath = HrmSalaryPayrollConf.GEN_PATH + yyyyMM + File.separator + sendId + File.separator + id + ".pdf";
|
||||
FileUtil.del(pdfPath);
|
||||
HtmlToPdf.convert(HrmSalaryPayrollConf.TO_PDF_TOOL_PATH, htmlPath, pdfPath);
|
||||
}
|
||||
|
|
@ -362,14 +359,39 @@ public class SalaryBillBO {
|
|||
return data;
|
||||
}
|
||||
|
||||
public static void sendSMS(SalaryBillSendDTO salaryBillSendParam, Long id, Long employeeId) {
|
||||
public static void sendSMS(Map<String, Object> e, SalaryBillSendDTO salaryBillSendParam) {
|
||||
|
||||
// try {
|
||||
// MessageUtil.sendSMS(mobile, content);
|
||||
// } catch (Exception e) {
|
||||
// kqLog.info("SendSMS error.resourceId:" + resourceId + ">>>>>>mobile>>>>>>" + mobile);
|
||||
// log.writeLog(e);
|
||||
// }
|
||||
|
||||
SalaryTemplateSMSSetDTO smsSetting = salaryBillSendParam.getSmsSetting();
|
||||
String content = smsSetting != null ? smsSetting.getContent() : "";
|
||||
if (StringUtils.isBlank(content)) {
|
||||
return;
|
||||
}
|
||||
|
||||
content = content.replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate()));
|
||||
|
||||
for (SalaryTemplateSalaryItemListDTO item : salaryBillSendParam.getEmployeeInformation().getItems()) {
|
||||
content = content.replace("{" + item.getName() + "}", item.getSalaryItemValue());
|
||||
}
|
||||
|
||||
for (SalaryTemplateSalaryItemSetListDTO salaryTemplateSalaryItemSetListDTO : salaryBillSendParam.getSalaryItemSetList()) {
|
||||
for (SalaryTemplateSalaryItemListDTO item : salaryTemplateSalaryItemSetListDTO.getItems()) {
|
||||
if (content.contains("{" + item.getName() + "}")) {
|
||||
content = content.replace("{" + item.getName() + "}", e.getOrDefault(item.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX, "").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
log.info("发送短信内容, {}", content);
|
||||
if (e.get("mobile") != null) {
|
||||
MessageUtil.sendSMS(e.get("mobile").toString(), content);
|
||||
} else {
|
||||
log.error("发送短信失败,{}手机号为空", e.getOrDefault("username", ""));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("发送短信失败", ex);
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
@ -561,9 +583,7 @@ public class SalaryBillBO {
|
|||
InputStream imageInputStream = ImageFileManager.getInputStreamById(imagefileid);
|
||||
byte[] data = readInputStream(imageInputStream);
|
||||
String imageBase64 = "data:image/jpeg;base64," + Base64Utils.encodeToString(data);
|
||||
emailContent.append("<div style='width: 100%;margin-top: 16px;text-align: right;line-height: 1.5715;font-family: PingFangSC-Regular;font-size: 12px;color: #111111;'>\n" +
|
||||
" <img style='width: 140px;height: 70px;' src='" + imageBase64 + "'>" +
|
||||
" </div>");
|
||||
emailContent.append("<div style='width: 100%;margin-top: 16px;text-align: right;line-height: 1.5715;font-family: PingFangSC-Regular;font-size: 12px;color: #111111;'>\n" + " <img style='width: 140px;height: 70px;' src='" + imageBase64 + "'>" + " </div>");
|
||||
}
|
||||
}
|
||||
emailContent.append("</div>");
|
||||
|
|
@ -621,15 +641,20 @@ public class SalaryBillBO {
|
|||
} else {
|
||||
for (Object keyName : e.keySet()) {
|
||||
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
|
||||
boolean isHide = (isHideNull && e.get(keyName.toString()) != null) || (isHideZero && "0.00".equals(e.get(keyName.toString())));
|
||||
// 4.2.薪资项目
|
||||
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
|
||||
emailContent.append(salaryItem.getName());
|
||||
emailContent.append("</th>");
|
||||
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);
|
||||
if (!isHide) {
|
||||
// 4.2.薪资项目
|
||||
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
|
||||
emailContent.append(salaryItem.getName());
|
||||
emailContent.append("</th>");
|
||||
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append("</td>");
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append("</td>");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -696,15 +721,20 @@ public class SalaryBillBO {
|
|||
SalaryTemplateSalaryItemListDTO salaryItem = itemPartition.get(i);
|
||||
for (Object keyName : e.keySet()) {
|
||||
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
|
||||
boolean isHide = (isHideNull && e.get(keyName.toString()) != null) || (isHideZero && "0.00".equals(e.get(keyName.toString())));
|
||||
// 4.2.薪资项目
|
||||
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
|
||||
emailContent.append(salaryItem.getName());
|
||||
emailContent.append("</th>");
|
||||
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);
|
||||
if (!isHide) {
|
||||
// 4.2.薪资项目
|
||||
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
|
||||
emailContent.append(salaryItem.getName());
|
||||
emailContent.append("</th>");
|
||||
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append("</td>");
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append("</td>");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ public class SalaryBillSendDTO {
|
|||
//工资单模板-薪资项目设置
|
||||
private List<SalaryTemplateSalaryItemSetListDTO> salaryItemSetList;
|
||||
|
||||
//短信模板
|
||||
private SalaryTemplateSMSSetDTO smsSetting;
|
||||
|
||||
//工资单模板-员工基本信息
|
||||
private SalaryTemplateSalaryItemSetListDTO employeeInformation;
|
||||
|
||||
|
|
@ -74,7 +77,7 @@ public class SalaryBillSendDTO {
|
|||
private String remarkI18n;
|
||||
|
||||
//邮件是否可以发送邮件
|
||||
private boolean isEnableEmail;
|
||||
// private boolean isEnableEmail;
|
||||
|
||||
//工资单发放
|
||||
private SalarySendPO salarySend;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ public class SalaryTemplateBaseSetDTO {
|
|||
//消息中心")
|
||||
private Boolean msgStatus;
|
||||
|
||||
/**
|
||||
* 短信开启状态。0:关、1:开,默认关闭
|
||||
*/
|
||||
private Integer smsStatus;
|
||||
|
||||
/**
|
||||
* 短信模板设置
|
||||
*/
|
||||
private String smsSetting;
|
||||
|
||||
// 是否启用工资单定时发送
|
||||
private Boolean autoSendStatus;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryTemplateSMSDTO {
|
||||
|
||||
//展示名称
|
||||
private String itemName;
|
||||
|
||||
//薪资项目
|
||||
private String itemKey;
|
||||
|
||||
//来源
|
||||
private String source;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 短信模板设置
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryTemplateSMSSetDTO {
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSMSSetDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateTextContentPositionEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -45,6 +46,9 @@ public class SalaryTemplateSaveParam {
|
|||
// 消息中心开启状态。false:关、true:开
|
||||
private Boolean msgStatus;
|
||||
|
||||
// 短信开关 false:关、true:开
|
||||
private Boolean smsStatus;
|
||||
|
||||
// 主题
|
||||
private String theme;
|
||||
|
||||
|
|
@ -78,6 +82,9 @@ public class SalaryTemplateSaveParam {
|
|||
// 薪资项目设置
|
||||
private List<SalaryTemplateSalaryItemSetListDTO> salaryItemSetting;
|
||||
|
||||
//短信模板
|
||||
private SalaryTemplateSMSSetDTO smsSetting;
|
||||
|
||||
|
||||
// 补发工资单模板名称
|
||||
private String replenishName;
|
||||
|
|
@ -100,7 +107,6 @@ public class SalaryTemplateSaveParam {
|
|||
|
||||
/**
|
||||
* 反馈流程地址
|
||||
*
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
|
||||
|
|
@ -153,11 +159,11 @@ public class SalaryTemplateSaveParam {
|
|||
}
|
||||
|
||||
if (saveParam.getAutoSendStatus() == Boolean.TRUE) {
|
||||
if(StringUtils.isBlank(saveParam.getAutoSendDayOfMonth()))
|
||||
if (StringUtils.isBlank(saveParam.getAutoSendDayOfMonth()))
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(140509, "自动发放日期不能为空"));
|
||||
if(Objects.isNull(saveParam.getAutoSendCycleType()))
|
||||
if (Objects.isNull(saveParam.getAutoSendCycleType()))
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(140509, "自动发放周期不能为空"));
|
||||
if(StringUtils.isBlank(saveParam.getAutoSendTimeOfDay()))
|
||||
if (StringUtils.isBlank(saveParam.getAutoSendTimeOfDay()))
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(140509, "自动发放时间不能为空"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,11 @@ public class SalaryTemplatePO {
|
|||
*/
|
||||
private Integer smsStatus;
|
||||
|
||||
/**
|
||||
* 短信模板设置
|
||||
*/
|
||||
private String smsSetting;
|
||||
|
||||
/**
|
||||
* 薪酬水印
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public interface SalaryAcctResultMapper {
|
|||
* @param salaryAcctEmpIds
|
||||
* @param salaryItemIds
|
||||
*/
|
||||
void deleteByAcctEmpIdsAndSalaryItemIds(@Param("salaryAcctEmpIds") Collection<Long> salaryAcctEmpIds,
|
||||
void deleteByAcctEmpIdsAndSalaryItemIds(@Param("salaryAcctEmpIds") List<Long> salaryAcctEmpIds,
|
||||
@Param("salaryItemIds") Collection<Long> salaryItemIds);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="sms_setting" property="smsSetting"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -62,6 +63,7 @@
|
|||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.sms_setting
|
||||
</sql>
|
||||
<select id="getById" resultType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
||||
SELECT id,
|
||||
|
|
@ -94,6 +96,7 @@
|
|||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
sms_setting,
|
||||
tenant_key
|
||||
FROM hrsa_salary_template
|
||||
WHERE delete_type = 0
|
||||
|
|
@ -538,7 +541,10 @@
|
|||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator}
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="smsSetting != null">
|
||||
sms_setting=#{smsSetting}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
|
|
@ -645,6 +651,9 @@
|
|||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="smsSetting != null">
|
||||
sms_setting,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
|
@ -740,6 +749,9 @@
|
|||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="smsSetting != null">
|
||||
#{smsSetting},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -845,6 +857,9 @@
|
|||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="smsSetting != null">
|
||||
sms_setting,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
|
@ -940,6 +955,9 @@
|
|||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="smsSetting != null">
|
||||
#{sms_setting},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ public interface InsuranceBaseAdjustHistoryMapper {
|
|||
* 根据操作人或操作对象获取基数调整记录
|
||||
*/
|
||||
List<InsuranceArchivesBaseHistoryDTO> listByEmployeeIdAndOperator(@Param("operator")Long operator, @Param("employeeId")Long employeeId);
|
||||
List<InsuranceArchivesBaseHistoryDTO> listByExtEmpIdAndOperator(@Param("operator")Long operator, @Param("employeeId")Long employeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,4 +196,40 @@
|
|||
</if>
|
||||
ORDER BY t.operate_time DESC, t.adjust_welfare_item_id ASC
|
||||
</select>
|
||||
|
||||
<select id="listByExtEmpIdAndOperator" resultType="com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO">
|
||||
SELECT
|
||||
t.id
|
||||
, t.employee_id
|
||||
, t.payment_organization
|
||||
, t.welfare_type
|
||||
, t.adjust_before_scheme_id
|
||||
, t.adjust_after_scheme_id
|
||||
, t.adjust_before_base_value
|
||||
, t.adjust_after_base_value
|
||||
, t.adjust_welfare_item_id
|
||||
, t.operator
|
||||
, t.operate_time
|
||||
, ca.insurance_name as welfareItemName
|
||||
, sb.scheme_name as adjustBeforeSchemeName
|
||||
, sa.scheme_name as adjustAfterSchemeName
|
||||
, eo.lastname as operatorName
|
||||
, ee.username as employeeName
|
||||
, p.name as paymentOrganizationName
|
||||
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
|
||||
LEFT JOIN hrsa_social_security_scheme sb on sb.id = t.adjust_before_scheme_id
|
||||
LEFT JOIN hrsa_social_security_scheme sa on sa.id = t.adjust_after_scheme_id
|
||||
LEFT JOIN hrsa_insurance_category ca on ca.id = t.adjust_welfare_item_id
|
||||
LEFT JOIN hrsa_tax_agent p on p.id = t.payment_organization
|
||||
WHERE t.delete_type = 0
|
||||
<if test="employeeId != null ">
|
||||
AND t.employee_id = #{employeeId}
|
||||
</if>
|
||||
<if test="operator != null ">
|
||||
AND t.operator = #{operator}
|
||||
</if>
|
||||
ORDER BY t.operate_time DESC, t.adjust_welfare_item_id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,371 @@
|
|||
package com.engine.salary.remote.attend.cmd;
|
||||
|
||||
import com.api.hrm.bean.HrmFieldBean;
|
||||
import com.api.hrm.util.HrmFieldUtil;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.kq.biz.KQBalanceOfLeaveBiz;
|
||||
import com.engine.kq.biz.KQLeaveRulesBiz;
|
||||
import com.engine.kq.biz.KQLeaveRulesComInfo;
|
||||
import com.engine.kq.biz.KQReportBiz;
|
||||
import com.engine.kq.util.KQTransMethod;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 员工假期余额报表--获取查询列表
|
||||
*/
|
||||
public class GetSearchListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public GetSearchListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
/**
|
||||
* 分页控件返回的值
|
||||
* currentPage:当前页数
|
||||
* pageSize:每页多少条数据
|
||||
*/
|
||||
int currentPage = Util.getIntValue((String) params.get("currentPage"), 1);
|
||||
int pageSize = Util.getIntValue((String) params.get("pageSize"), 10);
|
||||
/**
|
||||
* 时间范围选择的年份
|
||||
* dateScope:5-本年、8-上一年
|
||||
* selectedYear:指定年份
|
||||
*/
|
||||
String dateScope = Util.null2String(params.get("dateScope"));
|
||||
String selectedYear = Util.null2String(params.get("selectedYear"));
|
||||
if (dateScope.equals("5") || dateScope.equals("8")) {
|
||||
selectedYear = TimeUtil.getDateByOption(dateScope, "0").substring(0, 4);
|
||||
}
|
||||
/**
|
||||
* 数据范围
|
||||
* dataScope:0-总部、1-分部、2-分部、3-人员、4-我的下属
|
||||
* subcomId:指定分部ID
|
||||
* deptId:指定部门ID
|
||||
* resourceId:指定人员ID
|
||||
* allLevel:是否包含下级下属:0-不包含、1-包含
|
||||
*/
|
||||
String dataScope = Util.null2String(params.get("dataScope"));
|
||||
String subcomId = Util.null2String(params.get("subcomId"));
|
||||
String deptId = Util.null2String(params.get("deptId"));
|
||||
String resourceId = Util.null2String(params.get("resourceId"));
|
||||
String allLevel = Util.null2String(params.get("allLevel"));
|
||||
/**
|
||||
* isNoAccount:是否显示无账号人员:true-显示、false-不显示
|
||||
*/
|
||||
String isNoAccount = Util.null2String(params.get("isNoAccount"));
|
||||
|
||||
try {
|
||||
/**
|
||||
* 获取考勤报表权限共享设置
|
||||
*/
|
||||
KQReportBiz kqReportBiz = new KQReportBiz();
|
||||
// String rightStr = kqReportBiz.getReportRight("4", "" + user.getUID(), "a");
|
||||
String rightStr ="";
|
||||
|
||||
/**
|
||||
* 拼凑查询结果列表的表头
|
||||
*/
|
||||
List<Map<String, Object>> columnsList = new ArrayList<Map<String, Object>>();
|
||||
List<HrmFieldBean> hrmFieldBeanList = new ArrayList<HrmFieldBean>();
|
||||
HrmFieldBean hrmFieldBean = null;
|
||||
String[] tempArr = new String[]{"lastName,413", "subcom,141", "dept,124", "jobtitle,6086","workcode,714", "companyStartDate,1516"};
|
||||
for (int i = 0; i < tempArr.length; i++) {
|
||||
String[] fieldInfo = tempArr[i].split(",");
|
||||
hrmFieldBean = new HrmFieldBean();
|
||||
hrmFieldBean.setFieldname(fieldInfo[0]);
|
||||
hrmFieldBean.setFieldlabel(fieldInfo[1]);
|
||||
hrmFieldBean.setFieldhtmltype("1");
|
||||
hrmFieldBean.setType("1");
|
||||
hrmFieldBean.setViewAttr(1);
|
||||
hrmFieldBean.setIsFormField(true);
|
||||
hrmFieldBeanList.add(hrmFieldBean);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************/
|
||||
|
||||
/**获取假期类型的相关设置*/
|
||||
|
||||
/*请假类型的ID*/
|
||||
String leaveRulesId = "";
|
||||
|
||||
/*假期类型的名称,用作查询结果列表的表头显示*/
|
||||
String leaveName = "";
|
||||
|
||||
/*最小请假单位:1-按天请假、2-按半天请假、3-按小时请假、4-按整天请假*/
|
||||
int minimumUnit = 1;
|
||||
|
||||
/*请假单位的显示名称是天还是小时*/
|
||||
String unitName = "";
|
||||
|
||||
/*是否开启假期余额,没有开启假期余额时需要提示“不限制余额*/
|
||||
int balanceEnable = 0;
|
||||
|
||||
/**********************************************************************************************************/
|
||||
|
||||
/*是否是混合模式(福利年假+法定年假)*/
|
||||
boolean isMixMode = false;
|
||||
|
||||
//是否是调休
|
||||
boolean isTiaoXiu = false;
|
||||
|
||||
/**********************************************************************************************************/
|
||||
|
||||
/*获取当前日期*/
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
|
||||
Map<String, BigDecimal> balanceMap = new HashMap<String, BigDecimal>();
|
||||
KQLeaveRulesComInfo rulesComInfo = new KQLeaveRulesComInfo();
|
||||
rulesComInfo.setTofirstRow();
|
||||
while (rulesComInfo.next()) {
|
||||
if (rulesComInfo.getIsEnable().equals("0")) {
|
||||
continue;//此假期类型没有启用
|
||||
}
|
||||
|
||||
/*获取假期类型的设置 start*/
|
||||
leaveRulesId = rulesComInfo.getId();
|
||||
leaveName = Util.formatMultiLang(rulesComInfo.getLeaveName(), "" + user.getLanguage());
|
||||
minimumUnit = Util.getIntValue(rulesComInfo.getMinimumUnit(), 1);
|
||||
if (minimumUnit == 1 || minimumUnit == 2 || minimumUnit == 4) {
|
||||
unitName = SystemEnv.getHtmlLabelName(389325, user.getLanguage());//(天)
|
||||
} else {
|
||||
unitName = SystemEnv.getHtmlLabelName(389326, user.getLanguage());//(小时)
|
||||
}
|
||||
String showName = leaveName + unitName;
|
||||
balanceEnable = Util.getIntValue(rulesComInfo.getBalanceEnable(), 0);
|
||||
|
||||
isMixMode = KQLeaveRulesBiz.isMixMode(leaveRulesId);
|
||||
isTiaoXiu = KQLeaveRulesBiz.isTiaoXiu(leaveRulesId);
|
||||
/*获取假期类型的设置 end*/
|
||||
|
||||
hrmFieldBean = new HrmFieldBean();
|
||||
hrmFieldBean.setFieldname(rulesComInfo.getId());
|
||||
hrmFieldBean.setFieldlabelname(showName);
|
||||
hrmFieldBean.setFieldhtmltype("1");
|
||||
hrmFieldBean.setType("1");
|
||||
hrmFieldBean.setViewAttr(1);
|
||||
hrmFieldBean.setIsFormField(true);
|
||||
hrmFieldBeanList.add(hrmFieldBean);
|
||||
|
||||
/*判断该假期规则是否开启了假期余额,若没有开启,则无需查找该假期的余额,直接遍历下一个假期*/
|
||||
if (balanceEnable == 0) {
|
||||
continue;
|
||||
}
|
||||
//如果是调休,获取假期余额的方式有些不同
|
||||
if(isTiaoXiu){
|
||||
params.put("leaveRulesId",leaveRulesId);
|
||||
params.put("showAll","false");
|
||||
Map<String, BigDecimal> _balanceMap = KQBalanceOfLeaveBiz.getRestAmountMapByDis5(params,user);
|
||||
balanceMap.putAll(_balanceMap);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*查询指定年份指定假期的余额数据,并放入集合中,用于后续拼凑查询结果数据*/
|
||||
KQTransMethod transMethod = new KQTransMethod();
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String sql = "select a.id hrmResourceId,a.companyStartDate,a.workStartDate,b.* from HrmResource a left join kq_balanceOfLeave b on a.id=b.resourceId " +
|
||||
"and belongYear='" + selectedYear + "' and b.leaveRulesId=" + leaveRulesId + " where 1=1 ";
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
sql = "select a.id hrmResourceId,a.companyStartDate,a.workStartDate,b.*,ROW_NUMBER() OVER(order by dspOrder,a.id) as rn from HrmResource a left join kq_balanceOfLeave b on a.id=b.resourceId " +
|
||||
"and belongYear='" + selectedYear + "' and b.leaveRulesId=" + leaveRulesId + " where 1=1 ";
|
||||
} else if (recordSet.getDBType().equalsIgnoreCase("mysql")) {
|
||||
sql = "select a.id hrmResourceId,a.companyStartDate,a.workStartDate,b.* from HrmResource a left join kq_balanceOfLeave b on a.id=b.resourceId " +
|
||||
"and belongYear='" + selectedYear + "' and b.leaveRulesId=" + leaveRulesId + " where 1=1 ";
|
||||
}
|
||||
if (dataScope.equals("0")) {
|
||||
//总部
|
||||
} else if (dataScope.equals("1")) {
|
||||
sql += " and a.subcompanyId1 in (" + subcomId + ") ";
|
||||
} else if (dataScope.equals("2")) {
|
||||
sql += " and a.departmentId in (" + deptId + ") ";
|
||||
} else if (dataScope.equals("3")) {
|
||||
sql += " and a.id in (" + resourceId + ")";
|
||||
} else if (dataScope.equals("4")) {
|
||||
if (allLevel.equals("1")) {
|
||||
sql += " and (a.id=" + user.getUID() + " or a.managerStr like '%," + user.getUID() + ",%' )";
|
||||
} else {
|
||||
sql += " and (a.id=" + user.getUID() + " or a.managerid = " + user.getUID() + ")";
|
||||
}
|
||||
}
|
||||
if (isNoAccount.equals("false")) {
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")
|
||||
|| recordSet.getDBType().equalsIgnoreCase("mysql")) {
|
||||
sql += " and (loginId is not null and loginId<>'')";
|
||||
} else {
|
||||
sql += " and (loginId is not null)";
|
||||
}
|
||||
}
|
||||
//考勤报表共享设置
|
||||
if (!rightStr.equals("") && !dataScope.equals("4")) {
|
||||
sql += rightStr;
|
||||
}
|
||||
if (!recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
sql += " order by dspOrder,hrmResourceId ";
|
||||
}
|
||||
|
||||
String pageSql = "select * from (select tmp.*,rownum rn from (" + sql + ") tmp where rownum<=" + (pageSize * currentPage) + ") where rn>=" + (pageSize * (currentPage - 1) + 1);
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
pageSql = "select t.* from (" + sql + ") t where 1=1 and rn>=" + (pageSize * (currentPage - 1) + 1) + " and rn<=" + (pageSize * currentPage);
|
||||
} else if (recordSet.getDBType().equalsIgnoreCase("mysql")) {
|
||||
pageSql = sql + " limit " + (currentPage - 1) * pageSize + "," + pageSize;
|
||||
}
|
||||
recordSet.executeQuery(pageSql);
|
||||
while (recordSet.next()) {
|
||||
String hrmResourceId = recordSet.getString("hrmResourceId");
|
||||
//所属年份
|
||||
String belongYear = recordSet.getString("belongYear");
|
||||
//失效日期
|
||||
String effectiveDate = recordSet.getString("effectiveDate");
|
||||
//失效日期
|
||||
String expirationDate = recordSet.getString("expirationDate");
|
||||
/*判断假期余额的有效期*/
|
||||
boolean status = KQBalanceOfLeaveBiz.getBalanceStatus(leaveRulesId, hrmResourceId, belongYear, currentDate,effectiveDate,expirationDate);
|
||||
if (!status) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal baseAmount = new BigDecimal(Util.getDoubleValue(recordSet.getString("baseAmount"), 0.00));//假期基数
|
||||
BigDecimal usedAmount = new BigDecimal(Util.getDoubleValue(recordSet.getString("usedAmount"), 0.00));//已用假期
|
||||
BigDecimal extraAmount = new BigDecimal(Util.getDoubleValue(recordSet.getString("extraAmount"), 0.00));//额外假期
|
||||
BigDecimal baseAmount2 = new BigDecimal(Util.getDoubleValue(recordSet.getString("baseAmount2"), 0.00));//用于混合模式时:福利年假基数
|
||||
BigDecimal usedAmount2 = new BigDecimal(Util.getDoubleValue(recordSet.getString("usedAmount2"), 0.00));//用于混合模式时:已用福利年假
|
||||
BigDecimal extraAmount2 = new BigDecimal(Util.getDoubleValue(recordSet.getString("extraAmount2"), 0.00));//用于混合模式时:额外福利年假
|
||||
|
||||
BigDecimal restAmount = new BigDecimal(0);
|
||||
if (isMixMode) {
|
||||
/*释放规则*/
|
||||
baseAmount = KQBalanceOfLeaveBiz.getCanUseAmount(hrmResourceId, leaveRulesId, belongYear, baseAmount, "legal", currentDate);
|
||||
baseAmount2 = KQBalanceOfLeaveBiz.getCanUseAmount(hrmResourceId, leaveRulesId, belongYear, baseAmount2, "welfare", currentDate);
|
||||
|
||||
restAmount = baseAmount.add(extraAmount).subtract(usedAmount).add(baseAmount2).add(extraAmount2).subtract(usedAmount2);
|
||||
} else {
|
||||
/*释放规则*/
|
||||
baseAmount = KQBalanceOfLeaveBiz.getCanUseAmount(hrmResourceId, leaveRulesId, belongYear, baseAmount, "", currentDate);
|
||||
|
||||
restAmount = baseAmount.add(extraAmount).subtract(usedAmount);
|
||||
}
|
||||
balanceMap.put(hrmResourceId + "_" + leaveRulesId, restAmount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于拼凑查询结果列表的表数据
|
||||
*/
|
||||
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
||||
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
||||
List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String sql = "select * from HrmResource a where 1=1 ";
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
sql = "select *,ROW_NUMBER() OVER(order by dspOrder,id) as rn from HrmResource a where 1=1 ";
|
||||
}
|
||||
if (dataScope.equals("0")) {
|
||||
//总部
|
||||
} else if (dataScope.equals("1")) {
|
||||
sql += " and a.subcompanyId1 in (" + subcomId + ") ";
|
||||
} else if (dataScope.equals("2")) {
|
||||
sql += " and a.departmentId in (" + deptId + ") ";
|
||||
} else if (dataScope.equals("3")) {
|
||||
sql += " and a.id in (" + resourceId + ")";
|
||||
} else if (dataScope.equals("4")) {
|
||||
if (allLevel.equals("1")) {
|
||||
sql += " and (a.id=" + user.getUID() + " or a.managerStr like '%," + user.getUID() + ",%' )";
|
||||
} else {
|
||||
sql += " and (a.id=" + user.getUID() + " or a.managerid = " + user.getUID() + ")";
|
||||
}
|
||||
}
|
||||
if (isNoAccount.equals("false")) {
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")
|
||||
|| recordSet.getDBType().equalsIgnoreCase("mysql")) {
|
||||
sql += " and (a.loginId is not null and a.loginId<>'')";
|
||||
} else {
|
||||
sql += " and (a.loginId is not null)";
|
||||
}
|
||||
}
|
||||
//考勤报表共享设置
|
||||
if (!rightStr.equals("") && !dataScope.equals("4")) {
|
||||
sql += rightStr;
|
||||
}
|
||||
if (!recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
sql += " order by dspOrder,id ";
|
||||
}
|
||||
String pageSql = "select * from (select tmp.*,rownum rn from (" + sql + ") tmp where rownum<=" + (pageSize * currentPage) + ") where rn>=" + (pageSize * (currentPage - 1) + 1);
|
||||
if (recordSet.getDBType().equalsIgnoreCase("sqlserver")) {
|
||||
pageSql = "select t.* from (" + sql + ") t where 1=1 and rn>=" + (pageSize * (currentPage - 1) + 1) + " and rn<=" + (pageSize * currentPage);
|
||||
} else if (recordSet.getDBType().equalsIgnoreCase("mysql")) {
|
||||
pageSql = sql + " limit " + (currentPage - 1) * pageSize + "," + pageSize;
|
||||
}
|
||||
recordSet.executeQuery(pageSql);
|
||||
while (recordSet.next()) {
|
||||
dataMap = new HashMap<String, Object>();
|
||||
|
||||
String id = recordSet.getString("id");
|
||||
String lastName = Util.formatMultiLang(recordSet.getString("lastName"), "" + user.getLanguage());
|
||||
String departmentId = recordSet.getString("departmentId");
|
||||
String subcompanyId = recordSet.getString("subcompanyId1");
|
||||
String jobtitleId = recordSet.getString("jobtitle");
|
||||
String workcode = recordSet.getString("workcode");
|
||||
String companyStartdate = recordSet.getString("companyStartdate");
|
||||
|
||||
dataMap.put("id", id);
|
||||
dataMap.put("lastName", lastName);
|
||||
dataMap.put("subcom", Util.formatMultiLang(subCompanyComInfo.getSubcompanyname(subcompanyId), "" + user.getLanguage()));
|
||||
dataMap.put("dept", Util.formatMultiLang(departmentComInfo.getDepartmentname(departmentId), "" + user.getLanguage()));
|
||||
dataMap.put("jobtitle", Util.formatMultiLang(jobTitlesComInfo.getJobTitlesname(jobtitleId), "" + user.getLanguage()));
|
||||
dataMap.put("workcode", workcode);
|
||||
dataMap.put("companyStartDate", companyStartdate);
|
||||
dataMap.put("subcomId", subcompanyId);
|
||||
dataMap.put("deptId", departmentId);
|
||||
dataMap.put("jobtitleId", jobtitleId);
|
||||
|
||||
rulesComInfo.setTofirstRow();
|
||||
while (rulesComInfo.next()) {
|
||||
if (rulesComInfo.getIsEnable().equals("0")) {
|
||||
continue;
|
||||
}
|
||||
/*该假期没有开启余额限制,显示不限制余额*/
|
||||
if (rulesComInfo.getBalanceEnable().equals("0")) {
|
||||
dataMap.put(rulesComInfo.getId(), SystemEnv.getHtmlLabelName(389731, user.getLanguage()));//不限制余额
|
||||
continue;
|
||||
}
|
||||
BigDecimal restAmount = balanceMap.get(id + "_" + rulesComInfo.getId());
|
||||
dataMap.put(rulesComInfo.getId(), restAmount != null ? restAmount.setScale(2, RoundingMode.HALF_UP).toPlainString() : "0");
|
||||
}
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
|
||||
columnsList = HrmFieldUtil.getHrmDetailTable(hrmFieldBeanList, null, user);
|
||||
resultMap.put("columns", columnsList);
|
||||
resultMap.put("datas", dataList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@ package com.engine.salary.remote.attend.service.impl;
|
|||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.kq.cmd.balanceofleaverp.GetSearchListCmd;
|
||||
import com.engine.kq.cmd.report.GetKQReportCmd;
|
||||
import com.engine.salary.remote.attend.cmd.GetSearchListCmd;
|
||||
import com.engine.salary.remote.attend.entity.Attend4Salary;
|
||||
import com.engine.salary.remote.attend.service.RemoteAttend4SalaryService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -106,8 +106,9 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
@Override
|
||||
public List<Map<String, String>> getDatas(Attend4Salary attend4Salary) {
|
||||
ValidUtil.doValidator(attend4Salary);
|
||||
log.info("开始获取的考勤数据,参数{}", attend4Salary);
|
||||
log.info("salaryAttend开始获取的考勤数据,参数{}", attend4Salary);
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
|
||||
try {
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
paramsMap.put("pageIndex", 1);
|
||||
|
|
@ -126,10 +127,13 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
temp.put("reportType", "month");
|
||||
list = (List<Map<String, String>>) commandExecutor.execute(new GetKQReportCmd(temp, user)).get("datas");
|
||||
if (isLog) {
|
||||
log.info("获取的考勤数据,{}", JSONUtils.toJSONString(list));
|
||||
log.info("salaryAttend获取的考勤数据,{}", JSONUtils.toJSONString(list));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("salaryAttend获取考勤数据失败", e);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
//假期余额信息
|
||||
List<Map<String, String>> balanceOfLeaveDatas = getBalanceOfLeaveDatas(attend4Salary);
|
||||
Map<String, Map<String, String>> balanceMap = SalaryEntityUtil.convert2Map(balanceOfLeaveDatas, m -> m.get("id"));
|
||||
|
|
@ -159,7 +163,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
.collect(Collectors.toList());
|
||||
list.addAll(balanceOfLeaveList);
|
||||
} catch (Exception e) {
|
||||
log.error("获取考勤数据失败", e);
|
||||
log.error("salaryAttend获取假期数据失败", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -191,7 +195,8 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
@Override
|
||||
public List<Map<String, String>> getBalanceOfLeaveDatas(Attend4Salary attend4Salary) {
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
paramsMap.put("dateScope", "6");
|
||||
paramsMap.put("currentPage", "1");
|
||||
paramsMap.put("pageSize", "500");
|
||||
paramsMap.put("selectedYear", SalaryDateUtil.date2Year(attend4Salary.getBeginDate()));
|
||||
paramsMap.put("dataScope", "3");
|
||||
paramsMap.put("resourceId", attend4Salary.getOnlyEmpIds().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.service;
|
|||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资报表
|
||||
|
|
@ -36,6 +37,6 @@ public interface SalaryAcctReportService {
|
|||
* @param salaryAcctEmployeeIds 薪资核算人员id
|
||||
* @param salaryItemIds 薪资项目id
|
||||
*/
|
||||
void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds);
|
||||
void deleteByAcctEmployeeIdsAndSalaryItemIds(List<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public interface SalaryAcctResultService {
|
|||
* @param salaryAcctEmployeeIds 薪资核算人员id
|
||||
* @param salaryItemIds 薪资项目id
|
||||
*/
|
||||
void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds);
|
||||
void deleteByAcctEmployeeIdsAndSalaryItemIds(List<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id删除薪资核算结果
|
||||
|
|
|
|||
|
|
@ -450,11 +450,11 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// AttendQuoteDataBO.buildAttendDataFromRemote("day", attendResult.getData(), attendQuoteFields, attendQuoteSyncData);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取考勤数据错误失败:{}", String.format("参数:%s,错误信息:%s", JSONObject.toJSONString(attend4Salary), e.getMessage()), e);
|
||||
log.error("salaryAttend获取考勤数据错误失败:{}", String.format("参数:%s,错误信息:%s", JSONObject.toJSONString(attend4Salary), e.getMessage()), e);
|
||||
return attendQuoteSyncData;
|
||||
}
|
||||
if (isLog) {
|
||||
log.info("同步的考勤数据:{}", JSONUtils.toJSONString(attendQuoteSyncData));
|
||||
log.info("salaryAttend同步的考勤数据:{}", JSONUtils.toJSONString(attendQuoteSyncData));
|
||||
}
|
||||
return attendQuoteSyncData;
|
||||
}
|
||||
|
|
@ -484,7 +484,6 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
dataValueBiz.deleteByAttendQuoteIds(quoteIds);
|
||||
// 新增考勤值数据
|
||||
if (CollectionUtils.isNotEmpty(values)) {
|
||||
log.info("考勤数据:{}", values);
|
||||
//去除空值
|
||||
values = values.stream().filter(po -> StringUtils.isNotBlank(po.getDataValue())).collect(Collectors.toList());
|
||||
dataValueBiz.insertData(values);
|
||||
|
|
@ -539,7 +538,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
} catch (Exception e) {
|
||||
log.error("下载模板失败", e);
|
||||
log.error("salaryAttend下载模板失败", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.api.formmode.page.util.Util;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
|
|
@ -39,8 +38,6 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -291,11 +288,13 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listByParam(queryParam);
|
||||
Set<String> keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
|
||||
lastMonthSalaryAcctEmployeePOMap.forEach((k, v) -> {
|
||||
if (!keySet.contains(k)) {
|
||||
resultList.add(v);
|
||||
}
|
||||
});
|
||||
if(CollectionUtils.isNotEmpty(keySet)){
|
||||
lastMonthSalaryAcctEmployeePOMap.forEach((k, v) -> {
|
||||
if (!keySet.contains(k)) {
|
||||
resultList.add(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
|
@ -618,30 +617,30 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
// 获取分部信息
|
||||
List<Long> subCompanyIds = param.getSubCompany();
|
||||
if (CollectionUtils.isNotEmpty(subCompanyIds)) {
|
||||
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
List<String> allSubcompanyIds = new ArrayList<>();
|
||||
for (Long subCompanyId : subCompanyIds) {
|
||||
String organizationIds = Util.null2String(subCompanyId);
|
||||
String allChildSubcompanyId = subCompanyComInfo.getAllChildSubcompanyId(subCompanyId.toString(), organizationIds);
|
||||
allSubcompanyIds.addAll(Arrays.asList(allChildSubcompanyId.split(",")));
|
||||
}
|
||||
employeeList = employeeList.stream().filter(emp -> allSubcompanyIds.contains(emp.getSubcompanyid().toString())).collect(Collectors.toList());
|
||||
// SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
// List<String> allSubcompanyIds = new ArrayList<>();
|
||||
// for (Long subCompanyId : subCompanyIds) {
|
||||
// String organizationIds = Util.null2String(subCompanyId);
|
||||
// String allChildSubcompanyId = subCompanyComInfo.getAllChildSubcompanyId(subCompanyId.toString(), organizationIds);
|
||||
// allSubcompanyIds.addAll(Arrays.asList(allChildSubcompanyId.split(",")));
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> subCompanyIds.contains(emp.getSubcompanyid())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 部门过滤
|
||||
List<Long> depart = param.getDepart();
|
||||
if (CollectionUtils.isNotEmpty(depart)) {
|
||||
List<String> allDepartIds = new ArrayList<>();
|
||||
for (Long subDepartId : depart) {
|
||||
String ids = Util.null2String(subDepartId);
|
||||
try {
|
||||
String allDepartId = DepartmentComInfo.getAllChildDepartId(subDepartId.toString(), ids);
|
||||
allDepartIds.addAll(Arrays.asList(allDepartId.toString().split(",")));
|
||||
} catch (Exception e) {
|
||||
log.error("获取子部门失败", e);
|
||||
}
|
||||
}
|
||||
employeeList = employeeList.stream().filter(emp -> allDepartIds.contains(emp.getDepartmentId().toString())).collect(Collectors.toList());
|
||||
// List<String> allDepartIds = new ArrayList<>();
|
||||
// for (Long subDepartId : depart) {
|
||||
// String ids = Util.null2String(subDepartId);
|
||||
// try {
|
||||
// String allDepartId = DepartmentComInfo.getAllChildDepartId(subDepartId.toString(), ids);
|
||||
// allDepartIds.addAll(Arrays.asList(allDepartId.toString().split(",")));
|
||||
// } catch (Exception e) {
|
||||
// log.error("获取子部门失败", e);
|
||||
// }
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> depart.contains(emp.getDepartmentId())).collect(Collectors.toList());
|
||||
}
|
||||
// 职级过滤
|
||||
// if (CollectionUtils.isNotEmpty(param.getGrade())) {
|
||||
|
|
|
|||
|
|
@ -643,15 +643,19 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = listByTaxCycle(yearRange, salarySobIds);
|
||||
List<SalaryAcctRecordPO> selfSalaryAcctRecordPOS = filterByAuthority(salaryAcctRecordPOS);
|
||||
|
||||
// 如果已经存在之后月份的薪资核算记录了,就不允许重新核算本月了
|
||||
SalaryAcctRecordPO afterSalaryAcctRecordPO = selfSalaryAcctRecordPOS.stream()
|
||||
.filter(po -> po.getSalaryMonth().compareTo(salaryAcctRecordPO.getSalaryMonth()) > 0)
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
if (Objects.nonNull(afterSalaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(105826, "已经存在{0}的薪资核算记录了,不能重新核算{1}的薪资了")
|
||||
.replace("{0}", SalaryDateUtil.localDate2YearMonth(afterSalaryAcctRecordPO.getSalaryMonth()).toString())
|
||||
.replace("{1}", SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString()));
|
||||
// 获取个税申报功能状态
|
||||
TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration();
|
||||
if (!taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) {
|
||||
// 如果已经存在之后月份的薪资核算记录了,就不允许重新核算本月了
|
||||
SalaryAcctRecordPO afterSalaryAcctRecordPO = selfSalaryAcctRecordPOS.stream()
|
||||
.filter(po -> po.getSalaryMonth().compareTo(salaryAcctRecordPO.getSalaryMonth()) > 0)
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
if (Objects.nonNull(afterSalaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(105826, "已经存在{0}的薪资核算记录了,不能重新核算{1}的薪资了")
|
||||
.replace("{0}", SalaryDateUtil.localDate2YearMonth(afterSalaryAcctRecordPO.getSalaryMonth()).toString())
|
||||
.replace("{1}", SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString()));
|
||||
}
|
||||
}
|
||||
|
||||
if (!isReCalc) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ 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.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -82,10 +83,11 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
|
||||
public void deleteByAcctEmployeeIdsAndSalaryItemIds(List<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeeIds) && CollectionUtils.isNotEmpty(salaryItemIds)) {
|
||||
List<String> salaryAcctEmployeeIdsStr = salaryAcctEmployeeIds.stream().map(e -> AESEncryptUtil.encrypt(e.toString())).collect(Collectors.toList());
|
||||
getSalaryAcctResultReportMapper().deleteByAcctEmpIdsAndSalaryItemIds(salaryAcctEmployeeIdsStr, salaryItemIds);
|
||||
List<List<String>> partition = Lists.partition(salaryAcctEmployeeIdsStr, 300);
|
||||
partition.forEach(part -> getSalaryAcctResultReportMapper().deleteByAcctEmpIdsAndSalaryItemIds(part, salaryItemIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -619,7 +619,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// salaryAcctResultPOS.addAll(salarySobBackItemResultPO);
|
||||
// }
|
||||
// 删除原来的薪资核算结果
|
||||
deleteBySalaryAcctEmployeeIds(Collections.singleton(saveParam.getSalaryAcctEmpId()));
|
||||
List<Long> saveItemIds = saveParam.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList());
|
||||
deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds);
|
||||
// 保存薪资核算结果
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
|
||||
// 加密
|
||||
|
|
@ -628,7 +629,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
partition.forEach(getSalaryAcctResultMapper()::batchInsert);
|
||||
}
|
||||
//报表 todo
|
||||
getSalaryAcctReportService(user).deleteBySalaryAcctEmpIds(Collections.singleton(saveParam.getSalaryAcctEmpId()));
|
||||
getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds);
|
||||
List<SalaryAcctResultReportPO> salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) {
|
||||
getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
|
||||
|
|
@ -701,8 +702,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
|
||||
|
||||
@Override
|
||||
public void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
|
||||
getSalaryAcctResultMapper().deleteByAcctEmpIdsAndSalaryItemIds(salaryAcctEmployeeIds, salaryItemIds);
|
||||
public void deleteByAcctEmployeeIdsAndSalaryItemIds(List<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
|
||||
List<List<Long>> partition = Lists.partition(salaryAcctEmployeeIds, 300);
|
||||
partition.forEach(part -> getSalaryAcctResultMapper().deleteByAcctEmpIdsAndSalaryItemIds(part, salaryItemIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
|
|
@ -12,10 +13,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|||
import com.engine.salary.entity.progress.ProgressDTO;
|
||||
import com.engine.salary.entity.salaryBill.bo.SalaryBillBO;
|
||||
import com.engine.salary.entity.salaryBill.bo.SalaryTemplateBO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillSendDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryExportPdfParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendInfoQueryParam;
|
||||
|
|
@ -324,8 +322,7 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
if (StringUtils.isNotEmpty(salaryTemplate.getTextContent())) {
|
||||
String yearI18n = SalaryI18nUtil.getI18nLabel(100325, "年");
|
||||
String monthI18n = SalaryI18nUtil.getI18nLabel(100326, "月");
|
||||
salaryTemplate
|
||||
.setTextContent(salaryTemplate.getTextContent().replace("${salaryMonth}", salaryMonth.getYear() + yearI18n + salaryMonth.getMonth() + monthI18n));
|
||||
salaryTemplate.setTextContent(salaryTemplate.getTextContent().replace("${salaryMonth}", salaryMonth.getYear() + yearI18n + salaryMonth.getMonth() + monthI18n));
|
||||
}
|
||||
|
||||
// 工资单水印设置
|
||||
|
|
@ -362,6 +359,8 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
.employeeInformation(employeeInformation)
|
||||
// 工资单模板-对应人员字段
|
||||
.employeeField(employeeField)
|
||||
//短信模板
|
||||
.smsSetting(JSON.parseObject(salaryTemplate.getSmsSetting(), SalaryTemplateSMSSetDTO.class))
|
||||
// 工资单模板-发放说明标签国际化
|
||||
.remarkI18n(remarkI18n)
|
||||
// 邮件是否可以发送邮件
|
||||
|
|
@ -430,15 +429,16 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
List<SalaryAcctResultPO> salaryAcctResultValues = Lists.newArrayList();
|
||||
|
||||
//是否需要发送邮件
|
||||
Boolean isEnableEmail = salaryBillSendParam.getSendChannels().contains(MessageChannelEnum.EMAIL);
|
||||
boolean isEnableEmail = salaryBillSendParam.getSendChannels().contains(MessageChannelEnum.EMAIL);
|
||||
boolean isEnableSMS = salaryBillSendParam.getSendChannels().contains(MessageChannelEnum.SMS);
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
int partSize = 100;// 分片大小,越小进度条跑得越短平快,但是总体速度更慢
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, partSize);
|
||||
for (List<Long> part : partition) {
|
||||
// 更新进度
|
||||
getProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), part.size());
|
||||
/** 注意只有邮件才需要加密的核算数据 */
|
||||
if (isEnableEmail || GEN_PDF) {
|
||||
/** 注意只有邮件或生成pdf才需要加密的核算数据 */
|
||||
if (isEnableEmail || isEnableSMS || GEN_PDF) {
|
||||
List<SalaryAcctEmployeePO> acctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(Collections.singletonList(salarySend.getSalaryAccountingId()), part);
|
||||
salaryAcctEmployees.addAll(acctEmployees);
|
||||
salaryAcctResultValues.addAll(getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(SalaryEntityUtil.properties(acctEmployees, SalaryAcctEmployeePO::getId, Collectors.toList())));
|
||||
|
|
@ -446,7 +446,7 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
}
|
||||
} else {
|
||||
/** 注意只有邮件才需要加密的核算数据 */
|
||||
if (isEnableEmail || GEN_PDF) {
|
||||
if (isEnableEmail || isEnableSMS || GEN_PDF) {
|
||||
salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salarySend.getSalaryAccountingId());
|
||||
salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singletonList(salarySend.getSalaryAccountingId()));
|
||||
}
|
||||
|
|
@ -571,12 +571,20 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
SalaryBillBO.sendMsg(salaryBillSendParam, Long.valueOf(e.get("id").toString()), Long.valueOf(e.get("employeeId").toString()));
|
||||
}
|
||||
|
||||
if (sendChannels.contains(MessageChannelEnum.EMAIL) || GEN_PDF) {
|
||||
// 构建发送消息
|
||||
if (sendChannels.contains(MessageChannelEnum.EMAIL) || sendChannels.contains(MessageChannelEnum.SMS) || GEN_PDF) {
|
||||
// 构建人员信息
|
||||
SalaryBillBO.buildEmployeeInfo(salaryBillSendParam, allEmployeeMap.get(e.get("employeeId").toString()));
|
||||
SalaryBillBO.sendEmail(e, salaryBillSendParam);
|
||||
}
|
||||
|
||||
//发送邮件
|
||||
if (sendChannels.contains(MessageChannelEnum.EMAIL)) {
|
||||
SalaryBillBO.sendEmail(e, salaryBillSendParam);
|
||||
}
|
||||
|
||||
//发送短信
|
||||
if (sendChannels.contains(MessageChannelEnum.SMS)) {
|
||||
SalaryBillBO.sendSMS(e, salaryBillSendParam);
|
||||
}
|
||||
}
|
||||
|
||||
/** 发送工资单 **********************************************************/
|
||||
sendInfoUpdateList.add(SalarySendInfoPO.builder()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobBiz;
|
||||
|
|
@ -139,11 +140,13 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
// 保存
|
||||
SalaryTemplatePO salaryTemplate = SalaryTemplateBO.convertToPO(saveParam, (long) user.getUID());
|
||||
// salaryTemplate.setSendEmailId(saveParam.getSendEmail());
|
||||
salaryTemplate.setEmailStatus(saveParam.getEmailStatus()?1:0);
|
||||
salaryTemplate.setMsgStatus(saveParam.getMsgStatus()?1:0);
|
||||
salaryTemplate.setEmailStatus(saveParam.getEmailStatus() ? 1 : 0);
|
||||
salaryTemplate.setMsgStatus(saveParam.getMsgStatus() ? 1 : 0);
|
||||
salaryTemplate.setSmsStatus(saveParam.getSmsStatus() != null && saveParam.getSmsStatus() ? 1 : 0);
|
||||
salaryTemplate.setSmsSetting(saveParam.getSmsSetting() == null ? "" : JSON.toJSONString(saveParam.getSmsSetting()));
|
||||
salaryTemplate.setTextContentPosition(saveParam.getTextContentPosition());
|
||||
salaryTemplate.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus()?1:0);
|
||||
salaryTemplate.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0);
|
||||
salaryTemplate.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus() ? 1 : 0);
|
||||
salaryTemplate.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus() ? 1 : 0);
|
||||
salaryTemplate.setAutoSendCycleType(saveParam.getAutoSendCycleType());
|
||||
mapper.insert(salaryTemplate);
|
||||
|
||||
|
|
@ -202,14 +205,16 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
BeanUtils.copyProperties(saveParam, salaryTemplateNew);
|
||||
salaryTemplateNew.setUpdateTime(new Date());
|
||||
salaryTemplateNew.setSendEmailId(0L);
|
||||
salaryTemplateNew.setEmailStatus(saveParam.getEmailStatus()?1:0);
|
||||
salaryTemplateNew.setMsgStatus(saveParam.getMsgStatus()?1:0);
|
||||
salaryTemplateNew.setEmailStatus(saveParam.getEmailStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setMsgStatus(saveParam.getMsgStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setSmsStatus(saveParam.getSmsStatus() != null && saveParam.getSmsStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setSmsSetting(saveParam.getSmsSetting() == null ? "" : JSON.toJSONString(saveParam.getSmsSetting()));
|
||||
salaryTemplateNew.setTextContentPosition(saveParam.getTextContentPosition());
|
||||
salaryTemplateNew.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus()?1:0);
|
||||
salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0);
|
||||
salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus()?1:0);
|
||||
salaryTemplateNew.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setAutoSendCycleType(saveParam.getAutoSendCycleType());
|
||||
salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0);
|
||||
salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus() ? 1 : 0);
|
||||
salaryTemplateNew.setAutoAckDays(saveParam.getAutoAckDays());
|
||||
salaryTemplateNew.setFeedbackUrl(saveParam.getFeedbackUrl());
|
||||
// todo 薪资项目设置检查校验
|
||||
|
|
@ -271,7 +276,7 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
|
||||
// 复制工资单自定义名称信息
|
||||
List<SalaryBillItemNamePO> billItemNamePOList = getSalaryBillItemNameService(user).ListByTemplateAndType(SalaryBillItemNamePO.builder().salaryTemplateId(copyParam.getId()).build());
|
||||
if(CollectionUtils.isNotEmpty(billItemNamePOList)){
|
||||
if (CollectionUtils.isNotEmpty(billItemNamePOList)) {
|
||||
Date now = new Date();
|
||||
List<SalaryBillItemNamePO> needInsertList = billItemNamePOList.stream().map(po -> {
|
||||
SalaryBillItemNamePO newSalaryBillItemNamePO = new SalaryBillItemNamePO();
|
||||
|
|
@ -321,7 +326,7 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
public List<Map<String, Object>> selectSalarySobList() {
|
||||
List<SalarySobPO> salarySobs = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
|
||||
|
||||
return salarySobs.stream().map(m->{
|
||||
return salarySobs.stream().map(m -> {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("id", String.valueOf(m.getId()));
|
||||
map.put("content", m.getName());
|
||||
|
|
@ -339,17 +344,17 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
List<SalarySobItemGroupDTO> itemGroupDTOS = salarySobItemAggregate.getItemGroups().stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList());
|
||||
// 获取关闭显示的薪资项目
|
||||
List<Long> hideItemIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salarySobId).isGroup(0).build());
|
||||
for(SalarySobItemGroupDTO DTO : itemGroupDTOS){
|
||||
for (SalarySobItemGroupDTO DTO : itemGroupDTOS) {
|
||||
List<SalarySobItemDTO> items = DTO.getItems();
|
||||
DTO.setItems( items.stream().filter(item -> !(hideItemIDs.contains(item.getSalaryItemId()))).collect(Collectors.toList()) );
|
||||
DTO.setItems(items.stream().filter(item -> !(hideItemIDs.contains(item.getSalaryItemId()))).collect(Collectors.toList()));
|
||||
}
|
||||
itemGroupDTOS = itemGroupDTOS.stream().filter(DTO -> CollectionUtils.isNotEmpty(DTO.getItems())).collect(Collectors.toList());
|
||||
salarySobItemAggregate.setItemGroups(itemGroupDTOS);
|
||||
if(hideGroupIDs.contains(0L)){
|
||||
if (hideGroupIDs.contains(0L)) {
|
||||
// 隐藏了未分类
|
||||
salarySobItemAggregate.setItems(Collections.emptyList());
|
||||
}else{
|
||||
salarySobItemAggregate.setItems( salarySobItemAggregate.getItems().stream().filter( item -> !(hideItemIDs.contains(item.getSalaryItemId())) ).collect(Collectors.toList()) );
|
||||
} else {
|
||||
salarySobItemAggregate.setItems(salarySobItemAggregate.getItems().stream().filter(item -> !(hideItemIDs.contains(item.getSalaryItemId()))).collect(Collectors.toList()));
|
||||
}
|
||||
return SalaryTemplateBO.convertSalarySobItemAggregateToSalaryItemSet(salarySobItemAggregate, new Long(user.getUID()), isReplenish);
|
||||
}
|
||||
|
|
@ -370,10 +375,10 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
.forEach(data -> {
|
||||
data.getItems().forEach(item -> {
|
||||
Long salaryItemId = Long.valueOf(item.getSalaryItemId());
|
||||
if(itemShowNameMap.containsKey(salaryItemId)){
|
||||
if (itemShowNameMap.containsKey(salaryItemId)) {
|
||||
item.setSalaryItemShowName(itemShowNameMap.get(salaryItemId));
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + item.getOriginName() +")");
|
||||
}else{
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + item.getOriginName() + ")");
|
||||
} else {
|
||||
item.setSalaryItemShowName(item.getOriginName());
|
||||
item.setName(item.getOriginName());
|
||||
}
|
||||
|
|
@ -410,7 +415,7 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
} else {
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salaryTemplateDTOList, SalaryTemplateListDTO.class);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
// 查询
|
||||
salaryTemplateDTOList = mapper.listDTO(SalaryTemplatePO.builder().salarySobId(queryParam.getSalarySobId()).name(queryParam.getName()).build());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成")
|
||||
.replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId()))
|
||||
.replace("{1}", saveParam.getSalaryMonth().toString()));
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 查询薪资所属月的薪资核算记录
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
||||
|
|
@ -204,7 +204,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
// 无薪资核算结果,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctResultPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据")
|
||||
.replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
|
||||
Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId);
|
||||
|
|
@ -213,14 +213,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()));
|
||||
if (notArchived) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报")
|
||||
.replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表
|
||||
Date taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle();
|
||||
boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0);
|
||||
if (differentTaxCycle) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表")
|
||||
.replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId);
|
||||
|
|
|
|||
|
|
@ -103,6 +103,14 @@ public class SalaryDateUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static String getFormatYearMonth(YearMonth localDate) {
|
||||
if (localDate == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return localDate.format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
|
||||
}
|
||||
|
||||
public static String getFormatLocalDate(LocalDate localDate) {
|
||||
if (localDate == null) {
|
||||
return StringUtils.EMPTY;
|
||||
|
|
@ -224,7 +232,7 @@ public class SalaryDateUtil {
|
|||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(localDate);
|
||||
int year = c.get(Calendar.YEAR);
|
||||
return year ;
|
||||
return year;
|
||||
}
|
||||
|
||||
public static LocalDateRange localDate2Range(Date localDate) {
|
||||
|
|
@ -254,6 +262,7 @@ public class SalaryDateUtil {
|
|||
cal.set(Calendar.DAY_OF_MONTH, last);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
public static Date getFirstDayDateOfMonthWithMinutesAndSeconds(final Date date) {
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
|
|
@ -291,8 +300,6 @@ public class SalaryDateUtil {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static String getMonthBegin(String specifiedDay) {
|
||||
int year;
|
||||
int month;
|
||||
|
|
@ -563,9 +570,10 @@ public class SalaryDateUtil {
|
|||
|
||||
/**
|
||||
* 转换时间对象
|
||||
* @see SalaryDateUtil#toDate(LocalDateTime, String)
|
||||
*
|
||||
* @param dateTime LocalDateTime
|
||||
* @return Date
|
||||
* @see SalaryDateUtil#toDate(LocalDateTime, String)
|
||||
*/
|
||||
public static Date toDate(LocalDateTime dateTime) {
|
||||
return toDate(dateTime, null);
|
||||
|
|
@ -574,8 +582,9 @@ public class SalaryDateUtil {
|
|||
|
||||
/**
|
||||
* 转换时间对象
|
||||
*
|
||||
* @param dateTime LocalDateTime
|
||||
* @param offset 时区,e.g. +8
|
||||
* @param offset 时区,e.g. +8
|
||||
* @return Date
|
||||
*/
|
||||
public static Date toDate(LocalDateTime dateTime, String offset) {
|
||||
|
|
|
|||
|
|
@ -129,6 +129,20 @@ public class SalaryBillController {
|
|||
return new ResponseResult<Long, List<SalaryTemplateSalaryItemSetListDTO>>(user).run(getSalaryTemplateWrapper(user)::getSalaryItemSet, salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取短信薪资项目设置
|
||||
*
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/getSmsSalaryItemSet")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSmsSalaryItemSet(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("salarySobId") Long salarySobId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<SalaryTemplateSalaryItemSetListDTO>>(user).run(getSalaryTemplateWrapper(user)::getSmsSalaryItemSet, salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用的薪资项目
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
|
|||
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||
salaryItemMap.put("id", String.valueOf(m.getId()));
|
||||
salaryItemMap.put("content", m.getName());
|
||||
salaryItemMap.put("dataType", m.getDataType());
|
||||
return salaryItemMap;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
|
|
|||
|
|
@ -164,8 +164,8 @@ public class SalaryTemplateWrapper extends Service {
|
|||
salaryTemplateBaseSetDTO.setMsgStatus(po.getMsgStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId());
|
||||
salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId());
|
||||
salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() == null ? false : po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0);
|
||||
salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() != null && po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() != null && NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0);
|
||||
salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays());
|
||||
// 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID
|
||||
salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule());
|
||||
|
|
@ -178,14 +178,12 @@ public class SalaryTemplateWrapper extends Service {
|
|||
|
||||
// 查询所有启用的薪资账套
|
||||
List<SalarySobPO> salarySobs = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
|
||||
List<Map<String, Object>> salarySobOptions = salarySobs.stream()
|
||||
.map(salarySobPO -> {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("id", salarySobPO.getId());
|
||||
item.put("name", salarySobPO.getName());
|
||||
return item;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
List<Map<String, Object>> salarySobOptions = salarySobs.stream().map(salarySobPO -> {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("id", salarySobPO.getId());
|
||||
item.put("name", salarySobPO.getName());
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 邮箱下拉
|
||||
// List<WeaFormOption> sendEmailOptions = Lists.newArrayList();
|
||||
|
|
@ -195,10 +193,10 @@ public class SalaryTemplateWrapper extends Service {
|
|||
|
||||
// WeaForm salaryTemplateBase = SalaryFormatUtil.<SalaryTemplateBaseSetDTO>getInstance().buildForm(SalaryTemplateBaseSetDTO.class, SalaryTemplateBaseSetDTO.builder().salarySobOptions(salarySobOptions).sendEmailOptions(sendEmailOptions).build());
|
||||
|
||||
if(id == null){
|
||||
if (id == null) {
|
||||
// 新建,获取默认的确认反馈信息
|
||||
SalaryBillAckFeedbackDTO defaultAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting();
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(),"1"));
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(), "1"));
|
||||
salaryTemplateBaseSetDTO.setAutoAckDays(defaultAckFeedback.getAutoAckDays());
|
||||
salaryTemplateBaseSetDTO.setFeedbackUrl(defaultAckFeedback.getFeedBackUrl());
|
||||
}
|
||||
|
|
@ -208,11 +206,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
// 编辑时禁止修改薪资账套 前端实现
|
||||
// 分组 前端实现
|
||||
|
||||
return SalaryTemplateBaseFormDTO.builder()
|
||||
.id(id)
|
||||
.salaryTemplateBaseSet(salaryTemplateBase)
|
||||
.replenishRuleSetOption(replenishRuleSetOptionList)
|
||||
.build();
|
||||
return SalaryTemplateBaseFormDTO.builder().id(id).salaryTemplateBaseSet(salaryTemplateBase).replenishRuleSetOption(replenishRuleSetOptionList).build();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -261,7 +255,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
// 获取工资单薪资项目展示名信息
|
||||
Map<Long, String> itemShowNameMap;
|
||||
Map<Long, SalaryBillItemNameDTO> salaryBillItemNameDTOMap = Collections.emptyMap();
|
||||
if (id != null){
|
||||
if (id != null) {
|
||||
List<SalaryBillItemNamePO> billItemNameList = getSalaryBillItemNameService(user).ListByTemplateAndType(SalaryBillItemNamePO.builder().salaryTemplateId(id).salaryBillType(0).build());
|
||||
itemShowNameMap = SalaryEntityUtil.convert2Map(billItemNameList, SalaryBillItemNamePO::getSalaryItemId, SalaryBillItemNamePO::getSalaryItemShowName);
|
||||
// 获取薪资项目信息
|
||||
|
|
@ -274,15 +268,14 @@ public class SalaryTemplateWrapper extends Service {
|
|||
if (CollectionUtils.isNotEmpty(salaryTemplateShowSetData)) {
|
||||
salaryTemplateShowSetData.stream()
|
||||
//排除人员消息
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111"))
|
||||
.forEach(data -> {
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111")).forEach(data -> {
|
||||
data.getItems().forEach(item -> {
|
||||
Long salaryItemId = Long.valueOf(item.getSalaryItemId());
|
||||
item.setOriginName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
if(itemShowNameMap.containsKey(salaryItemId)){
|
||||
if (itemShowNameMap.containsKey(salaryItemId)) {
|
||||
item.setSalaryItemShowName(itemShowNameMap.get(salaryItemId));
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + itemIdNameMap.getOrDefault(salaryItemId, item.getName()) +")");
|
||||
}else{
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + itemIdNameMap.getOrDefault(salaryItemId, item.getName()) + ")");
|
||||
} else {
|
||||
item.setSalaryItemShowName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
item.setName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
}
|
||||
|
|
@ -291,14 +284,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
return SalaryTemplateShowFormDTO.builder()
|
||||
.id(id)
|
||||
.vars(Arrays.stream(SalaryTemplateVarEnum.values()).map(SalaryTemplateVarEnum::getValue).collect(Collectors.toList()))
|
||||
.salaryTemplateShowSet(salaryTemplateShowSet)
|
||||
.salaryTemplateSalaryItemSet(salaryTemplateShowSetData)
|
||||
.replenishSalaryTemplateSalaryItemSet(replenishSalaryTemplateSalaryItemSet)
|
||||
.salaryBillItemNameSet(salaryBillItemNameDTOMap)
|
||||
.build();
|
||||
return SalaryTemplateShowFormDTO.builder().id(id).vars(Arrays.stream(SalaryTemplateVarEnum.values()).map(SalaryTemplateVarEnum::getValue).collect(Collectors.toList())).salaryTemplateShowSet(salaryTemplateShowSet).salaryTemplateSalaryItemSet(salaryTemplateShowSetData).replenishSalaryTemplateSalaryItemSet(replenishSalaryTemplateSalaryItemSet).salaryBillItemNameSet(salaryBillItemNameDTOMap).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -311,6 +297,18 @@ public class SalaryTemplateWrapper extends Service {
|
|||
return getSalaryTemplateService(user).getSalaryItemSet(salarySobId, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
public List<SalaryTemplateSalaryItemSetListDTO> getSmsSalaryItemSet(Long salarySobId) {
|
||||
List<SalaryTemplateSalaryItemSetListDTO> salaryItemSet = getSalaryTemplateService(user).getSalaryItemSet(salarySobId, false);
|
||||
|
||||
salaryItemSet.add(0, SalaryTemplateSalaryItemSetListDTO.builder().groupId("444444444444444444L").groupName("基本信息").items(Collections.singletonList(SalaryTemplateSalaryItemListDTO.builder().name("薪资所属月").build())).build());
|
||||
return salaryItemSet;
|
||||
}
|
||||
|
||||
public List<SalaryTemplateSalaryItemSetListDTO> getReplenishSalaryItemSet(Long salarySobId) {
|
||||
return getSalaryTemplateService(user).getSalaryItemSet(salarySobId, true);
|
||||
}
|
||||
|
|
@ -447,20 +445,19 @@ public class SalaryTemplateWrapper extends Service {
|
|||
if (CollectionUtils.isNotEmpty(replenishSalaryItemSetting)) {
|
||||
replenishSalaryItemSetting.stream()
|
||||
//排除人员消息
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111"))
|
||||
.forEach(data -> {
|
||||
data.getItems().forEach(item -> {
|
||||
Long salaryItemId = Long.valueOf(item.getSalaryItemId());
|
||||
item.setOriginName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
if(itemShowNameMap.containsKey(salaryItemId)){
|
||||
item.setSalaryItemShowName(itemShowNameMap.get(salaryItemId));
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + itemIdNameMap.getOrDefault(salaryItemId, item.getName()) + ")");
|
||||
}else{
|
||||
item.setSalaryItemShowName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
item.setName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
}
|
||||
});
|
||||
});
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111")).forEach(data -> {
|
||||
data.getItems().forEach(item -> {
|
||||
Long salaryItemId = Long.valueOf(item.getSalaryItemId());
|
||||
item.setOriginName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
if (itemShowNameMap.containsKey(salaryItemId)) {
|
||||
item.setSalaryItemShowName(itemShowNameMap.get(salaryItemId));
|
||||
item.setName(itemShowNameMap.get(salaryItemId) + "(" + itemIdNameMap.getOrDefault(salaryItemId, item.getName()) + ")");
|
||||
} else {
|
||||
item.setSalaryItemShowName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
item.setName(itemIdNameMap.getOrDefault(salaryItemId, item.getName()));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
replenishSalaryItemSetting = getReplenishSalaryItemSet(replenishFormQueryParam.getSalarySobId());
|
||||
|
|
@ -469,11 +466,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
replenishSalaryItemSetting = getReplenishSalaryItemSet(replenishFormQueryParam.getSalarySobId());
|
||||
}
|
||||
|
||||
return SalaryTemplateReplenishFormDTO.builder()
|
||||
.id(id)
|
||||
.replenishSalaryTemplateSalaryItemSet(replenishSalaryItemSetting)
|
||||
.salaryBillItemNameSet(salaryBillItemNameDTOMap)
|
||||
.build();
|
||||
return SalaryTemplateReplenishFormDTO.builder().id(id).replenishSalaryTemplateSalaryItemSet(replenishSalaryItemSetting).salaryBillItemNameSet(salaryBillItemNameDTOMap).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -483,20 +476,10 @@ public class SalaryTemplateWrapper extends Service {
|
|||
* @return 单个分组下剩余的薪资项目
|
||||
*/
|
||||
public List<SalaryTemplateSalaryItemListDTO> getSalaryItemSetGrouped(SalaryBillSalaryItemQueryParam param) {
|
||||
Boolean isReplenish = Optional.ofNullable(param.getIsReplenish())
|
||||
.orElse(false);
|
||||
List<SalaryTemplateSalaryItemSetListDTO> salaryItemSet
|
||||
= getSalaryTemplateService(user).getSalaryItemSetContainHide(param.getSalarySobId(), param.getSalaryTemplateId(), isReplenish);
|
||||
Boolean isReplenish = Optional.ofNullable(param.getIsReplenish()).orElse(false);
|
||||
List<SalaryTemplateSalaryItemSetListDTO> salaryItemSet = getSalaryTemplateService(user).getSalaryItemSetContainHide(param.getSalarySobId(), param.getSalaryTemplateId(), isReplenish);
|
||||
Long groupId = param.getGroupId();
|
||||
return salaryItemSet.stream()
|
||||
.filter(s -> Objects.equals(s.getGroupId(), groupId + ""))
|
||||
.map(SalaryTemplateSalaryItemSetListDTO::getItems)
|
||||
.findFirst()
|
||||
.orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.filter(item -> !Optional.ofNullable(param.getExistSalaryItemIds()).orElse(Collections.emptyList())
|
||||
.contains(item.getId())
|
||||
).collect(Collectors.toList());
|
||||
return salaryItemSet.stream().filter(s -> Objects.equals(s.getGroupId(), groupId + "")).map(SalaryTemplateSalaryItemSetListDTO::getItems).findFirst().orElse(Collections.emptyList()).stream().filter(item -> !Optional.ofNullable(param.getExistSalaryItemIds()).orElse(Collections.emptyList()).contains(item.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -506,17 +489,12 @@ public class SalaryTemplateWrapper extends Service {
|
|||
* @return 分组与下属
|
||||
*/
|
||||
public List<SalaryTemplateSalaryItemSetListDTO> getSalaryGroupSet(SalaryBillSalaryGroupQueryParam param) {
|
||||
Boolean isReplenish = Optional.ofNullable(param.getIsReplenish())
|
||||
.orElse(false);
|
||||
return getSalaryTemplateService(user).getSalaryItemSetContainHide(param.getSalarySobId(), param.getSalaryTemplateId(), isReplenish)
|
||||
.stream()
|
||||
.filter(group -> !Optional.ofNullable(param.getExistSalaryGroupIds()).orElse(Collections.emptyList())
|
||||
.contains(group.getGroupId())
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
Boolean isReplenish = Optional.ofNullable(param.getIsReplenish()).orElse(false);
|
||||
return getSalaryTemplateService(user).getSalaryItemSetContainHide(param.getSalarySobId(), param.getSalaryTemplateId(), isReplenish).stream().filter(group -> !Optional.ofNullable(param.getExistSalaryGroupIds()).orElse(Collections.emptyList()).contains(group.getGroupId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void saveItemShowName(List<SalaryBillItemNameSaveParam> saveList) {
|
||||
getSalaryBillItemNameService(user).saveItemShowName(saveList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue