账套-个税字段对应、累计字段对应
This commit is contained in:
parent
7275eb15d1
commit
cf22685fca
|
|
@ -0,0 +1,29 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar2(100);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item modify income_category default '1';
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4');
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar2(100);
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a
|
||||
set ( salary_item_code) = (
|
||||
select code as salary_item_code
|
||||
from hrsa_salary_item b
|
||||
where a.salary_item_id = b.id
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar2(100);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item modify income_category default '1';
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4');
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar2(100);
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a
|
||||
set ( salary_item_code) = (
|
||||
select code as salary_item_code
|
||||
from hrsa_salary_item b
|
||||
where a.salary_item_id = b.id
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar2(100);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item modify income_category default '1';
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4');
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar2(100);
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a
|
||||
set ( salary_item_code) = (
|
||||
select code as salary_item_code
|
||||
from hrsa_salary_item b
|
||||
where a.salary_item_id = b.id
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar(100)
|
||||
;
|
||||
|
||||
alter table hrsa_salary_sob_item modify column income_category varchar(100) default '1'
|
||||
;
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1')
|
||||
;
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2')
|
||||
;
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4')
|
||||
;
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar(100)
|
||||
;
|
||||
|
||||
update hrsa_salary_sob_item a, hrsa_salary_item b
|
||||
set a.salary_item_code = b.code
|
||||
where a.salary_item_id = b.id
|
||||
;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar2(100)
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item modify income_category default '1'
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1')
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2')
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4')
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar2(100)
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a
|
||||
set ( salary_item_code) = (
|
||||
select code as salary_item_code
|
||||
from hrsa_salary_item b
|
||||
where a.salary_item_id = b.id
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar(100);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item alter column income_category set default '1';
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2');
|
||||
/
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4');
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar(100);
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a set salary_item_code = b.code from hrsa_salary_item b where a.salary_item_id = b.id and a.delete_type = 0;
|
||||
/
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
alter table hrsa_salary_sob_item add income_category nvarchar(100)
|
||||
GO
|
||||
|
||||
alter table hrsa_salary_sob_item add constraint hssi_income_category_default default '1' for income_category
|
||||
GO
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1')
|
||||
GO
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2')
|
||||
GO
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4')
|
||||
GO
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code nvarchar(100)
|
||||
GO
|
||||
|
||||
update a set a.salary_item_code = b.code from hrsa_salary_sob_item a, hrsa_salary_item b where a.salary_item_id = b.id
|
||||
GO
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
alter table hrsa_salary_sob_item add income_category varchar2(100);
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item modify income_category default '1';
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2');
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN
|
||||
(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4');
|
||||
/
|
||||
|
||||
alter table hrsa_salary_sob_item add salary_item_code varchar2(100);
|
||||
/
|
||||
|
||||
update hrsa_salary_sob_item a
|
||||
set ( salary_item_code) = (
|
||||
select code as salary_item_code
|
||||
from hrsa_salary_item b
|
||||
where a.salary_item_id = b.id
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -7,13 +7,14 @@ import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
|||
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 人员报送(人员)表单
|
||||
|
|
@ -33,216 +34,83 @@ public class EmployeeDeclareFromDTO {
|
|||
private Long id;
|
||||
|
||||
// 个税扣缴义务人id
|
||||
|
||||
private Long taxAgentId;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "系统名称",
|
||||
// labelId = 160460,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.TYPESBROWSER, browserModule = "hrmsalary",
|
||||
// browserType = "salaryEmployeeCombinationBrowser", required = true)
|
||||
// }
|
||||
// )
|
||||
// 系统名称
|
||||
@TableTitle(title = "系统名称", dataIndex = "employee", key = "employee")
|
||||
private String employee;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "证件姓名",
|
||||
// labelId = 160461,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40", required = true)
|
||||
// }
|
||||
// )
|
||||
// 证件姓名
|
||||
@TableTitle(title = "证件姓名", dataIndex = "employeeName", key = "employeeName")
|
||||
private String employeeName;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "工号",
|
||||
// labelId = 86317,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "40")
|
||||
// }
|
||||
// )
|
||||
// 工号
|
||||
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||
private String jobNum;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "国籍",
|
||||
// labelId = 156406,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, readOnly = true)
|
||||
// }
|
||||
// )
|
||||
// 国籍
|
||||
@TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
|
||||
private String nationality;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "证件类型",
|
||||
// labelId = 105139,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, readOnly = true, optionsEnum = CardTypeEnum.class,
|
||||
// required = true)
|
||||
// }
|
||||
// )
|
||||
// 证件类型
|
||||
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
|
||||
private CardTypeEnum cardType;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "证件号码",
|
||||
// labelId = 86318,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true, maxLength = "18")
|
||||
// }
|
||||
// )
|
||||
// 证件号码
|
||||
@TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
|
||||
private String cardNum;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "性别",
|
||||
// labelId = 98622,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = GenderEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 性别
|
||||
@TableTitle(title = "性别", dataIndex = "gender", key = "gender")
|
||||
private GenderEnum gender;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "出生日期",
|
||||
// labelId = 98624,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true)
|
||||
// }
|
||||
// )
|
||||
// 出生日期
|
||||
@TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday")
|
||||
private LocalDate birthday;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date birthday;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "状态",
|
||||
// labelId = 91075,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, required = true, optionsEnum = EmploymentStatusEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 状态
|
||||
@TableTitle(title = "状态", dataIndex = "employmentStatus", key = "employmentStatus")
|
||||
private EmploymentStatusEnum employmentStatus;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "手机号码",
|
||||
// labelId = 98621,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, required = true)
|
||||
// }
|
||||
// )
|
||||
// 手机号码
|
||||
@TableTitle(title = "手机号码", dataIndex = "mobile", key = "mobile")
|
||||
private String mobile;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "任职受雇从业类型",
|
||||
// labelId = 156396,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true, optionsEnum = EmploymentTypeEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 任职受雇从业类型
|
||||
@TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType")
|
||||
private EmploymentTypeEnum employmentType;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "任职受雇从业日期",
|
||||
// labelId = 156409,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true)
|
||||
// }
|
||||
// )
|
||||
// 任职受雇从业日期
|
||||
@TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate")
|
||||
private LocalDate employmentDate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date employmentDate;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "离职日期",
|
||||
// labelId = 95228,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER)
|
||||
// }
|
||||
// )
|
||||
// 离职日期
|
||||
@TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate")
|
||||
private LocalDate dismissDate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date dismissDate;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "是否残疾",
|
||||
// labelId = 156399,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 是否残疾
|
||||
@TableTitle(title = "是否残疾", dataIndex = "disability", key = "disability")
|
||||
private SalaryOnOffEnum disability;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "残疾证号",
|
||||
// labelId = 156412,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT)
|
||||
// }
|
||||
// )
|
||||
// 残疾证号
|
||||
@TableTitle(title = "残疾证号", dataIndex = "disabilityCardNo", key = "disabilityCardNo")
|
||||
private String disabilityCardNo;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "是否孤老",
|
||||
// labelId = 156400,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 是否孤老
|
||||
@TableTitle(title = "是否孤老", dataIndex = "lonelyOld", key = "lonelyOld")
|
||||
private SalaryOnOffEnum lonelyOld;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "是否是烈属",
|
||||
// labelId = 156401,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 是否是烈属
|
||||
@TableTitle(title = "是否是烈属", dataIndex = "martyrDependents", key = "martyrDependents")
|
||||
private SalaryOnOffEnum martyrDependents;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "烈属证号",
|
||||
// labelId = 156413,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.INPUT)
|
||||
// }
|
||||
// )
|
||||
// 烈属证号
|
||||
@TableTitle(title = "烈属证号", dataIndex = "martyrDependentsCardNo", key = "martyrDependentsCardNo")
|
||||
private String martyrDependentsCardNo;
|
||||
|
||||
// @SalaryForm(
|
||||
// label = "是否扣除减除费用",
|
||||
// labelId = 156402,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.RADIO, optionsEnum = SalaryOnOffEnum.class)
|
||||
// }
|
||||
// )
|
||||
// 是否扣除减除费用
|
||||
@TableTitle(title = "是否扣除减除费用", dataIndex = "deductExpenses", key = "deductExpenses")
|
||||
private SalaryOnOffEnum deductExpenses;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.engine.salary.entity.employeedeclare.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -15,6 +18,9 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
//"hrsa_employee_declare_record")
|
||||
public class EmployeeDeclareRecordPO {
|
||||
|
||||
|
|
@ -29,7 +35,7 @@ public class EmployeeDeclareRecordPO {
|
|||
/**
|
||||
* 税款所属期
|
||||
*/
|
||||
private String taxCycle;
|
||||
private Date taxCycle;
|
||||
/**
|
||||
* 请求的requestId
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.salary.enums.SalaryRoundingModeEnum;
|
|||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -158,4 +159,32 @@ public class SysSalaryItemBO {
|
|||
.sharedType(sysSalaryItemPO.getSharedType())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统薪资项目转换成自定义薪资项目
|
||||
*
|
||||
* @param sysSalaryItemPO 系统薪资项目
|
||||
* @param employeeId 人员id
|
||||
* @return
|
||||
*/
|
||||
public static SalaryItemPO convert2SalaryItemPO(SysSalaryItemPO sysSalaryItemPO, Date now, Long employeeId) {
|
||||
if (sysSalaryItemPO == null) {
|
||||
return null;
|
||||
}
|
||||
long id = IdGenerator.generate();
|
||||
return SalaryItemPO.builder()
|
||||
.id(id)
|
||||
.code(sysSalaryItemPO.getCode())
|
||||
.name(sysSalaryItemPO.getName())
|
||||
.systemType(SalarySystemTypeEnum.SYSTEM.getValue())
|
||||
.sysSalaryItemId(sysSalaryItemPO.getId())
|
||||
.dataType(sysSalaryItemPO.getDataType())
|
||||
.description(sysSalaryItemPO.getDescription())
|
||||
.creator(employeeId)
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import lombok.Data;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 初始化薪资账套
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2023/5/18 15:36
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Data
|
||||
public class SalarySobInitEnv {
|
||||
|
||||
private User currentUser;
|
||||
private SalarySobBasicSaveParam saveParam;
|
||||
private SalarySobPO salarySob;
|
||||
private List<SalarySobItemPO> salarySobItems;
|
||||
}
|
||||
|
|
@ -117,6 +117,7 @@ public class SalarySobItemBO {
|
|||
.salarySobId(salarySobId)
|
||||
.salarySobItemGroupId(salarySobItemGroupIdMap.getOrDefault(salarySobDefaultItemPO.getSobDefaultItemGroupId(), NumberUtils.LONG_ZERO))
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.salaryItemCode(salaryItemPO.getCode())
|
||||
.formulaId(salaryItemPO.getFormulaId())
|
||||
.sortedIndex(salarySobDefaultItemPO.getSortedIndex())
|
||||
.description(salaryItemPO.getDescription())
|
||||
|
|
@ -157,6 +158,7 @@ public class SalarySobItemBO {
|
|||
.salarySobId(salarySobId)
|
||||
.salarySobItemGroupId(NumberUtils.LONG_ZERO)
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.salaryItemCode(salaryItemPO.getCode())
|
||||
.formulaId(salaryItemPO.getFormulaId())
|
||||
.sortedIndex(i)
|
||||
.description(salaryItemPO.getDescription())
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@ public class SalarySobBasicSaveParam {
|
|||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 薪资类型不允许为空
|
||||
* 所得项目不允许为空
|
||||
*
|
||||
* @see IncomeCategoryEnum
|
||||
*/
|
||||
@DataCheck(require = true, message = "薪资类型不允许为空")
|
||||
@DataCheck(require = true, message = "所得项目不允许为空")
|
||||
private Integer taxableItems;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -15,27 +18,32 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
//"hrsa_sob_add_up_rule")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
//hrsa_sob_add_up_rule
|
||||
public class SalarySobAddUpRulePO {
|
||||
|
||||
//主键id")
|
||||
//主键id
|
||||
private Long id;
|
||||
//薪资账套id")
|
||||
//薪资账套id
|
||||
private Long salarySobId;
|
||||
//收入所得项目")
|
||||
//收入所得项目
|
||||
private String incomeCategory;
|
||||
//薪资项目id")
|
||||
//薪资项目id
|
||||
private Long salaryItemId;
|
||||
//往期累计情况的字段索引")
|
||||
//往期累计情况的字段索引
|
||||
private String addUpColumnDataIndex;
|
||||
//租户key", ignore = true)
|
||||
//租户key
|
||||
private String tenantKey;
|
||||
//创建人id", ignore = true)
|
||||
//创建人id
|
||||
private Long creator;
|
||||
//是否删除", ignore = true)
|
||||
//是否删除
|
||||
private Integer deleteType;
|
||||
//创建时间", ignore = true)
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//更新时间", ignore = true)
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> salarySobIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,4 +76,5 @@ public class SalarySobDefaultItemGroupPO {
|
|||
private Date updateTime;
|
||||
|
||||
Collection<Long> ids;
|
||||
Collection<Integer> incomeCategorys;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,11 +33,23 @@ public class SalarySobItemPO {
|
|||
*/
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 所得项目
|
||||
*/
|
||||
private String incomeCategory;
|
||||
|
||||
/**
|
||||
* 薪资项目的id
|
||||
*/
|
||||
private Long salaryItemId;
|
||||
|
||||
/**
|
||||
* 薪资项目的code
|
||||
*/
|
||||
private String salaryItemCode;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 薪资账套薪资项目分组id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -35,6 +36,7 @@ public class SalarySobPO {
|
|||
|
||||
/**
|
||||
* 应税项目。1:正常工资薪金所得
|
||||
* @see IncomeCategoryEnum
|
||||
*/
|
||||
private Integer incomeCategory;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -14,6 +18,9 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
//hrsa_sob_tax_report_rule
|
||||
public class SalarySobTaxReportRulePO {
|
||||
|
||||
|
|
@ -37,4 +44,8 @@ public class SalarySobTaxReportRulePO {
|
|||
private Date createTime;
|
||||
//更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
private Collection<Long> ids;
|
||||
private Collection<Long> salarySobIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
package com.engine.salary.entity.taxdeclaration.po;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @description: 个税申报中的人员
|
||||
|
|
@ -11,6 +12,8 @@ import lombok.Data;
|
|||
* @version:v1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TaxDeclareEmployeePO {
|
||||
|
||||
//人员id")
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.engine.salary.entity.taxdeclaration.po;
|
||||
|
||||
import com.engine.salary.report.enums.IncomeCategoryEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -19,6 +21,8 @@ import java.util.Date;
|
|||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
//hrsa_tax_declare_fail")
|
||||
public class TaxDeclareFailPO implements Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.engine.salary.entity.taxdeclaration.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -14,7 +17,8 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@Builder
|
||||
//name = "个税申报表表头")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
//hrsa_tax_report_column")
|
||||
public class TaxReportColumnPO {
|
||||
|
||||
|
|
@ -44,4 +48,6 @@ public class TaxReportColumnPO {
|
|||
private Date createTime;
|
||||
//name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import java.util.Objects;
|
|||
**/
|
||||
public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
||||
|
||||
// todo 多语言
|
||||
WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487),
|
||||
REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488),
|
||||
ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489),
|
||||
|
|
|
|||
|
|
@ -558,9 +558,9 @@
|
|||
SET delete_type=1,
|
||||
update_time = #{date}
|
||||
WHERE delete_type = 0
|
||||
<if test="ids != null and param.ids.size()>0">
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="param.ids" open="(" separator="," item="id" close=")">
|
||||
<foreach collection="ids" open="(" separator="," item="id" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface EmployeeDeclareRecordMapper {
|
||||
|
|
@ -77,4 +78,5 @@ public interface EmployeeDeclareRecordMapper {
|
|||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId);
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@
|
|||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.taxAgentId,jdbcType=DOUBLE},
|
||||
#{item.taxCycle,jdbcType=VARCHAR},
|
||||
#{item.taxCycle,jdbcType=DATE},
|
||||
#{item.requestId,jdbcType=DOUBLE},
|
||||
from dual
|
||||
</foreach>
|
||||
|
|
@ -227,15 +227,15 @@
|
|||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.taxAgentId},
|
||||
#{item.taxCycle},
|
||||
#{item.requestId},
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -308,5 +308,12 @@
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByTaxCycleAndTaxAgentId">
|
||||
UPDATE hrsa_employee_declare_record
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND tax_cycle = #{taxCycle}
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface SalarySobAddUpRuleMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobAddUpRulePO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobAddUpRulePO> listSome(SalarySobAddUpRulePO sobAddUpRule);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobAddUpRulePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param sobAddUpRule 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobAddUpRulePO sobAddUpRule);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param sobAddUpRule
|
||||
*/
|
||||
void batchInsert(@Param("collection") List<SalarySobAddUpRulePO> sobAddUpRule);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param sobAddUpRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobAddUpRulePO sobAddUpRule);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param sobAddUpRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobAddUpRulePO sobAddUpRule);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param sobAddUpRule 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobAddUpRulePO sobAddUpRule);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteBySalarySobIds(Collection<Long> salarySobIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,342 @@
|
|||
<?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.SalarySobAddUpRuleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO">
|
||||
<result column="add_up_column_data_index" property="addUpColumnDataIndex"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="income_category" property="incomeCategory"/>
|
||||
<result column="salary_item_id" property="salaryItemId"/>
|
||||
<result column="salary_sob_id" property="salarySobId"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
add_up_column_data_index
|
||||
, t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.id
|
||||
, t.income_category
|
||||
, t.salary_item_id
|
||||
, t.salary_sob_id
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_add_up_rule t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_add_up_rule t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_add_up_rule t
|
||||
WHERE delete_type = 0
|
||||
<if test="addUpColumnDataIndex != null">
|
||||
AND add_up_column_data_index = #{addUpColumnDataIndex}
|
||||
</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="incomeCategory != null">
|
||||
AND income_category = #{incomeCategory}
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
AND salary_item_id = #{salaryItemId}
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO">
|
||||
INSERT INTO hrsa_sob_add_up_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="addUpColumnDataIndex != null">
|
||||
add_up_column_data_index,
|
||||
</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="incomeCategory != null">
|
||||
income_category,
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
salary_item_id,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="addUpColumnDataIndex != null">
|
||||
#{addUpColumnDataIndex},
|
||||
</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="incomeCategory != null">
|
||||
#{incomeCategory},
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
#{salaryItemId},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
#{salarySobId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
|
||||
INSERT INTO hrsa_sob_add_up_rule
|
||||
(
|
||||
add_up_column_data_index,
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
income_category,
|
||||
salary_item_id,
|
||||
salary_sob_id,
|
||||
tenant_key,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
#{item.addUpColumnDataIndex},
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.id},
|
||||
#{item.incomeCategory},
|
||||
#{item.salaryItemId},
|
||||
#{item.salarySobId},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
</foreach>
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_sob_add_up_rule (
|
||||
add_up_column_data_index,
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
income_category,
|
||||
salary_item_id,
|
||||
salary_sob_id,
|
||||
tenant_key,
|
||||
update_time,
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.addUpColumnDataIndex,jdbcType=VARCHAR},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.incomeCategory,jdbcType=VARCHAR},
|
||||
#{item.salaryItemId,jdbcType=DOUBLE},
|
||||
#{item.salarySobId,jdbcType=DOUBLE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
INSERT INTO hrsa_sob_add_up_rule (
|
||||
add_up_column_data_index,
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
income_category,
|
||||
salary_item_id,
|
||||
salary_sob_id,
|
||||
tenant_key,
|
||||
update_time,
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.addUpColumnDataIndex},
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.id},
|
||||
#{item.incomeCategory},
|
||||
#{item.salaryItemId},
|
||||
#{item.salarySobId},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime},
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO">
|
||||
UPDATE hrsa_sob_add_up_rule
|
||||
<set>
|
||||
add_up_column_data_index=#{addUpColumnDataIndex},
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
income_category=#{incomeCategory},
|
||||
salary_item_id=#{salaryItemId},
|
||||
salary_sob_id=#{salarySobId},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO">
|
||||
UPDATE hrsa_sob_add_up_rule
|
||||
<set>
|
||||
<if test="addUpColumnDataIndex != null">
|
||||
add_up_column_data_index=#{addUpColumnDataIndex},
|
||||
</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="incomeCategory != null">
|
||||
income_category=#{incomeCategory},
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
salary_item_id=#{salaryItemId},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_sob_add_up_rule
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_sob_add_up_rule
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBySalarySobIds">
|
||||
UPDATE hrsa_sob_add_up_rule
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -89,6 +89,12 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="incomeCategorys != null and incomeCategorys.size()>0">
|
||||
AND income_category IN
|
||||
<foreach collection="incomeCategorys" open="(" item="incomeCategory" separator="," close=")">
|
||||
#{incomeCategory}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<result column="salary_item_code" property="salaryItemCode"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -34,6 +35,7 @@
|
|||
, t.tenant_key
|
||||
, t.update_time
|
||||
,t.can_delete
|
||||
,t.salary_item_code
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -160,6 +162,7 @@
|
|||
, t.tenant_key
|
||||
, t.update_time
|
||||
,t.can_delete
|
||||
,t.salary_item_code
|
||||
,h.item_hide
|
||||
FROM hrsa_salary_sob_item t
|
||||
LEFT JOIN hrsa_salary_item_hide h ON t.salary_item_id=h.salary_item_id and t.salary_sob_id = h.salary_sob_id
|
||||
|
|
@ -364,7 +367,7 @@
|
|||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_salary_sob_item(salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id,
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete)
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
|
|
@ -379,13 +382,14 @@
|
|||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.canDelete}
|
||||
#{item.canDelete},
|
||||
#{item.salaryItemCode}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id,
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete)
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
|
|
@ -400,14 +404,15 @@
|
|||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.canDelete,jdbcType=INTEGER}
|
||||
#{item.canDelete,jdbcType=INTEGER},
|
||||
#{item.salaryItemCode,jdbcType=INTEGER}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id,
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete)
|
||||
sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,salary_item_code)
|
||||
VALUES
|
||||
(
|
||||
#{item.salarySobId},
|
||||
|
|
@ -421,7 +426,8 @@
|
|||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.canDelete}
|
||||
#{item.canDelete},
|
||||
#{item.salaryItemCode}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface SalarySobTaxReportRuleMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobTaxReportRulePO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobTaxReportRulePO> listSome(SalarySobTaxReportRulePO sobTaxReportRule);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobTaxReportRulePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param sobTaxReportRule 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param sobTaxReportRule
|
||||
*/
|
||||
void batchInsert(@Param("collection") List<SalarySobTaxReportRulePO> sobTaxReportRule);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param sobTaxReportRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobTaxReportRulePO sobTaxReportRule);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param sobTaxReportRule 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param sobTaxReportRule 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobTaxReportRulePO sobTaxReportRule);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteBySalarySobIds(@Param("salarySobIds")Collection<Long> salarySobIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,349 @@
|
|||
<?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.SalarySobTaxReportRuleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="salary_sob_id" property="salarySobId"/>
|
||||
<result column="income_category" property="incomeCategory"/>
|
||||
<result column="report_column_data_index" property="reportColumnDataIndex"/>
|
||||
<result column="salary_item_id" property="salaryItemId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.salary_sob_id
|
||||
, t.income_category
|
||||
, t.report_column_data_index
|
||||
, t.salary_item_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_tax_report_rule t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_tax_report_rule t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_tax_report_rule t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
AND income_category = #{incomeCategory}
|
||||
</if>
|
||||
<if test="reportColumnDataIndex != null">
|
||||
AND report_column_data_index = #{reportColumnDataIndex}
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
AND salary_item_id = #{salaryItemId}
|
||||
</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.SalarySobTaxReportRulePO">
|
||||
INSERT INTO hrsa_sob_tax_report_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
income_category,
|
||||
</if>
|
||||
<if test="reportColumnDataIndex != null">
|
||||
report_column_data_index,
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
salary_item_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
#{salarySobId},
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
#{incomeCategory},
|
||||
</if>
|
||||
<if test="reportColumnDataIndex != null">
|
||||
#{reportColumnDataIndex},
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
#{salaryItemId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
|
||||
INSERT INTO hrsa_sob_tax_report_rule
|
||||
(
|
||||
id,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
tenant_key,
|
||||
salary_sob_id,
|
||||
income_category,
|
||||
report_column_data_index,
|
||||
salary_item_id,
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.salarySobId},
|
||||
#{item.incomeCategory},
|
||||
#{item.reportColumnDataIndex},
|
||||
#{item.salaryItemId},
|
||||
</foreach>
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_sob_tax_report_rule (
|
||||
id,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
tenant_key,
|
||||
salary_sob_id,
|
||||
income_category,
|
||||
report_column_data_index,
|
||||
salary_item_id,
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.salarySobId,jdbcType=DOUBLE},
|
||||
#{item.incomeCategory,jdbcType=VARCHAR},
|
||||
#{item.reportColumnDataIndex,jdbcType=VARCHAR},
|
||||
#{item.salaryItemId,jdbcType=DOUBLE},
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
INSERT INTO hrsa_sob_tax_report_rule (
|
||||
id,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
delete_type,
|
||||
tenant_key,
|
||||
salary_sob_id,
|
||||
income_category,
|
||||
report_column_data_index,
|
||||
salary_item_id,
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.salarySobId},
|
||||
#{item.incomeCategory},
|
||||
#{item.reportColumnDataIndex},
|
||||
#{item.salaryItemId},
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO">
|
||||
UPDATE hrsa_sob_tax_report_rule
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
salary_sob_id=#{salarySobId},
|
||||
income_category=#{incomeCategory},
|
||||
report_column_data_index=#{reportColumnDataIndex},
|
||||
salary_item_id=#{salaryItemId},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO">
|
||||
UPDATE hrsa_sob_tax_report_rule
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
income_category=#{incomeCategory},
|
||||
</if>
|
||||
<if test="reportColumnDataIndex != null">
|
||||
report_column_data_index=#{reportColumnDataIndex},
|
||||
</if>
|
||||
<if test="salaryItemId != null">
|
||||
salary_item_id=#{salaryItemId},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_sob_tax_report_rule
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_sob_tax_report_rule
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBySalarySobIds">
|
||||
UPDATE hrsa_sob_tax_report_rule
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -227,17 +227,17 @@
|
|||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxDeclareRecordId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxDeclarationId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.employeeType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.employeeId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.resultValueJson,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.taxDeclareRecordId,jdbcType=DOUBLE},
|
||||
#{item.taxDeclarationId,jdbcType=DOUBLE},
|
||||
#{item.employeeType,jdbcType=INTEGER},
|
||||
#{item.employeeId,jdbcType=DOUBLE},
|
||||
#{item.resultValueJson,jdbcType=VARCHAR},
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -401,25 +401,25 @@
|
|||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.id,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.createTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.updateTime,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.creator,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.deleteType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.tenantKey,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxAgentId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.salaryMonth,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxCycle,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.remark,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.requestId,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxDeclareType,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxDeclareStatus,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.displayUpdateIcon,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxPayAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.personNum,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxDeclareErrorMsg,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxPaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.taxPurePaidAmount,jdbcType=DOUBLE、DATE、VARCHAR、INTEGER},
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.taxAgentId},
|
||||
#{item.salaryMonth},
|
||||
#{item.taxCycle},
|
||||
#{item.remark},
|
||||
#{item.requestId},
|
||||
#{item.taxDeclareType},
|
||||
#{item.taxDeclareStatus},
|
||||
#{item.displayUpdateIcon},
|
||||
#{item.taxPayAmount},
|
||||
#{item.personNum},
|
||||
#{item.taxDeclareErrorMsg},
|
||||
#{item.taxPaidAmount},
|
||||
#{item.taxPurePaidAmount},
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -45,4 +45,7 @@ public interface SalarySobAddUpRuleService {
|
|||
* @param salarySobIds
|
||||
*/
|
||||
void deleteBySalarySobIds(Collection<Long> salarySobIds);
|
||||
|
||||
void saveBatch(List<SalarySobAddUpRulePO> salarySobAddUpRules);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套默认的员工信息字段
|
||||
* @author: xiajun
|
||||
|
|
@ -9,10 +13,10 @@ package com.engine.salary.service;
|
|||
*/
|
||||
public interface SalarySobDefaultEmpFieldService {
|
||||
|
||||
// /**
|
||||
// * 获取所有的薪资账套默认的员工信息字段
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// List<SalarySobDefaultEmpFieldPO> list();
|
||||
/**
|
||||
* 获取所有的薪资账套默认的员工信息字段
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SalarySobDefaultEmpFieldPO> list();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套默认的薪资项目分类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: 2022/3/11 15:05
|
||||
* @version:v1.0
|
||||
*/
|
||||
public interface SalarySobDefaultItemGroupService {
|
||||
|
||||
/**
|
||||
* 根据所得项目获取薪资账套默认的薪资项目分类
|
||||
*
|
||||
* @param incomeCategories
|
||||
* @return
|
||||
*/
|
||||
List<SalarySobDefaultItemGroupPO> listByIncomeCategoryIn(Collection<IncomeCategoryEnum> incomeCategories);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套初始化
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2023/5/18 17:27
|
||||
* @version:v1.0
|
||||
*/
|
||||
public interface SalarySobInitService {
|
||||
|
||||
/**
|
||||
* 薪资账套初始化
|
||||
*
|
||||
* @param saveParam 初始化参数
|
||||
* @return
|
||||
*/
|
||||
SalarySobPO init(SalarySobBasicSaveParam saveParam);
|
||||
}
|
||||
|
|
@ -45,4 +45,6 @@ public interface SalarySobTaxReportRuleService {
|
|||
* @param salarySobIds
|
||||
*/
|
||||
void deleteBySalarySobIds(Collection<Long> salarySobIds);
|
||||
|
||||
void saveBatch(List<SalarySobTaxReportRulePO> salarySobTaxReportRules);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.service.SalarySobInitService;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套初始化
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2023/5/18 15:23
|
||||
* @version:v1.0
|
||||
*/
|
||||
public abstract class AbstractSalarySobInitService extends Service implements SalarySobInitService {
|
||||
|
||||
@Override
|
||||
public SalarySobPO init(SalarySobBasicSaveParam saveParam) {
|
||||
SalarySobInitEnv env = new SalarySobInitEnv();
|
||||
env.setSaveParam(saveParam);
|
||||
env.setCurrentUser(user);
|
||||
|
||||
// 初始化基础设置
|
||||
initBasic(env);
|
||||
// 初始化员工信息字段
|
||||
initEmpField(env);
|
||||
// 初始化薪资项目、薪资项目分组
|
||||
initItem(env);
|
||||
// 初始化回算薪资项目
|
||||
initBackItem(env);
|
||||
// 初始化累计字段对应规则
|
||||
initAddUpRule(env);
|
||||
// 初始化个税申报表字段对应规则
|
||||
initTaxReportRule(env);
|
||||
|
||||
return env.getSalarySob();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化基础设置
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initBasic(SalarySobInitEnv env);
|
||||
|
||||
/**
|
||||
* 初始化人员信息字段
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initEmpField(SalarySobInitEnv env);
|
||||
|
||||
/**
|
||||
* 初始化薪资项目、薪资项目分组
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initItem(SalarySobInitEnv env);
|
||||
|
||||
/**
|
||||
* 初始化回算薪资项目
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initBackItem(SalarySobInitEnv env);
|
||||
|
||||
/**
|
||||
* 初始化累计字段对应规则
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initAddUpRule(SalarySobInitEnv env);
|
||||
|
||||
/**
|
||||
* 初始化个税申报表字段对应规则
|
||||
*
|
||||
* @param env 公共变量
|
||||
*/
|
||||
protected abstract void initTaxReportRule(SalarySobInitEnv env);
|
||||
}
|
||||
|
|
@ -2,9 +2,13 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
|
||||
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareRecordMapper;
|
||||
import com.engine.salary.service.EmployeeDeclareRecordService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 员工报送记录
|
||||
|
|
@ -15,32 +19,26 @@ import java.util.Date;
|
|||
*/
|
||||
public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService {
|
||||
|
||||
private EmployeeDeclareRecordMapper getEmployeeDeclareRecordMapper() {
|
||||
return MapperProxyFactory.getProxy(EmployeeDeclareRecordMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) {
|
||||
// return new LambdaQueryChainWrapper<>(baseMapper)
|
||||
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
|
||||
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
|
||||
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
|
||||
// .one();
|
||||
List<EmployeeDeclareRecordPO> employeeDeclareRecordPOS = getEmployeeDeclareRecordMapper().listSome(EmployeeDeclareRecordPO.builder().taxCycle(taxCycle).taxAgentId(taxAgentId).build());
|
||||
if (CollectionUtils.isNotEmpty(employeeDeclareRecordPOS)) {
|
||||
return employeeDeclareRecordPOS.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) {
|
||||
// new LambdaUpdateChainWrapper<>(baseMapper)
|
||||
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
|
||||
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
|
||||
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
|
||||
// .set(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue())
|
||||
// .set(EmployeeDeclareRecordPO::getUpdateTime, LocalDateTime.now())
|
||||
// .update();
|
||||
getEmployeeDeclareRecordMapper().deleteByTaxCycleAndTaxAgentId(taxCycle, taxAgentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(EmployeeDeclareRecordPO employeeDeclareRecord) {
|
||||
|
||||
|
||||
getEmployeeDeclareRecordMapper().insertIgnoreNull(employeeDeclareRecord);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
employeeDeclareRecord = new EmployeeDeclareRecordPO()
|
||||
.setId(IdGenerator.generate())
|
||||
.setTaxAgentId(param.getTaxAgentId())
|
||||
.setTaxCycle(param.getTaxCycle().toString())
|
||||
.setTaxCycle(param.getTaxCycle())
|
||||
.setRequestId(asyncRequestIdDTO.getRequestId())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) user.getUID())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,173 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO;
|
||||
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.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobAddUpRuleMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套的累计字段对应
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2023/1/4 10:09 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobAddUpRuleService {
|
||||
|
||||
private SalarySobAddUpRuleMapper getSalarySobAddUpRuleMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobAddUpRuleMapper.class);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobBackItemService getSalarySobBackItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user);
|
||||
}
|
||||
@Override
|
||||
public List<SalarySobAddUpRulePO> listBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isEmpty(salarySobIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return getSalarySobAddUpRuleMapper().listSome(SalarySobAddUpRulePO.builder().salarySobIds(salarySobIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobAddUpRuleDTO> listSalarySobAddUpRuleDTO(Long salarySobId) {
|
||||
List<SalarySobAddUpRuleDTO> resultList = Lists.newArrayList();
|
||||
// 查询薪资账套
|
||||
SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId);
|
||||
// 薪资账套的收入所得项目
|
||||
Integer incomeCategoryId = salarySob.getIncomeCategory();
|
||||
// 薪资账套的薪资项目
|
||||
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId);
|
||||
// 薪资账套的回算薪资项目
|
||||
List<SalarySobBackItemPO> salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId);
|
||||
// 薪资项目
|
||||
Set<Long> salaryItemIds = Sets.newHashSet();
|
||||
salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId));
|
||||
salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId));
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
Map<Long, SalaryItemPO> idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
// 薪资账套的已经存在的对应关系
|
||||
List<SalarySobAddUpRulePO> salarySobAddUpRulePOS = listBySalarySobIds(Collections.singleton(salarySobId));
|
||||
Map<String, Long> salarySobAddUpMap = SalaryEntityUtil.convert2Map(salarySobAddUpRulePOS,
|
||||
e -> e.getIncomeCategory() + "-" + e.getAddUpColumnDataIndex(), SalarySobAddUpRulePO::getSalaryItemId);
|
||||
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId);
|
||||
if (incomeCategoryEnum != IncomeCategoryEnum.WAGES_AND_SALARIES
|
||||
&& incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN
|
||||
&& incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER
|
||||
&& incomeCategoryEnum != IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) {
|
||||
return resultList;
|
||||
}
|
||||
List<SalarySobAddUpRuleDTO.AddUpRuleDTO> addUpRules = Lists.newArrayList();
|
||||
Field[] declaredFields = AddUpSituation.class.getDeclaredFields();
|
||||
for (Field declaredField : declaredFields) {
|
||||
if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) {
|
||||
continue;
|
||||
}
|
||||
SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class);
|
||||
SalarySobAddUpRuleDTO.AddUpRuleDTO addUpRuleDTO = new SalarySobAddUpRuleDTO.AddUpRuleDTO();
|
||||
addUpRuleDTO.setId(IdGenerator.generate());
|
||||
addUpRuleDTO.setAddUpColumnName(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
|
||||
addUpRuleDTO.setAddUpColumnDataIndex(declaredField.getName());
|
||||
addUpRuleDTO.setSalaryItem(Collections.emptyList());
|
||||
addUpRuleDTO.setCanEdit(true);
|
||||
|
||||
Long salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + declaredField.getName());
|
||||
SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId);
|
||||
if (Objects.nonNull(salaryItem)) {
|
||||
Map<String, Object> dataMap = Maps.newHashMap();
|
||||
dataMap.put("id", salaryItem.getId().toString());
|
||||
dataMap.put("name", salaryItem.getName());
|
||||
dataMap.put("icon", "Icon-N-Salary-item-management");
|
||||
addUpRuleDTO.setSalaryItem(Collections.singletonList(dataMap));
|
||||
}
|
||||
addUpRules.add(addUpRuleDTO);
|
||||
}
|
||||
SalarySobAddUpRuleDTO salarySobAddUpRuleDTO = new SalarySobAddUpRuleDTO();
|
||||
salarySobAddUpRuleDTO.setIncomeCategoryId(incomeCategoryId.toString());
|
||||
salarySobAddUpRuleDTO.setIncomeCategoryName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
|
||||
salarySobAddUpRuleDTO.setAddUpRules(addUpRules);
|
||||
resultList.add(salarySobAddUpRuleDTO);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveByParam(SalarySobAddUpRuleSaveParam saveParam) {
|
||||
// 校验参数是否合法
|
||||
// 根据保存参数构建出po
|
||||
Date now = new Date();
|
||||
List<SalarySobAddUpRulePO> salarySobAddUpRulePOS = Lists.newArrayList();
|
||||
for (SalarySobAddUpRuleSaveParam.AddUpRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) {
|
||||
for (SalarySobAddUpRuleSaveParam.AddUpRuleParam addUpRuleParam : incomeCategoryParam.getAddUpRuleParams()) {
|
||||
SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO()
|
||||
.setId(IdGenerator.generate())
|
||||
.setSalarySobId(saveParam.getSalarySobId())
|
||||
.setIncomeCategory(incomeCategoryParam.getIncomeCategory())
|
||||
.setSalaryItemId(addUpRuleParam.getSalaryItemId())
|
||||
.setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreator((long) user.getUID())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now);
|
||||
salarySobAddUpRulePOS.add(salarySobAddUpRulePO);
|
||||
}
|
||||
}
|
||||
// 删除原来的配置,保存新的
|
||||
deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
if (CollectionUtils.isNotEmpty(salarySobAddUpRulePOS)) {
|
||||
saveBatch(salarySobAddUpRulePOS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isNotEmpty(salarySobIds)) {
|
||||
getSalarySobAddUpRuleMapper().deleteBySalarySobIds(salarySobIds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<SalarySobAddUpRulePO> salarySobAddUpRules) {
|
||||
if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) {
|
||||
salarySobAddUpRules.forEach(o->getSalarySobAddUpRuleMapper().insertIgnoreNull(o));
|
||||
// getSalarySobAddUpRuleMapper().batchInsert(salarySobAddUpRules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobDefaultEmpFieldMapper;
|
||||
import com.engine.salary.service.SalarySobDefaultEmpFieldService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资账套默认的员工信息字段
|
||||
|
|
@ -10,17 +16,14 @@ import com.engine.salary.service.SalarySobDefaultEmpFieldService;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalarySobDefaultEmpFieldServiceImpl implements SalarySobDefaultEmpFieldService {
|
||||
public class SalarySobDefaultEmpFieldServiceImpl extends Service implements SalarySobDefaultEmpFieldService {
|
||||
|
||||
//
|
||||
// private SalarySobDefaultEmpFieldMapper salarySobDefaultEmpFieldMapper;
|
||||
//
|
||||
// @Override
|
||||
// public List<SalarySobDefaultEmpFieldPO> list() {
|
||||
//
|
||||
// return new LambdaQueryChainWrapper<>(salarySobDefaultEmpFieldMapper)
|
||||
// .eq(SalarySobDefaultEmpFieldPO::getTenantKey, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .eq(SalarySobDefaultEmpFieldPO::getDeleteType, 0)
|
||||
// .list();
|
||||
// }
|
||||
private SalarySobDefaultEmpFieldMapper getSalarySobDefaultEmpFieldMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobDefaultEmpFieldMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobDefaultEmpFieldPO> list() {
|
||||
return getSalarySobDefaultEmpFieldMapper().listAll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobDefaultItemGroupMapper;
|
||||
import com.engine.salary.service.SalarySobDefaultItemGroupService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: 2022/3/11 15:07
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalarySobDefaultItemGroupServiceImpl extends Service implements SalarySobDefaultItemGroupService {
|
||||
|
||||
private SalarySobDefaultItemGroupMapper getSalarySobDefaultItemGroupMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobDefaultItemGroupMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobDefaultItemGroupPO> listByIncomeCategoryIn(Collection<IncomeCategoryEnum> incomeCategories) {
|
||||
if (CollectionUtils.isEmpty(incomeCategories)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Integer> incomeCategoryValues = SalaryEntityUtil.properties(incomeCategories, IncomeCategoryEnum::getValue, Collectors.toList());
|
||||
return getSalarySobDefaultItemGroupMapper().listSome(SalarySobDefaultItemGroupPO.builder().incomeCategorys(incomeCategoryValues).build());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,389 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.SalaryCycleTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套初始化
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2023/5/18 15:32
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalarySobInitServiceImpl extends AbstractSalarySobInitService {
|
||||
|
||||
private SalarySobMapper getSalarySobMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobMapper.class);
|
||||
}
|
||||
|
||||
private SalarySobDefaultEmpFieldService getSalarySobDefaultEmpFieldService(User user) {
|
||||
return ServiceUtil.getService(SalarySobDefaultEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobDefaultItemGroupService getSalarySobDefaultItemGroupService(User user) {
|
||||
return ServiceUtil.getService(SalarySobDefaultItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobDefaultItemService getSalarySobDefaultItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobDefaultItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SysSalaryItemService getSysSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemGroupService getSalarySobItemGroupService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobBackItemService getSalarySobBackItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxReportColumnService getTaxReportColumnService(User user) {
|
||||
return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initBasic(SalarySobInitEnv env) {
|
||||
if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) {
|
||||
throw new SalaryRunTimeException("Invalid arguments");
|
||||
}
|
||||
// 因为薪资账套的「名称」支持了"小地球",所以在打开新建表单时,后端就会将id传给前端,所以新建保存的时候前端是会将id传给后端的
|
||||
// 当前端未将id传给后端时,后端自动生成一个id
|
||||
SalarySobBasicSaveParam saveParam = env.getSaveParam();
|
||||
if (saveParam.getId() == null) {
|
||||
saveParam.setId(IdGenerator.generate());
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
SalarySobPO salarySob = new SalarySobPO()
|
||||
// .setId(saveParam.getId())
|
||||
.setTaxAgentId(saveParam.getTaxAgentId())
|
||||
.setName(saveParam.getName())
|
||||
.setIncomeCategory(saveParam.getTaxableItems())
|
||||
.setSalaryCycleType(saveParam.getSalaryCycleType())
|
||||
.setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay())
|
||||
.setTaxCycleType(SalaryCycleTypeEnum.THIS_MONTH.getValue())
|
||||
.setAttendCycleType(saveParam.getAttendCycleType())
|
||||
.setAttendCycleFromDay(saveParam.getAttendCycleFromDay())
|
||||
.setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType())
|
||||
.setDisable(0)
|
||||
.setDescription(saveParam.getDescription())
|
||||
// .setOriginSalarySobId(saveParam.getId())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) env.getCurrentUser().getUID())
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now);
|
||||
getSalarySobMapper().insertIgnoreNull(salarySob);
|
||||
env.setSalarySob(salarySob);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initEmpField(SalarySobInitEnv env) {
|
||||
if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) {
|
||||
throw new SalaryRunTimeException("Invalid arguments");
|
||||
}
|
||||
// 查询薪资账套默认的员工信息字段
|
||||
List<SalarySobDefaultEmpFieldPO> salarySobDefaultEmpFields = getSalarySobDefaultEmpFieldService(user).list();
|
||||
|
||||
Date now = new Date();
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields = salarySobDefaultEmpFields.stream()
|
||||
.map(field -> new SalarySobEmpFieldPO()
|
||||
// .setId(IdGenerator.generate())
|
||||
.setSalarySobId(env.getSalarySob().getId())
|
||||
.setFieldCode(field.getFieldCode())
|
||||
.setSortedIndex(field.getSortedIndex())
|
||||
.setCanDelete(field.getCanDelete())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) env.getCurrentUser().getUID())
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now))
|
||||
.collect(Collectors.toList());
|
||||
getSalarySobEmpFieldService(user).batchSave(salarySobEmpFields);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initItem(SalarySobInitEnv env) {
|
||||
if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) {
|
||||
throw new SalaryRunTimeException("Invalid arguments");
|
||||
}
|
||||
Date now = new Date();
|
||||
// 根据所得项目查询默认的账套薪资项目分组
|
||||
List<SalarySobDefaultItemGroupPO> salarySobDefaultItemGroups = getSalarySobDefaultItemGroupService(user)
|
||||
.listByIncomeCategoryIn(Collections.singletonList(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems())));
|
||||
// 根据所得项目查询默认的账套薪资项目
|
||||
List<SalarySobDefaultItemPO> salarySobDefaultItems = getSalarySobDefaultItemService(user)
|
||||
.listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems()));
|
||||
// 根据默认的账套薪资项目查询关联的系统薪资项目id
|
||||
Set<Long> sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItems,
|
||||
SalarySobDefaultItemPO::getSysSalaryItemId);
|
||||
List<SysSalaryItemPO> sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds);
|
||||
Map<Long, SysSalaryItemPO> sysSalaryItemMap = SalaryEntityUtil.convert2Map(sysSalaryItems, SysSalaryItemPO::getId);
|
||||
// 根据系统薪资项目id查询当前租户的自定义薪资项目
|
||||
// 如果默认的账套薪资项目查询关联的系统薪资项目id没有生成自定义薪资项目,需要自动生成对应的自定义薪资项目
|
||||
List<SalaryItemPO> needInsertSalaryItems = new ArrayList<>();
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds);
|
||||
// key:系统薪资项目id;value:薪资项目po
|
||||
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems,
|
||||
SalaryItemPO::getSysSalaryItemId);
|
||||
for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) {
|
||||
salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> {
|
||||
SalaryItemPO salaryItem = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID());
|
||||
needInsertSalaryItems.add(salaryItem);
|
||||
return salaryItem;
|
||||
});
|
||||
}
|
||||
|
||||
// key:默认的账套薪资项目分组id;value:账套薪资项目分组po
|
||||
Map<Long, SalarySobItemGroupPO> salarySobItemGroupMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroups.size());
|
||||
// 遍历默认的账套薪资项目分组,生成账套薪资项目分组po
|
||||
for (SalarySobDefaultItemGroupPO salarySobDefaultItemGroup : salarySobDefaultItemGroups) {
|
||||
SalarySobItemGroupPO salarySobItemGroup = SalarySobItemGroupPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.name(salarySobDefaultItemGroup.getName())
|
||||
.salarySobId(env.getSalarySob().getId())
|
||||
.sortedIndex(salarySobDefaultItemGroup.getSortedIndex())
|
||||
.description(salarySobDefaultItemGroup.getDescription())
|
||||
// .incomeCategory(salarySobDefaultItemGroup.getIncomeCategory().toString())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.creator((long) env.getCurrentUser().getUID())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.build();
|
||||
salarySobItemGroupMap.put(salarySobDefaultItemGroup.getId(), salarySobItemGroup);
|
||||
}
|
||||
|
||||
List<SalarySobItemPO> salarySobItems = new ArrayList<>(salarySobDefaultItems.size());
|
||||
// 遍历默认的账套薪资项目,生成账套薪资项目po
|
||||
for (SalarySobDefaultItemPO salarySobDefaultItem : salarySobDefaultItems) {
|
||||
// 账套薪资项目分组
|
||||
SalarySobItemGroupPO salarySobItemGroup = salarySobItemGroupMap.get(salarySobDefaultItem.getSobDefaultItemGroupId());
|
||||
// 关联的薪资项目、系统薪资项目
|
||||
SalaryItemPO salaryItem = salaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId());
|
||||
SysSalaryItemPO sysSalaryItem = sysSalaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId());
|
||||
if (salaryItem == null || sysSalaryItem == null) {
|
||||
throw new SalaryRunTimeException("Invalid arguments,salaryItem can not be null");
|
||||
}
|
||||
SalarySobItemPO salarySobItem = SalarySobItemPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
.salarySobId(env.getSalarySob().getId())
|
||||
.incomeCategory(salarySobDefaultItem.getIncomeCategory().toString())
|
||||
.salaryItemId(salaryItem.getId())
|
||||
.salaryItemCode(salaryItem.getCode())
|
||||
.salarySobItemGroupId(Optional.ofNullable(salarySobItemGroup).map(SalarySobItemGroupPO::getId).orElse(0L))
|
||||
// .useInEmployeeSalary(0)
|
||||
// .dataType(salaryItem.getDataType())
|
||||
// .roundingMode(sysSalaryItem.getRoundingMode())
|
||||
// .pattern(sysSalaryItem.getPattern())
|
||||
// .valueType(sysSalaryItem.getValueType())
|
||||
.formulaId(sysSalaryItem.getFormulaId())
|
||||
// .hideSwitch(0)
|
||||
// .sumSwitch(0)
|
||||
// .readonlySwitch(0)
|
||||
.sortedIndex(salarySobDefaultItem.getSortedIndex())
|
||||
.description(salaryItem.getDescription())
|
||||
// .canEdit(1)
|
||||
.canDelete(1)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.creator((long) env.getCurrentUser().getUID())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.build();
|
||||
salarySobItems.add(salarySobItem);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) {
|
||||
getSalaryItemService(user).batchSave(needInsertSalaryItems);
|
||||
}
|
||||
if (MapUtils.isNotEmpty(salarySobItemGroupMap)) {
|
||||
getSalarySobItemGroupService(user).batchSave(salarySobItemGroupMap.values());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(salarySobItems)) {
|
||||
getSalarySobItemService(user).batchSave(salarySobItems);
|
||||
}
|
||||
env.setSalarySobItems(salarySobItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initBackItem(SalarySobInitEnv env) {
|
||||
// 只有「正常工资薪金」才默认生成回算薪资项目
|
||||
boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue());
|
||||
if (!contains) {
|
||||
return;
|
||||
}
|
||||
// 746777981115629575L--已发薪资合计
|
||||
// 746777981115629576L--补发薪资合计
|
||||
List<Long> sysSalaryItemIds = Lists.newArrayList(746777981115629575L, 746777981115629576L);
|
||||
List<SysSalaryItemPO> sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds);
|
||||
// 根据系统薪资项目id查询当前租户的自定义薪资项目
|
||||
// 如果默认的账套薪资项目查询关联的系统薪资项目id没有生成自定义薪资项目,需要自动生成对应的自定义薪资项目
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds);
|
||||
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getSysSalaryItemId);
|
||||
|
||||
Date now = new Date();
|
||||
List<SalaryItemPO> needInsertSalaryItems = new ArrayList<>();
|
||||
List<SalarySobBackItemPO> salarySobBackItems = new ArrayList<>();
|
||||
for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) {
|
||||
SalaryItemPO salaryItem = salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> {
|
||||
SalaryItemPO temp = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID());
|
||||
needInsertSalaryItems.add(temp);
|
||||
return temp;
|
||||
});
|
||||
SalarySobBackItemPO salarySobBackItem = SalarySobBackItemPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(env.getSalarySob().getId())
|
||||
// .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString())
|
||||
.salaryItemId(salaryItem.getId())
|
||||
.salaryItemCode(salaryItem.getCode())
|
||||
.dataType(salaryItem.getDataType())
|
||||
.roundingMode(sysSalaryItem.getRoundingMode())
|
||||
.pattern(sysSalaryItem.getPattern())
|
||||
.valueType(sysSalaryItem.getValueType())
|
||||
.formulaId(sysSalaryItem.getFormulaId())
|
||||
// .hideSwitch(0)
|
||||
// .sumSwitch(0)
|
||||
// .readonlySwitch(0)
|
||||
// .sortedIndex(0)
|
||||
.backCalcType(Objects.equals(sysSalaryItem.getId(), 746777981115629575L) ? 0 : 1)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .breator((long) env.getCurrentUser().getUID())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.build();
|
||||
salarySobBackItems.add(salarySobBackItem);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) {
|
||||
getSalaryItemService(user).batchSave(needInsertSalaryItems);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(salarySobBackItems)) {
|
||||
getSalarySobBackItemService(user).batchInsert(salarySobBackItems);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAddUpRule(SalarySobInitEnv env) {
|
||||
// 只有「正常工资薪金」才默认生成累计字段对应规则
|
||||
boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue());
|
||||
if (!contains) {
|
||||
return;
|
||||
}
|
||||
Date now = new Date();
|
||||
List<SalarySobAddUpRulePO> salarySobAddUpRules = new ArrayList<>();
|
||||
// 账套薪资项目
|
||||
List<SalarySobItemPO> salarySobItems = env.getSalarySobItems().stream()
|
||||
.filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()))
|
||||
.collect(Collectors.toList());
|
||||
// AddUpSituationPO.class带有SalaryFormulaVar.class注解字段的name和账套薪资项目的code都是对应的,除了「addUpAdvanceTax」
|
||||
// 遍历AddUpSituationPO.class的SalaryFormulaVar.class注解,生成累计字段对应规则po
|
||||
Map<String, SalarySobItemPO> salarySobItemMap = SalaryEntityUtil.convert2Map(salarySobItems,
|
||||
SalarySobItemPO::getSalaryItemCode);
|
||||
for (Field declaredField : AddUpSituation.class.getDeclaredFields()) {
|
||||
SalarySobItemPO salarySobItem = salarySobItemMap.get(declaredField.getName());
|
||||
if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) {
|
||||
salarySobItem = salarySobItemMap.get("addUpTaxPayable");
|
||||
}
|
||||
if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) {
|
||||
continue;
|
||||
}
|
||||
SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO()
|
||||
.setId(IdGenerator.generate())
|
||||
.setSalarySobId(env.getSalarySob().getId())
|
||||
.setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString())
|
||||
.setSalaryItemId(salarySobItem.getSalaryItemId())
|
||||
.setAddUpColumnDataIndex(declaredField.getName())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) env.getCurrentUser().getUID())
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now);
|
||||
salarySobAddUpRules.add(salarySobAddUpRule);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) {
|
||||
getSalarySobAddUpRuleService(user).saveBatch(salarySobAddUpRules);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTaxReportRule(SalarySobInitEnv env) {
|
||||
// 查询个税申报表的表头
|
||||
List<TaxReportColumnPO> taxReportColumns = new ArrayList<>(getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems())));
|
||||
Date now = new Date();
|
||||
// 个税申报表表头的reportColumnDataIndex和账套薪资项目的code都是对应的
|
||||
// 遍历个税申报表的表头,生成个税申报表字段对应规则po
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = Lists.newArrayList();
|
||||
Map<String, SalarySobItemPO> salarySobItemMap = SalaryEntityUtil.convert2Map(env.getSalarySobItems(),
|
||||
e -> e.getIncomeCategory() + "-" + e.getSalaryItemCode());
|
||||
for (TaxReportColumnPO taxReportColumn : taxReportColumns) {
|
||||
SalarySobItemPO salarySobItem = salarySobItemMap.get(taxReportColumn.getIncomeCategory() + "-" + taxReportColumn.getReportColumnDataIndex());
|
||||
if (Objects.nonNull(salarySobItem)) {
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO()
|
||||
.setId(IdGenerator.generate())
|
||||
.setSalarySobId(env.getSalarySob().getId())
|
||||
.setIncomeCategory(salarySobItem.getIncomeCategory())
|
||||
.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex())
|
||||
.setSalaryItemId(salarySobItem.getSalaryItemId())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) env.getCurrentUser().getUID())
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now);
|
||||
salarySobTaxReportRules.add(salarySobTaxReportRule);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) {
|
||||
getSalarySobTaxReportRuleService(user).saveBatch(salarySobTaxReportRules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -131,6 +131,10 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobInitService getSalarySobInitService(User user) {
|
||||
return ServiceUtil.getService(SalarySobInitServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalarySobPO getById(Long id) {
|
||||
return salarySobMapper.getById(id);
|
||||
|
|
@ -272,23 +276,26 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98403, "薪资账套名称已存在"));
|
||||
}
|
||||
|
||||
// 保存参数转换成薪资账套po
|
||||
SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID());
|
||||
// 保存薪资账套
|
||||
salarySobMapper.insert(salarySobPO);
|
||||
//todo 记录日志
|
||||
// LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName());
|
||||
// loggerContext.setOldValues(salarySobPO);
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
// 新建薪资账套时,保存默认的员工信息字段
|
||||
saveDefaultEmpField(salarySobPO);
|
||||
// 新建薪资账套时,保存默认的薪资项目
|
||||
saveDefaultItem(salarySobPO);
|
||||
SalarySobPO salarySobPO = getSalarySobInitService(user).init(saveParam);
|
||||
|
||||
|
||||
// // 保存参数转换成薪资账套po
|
||||
// SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID());
|
||||
// // 保存薪资账套
|
||||
// salarySobMapper.insert(salarySobPO);
|
||||
// //todo 记录日志
|
||||
//// LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
//// loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
//// loggerContext.setTargetName(salarySobPO.getName());
|
||||
//// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
//// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套"));
|
||||
//// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName());
|
||||
//// loggerContext.setOldValues(salarySobPO);
|
||||
//// salarySobLoggerTemplate.write(loggerContext);
|
||||
// // 新建薪资账套时,保存默认的员工信息字段
|
||||
// saveDefaultEmpField(salarySobPO);
|
||||
// // 新建薪资账套时,保存默认的薪资项目
|
||||
// saveDefaultItem(salarySobPO);
|
||||
// 新建薪资账套时,保存默认的关联人员范围及从范围中排除
|
||||
saveDefaultEmployeeRange(salarySobPO);
|
||||
// 返回薪资账套的主键id
|
||||
|
|
|
|||
|
|
@ -0,0 +1,169 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam;
|
||||
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.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobTaxReportRuleMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套的个税申报表规则
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2022/11/29 5:19 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalarySobTaxReportRuleServiceImpl extends Service implements SalarySobTaxReportRuleService {
|
||||
|
||||
|
||||
private SalarySobTaxReportRuleMapper salarySobTaxReportRuleMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobTaxReportRuleMapper.class);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxReportColumnService getTaxReportColumnService(User user) {
|
||||
return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobBackItemService getSalarySobBackItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobTaxReportRulePO> listBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isEmpty(salarySobIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salarySobTaxReportRuleMapper().listSome(SalarySobTaxReportRulePO.builder().salarySobIds(salarySobIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobTaxReportRuleDTO> getSalarySobTaxReportRuleDTO(Long salarySobId) {
|
||||
List<SalarySobTaxReportRuleDTO> resultList = Lists.newArrayList();
|
||||
// 查询薪资账套
|
||||
SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId);
|
||||
Integer incomeCategory = salarySob.getIncomeCategory();
|
||||
List<Integer> incomeCategoryIds = Collections.singletonList(incomeCategory);
|
||||
// 薪资账套的薪资项目
|
||||
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId);
|
||||
// 薪资账套的回算薪资项目
|
||||
List<SalarySobBackItemPO> salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId);
|
||||
// 薪资项目
|
||||
Set<Long> salaryItemIds = Sets.newHashSet();
|
||||
salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId));
|
||||
salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId));
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
Map<Long, SalaryItemPO> idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
// 薪资账套中已经存在的对应关系
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = listBySalarySobIds(Collections.singleton(salarySobId));
|
||||
Map<String, Long> salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules,
|
||||
e -> e.getIncomeCategory() + "-" + e.getReportColumnDataIndex(), SalarySobTaxReportRulePO::getSalaryItemId);
|
||||
|
||||
for (Integer incomeCategoryId : incomeCategoryIds) {
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId);
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
|
||||
List<SalarySobTaxReportRuleDTO.TaxReportRuleDTO> taxReportRules = Lists.newArrayList();
|
||||
for (TaxReportColumnPO taxReportColumn : taxReportColumns) {
|
||||
SalarySobTaxReportRuleDTO.TaxReportRuleDTO taxReportRuleDTO = new SalarySobTaxReportRuleDTO.TaxReportRuleDTO();
|
||||
taxReportRuleDTO.setId(taxReportColumn.getId());
|
||||
taxReportRuleDTO.setReportColumnName(taxReportColumn.getReportColumnName());
|
||||
taxReportRuleDTO.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex());
|
||||
taxReportRuleDTO.setSalaryItem(Collections.emptyList());
|
||||
taxReportRuleDTO.setCanEdit(true);
|
||||
Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxReportColumn.getReportColumnDataIndex());
|
||||
SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId);
|
||||
if (Objects.nonNull(salaryItem)) {
|
||||
Map<String, Object> dataMap = Maps.newHashMap();
|
||||
dataMap.put("id", salaryItem.getId().toString());
|
||||
dataMap.put("name", salaryItem.getName());
|
||||
dataMap.put("icon", "Icon-N-Salary-item-management");
|
||||
taxReportRuleDTO.setSalaryItem(Collections.singletonList(dataMap));
|
||||
}
|
||||
taxReportRules.add(taxReportRuleDTO);
|
||||
}
|
||||
|
||||
SalarySobTaxReportRuleDTO salarySobTaxReportRuleDTO = new SalarySobTaxReportRuleDTO();
|
||||
salarySobTaxReportRuleDTO.setIncomeCategoryId(incomeCategoryId.toString());
|
||||
salarySobTaxReportRuleDTO.setIncomeCategoryName(incomeCategoryEnum == null ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
|
||||
salarySobTaxReportRuleDTO.setTaxReportRules(taxReportRules);
|
||||
resultList.add(salarySobTaxReportRuleDTO);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveByParam(SalarySobTaxReportRuleSaveParam saveParam) {
|
||||
// 校验参数是否合法
|
||||
// 构建po
|
||||
Date now = new Date();
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = Lists.newArrayList();
|
||||
for (SalarySobTaxReportRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) {
|
||||
for (SalarySobTaxReportRuleSaveParam.TaxReportRuleParam taxReportRuleParam : incomeCategoryParam.getTaxReportRuleParams()) {
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO()
|
||||
.setId(IdGenerator.generate())
|
||||
.setSalarySobId(saveParam.getSalarySobId())
|
||||
.setIncomeCategory(incomeCategoryParam.getIncomeCategory())
|
||||
.setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex())
|
||||
.setSalaryItemId(taxReportRuleParam.getSalaryItemId())
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setCreator((long) user.getUID())
|
||||
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now);
|
||||
salarySobTaxReportRules.add(salarySobTaxReportRule);
|
||||
}
|
||||
}
|
||||
deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) {
|
||||
salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isEmpty(salarySobIds)) {
|
||||
return;
|
||||
}
|
||||
salarySobTaxReportRuleMapper().deleteBySalarySobIds(salarySobIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<SalarySobTaxReportRulePO> salarySobTaxReportRules) {
|
||||
if (CollectionUtils.isEmpty(salarySobTaxReportRules)) {
|
||||
return;
|
||||
}
|
||||
salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules);
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +92,7 @@ public class SalaryEnumUtil {
|
|||
|
||||
for (BaseEnum enumMessage : enums) {
|
||||
Map<String, Object> hashMap = new HashMap<String, Object>();
|
||||
hashMap.put("enum", enumMessage);
|
||||
hashMap.put("value", enumMessage.getValue());
|
||||
hashMap.put("defaultLabel", enumMessage.getDefaultLabel());
|
||||
hashMap.put("labelId", enumMessage.getLabelId());
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ public class EmployeeDeclareController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam);
|
||||
return new ResponseResult<EmployeeDeclareParam, String>(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -230,7 +230,7 @@ public class EmployeeDeclareController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
|
||||
return new ResponseResult<EmployeeDeclareParam, String>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ public class SalarySobController {
|
|||
return ServiceUtil.getService(SalarySobBackItemWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user);
|
||||
}
|
||||
/**********************************薪资账套 start*********************************/
|
||||
|
||||
/**
|
||||
|
|
@ -244,13 +247,13 @@ public class SalarySobController {
|
|||
public Response downloadSobRangeTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
SalarySobPO salarySobPO = Objects.isNull(salarySobId) ? null : getSalarySobWrapper(user).getSalarySobService(user).getById(salarySobId);
|
||||
if(Objects.isNull(salarySobPO)){
|
||||
if (Objects.isNull(salarySobPO)) {
|
||||
throw new SalaryRunTimeException("薪资账套不存在或已被删除");
|
||||
}
|
||||
try {
|
||||
XSSFWorkbook workbook = getSalarySobRangeWrapper(user).exportImportTemplate();
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = salarySobPO.getName() + "人员范围导入模板" + time ;
|
||||
String fileName = salarySobPO.getName() + "人员范围导入模板" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
@ -261,17 +264,15 @@ public class SalarySobController {
|
|||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).
|
||||
header("Content-disposition", "attachment;filename=" + fileName).
|
||||
header("Cache-Control", "no-cache").build();
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 薪资账套人员范围导入预览
|
||||
* @return String
|
||||
* @description 薪资账套人员范围导入预览
|
||||
* @author Harryxzy
|
||||
* @date 2023/1/9 13:32
|
||||
*/
|
||||
|
|
@ -284,8 +285,8 @@ public class SalarySobController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @description 薪资账套人员范围导入
|
||||
* @return String
|
||||
* @description 薪资账套人员范围导入
|
||||
* @author Harryxzy
|
||||
* @date 2023/1/9 13:32
|
||||
*/
|
||||
|
|
@ -309,7 +310,7 @@ public class SalarySobController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryItemSearchParam, PageInfo<SalaryItemSobListDTO> >(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam);
|
||||
return new ResponseResult<SalaryItemSearchParam, PageInfo<SalaryItemSobListDTO>>(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -368,32 +369,28 @@ public class SalarySobController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************************薪资账套的薪资项目 end*********************************/
|
||||
|
||||
|
||||
|
||||
/**********************************薪资账套的回算项目 start*********************************/
|
||||
|
||||
/**
|
||||
* @description 薪资账套回算项目列表
|
||||
* @return String
|
||||
* @description 薪资账套回算项目列表
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 14:01
|
||||
*/
|
||||
@GET
|
||||
@Path("/backitem/getAggregate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "salarySobId") Long salarySobId) {
|
||||
public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long,SalarySobBackItemAggregateDTO>(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId);
|
||||
return new ResponseResult<Long, SalarySobBackItemAggregateDTO>(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 薪资账套回算项目详情(编辑前获取)
|
||||
* @return null
|
||||
* @description 薪资账套回算项目详情(编辑前获取)
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 14:02
|
||||
*/
|
||||
|
|
@ -401,28 +398,61 @@ public class SalarySobController {
|
|||
@Path("/backitem/getForm")
|
||||
@ApiOperation("薪资账套回算项目详情")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value ="id") Long id) {
|
||||
public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long,SalarySobBackItemFormDTO>(user).run(getSalarySobBackItemWrapper(user)::getForm, id);
|
||||
return new ResponseResult<Long, SalarySobBackItemFormDTO>(user).run(getSalarySobBackItemWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 保存薪资账套回算项目
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 15:05
|
||||
*/
|
||||
@POST
|
||||
@Path("/backitem/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalarySobBackItemSaveParam saveParam) {
|
||||
public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobBackItemSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySobBackItemSaveParam,List<SalarySobBackItemDTO>>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam);
|
||||
return new ResponseResult<SalarySobBackItemSaveParam, List<SalarySobBackItemDTO>>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam);
|
||||
}
|
||||
|
||||
/**********************************薪资账套的回算项目 end*********************************/
|
||||
|
||||
|
||||
/**********************************薪资账套的个税申报表规则 start*********************************/
|
||||
|
||||
/**
|
||||
* 薪资账套下的个税申报表规则的详情
|
||||
*
|
||||
* @param id 薪资账套id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/taxreportrule/getForm")
|
||||
@ApiOperation("薪资账套下的个税申报表规则的详情")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobTaxReportRuleForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<SalarySobTaxReportRuleDTO>>(user).run(getSalarySobTaxReportRuleWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪资账套下的个税申报表规则的
|
||||
*
|
||||
* @param saveParam 保存参数
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/taxreportrule/save")
|
||||
@ApiOperation("保存薪资账套下的个税申报表规则的")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalarySobTaxReportRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobTaxReportRuleSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySobTaxReportRuleSaveParam, String>(user).run(getSalarySobTaxReportRuleWrapper(user)::save, saveParam);
|
||||
}
|
||||
|
||||
/**********************************薪资账套的个税申报表规则 end*********************************/
|
||||
|
||||
|
||||
/**********************************调薪计薪规则 start*********************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
List<EmployeeDeclarePO> employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam);
|
||||
employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS);
|
||||
List<EmployeeDeclareListDTO> convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS);
|
||||
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),EmployeeDeclareListDTO.class);
|
||||
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class);
|
||||
pageInfo.setList(convert);
|
||||
pageInfo.setTotal(employeeDeclarePOS.size());
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
PageInfo<EmployeeDeclarePO> addPoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), addPOList, EmployeeDeclarePO.class);
|
||||
List<EmployeeDeclareListDTO> addDTOList = getEmployeeDeclareService(user).convert(addPoPageInfo.getList());
|
||||
// 分页
|
||||
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
PageInfo<EmployeeDeclareListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class);
|
||||
pageInfo.setList(addDTOList);
|
||||
pageInfo.setTotal(addPOList.size());
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
// 查询上个月报送的人员
|
||||
Set<Long> employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId);
|
||||
List<EmployeeDeclarePO> preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(
|
||||
SalaryDateUtil.plusMonths(queryParam.getTaxCycle(),-1), queryParam.getTaxAgentId(), employeeIds);
|
||||
SalaryDateUtil.plusMonths(queryParam.getTaxCycle(), -1), queryParam.getTaxAgentId(), employeeIds);
|
||||
// 获取修改了哪些字段
|
||||
Map<Long, Set<String>> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares);
|
||||
for (EmployeeDeclareListDTO employeeDeclareListDTO : (List<EmployeeDeclareListDTO>) dtoPageInfo.getList()) {
|
||||
|
|
@ -270,12 +270,12 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS)
|
||||
.setCardNum(employeeDeclare.getCardNum())
|
||||
.setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class))
|
||||
.setBirthday(SalaryDateUtil.dateToLocalDate(employeeDeclare.getBirthday()))
|
||||
.setBirthday(employeeDeclare.getBirthday())
|
||||
.setEmploymentStatus(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class))
|
||||
.setMobile(employeeDeclare.getMobile())
|
||||
.setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class))
|
||||
.setEmploymentDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getEmploymentDate()))
|
||||
.setDismissDate(SalaryDateUtil.dateToLocalDate(employeeDeclare.getDismissDate()))
|
||||
.setEmploymentDate(employeeDeclare.getEmploymentDate())
|
||||
.setDismissDate(employeeDeclare.getDismissDate())
|
||||
.setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class))
|
||||
.setDisabilityCardNo(employeeDeclare.getDisabilityCardNo())
|
||||
.setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class))
|
||||
|
|
@ -531,7 +531,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public EmployeeDeclareRateDTO getRate(String index) {
|
||||
return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE+ index);
|
||||
return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam;
|
||||
import com.engine.salary.service.SalarySobTaxReportRuleService;
|
||||
import com.engine.salary.service.impl.SalarySobTaxReportRuleServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套的个税申报表规则
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2022/12/7 4:27 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
@Component
|
||||
public class SalarySobTaxReportRuleWrapper extends Service {
|
||||
|
||||
private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资账套的个税申报表规则
|
||||
*
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
public List<SalarySobTaxReportRuleDTO> getForm(Long salarySobId) {
|
||||
return getSalarySobTaxReportRuleService(user).getSalarySobTaxReportRuleDTO(salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存薪资账套的个税申报表规则
|
||||
*
|
||||
* @param saveParam
|
||||
*/
|
||||
public void save(SalarySobTaxReportRuleSaveParam saveParam) {
|
||||
getSalarySobTaxReportRuleService(user).saveByParam(saveParam);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue