Merge branch 'release/2.15.1.2407.01' into feature/权限
This commit is contained in:
commit
25321bb357
|
|
@ -20,6 +20,9 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人
|
|||
二、删除停薪员工档案
|
||||
update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
|
||||
|
||||
二、删除停薪员工社保档案
|
||||
update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
|
||||
|
||||
|
||||
三、删除指定人员档案
|
||||
|
||||
|
|
|
|||
|
|
@ -70,4 +70,7 @@ public class SalaryCacheKey {
|
|||
public final static String SALARY_REPORT_DATA = "SALARY_REPORT_DATA_";
|
||||
|
||||
|
||||
public final static String UPLOAD_SALARY_CONFIG = "UPLOAD_SALARY_CONFIG";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.engine.salary.entity.config;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalaryConfig")
|
||||
public class SalaryConfig {
|
||||
// //版本
|
||||
// @XStreamAlias("version")
|
||||
// @XStreamAsAttribute
|
||||
// private String version;
|
||||
//
|
||||
@XStreamAlias("SysConfig")
|
||||
private SysConfig sysConfig;
|
||||
|
||||
//社保方案
|
||||
|
||||
//薪资项目
|
||||
@XStreamAlias("SalaryItemConfig")
|
||||
private SalaryItemAllConfig salaryItemConfig;
|
||||
|
||||
//字段管理
|
||||
@XStreamAlias("ArchiveFieldConfig")
|
||||
private ArchiveFieldConfig archiveFieldConfig;
|
||||
|
||||
//分权基础设置
|
||||
@XStreamAlias("TaxAgentBaseConfig")
|
||||
private TaxAgentBasePO taxAgentBaseConfig;
|
||||
|
||||
//扣缴义务人
|
||||
@XStreamImplicit
|
||||
private List<TaxAgentConfig> taxAgentConfigs;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.salary.entity.salaryarchive.config;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("ArchiveFieldConfig")
|
||||
public class ArchiveFieldConfig {
|
||||
|
||||
@XStreamImplicit
|
||||
List<SalaryItemPO> salaryItems;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salaryformula.config;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("FormluaConfig")
|
||||
public class FormluaConfig {
|
||||
|
||||
@XStreamImplicit
|
||||
private List<FormulaPO> formulas;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<FormulaVar> formulaVars;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package com.engine.salary.entity.salaryformula.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -7,75 +10,111 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("Formula")
|
||||
public class FormulaPO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
@XStreamAlias("module")
|
||||
@XStreamAsAttribute
|
||||
private String module;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@XStreamAlias("useFor")
|
||||
@XStreamAsAttribute
|
||||
private String useFor;
|
||||
/**
|
||||
* 引用类型
|
||||
*/
|
||||
@XStreamAlias("referenceType")
|
||||
@XStreamAsAttribute
|
||||
private String referenceType;
|
||||
/**
|
||||
* 返回类型
|
||||
*/
|
||||
@XStreamAlias("returnType")
|
||||
@XStreamAsAttribute
|
||||
private String returnType;
|
||||
/**
|
||||
* 校验类型
|
||||
*/
|
||||
@XStreamAlias("validateType")
|
||||
@XStreamAsAttribute
|
||||
private String validateType;
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
@XStreamAlias("extendParam")
|
||||
@XStreamAsAttribute
|
||||
private String extendParam;
|
||||
/**
|
||||
* 公式内容
|
||||
*/
|
||||
@XStreamAlias("formula")
|
||||
@XStreamAsAttribute
|
||||
private String formula;
|
||||
|
||||
/**
|
||||
* 公式实际运行脚本
|
||||
*/
|
||||
@XStreamAlias("formulaRunScript")
|
||||
@XStreamAsAttribute
|
||||
private String formulaRunScript;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
|
||||
@XStreamImplicit
|
||||
private List<FormulaVar> formulaVars;
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package com.engine.salary.entity.salaryformula.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -12,58 +15,84 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("FormulaVar")
|
||||
public class FormulaVar {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
/**
|
||||
* 公式id
|
||||
*/
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
/**
|
||||
* 字段id
|
||||
*/
|
||||
@XStreamAlias("fieldId")
|
||||
@XStreamAsAttribute
|
||||
private String fieldId;
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
@XStreamAlias("fieldName")
|
||||
@XStreamAsAttribute
|
||||
private String fieldName;
|
||||
/**
|
||||
* 字段类型,number,string
|
||||
*/
|
||||
@XStreamAlias("fieldType")
|
||||
@XStreamAsAttribute
|
||||
private String fieldType;
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
@XStreamAlias("source")
|
||||
@XStreamAsAttribute
|
||||
private String source;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("orderIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer orderIndex;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否删除,0否1是
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
//值
|
||||
@XStreamOmitField
|
||||
private String content;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package com.engine.salary.entity.salaryitem.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("FormulaConfig")
|
||||
public class FormulaConfig {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
@XStreamAlias("module")
|
||||
@XStreamAsAttribute
|
||||
private String module;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@XStreamAlias("useFor")
|
||||
@XStreamAsAttribute
|
||||
private String useFor;
|
||||
/**
|
||||
* 引用类型
|
||||
*/
|
||||
@XStreamAlias("referenceType")
|
||||
@XStreamAsAttribute
|
||||
private String referenceType;
|
||||
/**
|
||||
* 返回类型
|
||||
*/
|
||||
@XStreamAlias("returnType")
|
||||
@XStreamAsAttribute
|
||||
private String returnType;
|
||||
/**
|
||||
* 校验类型
|
||||
*/
|
||||
@XStreamAlias("validateType")
|
||||
@XStreamAsAttribute
|
||||
private String validateType;
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
@XStreamAlias("extendParam")
|
||||
@XStreamAsAttribute
|
||||
private String extendParam;
|
||||
/**
|
||||
* 公式内容
|
||||
*/
|
||||
@XStreamAlias("formula")
|
||||
@XStreamAsAttribute
|
||||
private String formula;
|
||||
|
||||
/**
|
||||
* 公式实际运行脚本
|
||||
*/
|
||||
@XStreamAlias("formulaRunScript")
|
||||
@XStreamAsAttribute
|
||||
private String formulaRunScript;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<FormulaVarConfig> varConfigs;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.entity.salaryitem.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("FormulaVarConfig")
|
||||
public class FormulaVarConfig {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 公式id
|
||||
*/
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
|
||||
/**
|
||||
* 字段id
|
||||
*/
|
||||
@XStreamAlias("fieldId")
|
||||
@XStreamAsAttribute
|
||||
private String fieldId;
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
@XStreamAlias("fieldName")
|
||||
@XStreamAsAttribute
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 字段类型,number,string
|
||||
*/
|
||||
@XStreamAlias("fieldType")
|
||||
@XStreamAsAttribute
|
||||
private String fieldType;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
@XStreamAlias("source")
|
||||
@XStreamAsAttribute
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("orderIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer orderIndex;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.salary.entity.salaryitem.config;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalaryItemConfig")
|
||||
public class SalaryItemAllConfig {
|
||||
|
||||
@XStreamImplicit
|
||||
List<SalaryItemPO> salaryItems;
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
package com.engine.salary.entity.salaryitem.config;
|
||||
|
||||
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.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalaryItemConfig")
|
||||
public class SalaryItemConfig {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@XStreamAlias("code")
|
||||
@XStreamAsAttribute
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 是否是系统项目
|
||||
*
|
||||
* @see SalarySystemTypeEnum
|
||||
*/
|
||||
@XStreamAlias("systemType")
|
||||
@XStreamAsAttribute
|
||||
private Integer systemType;
|
||||
|
||||
/**
|
||||
* 系统薪资项目的id(是从哪个系统薪资项目复制过来的)
|
||||
*/
|
||||
@XStreamAlias("sysSalaryItemId")
|
||||
@XStreamAsAttribute
|
||||
private Long sysSalaryItemId;
|
||||
|
||||
/**
|
||||
* 默认使用。0:默认不适用、1:默认使用
|
||||
*/
|
||||
@XStreamAlias("useDefault")
|
||||
@XStreamAsAttribute
|
||||
private Integer useDefault;
|
||||
|
||||
/**
|
||||
* 薪资档案引用。0:薪资档案未引用、1:薪资档案引用
|
||||
*/
|
||||
@XStreamAlias("useInEmployeeSalary")
|
||||
@XStreamAsAttribute
|
||||
private Integer useInEmployeeSalary;
|
||||
|
||||
/**
|
||||
* 核算时隐藏
|
||||
*/
|
||||
@XStreamAlias("hideDefault")
|
||||
@XStreamAsAttribute
|
||||
private Integer hideDefault;
|
||||
|
||||
/**
|
||||
* 进位规则
|
||||
*
|
||||
* @see SalaryRoundingModeEnum
|
||||
*/
|
||||
@XStreamAlias("roundingMode")
|
||||
@XStreamAsAttribute
|
||||
private Integer roundingMode;
|
||||
|
||||
/**
|
||||
* 保留的小数位数
|
||||
*/
|
||||
@XStreamAlias("pattern")
|
||||
@XStreamAsAttribute
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
* 取值方式
|
||||
*
|
||||
* @see SalaryValueTypeEnum
|
||||
*/
|
||||
@XStreamAlias("valueType")
|
||||
@XStreamAsAttribute
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
@XStreamAlias("dataType")
|
||||
@XStreamAsAttribute
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否可以编辑。0:不可编辑、1:可编辑
|
||||
*/
|
||||
@XStreamAlias("canEdit")
|
||||
@XStreamAsAttribute
|
||||
private Integer canEdit;
|
||||
|
||||
/**
|
||||
* 可见性
|
||||
*/
|
||||
@XStreamAlias("sharedType")
|
||||
@XStreamAsAttribute
|
||||
private Integer sharedType;
|
||||
|
||||
/**
|
||||
* 可见范围
|
||||
*/
|
||||
@XStreamAlias("taxAgentIds")
|
||||
@XStreamAsAttribute
|
||||
private String taxAgentIds;
|
||||
|
||||
/**
|
||||
* 0不可删除,1可删除
|
||||
*/
|
||||
@XStreamAlias("canDelete")
|
||||
@XStreamAsAttribute
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@XStreamAlias("width")
|
||||
@XStreamAsAttribute
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@XStreamAlias("defaultValue")
|
||||
@XStreamAsAttribute
|
||||
private String defaultValue;
|
||||
|
||||
@XStreamAlias("FormulaConfig")
|
||||
private FormulaConfig formulaConfig;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.engine.salary.entity.salaryitem.config;
|
||||
|
||||
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.util.excel.ExcelHead;
|
||||
import com.engine.salary.util.excel.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryItemExcelConfig {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelHead(title="名称",dataIndex = "name")
|
||||
@ExcelProperty(index = 0)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 默认使用。0:默认不适用、1:默认使用
|
||||
*/
|
||||
@ExcelHead(title="是否默认使用",dataIndex = "useDefault")
|
||||
@ExcelProperty(index = 1)
|
||||
private String useDefault;
|
||||
|
||||
/**
|
||||
* 核算是否隐藏
|
||||
*/
|
||||
@ExcelHead(title="核算是否隐藏",dataIndex = "hideDefault")
|
||||
@ExcelProperty(index = 2)
|
||||
private String hideDefault;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
@ExcelHead(title="字段类型",dataIndex = "dataType")
|
||||
@ExcelProperty(index = 3)
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 进位规则
|
||||
*
|
||||
* @see SalaryRoundingModeEnum
|
||||
*/
|
||||
@ExcelHead(title="进位规则",dataIndex = "roundingMode")
|
||||
@ExcelProperty(index = 4)
|
||||
private String roundingMode;
|
||||
|
||||
/**
|
||||
* 保留的小数位数
|
||||
*/
|
||||
@ExcelHead(title="保留的小数位数",dataIndex = "pattern")
|
||||
@ExcelProperty(index = 5)
|
||||
private String pattern;
|
||||
|
||||
/**
|
||||
* 取值方式
|
||||
*
|
||||
* @see SalaryValueTypeEnum
|
||||
*/
|
||||
@ExcelHead(title="取值方式",dataIndex = "valueType")
|
||||
@ExcelProperty(index = 6)
|
||||
private String valueType;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
@ExcelHead(title="公式",dataIndex = "formula")
|
||||
@ExcelProperty(index = 7)
|
||||
private String formula;
|
||||
|
||||
@ExcelHead(title="sql返回字段",dataIndex = "sqlReturnKey")
|
||||
@ExcelProperty(index = 8)
|
||||
private String extendParam;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelHead(title="排序",dataIndex = "sortedIndex")
|
||||
@ExcelProperty(index = 9)
|
||||
private String sortedIndex;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ExcelHead(title="宽度",dataIndex = "width")
|
||||
@ExcelProperty(index = 10)
|
||||
private String width;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@ExcelHead(title="默认值",dataIndex = "defaultValue")
|
||||
@ExcelProperty(index = 11)
|
||||
private String defaultValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelHead(title="备注",dataIndex = "description")
|
||||
@ExcelProperty(index = 12)
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.salary.entity.salaryitem.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资项目查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryItemDownloadTemplateParam {
|
||||
|
||||
//下载模板是否带数据
|
||||
private boolean hasData;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salaryitem.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 导出参数
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryItemExportParam {
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.entity.salaryitem.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 导入参数
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryItemImportParam {
|
||||
|
||||
/**
|
||||
* 上传文件id
|
||||
*/
|
||||
String imageId;
|
||||
}
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
package com.engine.salary.entity.salaryitem.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
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.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -27,24 +30,31 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
//hrsa_salary_item
|
||||
@ElogTransform(name = "薪资项目")
|
||||
@XStreamAlias("SalaryItem")
|
||||
public class SalaryItemPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ElogTransform(name = "主键id")
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ElogTransform(name = "名称")
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ElogTransform(name = "编号")
|
||||
@XStreamAlias("code")
|
||||
@XStreamAsAttribute
|
||||
private String code;
|
||||
|
||||
/**
|
||||
|
|
@ -53,30 +63,40 @@ public class SalaryItemPO {
|
|||
* @see SalarySystemTypeEnum
|
||||
*/
|
||||
@ElogTransform(name = "是否是系统项目")
|
||||
@XStreamAlias("systemType")
|
||||
@XStreamAsAttribute
|
||||
private Integer systemType;
|
||||
|
||||
/**
|
||||
* 系统薪资项目的id(是从哪个系统薪资项目复制过来的)
|
||||
*/
|
||||
@ElogTransform(name = "系统薪资项目的id")
|
||||
@XStreamAlias("sysSalaryItemId")
|
||||
@XStreamAsAttribute
|
||||
private Long sysSalaryItemId;
|
||||
|
||||
/**
|
||||
* 默认使用。0:默认不适用、1:默认使用
|
||||
*/
|
||||
@ElogTransform(name = "默认使用")
|
||||
@XStreamAlias("useDefault")
|
||||
@XStreamAsAttribute
|
||||
private Integer useDefault;
|
||||
|
||||
/**
|
||||
* 薪资档案引用。0:薪资档案未引用、1:薪资档案引用
|
||||
*/
|
||||
@ElogTransform(name = "薪资档案引用")
|
||||
@XStreamAlias("useInEmployeeSalary")
|
||||
@XStreamAsAttribute
|
||||
private Integer useInEmployeeSalary;
|
||||
|
||||
/**
|
||||
* 核算时隐藏
|
||||
*/
|
||||
@ElogTransform(name = "核算时隐藏")
|
||||
@XStreamAlias("hideDefault")
|
||||
@XStreamAsAttribute
|
||||
private Integer hideDefault;
|
||||
|
||||
/**
|
||||
|
|
@ -85,12 +105,16 @@ public class SalaryItemPO {
|
|||
* @see SalaryRoundingModeEnum
|
||||
*/
|
||||
@ElogTransform(name = "进位规则")
|
||||
@XStreamAlias("roundingMode")
|
||||
@XStreamAsAttribute
|
||||
private Integer roundingMode;
|
||||
|
||||
/**
|
||||
* 保留的小数位数
|
||||
*/
|
||||
@ElogTransform(name = "保留的小数位数")
|
||||
@XStreamAlias("pattern")
|
||||
@XStreamAsAttribute
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
|
|
@ -99,6 +123,8 @@ public class SalaryItemPO {
|
|||
* @see SalaryValueTypeEnum
|
||||
*/
|
||||
@ElogTransform(name = "取值方式")
|
||||
@XStreamAlias("valueType")
|
||||
@XStreamAsAttribute
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
|
|
@ -107,54 +133,72 @@ public class SalaryItemPO {
|
|||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
@ElogTransform(name = "字段类型")
|
||||
@XStreamAlias("dataType")
|
||||
@XStreamAsAttribute
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
@ElogTransform(name = "公式")
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ElogTransform(name = "备注")
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否可以编辑。0:不可编辑、1:可编辑
|
||||
*/
|
||||
@ElogTransform(name = "是否可以编辑")
|
||||
@XStreamAlias("canEdit")
|
||||
@XStreamAsAttribute
|
||||
private Integer canEdit;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@ElogTransform(name = "租户key")
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ElogTransform(name = "创建人id")
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@ElogTransform(name = "是否删除")
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
//查询条件
|
||||
|
|
@ -166,35 +210,50 @@ public class SalaryItemPO {
|
|||
* 可见性
|
||||
*/
|
||||
@ElogTransform(name = "可见性")
|
||||
@XStreamAlias("sharedType")
|
||||
@XStreamAsAttribute
|
||||
private Integer sharedType;
|
||||
|
||||
/**
|
||||
* 可见范围
|
||||
*/
|
||||
@ElogTransform(name = "可见范围")
|
||||
@XStreamAlias("taxAgentIds")
|
||||
@XStreamAsAttribute
|
||||
private String taxAgentIds;
|
||||
|
||||
/**
|
||||
* 0不可删除,1可删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已经删除")
|
||||
@XStreamAlias("canDelete")
|
||||
@XStreamAsAttribute
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ElogTransform(name = "排序")
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ElogTransform(name = "宽度")
|
||||
@XStreamAlias("width")
|
||||
@XStreamAsAttribute
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@ElogTransform(name = "默认值")
|
||||
@XStreamAlias("defaultValue")
|
||||
@XStreamAsAttribute
|
||||
private String defaultValue;
|
||||
|
||||
@XStreamAlias("Formula")
|
||||
FormulaPO formula;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.engine.salary.entity.salarysob.config;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalarySobConfig")
|
||||
public class SalarySobConfig {
|
||||
|
||||
@XStreamAlias("SalarySob")
|
||||
private SalarySobPO salarySob;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySobEmpFieldPO> salarySobEmpFields;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySobItemGroupPO> salarySobItemGroups;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySobItemPO> salarySobItems;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySobBackItemPO> salarySobBackItems;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySobAdjustRulePO> salarySobAdjustRules;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -24,26 +26,35 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@Builder
|
||||
//hrsa_salary_sob_adjust_rule
|
||||
@XStreamAlias("SalarySobAdjustRule")
|
||||
public class SalarySobAdjustRulePO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
@XStreamAlias("salarySobId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
*/
|
||||
@XStreamAlias("salaryItemId")
|
||||
@XStreamAsAttribute
|
||||
private Long salaryItemId;
|
||||
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
@XStreamAlias("dayOfMonth")
|
||||
@XStreamAsAttribute
|
||||
private Integer dayOfMonth;
|
||||
|
||||
/**
|
||||
|
|
@ -51,6 +62,8 @@ public class SalarySobAdjustRulePO {
|
|||
*
|
||||
* @see SalarySobAdjustRuleTypeEnum
|
||||
*/
|
||||
@XStreamAlias("beforeAdjustmentType")
|
||||
@XStreamAsAttribute
|
||||
private Integer beforeAdjustmentType;
|
||||
|
||||
/**
|
||||
|
|
@ -58,31 +71,43 @@ public class SalarySobAdjustRulePO {
|
|||
*
|
||||
* @see SalarySobAdjustRuleTypeEnum
|
||||
*/
|
||||
@XStreamAlias("afterAdjustmentType")
|
||||
@XStreamAsAttribute
|
||||
private Integer afterAdjustmentType;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
Collection<Long> ids;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -26,26 +30,35 @@ import java.util.stream.Collectors;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalarySobBackItem")
|
||||
public class SalarySobBackItemPO{
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
@XStreamAlias("salarySobId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
*/
|
||||
@XStreamAlias("salaryItemId")
|
||||
@XStreamAsAttribute
|
||||
private Long salaryItemId;
|
||||
|
||||
/**
|
||||
* 薪资项目code
|
||||
*/
|
||||
@XStreamAlias("salaryItemCode")
|
||||
@XStreamAsAttribute
|
||||
private String salaryItemCode;
|
||||
|
||||
/**
|
||||
|
|
@ -53,6 +66,8 @@ public class SalarySobBackItemPO{
|
|||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
@XStreamAlias("dataType")
|
||||
@XStreamAsAttribute
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
|
|
@ -60,11 +75,15 @@ public class SalarySobBackItemPO{
|
|||
*
|
||||
* @see SalaryRoundingModeEnum
|
||||
*/
|
||||
@XStreamAlias("roundingMode")
|
||||
@XStreamAsAttribute
|
||||
private Integer roundingMode;
|
||||
|
||||
/**
|
||||
* 保留的小数位数
|
||||
*/
|
||||
@XStreamAlias("pattern")
|
||||
@XStreamAsAttribute
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
|
|
@ -72,54 +91,79 @@ public class SalarySobBackItemPO{
|
|||
*
|
||||
* @see SalaryValueTypeEnum
|
||||
*/
|
||||
@XStreamAlias("valueType")
|
||||
@XStreamAsAttribute
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 公式id
|
||||
*/
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
|
||||
/**
|
||||
* 0:已发项目、1:补发薪资项目
|
||||
*/
|
||||
@XStreamAlias("backCalcType")
|
||||
@XStreamAsAttribute
|
||||
private Integer backCalcType;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@XStreamAlias("defaultValue")
|
||||
@XStreamAsAttribute
|
||||
private String defaultValue;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
@JsonIgnore
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
@JsonIgnore
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
@JsonIgnore
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
@JsonIgnore
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
@JsonIgnore
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
private String defaultValue;
|
||||
|
||||
|
||||
@XStreamAlias("SalaryItem")
|
||||
private SalaryItemPO salaryItem;
|
||||
|
||||
@XStreamAlias("Formula")
|
||||
FormulaPO formula;
|
||||
|
||||
|
||||
/**
|
||||
* 薪资项目id
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -27,56 +29,77 @@ import java.util.stream.Collectors;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_salary_sob_emp_field
|
||||
@XStreamAlias("SalarySobEmpField")
|
||||
public class SalarySobEmpFieldPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
@XStreamAlias("salarySobId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 字段code
|
||||
*/
|
||||
@XStreamAlias("fieldCode")
|
||||
@XStreamAsAttribute
|
||||
private String fieldCode;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 是否可以删除
|
||||
*/
|
||||
@XStreamAlias("canDelete")
|
||||
@XStreamAsAttribute
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
Collection<Long> ids;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -25,60 +28,88 @@ import java.util.stream.Collectors;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_salary_sob_item_group
|
||||
@XStreamAlias("SalarySobItemGroup")
|
||||
public class SalarySobItemGroupPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套的id
|
||||
*/
|
||||
@XStreamAlias("salarySobId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资账套中薪资项目分组的名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
|
||||
//该分类是否隐藏(0不隐藏,1隐藏)
|
||||
@XStreamAlias("itemHide")
|
||||
@XStreamAsAttribute
|
||||
private Long itemHide;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
//该分类是否隐藏(0不隐藏,1隐藏)
|
||||
private Long itemHide;
|
||||
@XStreamImplicit
|
||||
private List<SalarySobItemPO> salarySobItems;
|
||||
|
||||
|
||||
Collection<Long> ids;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -29,83 +33,73 @@ import java.util.stream.Collectors;
|
|||
@AllArgsConstructor
|
||||
//hrsa_salary_sob_item
|
||||
@ElogTransform( name="薪资账套薪资项目" )
|
||||
@XStreamAlias("SalarySobItem")
|
||||
public class SalarySobItemPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资账套的id
|
||||
*/
|
||||
@XStreamAlias("salarySobId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 薪资项目的id
|
||||
*/
|
||||
@XStreamAlias("salaryItemId")
|
||||
@XStreamAsAttribute
|
||||
private Long salaryItemId;
|
||||
|
||||
/**
|
||||
* 薪资账套薪资项目分组id
|
||||
*/
|
||||
@XStreamAlias("salarySobItemGroupId")
|
||||
@XStreamAsAttribute
|
||||
private Long salarySobItemGroupId;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
@XStreamAlias("formulaId")
|
||||
@XStreamAsAttribute
|
||||
private Long formulaId;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否可以删除。0:不可删除、1:可以删除
|
||||
*/
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 进位规则
|
||||
*
|
||||
* @see SalaryRoundingModeEnum
|
||||
*/
|
||||
@XStreamAlias("roundingMode")
|
||||
@XStreamAsAttribute
|
||||
private Integer roundingMode;
|
||||
|
||||
/**
|
||||
* 保留的小数位数
|
||||
*/
|
||||
@XStreamAlias("pattern")
|
||||
@XStreamAsAttribute
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
|
|
@ -113,17 +107,71 @@ public class SalarySobItemPO {
|
|||
*
|
||||
* @see SalaryValueTypeEnum
|
||||
*/
|
||||
@XStreamAlias("valueType")
|
||||
@XStreamAsAttribute
|
||||
private Integer valueType;
|
||||
|
||||
|
||||
//该分类是否隐藏(0不隐藏,1隐藏)
|
||||
@XStreamAlias("itemHide")
|
||||
@XStreamAsAttribute
|
||||
private Long itemHide;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@XStreamAlias("defaultValue")
|
||||
@XStreamAsAttribute
|
||||
private String defaultValue;
|
||||
|
||||
/**
|
||||
* 是否可以删除。0:不可删除、1:可以删除
|
||||
*/
|
||||
@XStreamAlias("canDelete")
|
||||
@XStreamAsAttribute
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
@XStreamAlias("SalaryItem")
|
||||
private SalaryItemPO salaryItem;
|
||||
|
||||
@XStreamAlias("Formula")
|
||||
private FormulaPO formula;
|
||||
|
||||
//in
|
||||
Collection<Long> ids;
|
||||
Collection<Long> salarySobIds;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.engine.salary.entity.salarysob.po;
|
|||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.util.valid.Compare;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,6 +24,7 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@ElogTransform( name="薪资账套" )
|
||||
//hrsa_salary_sob
|
||||
@XStreamAlias("SalarySob")
|
||||
public class SalarySobPO {
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +32,7 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="主键" )
|
||||
@Compare
|
||||
@XStreamOmitField
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
@ -35,12 +40,16 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="名称" )
|
||||
@Compare
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人的主键id
|
||||
*/
|
||||
@ElogTransform( name="个税扣缴义务人id" )
|
||||
@XStreamAlias("taxAgentId")
|
||||
@XStreamAsAttribute
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
|
|
@ -48,6 +57,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="薪资类型" )
|
||||
@Compare
|
||||
@XStreamAlias("incomeCategory")
|
||||
@XStreamAsAttribute
|
||||
private Integer incomeCategory;
|
||||
|
||||
/**
|
||||
|
|
@ -55,6 +66,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="薪资周期" )
|
||||
@Compare
|
||||
@XStreamAlias("salaryCycleType")
|
||||
@XStreamAsAttribute
|
||||
private Integer salaryCycleType;
|
||||
|
||||
/**
|
||||
|
|
@ -62,6 +75,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="薪资周期起始日期" )
|
||||
@Compare
|
||||
@XStreamAlias("salaryCycleFromDay")
|
||||
@XStreamAsAttribute
|
||||
private Integer salaryCycleFromDay;
|
||||
|
||||
/**
|
||||
|
|
@ -69,6 +84,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="税款所属期" )
|
||||
@Compare
|
||||
@XStreamAlias("taxCycleType")
|
||||
@XStreamAsAttribute
|
||||
private Integer taxCycleType;
|
||||
|
||||
/**
|
||||
|
|
@ -76,6 +93,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="考勤周期" )
|
||||
@Compare
|
||||
@XStreamAlias("attendCycleType")
|
||||
@XStreamAsAttribute
|
||||
private Integer attendCycleType;
|
||||
|
||||
/**
|
||||
|
|
@ -83,6 +102,8 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="考勤周期起始日期" )
|
||||
@Compare
|
||||
@XStreamAlias("attendCycleFromDay")
|
||||
@XStreamAsAttribute
|
||||
private Integer attendCycleFromDay;
|
||||
|
||||
/**
|
||||
|
|
@ -90,48 +111,64 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="社保福利所属期" )
|
||||
@Compare
|
||||
@XStreamAlias("socialSecurityCycleType")
|
||||
@XStreamAsAttribute
|
||||
private Integer socialSecurityCycleType;
|
||||
|
||||
/**
|
||||
* 是否禁用。0:正常使用、1:禁用
|
||||
*/
|
||||
@ElogTransform( name="是否禁用" )
|
||||
@XStreamAlias("disable")
|
||||
@XStreamAsAttribute
|
||||
private Integer disable;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ElogTransform( name="描述" )
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform( name="创建人" )
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform( name="创建时间" )
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform( name="更新时间" )
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform( name="是否已删除" )
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ElogTransform( name="租户" )
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
Collection<Long> ids;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.entity.siarchives.po;
|
|||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -90,6 +91,7 @@ public class InsuranceArchivesBaseInfoPO {
|
|||
|
||||
/**
|
||||
* 福利执行状态
|
||||
* @see EmployeeStatusEnum
|
||||
*/
|
||||
@ElogTransform(name = "福利执行状态")
|
||||
private String runStatus;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.salary.entity.taxagent.config;
|
||||
|
||||
import com.engine.salary.entity.salarysob.config.SalarySobConfig;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("TaxAgentConfig")
|
||||
public class TaxAgentConfig {
|
||||
|
||||
@XStreamAlias("TaxAgent")
|
||||
private TaxAgentPO taxAgent;
|
||||
|
||||
//薪资账套
|
||||
@XStreamImplicit
|
||||
private List<SalarySobConfig> salarySobConfigs;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.salary.entity.taxagent.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,41 +23,57 @@ import java.util.Date;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_tax_agent_base")
|
||||
@XStreamAlias("TaxAgentBase")
|
||||
public class TaxAgentBasePO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分权开关
|
||||
*/
|
||||
@XStreamAlias("devolutionStatus")
|
||||
@XStreamAsAttribute
|
||||
private Integer devolutionStatus;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.engine.salary.entity.taxagent.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -24,64 +27,86 @@ import java.util.Date;
|
|||
//hrsa_tax_agent")
|
||||
//个税扣缴义务人表")
|
||||
@ElogTransform(name = "个税扣缴义务人")
|
||||
@XStreamAlias("TaxAgent")
|
||||
public class TaxAgentPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ElogTransform(name = "主键id")
|
||||
@XStreamOmitField
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ElogTransform(name = "名称")
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 代缴机构
|
||||
*/
|
||||
// @ElogTransform(name = "代缴机构")
|
||||
@XStreamAlias("paymentAgency")
|
||||
@XStreamAsAttribute
|
||||
private String paymentAgency;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ElogTransform(name = "备注")
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ElogTransform(name = "创建人id")
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
@ElogTransform(name = "updateTime")
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortedIndex;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ package com.engine.salary.enums;
|
|||
|
||||
|
||||
/**
|
||||
* @description: 是、否
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/28/21 5:50 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 开关枚举
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum SalaryOnOffEnum implements BaseEnum<Integer> {
|
||||
|
||||
ON(1, "是", 84967),
|
||||
|
|
@ -40,4 +41,22 @@ public enum SalaryOnOffEnum implements BaseEnum<Integer> {
|
|||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static SalaryOnOffEnum parseByValue(int value) {
|
||||
for (SalaryOnOffEnum item : values()) {
|
||||
if (item.getValue().equals(value)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return OFF;
|
||||
}
|
||||
|
||||
public static SalaryOnOffEnum parseByDefaultLabel(String defaultLabel) {
|
||||
for (SalaryOnOffEnum item : values()) {
|
||||
if (item.getDefaultLabel().equals(defaultLabel)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return OFF;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,15 @@ public enum SalaryRoundingModeEnum implements BaseEnum<Integer> {
|
|||
return modeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return ROUNDING;
|
||||
}
|
||||
|
||||
public static SalaryRoundingModeEnum parseByDefaultLabel(String defaultLabel) {
|
||||
for (SalaryRoundingModeEnum modeEnum : SalaryRoundingModeEnum.values()) {
|
||||
if (Objects.equals(modeEnum.getDefaultLabel(), defaultLabel)) {
|
||||
return modeEnum;
|
||||
}
|
||||
}
|
||||
return ROUNDING;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,16 @@ public enum SalaryValueTypeEnum implements BaseEnum<Integer> {
|
|||
return salaryValueTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
public static SalaryValueTypeEnum parseByDefaultLabel(String defaultLabel) {
|
||||
for (SalaryValueTypeEnum salaryValueTypeEnum : SalaryValueTypeEnum.values()) {
|
||||
if (Objects.equals(salaryValueTypeEnum.getDefaultLabel(), defaultLabel)) {
|
||||
return salaryValueTypeEnum;
|
||||
}
|
||||
}
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -65,6 +74,6 @@ public enum SalaryValueTypeEnum implements BaseEnum<Integer> {
|
|||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return INPUT.getDefaultLabel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.enums.salaryitem;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
|
@ -51,7 +52,7 @@ public enum SalaryDataTypeEnum implements BaseEnum<String> {
|
|||
return salaryDataTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return STRING;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(String value) {
|
||||
|
|
@ -66,4 +67,13 @@ public enum SalaryDataTypeEnum implements BaseEnum<String> {
|
|||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static SalaryDataTypeEnum parseByDefaultLabel(String defaultLabel) {
|
||||
for (SalaryDataTypeEnum typeEnum : SalaryDataTypeEnum.values()) {
|
||||
if (Objects.equals(typeEnum.getDefaultLabel(), defaultLabel)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
return STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
|||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -97,4 +96,5 @@ public interface SalaryArchiveItemMapper {
|
|||
void batchDeleteHistoryData(SalaryArchiveItemPO build);
|
||||
|
||||
int batchUpdate(@Param("collection") List<SalaryArchiveItemPO> pos);
|
||||
|
||||
}
|
||||
|
|
@ -1137,4 +1137,61 @@
|
|||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<resultMap id="configResultMap" type="com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig">
|
||||
<result column="item_id" property="id"/>
|
||||
<result column="item_name" property="name"/>
|
||||
<result column="item_code" property="code"/>
|
||||
<result column="item_system_type" property="systemType"/>
|
||||
<result column="item_sys_salary_item_id" property="sysSalaryItemId"/>
|
||||
<result column="item_use_default" property="useDefault"/>
|
||||
<result column="item_use_in_employee_salary" property="useInEmployeeSalary"/>
|
||||
<result column="item_rounding_mode" property="roundingMode"/>
|
||||
<result column="item_pattern" property="pattern"/>
|
||||
<result column="item_value_type" property="valueType"/>
|
||||
<result column="item_formula_id" property="formulaId"/>
|
||||
<result column="item_description" property="description"/>
|
||||
<result column="item_can_edit" property="canEdit"/>
|
||||
<result column="item_data_type" property="dataType"/>
|
||||
<result column="item_shared_type" property="sharedType"/>
|
||||
<result column="item_tax_agent_ids" property="taxAgentIds"/>
|
||||
<result column="item_sorted_index" property="sortedIndex"/>
|
||||
<result column="item_hide_default" property="hideDefault"/>
|
||||
<result column="item_width" property="width"/>
|
||||
<result column="item_default_value" property="defaultValue"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="itemColumns">
|
||||
item.id as item_id
|
||||
,item.name as item_name
|
||||
, item.code as item_code
|
||||
, item.system_type as item_system_type
|
||||
, item.sys_salary_item_id as item_sys_salary_item_id
|
||||
, item.use_default as item_use_default
|
||||
, item.use_in_employee_salary as item_use_in_employee_salary
|
||||
, item.rounding_mode as item_rounding_mode
|
||||
, item.pattern as item_pattern
|
||||
, item.value_type as item_value_type
|
||||
, item.formula_id as item_formula_id
|
||||
, item.description as item_description
|
||||
, item.can_edit as item_can_edit
|
||||
, item.can_delete as item_can_delete
|
||||
, item.data_type as item_data_type
|
||||
, item.shared_type as item_shared_type
|
||||
, item.tax_agent_ids as item_tax_agent_ids
|
||||
, item.sorted_index as item_sorted_index
|
||||
, item.hide_default as item_hide_default
|
||||
, item.width as item_width
|
||||
, item.default_value as item_default_value
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -15,7 +15,9 @@ public interface FormulaMapper {
|
|||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<FormulaPO> listAll();
|
||||
|
||||
|
||||
List<FormulaPO> list2All();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@
|
|||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="list2All" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_formula t
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.mapper.salaryitem;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -67,5 +68,11 @@ public interface SalaryItemMapper {
|
|||
|
||||
void batchUpdateSortedIndex(@Param("collection")List<SalaryItemPO> salaryItemPOS);
|
||||
|
||||
SalaryItemPO getByName(String name);
|
||||
SalaryItemPO getByCode(String code);
|
||||
|
||||
List<SalaryItemExcelConfig> getConfig(@Param("ids") Collection<Long> ids);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -31,7 +31,10 @@
|
|||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id,
|
||||
t
|
||||
.
|
||||
id
|
||||
,
|
||||
t.name,
|
||||
t.code,
|
||||
t.system_type,
|
||||
|
|
@ -406,12 +409,12 @@
|
|||
update_time, creator, delete_type, tenant_key, data_type, shared_type, tax_agent_ids)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(#{item.id},#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey}, #{item.dataType},
|
||||
#{item.sharedType}, #{item.taxAgentIds})
|
||||
(#{item_id},#{item_name}, #{item_code}, #{item_systemType}, #{item_sysSalaryItemId},
|
||||
#{item_useDefault}, #{item_useInEmployeeSalary}, #{item_roundingMode},
|
||||
#{item_pattern},
|
||||
#{item_valueType}, #{item_formulaId}, #{item_description}, #{item_canEdit},
|
||||
#{item_createTime}, #{item_updateTime}, #{item_creator}, 0, #{item_tenantKey}, #{item_dataType},
|
||||
#{item_sharedType}, #{item_taxAgentIds})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
|
|
@ -422,27 +425,27 @@
|
|||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.name,jdbcType=VARCHAR},
|
||||
#{item.code,jdbcType=VARCHAR},
|
||||
#{item.systemType,jdbcType=INTEGER},
|
||||
#{item.sysSalaryItemId,jdbcType=DOUBLE},
|
||||
#{item.useDefault,jdbcType=INTEGER},
|
||||
#{item.useInEmployeeSalary,jdbcType=INTEGER},
|
||||
#{item.roundingMode,jdbcType=INTEGER},
|
||||
#{item.pattern,jdbcType=INTEGER},
|
||||
#{item.valueType,jdbcType=INTEGER},
|
||||
#{item.formulaId,jdbcType=DOUBLE},
|
||||
#{item.description,jdbcType=VARCHAR},
|
||||
#{item.canEdit,jdbcType=INTEGER},
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item_id,jdbcType=DOUBLE},
|
||||
#{item_name,jdbcType=VARCHAR},
|
||||
#{item_code,jdbcType=VARCHAR},
|
||||
#{item_systemType,jdbcType=INTEGER},
|
||||
#{item_sysSalaryItemId,jdbcType=DOUBLE},
|
||||
#{item_useDefault,jdbcType=INTEGER},
|
||||
#{item_useInEmployeeSalary,jdbcType=INTEGER},
|
||||
#{item_roundingMode,jdbcType=INTEGER},
|
||||
#{item_pattern,jdbcType=INTEGER},
|
||||
#{item_valueType,jdbcType=INTEGER},
|
||||
#{item_formulaId,jdbcType=DOUBLE},
|
||||
#{item_description,jdbcType=VARCHAR},
|
||||
#{item_canEdit,jdbcType=INTEGER},
|
||||
#{item_createTime,jdbcType=DATE},
|
||||
#{item_updateTime,jdbcType=DATE},
|
||||
#{item_creator,jdbcType=DOUBLE},
|
||||
0,
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.dataType,jdbcType=VARCHAR},
|
||||
#{item.sharedType,jdbcType=INTEGER},
|
||||
#{item.taxAgentIds,jdbcType=VARCHAR}
|
||||
#{item_tenantKey,jdbcType=VARCHAR},
|
||||
#{item_dataType,jdbcType=VARCHAR},
|
||||
#{item_sharedType,jdbcType=INTEGER},
|
||||
#{item_taxAgentIds,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -453,12 +456,12 @@
|
|||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key, data_type, shared_type, tax_agent_ids)
|
||||
VALUES
|
||||
(#{item.id},#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey}, #{item.dataType},
|
||||
#{item.sharedType}, #{item.taxAgentIds})
|
||||
(#{item_id},#{item_name}, #{item_code}, #{item_systemType}, #{item_sysSalaryItemId},
|
||||
#{item_useDefault}, #{item_useInEmployeeSalary}, #{item_roundingMode},
|
||||
#{item_pattern},
|
||||
#{item_valueType}, #{item_formulaId}, #{item_description}, #{item_canEdit},
|
||||
#{item_createTime}, #{item_updateTime}, #{item_creator}, 0, #{item_tenantKey}, #{item_dataType},
|
||||
#{item_sharedType}, #{item_taxAgentIds})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
|
@ -476,8 +479,8 @@
|
|||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="sorted_index =case" suffix="end,">
|
||||
<foreach collection="collection" item="item" index="index">
|
||||
<if test="item.sortedIndex!=null">
|
||||
when id=#{item.id} then #{item.sortedIndex}
|
||||
<if test="item_sortedIndex!=null">
|
||||
when id=#{item_id} then #{item_sortedIndex}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
|
|
@ -485,7 +488,7 @@
|
|||
where
|
||||
id in
|
||||
<foreach collection="collection" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
#{item_id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
|
@ -582,5 +585,71 @@
|
|||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_item t
|
||||
WHERE name = #{name} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="getByCode" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_item t
|
||||
WHERE code = #{code} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="configResultMap" type="com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig">
|
||||
<result column="name" property="name"/>
|
||||
<result column="use_default" property="useDefault"/>
|
||||
<result column="hide_default" property="hideDefault"/>
|
||||
<result column="data_type" property="dataType"/>
|
||||
<result column="rounding_mode" property="roundingMode"/>
|
||||
<result column="pattern" property="pattern"/>
|
||||
<result column="value_type" property="valueType"/>
|
||||
<result column="formula" property="formula"/>
|
||||
<result column="extend_param" property="extendParam"/>
|
||||
<result column="sorted_index" property="sortedIndex"/>
|
||||
<result column="width" property="width"/>
|
||||
<result column="default_value" property="defaultValue"/>
|
||||
<result column="description" property="description"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="itemColumns">
|
||||
item.name as name
|
||||
, item.use_default as use_default
|
||||
, item.hide_default as hide_default
|
||||
, item.data_type as data_type
|
||||
, item.rounding_mode as rounding_mode
|
||||
, item.pattern as pattern
|
||||
, item.value_type as value_type
|
||||
, f.formula as formula
|
||||
, f.extend_param as extend_param
|
||||
, item.sorted_index as sorted_index
|
||||
, item.width as width
|
||||
, item.default_value as default_value
|
||||
, item.description as description
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="getConfig" resultMap="configResultMap">
|
||||
select
|
||||
<include refid="itemColumns"/>
|
||||
from hrsa_salary_item item
|
||||
left join hrsa_formula f on item.formula_id = f.id
|
||||
where item.delete_type=0
|
||||
and item.use_in_employee_salary = 0
|
||||
and item.system_type = 0
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND item.id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -53,4 +53,5 @@ public interface SalarySobMapper {
|
|||
List<SalarySobPO> listByParam(@Param("param") SalarySobPO SalarySobPO);
|
||||
|
||||
List<SalarySobPO> listByName(SalarySobPO build);
|
||||
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@
|
|||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobPO" databaseId="oracle">
|
||||
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select hrsa_salary_sob_id.currval from dual
|
||||
</selectKey>
|
||||
|
||||
|
|
@ -446,7 +446,7 @@
|
|||
<update id="deleteByIds">
|
||||
UPDATE hrsa_salary_sob
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
|
|
@ -454,7 +454,6 @@
|
|||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="listByParam" resultType="com.engine.salary.entity.salarysob.po.SalarySobPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.mapper.taxagent;
|
||||
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
|
|
@ -69,4 +70,6 @@ public interface TaxAgentMapper {
|
|||
|
||||
List<TaxAgentEmployeePO> listEmployee();
|
||||
|
||||
List<TaxAgentConfig> getAllConfig();
|
||||
|
||||
}
|
||||
|
|
@ -263,5 +263,19 @@
|
|||
where e.status not in (7)
|
||||
</select>
|
||||
|
||||
<resultMap id="configResultMap" type="com.engine.salary.entity.taxagent.config.TaxAgentConfig">
|
||||
<result column="description" property="description"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="sorted_index" property="sortedIndex"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getAllConfig" resultMap="configResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from hrsa_tax_agent t
|
||||
where t.delete_type=0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.component.WeaTableColumnGroup;
|
|||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctImportFieldDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.util.excel.ExcelPreviewDTO;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -113,7 +114,7 @@ public interface SalaryAcctExcelService {
|
|||
|
||||
Map<String, Object> preview(SalaryAcctImportParam param);
|
||||
|
||||
Map<String, Object> previewImportSalaryAcctResult(SalaryAcctImportParam param);
|
||||
ExcelPreviewDTO previewImportSalaryAcctResult(SalaryAcctImportParam param);
|
||||
|
||||
|
||||
void cacheImportField(List<Long> salaryItems);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemSaveParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustBeforeParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
|
|
@ -156,4 +158,9 @@ public interface SalaryArchiveItemService {
|
|||
* @date 2022/11/14 13:38
|
||||
*/
|
||||
String editSingleSalaryItem(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam);
|
||||
|
||||
|
||||
ArchiveFieldConfig getConfig();
|
||||
|
||||
UploadConfigResponse.Result parseConfig(ArchiveFieldConfig config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaMockParam;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
|
|
@ -55,5 +56,13 @@ public interface SalaryFormulaService {
|
|||
|
||||
List<FormulaPO> listByIds(List<Long> formulaIds);
|
||||
|
||||
List<FormulaPO> listAll();
|
||||
|
||||
List<FormulaVar> listAllVar();
|
||||
|
||||
void update(FormulaPO formulaPO);
|
||||
|
||||
FormluaConfig getConfig();
|
||||
|
||||
Long add(FormulaPO formula);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SyncSalaryItemParam;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig;
|
||||
import com.engine.salary.entity.salaryitem.param.*;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.excel.ImportExcelResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -61,6 +64,8 @@ public interface SalaryItemService {
|
|||
* @return
|
||||
*/
|
||||
List<SalaryItemPO> listByName(String name);
|
||||
SalaryItemPO getByName(String name);
|
||||
|
||||
|
||||
/**
|
||||
* 根据(自定义薪资项目/系统薪资项目)查询薪资项目
|
||||
|
|
@ -147,4 +152,22 @@ public interface SalaryItemService {
|
|||
* @param syncSalaryItemParam
|
||||
*/
|
||||
void syncSalaryItemToSalarySobItem(SyncSalaryItemParam syncSalaryItemParam);
|
||||
|
||||
SalaryItemAllConfig getConfig();
|
||||
|
||||
UploadConfigResponse.Result parseConfig(SalaryItemAllConfig salaryItemConfig);
|
||||
|
||||
SalaryItemPO getItem(SalaryItemPO salaryItemPO);
|
||||
|
||||
List<SalaryItemExcelConfig> getConfig(SalaryItemExportParam param);
|
||||
|
||||
|
||||
Map<String, Object> preview(SalaryItemImportParam param);
|
||||
|
||||
ImportExcelResponse importSalaryItem(SalaryItemImportParam param);
|
||||
|
||||
XSSFWorkbook export(SalaryItemExportParam param);
|
||||
|
||||
XSSFWorkbook downloadTemplate(SalaryItemDownloadTemplateParam param);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,7 @@ public interface SalarySobBackItemService {
|
|||
int deleteBySalarySobIds(Collection<Long> salarySobIds);
|
||||
|
||||
List<SalarySobBackItemPO> listBySalaryItemIds(Collection<Long> salaryItemIds);
|
||||
|
||||
List<SalarySobBackItemPO> getConfig(Long salarySobId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,6 @@ public interface SalarySobItemGroupService {
|
|||
* @param salarySobIds 薪资账套id
|
||||
*/
|
||||
void deleteBySalarySobIds(Collection<Long> salarySobIds);
|
||||
|
||||
List<SalarySobItemGroupPO> getConfig(Long salarySobId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,4 +126,6 @@ public interface SalarySobItemService {
|
|||
SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param);
|
||||
|
||||
void update(SalarySobItemPO po);
|
||||
|
||||
List<SalarySobItemPO> getConfig(Long salarySobId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salarysob.config.SalarySobConfig;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobDisableParam;
|
||||
|
|
@ -7,6 +8,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobDuplicateParam;
|
|||
import com.engine.salary.entity.salarysob.param.SalarySobListQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.time.YearMonth;
|
||||
|
|
@ -156,4 +158,8 @@ public interface SalarySobService {
|
|||
* @return
|
||||
*/
|
||||
List<SalarySobPO> listByTaxAgentIds(Collection<Long> taxAgentIds);
|
||||
|
||||
List<SalarySobConfig> getConfig(Long taxAgentId);
|
||||
|
||||
List<UploadConfigResponse.Result> parseConfig(Long taxAgentId, List<SalarySobConfig> salarySobConfigs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.service;
|
|||
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentSaveBaseParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人基础信息
|
||||
|
|
@ -34,4 +35,8 @@ public interface TaxAgentBaseService {
|
|||
* @return
|
||||
*/
|
||||
String save(TaxAgentSaveBaseParam saveBaseParam);
|
||||
|
||||
TaxAgentBasePO getConfig();
|
||||
|
||||
UploadConfigResponse.Result parseConfig(TaxAgentBasePO config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
||||
|
|
@ -11,6 +12,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentRoleTypeEnum;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -265,4 +267,8 @@ public interface TaxAgentService {
|
|||
* @return
|
||||
*/
|
||||
Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId);
|
||||
|
||||
List<TaxAgentConfig> getConfig();
|
||||
|
||||
List<UploadConfigResponse.Result> parseConfig(List<TaxAgentConfig> configs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
|||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelPreviewDTO;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -63,7 +64,9 @@ import org.apache.commons.collections4.ListUtils;
|
|||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -985,7 +988,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> previewImportSalaryAcctResult(SalaryAcctImportParam param) {
|
||||
public ExcelPreviewDTO previewImportSalaryAcctResult(SalaryAcctImportParam param) {
|
||||
|
||||
//1、参数校验
|
||||
ValidUtil.doValidator(param);
|
||||
|
|
@ -995,11 +998,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
map.put("headers", ExcelSupport.getSheetHeader(sheet, 1));
|
||||
map.put("list", ExcelParseHelper.parse2List(sheet, 2, 1));
|
||||
return map;
|
||||
|
||||
Workbook workbook = ExcelSupport.parseFile(fileInputStream, EXCEL_TYPE_XLSX);
|
||||
// 创建一个公式求值器对象
|
||||
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
return ExcelPreviewDTO.builder()
|
||||
.headers(ExcelSupport.getSheetHeader(sheet, 1))
|
||||
.list(ExcelParseHelper.parse2List(sheet, evaluator, 2, 1)).build();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
|
|
@ -1074,7 +1079,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
Workbook workbook = ExcelSupport.parseFile(fileInputStream, EXCEL_TYPE_XLSX);
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
|
||||
// 错误提示信息
|
||||
|
|
@ -1094,7 +1100,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
// List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
List<Map<String, Object>> data;
|
||||
// if (StringUtils.equals("importSalaryAcctResult", importType)) {
|
||||
data = ExcelParseHelper.parse2Map(sheet, 2, 1);
|
||||
data = ExcelParseHelper.parse2Map(workbook, 0, 2, 1);
|
||||
// } else {
|
||||
// data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalaryArchiveBiz;
|
||||
|
|
@ -8,10 +10,12 @@ import com.engine.salary.biz.SalaryItemBiz;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.*;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
|
|
@ -20,17 +24,20 @@ import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
|
|||
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalaryArchiveItemService;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
|
||||
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.SalaryLoggerUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
|
@ -49,12 +56,22 @@ import java.util.stream.Collectors;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchiveItemService {
|
||||
|
||||
private SalaryArchiveBiz salaryArchiveMapper = new SalaryArchiveBiz();
|
||||
private SalaryItemBiz salaryItemMapper = new SalaryItemBiz();
|
||||
private SalaryArchiveItemBiz salaryArchiveItemMapper = new SalaryArchiveItemBiz();
|
||||
|
||||
private SalaryArchiveItemMapper getSalaryArchiveItemMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryArchiveItemMapper.class);
|
||||
}
|
||||
|
||||
private SalaryItemMapper getSalaryItemMapper() {
|
||||
return SqlProxyHandle.getProxy(SalaryItemMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SalaryArchiveItemPO getById(Long salaryArchiveItemId) {
|
||||
return salaryArchiveItemMapper.getById(salaryArchiveItemId);
|
||||
|
|
@ -68,6 +85,10 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -75,6 +96,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未生效 lt
|
||||
*
|
||||
|
|
@ -262,11 +284,12 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
salaryArchiveItem,
|
||||
saiNew,
|
||||
user
|
||||
);
|
||||
);
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return null
|
||||
* @description 构建薪资档案中调薪的更新PO
|
||||
|
|
@ -726,4 +749,62 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArchiveFieldConfig getConfig() {
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listByParam(SalaryItemSearchParam.builder().useInEmployeeSalary(1).build());
|
||||
return ArchiveFieldConfig.builder().salaryItems(salaryItemPOList).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadConfigResponse.Result parseConfig(ArchiveFieldConfig config) {
|
||||
UploadConfigResponse.Result result = UploadConfigResponse.Result.builder()
|
||||
.message("档案字段加载完毕")
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
long uid = user.getUID();
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Map<String, SalaryItemPO> nameMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getName);
|
||||
Map<String, SalaryItemPO> codeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getCode);
|
||||
Optional.ofNullable(config.getSalaryItems())
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(itemPO -> {
|
||||
try {
|
||||
|
||||
|
||||
if (nameMap.containsKey(itemPO.getName())) {
|
||||
SalaryItemPO salaryItemPO = nameMap.get(itemPO.getName());
|
||||
if (!StrUtil.equals(salaryItemPO.getCode(), itemPO.getCode())) {
|
||||
result.getWarning().add(String.format("警告,档案字段[%s]名称已存在,但项目code不一致,迁入code:%s,当前系统code:%s", itemPO.getName(), itemPO.getCode(), salaryItemPO.getCode()));
|
||||
}
|
||||
itemPO.setId(salaryItemPO.getId());
|
||||
//不许修改code
|
||||
itemPO.setCode(null);
|
||||
itemPO.setCreator(uid);
|
||||
getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
} else if (codeMap.containsKey(itemPO.getCode())) {
|
||||
SalaryItemPO salaryItemPO = codeMap.get(itemPO.getCode());
|
||||
if (!StrUtil.equals(salaryItemPO.getName(), itemPO.getName())) {
|
||||
result.getWarning().add(String.format("警告,档案字段[%s]code已存在,但项目code不一致,迁入名称:%s,当前系统名称:%s", itemPO.getName(), itemPO.getName(), salaryItemPO.getName()));
|
||||
}
|
||||
itemPO.setId(salaryItemPO.getId());
|
||||
//不许修改名字
|
||||
itemPO.setName(null);
|
||||
itemPO.setCreator(uid);
|
||||
getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
} else {
|
||||
itemPO.setId(IdGenerator.generate());
|
||||
getSalaryItemMapper().insertIgnoreNull(itemPO);
|
||||
}
|
||||
result.getSuccess().add(String.format("成功,薪资项目[%s]加载成功", itemPO.getName()));
|
||||
} catch (Exception e) {
|
||||
log.error("{}字段加载异常,", itemPO.getName(), e);
|
||||
result.getError().add(String.format("错误,档案字段[%s]加载异常,%s", itemPO.getName(), e.getMessage()));
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaMockParam;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
|
|
@ -19,10 +21,10 @@ import com.engine.salary.service.FormulaRunService;
|
|||
import com.engine.salary.service.RemoteExcelService;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -396,9 +398,53 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
|
|||
return getFormulaMapper().listByIds(formulaIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FormulaPO> listAll() {
|
||||
return getFormulaMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FormulaVar> listAllVar() {
|
||||
return getFormulaVarMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(FormulaPO formulaPO) {
|
||||
getFormulaMapper().updateIgnoreNull(formulaPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FormluaConfig getConfig() {
|
||||
List<FormulaPO> formulaPOS = getFormulaMapper().listAll();
|
||||
List<FormulaVar> formulaVars = getFormulaVarMapper().listAll();
|
||||
return FormluaConfig.builder().formulas(formulaPOS).formulaVars(formulaVars).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long add(FormulaPO formula) {
|
||||
if (formula == null) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
long uid = user.getUID();
|
||||
Date now = new Date();
|
||||
long formulaId = IdGenerator.generate();
|
||||
formula.setId(formulaId);
|
||||
formula.setCreator(uid);
|
||||
formula.setCreateTime(now);
|
||||
|
||||
getFormulaMapper().insertIgnoreNull(formula);
|
||||
|
||||
List<FormulaVar> formulaVars = formula.getFormulaVars();
|
||||
if (CollectionUtil.isNotEmpty(formulaVars)) {
|
||||
formulaVars.forEach(v -> {
|
||||
v.setId(IdGenerator.generate());
|
||||
v.setFormulaId(formulaId);
|
||||
v.setCreator(uid);
|
||||
v.setCreateTime(now);
|
||||
getFormulaVarMapper().insertIgnoreNull(v);
|
||||
});
|
||||
}
|
||||
return formulaId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +1,70 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.biz.SalaryItemBiz;
|
||||
import com.engine.salary.biz.SysSalaryItemBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SyncSalaryItemParam;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig;
|
||||
import com.engine.salary.entity.salaryitem.param.*;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.*;
|
||||
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
|
||||
import com.engine.salary.enums.salaryformula.ReturnTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.SharedTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.excel.ImportExcelResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.general.Util;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* 薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -50,6 +73,7 @@ import java.util.stream.Collectors;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalaryItemServiceImpl extends Service implements SalaryItemService {
|
||||
|
||||
private SalaryItemBiz salaryItemBiz = new SalaryItemBiz();
|
||||
|
|
@ -80,8 +104,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
}
|
||||
|
||||
private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz();
|
||||
// @Autowired
|
||||
// private LoggerTemplate salaryItemLoggerTemplate;
|
||||
|
||||
private SalaryItemMapper getSalaryItemMapper() {
|
||||
return SqlProxyHandle.getProxy(SalaryItemMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryItemPO getById(Long id) {
|
||||
|
|
@ -114,6 +140,12 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
return salaryItemBiz.listSome(SalaryItemPO.builder().name(name).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryItemPO getByName(String name) {
|
||||
return getSalaryItemMapper().getByName(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SalaryItemPO> listBySystemType(SalarySystemTypeEnum systemType) {
|
||||
return salaryItemBiz.listSome(SalaryItemPO.builder().systemType(systemType.getValue()).build());
|
||||
|
|
@ -465,6 +497,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
|
@ -505,4 +538,335 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
return UsingItem.builder().build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SalaryItemExcelConfig> getConfig(SalaryItemExportParam param) {
|
||||
return getSalaryItemMapper().getConfig(param.getIds());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> preview(SalaryItemImportParam param) {
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1));
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImportExcelResponse importSalaryItem(SalaryItemImportParam param) {
|
||||
|
||||
Date now = new Date();
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
List<SalaryItemExcelConfig> configs = ExcelParseHelper.parse2Map(fileInputStream, SalaryItemExcelConfig.class, 0, 1, 13, EXCEL_TYPE_XLSX);
|
||||
|
||||
// 错误excel内容
|
||||
ImportExcelResponse response = ImportExcelResponse.builder().totalCount(configs.size()).successCount(configs.size()).errorCount(0).errorData(new ArrayList<>()).build();
|
||||
|
||||
List<SysSalaryItemPO> sysSalaryItemPOS = sysSalaryItemBiz.listAll();
|
||||
Set<String> sysItems = SalaryEntityUtil.properties(sysSalaryItemPOS, SysSalaryItemPO::getName);
|
||||
|
||||
List<SalaryItemPO> adds = new ArrayList<>();
|
||||
List<SalaryItemPO> updates = new ArrayList<>();
|
||||
Map<Long, Map<String, String>> formulaItems = new HashMap<>();
|
||||
for (int i = 0; i < configs.size(); i++) {
|
||||
String rowIndex = String.format("第%s行", i + 2);
|
||||
SalaryItemExcelConfig config = configs.get(i);
|
||||
String name = config.getName();
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByDefaultLabel(config.getValueType());
|
||||
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByDefaultLabel(config.getDataType());
|
||||
SalaryItemPO itemPO = getByName(name);
|
||||
if (itemPO == null) {
|
||||
|
||||
if (sysItems.contains(name)) {
|
||||
ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”的名称与系统名称冲突", rowIndex, name)).build();
|
||||
response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
response.setErrorCount(response.getErrorCount() + 1);
|
||||
response.getErrorData().add(error);
|
||||
continue;
|
||||
}
|
||||
|
||||
itemPO = SalaryItemPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.code(IdGenerator.getUUID())
|
||||
.name(name)
|
||||
.systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
||||
.sysSalaryItemId(org.apache.commons.lang3.math.NumberUtils.LONG_ZERO)
|
||||
.useDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getUseDefault()).getValue())
|
||||
.useInEmployeeSalary(SalaryOnOffEnum.OFF.getValue())
|
||||
.hideDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getHideDefault()).getValue())
|
||||
.roundingMode(SalaryRoundingModeEnum.parseByDefaultLabel(config.getRoundingMode()).getValue())
|
||||
.pattern(NumberUtil.isNumber(config.getPattern()) ? Integer.parseInt(config.getPattern()) : 2)
|
||||
.valueType(salaryValueTypeEnum.getValue())
|
||||
.dataType(salaryDataTypeEnum.getValue())
|
||||
//后补
|
||||
.formulaId(0L)
|
||||
.description(config.getDescription())
|
||||
.canEdit(org.apache.commons.lang3.math.NumberUtils.INTEGER_ONE)
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(0)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.sharedType(0)
|
||||
.taxAgentIds("")
|
||||
.sortedIndex(NumberUtil.isNumber(config.getSortedIndex()) ? Integer.parseInt(config.getSortedIndex()) : null)
|
||||
.width(NumberUtil.isNumber(config.getWidth()) ? Integer.parseInt(config.getWidth()) : null)
|
||||
.defaultValue(config.getDefaultValue())
|
||||
.build();
|
||||
adds.add(itemPO);
|
||||
} else {
|
||||
|
||||
if (SalarySystemTypeEnum.parseByValue(itemPO.getSystemType()) == SalarySystemTypeEnum.SYSTEM) {
|
||||
ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”是系统薪资项目不支持修改", rowIndex, name)).build();
|
||||
response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
response.setErrorCount(response.getErrorCount() + 1);
|
||||
response.getErrorData().add(error);
|
||||
continue;
|
||||
}
|
||||
|
||||
itemPO.setUseDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getUseDefault()).getValue());
|
||||
itemPO.setHideDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getHideDefault()).getValue());
|
||||
itemPO.setRoundingMode(SalaryRoundingModeEnum.parseByDefaultLabel(config.getRoundingMode()).getValue());
|
||||
itemPO.setPattern(NumberUtil.isNumber(config.getPattern()) ? Integer.parseInt(config.getPattern()) : 2);
|
||||
itemPO.setValueType(salaryValueTypeEnum.getValue());
|
||||
itemPO.setDataType(salaryDataTypeEnum.getValue());
|
||||
//后补
|
||||
itemPO.setFormulaId(0L);
|
||||
itemPO.setDescription(config.getDescription());
|
||||
itemPO.setUpdateTime(now);
|
||||
itemPO.setSortedIndex(NumberUtil.isNumber(config.getSortedIndex()) ? Integer.parseInt(config.getSortedIndex()) : null);
|
||||
itemPO.setWidth(NumberUtil.isNumber(config.getWidth()) ? Integer.parseInt(config.getWidth()) : null);
|
||||
itemPO.setDefaultValue(config.getDefaultValue());
|
||||
updates.add(itemPO);
|
||||
}
|
||||
|
||||
//解析公式
|
||||
if (salaryValueTypeEnum == SalaryValueTypeEnum.FORMULA || salaryValueTypeEnum == SalaryValueTypeEnum.SQL) {
|
||||
Long id = itemPO.getId();
|
||||
String formula = config.getFormula();
|
||||
String sqlReturnKey = config.getExtendParam();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("rowIndex", rowIndex);
|
||||
map.put("formula", formula);
|
||||
map.put("sqlReturnKey", sqlReturnKey);
|
||||
formulaItems.put(id, map);
|
||||
}
|
||||
}
|
||||
|
||||
adds.forEach(getSalaryItemMapper()::insertIgnoreNull);
|
||||
updates.forEach(getSalaryItemMapper()::updateIgnoreNull);
|
||||
|
||||
for (Long id : formulaItems.keySet()) {
|
||||
SalaryItemPO itemPO = getById(id);
|
||||
Map<String, String> map = formulaItems.get(id);
|
||||
String rowIndex = map.get("rowIndex");
|
||||
String formula = map.get("formula");
|
||||
String sqlReturnKey = map.get("sqlReturnKey");
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(itemPO.getValueType());
|
||||
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(itemPO.getDataType());
|
||||
SalaryFormulaSaveParam saveParam = SalaryFormulaSaveParam.builder()
|
||||
.name(itemPO.getName())
|
||||
.module("salary")
|
||||
.useFor("salaryitem")
|
||||
.referenceType(salaryValueTypeEnum == SalaryValueTypeEnum.FORMULA ? ReferenceTypeEnum.FORMULA.getValue() : ReferenceTypeEnum.SQL.getValue())
|
||||
.returnType(salaryDataTypeEnum == SalaryDataTypeEnum.STRING ? ReturnTypeEnum.STRING.getValue() : ReturnTypeEnum.NUMBER.getValue())
|
||||
.validateType(salaryDataTypeEnum == SalaryDataTypeEnum.STRING ? ReturnTypeEnum.STRING.getValue() : ReturnTypeEnum.NUMBER.getValue())
|
||||
.extendParam("{\"isCustomFunction\":\"0\",\"sqlReturnKey\":\"" + sqlReturnKey + "\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}")
|
||||
.formula(formula)
|
||||
.build();
|
||||
|
||||
try {
|
||||
FormulaPO formulaPO = getSalaryFormulaService(user).save(saveParam);
|
||||
itemPO.setFormulaId(formulaPO.getId());
|
||||
getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
} catch (Exception e) {
|
||||
ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”的公式设置有误:%s", rowIndex, itemPO.getName(), e.getMessage())).build();
|
||||
response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
response.setErrorCount(response.getErrorCount() + 1);
|
||||
response.getErrorData().add(error);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook export(SalaryItemExportParam param) {
|
||||
|
||||
List<Object> titles = Lists.newArrayList();
|
||||
List<String> dataIndexList = Lists.newArrayList();
|
||||
ExcelUtil.parseHeader(SalaryItemExcelConfig.class, titles, dataIndexList);
|
||||
|
||||
List<SalaryItemExcelConfig> configs = getConfig(param);
|
||||
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(titles);
|
||||
configs.forEach(e -> {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(e.getName());
|
||||
row.add(e.getUseDefault() == null ? "否" : SalaryOnOffEnum.parseByValue(Integer.parseInt(e.getUseDefault())).getDefaultLabel());
|
||||
row.add(e.getHideDefault() == null ? "否" : SalaryOnOffEnum.parseByValue(Integer.parseInt(e.getHideDefault())).getDefaultLabel());
|
||||
row.add(SalaryDataTypeEnum.parseByValue(Util.null2String(e.getDataType())).getDefaultLabel());
|
||||
row.add(e.getRoundingMode() == null ? "四舍五入" : SalaryRoundingModeEnum.parseByValue(Integer.parseInt(e.getRoundingMode())).getDefaultLabel());
|
||||
row.add(e.getPattern() == null ? "2" : e.getPattern());
|
||||
row.add(e.getValueType() == null ? "输入" : SalaryValueTypeEnum.parseByValue(Integer.parseInt(e.getValueType())).getDefaultLabel());
|
||||
row.add(e.getFormula() == null ? "" : e.getFormula());
|
||||
String sqlReturnKey = "";
|
||||
if (e.getExtendParam() != null) {
|
||||
sqlReturnKey = JsonUtil.parseMap(Util.null2String(e.getExtendParam()), String.class).getOrDefault("sqlReturnKey", "");
|
||||
if ("null".equals(sqlReturnKey)) {
|
||||
sqlReturnKey = "";
|
||||
}
|
||||
}
|
||||
row.add(sqlReturnKey);
|
||||
row.add(e.getSortedIndex() == null ? "" : e.getSortedIndex());
|
||||
row.add(e.getWidth() == null ? "" : e.getWidth());
|
||||
row.add(e.getDefaultValue() == null ? "" : e.getDefaultValue());
|
||||
row.add(e.getDescription() == null ? "" : e.getDescription());
|
||||
rows.add(row);
|
||||
});
|
||||
|
||||
return ExcelUtil.genWorkbookV2(rows, "薪资项目");
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook downloadTemplate(SalaryItemDownloadTemplateParam param) {
|
||||
List<Object> titles = Lists.newArrayList();
|
||||
List<String> dataIndexList = Lists.newArrayList();
|
||||
ExcelUtil.parseHeader(SalaryItemExcelConfig.class, titles, dataIndexList);
|
||||
|
||||
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(titles);
|
||||
if (param.isHasData()) {
|
||||
List<SalaryItemExcelConfig> configs = getConfig(SalaryItemExportParam.builder().build());
|
||||
configs.forEach(e -> {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(e.getName());
|
||||
row.add(e.getUseDefault() == null ? "否" : SalaryOnOffEnum.parseByValue(Integer.parseInt(e.getUseDefault())).getDefaultLabel());
|
||||
row.add(e.getHideDefault() == null ? "否" : SalaryOnOffEnum.parseByValue(Integer.parseInt(e.getHideDefault())).getDefaultLabel());
|
||||
row.add(SalaryDataTypeEnum.parseByValue(Util.null2String(e.getDataType())).getDefaultLabel());
|
||||
row.add(e.getRoundingMode() == null ? "四舍五入" : SalaryRoundingModeEnum.parseByValue(Integer.parseInt(e.getRoundingMode())).getDefaultLabel());
|
||||
row.add(e.getPattern() == null ? "2" : e.getPattern());
|
||||
row.add(e.getValueType() == null ? "输入" : SalaryValueTypeEnum.parseByValue(Integer.parseInt(e.getValueType())).getDefaultLabel());
|
||||
row.add(e.getFormula() == null ? "" : e.getFormula());
|
||||
String sqlReturnKey = "";
|
||||
if (e.getExtendParam() != null) {
|
||||
sqlReturnKey = JsonUtil.parseMap(Util.null2String(e.getExtendParam()), String.class).getOrDefault("sqlReturnKey", "");
|
||||
if ("null".equals(sqlReturnKey)) {
|
||||
sqlReturnKey = "";
|
||||
}
|
||||
}
|
||||
row.add(sqlReturnKey);
|
||||
row.add(e.getSortedIndex() == null ? "" : e.getSortedIndex());
|
||||
row.add(e.getWidth() == null ? "" : e.getWidth());
|
||||
row.add(e.getDefaultValue() == null ? "" : e.getDefaultValue());
|
||||
row.add(e.getDescription() == null ? "" : e.getDescription());
|
||||
rows.add(row);
|
||||
});
|
||||
}
|
||||
return ExcelUtil.genWorkbookV2(rows, "薪资项目");
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryItemAllConfig getConfig() {
|
||||
List<SalaryItemPO> salaryItemPOList = listByParam(SalaryItemSearchParam.builder().useInEmployeeSalary(0).build());
|
||||
List<FormulaPO> formulaPOS = getSalaryFormulaService(user).listAll();
|
||||
Map<Long, FormulaPO> formulaMap = SalaryEntityUtil.convert2Map(formulaPOS, FormulaPO::getId);
|
||||
List<FormulaVar> formulaVars = getSalaryFormulaService(user).listAllVar();
|
||||
Map<Long, List<FormulaVar>> varListMap = SalaryEntityUtil.group2Map(formulaVars, FormulaVar::getFormulaId);
|
||||
|
||||
salaryItemPOList.forEach(itemPO -> {
|
||||
if (itemPO.getFormulaId() != null) {
|
||||
FormulaPO formulaPO = formulaMap.get(itemPO.getFormulaId());
|
||||
if (formulaPO != null) {
|
||||
formulaPO.setFormulaVars(varListMap.get(itemPO.getFormulaId()));
|
||||
itemPO.setFormula(formulaPO);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return SalaryItemAllConfig.builder().salaryItems(salaryItemPOList).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadConfigResponse.Result parseConfig(SalaryItemAllConfig salaryItemConfig) {
|
||||
UploadConfigResponse.Result result = UploadConfigResponse.Result.builder()
|
||||
.message("薪资项目加载完毕")
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
List<SalaryItemPO> salaryItemPOList = listAll();
|
||||
Map<String, SalaryItemPO> nameMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getName);
|
||||
Map<String, SalaryItemPO> codeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getCode);
|
||||
|
||||
Optional.ofNullable(salaryItemConfig.getSalaryItems())
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(itemPO -> {
|
||||
try {
|
||||
add(itemPO, nameMap, codeMap, result);
|
||||
} catch (Exception e) {
|
||||
log.error("{}项目加载异常,", itemPO.getName(), e);
|
||||
result.getError().add(String.format("错误,薪资项目[%s]加载异常,%s", itemPO.getName(), e.getMessage()));
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryItemPO getItem(SalaryItemPO salaryItemPO) {
|
||||
SalaryItemPO po = getByName(salaryItemPO.getName());
|
||||
if (po == null) {
|
||||
po = getSalaryItemMapper().getByCode(salaryItemPO.getCode());
|
||||
}
|
||||
return po;
|
||||
}
|
||||
|
||||
|
||||
private Long add(SalaryItemPO itemPO, Map<String, SalaryItemPO> nameMap, Map<String, SalaryItemPO> codeMap, UploadConfigResponse.Result result) {
|
||||
long uid = user.getUID();
|
||||
Long formulaId = getSalaryFormulaService(user).add(itemPO.getFormula());
|
||||
itemPO.setFormulaId(formulaId);
|
||||
|
||||
if (nameMap.containsKey(itemPO.getName())) {
|
||||
SalaryItemPO salaryItemPO = nameMap.get(itemPO.getName());
|
||||
if (!StrUtil.equals(salaryItemPO.getCode(), itemPO.getCode())) {
|
||||
result.getWarning().add(String.format("警告,薪资项目[%s]名称已存在,但项目code不一致,迁入code:%s,当前系统code:%s", itemPO.getName(), itemPO.getCode(), salaryItemPO.getCode()));
|
||||
}
|
||||
itemPO.setId(salaryItemPO.getId());
|
||||
//不许修改code
|
||||
itemPO.setCode(null);
|
||||
itemPO.setCreator(uid);
|
||||
getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
} else if (codeMap.containsKey(itemPO.getCode())) {
|
||||
SalaryItemPO salaryItemPO = codeMap.get(itemPO.getCode());
|
||||
if (!StrUtil.equals(salaryItemPO.getName(), itemPO.getName())) {
|
||||
result.getWarning().add(String.format("警告,薪资项目[%s]code已存在,但项目code不一致,迁入名称:%s,当前系统名称:%s", itemPO.getName(), itemPO.getName(), salaryItemPO.getName()));
|
||||
}
|
||||
itemPO.setId(salaryItemPO.getId());
|
||||
//不许修改名字
|
||||
itemPO.setName(null);
|
||||
itemPO.setCreator(uid);
|
||||
getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
} else {
|
||||
itemPO.setId(IdGenerator.generate());
|
||||
getSalaryItemMapper().insertIgnoreNull(itemPO);
|
||||
}
|
||||
result.getSuccess().add(String.format("成功,薪资项目[%s]加载成功", itemPO.getName()));
|
||||
|
||||
return itemPO.getId();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobBackItemBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobBackItemDTO;
|
||||
|
|
@ -17,6 +21,7 @@ import com.engine.salary.service.SalaryItemService;
|
|||
import com.engine.salary.service.SalarySobBackItemService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
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;
|
||||
|
|
@ -24,10 +29,7 @@ import org.apache.commons.lang3.math.NumberUtils;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
|
|
@ -117,4 +119,36 @@ public class SalarySobBackItemServiceImpl extends Service implements SalarySobBa
|
|||
return getSalarySobBackItemMapper().listSome(SalarySobBackItemPO.builder().salaryItemIds(salaryItemIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobBackItemPO> getConfig(Long salarySobId) {
|
||||
List<SalarySobBackItemPO> salarySobBackItemPOS = listBySalarySobId(salarySobId);
|
||||
if (CollectionUtil.isNotEmpty(salarySobBackItemPOS)) {
|
||||
FormluaConfig config = getSalaryFormulaService(user).getConfig();
|
||||
List<FormulaPO> formulaPOS = config.getFormulas();
|
||||
Map<Long, FormulaPO> formulaMap = SalaryEntityUtil.convert2Map(formulaPOS, FormulaPO::getId);
|
||||
List<FormulaVar> formulaVars = config.getFormulaVars();
|
||||
Map<Long, List<FormulaVar>> varListMap = SalaryEntityUtil.group2Map(formulaVars, FormulaVar::getFormulaId);
|
||||
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listAll();
|
||||
Map<Long, SalaryItemPO> itemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
|
||||
salarySobBackItemPOS.forEach(po -> {
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(po.getFormulaId())) {
|
||||
FormulaPO formulaPO = formulaMap.get(po.getFormulaId());
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(formulaPO)) {
|
||||
List<FormulaVar> formulaVarList = varListMap.getOrDefault(formulaPO.getId(), new ArrayList<>());
|
||||
formulaPO.setFormulaVars(formulaVarList);
|
||||
}
|
||||
po.setFormula(formulaPO);
|
||||
}
|
||||
if(SalaryEntityUtil.isNotNullOrEmpty(po.getSalaryItemId())){
|
||||
SalaryItemPO salaryItemPO = itemIdMap.get(po.getSalaryItemId());
|
||||
po.setSalaryItem(salaryItemPO);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
return salarySobBackItemPOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,26 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobItemGroupBiz;
|
||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobItemGroupService;
|
||||
import com.engine.salary.service.SalarySobItemService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资账套中的薪资项目分类
|
||||
|
|
@ -20,6 +34,19 @@ public class SalarySobItemGroupServiceImpl extends Service implements SalarySobI
|
|||
|
||||
private SalarySobItemGroupBiz salarySobItemGroupMapper = new SalarySobItemGroupBiz();
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SalarySobItemGroupPO getById(Long id) {
|
||||
return salarySobItemGroupMapper.getById(id);
|
||||
|
|
@ -39,4 +66,44 @@ public class SalarySobItemGroupServiceImpl extends Service implements SalarySobI
|
|||
public void deleteBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
salarySobItemGroupMapper.deleteBySalarySobIds(salarySobIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobItemGroupPO> getConfig(Long salarySobId) {
|
||||
List<SalarySobItemGroupPO> salarySobItemGroupPOS = salarySobItemGroupMapper.listSome(SalarySobItemGroupPO.builder().salarySobId(salarySobId).build());
|
||||
if (CollectionUtil.isNotEmpty(salarySobItemGroupPOS)) {
|
||||
List<SalarySobItemPO> sobItemPOS = getSalarySobItemService(user).listBySalarySobId(salarySobId);
|
||||
Map<Long, List<SalarySobItemPO>> itemListMap = SalaryEntityUtil.group2Map(sobItemPOS, SalarySobItemPO::getSalarySobItemGroupId);
|
||||
|
||||
FormluaConfig config = getSalaryFormulaService(user).getConfig();
|
||||
List<FormulaPO> formulaPOS = config.getFormulas();
|
||||
Map<Long, FormulaPO> formulaMap = SalaryEntityUtil.convert2Map(formulaPOS, FormulaPO::getId);
|
||||
List<FormulaVar> formulaVars = config.getFormulaVars();
|
||||
Map<Long, List<FormulaVar>> varListMap = SalaryEntityUtil.group2Map(formulaVars, FormulaVar::getFormulaId);
|
||||
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listAll();
|
||||
Map<Long, SalaryItemPO> itemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
|
||||
|
||||
salarySobItemGroupPOS.forEach(salarySobItemGroupPO -> {
|
||||
List<SalarySobItemPO> salarySobItemPOS = itemListMap.getOrDefault(salarySobItemGroupPO.getId(), new ArrayList<>());
|
||||
salarySobItemPOS.forEach(po -> {
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(po.getFormulaId())) {
|
||||
FormulaPO formulaPO = formulaMap.get(po.getFormulaId());
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(formulaPO)) {
|
||||
List<FormulaVar> formulaVarList = varListMap.getOrDefault(formulaPO.getId(), new ArrayList<>());
|
||||
formulaPO.setFormulaVars(formulaVarList);
|
||||
}
|
||||
po.setFormula(formulaPO);
|
||||
}
|
||||
if(SalaryEntityUtil.isNotNullOrEmpty(po.getSalaryItemId())){
|
||||
SalaryItemPO salaryItemPO = itemIdMap.get(po.getSalaryItemId());
|
||||
po.setSalaryItem(salaryItemPO);
|
||||
}
|
||||
});
|
||||
salarySobItemGroupPO.setSalarySobItems(salarySobItemPOS);
|
||||
});
|
||||
}
|
||||
|
||||
return salarySobItemGroupPOS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,13 @@ import com.engine.salary.config.SalaryElogConfig;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig;
|
||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
|
|
@ -530,6 +536,37 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
salarySobItemMapper.update(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobItemPO> getConfig(Long salarySobId) {
|
||||
List<SalarySobItemPO> salarySobItemPOS = salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).salarySobItemGroupId(0L).build());
|
||||
if (CollectionUtils.isNotEmpty(salarySobItemPOS)) {
|
||||
FormluaConfig config = getSalaryFormulaService(user).getConfig();
|
||||
List<FormulaPO> formulaPOS = config.getFormulas();
|
||||
Map<Long, FormulaPO> formulaMap = SalaryEntityUtil.convert2Map(formulaPOS, FormulaPO::getId);
|
||||
List<FormulaVar> formulaVars = config.getFormulaVars();
|
||||
Map<Long, List<FormulaVar>> varListMap = SalaryEntityUtil.group2Map(formulaVars, FormulaVar::getFormulaId);
|
||||
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listAll();
|
||||
Map<Long, SalaryItemPO> itemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
|
||||
salarySobItemPOS.forEach(salarySobItemPO -> {
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getFormulaId())) {
|
||||
FormulaPO formulaPO = formulaMap.get(salarySobItemPO.getFormulaId());
|
||||
if (SalaryEntityUtil.isNotNullOrEmpty(formulaPO)) {
|
||||
List<FormulaVar> formulaVarList = varListMap.getOrDefault(formulaPO.getId(), new ArrayList<>());
|
||||
formulaPO.setFormulaVars(formulaVarList);
|
||||
}
|
||||
salarySobItemPO.setFormula(formulaPO);
|
||||
}
|
||||
if(SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getSalaryItemId())){
|
||||
SalaryItemPO salaryItemPO = itemIdMap.get(salarySobItemPO.getSalaryItemId());
|
||||
salarySobItemPO.setSalaryItem(salaryItemPO);
|
||||
}
|
||||
});
|
||||
}
|
||||
return salarySobItemPOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param) {
|
||||
SalarySobItemFormDTO salarySobItemFormDTO = new SalarySobItemFormDTO();
|
||||
|
|
@ -584,5 +621,4 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
}
|
||||
return salarySobItemFormDTO;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
|
|
@ -12,6 +13,7 @@ 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.*;
|
||||
import com.engine.salary.entity.salarysob.config.SalarySobConfig;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.*;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
|
|
@ -28,17 +30,20 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.mapper.salarysob.SalarySobMapper;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentExtRangeMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -59,6 +64,7 @@ import java.util.stream.Collectors;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalarySobServiceImpl extends Service implements SalarySobService {
|
||||
|
||||
|
||||
|
|
@ -79,6 +85,27 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// return MapperProxyFactory.getProxy(SalarySobBackItemMapper.class);
|
||||
// }
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemGroupService getSalarySobItemGroupService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobAdjustRuleService getSalarySobAdjustRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobAdjustRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalarySobMapper getSalarySobMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobMapper.class);
|
||||
}
|
||||
|
|
@ -239,8 +266,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
return page;
|
||||
} else {
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(build);
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||
salarySobPOS, SalarySobPO.class);
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salarySobPOS, SalarySobPO.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -297,15 +323,15 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// 保存薪资账套
|
||||
salarySobMapper.insert(salarySobPO);
|
||||
// 记录日志
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套") + ": " + salarySobPO.getName());
|
||||
loggerContext.setNewValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套") + ": " + salarySobPO.getName());
|
||||
loggerContext.setNewValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
// 新建薪资账套时,保存默认的员工信息字段
|
||||
saveDefaultEmpField(salarySobPO);
|
||||
// 新建薪资账套时,保存默认的薪资项目
|
||||
|
|
@ -387,9 +413,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
SalarySobItemBO.Result result = SalarySobItemBO.initSalarySobItem(salarySobPO.getId(), salarySobDefaultItemGroupPOS, salarySobDefaultItemPOS, defaultSalaryItemPOS, (long) user.getUID(), SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItems())) {
|
||||
|
||||
List<SalarySobItemPO> list = new ArrayList<>(result.getNeedInsertSalarySobItems().stream()
|
||||
.collect(Collectors.toMap(SalarySobItemPO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue))
|
||||
.values());
|
||||
List<SalarySobItemPO> list = new ArrayList<>(result.getNeedInsertSalarySobItems().stream().collect(Collectors.toMap(SalarySobItemPO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue)).values());
|
||||
|
||||
salarySobItemService.batchInsert(list);
|
||||
}
|
||||
|
|
@ -571,18 +595,18 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
salarySobPO.setUpdateTime(new Date());
|
||||
salarySobMapper.updateById(salarySobPO);
|
||||
// 记录日志
|
||||
String operateTypeName = Objects.equals(disableParam.getDisable(), NumberUtils.INTEGER_ONE) ?
|
||||
SalaryI18nUtil.getI18nLabel(0, "禁用薪资账套") : SalaryI18nUtil.getI18nLabel(0, "启用薪资账套");
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(operateTypeName);
|
||||
loggerContext.setOperatedesc(operateTypeName + ": " + salarySobPO.getName());
|
||||
loggerContext.setOldValues(oldSalarySobPO);
|
||||
loggerContext.setNewValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
String operateTypeName = Objects.equals(disableParam.getDisable(), NumberUtils.INTEGER_ONE) ?
|
||||
SalaryI18nUtil.getI18nLabel(0, "禁用薪资账套") : SalaryI18nUtil.getI18nLabel(0, "启用薪资账套");
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(operateTypeName);
|
||||
loggerContext.setOperatedesc(operateTypeName + ": " + salarySobPO.getName());
|
||||
loggerContext.setOldValues(oldSalarySobPO);
|
||||
loggerContext.setNewValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -637,18 +661,18 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
getSalarySobBackItemService(user).deleteBySalarySobIds(ids);
|
||||
// 删除薪资账套的校验规则
|
||||
getSalarySobCheckRuleService(user).deleteBySalarySobIds(ids);
|
||||
// 记录日志
|
||||
salarySobPOS.forEach(salarySobPO -> {
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套"));
|
||||
loggerContext.setOldValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
// 记录日志
|
||||
salarySobPOS.forEach(salarySobPO -> {
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套"));
|
||||
loggerContext.setOldValues(salarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -743,15 +767,15 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
if (CollectionUtils.isNotEmpty(result.getSalarySobCheckRules())) {
|
||||
getSalarySobCheckRuleService(user).batchSave(result.getSalarySobCheckRules());
|
||||
}
|
||||
// 记录日志
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + result.getSalarySob().getId());
|
||||
loggerContext.setTargetName(result.getSalarySob().getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套") + ": " + salarySobPO.getName());
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
// 记录日志
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + result.getSalarySob().getId());
|
||||
loggerContext.setTargetName(result.getSalarySob().getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套") + ": " + salarySobPO.getName());
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -800,6 +824,188 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
return getSalarySobMapper().listSome(SalarySobPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobConfig> getConfig(Long taxAgentId) {
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobMapper().listSome(SalarySobPO.builder().taxAgentId(taxAgentId).build());
|
||||
return salarySobPOS.stream().map(salarySobPO -> {
|
||||
Long salarySobId = salarySobPO.getId();
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobId);
|
||||
List<SalarySobItemGroupPO> salarySobItemGroupPOS = getSalarySobItemGroupService(user).getConfig(salarySobId);
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).getConfig(salarySobId);
|
||||
List<SalarySobBackItemPO> salarySobBackItemPOS = getSalarySobBackItemService(user).getConfig(salarySobId);
|
||||
List<SalarySobAdjustRulePO> salarySobAdjustRulePOS = getSalarySobAdjustRuleService(user).listBySalarySobId(salarySobId);
|
||||
return SalarySobConfig.builder().salarySob(salarySobPO).salarySobEmpFields(salarySobEmpFieldPOS).salarySobItemGroups(salarySobItemGroupPOS).salarySobItems(salarySobItemPOS).salarySobBackItems(salarySobBackItemPOS).salarySobAdjustRules(salarySobAdjustRulePOS).build();
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UploadConfigResponse.Result> parseConfig(Long taxAgentId, List<SalarySobConfig> salarySobConfigs) {
|
||||
List<UploadConfigResponse.Result> results = new ArrayList<>();
|
||||
long uid = user.getUID();
|
||||
List<SalarySobPO> salarySobPOS = listByTaxAgentId(taxAgentId);
|
||||
Map<String, SalarySobPO> sobPOMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getName);
|
||||
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Map<String, SalaryItemPO> salaryItemNameMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getName);
|
||||
|
||||
Optional.ofNullable(salarySobConfigs).orElse(new ArrayList<>()).forEach(salarySobConfig -> {
|
||||
SalarySobPO salarySobPO = salarySobConfig.getSalarySob();
|
||||
String sobPOName = salarySobPO.getName();
|
||||
|
||||
UploadConfigResponse.Result result = UploadConfigResponse.Result.builder()
|
||||
.message(String.format("账套:%s基础信息加载完毕", sobPOName))
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
|
||||
if (sobPOMap.containsKey(sobPOName)) {
|
||||
SalarySobPO oldSob = sobPOMap.get(sobPOName);
|
||||
salarySobPO.setId(oldSob.getId());
|
||||
salarySobPO.setCreator(uid);
|
||||
salarySobPO.setTaxAgentId(oldSob.getTaxAgentId());
|
||||
getSalarySobMapper().updateIgnoreNull(salarySobPO);
|
||||
} else {
|
||||
salarySobPO.setCreator(uid);
|
||||
salarySobPO.setTaxAgentId(taxAgentId);
|
||||
getSalarySobMapper().insertIgnoreNull(salarySobPO);
|
||||
}
|
||||
|
||||
result.getSuccess().add(String.format("账套:%s基础信息加载成功", sobPOName));
|
||||
|
||||
Long sobId = salarySobPO.getId();
|
||||
getSalarySobEmpFieldService(user).deleteBySalarySobIds(Collections.singletonList(sobId));
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields = salarySobConfig.getSalarySobEmpFields();
|
||||
if (CollectionUtil.isNotEmpty(salarySobEmpFields)) {
|
||||
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
|
||||
salarySobEmpField.setSalarySobId(sobId);
|
||||
salarySobEmpField.setCreator(uid);
|
||||
}
|
||||
getSalarySobEmpFieldService(user).batchSave(salarySobEmpFields);
|
||||
}
|
||||
result.getSuccess().add(String.format("账套:%s人员字段加载成功", sobPOName));
|
||||
|
||||
getSalarySobItemService(user).deleteBySalarySobIds(Collections.singletonList(sobId));
|
||||
List<SalarySobItemPO> salarySobItems = salarySobConfig.getSalarySobItems();
|
||||
if (CollectionUtil.isNotEmpty(salarySobItems)) {
|
||||
salarySobItems.forEach(sobItem -> {
|
||||
sobItem.setId(IdGenerator.generate());
|
||||
sobItem.setSalarySobId(sobId);
|
||||
sobItem.setCreator(uid);
|
||||
Long formulaId = getSalaryFormulaService(user).add(sobItem.getFormula());
|
||||
sobItem.setFormulaId(formulaId);
|
||||
|
||||
SalaryItemPO salaryItem = sobItem.getSalaryItem();
|
||||
if (salaryItem != null) {
|
||||
SalaryItemPO salaryItemPO = salaryItemNameMap.get(salaryItem.getName());
|
||||
if (salaryItemPO != null) {
|
||||
sobItem.setSalaryItemId(salaryItemPO.getId());
|
||||
} else {
|
||||
SalaryItemPO itemPO = getSalaryItemService(user).getItem(salaryItem);
|
||||
if (itemPO != null) {
|
||||
sobItem.setSalaryItemId(itemPO.getId());
|
||||
} else {
|
||||
result.getError().add(String.format("错误,账套:%s,薪资项目:%s,未找到对应薪资项目id", sobPOName, salaryItem.getName()));
|
||||
log.error("item not found:{}", salaryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
getSalarySobItemService(user).batchSave(salarySobItems);
|
||||
}
|
||||
|
||||
getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singletonList(sobId));
|
||||
List<SalarySobItemGroupPO> salarySobItemGroups = salarySobConfig.getSalarySobItemGroups();
|
||||
if (CollectionUtil.isNotEmpty(salarySobItemGroups)) {
|
||||
for (SalarySobItemGroupPO salarySobItemGroup : salarySobItemGroups) {
|
||||
long groupId = IdGenerator.generate();
|
||||
salarySobItemGroup.setId(groupId);
|
||||
salarySobItemGroup.setSalarySobId(sobId);
|
||||
salarySobItemGroup.setCreator(uid);
|
||||
|
||||
List<SalarySobItemPO> sobItems = salarySobItemGroup.getSalarySobItems();
|
||||
if (CollectionUtil.isNotEmpty(sobItems)) {
|
||||
sobItems.forEach(sobItem -> {
|
||||
sobItem.setId(IdGenerator.generate());
|
||||
sobItem.setSalarySobId(sobId);
|
||||
sobItem.setSalarySobItemGroupId(groupId);
|
||||
sobItem.setCreator(uid);
|
||||
Long formulaId = getSalaryFormulaService(user).add(sobItem.getFormula());
|
||||
sobItem.setFormulaId(formulaId);
|
||||
|
||||
SalaryItemPO salaryItem = sobItem.getSalaryItem();
|
||||
if (salaryItem != null) {
|
||||
SalaryItemPO salaryItemPO = salaryItemNameMap.get(salaryItem.getName());
|
||||
if (salaryItemPO != null) {
|
||||
sobItem.setSalaryItemId(salaryItemPO.getId());
|
||||
} else {
|
||||
SalaryItemPO itemPO = getSalaryItemService(user).getItem(salaryItem);
|
||||
if (itemPO != null) {
|
||||
sobItem.setSalaryItemId(itemPO.getId());
|
||||
} else {
|
||||
result.getError().add(String.format("错误,账套:%s,薪资项目:%s,未找到对应薪资项目id", sobPOName, salaryItem.getName()));
|
||||
log.error("item not found:{}", salaryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
getSalarySobItemService(user).batchSave(sobItems);
|
||||
}
|
||||
}
|
||||
getSalarySobItemGroupService(user).batchSave(salarySobItemGroups);
|
||||
}
|
||||
result.getSuccess().add(String.format("账套:%s薪资项目加载成功", sobPOName));
|
||||
|
||||
getSalarySobBackItemService(user).deleteBySalarySobIds(Collections.singletonList(sobId));
|
||||
List<SalarySobBackItemPO> salarySobBackItems = salarySobConfig.getSalarySobBackItems();
|
||||
if (CollectionUtil.isNotEmpty(salarySobBackItems)) {
|
||||
for (SalarySobBackItemPO salarySobBackItem : salarySobBackItems) {
|
||||
salarySobBackItem.setId(IdGenerator.generate());
|
||||
salarySobBackItem.setSalarySobId(sobId);
|
||||
salarySobBackItem.setCreator(uid);
|
||||
|
||||
Long formulaId = getSalaryFormulaService(user).add(salarySobBackItem.getFormula());
|
||||
salarySobBackItem.setFormulaId(formulaId);
|
||||
|
||||
SalaryItemPO salaryItem = salarySobBackItem.getSalaryItem();
|
||||
if (salaryItem != null) {
|
||||
SalaryItemPO salaryItemPO = salaryItemNameMap.get(salaryItem.getName());
|
||||
if (salaryItemPO != null) {
|
||||
salarySobBackItem.setSalaryItemId(salaryItemPO.getId());
|
||||
} else {
|
||||
SalaryItemPO itemPO = getSalaryItemService(user).getItem(salaryItem);
|
||||
if (itemPO != null) {
|
||||
salarySobBackItem.setSalaryItemId(itemPO.getId());
|
||||
} else {
|
||||
result.getError().add(String.format("错误,账套:%s,薪资项目:%s,未找到对应薪资项目id", sobPOName, salaryItem.getName()));
|
||||
log.error("item not found:{}", salaryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getSalarySobBackItemService(user).batchInsert(salarySobBackItems);
|
||||
}
|
||||
result.getSuccess().add(String.format("账套:%s回算加载成功", sobPOName));
|
||||
|
||||
getSalarySobAdjustRuleService(user).deleteBySalarySobIds(Collections.singletonList(sobId));
|
||||
List<SalarySobAdjustRulePO> salarySobAdjustRules = salarySobConfig.getSalarySobAdjustRules();
|
||||
if (CollectionUtil.isNotEmpty(salarySobAdjustRules)) {
|
||||
for (SalarySobAdjustRulePO salarySobAdjustRule : salarySobAdjustRules) {
|
||||
salarySobAdjustRule.setId(IdGenerator.generate());
|
||||
salarySobAdjustRule.setSalarySobId(sobId);
|
||||
salarySobAdjustRule.setCreator(uid);
|
||||
}
|
||||
getSalarySobAdjustRuleService(user).batchSave(salarySobAdjustRules);
|
||||
}
|
||||
result.getSuccess().add(String.format("账套:%s调薪计薪规则加载成功", sobPOName));
|
||||
|
||||
results.add(result);
|
||||
});
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
public List<SalarySobPO> filterByAdmin(List<SalarySobPO> salarySobPOS) {
|
||||
long employeeId = user.getUID();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.salary.mapper.taxagent.TaxAgentBaseMapper;
|
|||
import com.engine.salary.service.SIAccountService;
|
||||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.TaxAgentBaseService;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
|
|
@ -20,6 +21,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -95,6 +97,42 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaxAgentBasePO getConfig() {
|
||||
Date now = new Date();
|
||||
TaxAgentBasePO baseInfo = getBaseInfo();
|
||||
if (baseInfo == null) {
|
||||
baseInfo = TaxAgentBasePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.devolutionStatus(0)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
}
|
||||
return baseInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadConfigResponse.Result parseConfig(TaxAgentBasePO config) {
|
||||
UploadConfigResponse.Result result = UploadConfigResponse.Result.builder().message("分权配置加载完毕")
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
TaxAgentBasePO baseInfo = getBaseInfo();
|
||||
if (baseInfo == null) {
|
||||
config.setCreator((long) user.getUID());
|
||||
getTaxAgentBaseMapper().insertIgnoreNull(config);
|
||||
} else {
|
||||
baseInfo.setDevolutionStatus(config.getDevolutionStatus());
|
||||
getTaxAgentBaseMapper().updateIgnoreNull(baseInfo);
|
||||
}
|
||||
result.getSuccess().add("分权加载完毕,分权" + (config.getDevolutionStatus() == 1 ? "开启" : "关闭 "));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有未归档数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,20 +4,22 @@ import com.engine.common.service.HrmCommonService;
|
|||
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryAuthConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salarysob.config.SalarySobConfig;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
||||
|
|
@ -41,6 +43,7 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
|||
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
|
|
@ -89,6 +92,11 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -473,7 +481,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
getTaxAgentMapper().deleteByIds(ids);
|
||||
|
||||
// 记录日志
|
||||
taxAgents.forEach(e ->{
|
||||
taxAgents.forEach(e -> {
|
||||
LoggerContext<TaxAgentPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(e.getId().toString());
|
||||
|
|
@ -502,12 +510,12 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
// 被社保福利档案引用
|
||||
List<InsuranceArchivesBaseInfoPO> socialByPaymentOrganization = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(id);
|
||||
if(CollectionUtils.isNotEmpty(socialByPaymentOrganization)){
|
||||
if (CollectionUtils.isNotEmpty(socialByPaymentOrganization)) {
|
||||
throw new SalaryRunTimeException("存在社保福利档案引用");
|
||||
}
|
||||
// 被社保福利台账引用
|
||||
List<InsuranceAccountBatchPO> insuranceArchiveList = getInsuranceAccountBatchMapper().list(InsuranceAccountBatchParam.builder().taxAgents(Collections.singletonList(id)).build());
|
||||
if(CollectionUtils.isNotEmpty(insuranceArchiveList)){
|
||||
if (CollectionUtils.isNotEmpty(insuranceArchiveList)) {
|
||||
throw new SalaryRunTimeException("存在社保福利台账引用");
|
||||
}
|
||||
//被社保福利档案引用
|
||||
|
|
@ -794,13 +802,61 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId) {
|
||||
List<TaxAgentEmpPO> taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId),UseEmployeeTypeEnum.ALL);
|
||||
List<TaxAgentEmpPO> taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId), UseEmployeeTypeEnum.ALL);
|
||||
|
||||
return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxAgentConfig> getConfig() {
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listAll();
|
||||
return taxAgentPOS.stream()
|
||||
.map(taxAgentPO -> {
|
||||
List<SalarySobConfig> sobConfigs = getSalarySobService(user).getConfig(taxAgentPO.getId());
|
||||
return TaxAgentConfig.builder().taxAgent(taxAgentPO).salarySobConfigs(sobConfigs).build();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UploadConfigResponse.Result> parseConfig(List<TaxAgentConfig> configs) {
|
||||
List<UploadConfigResponse.Result> results = new ArrayList<>();
|
||||
|
||||
List<TaxAgentPO> taxAgentPOS = listAll();
|
||||
Map<String, TaxAgentPO> agentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getName);
|
||||
|
||||
Optional.ofNullable(configs)
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(config -> {
|
||||
TaxAgentPO taxAgent = config.getTaxAgent();
|
||||
String name = taxAgent.getName();
|
||||
|
||||
UploadConfigResponse.Result taxResult = UploadConfigResponse.Result.builder()
|
||||
.message(String.format("扣缴义务人%s加载完毕", name))
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
|
||||
if (agentPOMap.containsKey(name)) {
|
||||
//存在扣缴义务人
|
||||
taxAgent = agentPOMap.get(name);
|
||||
} else {
|
||||
//新增扣缴义务人
|
||||
taxAgent.setCreator((long) user.getUID());
|
||||
getTaxAgentMapper().insertIgnoreNull(taxAgent);
|
||||
}
|
||||
taxResult.getSuccess().add(String.format("%s加载成功", name));
|
||||
results.add(taxResult);
|
||||
|
||||
List<UploadConfigResponse.Result> sobResults = getSalarySobService(user).parseConfig(taxAgent.getId(), config.getSalarySobConfigs());
|
||||
results.addAll(sobResults);
|
||||
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.salary.sys.config;
|
||||
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SysConfig")
|
||||
public class SysConfig {
|
||||
|
||||
@XStreamImplicit
|
||||
private List<SalarySysConfPO> salarySysConfs;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.sys.entity.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 初始化薪酬配置
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UploadConfigParam {
|
||||
|
||||
//上传文件id
|
||||
String imageId;
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,9 @@ package com.engine.salary.sys.entity.po;
|
|||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -15,54 +18,74 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@XStreamAlias("SalarySysConf")
|
||||
public class SalarySysConfPO {
|
||||
|
||||
@DataCheck(require = true, runtime = RuntimeTypeEnum.UPDATE, message = "id为空")
|
||||
@XStreamOmitField
|
||||
private Long id;
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
@TableTitle(title = "标识", dataIndex = "confKey", key = "confKey")
|
||||
@DataCheck(require = true, message = "标识为空")
|
||||
@XStreamAlias("confKey")
|
||||
@XStreamAsAttribute
|
||||
private String confKey;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@TableTitle(title = "值", dataIndex = "confValue", key = "confValue")
|
||||
@DataCheck(require = true, message = "标识为空")
|
||||
@XStreamAlias("confValue")
|
||||
@XStreamAsAttribute
|
||||
private String confValue;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableTitle(title = "标题", dataIndex = "title", key = "title")
|
||||
@DataCheck(require = true, message = "标题为空")
|
||||
@XStreamAlias("title")
|
||||
@XStreamAsAttribute
|
||||
private String title;
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
@TableTitle(title = "所属模块", dataIndex = "module", key = "module")
|
||||
@XStreamAlias("module")
|
||||
@XStreamAsAttribute
|
||||
private String module;
|
||||
/**
|
||||
* 排序权重
|
||||
*/
|
||||
@TableTitle(title = "排序权重", dataIndex = "orderWeight", key = "orderWeight")
|
||||
@XStreamAlias("orderWeight")
|
||||
@XStreamAsAttribute
|
||||
private Integer orderWeight;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableTitle(title = "描述", dataIndex = "description", key = "description")
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
/**
|
||||
* 是否已删除,0否,1是
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.sys.entity.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UploadConfigResponse {
|
||||
|
||||
private boolean finish;
|
||||
|
||||
private List<Result> results;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Result {
|
||||
String message;
|
||||
List<String> success;
|
||||
List<String> warning;
|
||||
List<String> error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
package com.engine.salary.sys.service;
|
||||
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.AppSettingVO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -137,4 +139,8 @@ public interface SalarySysConfService {
|
|||
* @param app
|
||||
*/
|
||||
void saveSettingByType(String confValue, String confKey, String title, String app);
|
||||
|
||||
SysConfig getConfig();
|
||||
|
||||
UploadConfigResponse.Result parseConfig(SysConfig config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.dev.api.util.Util_DataCache;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
|
|
@ -38,12 +39,14 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
|||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.AppSettingVO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.sys.enums.*;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
|
|
@ -64,6 +67,7 @@ import weaver.hrm.User;
|
|||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.*;
|
||||
import static java.util.concurrent.Executors.newFixedThreadPool;
|
||||
|
|
@ -509,8 +513,52 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysConfig getConfig() {
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
List<SalarySysConfPO> salarySysConfPOS = getSalarySysConfMapper().listAll();
|
||||
//去除加密配置
|
||||
salarySysConfPOS = salarySysConfPOS.stream().filter(po -> !po.getConfKey().equals(OPEN_APPLICATION_ENCRYPT)).collect(Collectors.toList());
|
||||
sysConfig.setSalarySysConfs(salarySysConfPOS);
|
||||
return sysConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadConfigResponse.Result parseConfig(SysConfig config) {
|
||||
UploadConfigResponse.Result result = UploadConfigResponse.Result.builder()
|
||||
.message("系统配置加载完毕")
|
||||
.success(new ArrayList<>())
|
||||
.warning(new ArrayList<>())
|
||||
.error(new ArrayList<>())
|
||||
.build();
|
||||
|
||||
List<SalarySysConfPO> salarySysConfs = config.getSalarySysConfs();
|
||||
if (CollectionUtil.isNotEmpty((salarySysConfs))) {
|
||||
|
||||
salarySysConfs.forEach(po -> {
|
||||
try {
|
||||
SalarySysConfPO sysConfPO = getSalarySysConfMapper().getOneByCode(po.getConfKey());
|
||||
if (sysConfPO == null) {
|
||||
po.setId(IdGenerator.generate());
|
||||
getSalarySysConfMapper().insertIgnoreNull(po);
|
||||
} else {
|
||||
sysConfPO.setConfValue(po.getConfValue());
|
||||
getSalarySysConfMapper().updateIgnoreNull(sysConfPO);
|
||||
}
|
||||
result.getSuccess().add(String.format("[%s]配置,key:[%s],value:[%s]", po.getTitle(), po.getConfKey(), po.getConfValue()));
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("错误,[%s]配置加载异常,key:[%s],value:[%s]", po.getTitle(), po.getConfKey(), po.getConfValue()), e);
|
||||
result.getError().add(String.format("错误,[%s]配置加载异常,key:[%s],value:[%s],原因:%s", po.getTitle(), po.getConfKey(), po.getConfValue(), e.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启/关闭加解密
|
||||
*
|
||||
* @param confValue
|
||||
*/
|
||||
public void updateEncrypt(String confValue) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.util.db;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
public class IdGenerator {
|
||||
|
|
@ -43,4 +44,8 @@ public class IdGenerator {
|
|||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static String getUUID() {
|
||||
return UUID.randomUUID().toString().replaceAll("-", "");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ import java.lang.annotation.*;
|
|||
@Documented
|
||||
public @interface ExcelHead {
|
||||
|
||||
String title() default "";
|
||||
String title() ;
|
||||
|
||||
String dataIndex() default "";
|
||||
String dataIndex() ;
|
||||
|
||||
DataTypeEnum dataType() default DataTypeEnum.string;
|
||||
|
||||
|
|
|
|||
|
|
@ -204,6 +204,27 @@ public class ExcelParseHelper {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> parse2Map(Workbook workbook, int sheetIndex, int rowIndex, int headerRowIndex) {
|
||||
// 创建一个公式求值器对象
|
||||
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
|
||||
Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
int rowCount = sheet.getPhysicalNumberOfRows(); // 总行数
|
||||
int cellCount = sheet.getRow(headerRowIndex).getPhysicalNumberOfCells(); // 总列数
|
||||
|
||||
List<String> sheetHeader = ExcelSupport.getSheetHeader(sheet, headerRowIndex);
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (; rowIndex < rowCount; rowIndex++) {
|
||||
Map<String, Object> cellResult = new HashMap<>();
|
||||
for (int j = 0; j < cellCount; j++) {
|
||||
String key = sheetHeader.get(j);
|
||||
cellResult.put(key, ExcelSupport.getCellValue(sheet, evaluator, rowIndex, j));
|
||||
}
|
||||
result.add(cellResult);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将sheet数据转为map
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.util.excel;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ImportExcelResponse {
|
||||
private Integer totalCount;
|
||||
private Integer successCount;
|
||||
private Integer errorCount;
|
||||
private List<Error> errorData;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Error {
|
||||
String message;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.engine.salary.util.xml;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.io.HierarchicalStreamDriver;
|
||||
import com.thoughtworks.xstream.io.naming.NoNameCoder;
|
||||
import com.thoughtworks.xstream.io.xml.DomDriver;
|
||||
import com.thoughtworks.xstream.security.AnyTypePermission;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class XStreamUtil {
|
||||
//new NoNameCoder() 解决 _ 被序列化成 __ 的问题
|
||||
private static final NoNameCoder noNameCoder = new NoNameCoder();
|
||||
|
||||
private static XStream xStream = new XStream(new DomDriver("UTF-8", noNameCoder));
|
||||
|
||||
private static XStream getxStream(HierarchicalStreamDriver driver){
|
||||
if(Objects.isNull(driver)){
|
||||
return xStream;
|
||||
}
|
||||
return new XStream(driver);
|
||||
}
|
||||
|
||||
public static <T> T unmarshal(String pkgName, Class<T> cla, String xmlStr, HierarchicalStreamDriver driver) {
|
||||
xStream = getxStream(driver);
|
||||
|
||||
if (StrUtil.isEmpty(pkgName)) {
|
||||
//高版本为了解决安全漏洞,增加了白名单机制, 如果不设置这个权限可能会报错
|
||||
xStream.addPermission(AnyTypePermission.ANY);
|
||||
} else {
|
||||
//设置允许解析的包,如果不想设置可以用 addPermission(AnyTypePermission.ANY) 代替
|
||||
xStream.allowTypesByWildcard(new String[]{pkgName});
|
||||
}
|
||||
|
||||
//支持注解,不然使用的XStream注解不会生效且不报错
|
||||
xStream.autodetectAnnotations(true);
|
||||
xStream.processAnnotations(cla);
|
||||
|
||||
//忽略未知属性, 如果不添加这个,当Xml报文中出现实体中没有的属性时会报错 No such field
|
||||
xStream.ignoreUnknownElements();
|
||||
|
||||
return (T) xStream.fromXML(xmlStr);
|
||||
}
|
||||
|
||||
public static <T> T unmarshal(String pkgName, Class<T> cla, String xmlStr) {
|
||||
return unmarshal(pkgName, cla, xmlStr, null);
|
||||
}
|
||||
|
||||
public static <T> T unmarshal(Class<T> cla, String xmlStr) {
|
||||
return unmarshal(null, cla, xmlStr, null);
|
||||
}
|
||||
|
||||
public static String marshal(Object o, DomDriver driver) {
|
||||
xStream = getxStream(driver);
|
||||
|
||||
//支持注解,不然使用的 @XStreamAlias() 注解不会生效而且不会报错
|
||||
xStream.autodetectAnnotations(true);
|
||||
|
||||
//注册自定义时间转换器,使得XStream全局支持LocalDateTime, 或者不在这里注册,使用@XStreamConverter(LocalDateTimeConverter.class)注解在单一字段上
|
||||
// xStream.registerConverter(new LocalDateTimeConverter());
|
||||
return xStream.toXML(o);
|
||||
}
|
||||
|
||||
public static String marshal(Object o){
|
||||
return marshal(o, null);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import com.engine.salary.service.SalaryAcctExcelService;
|
|||
import com.engine.salary.service.impl.SalaryAcctExcelServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.excel.ExcelPreviewDTO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.*;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
|
|
@ -691,7 +692,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String importSalaryAcctResultPreview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctImportParam, Map<String, Object>>(user).run(getSalaryAcctExcelService(user)::previewImportSalaryAcctResult, param);
|
||||
return new ResponseResult<SalaryAcctImportParam, ExcelPreviewDTO>(user).run(getSalaryAcctExcelService(user)::previewImportSalaryAcctResult, param);
|
||||
}
|
||||
|
||||
// **********************************薪资核算结果 end*********************************/
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class SalaryCommonController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getCacheInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "key") String key) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, String>(user).run(getSalaryCommonWrapper(user)::getCacheInfo, key);
|
||||
return new ResponseResult<String, Object>(user).run(getSalaryCommonWrapper(user)::getCacheInfo, key);
|
||||
}
|
||||
|
||||
@GET
|
||||
|
|
|
|||
|
|
@ -5,18 +5,18 @@ import com.engine.salary.component.WeaFormOption;
|
|||
import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.dto.SysSalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SyncSalaryItemParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SysSalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.param.*;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ImportExcelResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalaryItemWrapper;
|
||||
import com.engine.salary.wrapper.SysSalaryItemWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -25,6 +25,11 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -37,6 +42,7 @@ import java.util.Map;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalaryItemController {
|
||||
|
||||
private SalaryItemWrapper getSalaryItemWrapper(User user) {
|
||||
|
|
@ -183,6 +189,75 @@ public class SalaryItemController {
|
|||
return new ResponseResult<SalaryItemSaveParam, String>(user).run(getSalaryItemWrapper(user)::update, saveParam);
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemExportParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getSalaryItemWrapper(user).export(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "薪资项目" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("薪资项目下载失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/downloadTemplate")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response downloadTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemDownloadTemplateParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getSalaryItemWrapper(user).downloadTemplate(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "薪资项目导入模板" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("薪资项目导入模板", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/preview")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemImportParam importParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryItemImportParam, Map<String, Object>>(user).run(getSalaryItemWrapper(user)::preview, importParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/import")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String importSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemImportParam importParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryItemImportParam, ImportExcelResponse>(user).run(getSalaryItemWrapper(user)::importSalaryItem, importParam);
|
||||
}
|
||||
|
||||
/**********************************自定义薪资项目 end*********************************/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
import com.engine.salary.entity.config.SalaryConfig;
|
||||
import com.engine.salary.sys.entity.param.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.AppSettingVO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.xml.XStreamUtil;
|
||||
import com.engine.salary.wrapper.SalarySystemConfigWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -22,6 +22,15 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.Writer;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
|
|
@ -199,6 +208,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 薪资核算人员匹配规则
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -214,6 +224,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 工资单反馈
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -229,6 +240,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 撤回个税申报
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -244,6 +256,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 删除档案
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -318,4 +331,46 @@ public class SalarySystemConfigController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, Map<String, Object>>(user).run(getSalarySystemConfigWrapper(user)::getEncryptProgress, progressId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/downloadConfig")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response downloadConfig(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
SalaryConfig salaryConfig = getSalarySystemConfigWrapper(user).downloadConfig();
|
||||
|
||||
String xml = XStreamUtil.marshal(salaryConfig);
|
||||
|
||||
String fileName = "薪酬配置" + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xml", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StreamingOutput output = outputStream -> {
|
||||
Writer writer = new BufferedWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
|
||||
writer.write(xml);
|
||||
writer.flush();
|
||||
};
|
||||
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("下载薪酬配置", e);
|
||||
throw new RuntimeException("下载薪酬配置", e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/uploadConfig")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String initConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody UploadConfigParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<UploadConfigParam, UploadConfigResponse>(user).run(getSalarySystemConfigWrapper(user)::uploadConfig, param);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class SalaryCommonWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public String getCacheInfo(String key) {
|
||||
public Object getCacheInfo(String key) {
|
||||
return getSalaryCacheService(user).get(key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,15 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.component.WeaFormOption;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.param.SyncSalaryItemParam;
|
||||
import com.engine.salary.entity.salaryitem.param.*;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
|
|
@ -26,12 +24,14 @@ import com.engine.salary.sys.service.SalarySysConfService;
|
|||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ImportExcelResponse;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -290,6 +290,7 @@ public class SalaryItemWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取薪资项目在哪些账套中使用
|
||||
*
|
||||
* @param salaryItemId
|
||||
*/
|
||||
public List<Map<String, Object>> getSalarySobBySalaryItem(Long salaryItemId) {
|
||||
|
|
@ -298,9 +299,26 @@ public class SalaryItemWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 将薪资项目管理中的信息同步至账套
|
||||
*
|
||||
* @param syncSalaryItemParam
|
||||
*/
|
||||
public void syncSalaryItemToSalarySobItem(SyncSalaryItemParam syncSalaryItemParam) {
|
||||
getSalaryItemService(user).syncSalaryItemToSalarySobItem(syncSalaryItemParam);
|
||||
}
|
||||
|
||||
public XSSFWorkbook export(SalaryItemExportParam param) {
|
||||
return getSalaryItemService(user).export(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> preview(SalaryItemImportParam param) {
|
||||
return getSalaryItemService(user).preview(param);
|
||||
}
|
||||
public ImportExcelResponse importSalaryItem(SalaryItemImportParam param) {
|
||||
return getSalaryItemService(user).importSalaryItem(param);
|
||||
}
|
||||
|
||||
|
||||
public XSSFWorkbook downloadTemplate(SalaryItemDownloadTemplateParam param) {
|
||||
return getSalaryItemService(user).downloadTemplate(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,21 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
import com.engine.salary.cache.SalaryCacheKey;
|
||||
import com.engine.salary.entity.config.SalaryConfig;
|
||||
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.engine.salary.sys.entity.param.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.AppSettingVO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
|
|
@ -17,10 +25,20 @@ import com.engine.salary.util.page.PageInfo;
|
|||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.engine.salary.util.xml.XStreamUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -33,12 +51,37 @@ import java.util.Map;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalarySystemConfigWrapper extends Service {
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveItemService getSalaryArchiveItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentBaseService getTaxAgentBaseService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCacheService getSalaryCacheService(User user) {
|
||||
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> info() {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String log = baseBean.getPropValue("hrmSalary", "log");
|
||||
|
|
@ -136,12 +179,12 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
|
||||
public AppSettingVO appSetting() {
|
||||
|
||||
return getSalarySysConfService(user).appSetting();
|
||||
return getSalarySysConfService(user).appSetting();
|
||||
|
||||
}
|
||||
|
||||
public Map<String, Object> saveEncryptSetting(AppSettingSaveParam param) {
|
||||
return getSalarySysConfService(user).saveEncryptSetting(param);
|
||||
return getSalarySysConfService(user).saveEncryptSetting(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> getEncryptProgress(String progressId) {
|
||||
|
|
@ -167,4 +210,92 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
public void saveSalarySendFeedback(SalarySysConfPO param) {
|
||||
getSalarySysConfService(user).saveSalarySendFeedback(param);
|
||||
}
|
||||
|
||||
|
||||
public SalaryConfig downloadConfig() {
|
||||
Boolean chief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
if (!chief) {
|
||||
throw new SalaryRunTimeException("您不是薪酬总管理员,无法迁入出配置!");
|
||||
}
|
||||
|
||||
|
||||
SalaryConfig salaryConfig = new SalaryConfig();
|
||||
SysConfig sysConfig = getSalarySysConfService(user).getConfig();
|
||||
salaryConfig.setSysConfig(sysConfig);
|
||||
|
||||
// FormluaConfig formluaConfig = getSalaryFormulaService(user).getConfig();
|
||||
// salaryConfig.setFormluaConfig(formluaConfig);
|
||||
|
||||
SalaryItemAllConfig salaryItemConfig = getSalaryItemService(user).getConfig();
|
||||
salaryConfig.setSalaryItemConfig(salaryItemConfig);
|
||||
|
||||
ArchiveFieldConfig archiveFieldConfig = getSalaryArchiveItemService(user).getConfig();
|
||||
salaryConfig.setArchiveFieldConfig(archiveFieldConfig);
|
||||
|
||||
TaxAgentBasePO taxAgentBaseConfig = getTaxAgentBaseService(user).getConfig();
|
||||
salaryConfig.setTaxAgentBaseConfig(taxAgentBaseConfig);
|
||||
|
||||
List<TaxAgentConfig> taxAgentConfigs = getTaxAgentService(user).getConfig();
|
||||
salaryConfig.setTaxAgentConfigs(taxAgentConfigs);
|
||||
|
||||
return salaryConfig;
|
||||
}
|
||||
|
||||
public UploadConfigResponse uploadConfig(UploadConfigParam param) {
|
||||
Boolean chief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
if (!chief) {
|
||||
throw new SalaryRunTimeException("您不是薪酬总管理员,无法迁入配置!");
|
||||
}
|
||||
|
||||
UploadConfigResponse lastResponse = getSalaryCacheService(user).get(SalaryCacheKey.UPLOAD_SALARY_CONFIG);
|
||||
if (lastResponse != null && !lastResponse.isFinish()) {
|
||||
throw new SalaryRunTimeException("迁入任务进行中,请等待上次任务完成!");
|
||||
}
|
||||
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
UploadConfigResponse response = UploadConfigResponse.builder().finish(false).results(new ArrayList<>()).build();
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.UPLOAD_SALARY_CONFIG, response);
|
||||
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Reader reader = new InputStreamReader(fileInputStream, StandardCharsets.UTF_8);
|
||||
BufferedReader bufferedReader = new BufferedReader(reader);
|
||||
String line;
|
||||
StringBuilder xml = new StringBuilder();
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
xml.append(line);
|
||||
}
|
||||
|
||||
SalaryConfig config = XStreamUtil.unmarshal(SalaryConfig.class, xml.toString());
|
||||
|
||||
UploadConfigResponse.Result sysConfigResult = getSalarySysConfService(user).parseConfig(config.getSysConfig());
|
||||
response.getResults().add(sysConfigResult);
|
||||
|
||||
UploadConfigResponse.Result salaryItemResult = getSalaryItemService(user).parseConfig(config.getSalaryItemConfig());
|
||||
response.getResults().add(salaryItemResult);
|
||||
|
||||
UploadConfigResponse.Result archiveFieldResult = getSalaryArchiveItemService(user).parseConfig(config.getArchiveFieldConfig());
|
||||
response.getResults().add(archiveFieldResult);
|
||||
|
||||
UploadConfigResponse.Result taxAgentBaseResult = getTaxAgentBaseService(user).parseConfig(config.getTaxAgentBaseConfig());
|
||||
response.getResults().add(taxAgentBaseResult);
|
||||
|
||||
List<UploadConfigResponse.Result> results = getTaxAgentService(user).parseConfig(config.getTaxAgentConfigs());
|
||||
response.getResults().addAll(results);
|
||||
} catch (Exception e) {
|
||||
log.error("加载失败", e);
|
||||
} finally {
|
||||
response.setFinish(true);
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.UPLOAD_SALARY_CONFIG, response);
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "UPLOAD_SALARY_CONFIG", localRunnable);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue