Merge branch 'release/2.17.1.2411.01' into release/个税版本
# Conflicts: # src/com/engine/salary/service/impl/SalarySobServiceImpl.java # src/com/engine/salary/web/SalarySobController.java # src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java # src/com/engine/salary/wrapper/SalarySobItemWrapper.java
This commit is contained in:
commit
ce098fcd89
|
|
@ -1,5 +1,5 @@
|
|||
log=false
|
||||
defaultCloseNonStandard149=true
|
||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||
version=2.16.1.2410.01
|
||||
version=2.17.1.2411.01
|
||||
openFormulaForcedEditing=false
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id NUMBER(38,0) primary key,
|
||||
salary_sob_id NUMBER(38,0),
|
||||
open_approval NUMBER,
|
||||
approval_group_setting clob,
|
||||
workflow_url varchar2(500) DEFAULT NULL,
|
||||
delete_type NUMBER,
|
||||
create_time DATE default sysdate,
|
||||
update_time DATE default sysdate,
|
||||
creator NUMBER(38,0)
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar2(50);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar2(50);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add account_type NUMBER;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id NUMBER(38,0) primary key,
|
||||
salary_sob_id NUMBER(38,0),
|
||||
open_approval NUMBER,
|
||||
approval_group_setting clob,
|
||||
workflow_url varchar2(500) DEFAULT NULL,
|
||||
delete_type NUMBER,
|
||||
create_time DATE default sysdate,
|
||||
update_time DATE default sysdate,
|
||||
creator NUMBER(38,0)
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar2(50);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar2(50);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add account_type NUMBER;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id NUMBER(38,0) primary key,
|
||||
salary_sob_id NUMBER(38,0),
|
||||
open_approval NUMBER,
|
||||
approval_group_setting clob,
|
||||
workflow_url varchar2(500) DEFAULT NULL,
|
||||
delete_type NUMBER,
|
||||
create_time DATE default sysdate,
|
||||
update_time DATE default sysdate,
|
||||
creator NUMBER(38,0)
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar2(50);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar2(50);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add account_type NUMBER;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id bigint NOT NULL,
|
||||
salary_sob_id bigint NOT NULL,
|
||||
open_approval int NOT NULL,
|
||||
approval_group_setting text NULL,
|
||||
workflow_url varchar(500) NULL DEFAULT NULL,
|
||||
delete_type int NOT NULL,
|
||||
create_time datetime NOT NULL ,
|
||||
update_time datetime NOT NULL,
|
||||
creator bigint NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar(50);
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar(50);
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp ADD COLUMN account_type int(0);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id NUMBER(38,0) primary key,
|
||||
salary_sob_id NUMBER(38,0),
|
||||
open_approval NUMBER,
|
||||
approval_group_setting clob,
|
||||
workflow_url varchar2(500) DEFAULT NULL,
|
||||
delete_type NUMBER,
|
||||
create_time DATE default sysdate,
|
||||
update_time DATE default sysdate,
|
||||
creator NUMBER(38,0)
|
||||
)
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar2(50)
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar2(50)
|
||||
/
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_salary_acct_emp add account_type NUMBER
|
||||
/
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id bigint primary key,
|
||||
salary_sob_id bigint,
|
||||
open_approval int,
|
||||
approval_group_setting text,
|
||||
workflow_url varchar(500) DEFAULT NULL,
|
||||
delete_type int,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
creator bigint
|
||||
)
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar(50)
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar(50)
|
||||
/
|
||||
|
|
@ -0,0 +1 @@
|
|||
alter table hrsa_salary_acct_emp add account_type int;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id bigint NOT NULL,
|
||||
salary_sob_id bigint NOT NULL,
|
||||
open_approval int NOT NULL,
|
||||
approval_group_setting text NULL,
|
||||
workflow_url varchar(500)NULL DEFAULT NULL,
|
||||
delete_type int NOT NULL,
|
||||
create_time datetime NOT NULL ,
|
||||
update_time datetime NOT NULL,
|
||||
creator bigint NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
GO
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar(50)
|
||||
GO
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar(50)
|
||||
GO
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp ADD account_type int
|
||||
GO
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE hrsa_salary_approval_rule (
|
||||
id NUMBER(38,0) primary key,
|
||||
salary_sob_id NUMBER(38,0),
|
||||
open_approval NUMBER,
|
||||
approval_group_setting clob,
|
||||
workflow_url varchar2(500) DEFAULT NULL,
|
||||
delete_type NUMBER,
|
||||
create_time DATE default sysdate,
|
||||
update_time DATE default sysdate,
|
||||
creator NUMBER(38,0)
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_id varchar2(50);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_record add approval_status varchar2(50);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add account_type NUMBER;
|
||||
/
|
||||
|
||||
|
|
@ -25,5 +25,5 @@ where item.name = '工资薪金合计'
|
|||
left join hrsa_salary_item c on c.id=i.salary_item_id
|
||||
left join hrsa_tax_agent t on a.tax_agent_id=t.id
|
||||
where a.delete_type=0 and i.delete_type=0 and t.delete_type=0 and c.delete_type=0
|
||||
and a.employee_id=人员id and t.name=扣缴义务人名称
|
||||
c.name='基本工资' order by effective_time desc
|
||||
and a.employee_id=人员id and t.name=扣缴义务人名称
|
||||
and c.name='基本工资' order by effective_time desc
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.engine.salary.action;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
|
||||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName updateSalaryApprovalStatusAction
|
||||
* @author Harryxzy
|
||||
* @date 2024/4/24 15:44
|
||||
* @description 跟新薪资核算审批状态
|
||||
*/
|
||||
@Slf4j
|
||||
public class updateSalaryApprovalStatusAction implements Action {
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordMapper getSalaryAcctRecordMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class);
|
||||
}
|
||||
|
||||
|
||||
// 记录薪资核算记录id的字段
|
||||
private String salaryAcctRecordIdField;
|
||||
|
||||
// 修改为对应的状态
|
||||
private String status;
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
try {
|
||||
if (StringUtils.isEmpty(salaryAcctRecordIdField)) {
|
||||
requestInfo.getRequestManager().setMessage("薪资核算记录id字段不能为空");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Property[] properties = requestInfo.getMainTableInfo().getProperty();
|
||||
Map<String, String> fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName,
|
||||
property -> Util.null2String(property.getValue())));
|
||||
String salaryAcctRecordId = fieldMap.get(salaryAcctRecordIdField);
|
||||
if (!NumberUtil.isNumber(salaryAcctRecordId)) {
|
||||
requestInfo.getRequestManager().setMessage("核算记录id不为数字");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
User user = new User();
|
||||
user.setUid(1);
|
||||
user.setLoginid("sysadmin");
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(Long.valueOf(salaryAcctRecordId));
|
||||
if (salaryAcctRecordPO == null) {
|
||||
requestInfo.getRequestManager().setMessage("核算记录不存在或已被删除");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
salaryAcctRecordPO.setApprovalStatus(status);
|
||||
getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
|
||||
} catch (Exception e) {
|
||||
log.error("审批状态更新失败", e);
|
||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -114,6 +114,17 @@ public class DataCollectionEmployee {
|
|||
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 98624, dataType = "string")
|
||||
private String idNo;
|
||||
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "账号类型", labelId = 98622, dataType = "string")
|
||||
private String accountTypeName;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
* 0/null:主账号 1:次账号
|
||||
*/
|
||||
@SalaryFormulaVar(defaultLabel = "账号类型编码", labelId = 98622, dataType = "string")
|
||||
private Integer accountType;
|
||||
|
||||
//是否是系统管理员
|
||||
private Boolean isAdmin;
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ public class SalaryBillBO {
|
|||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.accountType(simpleEmployee.getAccountType())
|
||||
.accountTypeName(simpleEmployee.getAccountTypeName())
|
||||
.build();
|
||||
List<SalaryTemplateSalaryItemListDTO> items = employeeInformation.getItems();
|
||||
// 1.SalaryAcctResultBO.buildEmployeeFieldName()的取法
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.AccountTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -66,6 +67,7 @@ public class SalaryAcctEmployeeBO {
|
|||
.departmentId(e.getDepartmentId())
|
||||
.departmentName(e.getDepartmentName())
|
||||
.status(UserStatusEnum.getDefaultLabelByValue(NumberUtils.toInt(e.getStatus())))
|
||||
.accountType(AccountTypeEnum.getDefaultLabelByValue(e.getAccountType()))
|
||||
.mobile(simpleEmployee.getMobile())
|
||||
.jobNum(simpleEmployee.getWorkcode())
|
||||
.hireDate(simpleEmployee.getCompanystartdate())
|
||||
|
|
@ -110,6 +112,7 @@ public class SalaryAcctEmployeeBO {
|
|||
.subcompanyId(emp.getSubcompanyid())
|
||||
.subcompanyName(emp.getSubcompanyName())
|
||||
.status(emp.getStatus())
|
||||
.accountType(emp.getAccountType())
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
|
|
@ -138,6 +141,8 @@ public class SalaryAcctEmployeeBO {
|
|||
simpleEmployee.setJobtitleName(acctEmployeePO.getJobtitleName());
|
||||
simpleEmployee.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(acctEmployeePO.getStatus(), "1"))));
|
||||
simpleEmployee.setStatus(acctEmployeePO.getStatus());
|
||||
simpleEmployee.setAccountType(acctEmployeePO.getAccountType());
|
||||
simpleEmployee.setAccountTypeName(AccountTypeEnum.getDefaultLabelByValue(acctEmployeePO.getAccountType()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ public class SalaryAcctFormulaBO {
|
|||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.accountType(simpleEmployee.getAccountType())
|
||||
.accountTypeName(simpleEmployee.getAccountTypeName())
|
||||
.departmentName(simpleEmployee.getDepartmentName())
|
||||
.departmentId(simpleEmployee.getDepartmentId())
|
||||
.subcompanyName(simpleEmployee.getSubcompanyName())
|
||||
|
|
@ -115,6 +117,8 @@ public class SalaryAcctFormulaBO {
|
|||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.accountType(simpleEmployee.getAccountType())
|
||||
.accountTypeName(simpleEmployee.getAccountTypeName())
|
||||
.departmentName(salaryAcctEmployeePO.getDepartmentName())
|
||||
.departmentId(salaryAcctEmployeePO.getDepartmentId())
|
||||
.subcompanyName(salaryAcctEmployeePO.getSubcompanyName())
|
||||
|
|
|
|||
|
|
@ -47,7 +47,10 @@ public class SalaryAcctRecordBO {
|
|||
List<DataCollectionEmployee> employeeComInfos,
|
||||
List<SalaryAcctEmployeeCountDTO> salaryAcctEmployeeCountDTOS,
|
||||
List<SalarySendCheckDTO> salarySendCheckResult,
|
||||
List<TaxAgentPO> taxAgentPOS) {
|
||||
List<TaxAgentPO> taxAgentPOS,
|
||||
List<Long> needApprovalSalarySobIds,
|
||||
boolean approvalCanFile,
|
||||
boolean approvalCanReCalc) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
@ -69,16 +72,22 @@ public class SalaryAcctRecordBO {
|
|||
if(!Objects.equals(salaryAcctRecordPO.getBackCalcStatus(),NumberUtils.INTEGER_ONE)){
|
||||
btnList.add(new WeaTableOperate("删除", null, "1"));
|
||||
}
|
||||
btnList.add(new WeaTableOperate("归档", null, "2"));
|
||||
if (approvalCanFile || !needApprovalSalarySobIds.contains(salaryAcctRecordPO.getSalarySobId())) {
|
||||
btnList.add(new WeaTableOperate("归档", null, "2"));
|
||||
}
|
||||
} else if (SalaryAcctRecordStatusEnum.ARCHIVED == salaryAcctRecordStatusEnum && ( salarySendMap.get(salaryAcctRecordPO.getId()) ==Boolean.TRUE ) ){
|
||||
btnList.add(new WeaTableOperate("查看", null, "3"));
|
||||
btnList.add(new WeaTableOperate("重新核算", null, "4"));
|
||||
if (approvalCanReCalc || !needApprovalSalarySobIds.contains(salaryAcctRecordPO.getSalarySobId())) {
|
||||
btnList.add(new WeaTableOperate("重新核算", null, "4"));
|
||||
}
|
||||
if(salaryAcctRecordPO.getBackCalcStatus() == null || salaryAcctRecordPO.getBackCalcStatus() == NumberUtils.INTEGER_ZERO) {
|
||||
btnList.add(new WeaTableOperate("回算", null, "5"));
|
||||
}
|
||||
} else {
|
||||
btnList.add(new WeaTableOperate("查看", null, "3"));
|
||||
btnList.add(new WeaTableOperate("重新核算", null, "4"));
|
||||
if (approvalCanReCalc || !needApprovalSalarySobIds.contains(salaryAcctRecordPO.getSalarySobId())) {
|
||||
btnList.add(new WeaTableOperate("重新核算", null, "4"));
|
||||
}
|
||||
}
|
||||
return SalaryAcctRecordListDTO.builder()
|
||||
.id(salaryAcctRecordPO.getId())
|
||||
|
|
@ -96,6 +105,7 @@ public class SalaryAcctRecordBO {
|
|||
.accountantName(usernameMap.getOrDefault(salaryAcctRecordPO.getCreator(), StringUtils.EMPTY))
|
||||
.updateTime(SalaryDateUtil.getFormatLocalDateTime(salaryAcctRecordPO.getUpdateTime()))
|
||||
.description(salaryAcctRecordPO.getDescription())
|
||||
.approvalStatus(salaryAcctRecordPO.getApprovalStatus())
|
||||
.operate(btnList)
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemDTO;
|
|||
import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.AccountTypeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
|
|
@ -310,6 +311,10 @@ public class SalaryAcctResultBO {
|
|||
map.put("status", e.getStatus());
|
||||
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(e.getStatus(), "1"))));
|
||||
} else if ("accountType".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("accountType", e.getAccountType());
|
||||
} else if ("accountTypeName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("accountTypeName", AccountTypeEnum.getDefaultLabelByValue(e.getAccountType()));
|
||||
} else {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
}
|
||||
|
|
@ -397,6 +402,10 @@ public class SalaryAcctResultBO {
|
|||
map.put("status", salaryAcctEmployee.getStatus());
|
||||
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(salaryAcctEmployee.getStatus(), "1"))));
|
||||
} else if ("accountType".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("accountType", salaryAcctEmployee.getAccountType());
|
||||
} else if ("accountTypeName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("accountTypeName", AccountTypeEnum.getDefaultLabelByValue(salaryAcctEmployee.getAccountType()));
|
||||
} else {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class SalaryAccEmployeeListDTO {
|
|||
@TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName")
|
||||
private String employeeName;
|
||||
|
||||
//个税扣缴义务人id")
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
|
||||
|
|
@ -38,30 +38,28 @@ public class SalaryAccEmployeeListDTO {
|
|||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
|
||||
//部门id")
|
||||
//部门id
|
||||
private Long departmentId;
|
||||
|
||||
|
||||
//部门")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
@TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile")
|
||||
private String mobile;
|
||||
|
||||
|
||||
//工号")
|
||||
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||
private String jobNum;
|
||||
|
||||
|
||||
//员工状态")
|
||||
@TableTitle(title = "员工状态", dataIndex = "status", key = "status")
|
||||
private String status;
|
||||
|
||||
@TableTitle(title = "账号类型", dataIndex = "accountType", key = "accountType")
|
||||
private String accountType;
|
||||
|
||||
|
||||
//入职日期")
|
||||
@TableTitle(title = "入职日期", dataIndex = "hireDate", key = "hireDate")
|
||||
private String hireDate;
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ public class SalaryAcctRecordListDTO {
|
|||
@TableTitle(title = "备注", dataIndex = "description", key = "description")
|
||||
private String description;
|
||||
|
||||
@TableTitle(title = "审批状态", dataIndex = "approvalStatus", key = "approvalStatus")
|
||||
private String approvalStatus;
|
||||
|
||||
@TableTitle(title = "操作", dataIndex = "operate", key = "operate")
|
||||
private List<WeaTableOperate> operate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,6 +168,13 @@ public class SalaryAcctEmployeePO {
|
|||
private List<Long> lockItems;
|
||||
|
||||
|
||||
/**
|
||||
* 主次账号 0/null:主账号 1:次账号
|
||||
*/
|
||||
private Integer accountType;
|
||||
|
||||
|
||||
|
||||
//--------条件----------
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
|
|
|||
|
|
@ -128,6 +128,16 @@ public class SalaryAcctRecordPO {
|
|||
@ElogTransform( name = "更新时间" )
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审批流程id
|
||||
*/
|
||||
private String approvalId;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 锁定的薪资项目
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public class SalaryArchiveBO {
|
|||
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
columns.add(employeeIdColumn);
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "账号类型"), "accountType"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgentName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "分部"), "subcompanyName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
||||
|
|
|
|||
|
|
@ -121,4 +121,7 @@ public class SalaryArchiveListDTO {
|
|||
*/
|
||||
private String archiveStatus;
|
||||
|
||||
//主次账号 0/null:主账号 1:次账号
|
||||
private Integer accountType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,11 @@ public class SalaryFormulaEmployeeDTO {
|
|||
@SalaryFormulaVar(defaultLabel = "状态", labelId = 98622, dataType = "string")
|
||||
private String statusName;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "账号类型", labelId = 98622, dataType = "string")
|
||||
private String accountTypeName;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "账号类型编码", labelId = 98622, dataType = "string")
|
||||
private Integer accountType;
|
||||
//工号
|
||||
@SalaryFormulaVar(defaultLabel = "工号", labelId = 98622, dataType = "string")
|
||||
private String workcode;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ import java.util.Collection;
|
|||
@AllArgsConstructor
|
||||
public class SalaryItemSearchParam extends BaseQueryParam {
|
||||
|
||||
// 账套id
|
||||
private Long salarySobId;
|
||||
|
||||
//名称
|
||||
private String name;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalaryApprovalDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryApprovalBO
|
||||
* @date 2024/04/23 17:47
|
||||
* @description 薪资账套的薪资审批
|
||||
*/
|
||||
public class SalaryApprovalBO {
|
||||
|
||||
public static SalaryApprovalDTO convert2DTO(SalaryApprovalRulePO salaryApprovalRulePO, List<SalaryItemPO> salaryItemList) {
|
||||
if (salaryApprovalRulePO == null) {
|
||||
return new SalaryApprovalDTO();
|
||||
}
|
||||
Map<Long, String> salaryItemNameMap = SalaryEntityUtil.convert2Map(salaryItemList, SalaryItemPO::getId, SalaryItemPO::getName);
|
||||
List<SalaryApprovalDTO.approvalItemGroup> approvalItemGroups = JsonUtil.parseList(salaryApprovalRulePO.getApprovalGroupSetting(), SalaryApprovalDTO.approvalItemGroup.class);
|
||||
for (SalaryApprovalDTO.approvalItemGroup group : approvalItemGroups) {
|
||||
for(SalaryApprovalDTO.approvalItem item : group.getApprovalItems()) {
|
||||
item.setSalaryItemName(salaryItemNameMap.getOrDefault(item.getSalaryItemId(), ""));
|
||||
}
|
||||
}
|
||||
|
||||
return SalaryApprovalDTO.builder()
|
||||
.id(salaryApprovalRulePO.getId())
|
||||
.salarySobId(salaryApprovalRulePO.getSalarySobId())
|
||||
.isOpenApproval(salaryApprovalRulePO.getOpenApproval().equals(1))
|
||||
.approvalWorkflowUrl(StringUtils.isBlank(salaryApprovalRulePO.getWorkflowUrl()) ? "" : salaryApprovalRulePO.getWorkflowUrl())
|
||||
.approvalItemGroup(approvalItemGroups)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将账套薪资项目设置转换成审批中的项目设置信息
|
||||
* @param aggregateBySalarySobId
|
||||
*/
|
||||
public static String sobItemAggregate2approvalGroupSetting(SalarySobItemAggregateDTO aggregateBySalarySobId) {
|
||||
List<SalaryApprovalDTO.approvalItemGroup> groupList = new ArrayList<>();
|
||||
// 薪资项目分组
|
||||
List<SalarySobItemGroupDTO> itemGroups = aggregateBySalarySobId.getItemGroups();
|
||||
for (SalarySobItemGroupDTO sobItemGroupDTO: itemGroups) {
|
||||
SalaryApprovalDTO.approvalItemGroup approvalGroup = new SalaryApprovalDTO.approvalItemGroup();
|
||||
approvalGroup.setGroupName(sobItemGroupDTO.getName());
|
||||
approvalGroup.setSorted(sobItemGroupDTO.getSortedIndex());
|
||||
List<SalaryApprovalDTO.approvalItem> approvalItemList = new ArrayList<>();
|
||||
for (SalarySobItemDTO groupItem : sobItemGroupDTO.getItems()) {
|
||||
SalaryApprovalDTO.approvalItem approvalItem = new SalaryApprovalDTO.approvalItem();
|
||||
approvalItem.setSalaryItemId(groupItem.getSalaryItemId());
|
||||
approvalItem.setSalaryItemName(groupItem.getName());
|
||||
approvalItem.setSorted(groupItem.getSortedIndex());
|
||||
approvalItemList.add(approvalItem);
|
||||
}
|
||||
approvalGroup.setApprovalItems(approvalItemList);
|
||||
groupList.add(approvalGroup);
|
||||
}
|
||||
// 未分类
|
||||
List<SalarySobItemDTO> items = aggregateBySalarySobId.getItems();
|
||||
List<SalaryApprovalDTO.approvalItem> approvalItemList2 = new ArrayList<>();
|
||||
for (SalarySobItemDTO groupItem : items) {
|
||||
SalaryApprovalDTO.approvalItem approvalItem = new SalaryApprovalDTO.approvalItem();
|
||||
approvalItem.setSalaryItemId(groupItem.getSalaryItemId());
|
||||
approvalItem.setSalaryItemName(groupItem.getName());
|
||||
approvalItem.setSorted(groupItem.getSortedIndex());
|
||||
approvalItemList2.add(approvalItem);
|
||||
}
|
||||
SalaryApprovalDTO.approvalItemGroup approvalGroup = new SalaryApprovalDTO.approvalItemGroup();
|
||||
approvalGroup.setGroupName("未分类");
|
||||
approvalGroup.setSorted(groupList.size());
|
||||
approvalGroup.setApprovalItems(approvalItemList2);
|
||||
groupList.add(approvalGroup);
|
||||
return JsonUtil.toJsonString(groupList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.engine.salary.entity.salarysob.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资审批设置列表
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author xuzhuoyan
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryApprovalDTO {
|
||||
|
||||
// 主键id
|
||||
private Long id;
|
||||
|
||||
// 薪资账套id
|
||||
private Long salarySobId;
|
||||
|
||||
// 是否开启审批
|
||||
private Boolean isOpenApproval;
|
||||
|
||||
// 审批流程地址
|
||||
private String approvalWorkflowUrl;
|
||||
|
||||
// 审批项目信息
|
||||
private List<approvalItemGroup> approvalItemGroup;
|
||||
|
||||
private Boolean canEdit;
|
||||
|
||||
/**
|
||||
* 审批项目信息分组形式
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class approvalItemGroup {
|
||||
|
||||
// 分组名称
|
||||
private String groupName;
|
||||
|
||||
// 项目信息
|
||||
private List<approvalItem> approvalItems;
|
||||
|
||||
// 排序
|
||||
private Integer sorted;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批薪资项目
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class approvalItem {
|
||||
// 薪资项目id
|
||||
private Long salaryItemId;
|
||||
|
||||
// 薪资项目名称
|
||||
private String salaryItemName;
|
||||
|
||||
// 排序
|
||||
private Integer sorted;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salarysob.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName SalaryApprovalQueryParam
|
||||
* @author Harryxzy
|
||||
* @date 2024/4/23 15:05
|
||||
* @description 薪资审批流程id保存参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ApprovalRequestSaveParam {
|
||||
|
||||
// 流程id
|
||||
@DataCheck(require = true, message = "流程id不能为空")
|
||||
private String requestId;
|
||||
|
||||
// 核算记录id
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.salary.entity.salarysob.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName SalaryApprovalQueryParam
|
||||
* @author Harryxzy
|
||||
* @date 2024/4/23 15:05
|
||||
* @description 薪资审批设置查询参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryApprovalQueryParam {
|
||||
|
||||
// 薪资账套id
|
||||
@DataCheck(require = true, message = "薪资账套的ID不允许为空")
|
||||
private Long salarySobId;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryApprovalRulePO
|
||||
* @date 2024/04/23 17:31
|
||||
* @description 薪资核算审批规则
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryApprovalRulePO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 是否开启工资单审批
|
||||
*/
|
||||
private Integer openApproval;
|
||||
|
||||
/**
|
||||
* 审批薪资项目设置
|
||||
*/
|
||||
private String approvalGroupSetting;
|
||||
|
||||
/**
|
||||
* 审批流程地址
|
||||
*/
|
||||
private String workflowUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
//薪资账套id集合
|
||||
private Collection<Long> salarySobIds;
|
||||
|
||||
}
|
||||
|
|
@ -10,13 +10,11 @@ import java.util.Collection;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_page_list_setting
|
||||
public class PageListSettingPO {
|
||||
|
||||
@ElogTransform(name = "id")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum AccountTypeEnum implements BaseEnum {
|
||||
|
||||
MAIN(0, "主账号", 1),
|
||||
SECOND(1, "次账号", 1);
|
||||
|
||||
private Integer value;
|
||||
private String defaultLabel;
|
||||
private int labelId;
|
||||
|
||||
|
||||
AccountTypeEnum(Integer value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return MAIN.defaultLabel;
|
||||
}
|
||||
Optional<AccountTypeEnum> optional = Arrays.stream(AccountTypeEnum.values()).filter(r -> r.getValue().equals(value)).findFirst();
|
||||
return optional.isPresent() ? optional.get().defaultLabel : "";
|
||||
}
|
||||
|
||||
|
||||
public static AccountTypeEnum parseByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return MAIN;
|
||||
}
|
||||
|
||||
for (AccountTypeEnum statusEnum : AccountTypeEnum.values()) {
|
||||
if (Objects.equals(statusEnum.getValue(), value)) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
return MAIN;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
LEFT JOIN hrmresource e ON e.ID = a.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
|
||||
SELECT
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
LEFT JOIN hrmresource e ON e.ID = a.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
|
||||
SELECT
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
LEFT JOIN hrmresource e ON e.ID = a.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -205,7 +205,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@
|
|||
, e.enddate as dismissdate
|
||||
, e.status AS employeeStatus
|
||||
,e.certificatenum as idNo
|
||||
,e.accounttype as accountType
|
||||
, d.departmentname AS departmentName
|
||||
, c.subcompanyname AS subcompanyName
|
||||
</sql>
|
||||
|
|
@ -118,7 +119,7 @@
|
|||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -222,7 +223,7 @@
|
|||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -323,7 +324,7 @@
|
|||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status != '7'
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 关键字(姓名、部门、个税扣缴义务人) -->
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
AND (
|
||||
|
|
@ -580,7 +580,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status != '7'
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
AND (
|
||||
e.lastname like '%'||#{param.keyword}||'%'
|
||||
|
|
@ -602,7 +602,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status != '7'
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
AND (
|
||||
e.lastname like '%'+#{param.keyword}+'%'
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -326,7 +326,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -347,7 +347,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -367,7 +367,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -649,7 +649,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.declare_month DESC
|
||||
</select>
|
||||
|
|
@ -664,7 +664,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="taxAgentIds != null and taxAgentIds.size() != 0">
|
||||
and tax_agent_id in
|
||||
<foreach collection="taxAgentIds" item="taxAgentId" open="(" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@
|
|||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -393,7 +393,7 @@
|
|||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -414,7 +414,7 @@
|
|||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.tax_year_month DESC
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -279,7 +279,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -297,7 +297,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
|
|||
|
|
@ -10,11 +10,12 @@
|
|||
e.mobile,
|
||||
e.workcode,
|
||||
e.certificatenum as idNo,
|
||||
e.accounttype as accountType,
|
||||
'false' as extEmp
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeByIds" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||
|
|
@ -25,9 +26,10 @@
|
|||
e.workcode as workcode,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
e.workyear as workYear
|
||||
from hrmresource e
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
where e.status not in (7)
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND e.id IN
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -44,6 +46,7 @@
|
|||
e.workcode as workcode,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
e.workyear as workYear
|
||||
from hrmresource e
|
||||
where e.status not in (7)
|
||||
|
|
@ -78,13 +81,14 @@
|
|||
e.certificatenum as idNo,
|
||||
e.enddate as dismissdate,
|
||||
e.workyear,
|
||||
e.accounttype as accountType,
|
||||
e.companyworkyear
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
where e.status not in (7)
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND e.id IN
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -126,6 +130,7 @@
|
|||
c.id as jobtitleId,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
job.id as jobcallId,
|
||||
|
|
@ -135,7 +140,7 @@
|
|||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
WHERE e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
WHERE e.status not in (7)
|
||||
<if test="params != null and params.size() > 0">
|
||||
AND ( 1=2
|
||||
<foreach collection="params" item="param">
|
||||
|
|
@ -184,10 +189,11 @@
|
|||
h.certificatenum as idNo,
|
||||
h.workcode as workcode,
|
||||
h.companystartdate as companystartdate,
|
||||
h.accounttype as accountType,
|
||||
h.mobile as mobile
|
||||
from hrmresourcevirtual v
|
||||
left join hrmresource h on v.resourceid=h.id
|
||||
WHERE h.status not in (7) and (h.accounttype is null or h.accounttype = 0)
|
||||
WHERE h.status not in (7)
|
||||
<if test="params != null and params.size() > 0">
|
||||
AND ( 1=2
|
||||
<foreach collection="params" item="param">
|
||||
|
|
@ -231,6 +237,7 @@
|
|||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.enddate as dismissdate,
|
||||
e.accounttype as accountType,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid
|
||||
from hrmresource e
|
||||
|
|
@ -238,7 +245,7 @@
|
|||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
AND e.id = #{id}
|
||||
</select>
|
||||
|
||||
|
|
@ -278,6 +285,7 @@
|
|||
e.certificatenum as idNo,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
e.subcompanyid1 as subcompanyid,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
|
|
@ -287,7 +295,6 @@
|
|||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||
|
|
@ -298,6 +305,7 @@
|
|||
e.certificatenum as idNo,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
e.subcompanyid1 as subcompanyid,
|
||||
e.departmentid as departmentId,
|
||||
d.DEPARTMENTNAME as departmentName,
|
||||
|
|
@ -305,7 +313,7 @@
|
|||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -319,6 +327,7 @@
|
|||
e.mobile as mobile,
|
||||
e.departmentid as departmentId,
|
||||
e.subcompanyid1 as subcompanyid,
|
||||
e.accounttype as accountType,
|
||||
e.costcenterid as costcenterId,
|
||||
e.locationid as locationId,
|
||||
e.jobtitle as jobtitleId,
|
||||
|
|
@ -327,7 +336,7 @@
|
|||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
where e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -480,6 +489,7 @@
|
|||
e.workcode as workcode,
|
||||
e.companystartdate as companystartdate,
|
||||
e.mobile as mobile,
|
||||
e.accounttype as accountType,
|
||||
e.enddate as dismissdate
|
||||
from hrmresource e
|
||||
where e.status in (4,5,6)
|
||||
|
|
@ -557,11 +567,12 @@
|
|||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.companystartdate as companystartdate,
|
||||
e.accounttype as accountType,
|
||||
e.mobile as mobile
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
WHERE e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
WHERE e.status not in (7)
|
||||
<if test="subCompanyIds != null and subCompanyIds.size()>0">
|
||||
AND e.subcompanyid1 IN
|
||||
<foreach collection="subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
|
||||
|
|
@ -580,6 +591,7 @@
|
|||
resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||
select e.RESOURCEID as employeeId,
|
||||
e.SUBCOMPANYID as subcompanyid,
|
||||
h.accounttype as accountType,
|
||||
e.DEPARTMENTID as departmentId
|
||||
from hrmresourcevirtual e
|
||||
left join hrmresource h on e.RESOURCEID=h.id
|
||||
|
|
@ -597,6 +609,7 @@
|
|||
select
|
||||
e.RESOURCEID as employeeId,
|
||||
e.SUBCOMPANYID as subcompanyid,
|
||||
h.accounttype as accountType,
|
||||
e.DEPARTMENTID as departmentId
|
||||
from hrmresourcevirtual e
|
||||
left join hrmresource h on e.RESOURCEID=h.id
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -299,7 +299,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.declare_month DESC
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.create_time desc
|
||||
</select>
|
||||
|
|
@ -633,7 +633,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<if test="taxAgentIds != null and taxAgentIds.size() != 0">
|
||||
AND t1.tax_agent_id IN
|
||||
<foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
|
|
@ -653,7 +653,7 @@
|
|||
WHERE
|
||||
t1.delete_type = 0 AND t2.delete_type = 0
|
||||
AND e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSql"/>
|
||||
<if test="param.orderRule != null ">
|
||||
order by ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@
|
|||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
|
|
@ -173,7 +173,7 @@
|
|||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
LEFT JOIN hrsa_tax_agent a ON t.tax_agent_id = a.id
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<!-- 个税扣缴义务人 -->
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
<result column="jobcall_id" property="jobcallId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="account_type" property="accountType"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SalaryAccEmployeeCountMap"
|
||||
|
|
@ -60,7 +61,8 @@
|
|||
t.jobcall,
|
||||
t.jobcall_id,
|
||||
t.status,
|
||||
t.lock_items
|
||||
t.lock_items,
|
||||
t.account_type
|
||||
</sql>
|
||||
|
||||
<sql id="emp1Column">
|
||||
|
|
@ -83,7 +85,8 @@
|
|||
jobtitle_id,
|
||||
jobcall,
|
||||
jobcall_id,
|
||||
status)
|
||||
status,
|
||||
account_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="emp" separator=",">
|
||||
(
|
||||
|
|
@ -107,7 +110,8 @@
|
|||
#{emp.jobtitleId},
|
||||
#{emp.jobcall},
|
||||
#{emp.jobcallId},
|
||||
#{emp.status}
|
||||
#{emp.status},
|
||||
#{emp.accountType}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -123,7 +127,9 @@
|
|||
jobtitle_id,
|
||||
jobcall,
|
||||
jobcall_id,
|
||||
status)
|
||||
status,
|
||||
account_type
|
||||
)
|
||||
<foreach collection="collection" item="emp" separator="union all">
|
||||
select
|
||||
#{emp.salaryAcctRecordId,jdbcType=DOUBLE},
|
||||
|
|
@ -146,7 +152,8 @@
|
|||
#{emp.jobtitleId,jdbcType=DOUBLE},
|
||||
#{emp.jobcall,jdbcType=VARCHAR},
|
||||
#{emp.jobcallId,jdbcType=DOUBLE},
|
||||
#{emp.status,jdbcType=VARCHAR}
|
||||
#{emp.status,jdbcType=VARCHAR},
|
||||
#{emp.accountType,jdbcType=INTEGER}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -163,7 +170,9 @@
|
|||
jobtitle_id,
|
||||
jobcall,
|
||||
jobcall_id,
|
||||
status)
|
||||
status,
|
||||
account_type
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{emp.salaryAcctRecordId},
|
||||
|
|
@ -186,7 +195,8 @@
|
|||
#{emp.jobtitleId},
|
||||
#{emp.jobcall},
|
||||
#{emp.jobcallId},
|
||||
#{emp.status}
|
||||
#{emp.status},
|
||||
#{emp.accountType}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -264,7 +274,6 @@
|
|||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM hrmresource em WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
|
|
@ -345,7 +354,7 @@
|
|||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM hrmresource em WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
|
|
@ -618,7 +627,7 @@
|
|||
AND t.employee_id IN
|
||||
(
|
||||
SELECT id FROM hrmresource em WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.lastname LIKE CONCAT('%',#{param.employeeName},'%')
|
||||
</if>
|
||||
|
|
@ -712,7 +721,7 @@
|
|||
AND t.employee_id IN
|
||||
(
|
||||
SELECT id FROM hrmresource em WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
|
|
@ -804,7 +813,7 @@
|
|||
AND t.employee_id IN
|
||||
(
|
||||
SELECT id FROM hrmresource em WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
|
|
@ -1024,6 +1033,7 @@
|
|||
<result column="jobcall_id" property="jobcallId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="account_type" property="accountType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -1053,6 +1063,7 @@
|
|||
, t.jobcall_id
|
||||
, t.status
|
||||
, t.lock_items
|
||||
, t.account_type
|
||||
</sql>
|
||||
|
||||
|
||||
|
|
@ -1268,6 +1279,9 @@
|
|||
<if test="salaryAcctEmployeePO.status != null" >
|
||||
status=#{salaryAcctEmployeePO.status},
|
||||
</if>
|
||||
<if test="salaryAcctEmployeePO.accountType != null" >
|
||||
account_type=#{salaryAcctEmployeePO.accountType},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{salaryAcctEmployeePO.id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@
|
|||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.back_calc_status
|
||||
,t.lock_salary_item_ids
|
||||
, t.lock_salary_item_ids
|
||||
, t.approval_status
|
||||
, t.approval_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -388,6 +390,12 @@
|
|||
<if test="backCalcStatus != null">
|
||||
back_calc_status=#{backCalcStatus},
|
||||
</if>
|
||||
<if test="approvalId != null">
|
||||
approval_id=#{approvalId},
|
||||
</if>
|
||||
<if test="approvalStatus != null">
|
||||
approval_status=#{approvalStatus},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryApprovalRuleMapper
|
||||
* @date 2024/04/23 17:36
|
||||
* @description
|
||||
*/
|
||||
public interface SalaryApprovalRuleMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryApprovalRulePO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryApprovalRulePO> listSome(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryApprovalRulePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salaryApprovalRule 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salaryApprovalRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salaryApprovalRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param salaryApprovalRule 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
void deleteBySalarySobId(@Param("salarySobId") Long salarySobId);
|
||||
}
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.salarysob.SalaryApprovalRuleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
<result column="approval_group_setting" property="approvalGroupSetting" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="creator" property="creator" />
|
||||
<result column="delete_type" property="deleteType" />
|
||||
<result column="id" property="id" />
|
||||
<result column="open_approval" property="openApproval" />
|
||||
<result column="salary_sob_id" property="salarySobId" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="workflow_url" property="workflowUrl" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.approval_group_setting
|
||||
, t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.id
|
||||
, t.open_approval
|
||||
, t.salary_sob_id
|
||||
, t.update_time
|
||||
, t.workflow_url
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_approval_rule t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_approval_rule t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_approval_rule t
|
||||
WHERE delete_type = 0
|
||||
<if test="approvalGroupSetting != null">
|
||||
AND approval_group_setting = #{approvalGroupSetting}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="openApproval != null">
|
||||
AND open_approval = #{openApproval}
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="workflowUrl != null">
|
||||
AND workflow_url = #{workflowUrl}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salarySobIds != null and salarySobIds.size()>0">
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
INSERT INTO hrsa_salary_approval_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="approvalGroupSetting != null">
|
||||
approval_group_setting,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="openApproval != null">
|
||||
open_approval,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="workflowUrl != null">
|
||||
workflow_url,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="approvalGroupSetting != null" >
|
||||
#{approvalGroupSetting},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
#{id},
|
||||
</if>
|
||||
<if test="openApproval != null" >
|
||||
#{openApproval},
|
||||
</if>
|
||||
<if test="salarySobId != null" >
|
||||
#{salarySobId},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="workflowUrl != null" >
|
||||
#{workflowUrl},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
UPDATE hrsa_salary_approval_rule
|
||||
<set>
|
||||
approval_group_setting=#{approvalGroupSetting},
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
open_approval=#{openApproval},
|
||||
salary_sob_id=#{salarySobId},
|
||||
update_time=#{updateTime},
|
||||
workflow_url=#{workflowUrl},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
UPDATE hrsa_salary_approval_rule
|
||||
<set>
|
||||
<if test="approvalGroupSetting != null" >
|
||||
approval_group_setting=#{approvalGroupSetting},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="openApproval != null" >
|
||||
open_approval=#{openApproval},
|
||||
</if>
|
||||
<if test="salarySobId != null" >
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="workflowUrl != null" >
|
||||
workflow_url=#{workflowUrl},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO">
|
||||
UPDATE hrsa_salary_approval_rule
|
||||
SET delete_type=1
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBySalarySobId">
|
||||
UPDATE hrsa_salary_approval_rule
|
||||
SET delete_type=1
|
||||
WHERE salary_sob_id = #{salarySobId} AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -434,7 +434,7 @@
|
|||
<select id="listEmployeeIds" resultType="long">
|
||||
SELECT id FROM hrmresource em
|
||||
WHERE em.status not in (7)
|
||||
and (em.accounttype is null or em.accounttype = 0)
|
||||
|
||||
<if test="params != null and params.size() > 0">
|
||||
AND ( 1=2
|
||||
<foreach collection="params" item="param">
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@
|
|||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE t.delete_type = 0
|
||||
and e.status not in (7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="paramSqlCommon"/>
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
|
|
@ -681,7 +681,7 @@
|
|||
ON e.ID = l.resource_n
|
||||
WHERE(
|
||||
e.status != '5'
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
OR l.dismissdate IS NULL
|
||||
OR l.dismissdate = ''
|
||||
OR l.dismissdate
|
||||
|
|
@ -751,7 +751,7 @@
|
|||
<!-- ON e.ID = l.resource_n-->
|
||||
<!-- WHERE(-->
|
||||
<!-- e.status != '5'-->
|
||||
<!-- and (e.accounttype is null or e.accounttype = 0)-->
|
||||
<!-- -->
|
||||
<!-- OR l.dismissdate IS NULL-->
|
||||
<!-- OR l.dismissdate = ''-->
|
||||
<!-- OR l.dismissdate-->
|
||||
|
|
@ -1167,7 +1167,7 @@
|
|||
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
|
||||
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
|
||||
WHERE
|
||||
e.STATUS = 5 and (e.accounttype is null or e.accounttype = 0) AND h.payment_status = 0
|
||||
e.STATUS = 5 AND h.payment_status = 0
|
||||
<include refid="likeCondition"/>
|
||||
AND(l.dismissdate IS NOT NULL)
|
||||
)AS t
|
||||
|
|
@ -1243,7 +1243,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
|
||||
WHERE
|
||||
e.STATUS not in (4,5,6,7)
|
||||
and (e.accounttype is null or e.accounttype = 0)
|
||||
|
||||
<include refid="likeCondition"/>
|
||||
AND(
|
||||
l.dismissdate IS NULL OR l.dismissdate = ''
|
||||
|
|
|
|||
|
|
@ -336,7 +336,6 @@
|
|||
LEFT JOIN bill_hrmdismiss f on a.id = f.resource_n
|
||||
WHERE
|
||||
a.status not in (7)
|
||||
and (a.accounttype is null or a.accounttype = 0)
|
||||
<include refid="paramSql"/>
|
||||
<include refid="paramSqlCommon"/>
|
||||
ORDER BY a.id asc
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalaryApprovalDTO;
|
||||
import com.engine.salary.entity.salarysob.param.ApprovalRequestSaveParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryApprovalRuleService
|
||||
* @date 2024/04/23 17:33
|
||||
* @description 薪资核算审批规则
|
||||
*/
|
||||
public interface SalaryApprovalRuleService {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryApprovalRulePO> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryApprovalRulePO getById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salaryApprovalRule 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salaryApprovalRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salaryApprovalRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param salaryApprovalRule 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalaryApprovalRulePO salaryApprovalRule);
|
||||
|
||||
/**
|
||||
* 根据账套id查询审批设置
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
SalaryApprovalRulePO getBySalarySobId(Long salarySobId);
|
||||
|
||||
/**
|
||||
* 根据薪资账套id删除
|
||||
* @param salarySobId
|
||||
*/
|
||||
void deleteBySalarySobId(Long salarySobId);
|
||||
|
||||
/**
|
||||
* 薪资账套的薪资审批规则
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
SalaryApprovalDTO salaryApprovalForm(SalaryApprovalQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 保存薪资账套的薪资审批规则
|
||||
* @param salaryApprovalDTO
|
||||
*/
|
||||
void saveSalaryApprovalForm(SalaryApprovalDTO salaryApprovalDTO);
|
||||
|
||||
List<SalaryItemPO> listSalaryApprovalItem(SalaryItemSearchParam queryParam);
|
||||
|
||||
SalaryApprovalDTO getApprovalInfoByRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 获取该核算记录是否可以编辑、核算
|
||||
* @param salaryAcctRecordPO
|
||||
* @return
|
||||
*/
|
||||
boolean getRecordIsCanEdit(SalaryAcctRecordPO salaryAcctRecordPO);
|
||||
|
||||
/**
|
||||
* 保存审批流程id
|
||||
* @param saveParam
|
||||
*/
|
||||
void saveApprovalRequestId(ApprovalRequestSaveParam saveParam);
|
||||
|
||||
void deleteBySalarySobIds(Collection<Long> ids);
|
||||
|
||||
List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds);
|
||||
}
|
||||
|
|
@ -166,6 +166,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
|
|
@ -1055,6 +1059,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
stopWatch.stop();
|
||||
|
||||
// 校验是否可以编辑
|
||||
boolean recordIsCanEdit = getSalaryApprovalRuleService(user).getRecordIsCanEdit(salaryAcctRecordPO);
|
||||
if (StringUtils.equals("importSalaryAcctResult", importType) && !recordIsCanEdit) {
|
||||
throw new SalaryRunTimeException("该核算记录已经发起审批,无法编辑或核算,请先删除审批流程");
|
||||
}
|
||||
// 薪资账套下的薪资项目副本
|
||||
stopWatch.start("薪资账套下的薪资项目副本");
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
|
|
|
|||
|
|
@ -202,6 +202,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
private VariableItemService getVariableItemService(User user) {
|
||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||
}
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
|
|
@ -651,6 +655,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
});
|
||||
getSalaryAcctEmployeeService(user).updateIgnoreNull(salaryAcctEmployeePO);
|
||||
|
||||
// 校验是否可以编辑
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctEmployeePO.getSalaryAcctRecordId());
|
||||
boolean recordIsCanEdit = getSalaryApprovalRuleService(user).getRecordIsCanEdit(salaryAcctRecordPO);
|
||||
if (!recordIsCanEdit) {
|
||||
throw new SalaryRunTimeException("该核算记录已经发起审批,无法编辑或核算,请先删除审批流程");
|
||||
}
|
||||
// 查询原来的薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(saveParam.getSalaryAcctEmpId()).build());
|
||||
// 解密
|
||||
|
|
|
|||
|
|
@ -0,0 +1,248 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalaryApprovalBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalaryApprovalDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.param.ApprovalRequestSaveParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
|
||||
import com.engine.salary.mapper.salarysob.SalaryApprovalRuleMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryApprovalRuleServiceImpl
|
||||
* @date 2024/04/23 17:35
|
||||
* @description
|
||||
*/
|
||||
public class SalaryApprovalRuleServiceImpl extends Service implements SalaryApprovalRuleService {
|
||||
|
||||
private SalaryApprovalRuleMapper getSalaryApprovalRuleMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryApprovalRuleMapper.class);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordMapper getSalaryAcctRecordMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryApprovalRulePO> listAll() {
|
||||
return getSalaryApprovalRuleMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryApprovalRulePO getById(Long id) {
|
||||
return getSalaryApprovalRuleMapper().getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertIgnoreNull(SalaryApprovalRulePO po) {
|
||||
return getSalaryApprovalRuleMapper().insertIgnoreNull(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(SalaryApprovalRulePO salaryApprovalRule) {
|
||||
return getSalaryApprovalRuleMapper().update(salaryApprovalRule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIgnoreNull(SalaryApprovalRulePO salaryApprovalRule) {
|
||||
return getSalaryApprovalRuleMapper().updateIgnoreNull(salaryApprovalRule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(SalaryApprovalRulePO salaryApprovalRule) {
|
||||
return getSalaryApprovalRuleMapper().delete(salaryApprovalRule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryApprovalRulePO getBySalarySobId(Long salarySobId) {
|
||||
if(salarySobId == null) {
|
||||
return null;
|
||||
}
|
||||
List<SalaryApprovalRulePO> salaryApprovalRulePOS = getSalaryApprovalRuleMapper().listSome(SalaryApprovalRulePO.builder().salarySobId(salarySobId).build());
|
||||
if (CollectionUtils.isNotEmpty(salaryApprovalRulePOS) && salaryApprovalRulePOS.size() == 1) {
|
||||
return salaryApprovalRulePOS.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalarySobId(Long salarySobId) {
|
||||
if (salarySobId == null) {
|
||||
return;
|
||||
}
|
||||
getSalaryApprovalRuleMapper().deleteBySalarySobId(salarySobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryApprovalDTO salaryApprovalForm(SalaryApprovalQueryParam queryParam) {
|
||||
// 查询薪资审批设置
|
||||
SalaryApprovalRulePO approvalRulePO = getBySalarySobId(queryParam.getSalarySobId());
|
||||
if (approvalRulePO == null) {
|
||||
// 没有审批设置信息,创建默认设置信息
|
||||
Date now = new Date();
|
||||
approvalRulePO = SalaryApprovalRulePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(queryParam.getSalarySobId())
|
||||
.openApproval(0)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.deleteType(0)
|
||||
.build();
|
||||
// 获取账套的薪资项目设置信息
|
||||
SalarySobItemAggregateDTO aggregateBySalarySobId = getSalarySobItemService(user).getAggregateBySalarySobId(queryParam.getSalarySobId());
|
||||
String setting = SalaryApprovalBO.sobItemAggregate2approvalGroupSetting(aggregateBySalarySobId);
|
||||
approvalRulePO.setApprovalGroupSetting(setting);
|
||||
insertIgnoreNull(approvalRulePO);
|
||||
}
|
||||
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
return SalaryApprovalBO.convert2DTO(approvalRulePO, salaryItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSalaryApprovalForm(SalaryApprovalDTO salaryApprovalDTO) {
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryApprovalDTO.getSalarySobId());
|
||||
if (salarySobPO == null) {
|
||||
throw new RuntimeException("薪资账套不存在");
|
||||
}
|
||||
// 删除原来的
|
||||
deleteBySalarySobId(salaryApprovalDTO.getSalarySobId());
|
||||
// 保存最新的
|
||||
Date now = new Date();
|
||||
SalaryApprovalRulePO po = SalaryApprovalRulePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(salaryApprovalDTO.getSalarySobId())
|
||||
.openApproval(salaryApprovalDTO.getIsOpenApproval() ? 1 : 0)
|
||||
.approvalGroupSetting(JsonUtil.toJsonString(salaryApprovalDTO.getApprovalItemGroup()))
|
||||
.workflowUrl(salaryApprovalDTO.getApprovalWorkflowUrl())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.deleteType(0)
|
||||
.build();
|
||||
insertIgnoreNull(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryItemPO> listSalaryApprovalItem(SalaryItemSearchParam queryParam) {
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(queryParam.getSalarySobId());
|
||||
List<Long> salaryItemIds = salarySobItemPOS.stream()
|
||||
.filter(po -> !queryParam.getExcludeIds().contains(po.getSalaryItemId()))
|
||||
.map(SalarySobItemPO::getSalaryItemId)
|
||||
.collect(Collectors.toList());
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
return salaryItemPOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryApprovalDTO getApprovalInfoByRecordId(Long salaryAcctRecordId) {
|
||||
SalaryAcctRecordPO acctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if (acctRecordPO == null) {
|
||||
throw new SalaryRunTimeException("薪资核算记录不存在或已被删除");
|
||||
}
|
||||
SalaryApprovalRulePO approvalRulePO = getBySalarySobId(acctRecordPO.getSalarySobId());
|
||||
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
SalaryApprovalDTO salaryApprovalDTO = SalaryApprovalBO.convert2DTO(approvalRulePO, salaryItemList);
|
||||
// 查询是否可以核算、编辑(默认开启)
|
||||
salaryApprovalDTO.setCanEdit(getRecordIsCanEdit(acctRecordPO));
|
||||
return salaryApprovalDTO;
|
||||
}
|
||||
|
||||
public boolean getRecordIsCanEdit(SalaryAcctRecordPO acctRecordPO) {
|
||||
// 审批总开关,默认关闭
|
||||
SalarySysConfPO approvalStatus = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_APPROVAL_STATUS);
|
||||
if (approvalStatus == null || approvalStatus.getConfValue().equals("0")) {
|
||||
return true;
|
||||
}
|
||||
// 查询是否可以核算、编辑(默认开启)
|
||||
SalarySysConfPO canEdit = getSalarySysConfService(user).getOneByCode(SalarySysConstant.APPROVAL_CAN_EDIT_RESULT_STATUS);
|
||||
if (canEdit == null || canEdit.getConfValue().equals("1")) {
|
||||
return true;
|
||||
} else {
|
||||
// 发起审批后不能核损,判断流程id是否存在
|
||||
if (StringUtils.isBlank(acctRecordPO.getApprovalId())) {
|
||||
return true;
|
||||
} else {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.execute("SELECT * FROM workflow_requestbase where REQUESTID =" + acctRecordPO.getApprovalId());
|
||||
return !rs.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveApprovalRequestId(ApprovalRequestSaveParam saveParam) {
|
||||
ValidUtil.doValidator(saveParam);
|
||||
// 获取核算记录信息
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(saveParam.getSalaryAcctRecordId());
|
||||
if (salaryAcctRecordPO == null) {
|
||||
throw new SalaryRunTimeException("薪资核素记录不存在或已被删除");
|
||||
}
|
||||
salaryAcctRecordPO.setApprovalId(saveParam.getRequestId());
|
||||
getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalarySobIds(Collection<Long> ids) {
|
||||
ids.stream().forEach(this::deleteBySalarySobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isEmpty(salarySobIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryApprovalRuleMapper().listSome(SalaryApprovalRulePO.builder().salarySobIds(salarySobIds).build());
|
||||
}
|
||||
}
|
||||
|
|
@ -76,6 +76,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.OPEN_SECONDARY_ACCOUNT;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
|
|
@ -132,6 +133,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//主次账号是否开启
|
||||
boolean openSecondaryAccount = "1".equals(getSalarySysConfService(user).getValueByCode(OPEN_SECONDARY_ACCOUNT));
|
||||
|
||||
@Override
|
||||
public SalaryArchivePO getById(Long salaryArchiveId) {
|
||||
return salaryArchiveMapper.getById(salaryArchiveId);
|
||||
|
|
@ -195,6 +199,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
list = list.stream().filter(dto -> archiveIds.contains(dto.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
list = list.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(list);
|
||||
}
|
||||
|
||||
|
|
@ -498,6 +505,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
map.put("id", e.getId());
|
||||
map.put("username", e.getUsername());
|
||||
map.put("employeeId", e.getEmployeeId());
|
||||
if (openSecondaryAccount) {
|
||||
map.put("accountType", e.getAccountType() == null || e.getAccountType() == 0 ? "主账号" : "次账号");
|
||||
}
|
||||
|
||||
// Optional<Map<String, Object>> optionalTaxAgent = taxAgentData.stream().filter(f -> f.get("salaryArchiveId").toString().equals(e.getId().toString())).findFirst();
|
||||
TaxAgentPO taxAgentPO = longTaxAgentPOMap.get(e.getTaxAgentId());
|
||||
|
|
@ -799,7 +809,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(e.getId()));
|
||||
loggerContext.setTargetName( Optional.ofNullable(taxAgentMap.get(e.getTaxAgentId())).orElse(StringUtils.EMPTY) + bar + Optional.ofNullable(empMap.get(e.getEmployeeId())).orElse(StringUtils.EMPTY) );
|
||||
loggerContext.setTargetName(Optional.ofNullable(taxAgentMap.get(e.getTaxAgentId())).orElse(StringUtils.EMPTY) + bar + Optional.ofNullable(empMap.get(e.getEmployeeId())).orElse(StringUtils.EMPTY));
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(operatedesc);
|
||||
loggerContext.setOperatedesc(operatedesc);
|
||||
|
|
|
|||
|
|
@ -23,12 +23,13 @@ import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
|||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.ExtEmpService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.SalarySobExtRangeService;
|
||||
import com.engine.salary.service.SalarySobRangeService;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
|
|
@ -44,6 +45,8 @@ import weaver.hrm.User;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.OPEN_SECONDARY_ACCOUNT;
|
||||
|
||||
/**
|
||||
* 人员信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -69,8 +72,8 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -89,6 +92,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
boolean openExtEmp = true;
|
||||
|
||||
//主次账号是否开启
|
||||
boolean openSecondaryAccount = "1".equals(getSalarySysConfService(user).getValueByCode(OPEN_SECONDARY_ACCOUNT));
|
||||
|
||||
@Override
|
||||
public List<DataCollectionEmployee> listAll(UseEmployeeTypeEnum empType) {
|
||||
List<DataCollectionEmployee> result = new ArrayList<>();
|
||||
|
|
@ -102,6 +108,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
result.addAll(employBiz.listAll());
|
||||
result.addAll(getExtEmpService(user).listEmployee());
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
result = result.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
SalaryI18nUtil.i18nList(result);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -112,6 +123,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if (openExtEmp) {
|
||||
result.addAll(getExtEmpService(user).listAllForReport());
|
||||
}
|
||||
if (!openSecondaryAccount) {
|
||||
result = result.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
SalaryI18nUtil.i18nList(result);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -158,6 +172,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
includeSalaryEmployees.addAll(extEmps);
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
includeSalaryEmployees = includeSalaryEmployees.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
SalaryI18nUtil.i18nList(includeSalaryEmployees);
|
||||
return includeSalaryEmployees;
|
||||
}
|
||||
|
|
@ -171,6 +189,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if (openExtEmp) {
|
||||
employeeList.addAll(getExtEmpService(user).getEmployeeByIds(ids));
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
employeeList = employeeList.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
SalaryI18nUtil.i18nList(employeeList);
|
||||
return employeeList;
|
||||
}
|
||||
|
|
@ -185,6 +208,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
result.addAll(getExtEmpService(user).getEmployeeByIds(ids));
|
||||
}
|
||||
result.addAll(employBiz.getEmployeeByIdsAll(ids));
|
||||
if (!openSecondaryAccount) {
|
||||
result = result.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
SalaryI18nUtil.i18nList(result);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -214,6 +240,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs));
|
||||
}
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
employeeList = employeeList.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employeeList);
|
||||
|
||||
}
|
||||
|
|
@ -231,6 +261,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs));
|
||||
}
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
employeeList = employeeList.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employeeList);
|
||||
|
||||
}
|
||||
|
|
@ -245,7 +279,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
employeeSameIds = employeeSameIds.stream()
|
||||
.filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
employeeSameIds = employeeSameIds.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employeeSameIds);
|
||||
}
|
||||
|
||||
|
|
@ -271,7 +307,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
employees = employeeList.stream().filter(e -> (StringUtils.isBlank(idNo) || Objects.equals(e.getIdNo(), idNo)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
employees = employees.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employees);
|
||||
|
||||
}
|
||||
|
|
@ -284,7 +322,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
*/
|
||||
@Override
|
||||
public String empValidType() {
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfService(user).getOneByCode("matchEmployeeMode");
|
||||
return (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
||||
}
|
||||
|
||||
|
|
@ -345,6 +383,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if (openExtEmp) {
|
||||
result.addAll(getExtEmpService(user).listEmployee());
|
||||
}
|
||||
if (!openSecondaryAccount) {
|
||||
result = result.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(result);
|
||||
}
|
||||
|
||||
|
|
@ -382,7 +423,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据,需要根据人员id去重
|
||||
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
result = result.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -427,6 +470,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
.forEach(e -> e.setExtendData(extendData));
|
||||
}
|
||||
}
|
||||
if (!openSecondaryAccount) {
|
||||
employees = employees.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employees);
|
||||
}
|
||||
|
||||
|
|
@ -530,7 +576,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if (CollectionUtils.isEmpty(virtualDepartmentIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getEmployMapper().listVirtualEmpByVirtualDepIds(virtualDepartmentIds);
|
||||
List<DataCollectionEmployee> employees = getEmployMapper().listVirtualEmpByVirtualDepIds(virtualDepartmentIds);
|
||||
if (!openSecondaryAccount) {
|
||||
employees = employees.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return employees;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -548,6 +598,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if (openExtEmp) {
|
||||
employeeList.addAll(getExtEmpService(user).listBySubCompanyOrDepartment(subCompanyIds, departmentIds));
|
||||
}
|
||||
if (!openSecondaryAccount) {
|
||||
employeeList = employeeList.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList());
|
||||
}
|
||||
return SalaryI18nUtil.i18nList(employeeList);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.AccountTypeEnum;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
|
|
@ -914,7 +915,29 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
if (CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
|
||||
//获取员工信息的字段名和中文描述的map关系
|
||||
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder().employeeId(simpleEmployee.getEmployeeId()).birthday(simpleEmployee.getBirthday()).departmentId(simpleEmployee.getDepartmentId()).departmentName(simpleEmployee.getDepartmentName()).subcompanyName(simpleEmployee.getSubcompanyName()).subcompanyId(simpleEmployee.getSubcompanyid()).email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail()).jobcall(simpleEmployee.getJobcall()).jobcallId(simpleEmployee.getJobcallId()).companystartdate(simpleEmployee.getCompanystartdate()).sex("0".equals(simpleEmployee.getSex()) ? "男" : "女").mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile()).jobtitleName(simpleEmployee.getJobtitleName()).jobtitleId(simpleEmployee.getJobtitleId()).status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus()).statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(), "1"))).getDefaultLabel()).telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone()).username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername()).workcode(StringUtils.isEmpty(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode()).idNo(Util.null2String(simpleEmployee.getIdNo())).taxAgentName(taxAgentName).build();
|
||||
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder().employeeId(simpleEmployee.getEmployeeId())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.departmentId(simpleEmployee.getDepartmentId())
|
||||
.departmentName(simpleEmployee.getDepartmentName())
|
||||
.subcompanyId(simpleEmployee.getSubcompanyid())
|
||||
.subcompanyName(simpleEmployee.getSubcompanyName())
|
||||
.email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
|
||||
.jobcall(simpleEmployee.getJobcall())
|
||||
.jobcallId(simpleEmployee.getJobcallId())
|
||||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.sex("0".equals(simpleEmployee.getSex()) ? "男" : "女")
|
||||
.mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile())
|
||||
.jobtitleName(simpleEmployee.getJobtitleName())
|
||||
.jobtitleId(simpleEmployee.getJobtitleId())
|
||||
.status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(),"1"))).getDefaultLabel())
|
||||
.accountTypeName(simpleEmployee.getAccountType() == null ? "" : AccountTypeEnum.parseByValue(simpleEmployee.getAccountType()).getDefaultLabel())
|
||||
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
|
||||
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
|
||||
.workcode(StringUtils.isEmpty(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode())
|
||||
.idNo(Util.null2String(simpleEmployee.getIdNo()))
|
||||
.taxAgentName(taxAgentName)
|
||||
.build();
|
||||
List<SalaryTemplateSalaryItemListDTO> items = employeeInformation.getItems();
|
||||
Set<Map.Entry<String, String>> entries = employeeField.entrySet();
|
||||
for (SalaryTemplateSalaryItemListDTO e : items) {
|
||||
|
|
@ -1441,6 +1464,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
|
||||
@Override
|
||||
public XSSFWorkbook exportInfoList(SalarySendInfoQueryParam queryParam) {
|
||||
// 校验
|
||||
SalarySendInfoQueryParam.checkParam(queryParam);
|
||||
|
||||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(100528, "工资单发放信息");
|
||||
List<Object> header = new ArrayList<>();
|
||||
|
|
@ -1450,14 +1476,24 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
header.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86317, "发送状态"));
|
||||
|
||||
SalarySendPO salarySendPO = getById(queryParam.getSalarySendId());
|
||||
if (salarySendPO == null) {
|
||||
throw new SalaryRunTimeException("工资单不存在");
|
||||
}
|
||||
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId()));
|
||||
if (CollectionUtils.isEmpty(salaryTemplates)) {
|
||||
throw new SalaryRunTimeException("请先设置工资单模板");
|
||||
}
|
||||
Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus();
|
||||
Integer feedbackStatus = salaryTemplates.get(0).getFeedbackStatus();
|
||||
if ((ackFeedbackStatus != null && NumberUtils.compare(ackFeedbackStatus, 1) == 0)
|
||||
|| (feedbackStatus != null && NumberUtils.compare(feedbackStatus, 1) == 0)) {
|
||||
header.add(SalaryI18nUtil.getI18nLabel(0, "查看状态"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(0, "确认状态"));
|
||||
}
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
// 2.表头
|
||||
rows.add(header);
|
||||
|
||||
// 校验
|
||||
SalarySendInfoQueryParam.checkParam(queryParam);
|
||||
|
||||
// 获取行数据
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
|
|
@ -1468,7 +1504,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
list.forEach(e -> {
|
||||
// 发放状态
|
||||
e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getSendStatus())));
|
||||
|
||||
// 查看状态
|
||||
e.setBillReadStatus(NumberUtils.isCreatable(e.getBillReadStatus()) ? BillReadStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getBillReadStatus())) : "");
|
||||
// 确认状态
|
||||
e.setBillConfirmStatus(NumberUtils.isCreatable(e.getBillConfirmStatus()) ? BillConfimStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getBillConfirmStatus())) : "");
|
||||
//外部人员
|
||||
if (Objects.equals(e.getEmployeeType(), 1)) {
|
||||
List<DataCollectionEmployee> employees = idEmpMap.getOrDefault(e.getEmployeeId(), new ArrayList<>());
|
||||
|
|
@ -1492,6 +1531,11 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
row.add(dto.getMobile());
|
||||
row.add(dto.getJobNum());
|
||||
row.add(dto.getSendStatus());
|
||||
if ((ackFeedbackStatus != null && NumberUtils.compare(ackFeedbackStatus, 1) == 0)
|
||||
|| (feedbackStatus != null && NumberUtils.compare(feedbackStatus, 1) == 0)) {
|
||||
row.add(dto.getBillReadStatus());
|
||||
row.add(dto.getBillConfirmStatus());
|
||||
}
|
||||
rows.add(row);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,6 +163,10 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobInitService getSalarySobInitService(User user) {
|
||||
return ServiceUtil.getService(SalarySobInitServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -671,7 +675,9 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
getSalarySobBackItemService(user).deleteBySalarySobIds(ids);
|
||||
// 删除薪资账套的校验规则
|
||||
getSalarySobCheckRuleService(user).deleteBySalarySobIds(ids);
|
||||
// 记录日志
|
||||
// 删除薪资审批规则
|
||||
getSalaryApprovalRuleService(user).deleteBySalarySobIds(ids);
|
||||
// 记录日志
|
||||
salarySobPOS.forEach(salarySobPO -> {
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
|
|
|
|||
|
|
@ -70,15 +70,16 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
Date now = new Date();
|
||||
|
||||
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(pageListSettingSaveParam.getPage());
|
||||
List<Long> checked = pageListSettingSaveParam.getSetting().stream().distinct().collect(Collectors.toList());
|
||||
if (pageListSettingPO != null) {
|
||||
pageListSettingPO.setSetting(pageListSettingSaveParam.getSetting());
|
||||
pageListSettingPO.setSetting(checked);
|
||||
pageListSettingPO.setUpdateTime(now);
|
||||
getPageListSettingMapper().updateIgnoreNull(pageListSettingPO);
|
||||
} else {
|
||||
pageListSettingPO = PageListSettingPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.page(pageListSettingSaveParam.getPage())
|
||||
.setting(pageListSettingSaveParam.getSetting())
|
||||
.setting(checked)
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
|
|
|
|||
|
|
@ -171,4 +171,37 @@ public class SalarySysConstant {
|
|||
* 薪资明细页面显示类型
|
||||
*/
|
||||
public static final String SALARY_DETAILS_REPORT_SHOW_TYPE = "SALARY_DETAILS_REPORT_SHOW_TYPE";
|
||||
|
||||
/**
|
||||
* 主次账号开启标识 1开启
|
||||
*/
|
||||
public static final String OPEN_SECONDARY_ACCOUNT = "openSecondaryAccount";
|
||||
|
||||
|
||||
/**
|
||||
* 展示薪资核算审批设置按钮
|
||||
*/
|
||||
public static final String SHOW_SALARY_ACCT_APPROVAL = "SHOW_SALARY_ACCT_APPROVAL";
|
||||
|
||||
/**
|
||||
* 开启核算记录审批功能
|
||||
*/
|
||||
public static final String SALARY_APPROVAL_STATUS = "SALARY_APPROVAL_STATUS";
|
||||
|
||||
/**
|
||||
* 开启审批的核算记录允许手动归档
|
||||
*/
|
||||
public static final String APPROVAL_CAN_MANUAL_FILE_STATUS = "APPROVAL_CAN_MANUAL_FILE_STATUS";
|
||||
|
||||
|
||||
/**
|
||||
* 开启审批的核算记录允许重新核算
|
||||
*/
|
||||
public static final String APPROVAL_CAN_RE_CALC_STATUS = "APPROVAL_CAN_RE_CALC_STATUS";
|
||||
|
||||
|
||||
/**
|
||||
* 审批流程发起后允许修改核算数据
|
||||
*/
|
||||
public static final String APPROVAL_CAN_EDIT_RESULT_STATUS = "APPROVAL_CAN_EDIT_RESULT_STATUS";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ public class PageInfo<T> extends com.engine.salary.component.PageInfo<T> {
|
|||
this.columns.addAll(columns);
|
||||
}
|
||||
|
||||
public void clearAndSetColumns(List<Column> columns) {
|
||||
this.columns.clear();
|
||||
this.columns.addAll(columns);
|
||||
}
|
||||
|
||||
List<Column> columns = new ArrayList<>();
|
||||
List<DataSource> dataSource = new ArrayList<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.engine.salary.web;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.SalarySobExtRangePO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.*;
|
||||
import com.engine.salary.entity.salarysob.param.*;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
|
|
@ -74,6 +76,10 @@ public class SalarySobController {
|
|||
return ServiceUtil.getService(SalarySobBackItemWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalWrapper getSalaryApprovalWrapper(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user);
|
||||
}
|
||||
|
|
@ -724,4 +730,82 @@ public class SalarySobController {
|
|||
|
||||
/**********************************校验规则 end*********************************/
|
||||
|
||||
/**********************************薪资审批规则 start*********************************/
|
||||
|
||||
/**
|
||||
* 薪资审批规则表单
|
||||
*/
|
||||
@POST
|
||||
@Path("/salaryApproval/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String salaryApprovalForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryApprovalQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryApprovalQueryParam, SalaryApprovalDTO>(user).run(getSalaryApprovalWrapper(user)::salaryApprovalForm, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪资审批规则表单
|
||||
*/
|
||||
@POST
|
||||
@Path("/salaryApproval/saveForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalaryApprovalForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryApprovalDTO saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryApprovalDTO, String>(user).run(getSalaryApprovalWrapper(user)::saveSalaryApprovalForm, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资审批可选薪资项目
|
||||
*/
|
||||
@POST
|
||||
@Path("/salaryApproval/listSalaryItem")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalaryApprovalItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryItemSearchParam, List<SalaryItemPO>>(user).run(getSalaryApprovalWrapper(user)::listSalaryApprovalItem, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据核算记录id获取审批信息
|
||||
*/
|
||||
@GET
|
||||
@Path("/salaryApproval/getApprovalInfoByRecordId")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getApprovalInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId")Long salaryAcctRecordId ) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, SalaryApprovalDTO>(user).run(getSalaryApprovalWrapper(user)::getApprovalInfoByRecordId, salaryAcctRecordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批时薪资核算结果
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/salaryApproval/acctresult/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalaryApprovalAcctResult(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultQueryParam, Map<String, Object>>(user).run(getSalaryApprovalWrapper(user)::listSalaryApprovalAcctResult, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存审批流程id
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/salaryApproval/saveRequestId")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveApprovalRequestId(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ApprovalRequestSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ApprovalRequestSaveParam, String>(user).run(getSalaryApprovalWrapper(user)::saveApprovalRequestId, param);
|
||||
}
|
||||
|
||||
/**********************************薪资审批规则 start*********************************/
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,16 +15,22 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctSobConfigPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.SalarySobUtil;
|
||||
import com.engine.salary.util.page.Column;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.engine.salary.wrapper.proxy.SalaryAcctRecordWrapperProxy;
|
||||
|
|
@ -83,6 +89,14 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
}
|
||||
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private ComInfoCache comInfoCache;
|
||||
|
||||
public PageInfo<SalaryAcctRecordListDTO> listPage(SalaryAcctRecordQueryParam queryParam) {
|
||||
|
|
@ -102,6 +116,24 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getSalarySobId);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIds(salarySobIds);
|
||||
// 规则设置中是否开启薪资审批按钮,默认关闭
|
||||
SalarySysConfPO salaryApprovalStatusConf = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_APPROVAL_STATUS);
|
||||
List<Long> needApprovalSalarySobIds = new ArrayList<>();
|
||||
// 默认可以重新核算、可以手动归档
|
||||
boolean approvalCanReCalc = true;
|
||||
boolean approvalCanFile = true;
|
||||
if (salaryApprovalStatusConf != null && salaryApprovalStatusConf.getConfValue().equals("1")) {
|
||||
// 开启了薪资审批,获取这开启审批的账套id
|
||||
List<SalaryApprovalRulePO> salaryApprovalRules = getSalaryApprovalRuleService(user).listBySalarySobIds(salarySobIds);
|
||||
needApprovalSalarySobIds = salaryApprovalRules.stream().filter(po -> po.getOpenApproval().equals(1)).map(SalaryApprovalRulePO::getSalarySobId).collect(Collectors.toList());
|
||||
|
||||
// 获取 开启审批的核算记录允许重新核算设置,默认开启
|
||||
SalarySysConfPO approvalCanReCalcFileStatusPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.APPROVAL_CAN_RE_CALC_STATUS);
|
||||
approvalCanReCalc = approvalCanReCalcFileStatusPO == null ? true : approvalCanReCalcFileStatusPO.getConfValue().equals("1");
|
||||
// 获取 开启审批的核算记录允许手动归档,默认开启
|
||||
SalarySysConfPO approvalCanManualFileStatusPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.APPROVAL_CAN_MANUAL_FILE_STATUS);
|
||||
approvalCanFile = approvalCanManualFileStatusPO == null ? true : approvalCanManualFileStatusPO.getConfValue().equals("1");
|
||||
}
|
||||
// 查询薪资核算记录的创建人员的人员信息
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getCreator, Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
|
|
@ -113,10 +145,15 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getTaxAgentId);
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||
|
||||
// 转换成列表dto
|
||||
List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS, salarySendCheckResult, taxAgentPOS);
|
||||
List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS, salarySendCheckResult, taxAgentPOS, needApprovalSalarySobIds, approvalCanFile, approvalCanReCalc);
|
||||
dtoPage.setList(salaryAcctRecordListDTOS);
|
||||
// 规则设置中是否开启审批功能,默认关闭
|
||||
if (CollectionUtils.isEmpty(needApprovalSalarySobIds)) {
|
||||
// 没有开启审批的
|
||||
List<Column> columnList = dtoPage.getColumns().stream().filter(col -> !col.getKey().equals("approvalStatus")).collect(Collectors.toList());
|
||||
dtoPage.clearAndSetColumns(columnList);
|
||||
}
|
||||
}
|
||||
// WeaTable<SalaryAcctRecordListDTO> weaTable = SalaryFormatUtil.<SalaryAcctRecordListDTO>getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage);
|
||||
// 只有未归档时可以"核算"、"删除"、"归档"
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
return ServiceUtil.getService(SalaryCalcTaxServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算列表
|
||||
*
|
||||
|
|
@ -216,6 +220,13 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
public void calculate(SalaryAcctCalculateParam calculateParam) {
|
||||
log.info("开始核算V1{}", calculateParam);
|
||||
|
||||
|
||||
// 校验是否可以编辑
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(calculateParam.getSalaryAcctRecordId());
|
||||
boolean recordIsCanEdit = getSalaryApprovalRuleService(user).getRecordIsCanEdit(salaryAcctRecordPO);
|
||||
if (!recordIsCanEdit) {
|
||||
throw new SalaryRunTimeException("该核算记录已经发起审批,无法编辑或核算,请先删除审批流程");
|
||||
}
|
||||
//当前登陆人员
|
||||
DataCollectionEmployee simpleEmployee = new DataCollectionEmployee();
|
||||
simpleEmployee.setEmployeeId((long) user.getUID());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,168 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalaryApprovalDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobEmpFieldDTO;
|
||||
import com.engine.salary.entity.salarysob.param.ApprovalRequestSaveParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_FIXED_COLUMNS;
|
||||
|
||||
/**
|
||||
* 薪资账套的薪资审批
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryApprovalWrapper extends Service {
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资账套的薪资审批规则
|
||||
*
|
||||
* @param queryParam 查询参数
|
||||
* @return
|
||||
*/
|
||||
public SalaryApprovalDTO salaryApprovalForm(SalaryApprovalQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
return getSalaryApprovalRuleService(user).salaryApprovalForm(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪资账套的薪资审批规则
|
||||
*
|
||||
* @param salaryApprovalDTO
|
||||
*
|
||||
*/
|
||||
public void saveSalaryApprovalForm(SalaryApprovalDTO salaryApprovalDTO) {
|
||||
getSalaryApprovalRuleService(user).saveSalaryApprovalForm(salaryApprovalDTO);
|
||||
}
|
||||
|
||||
public List<SalaryItemPO> listSalaryApprovalItem(SalaryItemSearchParam queryParam) {
|
||||
return getSalaryApprovalRuleService(user).listSalaryApprovalItem(queryParam);
|
||||
}
|
||||
|
||||
public SalaryApprovalDTO getApprovalInfoByRecordId(Long salaryAcctRecordId) {
|
||||
return getSalaryApprovalRuleService(user).getApprovalInfoByRecordId(salaryAcctRecordId);
|
||||
}
|
||||
|
||||
public Map<String, Object> listSalaryApprovalAcctResult(SalaryAcctResultQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
// 审批信息
|
||||
SalaryApprovalDTO approvalInfoByRecordId = getSalaryApprovalRuleService(user).getApprovalInfoByRecordId(queryParam.getSalaryAcctRecordId());
|
||||
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// 查询薪资核算结果(分页)
|
||||
PageInfo<Map<String, Object>> page = getSalaryAcctResultService(user).listPageByParam(queryParam);
|
||||
|
||||
// 构建薪资核算结果审批列表的表头
|
||||
List<WeaTableColumnGroup> columns = Lists.newArrayList();
|
||||
// 查询薪资账套的员工信息字段
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalarySobEmpFieldDTO> salarySobEmpFieldDTOS = new SalarySobItemAggregateBO().buildEmpField(salarySobEmpFieldPOS);
|
||||
// 获取薪资项目信息
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
|
||||
Map<Long, Integer> salaryItemWidthMap = SalaryEntityUtil.convert2Map(salaryItemPOS, SalaryItemPO::getId, SalaryItemPO::getWidth);
|
||||
// 员工信息字段
|
||||
for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobEmpFieldDTOS) {
|
||||
columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName(), 0), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId()));
|
||||
}
|
||||
// 薪资项目分组下的薪资项目
|
||||
for (SalaryApprovalDTO.approvalItemGroup groupDTO : approvalInfoByRecordId.getApprovalItemGroup()) {
|
||||
if (CollectionUtils.isEmpty(groupDTO.getApprovalItems())) {
|
||||
continue;
|
||||
}
|
||||
List<WeaTableColumnGroup> childrenColumns = Lists.newArrayList();
|
||||
for (SalaryApprovalDTO.approvalItem approvalItemDTO : groupDTO.getApprovalItems()) {
|
||||
childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(approvalItemDTO.getSalaryItemName(), salaryItemWidthMap.getOrDefault(approvalItemDTO.getSalaryItemId(), 0) == null ? 0 : salaryItemWidthMap.getOrDefault(approvalItemDTO.getSalaryItemId(), 0)), approvalItemDTO.getSalaryItemName(), "" + approvalItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue().toString()));
|
||||
}
|
||||
WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(groupDTO.getGroupName(), 0), groupDTO.getGroupName(), groupDTO.getGroupName(), childrenColumns);
|
||||
columns.add(weaTableColumnWapper);
|
||||
}
|
||||
|
||||
// 获取固定列头数
|
||||
SalarySysConfPO salaryAcctFixedColumns = getSalarySysConfMapper().getOneByCode(SALARY_ACCT_FIXED_COLUMNS);
|
||||
if (salaryAcctFixedColumns != null) {
|
||||
int fixedNum = NumberUtils.isCreatable(salaryAcctFixedColumns.getConfValue()) ? Integer.valueOf(salaryAcctFixedColumns.getConfValue()) : 3;
|
||||
if (fixedNum == 0) {
|
||||
fixedNum = 3;
|
||||
}
|
||||
for (int i = 0; i < fixedNum; i++) {
|
||||
columns.get(i).setFixed("left");
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("pageInfo", page);
|
||||
datas.put("columns", columns);
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存审批流程id
|
||||
* @param saveParam
|
||||
*/
|
||||
public void saveApprovalRequestId(ApprovalRequestSaveParam saveParam) {
|
||||
getSalaryApprovalRuleService(user).saveApprovalRequestId(saveParam);
|
||||
}
|
||||
}
|
||||
|
|
@ -194,4 +194,5 @@ public class SalarySobItemWrapper extends Service {
|
|||
public void checkLoop(Long salarySobId) {
|
||||
getSalarySobItemService(user).checkLoop(salarySobId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue