公式v2
This commit is contained in:
parent
a4547db7ff
commit
4db39902b5
|
|
@ -0,0 +1,7 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/formula")
|
||||
public class SalaryFormulaController extends com.engine.salary.web.SalaryFormulaController {
|
||||
}
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
package com.engine.salary.constant;
|
||||
|
||||
/**
|
||||
* @description: 薪酬管理公式编辑器的常量
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/24/21 5:51 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪酬管理公式编辑器的常量
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryFormulaFieldConstant {
|
||||
|
||||
// 公式变量的所属模块
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryFormulaFieldConstant;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.SalaryFormulaReferenceEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryFormulaFieldConstant;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.enums.SalaryFormulaReferenceEnum;
|
||||
|
|
@ -24,12 +24,13 @@ import java.util.regex.Pattern;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 薪资核算-薪资项目运算优先级
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 2/7/22 2:49 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪资核算-薪资项目运算优先级
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryAcctCalculatePriorityBO {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,10 +22,7 @@ import java.util.Collection;
|
|||
@AllArgsConstructor
|
||||
public class SalaryAcctCalculateParam {
|
||||
|
||||
/**
|
||||
* 不是employeeId而是salaryAcctEmpId
|
||||
*/
|
||||
//核算人员的id")
|
||||
//核算人员的id,不是employeeId而是salaryAcctEmpId
|
||||
private Collection<Long> ids;
|
||||
|
||||
@DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.entity.formula;
|
||||
package com.engine.salary.entity.salaryformula;
|
||||
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.entity.salaryformula.bo;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.dto.ExpressFormulaDTO;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
|
|
@ -9,12 +9,13 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 薪酬管理公式
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 12/7/21 5:49 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪酬管理公式
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryFormulaBO {
|
||||
|
||||
public static List<ExpressFormulaDTO> convert2DTO(List<ExpressFormula> expressFormulas) {
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
public class ExpressFormulaDTO {
|
||||
|
||||
//公式idTaxAgent
|
||||
//公式id
|
||||
private Long id;
|
||||
|
||||
//公式名称TaxAgent
|
||||
//公式名称
|
||||
private String name;
|
||||
|
||||
//公式表达式TaxAgent
|
||||
//公式表达式
|
||||
private String formula;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description: 薪资公式计算器-个税税率表
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/30/21 5:03 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪资公式计算器-个税税率表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.entity.salaryformula.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 公式字段查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryFormulaFieldQueryParam {
|
||||
|
||||
@DataCheck(require = true,message = "变量来源不可为空")
|
||||
String sourceId;
|
||||
|
||||
Map<String, Object> extendParam;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.engine.salary.entity.salaryformula.param;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryFormulaSaveParam {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@DataCheck(require = true,message = "主键为空",runtime = RuntimeTypeEnum.UPDATE)
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
private String module;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String useFor;
|
||||
/**
|
||||
* 引用类型
|
||||
*/
|
||||
private String referenceType;
|
||||
/**
|
||||
* 返回类型
|
||||
*/
|
||||
private String returnType;
|
||||
/**
|
||||
* 校验类型
|
||||
*/
|
||||
private String validateType;
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
private String extendParam;
|
||||
/**
|
||||
* 公式内容
|
||||
*/
|
||||
private String formula;
|
||||
|
||||
|
||||
private List<FormulaVar> parameters;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.entity.formula.po;
|
||||
package com.engine.salary.entity.salaryformula.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -32,7 +32,7 @@ public class FormulaPO {
|
|||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String use;
|
||||
private String useFor;
|
||||
/**
|
||||
* 引用类型
|
||||
*/
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.entity.formula.po;
|
||||
package com.engine.salary.entity.salaryformula.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -43,7 +43,7 @@ public class FormulaVar {
|
|||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer order;
|
||||
private Integer orderIndex;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryitem.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
||||
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
|
|
@ -11,21 +12,22 @@ import com.engine.salary.enums.SalaryValueTypeEnum;
|
|||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.conn.util.IdGenerator;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/28/21 4:55 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryItemBO {
|
||||
|
||||
|
||||
|
|
@ -165,7 +167,7 @@ public class SalaryItemBO {
|
|||
// long id = IdGenerator.generate();
|
||||
SalaryItemPO salaryItemPO = SalaryItemPO.builder()
|
||||
// .id(id)
|
||||
// .code(String.valueOf(id))
|
||||
.code(IdGenerator.getUUID())
|
||||
.name(saveParam.getName())
|
||||
.systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
||||
.sysSalaryItemId(NumberUtils.LONG_ZERO)
|
||||
|
|
@ -175,7 +177,7 @@ public class SalaryItemBO {
|
|||
.pattern(Optional.ofNullable(saveParam.getPattern()).orElse(2))
|
||||
.valueType(saveParam.getValueType())
|
||||
.dataType(saveParam.getDataType())
|
||||
.formulaId(saveParam.getValueType() == SalaryValueTypeEnum.FORMULA.getValue() ? Optional.ofNullable(saveParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO) : NumberUtils.LONG_ZERO)
|
||||
.formulaId(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.FORMULA.getValue()) ? Optional.ofNullable(saveParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO) : NumberUtils.LONG_ZERO)
|
||||
.description(saveParam.getDescription())
|
||||
.canEdit(NumberUtils.INTEGER_ONE)
|
||||
.creator(employeeId)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleFormDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleListDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
|
@ -16,7 +17,6 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
|
|
|||
|
|
@ -4,38 +4,39 @@ package com.engine.salary.enums;
|
|||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目公式引用分类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/1/21 10:16 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryFormulaReferenceEnum implements BaseEnum<Integer> {
|
||||
* 薪资项目公式引用分类
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum SalaryFormulaReferenceEnum implements BaseEnum<String> {
|
||||
|
||||
SALARY_ITEM(1, "薪资项目", 84960),
|
||||
// SALARY_ITEM_OF_HISTORY(2, "历史台账薪资项目", 85364),
|
||||
EMPLOYEE_INFO(3, "员工基本信息", 85366),
|
||||
SALARY_ARCHIVES(4, "薪资档案", 85368),
|
||||
ATTEND(5, "考勤引用", 85367),
|
||||
ADD_UP_SITUATION(6, "往期累计情况", 104412),
|
||||
ADD_UP_DEDUCTIONS(7, "累计专项附加扣除", 85380),
|
||||
WELFARE(8, "社保福利", 87522),
|
||||
OTHER_DEDUCTION(9, "其他免税扣除", 93849),
|
||||
SALARY_ITEM("salaryItem", "薪资项目", 84960),
|
||||
// SALARY_ITEM_OF_HISTORY("salaryItemOfHistory", "历史台账薪资项目", 85364),
|
||||
EMPLOYEE_INFO("employeeInfo", "员工基本信息", 85366),
|
||||
SALARY_ARCHIVES("salaryArchives", "薪资档案", 85368),
|
||||
ATTEND("attend", "考勤引用", 85367),
|
||||
ADD_UP_SITUATION("addUpSituation", "往期累计情况", 104412),
|
||||
ADD_UP_DEDUCTIONS("addUpDeductions", "累计专项附加扣除", 85380),
|
||||
WELFARE("welfare", "社保福利", 87522),
|
||||
OTHER_DEDUCTION("otherDeduction", "其他免税扣除", 93849),
|
||||
;
|
||||
private int value;
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryFormulaReferenceEnum(int value, String defaultLabel, int labelId) {
|
||||
SalaryFormulaReferenceEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ public enum SalaryFormulaReferenceEnum implements BaseEnum<Integer> {
|
|||
|
||||
public static SalaryFormulaReferenceEnum parseByValue(String value) {
|
||||
for (SalaryFormulaReferenceEnum referenceEnum : SalaryFormulaReferenceEnum.values()) {
|
||||
if (Objects.equals(referenceEnum.getValue() + "", value)) {
|
||||
if (Objects.equals(referenceEnum.getValue(), value)) {
|
||||
return referenceEnum;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@ import java.util.Arrays;
|
|||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 字段类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/1/21 4:35 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 字段类型
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum SalaryValueTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
INPUT(1, "输入", 84976),
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@ import java.util.Arrays;
|
|||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目的字段类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: 2022/3/10 17:16
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪资项目的字段类型
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum SalaryDataTypeEnum implements BaseEnum<String> {
|
||||
STRING("string", "字符", 105093),
|
||||
NUMBER("number", "数值", 87625),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ alter table hrsa_salary_archive_item modify id bigint auto_increment;
|
|||
alter table hrsa_salary_acct_record modify id bigint auto_increment;
|
||||
alter table hrsa_salary_acct_emp modify id bigint auto_increment;
|
||||
alter table hrsa_acct_result_temp modify id bigint auto_increment;
|
||||
alter table hrsa_formula modify id bigint auto_increment;
|
||||
alter table hrsa_formula_var modify id bigint auto_increment;
|
||||
|
||||
|
||||
--福利方案主键自增增加
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.mapper.formula;
|
||||
|
||||
import com.engine.salary.entity.formula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -55,5 +56,5 @@ public interface FormulaMapper {
|
|||
*/
|
||||
int delete(FormulaPO formula);
|
||||
|
||||
List<FormulaPO> listByIds(Collection<Long> ids);
|
||||
List<FormulaPO> listByIds(@Param("ids")Collection<Long> ids);
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.formula.FormulaMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.formula.po.FormulaPO">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryformula.po.FormulaPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="module" property="module"/>
|
||||
<result column="use" property="use"/>
|
||||
<result column="use_for" property="useFor"/>
|
||||
<result column="reference_type" property="referenceType"/>
|
||||
<result column="return_type" property="returnType"/>
|
||||
<result column="validate_type" property="validateType"/>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
, t.name
|
||||
, t.description
|
||||
, t.module
|
||||
, t.use
|
||||
, t.use_for
|
||||
, t.reference_type
|
||||
, t.return_type
|
||||
, t.validate_type
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.formula.po.FormulaPO">
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salaryformula.po.FormulaPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_formula t
|
||||
|
|
@ -72,8 +72,8 @@
|
|||
<if test="module != null">
|
||||
AND module = #{module}
|
||||
</if>
|
||||
<if test="use != null">
|
||||
AND use = #{use}
|
||||
<if test="useFor != null">
|
||||
AND use_for = #{useFor}
|
||||
</if>
|
||||
<if test="referenceType != null">
|
||||
AND reference_type = #{referenceType}
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.formula.po.FormulaPO"
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryformula.po.FormulaPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_formula
|
||||
|
|
@ -131,8 +131,8 @@
|
|||
<if test="module != null">
|
||||
module,
|
||||
</if>
|
||||
<if test="use != null">
|
||||
use,
|
||||
<if test="useFor != null">
|
||||
use_for,
|
||||
</if>
|
||||
<if test="referenceType != null">
|
||||
reference_type,
|
||||
|
|
@ -175,8 +175,8 @@
|
|||
<if test="module != null">
|
||||
#{module},
|
||||
</if>
|
||||
<if test="use != null">
|
||||
#{use},
|
||||
<if test="useFor != null">
|
||||
#{useFor},
|
||||
</if>
|
||||
<if test="referenceType != null">
|
||||
#{referenceType},
|
||||
|
|
@ -208,9 +208,30 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryformula.po.FormulaPO">
|
||||
UPDATE hrsa_formula
|
||||
<set>
|
||||
name=#{name},
|
||||
description=#{description},
|
||||
module=#{module},
|
||||
use_for=#{useFor},
|
||||
reference_type=#{referenceType},
|
||||
return_type=#{returnType},
|
||||
validate_type=#{validateType},
|
||||
extend_param=#{extendParam},
|
||||
formula=#{formula},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.formula.po.FormulaPO">
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryformula.po.FormulaPO">
|
||||
UPDATE hrsa_formula
|
||||
<set>
|
||||
<if test="name != null">
|
||||
|
|
@ -222,8 +243,8 @@
|
|||
<if test="module != null">
|
||||
module=#{module},
|
||||
</if>
|
||||
<if test="use != null">
|
||||
use=#{use},
|
||||
<if test="useFor != null">
|
||||
use_for=#{useFor},
|
||||
</if>
|
||||
<if test="referenceType != null">
|
||||
reference_type=#{referenceType},
|
||||
|
|
@ -258,7 +279,7 @@
|
|||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.formula.po.FormulaPO">
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.salaryformula.po.FormulaPO">
|
||||
UPDATE hrsa_formula
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.mapper.formula;
|
||||
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -44,13 +44,6 @@ public interface FormulaVarMapper {
|
|||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(FormulaVar formulaVar);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param formulaVar 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(FormulaVar formulaVar);
|
||||
|
||||
|
||||
void deleteByFormulaId(Long formulaId);
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.formula.FormulaVarMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.formula.po.FormulaVar">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryformula.po.FormulaVar">
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="formula_id" property="formulaId"/>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<result column="field_name" property="fieldName"/>
|
||||
<result column="field_type" property="fieldType"/>
|
||||
<result column="source" property="source"/>
|
||||
<result column="order" property="order"/>
|
||||
<result column="order_index" property="orderIndex"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
, t.field_name
|
||||
, t.field_type
|
||||
, t.source
|
||||
, t.order
|
||||
, t.order_index
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
|
|
@ -51,14 +51,12 @@
|
|||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.formula.po.FormulaVar">
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salaryformula.po.FormulaVar">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_formula_var t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
|
|
@ -77,8 +75,8 @@
|
|||
<if test="source != null">
|
||||
AND source = #{source}
|
||||
</if>
|
||||
<if test="order != null">
|
||||
AND order = #{order}
|
||||
<if test="orderIndex != null">
|
||||
AND order_index = #{orderIndex}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
|
|
@ -92,26 +90,17 @@
|
|||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.formula.po.FormulaVar"
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryformula.po.FormulaVar"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_formula_var
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
|
|
@ -130,8 +119,8 @@
|
|||
<if test="source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="order != null">
|
||||
order,
|
||||
<if test="orderIndex != null">
|
||||
order_index,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
|
|
@ -147,9 +136,6 @@
|
|||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
|
|
@ -168,8 +154,8 @@
|
|||
<if test="source != null">
|
||||
#{source},
|
||||
</if>
|
||||
<if test="order != null">
|
||||
#{order},
|
||||
<if test="orderIndex != null">
|
||||
#{orderIndex},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
|
|
@ -187,8 +173,9 @@
|
|||
</insert>
|
||||
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.formula.po.FormulaVar">
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryformula.po.FormulaVar">
|
||||
UPDATE hrsa_formula_var
|
||||
<set>
|
||||
<if test="name != null">
|
||||
|
|
@ -209,8 +196,8 @@
|
|||
<if test="source != null">
|
||||
source=#{source},
|
||||
</if>
|
||||
<if test="order != null">
|
||||
order=#{order},
|
||||
<if test="orderIndex != null">
|
||||
order_index=#{orderIndex},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
|
|
@ -229,13 +216,11 @@
|
|||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.formula.po.FormulaVar">
|
||||
<delete id="deleteByFormulaId" parameterType="com.engine.salary.entity.salaryformula.po.FormulaVar">
|
||||
UPDATE hrsa_formula_var
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
WHERE formula_id = #{formulaId}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.weaver.excel.formula.api.entity.FormulaVar;
|
||||
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -12,6 +13,9 @@ public interface RemoteExcelService {
|
|||
|
||||
List<FormulaVar> fieldList(String sourceId, Map<String, Object> extendParam);
|
||||
|
||||
List<Map<String,Object>> fieldGroupList(Map<String, Object> extendParam);
|
||||
|
||||
|
||||
// ExcelPage<FormulaDataSource> dataSourceList(String categoryId, ExcelPage<FormulaDataSource> page, Map<String, Object> extendParam, SimpleEmployee employee);
|
||||
//
|
||||
// List<FormulaVar> findProperData(String dataId, String fieldId, String fieldType, Map<String, Object> extendParam, SimpleEmployee employee);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -30,4 +31,8 @@ public interface SalaryFormulaService {
|
|||
* @return
|
||||
*/
|
||||
ExpressFormula getExpressFormula(Long formulaId);
|
||||
|
||||
void save(SalaryFormulaSaveParam salaryFormulaSaveParam);
|
||||
|
||||
void update(SalaryFormulaSaveParam salaryFormulaSaveParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
|||
import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.formula.DataType;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
|
||||
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaTaxRateDTO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
|
@ -22,7 +23,6 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.excel.formula.api.entity.FormulaVar;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -130,6 +130,16 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
return vars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> fieldGroupList(Map<String, Object> extendParam) {
|
||||
return Arrays.stream(SalaryFormulaReferenceEnum.values()).map(e -> {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("key", e.getValue());
|
||||
map.put("value", SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()));
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ExcelPage<FormulaDataSource> dataSourceList(String categoryId, ExcelPage<FormulaDataSource> page, Map<String, Object> extendParam, SimpleEmployee employee) {
|
||||
// log.info("categoryId: {}, page: {}", categoryId, JsonUtil.toJsonString(page));
|
||||
|
|
@ -218,7 +228,7 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
|
||||
private List<FormulaVar> salaryItem2FormulaVar(SalaryFormulaReferenceEnum referenceEnum, Map<String, Object> extendParam) {
|
||||
Set<Long> salaryItemIds = Collections.emptySet();
|
||||
Object salarySobId = extendParam.get("salarySobId");
|
||||
Object salarySobId = extendParam == null ? null : extendParam.get("salarySobId");
|
||||
if (Objects.nonNull(salarySobId)) {
|
||||
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(Long.valueOf(String.valueOf(salarySobId)));
|
||||
salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
|
||||
|
|
@ -233,12 +243,9 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
.map(e -> {
|
||||
FormulaVar formulaVar = new FormulaVar();
|
||||
formulaVar.setFieldId(referenceEnum.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + e.getCode());
|
||||
formulaVar.setTitle(e.getName());
|
||||
formulaVar.setFormId("" + referenceEnum.getValue());
|
||||
formulaVar.setDataType(DataType.NUMBER);
|
||||
formulaVar.setModule(SalaryFormulaFieldConstant.MODULE);
|
||||
formulaVar.setProperKey(DataType.NUMBER);
|
||||
formulaVar.setProperKey(e.getDataType());
|
||||
formulaVar.setName(e.getName());
|
||||
formulaVar.setSource("" + referenceEnum.getValue());
|
||||
formulaVar.setFieldType(e.getDataType());
|
||||
return formulaVar;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
|
@ -258,13 +265,11 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
} else {
|
||||
formulaVar.setFieldId(annotation.fieldId());
|
||||
}
|
||||
formulaVar.setModule(SalaryFormulaFieldConstant.MODULE);
|
||||
formulaVar.setTitle(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
|
||||
formulaVar.setFormId(formId);
|
||||
formulaVar.setDataType(annotation.dataType());
|
||||
formulaVar.setProperKey(DataType.NUMBER);
|
||||
formulaVar.setName(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
|
||||
formulaVar.setSource(formId);
|
||||
formulaVar.setFieldType(annotation.dataType());
|
||||
if (StringUtils.equals(formId, "" + SalaryFormulaReferenceEnum.EMPLOYEE_INFO.getValue())) {
|
||||
formulaVar.setProperKey(DataType.STRING);
|
||||
formulaVar.setSource(DataType.STRING);
|
||||
}
|
||||
formulaVars.add(formulaVar);
|
||||
}
|
||||
|
|
@ -279,12 +284,12 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
List<FormulaVar> formulaVars = Lists.newArrayListWithExpectedSize(welfareColumns.size());
|
||||
welfareColumns.forEach((k, v) -> {
|
||||
FormulaVar formulaVar = new FormulaVar();
|
||||
formulaVar.setFieldId(referenceEnum.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + v);
|
||||
formulaVar.setModule(SalaryFormulaFieldConstant.MODULE);
|
||||
formulaVar.setTitle(k);
|
||||
formulaVar.setFormId("" + referenceEnum.getValue());
|
||||
formulaVar.setDataType(DataType.NUMBER);
|
||||
formulaVar.setProperKey(DataType.NUMBER);
|
||||
// formulaVar.setFieldId(referenceEnum.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + v);
|
||||
// formulaVar.setModule(SalaryFormulaFieldConstant.MODULE);
|
||||
// formulaVar.setTitle(k);
|
||||
// formulaVar.setFormId("" + referenceEnum.getValue());
|
||||
// formulaVar.setDataType(DataType.NUMBER);
|
||||
// formulaVar.setProperKey(DataType.NUMBER);
|
||||
formulaVars.add(formulaVar);
|
||||
});
|
||||
return formulaVars;
|
||||
|
|
@ -298,11 +303,9 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
|
|||
List<FormulaVar> formulaVars = fields.stream().map(e -> {
|
||||
FormulaVar formulaVar = new FormulaVar();
|
||||
formulaVar.setFieldId(referenceEnum.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + e.getId());
|
||||
formulaVar.setModule(SalaryFormulaFieldConstant.MODULE);
|
||||
formulaVar.setTitle(e.getFieldName());
|
||||
formulaVar.setFormId("" + referenceEnum.getValue());
|
||||
formulaVar.setDataType(DataType.NUMBER);
|
||||
formulaVar.setProperKey(DataType.NUMBER);
|
||||
formulaVar.setName(e.getFieldName());
|
||||
formulaVar.setSource("" + referenceEnum.getValue());
|
||||
formulaVar.setFieldType(DataType.NUMBER);
|
||||
return formulaVar;
|
||||
}).collect(Collectors.toList());
|
||||
return formulaVars;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import com.engine.salary.entity.datacollection.AddUpSituation;
|
|||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteDataDTO;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryacct.bo.*;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.engine.salary.biz.TaxAgentBiz;
|
|||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
|
|
@ -481,6 +481,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
} catch (Exception e) {
|
||||
log.info("薪资核算出错:{}", e.getMessage(), e);
|
||||
throw new SalaryRunTimeException(e);
|
||||
// salaryAcctProgressService.fail("" + calculateParam.getSalaryAcctRecordId(), SalaryI18nUtil.getI18nLabel(99642, "薪资核算出错") + ": " + e.getMessage());
|
||||
} finally {
|
||||
// 数据库字段加密用
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
|
|
@ -31,7 +32,6 @@ import com.engine.salary.util.page.PageInfo;
|
|||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.formula.po.FormulaPO;
|
||||
import com.engine.salary.entity.formula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
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.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.formula.FormulaMapper;
|
||||
import com.engine.salary.mapper.formula.FormulaVarMapper;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
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.math.NumberUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -86,4 +87,79 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
|
|||
throw new SalaryRunTimeException("获取公示详情失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(SalaryFormulaSaveParam param) {
|
||||
|
||||
FormulaPO formulaPO = new FormulaPO();
|
||||
|
||||
formulaPO.setName(param.getName());
|
||||
formulaPO.setDescription(param.getDescription());
|
||||
formulaPO.setModule(param.getModule());
|
||||
formulaPO.setUseFor(param.getUseFor());
|
||||
formulaPO.setReferenceType(param.getReferenceType());
|
||||
formulaPO.setReturnType(param.getReturnType());
|
||||
formulaPO.setValidateType(param.getValidateType());
|
||||
formulaPO.setExtendParam(param.getExtendParam());
|
||||
formulaPO.setFormula(param.getFormula());
|
||||
formulaPO.setDeleteType(NumberUtils.INTEGER_ZERO);
|
||||
|
||||
Date now = new Date();
|
||||
formulaPO.setCreateTime(now);
|
||||
formulaPO.setUpdateTime(now);
|
||||
formulaPO.setCreator((long) user.getUID());
|
||||
getFormulaMapper().insertIgnoreNull(formulaPO);
|
||||
|
||||
List<FormulaVar> parameters = param.getParameters();
|
||||
parameters.forEach(po -> {
|
||||
po.setFormulaId(formulaPO.getId());
|
||||
po.setDeleteType(NumberUtils.INTEGER_ZERO);
|
||||
po.setCreator((long) user.getUID());
|
||||
po.setCreateTime(now);
|
||||
po.setUpdateTime(now);
|
||||
getFormulaVarMapper().insertIgnoreNull(po);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(SalaryFormulaSaveParam param) {
|
||||
|
||||
ValidUtil.doValidator(param, RuntimeTypeEnum.UPDATE);
|
||||
|
||||
Long id = param.getId();
|
||||
FormulaPO formulaPO = getFormulaMapper().getById(id);
|
||||
if (formulaPO == null) {
|
||||
throw new SalaryRunTimeException("公式不存在或已删除");
|
||||
}
|
||||
|
||||
formulaPO.setName(param.getName());
|
||||
formulaPO.setDescription(param.getDescription());
|
||||
formulaPO.setModule(param.getModule());
|
||||
formulaPO.setUseFor(param.getUseFor());
|
||||
formulaPO.setReferenceType(param.getReferenceType());
|
||||
formulaPO.setReturnType(param.getReturnType());
|
||||
formulaPO.setValidateType(param.getValidateType());
|
||||
formulaPO.setExtendParam(param.getExtendParam());
|
||||
formulaPO.setFormula(param.getFormula());
|
||||
formulaPO.setDeleteType(NumberUtils.INTEGER_ZERO);
|
||||
|
||||
Date now = new Date();
|
||||
formulaPO.setUpdateTime(now);
|
||||
formulaPO.setCreator((long) user.getUID());
|
||||
getFormulaMapper().updateIgnoreNull(formulaPO);
|
||||
|
||||
List<FormulaVar> parameters = param.getParameters();
|
||||
//删除公式下的变量
|
||||
getFormulaVarMapper().deleteByFormulaId(id);
|
||||
parameters.forEach(po -> {
|
||||
po.setCreator((long) user.getUID());
|
||||
po.setCreateTime(now);
|
||||
po.setUpdateTime(now);
|
||||
getFormulaVarMapper().insertIgnoreNull(po);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.salary.biz.SalarySobBiz;
|
|||
import com.engine.salary.biz.SalarySobItemBiz;
|
||||
import com.engine.salary.biz.SalarySobItemGroupBiz;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
|
|
@ -18,7 +19,6 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
|
@ -270,6 +270,9 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
|
||||
@Override
|
||||
public void batchSave(Collection<SalarySobItemPO> salarySobItemPOS) {
|
||||
if (CollectionUtils.isEmpty(salarySobItemPOS)){
|
||||
return;
|
||||
}
|
||||
salarySobItemMapper.batchInsert(salarySobItemPOS);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.transmethod;
|
||||
|
||||
import com.engine.salary.enums.SalaryCycleTypeEnum;
|
||||
import com.engine.salary.enums.SalaryDataSourceEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.AttendQuoteFieldSourceTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.AttendQuoteFieldTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum;
|
||||
|
|
@ -90,7 +90,7 @@ public class TransMethod {
|
|||
* @return
|
||||
*/
|
||||
public static String datasource(String datasource) {
|
||||
return SalaryDataSourceEnum.getDefaultLabelByValue(Integer.valueOf(datasource));
|
||||
return SalaryValueTypeEnum.getDefaultLabelByValue(Integer.valueOf(datasource));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryformula.dto.ExpressFormulaDTO;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaFieldQueryParam;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.SalaryFormulaWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SalaryFormulaController {
|
||||
|
||||
|
||||
private SalaryFormulaWrapper getSalaryFormulaWrapper(User user) {
|
||||
return (SalaryFormulaWrapper) ServiceUtil.getService(SalaryFormulaWrapper.class, user);
|
||||
}
|
||||
|
||||
//变量项
|
||||
@POST
|
||||
@Path("/search/group")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String fieldGroupList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, List<Map<String, Object>>>().run(getSalaryFormulaWrapper(user)::fieldGroupList, param);
|
||||
}
|
||||
|
||||
//变量字段列表
|
||||
@POST
|
||||
@Path("/search/field")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String fieldList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryFormulaFieldQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryFormulaFieldQueryParam, List<FormulaVar>>().run(getSalaryFormulaWrapper(user)::fieldList, param);
|
||||
}
|
||||
|
||||
//获取公式详情
|
||||
@GET
|
||||
@Path("/detail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String detail(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "formulaId") Long formulaId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, ExpressFormulaDTO>().run(getSalaryFormulaWrapper(user)::detail, formulaId);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryFormulaSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryFormulaSaveParam, String>().run(getSalaryFormulaWrapper(user)::save, param);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -19,9 +19,6 @@ import com.engine.salary.service.impl.*;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.weaver.util.threadPool.ThreadPoolUtil;
|
||||
import com.weaver.util.threadPool.constant.ModulePoolEnum;
|
||||
import com.weaver.util.threadPool.entity.LocalRunnable;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -187,13 +184,13 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
// .setMessage(StringUtils.EMPTY);
|
||||
// salaryAcctProgressService.initProgress("" + calculateParam.getSalaryAcctRecordId(), initProgress, simpleEmployee.getEmployeeId(), tenantKey);
|
||||
// 异步执行薪资核算
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCalculate", localRunnable);
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCalculate", localRunnable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
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.param.SalaryFormulaSaveParam;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryformula.bo.SalaryFormulaBO;
|
||||
import com.engine.salary.entity.salaryformula.dto.ExpressFormulaDTO;
|
||||
import com.engine.salary.entity.salaryformula.param.SalaryFormulaFieldQueryParam;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.RemoteExcelService;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.service.impl.RemoteExcelServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryFormulaServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryFormulaWrapper extends Service {
|
||||
|
||||
private RemoteExcelService getRemoteExcelService(User user) {
|
||||
return (RemoteExcelService) ServiceUtil.getService(RemoteExcelServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 公式字段列表
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return
|
||||
*/
|
||||
public List<FormulaVar> fieldList(SalaryFormulaFieldQueryParam param) {
|
||||
return getRemoteExcelService(user).fieldList(param.getSourceId(), param.getExtendParam());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 公式字段分类
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> fieldGroupList(Map<String, Object> param) {
|
||||
return getRemoteExcelService(user).fieldGroupList(param);
|
||||
}
|
||||
|
||||
public ExpressFormulaDTO detail(Long formulaId) {
|
||||
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(Collections.singleton(formulaId));
|
||||
if (CollectionUtils.isEmpty(expressFormulas)) {
|
||||
throw new SalaryRunTimeException("获取公式详情失败");
|
||||
}
|
||||
return SalaryFormulaBO.convert2DTO(expressFormulas).get(0);
|
||||
}
|
||||
|
||||
public void save(SalaryFormulaSaveParam salaryFormulaSaveParam) {
|
||||
getSalaryFormulaService(user).save(salaryFormulaSaveParam);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.formula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobCheckRuleBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleFormDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleListDTO;
|
||||
|
|
|
|||
Loading…
Reference in New Issue