This commit is contained in:
parent
49cd388df1
commit
cb1a53c649
|
|
@ -87,3 +87,43 @@ CREATE TABLE hrsa_tax_agent_base
|
|||
PRIMARY KEY (id) USING BTREE,
|
||||
INDEX idx_tenant_key(tenant_key) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '个税扣缴义务人基础信息表' ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS hrsa_tax_agent_sub_admin;
|
||||
CREATE TABLE hrsa_tax_agent_sub_admin
|
||||
(
|
||||
id bigint(20) NOT NULL COMMENT '主键',
|
||||
tax_agent_id bigint(20) NOT NULL COMMENT '个税扣缴义务人的主键id',
|
||||
employee_id bigint(20) NOT NULL COMMENT '人员信息表的主键id',
|
||||
description varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
create_time datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
update_time datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP (0) COMMENT '更新时间',
|
||||
creator bigint(20) NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
delete_type int(11) NOT NULL DEFAULT 0 COMMENT '是否已删除。0:未删除、1:已删除',
|
||||
tenant_key varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '租户ID',
|
||||
remark text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
PRIMARY KEY (id) USING BTREE,
|
||||
INDEX idx_tenant_key(tenant_key) USING BTREE,
|
||||
INDEX idx_tax_agent_id(tax_agent_id) USING BTREE,
|
||||
INDEX idx_employee_id(employee_id) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '个税扣缴义务人分管理员表' ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS hrsa_tax_agent_sub_admin_emp;
|
||||
CREATE TABLE hrsa_tax_agent_sub_admin_emp
|
||||
(
|
||||
id bigint(20) NOT NULL COMMENT 'ID',
|
||||
create_time datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
update_time datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
creator bigint(20) NULL DEFAULT NULL COMMENT '创建人id',
|
||||
delete_type int(11) NULL DEFAULT 0 COMMENT '是否删除',
|
||||
tenant_key varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户KEY',
|
||||
tax_agent_id bigint(20) NOT NULL DEFAULT 0 COMMENT '个税扣缴义务人的主键id',
|
||||
tax_agent_sub_admin_id bigint(20) NOT NULL DEFAULT 0 COMMENT '个税扣缴义务人的分管理员的id',
|
||||
employee_id bigint(20) NOT NULL DEFAULT 0 COMMENT '人员信息表的主键id',
|
||||
employee_name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员姓名',
|
||||
PRIMARY KEY (id) USING BTREE,
|
||||
INDEX idx_tenant_key(tenant_key) USING BTREE,
|
||||
INDEX idx_tax_agent(tax_agent_id) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
ALTER TABLE hrsa_add_up_deduction ADD COLUMN payment_agency varchar(255) NULL COMMENT '代缴机构' AFTER tenant_key;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
|
@ -93,4 +95,26 @@ public class EmployBiz extends BaseBean {
|
|||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<DeptInfo> getDeptInfoList(List<Long> departmentIds) {
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getDeptInfoList(departmentIds);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<SubCompanyInfo> getSubCompanyInfoList(List<Long> subDepartmentIds) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getSubCompanyInfoList(subDepartmentIds);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
public class SalaryRoleBiz {
|
||||
public String getAllAdminRoleId() {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String salaryAdminRoleId = baseBean.getPropValue("hrmSalary", "chiefAdminRoleId");
|
||||
return salaryAdminRoleId;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +1,27 @@
|
|||
package com.engine.salary.entity.agency.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.weaver.common.distribution.genid.IdGenerator;
|
||||
import com.weaver.hrm.salary.entity.agency.dto.PaymentAgencyFormDTO;
|
||||
import com.weaver.hrm.salary.entity.agency.dto.PaymentAgencyListDTO;
|
||||
import com.weaver.hrm.salary.entity.agency.po.PaymentAgencyPO;
|
||||
import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.entity.agency.dto.PaymentAgencyFormDTO;
|
||||
import com.engine.salary.entity.agency.dto.PaymentAgencyListDTO;
|
||||
import com.engine.salary.entity.agency.po.PaymentAgencyPO;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/4/20 20:59
|
||||
* @Version: v1.0
|
||||
*/
|
||||
|
||||
public class PaymentAgencyBO {
|
||||
|
||||
public static Wrapper<PaymentAgencyPO> buildPaymentAgencyListWrapper(Long employeeId, String tenantKey) {
|
||||
LambdaQueryWrapper<PaymentAgencyPO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(PaymentAgencyPO::getTenantKey, tenantKey);
|
||||
lambdaQueryWrapper.eq(PaymentAgencyPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
lambdaQueryWrapper.orderByDesc(PaymentAgencyPO::getUpdateTime);
|
||||
return lambdaQueryWrapper;
|
||||
}
|
||||
// public static Wrapper<PaymentAgencyPO> buildPaymentAgencyListWrapper(Long employeeId, String tenantKey) {
|
||||
// LambdaQueryWrapper<PaymentAgencyPO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
// lambdaQueryWrapper.eq(PaymentAgencyPO::getTenantKey, tenantKey);
|
||||
// lambdaQueryWrapper.eq(PaymentAgencyPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
// lambdaQueryWrapper.orderByDesc(PaymentAgencyPO::getUpdateTime);
|
||||
// return lambdaQueryWrapper;
|
||||
// }
|
||||
|
||||
public static List<PaymentAgencyListDTO> buildPaymentAgencyDTOList(List<PaymentAgencyPO> paymentAgencyPOS, Long employeeId, String tenantKey) {
|
||||
if (CollectionUtils.isEmpty(paymentAgencyPOS)) {
|
||||
|
|
|
|||
|
|
@ -2,64 +2,57 @@ package com.engine.salary.entity.agency.dto;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.weaver.common.component.form.item.WeaFormItemType;
|
||||
import com.weaver.hrm.salary.annotation.SalaryForm;
|
||||
import com.weaver.hrm.salary.annotation.SalaryFormItem;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/4/20 21:31
|
||||
* @Version: v1.0
|
||||
*/
|
||||
* 代缴机构表单
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("代缴机构表单")
|
||||
public class PaymentAgencyFormDTO {
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
//主键id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@SalaryForm(
|
||||
label = "名称",
|
||||
labelId = 84756,
|
||||
items = {
|
||||
@SalaryFormItem(
|
||||
itemType = WeaFormItemType.INPUT,
|
||||
required = true,
|
||||
maxLength = "50"
|
||||
)
|
||||
}
|
||||
)
|
||||
@NotBlank(message = "name is required")
|
||||
@Size(max = 50, message = "the maximum lenth is 50")
|
||||
@ApiModelProperty("名称")
|
||||
// @SalaryForm(
|
||||
// label = "名称",
|
||||
// labelId = 84756,
|
||||
// items = {
|
||||
// @SalaryFormItem(
|
||||
// itemType = WeaFormItemType.INPUT,
|
||||
// required = true,
|
||||
// maxLength = "50"
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
// @NotBlank(message = "name is required")
|
||||
// @Size(max = 50, message = "the maximum lenth is 50")
|
||||
// //名称")
|
||||
private String agencyName;
|
||||
|
||||
@SalaryForm(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
items = {
|
||||
@SalaryFormItem(
|
||||
itemType = WeaFormItemType.TEXTAREA,
|
||||
maxLength = "50"
|
||||
)
|
||||
}
|
||||
)
|
||||
@NotBlank(message = "name is required")
|
||||
@Size(max = 60, message = "the maximum lenth is 60")
|
||||
@ApiModelProperty("名称")
|
||||
// @SalaryForm(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// items = {
|
||||
// @SalaryFormItem(
|
||||
// itemType = WeaFormItemType.TEXTAREA,
|
||||
// maxLength = "50"
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
// @NotBlank(message = "name is required")
|
||||
// @Size(max = 60, message = "the maximum lenth is 60")
|
||||
// //名称")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,61 +1,55 @@
|
|||
package com.engine.salary.entity.agency.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.weaver.common.authority.format.Operates;
|
||||
import com.weaver.common.authority.format.TableColumn;
|
||||
import com.weaver.common.authority.format.TableOperates;
|
||||
import com.weaver.common.authority.format.WeaFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/4/20 20:41
|
||||
* @Version: v1.0
|
||||
*/
|
||||
* 代缴机构列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("代缴机构列表")
|
||||
@TableOperates(value = {
|
||||
@Operates(index = 0, text = "编辑", labelId = 87058),
|
||||
@Operates(index = 1, text = "删除", labelId = 87061)
|
||||
})
|
||||
//@ApiModel("")
|
||||
//@TableOperates(value = {
|
||||
// @Operates(index = 0, text = "编辑", labelId = 87058),
|
||||
// @Operates(index = 1, text = "删除", labelId = 87061)
|
||||
//})
|
||||
public class PaymentAgencyListDTO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty("主键id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
// @ApiModelProperty("主键id")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 社保福利代缴机构
|
||||
*/
|
||||
@WeaFormat(
|
||||
label = "社保福利代缴机构",
|
||||
labelId = 112448,
|
||||
tableColumn = @TableColumn(width = "200")
|
||||
)
|
||||
@ApiModelProperty("社保福利代缴机构")
|
||||
// @WeaFormat(
|
||||
// label = "社保福利代缴机构",
|
||||
// labelId = 112448,
|
||||
// tableColumn = @TableColumn(width = "200")
|
||||
// )
|
||||
// @ApiModelProperty("社保福利代缴机构")
|
||||
private String agencyName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@WeaFormat(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
tableColumn = @TableColumn(width = "300")
|
||||
)
|
||||
@ApiModelProperty("备注")
|
||||
// @WeaFormat(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// tableColumn = @TableColumn(width = "300")
|
||||
// )
|
||||
// @ApiModelProperty("备注")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.engine.salary.entity.agency.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.weaver.common.elog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -9,65 +7,50 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: zhangheng
|
||||
* @CreateDate: 2022/4/20 20:24
|
||||
* @Version: v1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("hrsa_payment_agency")
|
||||
@ElogTransform(name = "数据采集-累计专项附加扣除表")
|
||||
//hrsa_payment_agency
|
||||
public class PaymentAgencyPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@ElogTransform(name = "机构名称")
|
||||
private String agencyName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ElogTransform(name = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间", ignore = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间", ignore = true)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform(name = "创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.entity.hrm;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class HrmStatus {
|
||||
String id;
|
||||
|
||||
String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.salary.entity.hrm;
|
||||
|
||||
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 SubCompanyInfo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -7,7 +7,10 @@ import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.agency.po.PaymentAgencyPO;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
|
||||
|
|
@ -26,10 +29,6 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.common.component.table.permission.Permission;
|
||||
import com.weaver.common.hrm.cache.HrmDepartmentComInfo;
|
||||
import com.weaver.common.hrm.cache.HrmPositionComInfo;
|
||||
import com.weaver.common.hrm.domain.employee.HrmStatus;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -244,6 +243,7 @@ public class TaxAgentBO {
|
|||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator(employeeId)
|
||||
.deleteType(0)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
}
|
||||
|
|
@ -285,17 +285,17 @@ public class TaxAgentBO {
|
|||
* @return
|
||||
*/
|
||||
public static List<TaxAgentManageRangeListDTO> convert2ListDTO(List<TaxAgentManageRangePO> taxAgentManageRanges, List<DataCollectionEmployee> employeeComInfos,
|
||||
List<HrmDepartmentComInfo> departmentComInfos, List<HrmDepartmentComInfo> subDepartmentComInfos,
|
||||
List<DeptInfo> departmentComInfos, List<SubCompanyInfo> subDepartmentComInfos,
|
||||
List<PositionInfo> positionComInfos, List<HrmStatus> hrmStatusList) {
|
||||
if (CollectionUtils.isEmpty(taxAgentManageRanges)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<Long, String> employeeComInfoMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
|
||||
Map<Long, String> departmentComInfoMap = SalaryEntityUtil.convert2Map(departmentComInfos, HrmDepartmentComInfo::getId, HrmDepartmentComInfo::getName);
|
||||
Map<Long, String> subDepartmentComInfoMap = SalaryEntityUtil.convert2Map(subDepartmentComInfos, HrmDepartmentComInfo::getId, HrmDepartmentComInfo::getName);
|
||||
Map<Long, String> positionComInfoMap = SalaryEntityUtil.convert2Map(positionComInfos, HrmPositionComInfo::getId, HrmPositionComInfo::getName);
|
||||
Map<Long, String> departmentComInfoMap = SalaryEntityUtil.convert2Map(departmentComInfos, DeptInfo::getId, DeptInfo::getName);
|
||||
Map<Long, String> subDepartmentComInfoMap = SalaryEntityUtil.convert2Map(subDepartmentComInfos, SubCompanyInfo::getId, SubCompanyInfo::getName);
|
||||
Map<Long, String> positionComInfoMap = SalaryEntityUtil.convert2Map(positionComInfos, PositionInfo::getId, PositionInfo::getName);
|
||||
|
||||
Map<String, String> hrmStatusNameMap = SalaryEntityUtil.convert2Map(hrmStatusList, hrmStatus -> String.valueOf(hrmStatus.getCodeId()), HrmStatus::getName);
|
||||
Map<String, String> hrmStatusNameMap = SalaryEntityUtil.convert2Map(hrmStatusList, hrmStatus -> String.valueOf(hrmStatus.getId()), HrmStatus::getName);
|
||||
|
||||
return taxAgentManageRanges.stream()
|
||||
.map(taxAgentManageRange -> {
|
||||
|
|
@ -354,14 +354,14 @@ public class TaxAgentBO {
|
|||
}
|
||||
}
|
||||
|
||||
public static Result handleTaxAgentRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long employeeId,
|
||||
String tenantKey) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.TAXAGENT, taxAgentId, 0L, employeeId, tenantKey);
|
||||
public static Result handleTaxAgentRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long employeeId
|
||||
) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.TAXAGENT, taxAgentId, 0L, employeeId);
|
||||
}
|
||||
|
||||
public static Result handleSubAdminRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam, Long taxAgentId, Long subAdminId,
|
||||
Long employeeId, String tenantKey) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.SUBADMIN, taxAgentId, subAdminId, employeeId, tenantKey);
|
||||
Long employeeId) {
|
||||
return handleManageRange(taxAgentManageRanges, saveParam, TaxAgentRangeTypeEnum.SUBADMIN, taxAgentId, subAdminId, employeeId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -372,11 +372,10 @@ public class TaxAgentBO {
|
|||
* @param taxAgentId
|
||||
* @param subAdminId
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
private static Result handleManageRange(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeSaveParam saveParam,
|
||||
TaxAgentRangeTypeEnum rangeTypeEnum, Long taxAgentId, Long subAdminId, Long employeeId, String tenantKey) {
|
||||
TaxAgentRangeTypeEnum rangeTypeEnum, Long taxAgentId, Long subAdminId, Long employeeId) {
|
||||
Date now = new Date();
|
||||
Result handleResult = Result.builder()
|
||||
.needInsertTaxAgentManageRanges(Lists.newArrayList())
|
||||
|
|
@ -408,7 +407,7 @@ public class TaxAgentBO {
|
|||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(tenantKey)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
handleResult.getNeedInsertTaxAgentManageRanges().add(taxAgentManageRange);
|
||||
|
|
|
|||
|
|
@ -1,99 +1,99 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.weaver.common.component.search.item.WeaSearchConditionItemType;
|
||||
import com.weaver.common.component.search.item.WeaSearchConditionOption;
|
||||
import com.weaver.hrm.salary.annotation.SalarySearchCondition;
|
||||
import com.weaver.hrm.salary.annotation.SalarySearchConditionItem;
|
||||
import com.weaver.hrm.salary.enums.SalaryUserStatusEnum;
|
||||
import com.weaver.hrm.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
||||
import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.teams.security.context.TenantContext;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案操作记录
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/24 17:09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxAgentAdjustRecordForFormSearchConditionDTO {
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "个税扣缴义务人",
|
||||
labelId = 86184,
|
||||
needQuickSearch = true,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgent", options = "getTaxAgentOptions()"),
|
||||
}
|
||||
)
|
||||
private String taxAgent;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人选项
|
||||
*/
|
||||
private List<WeaSearchConditionOption> taxAgentOptions;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "调整原因",
|
||||
labelId = 85431,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "adjustReason", options = "getAdjustReasonOptions()"),
|
||||
}
|
||||
)
|
||||
private SalaryArchiveTaxAgentAdjustReasonEnum adjustReason;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "生效日期",
|
||||
labelId = 85904,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "effectiveTime")
|
||||
}
|
||||
)
|
||||
private String effectiveTime;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "操作日期",
|
||||
labelId = 91058,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "operateTime")
|
||||
}
|
||||
)
|
||||
private String operateTime;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "操作人",
|
||||
labelId = 85435,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "resource", browserMultiple = true, name = "operator", browserModule = "hrmsalary")
|
||||
}
|
||||
)
|
||||
private String operator;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "description"),
|
||||
}
|
||||
)
|
||||
private String description;
|
||||
|
||||
private List<WeaSearchConditionOption> getUserStatus(){
|
||||
return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<WeaSearchConditionOption> getAdjustReasonOptions(){
|
||||
return Arrays.stream(SalaryArchiveTaxAgentAdjustReasonEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
//package com.engine.salary.entity.taxagent.dto;
|
||||
//
|
||||
//import com.weaver.common.component.search.item.WeaSearchConditionItemType;
|
||||
//import com.weaver.common.component.search.item.WeaSearchConditionOption;
|
||||
//import com.weaver.hrm.salary.annotation.SalarySearchCondition;
|
||||
//import com.weaver.hrm.salary.annotation.SalarySearchConditionItem;
|
||||
//import com.weaver.hrm.salary.enums.SalaryUserStatusEnum;
|
||||
//import com.weaver.hrm.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
||||
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
//import com.weaver.teams.security.context.TenantContext;
|
||||
//import com.weaver.teams.security.context.UserContext;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * @Description: 薪资档案操作记录
|
||||
// * @Author: wangxiangzhong
|
||||
// * @Date: 2021/11/24 17:09
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class TaxAgentAdjustRecordForFormSearchConditionDTO {
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "个税扣缴义务人",
|
||||
// labelId = 86184,
|
||||
// needQuickSearch = true,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgent", options = "getTaxAgentOptions()"),
|
||||
// }
|
||||
// )
|
||||
// private String taxAgent;
|
||||
//
|
||||
// /**
|
||||
// * 个税扣缴义务人选项
|
||||
// */
|
||||
// private List<WeaSearchConditionOption> taxAgentOptions;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "调整原因",
|
||||
// labelId = 85431,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "adjustReason", options = "getAdjustReasonOptions()"),
|
||||
// }
|
||||
// )
|
||||
// private SalaryArchiveTaxAgentAdjustReasonEnum adjustReason;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "生效日期",
|
||||
// labelId = 85904,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "effectiveTime")
|
||||
// }
|
||||
// )
|
||||
// private String effectiveTime;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "操作日期",
|
||||
// labelId = 91058,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "operateTime")
|
||||
// }
|
||||
// )
|
||||
// private String operateTime;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "操作人",
|
||||
// labelId = 85435,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "resource", browserMultiple = true, name = "operator", browserModule = "hrmsalary")
|
||||
// }
|
||||
// )
|
||||
// private String operator;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "description"),
|
||||
// }
|
||||
// )
|
||||
// private String description;
|
||||
//
|
||||
// private List<WeaSearchConditionOption> getUserStatus(){
|
||||
// return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// private List<WeaSearchConditionOption> getAdjustReasonOptions(){
|
||||
// return Arrays.stream(SalaryArchiveTaxAgentAdjustReasonEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,136 +1,136 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.weaver.common.authority.format.TableColumn;
|
||||
import com.weaver.common.authority.format.TableOperates;
|
||||
import com.weaver.common.authority.format.WeaFormat;
|
||||
import com.weaver.common.component.table.type.WeaTableTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人调整记录列表
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 16:34
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("个税扣缴义务人调整记录列表")
|
||||
@TableOperates(tableType = WeaTableTypeEnum.CHECKBOX)
|
||||
public class TaxAgentAdjustRecordListDTO {
|
||||
@ApiModelProperty("主键id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 人员信息表的主键id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
@WeaFormat(
|
||||
label = "姓名",
|
||||
labelId = 85429,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("部门")
|
||||
@WeaFormat(
|
||||
label = "部门",
|
||||
labelId = 86185,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String departmentName;
|
||||
|
||||
@ApiModelProperty("员工状态")
|
||||
@WeaFormat(
|
||||
label = "员工状态",
|
||||
labelId = 86187,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String employeeStatus;
|
||||
|
||||
@ApiModelProperty("调整前")
|
||||
@WeaFormat(
|
||||
label = "调整前",
|
||||
labelId = 85433,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String adjustBefore;
|
||||
|
||||
@ApiModelProperty("调整后")
|
||||
@WeaFormat(
|
||||
label = "调整后",
|
||||
labelId = 85434,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String adjustAfter;
|
||||
|
||||
@ApiModelProperty("调整原因")
|
||||
@WeaFormat(
|
||||
label = "调整原因",
|
||||
labelId = 85431,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String adjustReason;
|
||||
|
||||
@ApiModelProperty("生效日期")
|
||||
@WeaFormat(
|
||||
label = "生效日期",
|
||||
labelId = 85904,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate effectiveTime;
|
||||
|
||||
@ApiModelProperty("操作人")
|
||||
@WeaFormat(
|
||||
label = "操作人",
|
||||
labelId = 85435,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String operator;
|
||||
|
||||
@ApiModelProperty("操作时间")
|
||||
@WeaFormat(
|
||||
label = "操作时间",
|
||||
labelId = 85436,
|
||||
tableColumn = @TableColumn(width = "150")
|
||||
)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date operateTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@WeaFormat(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
tableColumn = @TableColumn(width = "100")
|
||||
)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 薪资档案id
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Long salaryArchiveId;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Long taxAgentId;
|
||||
|
||||
}
|
||||
//package com.engine.salary.entity.taxagent.dto;
|
||||
//
|
||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
//import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
//import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
//import com.weaver.common.authority.format.TableColumn;
|
||||
//import com.weaver.common.authority.format.TableOperates;
|
||||
//import com.weaver.common.authority.format.WeaFormat;
|
||||
//import com.weaver.common.component.table.type.WeaTableTypeEnum;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import java.time.LocalDate;
|
||||
//import java.util.Date;
|
||||
//
|
||||
///**
|
||||
// * @Description: 个税扣缴义务人调整记录列表
|
||||
// * @Author: wangxiangzhong
|
||||
// * @Date: 2021/11/1 16:34
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("个税扣缴义务人调整记录列表")
|
||||
//@TableOperates(tableType = WeaTableTypeEnum.CHECKBOX)
|
||||
//public class TaxAgentAdjustRecordListDTO {
|
||||
// @ApiModelProperty("主键id")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
// private Long id;
|
||||
//
|
||||
// /**
|
||||
// * 人员信息表的主键id
|
||||
// */
|
||||
// private Long employeeId;
|
||||
//
|
||||
// @ApiModelProperty("姓名")
|
||||
// @WeaFormat(
|
||||
// label = "姓名",
|
||||
// labelId = 85429,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String username;
|
||||
//
|
||||
// @ApiModelProperty("部门")
|
||||
// @WeaFormat(
|
||||
// label = "部门",
|
||||
// labelId = 86185,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String departmentName;
|
||||
//
|
||||
// @ApiModelProperty("员工状态")
|
||||
// @WeaFormat(
|
||||
// label = "员工状态",
|
||||
// labelId = 86187,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String employeeStatus;
|
||||
//
|
||||
// @ApiModelProperty("调整前")
|
||||
// @WeaFormat(
|
||||
// label = "调整前",
|
||||
// labelId = 85433,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String adjustBefore;
|
||||
//
|
||||
// @ApiModelProperty("调整后")
|
||||
// @WeaFormat(
|
||||
// label = "调整后",
|
||||
// labelId = 85434,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String adjustAfter;
|
||||
//
|
||||
// @ApiModelProperty("调整原因")
|
||||
// @WeaFormat(
|
||||
// label = "调整原因",
|
||||
// labelId = 85431,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String adjustReason;
|
||||
//
|
||||
// @ApiModelProperty("生效日期")
|
||||
// @WeaFormat(
|
||||
// label = "生效日期",
|
||||
// labelId = 85904,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd")
|
||||
// private LocalDate effectiveTime;
|
||||
//
|
||||
// @ApiModelProperty("操作人")
|
||||
// @WeaFormat(
|
||||
// label = "操作人",
|
||||
// labelId = 85435,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String operator;
|
||||
//
|
||||
// @ApiModelProperty("操作时间")
|
||||
// @WeaFormat(
|
||||
// label = "操作时间",
|
||||
// labelId = 85436,
|
||||
// tableColumn = @TableColumn(width = "150")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date operateTime;
|
||||
//
|
||||
// @ApiModelProperty("备注")
|
||||
// @WeaFormat(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// tableColumn = @TableColumn(width = "100")
|
||||
// )
|
||||
// private String description;
|
||||
//
|
||||
// /**
|
||||
// * 薪资档案id
|
||||
// */
|
||||
// @JsonIgnore
|
||||
// private Long salaryArchiveId;
|
||||
//
|
||||
// /**
|
||||
// * 个税扣缴义务人id
|
||||
// */
|
||||
// @JsonIgnore
|
||||
// private Long taxAgentId;
|
||||
//
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,139 +1,139 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.weaver.common.component.search.item.WeaSearchConditionItemType;
|
||||
import com.weaver.common.component.search.item.WeaSearchConditionOption;
|
||||
import com.weaver.hrm.salary.annotation.SalarySearchCondition;
|
||||
import com.weaver.hrm.salary.annotation.SalarySearchConditionItem;
|
||||
import com.weaver.hrm.salary.enums.SalaryUserStatusEnum;
|
||||
import com.weaver.hrm.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
||||
import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.teams.api.user.UserStatus;
|
||||
import com.weaver.teams.security.context.TenantContext;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 薪资档案操作记录
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/24 17:09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxAgentAdjustRecordSearchConditionDTO {
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "姓名",
|
||||
labelId = 85429,
|
||||
needQuickSearch = true,
|
||||
quickSearchKey = "username",
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "username"),
|
||||
}
|
||||
)
|
||||
private String username;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "岗位",
|
||||
labelId = 90633,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "position", browserMultiple = true, name = "position", browserModule = "hrmsalary")
|
||||
}
|
||||
)
|
||||
private String position;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "状态",
|
||||
labelId = 91075,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "status", options = "getUserStatus()")
|
||||
}
|
||||
)
|
||||
private UserStatus status;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "部门",
|
||||
labelId = 86185,
|
||||
needQuickSearch = true,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "department", browserMultiple = true, name = "department", browserModule = "hrmsalary")
|
||||
}
|
||||
)
|
||||
private String department;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "个税扣缴义务人",
|
||||
labelId = 86184,
|
||||
needQuickSearch = true,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgent", options = "getTaxAgentOptions()"),
|
||||
}
|
||||
)
|
||||
private String taxAgent;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人选项
|
||||
*/
|
||||
private List<WeaSearchConditionOption> taxAgentOptions;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "调整原因",
|
||||
labelId = 85431,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "adjustReason", options = "getAdjustReasonOptions()"),
|
||||
}
|
||||
)
|
||||
private SalaryArchiveTaxAgentAdjustReasonEnum adjustReason;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "生效日期",
|
||||
labelId = 85904,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "effectiveTime")
|
||||
}
|
||||
)
|
||||
private String effectiveTime;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "操作日期",
|
||||
labelId = 91058,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "operateTime")
|
||||
}
|
||||
)
|
||||
private String operateTime;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "操作人",
|
||||
labelId = 85435,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "resource", browserMultiple = true, name = "operator", browserModule = "hrmsalary")
|
||||
}
|
||||
)
|
||||
private String operator;
|
||||
|
||||
@SalarySearchCondition(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
items = {
|
||||
@SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "description"),
|
||||
}
|
||||
)
|
||||
private String description;
|
||||
|
||||
private List<WeaSearchConditionOption> getUserStatus(){
|
||||
return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<WeaSearchConditionOption> getAdjustReasonOptions(){
|
||||
return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
//package com.engine.salary.entity.taxagent.dto;
|
||||
//
|
||||
//import com.weaver.common.component.search.item.WeaSearchConditionItemType;
|
||||
//import com.weaver.common.component.search.item.WeaSearchConditionOption;
|
||||
//import com.weaver.hrm.salary.annotation.SalarySearchCondition;
|
||||
//import com.weaver.hrm.salary.annotation.SalarySearchConditionItem;
|
||||
//import com.weaver.hrm.salary.enums.SalaryUserStatusEnum;
|
||||
//import com.weaver.hrm.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
|
||||
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
//import com.weaver.teams.api.user.UserStatus;
|
||||
//import com.weaver.teams.security.context.TenantContext;
|
||||
//import com.weaver.teams.security.context.UserContext;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * @Description: 薪资档案操作记录
|
||||
// * @Author: wangxiangzhong
|
||||
// * @Date: 2021/11/24 17:09
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class TaxAgentAdjustRecordSearchConditionDTO {
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "姓名",
|
||||
// labelId = 85429,
|
||||
// needQuickSearch = true,
|
||||
// quickSearchKey = "username",
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "username"),
|
||||
// }
|
||||
// )
|
||||
// private String username;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "岗位",
|
||||
// labelId = 90633,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "position", browserMultiple = true, name = "position", browserModule = "hrmsalary")
|
||||
// }
|
||||
// )
|
||||
// private String position;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "状态",
|
||||
// labelId = 91075,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "status", options = "getUserStatus()")
|
||||
// }
|
||||
// )
|
||||
// private UserStatus status;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "部门",
|
||||
// labelId = 86185,
|
||||
// needQuickSearch = true,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "department", browserMultiple = true, name = "department", browserModule = "hrmsalary")
|
||||
// }
|
||||
// )
|
||||
// private String department;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "个税扣缴义务人",
|
||||
// labelId = 86184,
|
||||
// needQuickSearch = true,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgent", options = "getTaxAgentOptions()"),
|
||||
// }
|
||||
// )
|
||||
// private String taxAgent;
|
||||
//
|
||||
// /**
|
||||
// * 个税扣缴义务人选项
|
||||
// */
|
||||
// private List<WeaSearchConditionOption> taxAgentOptions;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "调整原因",
|
||||
// labelId = 85431,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "adjustReason", options = "getAdjustReasonOptions()"),
|
||||
// }
|
||||
// )
|
||||
// private SalaryArchiveTaxAgentAdjustReasonEnum adjustReason;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "生效日期",
|
||||
// labelId = 85904,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "effectiveTime")
|
||||
// }
|
||||
// )
|
||||
// private String effectiveTime;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "操作日期",
|
||||
// labelId = 91058,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "operateTime")
|
||||
// }
|
||||
// )
|
||||
// private String operateTime;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "操作人",
|
||||
// labelId = 85435,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, browserType = "resource", browserMultiple = true, name = "operator", browserModule = "hrmsalary")
|
||||
// }
|
||||
// )
|
||||
// private String operator;
|
||||
//
|
||||
// @SalarySearchCondition(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// items = {
|
||||
// @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "description"),
|
||||
// }
|
||||
// )
|
||||
// private String description;
|
||||
//
|
||||
// private List<WeaSearchConditionOption> getUserStatus(){
|
||||
// return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// private List<WeaSearchConditionOption> getAdjustReasonOptions(){
|
||||
// return Arrays.stream(SalaryUserStatusEnum.values()).map(m->new WeaSearchConditionOption(m.name(), SalaryI18nUtil.getI18nLabel(TenantContext.getCurrentTenantKey(), UserContext.getCurrentEmployeeId(), m.getLabelId(), m.getDefaultLabel()))).collect(Collectors.toList());
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,30 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.weaver.common.component.form.item.WeaFormItemType;
|
||||
import com.weaver.hrm.salary.annotation.SalaryForm;
|
||||
import com.weaver.hrm.salary.annotation.SalaryFormItem;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人基础信息
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/21 10:00
|
||||
*/
|
||||
* 个税扣缴义务人基础信息表单
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("个税扣缴义务人基础信息表单")
|
||||
public class TaxAgentBaseFormDTO {
|
||||
|
||||
@SalaryForm(
|
||||
label = "启用分权",
|
||||
labelId = 106270,
|
||||
items = {
|
||||
@SalaryFormItem(itemType = WeaFormItemType.SWITCH)
|
||||
}
|
||||
)
|
||||
@ApiModelProperty("启用分权")
|
||||
// @SalaryForm(
|
||||
// label = "启用分权",
|
||||
// labelId = 106270,
|
||||
// items = {
|
||||
// @SalaryFormItem(itemType = WeaFormItemType.SWITCH)
|
||||
// }
|
||||
// )
|
||||
private Boolean devolutionStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,37 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人以及管理范围中的人员
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/24 14:44
|
||||
*/
|
||||
* 个税扣缴义务人以及管理范围中的人员
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("个税扣缴义务人以及管理范围中的人员")
|
||||
public class TaxAgentEmployeeDTO {
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
@ApiModelProperty("个税扣缴义务人id")
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* 个税扣缴义务人名称
|
||||
*/
|
||||
@ApiModelProperty("个税扣缴义务人名称")
|
||||
private String taxAgentName;
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
@ApiModelProperty("人员id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
@ApiModelProperty("名字")
|
||||
private String username;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,29 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 管理范围的人员与个税扣缴义务人的关联数据
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/22 17:08
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 管理范围的人员与个税扣缴义务人的关联数据
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@ApiModel("管理范围的人员与个税扣缴义务人的关联数据")
|
||||
public class TaxAgentEmployeeTaxAgentDTO {
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
@ApiModelProperty("人员id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id列表
|
||||
*/
|
||||
@ApiModelProperty("个税扣缴义务人id列表")
|
||||
private List<Long> taxAgentIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@ package com.engine.salary.entity.taxagent.dto;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.weaver.common.authority.format.Operates;
|
||||
import com.weaver.common.authority.format.TableColumn;
|
||||
import com.weaver.common.authority.format.TableOperates;
|
||||
import com.weaver.common.authority.format.WeaFormat;
|
||||
import com.weaver.common.component.table.type.WeaTableTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -23,30 +16,27 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("个税扣缴义务人列表")
|
||||
@TableOperates(value = {
|
||||
@Operates(index = 0, text = "编辑" ,labelId = 59943),
|
||||
@Operates(index = 1, text = "删除" ,labelId = 59942)
|
||||
}, tableType = WeaTableTypeEnum.NONE)
|
||||
//@ApiModel("个税扣缴义务人列表")
|
||||
//@TableOperates(value = {
|
||||
// @Operates(index = 0, text = "编辑" ,labelId = 59943),
|
||||
// @Operates(index = 1, text = "删除" ,labelId = 59942)
|
||||
//}, tableType = WeaTableTypeEnum.NONE)
|
||||
public class TaxAgentListDTO {
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("个税扣缴义务人名称")
|
||||
@WeaFormat(
|
||||
label = "个税扣缴义务人名称",
|
||||
labelId = 91558,
|
||||
tableColumn = @TableColumn(width = "40%")
|
||||
)
|
||||
// @WeaFormat(
|
||||
// label = "个税扣缴义务人名称",
|
||||
// labelId = 91558,
|
||||
// tableColumn = @TableColumn(width = "40%")
|
||||
// )
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@WeaFormat(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
tableColumn = @TableColumn(width = "40%")
|
||||
)
|
||||
// @WeaFormat(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// tableColumn = @TableColumn(width = "40%")
|
||||
// )
|
||||
private String description;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,35 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.weaver.common.component.browser.combination.TypesBrowserOption;
|
||||
import com.weaver.common.component.form.item.WeaFormItemType;
|
||||
import com.weaver.hrm.salary.annotation.SalaryForm;
|
||||
import com.weaver.hrm.salary.annotation.SalaryFormItem;
|
||||
import com.weaver.hrm.salary.enums.salarysob.TargetTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 范围表单
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/03/23 09:15
|
||||
*/
|
||||
* 范围表单
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("范围表单")
|
||||
public class TaxAgentManageRangeFormDTO {
|
||||
|
||||
@SalaryForm(
|
||||
label = "对象类型",
|
||||
labelId = 90394,
|
||||
items = {
|
||||
@SalaryFormItem(required = true, itemType = WeaFormItemType.TYPESBROWSER, options = "getTargetOptions()",
|
||||
browserModule = "hrmsalary", browserType = "hrmcombination", browserMultiple = true)
|
||||
}
|
||||
)
|
||||
@ApiModelProperty("对象类型")
|
||||
//对象类型
|
||||
private TargetTypeEnum targetType;
|
||||
|
||||
private List<TypesBrowserOption> targetOptions;
|
||||
// private List<TypesBrowserOption> targetOptions;
|
||||
|
||||
@ApiModelProperty("对象id")
|
||||
//对象id")
|
||||
private Long targetId;
|
||||
|
||||
@SalaryForm(
|
||||
label = "选择人员状态",
|
||||
labelId = 87825,
|
||||
items = {
|
||||
@SalaryFormItem(required = true, itemType = WeaFormItemType.CHECKBOX)
|
||||
}
|
||||
)
|
||||
@ApiModelProperty("人员状态")
|
||||
private Collection<String> employeeStatus;
|
||||
private Collection<HrmStatus> employeeStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.weaver.common.authority.format.Form;
|
||||
import com.weaver.common.authority.format.WeaFormat;
|
||||
import com.weaver.common.component.form.item.WeaFormItemType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -13,33 +8,26 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人分管理员基础设置表单
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/10/29 16:12
|
||||
*/
|
||||
* 个税扣缴义务人分管理员基础设置表单
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("个税扣缴义务人分管理员基础设置表单")
|
||||
public class TaxAgentSubAdminBaseFormDTO {
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
//主键id
|
||||
private Long id;
|
||||
|
||||
@WeaFormat(
|
||||
label = "分管理员",
|
||||
labelId = 106283,
|
||||
from = @Form(itemType = WeaFormItemType.BROWSER, required = true, browserModule = "hrmsalary", browserType = "resource")
|
||||
)
|
||||
@ApiModelProperty("分管理员")
|
||||
|
||||
//分管理员
|
||||
private List<TaxAgentEmployeeOptionDTO> subAdminUser;
|
||||
|
||||
@WeaFormat(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
from = @Form(itemType = WeaFormItemType.INPUT, maxLength = "20")
|
||||
)
|
||||
@ApiModelProperty("备注")
|
||||
//备注
|
||||
private String description;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,40 @@
|
|||
package com.engine.salary.entity.taxagent.dto;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.weaver.common.authority.format.Operates;
|
||||
import com.weaver.common.authority.format.TableColumn;
|
||||
import com.weaver.common.authority.format.TableOperates;
|
||||
import com.weaver.common.authority.format.WeaFormat;
|
||||
import com.weaver.common.component.table.type.WeaTableTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人分管理员列表
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/03/21 15:39
|
||||
*/
|
||||
* 个税扣缴义务人分管理员列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("个税扣缴义务人分管理员列表")
|
||||
@TableOperates(value = {
|
||||
@Operates(index = 0, text = "编辑" ,labelId = 59943),
|
||||
@Operates(index = 1, text = "删除" ,labelId = 59942)
|
||||
}, tableType = WeaTableTypeEnum.NONE)
|
||||
public class TaxAgentSubAdminListDTO {
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
//主键id
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("分管理员")
|
||||
@WeaFormat(
|
||||
label = "分管理员",
|
||||
labelId = 106283,
|
||||
tableColumn = @TableColumn(width = "30%")
|
||||
)
|
||||
//分管理员
|
||||
@TableTitle(title = "分管理员", key = "subAdmin", dataIndex = "subAdmin")
|
||||
private String subAdmin;
|
||||
|
||||
@ApiModelProperty("管理范围")
|
||||
@WeaFormat(
|
||||
label = "管理范围",
|
||||
labelId = 106250,
|
||||
tableColumn = @TableColumn(width = "30%")
|
||||
)
|
||||
//管理范围
|
||||
@TableTitle(title = "管理范围", key = "range", dataIndex = "range")
|
||||
private String range;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@WeaFormat(
|
||||
label = "备注",
|
||||
labelId = 84961,
|
||||
tableColumn = @TableColumn(width = "40%")
|
||||
)
|
||||
//备注
|
||||
@TableTitle(title = "备注", key = "description", dataIndex = "description")
|
||||
private String description;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxagent.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -20,8 +21,10 @@ import lombok.NoArgsConstructor;
|
|||
public class TaxAgentAdminChangeCheckParam {
|
||||
|
||||
//个税扣缴义务人id
|
||||
@DataCheck(require = true,message = "个税扣缴义务人id为空")
|
||||
private Long taxAgentId;
|
||||
|
||||
//管理员主键id
|
||||
@DataCheck(require = true,message = "管理员主键为空")
|
||||
private Long adminUserId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.taxagent.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,6 +22,7 @@ import lombok.NoArgsConstructor;
|
|||
public class TaxAgentSaveParam {
|
||||
|
||||
//主键id
|
||||
@DataCheck(require = true, message = "id为空", runtime = {RuntimeTypeEnum.UPDATE})
|
||||
private Long id;
|
||||
|
||||
//名称
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxagent.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -24,5 +25,6 @@ public class TaxAgentSubAdminBaseFormParam {
|
|||
private Long id;
|
||||
|
||||
//个税扣缴义务人的id
|
||||
@DataCheck(require = true, message = "个税扣缴义务人的id为空")
|
||||
private Long taxAgentId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.taxagent.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,5 +22,6 @@ import lombok.NoArgsConstructor;
|
|||
public class TaxAgentSubAdminQueryParam extends BaseQueryParam {
|
||||
|
||||
//个税扣缴义务人id
|
||||
@DataCheck(require = true,message = "个税扣缴义务人id为空")
|
||||
private Long taxAgentId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,6 @@ public class TaxAgentAdminPO {
|
|||
|
||||
|
||||
private Collection<Long> taxAgentIds;
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -56,4 +57,5 @@ public class TaxAgentBasePO {
|
|||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -82,4 +83,6 @@ public class TaxAgentEmpChangePO {
|
|||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,4 +69,5 @@ public class TaxAgentEmpPO {
|
|||
private Date updateTime;
|
||||
|
||||
private Collection<Long> taxAgentIds;
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 员工基本信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -33,4 +35,6 @@ public class TaxAgentEmployeePO {
|
|||
|
||||
//人事状态")
|
||||
private String personnelStatus;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -67,4 +68,6 @@ public class TaxAgentPO {
|
|||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -71,4 +72,7 @@ public class TaxAgentSubAdminEmpPO {
|
|||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -67,4 +68,7 @@ public class TaxAgentSubAdminPO {
|
|||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.salary.enums;
|
||||
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -83,5 +85,11 @@ public enum UserStatusEnum {
|
|||
return Arrays.stream(UserStatusEnum.values()).filter(v -> v != INVALID).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<HrmStatus> getHrmStatusList() {
|
||||
return Arrays.stream(UserStatusEnum.values())
|
||||
.filter(v -> v != INVALID)
|
||||
.map(v -> HrmStatus.builder().id(v.value.toString()).name(v.description).build()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
package com.engine.salary.enums.taxagent;
|
||||
|
||||
import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Description: 范围类型
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-17 14:37
|
||||
*/
|
||||
* 范围类型
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum TaxAgentRangeTypeEnum {
|
||||
|
||||
TAXAGENT(1, "个税扣缴义务人", 86184),
|
||||
|
|
@ -40,7 +43,7 @@ public enum TaxAgentRangeTypeEnum {
|
|||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value, Long employeeId, String tenantKey) {
|
||||
Optional<TaxAgentRangeTypeEnum> optional = Arrays.stream(TaxAgentRangeTypeEnum.values()).filter(r->Integer.valueOf(r.getValue()).equals(value)).findFirst();
|
||||
return optional.isPresent()?SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, optional.get().getLabelId(), optional.get().getDefaultLabel()):"";
|
||||
Optional<TaxAgentRangeTypeEnum> optional = Arrays.stream(TaxAgentRangeTypeEnum.values()).filter(r -> Integer.valueOf(r.getValue()).equals(value)).findFirst();
|
||||
return optional.isPresent() ? SalaryI18nUtil.getI18nLabel(optional.get().getLabelId(), optional.get().getDefaultLabel()) : "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.engine.salary.mapper.datacollection;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -11,31 +13,36 @@ import java.util.List;
|
|||
|
||||
@Mapper
|
||||
public interface EmployMapper {
|
||||
/**
|
||||
* 获取所有员工
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listEmployee();
|
||||
/**
|
||||
* 获取所有员工
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listEmployee();
|
||||
|
||||
List<DataCollectionEmployee> getEmployeeByIds(@Param("collection") List<Long> ids);
|
||||
List<DataCollectionEmployee> getEmployeeByIds(@Param("collection") List<Long> ids);
|
||||
|
||||
List<DataCollectionEmployee> getEmployeeByIdsAll(@Param("collection") List<Long> ids);
|
||||
List<DataCollectionEmployee> getEmployeeByIdsAll(@Param("collection") List<Long> ids);
|
||||
|
||||
List<PositionInfo> listPositionInfo(@Param("collection") List<Long> ids);
|
||||
List<DataCollectionEmployee> getAdminEmployeeByIds(@Param("collection") List<Long> list);
|
||||
|
||||
List<DataCollectionEmployee> getAdminEmployeeByIds(@Param("collection") List<Long> list);
|
||||
List<DataCollectionEmployee> getEmployeeIdsByUserName(@Param("userName") String userName);
|
||||
|
||||
List<DataCollectionEmployee> getEmployeeIdsByUserName(@Param("userName") String userName);
|
||||
/**
|
||||
* 根据薪资账套的人员范围转换而成的查询参数查询人员
|
||||
*
|
||||
* @param queryParams 薪资账套的人员范围转换而成的查询参数
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listByParams(@Param("params") Collection<SalarySobRangeEmpQueryParam> queryParams);
|
||||
|
||||
/**
|
||||
* 根据薪资账套的人员范围转换而成的查询参数查询人员
|
||||
*
|
||||
* @param queryParams 薪资账套的人员范围转换而成的查询参数
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listByParams(@Param("params") Collection<SalarySobRangeEmpQueryParam> queryParams);
|
||||
DataCollectionEmployee getEmployeeById(Long employeeId);
|
||||
|
||||
DataCollectionEmployee getEmployeeById(Long employeeId);
|
||||
List<DataCollectionEmployee> listAll();
|
||||
|
||||
List<DataCollectionEmployee> listAll();
|
||||
List<PositionInfo> listPositionInfo(@Param("collection") List<Long> ids);
|
||||
|
||||
List<DeptInfo> getDeptInfoList(@Param("departmentIds") List<Long> departmentIds);
|
||||
|
||||
List<SubCompanyInfo> getSubCompanyInfoList(List<Long> subDepartmentIds);
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
<if test="userName != null and userName != ''">
|
||||
AND
|
||||
(
|
||||
a.lastname like '%'||#{userName}||'%'
|
||||
a.lastname like '%'||#{userName}||'%'
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
|
@ -177,7 +177,7 @@
|
|||
|
||||
<select id="getEmployeeIdsByUserName" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||
select
|
||||
a.LASTNAME as username
|
||||
a.LASTNAME as username
|
||||
from hrmresource a
|
||||
where
|
||||
1 = 1
|
||||
|
|
@ -205,4 +205,31 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="getDeptInfoList" resultType="com.engine.salary.entity.hrm.DeptInfo">
|
||||
select d.departmentname as name,
|
||||
d.id as id
|
||||
from hrmdepartment d
|
||||
where 1=1
|
||||
<if test="departmentIds != null and departmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getSubCompanyInfoList" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
|
||||
select d.subcompanyname as name,
|
||||
d.id as id
|
||||
from hrmsubcompany d
|
||||
where 1=1
|
||||
<if test="subDepartmentIds != null and subDepartmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="subDepartmentIds" open="(" item="subDepartmentId" separator="," close=")">
|
||||
#{subDepartmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.mapper.taxagent;
|
|||
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -65,5 +66,9 @@ public interface TaxAgentManageRangeMapper {
|
|||
*/
|
||||
int delete(TaxAgentManageRangePO taxAgentManageRange);
|
||||
|
||||
void deleteByIds(Collection<Long> ids);
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteByTaxAgentIds(@Param("taxAgentIds") Collection<Long> taxAgentIds);
|
||||
|
||||
void deleteBySubAdminIds(Collection<Long> subAdminIds);
|
||||
}
|
||||
|
|
@ -304,5 +304,26 @@
|
|||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByTaxAgentIds">
|
||||
UPDATE hrsa_tax_agent_manage_range
|
||||
SET delete_type=1
|
||||
WHERE
|
||||
tax_agent_id IN
|
||||
<foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBySubAdminIds">
|
||||
UPDATE hrsa_tax_agent_manage_range
|
||||
SET delete_type=1
|
||||
WHERE
|
||||
tax_agent_sub_admin_id IN
|
||||
<foreach collection="subAdminIds" open="(" item="subAdminId" separator="," close=")">
|
||||
#{subAdminId}
|
||||
</foreach>
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -42,7 +42,6 @@ public interface TaxAgentAdminService {
|
|||
* 根据个税扣缴义务人id查询管理员
|
||||
*
|
||||
* @param taxAgentIds
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
List<TaxAgentAdminPO> listByTaxAgentIdsAndEmployeeId(Collection<Long> taxAgentIds, Long currentEmployeeId);
|
||||
|
|
|
|||
|
|
@ -87,25 +87,22 @@ public interface TaxAgentManageRangeService {
|
|||
* 保存
|
||||
*
|
||||
* @param saveParam 保存参数
|
||||
* @param employeeId 人员id
|
||||
*/
|
||||
void save(TaxAgentRangeSaveParam saveParam, Long employeeId);
|
||||
void save(TaxAgentRangeSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 保存分管理员的管理范围
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
*/
|
||||
void save4SubAdmin(TaxAgentSubAdminRangeSaveParam saveParam, Long employeeId);
|
||||
void save4SubAdmin(TaxAgentSubAdminRangeSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 根据主键id删除管理范围
|
||||
*
|
||||
* @param ids
|
||||
* @param employeeId
|
||||
*/
|
||||
void deleteByIds(Collection<Long> ids, Long employeeId);
|
||||
void deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据个税扣缴义务人的id删除管理范围
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ public interface TaxAgentSubAdminEmpService{
|
|||
*
|
||||
* @param subAdminEmpSaveParamList
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
*/
|
||||
void syncTaxAgentSubAdminEmployee(List<TaxAgentSubAdminEmpSaveParam> subAdminEmpSaveParamList, Long employeeId);
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ public interface TaxAgentSubAdminEmpService{
|
|||
* 根据分管理员id获取人员
|
||||
*
|
||||
* @param subAdminIds
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
List<TaxAgentSubAdminEmpPO> listBySubAdminIds(List<Long> subAdminIds);
|
||||
|
|
@ -38,7 +36,6 @@ public interface TaxAgentSubAdminEmpService{
|
|||
* 根据分管理员id删除人员
|
||||
*
|
||||
* @param subAdminIds
|
||||
* @param tenantKey
|
||||
*/
|
||||
void deleteBySubAdminIds(Collection<Long> subAdminIds);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,10 +60,9 @@ public interface TaxAgentSubAdminService {
|
|||
* 根据id删除分管理员
|
||||
*
|
||||
* @param ids
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
String deleteByIds(Collection<Long> ids, Long employeeId);
|
||||
String deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据分管理员id和个税扣缴义务人id获取分管理员
|
||||
|
|
@ -77,8 +76,7 @@ public interface TaxAgentSubAdminService {
|
|||
* 保存基础设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
String saveBase(TaxAgentSubAdminBaseSaveParam saveParam, Long employeeId);
|
||||
String saveBase(TaxAgentSubAdminBaseSaveParam saveParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,10 +125,9 @@ public interface TaxAgentV2Service {
|
|||
* 新建个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
String save(TaxAgentSaveParam saveParam, Long employeeId);
|
||||
String save(TaxAgentSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 更新代缴机构
|
||||
|
|
@ -142,27 +141,24 @@ public interface TaxAgentV2Service {
|
|||
* 编辑个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
String update(TaxAgentSaveParam saveParam, Long employeeId);
|
||||
String update(TaxAgentSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 删除个税扣缴义务人
|
||||
*
|
||||
* @param ids
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
String delete(Collection<Long> ids, Long employeeId);
|
||||
String delete(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取个税扣缴义务人下拉列表
|
||||
*
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectList(Long currentEmployeeId);
|
||||
List<Map<String, Object>> selectList();
|
||||
|
||||
/**
|
||||
* 是否开启分权
|
||||
|
|
@ -209,8 +205,7 @@ public interface TaxAgentV2Service {
|
|||
* 更换管理员校验是否有核算数据
|
||||
*
|
||||
* @param checkParam
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam, Long currentEmployeeId);
|
||||
Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentAdminMapper;
|
||||
import com.engine.salary.service.TaxAgentAdminService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -23,14 +24,16 @@ import java.util.List;
|
|||
**/
|
||||
public class TaxAgentAdminServiceImpl extends Service implements TaxAgentAdminService {
|
||||
|
||||
private TaxAgentAdminMapper taxAgentAdminMapper;
|
||||
private TaxAgentAdminMapper getTaxAgentAdminMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentAdminMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaxAgentIds(Collection<Long> taxAgentIds) {
|
||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return;
|
||||
}
|
||||
taxAgentAdminMapper.deleteByTaxAgentIds(taxAgentIds);
|
||||
getTaxAgentAdminMapper().deleteByTaxAgentIds(taxAgentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,7 +52,7 @@ public class TaxAgentAdminServiceImpl extends Service implements TaxAgentAdminSe
|
|||
.creator((long) user.getUID())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build())
|
||||
.forEach(taxAgentAdminMapper::insertIgnoreNull);
|
||||
.forEach(getTaxAgentAdminMapper()::insertIgnoreNull);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -58,7 +61,7 @@ public class TaxAgentAdminServiceImpl extends Service implements TaxAgentAdminSe
|
|||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return list;
|
||||
}
|
||||
return taxAgentAdminMapper.listSome(TaxAgentAdminPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
return getTaxAgentAdminMapper().listSome(TaxAgentAdminPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -68,11 +71,11 @@ public class TaxAgentAdminServiceImpl extends Service implements TaxAgentAdminSe
|
|||
if (CollectionUtils.isEmpty(taxAgentIds) || currentEmployeeId == null) {
|
||||
return list;
|
||||
}
|
||||
return taxAgentAdminMapper.listSome(TaxAgentAdminPO.builder().taxAgentIds(taxAgentIds).employeeId(currentEmployeeId).build());
|
||||
return getTaxAgentAdminMapper().listSome(TaxAgentAdminPO.builder().taxAgentIds(taxAgentIds).employeeId(currentEmployeeId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxAgentAdminPO> listByEmployeeId(Long currentEmployeeId) {
|
||||
return taxAgentAdminMapper.listSome(TaxAgentAdminPO.builder().employeeId(currentEmployeeId).build());
|
||||
return getTaxAgentAdminMapper().listSome(TaxAgentAdminPO.builder().employeeId(currentEmployeeId).build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
|
|
@ -13,9 +14,11 @@ import com.engine.salary.service.SIAccountService;
|
|||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.TaxAgentBaseService;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -30,9 +33,17 @@ import java.util.List;
|
|||
**/
|
||||
public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseService {
|
||||
|
||||
private TaxAgentBaseMapper taxAgentBaseMapper;
|
||||
private SalaryAcctRecordService salaryAcctRecordService;
|
||||
private SIAccountService siAccountService;
|
||||
private TaxAgentBaseMapper getTaxAgentBaseMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentBaseMapper.class);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SIAccountService getSIAccountService(User user) {
|
||||
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public TaxAgentBaseServiceImpl() {
|
||||
}
|
||||
|
|
@ -45,7 +56,7 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
|
||||
@Override
|
||||
public TaxAgentBasePO getBaseInfo() {
|
||||
List<TaxAgentBasePO> list = taxAgentBaseMapper.listAll();
|
||||
List<TaxAgentBasePO> list = getTaxAgentBaseMapper().listAll();
|
||||
return CollectionUtils.isEmpty(list) ? null : list.get(0);
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +78,7 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
Date now = new Date();
|
||||
Integer devolutionStatus = saveBaseParam.getDevolutionStatus() ? SalaryOnOffEnum.ON.getValue() : SalaryOnOffEnum.OFF.getValue();
|
||||
if (base == null) {
|
||||
taxAgentBaseMapper.insertIgnoreNull(
|
||||
getTaxAgentBaseMapper().insertIgnoreNull(
|
||||
TaxAgentBasePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.devolutionStatus(devolutionStatus)
|
||||
|
|
@ -79,7 +90,7 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
} else {
|
||||
base.setUpdateTime(now);
|
||||
base.setDevolutionStatus(devolutionStatus);
|
||||
taxAgentBaseMapper.updateIgnoreNull(base);
|
||||
getTaxAgentBaseMapper().updateIgnoreNull(base);
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
|
@ -92,9 +103,9 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
private boolean checkUsedData() {
|
||||
// 检查是否核算
|
||||
// todo 1.社保福利档案是否有核算未归档
|
||||
Boolean checkedValue = false;//= siAccountService.changeAdminUnfiledCheck();
|
||||
Boolean checkedValue = false;//= getSIAccountService(user).changeAdminUnfiledCheck();
|
||||
// todo 2.薪资核算是否有核算未归档
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = salaryAcctRecordService.listByStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED);// salaryAcctRecordService.listByStatusAndEmployeeId(SalaryAcctRecordStatusEnum.NOT_ARCHIVED, currentTenantKey);
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listByStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED);// getSalaryAcctRecordService(user).listByStatusAndEmployeeId(SalaryAcctRecordStatusEnum.NOT_ARCHIVED, currentTenantKey);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctRecords) || checkedValue) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
|
|
@ -12,9 +13,11 @@ import com.engine.salary.mapper.taxagent.TaxAgentEmpMapper;
|
|||
import com.engine.salary.service.TaxAgentEmpChangeService;
|
||||
import com.engine.salary.service.TaxAgentEmpService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -30,21 +33,25 @@ import java.util.stream.Collectors;
|
|||
public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpService {
|
||||
|
||||
|
||||
private TaxAgentEmpMapper taxAgentEmployeeMapper;
|
||||
private TaxAgentEmpMapper getTaxAgentEmpMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentEmpMapper.class);
|
||||
}
|
||||
|
||||
private TaxAgentEmpChangeService taxAgentEmpChangeService;
|
||||
public TaxAgentEmpChangeService getTaxAgentEmpChangeService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentEmpChangeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaxAgentIds(Collection<Long> taxAgentIds) {
|
||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return;
|
||||
}
|
||||
List<TaxAgentEmpPO> taxAgentEmpList = taxAgentEmployeeMapper.listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
List<TaxAgentEmpPO> taxAgentEmpList = getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
if (CollectionUtils.isEmpty(taxAgentEmpList)) {
|
||||
return;
|
||||
}
|
||||
List<Long> idList = taxAgentEmpList.stream().map(TaxAgentEmpPO::getId).collect(Collectors.toList());
|
||||
taxAgentEmployeeMapper.deleteByIds(idList);
|
||||
getTaxAgentEmpMapper().deleteByIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,7 +59,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
|
|||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return taxAgentEmployeeMapper.listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -134,15 +141,15 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
|
|||
// 关联表====================================================
|
||||
// 新增
|
||||
if (CollectionUtils.isNotEmpty(taxAgentEmployeeAddList)) {
|
||||
taxAgentEmployeeMapper.batchInsert(taxAgentEmployeeAddList);
|
||||
getTaxAgentEmpMapper().batchInsert(taxAgentEmployeeAddList);
|
||||
}
|
||||
// 删除
|
||||
if (CollectionUtils.isNotEmpty(taxAgentEmployeeDelIds)) {
|
||||
taxAgentEmployeeMapper.deleteByIds(taxAgentEmployeeDelIds);
|
||||
getTaxAgentEmpMapper().deleteByIds(taxAgentEmployeeDelIds);
|
||||
}
|
||||
// 增量表====================================================
|
||||
if (CollectionUtils.isNotEmpty(taxAgentEmpChangeList)) {
|
||||
taxAgentEmpChangeService.batchInsert(taxAgentEmpChangeList);
|
||||
getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.EmployBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
|
||||
|
|
@ -12,7 +15,7 @@ import com.engine.salary.entity.taxagent.param.*;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentSubAdminPO;
|
||||
import com.engine.salary.enums.SalaryJobFlagEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum;
|
||||
|
|
@ -23,27 +26,16 @@ import com.engine.salary.service.*;
|
|||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.common.async.bean.AsyncBean;
|
||||
import com.weaver.common.async.consumer.anno.method.AsyncListener;
|
||||
import com.weaver.common.cache.tablecache.impl.ComInfoCache;
|
||||
import com.weaver.common.hrm.cache.HrmDepartmentComInfo;
|
||||
import com.weaver.common.hrm.cache.HrmEmployeeComInfo;
|
||||
import com.weaver.common.hrm.cache.HrmPositionComInfo;
|
||||
import com.weaver.common.hrm.domain.employee.HrmStatus;
|
||||
import com.weaver.common.hrm.domain.queue.HrmCommonQueue;
|
||||
import com.weaver.common.hrm.service.employee.HrmCommonHrmStatusService;
|
||||
import com.weaver.datasecurity.interceptor.DSTenantKeyThreadVar;
|
||||
import com.weaver.hrm.salary.common.SalaryEmployee;
|
||||
import com.weaver.hrm.salary.entity.taxagent.param.*;
|
||||
import com.weaver.hrm.salary.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
@ -60,29 +52,44 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentManageRangeService {
|
||||
|
||||
private TaxAgentManageRangeMapper taxAgentManageRangeMapper;
|
||||
private TaxAgentManageRangeMapper getTaxAgentManageRangeMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentManageRangeMapper.class);
|
||||
}
|
||||
|
||||
private TaxAgentV2Service taxAgentService;
|
||||
private TaxAgentV2Service getTaxAgentV2Service(User user) {
|
||||
return ServiceUtil.getService(TaxAgentV2ServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentSubAdminService taxAgentSubAdminService;
|
||||
// private TaxAgentSubAdminService getTaxAgentSubAdminService(User user) {
|
||||
// return ServiceUtil.getService(TaxAgentSubAdminServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
private TaxAgentEmpService taxAgentEmployeeService;
|
||||
private TaxAgentEmpService getTaxAgentEmpService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentEmpServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentSubAdminEmpService taxAgentSubAdminEmployeeService;
|
||||
// private TaxAgentSubAdminEmpService getTaxAgentSubAdminEmpService(User user) {
|
||||
// return ServiceUtil.getService(TaxAgentSubAdminEmpServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
private ComInfoCache comInfoCache;
|
||||
// private ComInfoCache comInfoCache;
|
||||
|
||||
private EmployMapper employeeMapper;
|
||||
private EmployMapper getEmployMapper() {
|
||||
return MapperProxyFactory.getProxy(EmployMapper.class);
|
||||
}
|
||||
|
||||
private ExecutorService taskExecutor;
|
||||
|
||||
private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
// private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
|
||||
private List<TaxAgentManageRangePO> listByTaxAgentIds(List<Long> taxAgentIds) {
|
||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).taxAgentIds(taxAgentIds).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).taxAgentIds(taxAgentIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -101,7 +108,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
if (CollectionUtils.isEmpty(taxAgentSubAdminIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).taxAgentSubAdminIds(taxAgentSubAdminIds).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).taxAgentSubAdminIds(taxAgentSubAdminIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -164,11 +171,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
List<String> personnelStatuss = Lists.newArrayList();
|
||||
if (employeeStatus != null) {
|
||||
// 查询人员状态
|
||||
List<HrmStatus> hrmStatusList = hrmCommonHrmStatusService.list();
|
||||
if (employeeStatus.equals(SalaryEmployeeStatusEnum.NORMAL)) {
|
||||
personnelStatuss = hrmStatusList.stream().filter(f -> f.getJobflag().equals(SalaryJobFlagEnum.normal.getValue())).map(m -> m.getCodeId() + "").collect(Collectors.toList());
|
||||
personnelStatuss = UserStatusEnum.getNormalStatus();
|
||||
} else if (employeeStatus.equals(SalaryEmployeeStatusEnum.UNAVAILABLE)) {
|
||||
personnelStatuss = hrmStatusList.stream().filter(f -> f.getJobflag().equals(SalaryJobFlagEnum.unavailable.getValue())).map(m -> m.getCodeId() + "").collect(Collectors.toList());
|
||||
personnelStatuss = UserStatusEnum.getUnavailableStatus();
|
||||
}
|
||||
}
|
||||
// 根据上一步的查询参数查询人员
|
||||
|
|
@ -201,7 +207,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
if (CollectionUtils.isEmpty(taxAgentManageRanges)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<DataCollectionEmployee> salaryEmployees = employeeMapper.listAll();
|
||||
List<DataCollectionEmployee> salaryEmployees = getEmployMapper().listAll();
|
||||
List<DataCollectionEmployee> salaryEmployeeList = Lists.newArrayList();
|
||||
for (TaxAgentManageRangePO manageRange : taxAgentManageRanges) {
|
||||
salaryEmployeeList.addAll(salaryEmployees.stream()
|
||||
|
|
@ -212,7 +218,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
if (CollectionUtils.isNotEmpty(personnelStatuss)) {
|
||||
hrmStatusList = hrmStatusList.stream().filter(personnelStatuss::contains).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(hrmStatusList) && !hrmStatusList.contains(salaryEmployee.getPersonnelStatus())) {
|
||||
if (CollectionUtils.isNotEmpty(hrmStatusList) && !hrmStatusList.contains(salaryEmployee.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.ALL.getValue())) {
|
||||
|
|
@ -242,16 +248,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
return salaryEmployeeList;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 根据分管理员id获取管理范围列表
|
||||
// *
|
||||
// * @param subAdminId
|
||||
// * @param includeType
|
||||
// * @return
|
||||
// */
|
||||
// private List<TaxAgentManageRangePO> listBySubAdminIdAndIncludeType(Long subAdminId, Integer includeType) {
|
||||
//
|
||||
// return new LambdaQueryChainWrapper<>(taxAgentManageRangeMapper)
|
||||
/**
|
||||
* 根据分管理员id获取管理范围列表
|
||||
*
|
||||
* @param subAdminId
|
||||
* @param includeType
|
||||
* @return
|
||||
*/
|
||||
private List<TaxAgentManageRangePO> listBySubAdminIdAndIncludeType(Long subAdminId, Integer includeType) {
|
||||
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentSubAdminId(subAdminId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).includeType(includeType).build());
|
||||
// return new LambdaQueryChainWrapper<>(getTaxAgentManageRangeMapper())
|
||||
// .eq(TaxAgentManageRangePO::getTenantKey)
|
||||
// .eq(TaxAgentManageRangePO::getDeleteType, 0)
|
||||
// .eq(TaxAgentManageRangePO::getTaxAgentSubAdminId, subAdminId)
|
||||
|
|
@ -259,7 +266,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
// .eq(TaxAgentManageRangePO::getIncludeType, includeType)
|
||||
// .orderByDesc(TaxAgentManageRangePO::getId)
|
||||
// .list();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个税口角义务人的管理范围
|
||||
|
|
@ -269,15 +276,15 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
* @return
|
||||
*/
|
||||
private List<TaxAgentManageRangePO> listByTaxAgentIdAndIncludeType(Long taxAgentId, Integer includeType) {
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).includeType(includeType).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).includeType(includeType).build());
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Page<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(TaxAgentSubAdminRangeQueryParam queryParam, Integer includeType) {
|
||||
// // 查询已有的管理范围
|
||||
// List<TaxAgentManageRangePO> taxAgentManageRanges = listBySubAdminIdAndIncludeType(queryParam.getSubAdminId(), includeType);
|
||||
// return listPageByParamAndIncludeType(taxAgentManageRanges, queryParam, includeType);
|
||||
// }
|
||||
@Override
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(TaxAgentSubAdminRangeQueryParam queryParam, Integer includeType) {
|
||||
// 查询已有的管理范围
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = listBySubAdminIdAndIncludeType(queryParam.getSubAdminId(), includeType);
|
||||
return listPageByParamAndIncludeType(taxAgentManageRanges, queryParam, includeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(TaxAgentRangeQueryParam queryParam, Integer includeType) {
|
||||
|
|
@ -289,33 +296,36 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
private PageInfo<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(List<TaxAgentManageRangePO> taxAgentManageRanges, TaxAgentManageRangeQueryParam queryParam, Integer includeType) {
|
||||
|
||||
// 查询人员信息
|
||||
List<Object> employeeIds = taxAgentManageRanges.stream()
|
||||
List<Long> employeeIds = taxAgentManageRanges.stream()
|
||||
.filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.EMPLOYEE.getValue()))
|
||||
.map(TaxAgentManageRangePO::getTargetId)
|
||||
.collect(Collectors.toList());
|
||||
List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds);
|
||||
// List<DataCollectionEmployee> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds);
|
||||
List<DataCollectionEmployee> employeeComInfos = employBiz.getEmployeeByIdsAll(employeeIds);
|
||||
// 查询部门信息
|
||||
List<Object> departmentIds = taxAgentManageRanges.stream()
|
||||
List<Long> departmentIds = taxAgentManageRanges.stream()
|
||||
.filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.DEPT.getValue()))
|
||||
.map(TaxAgentManageRangePO::getTargetId)
|
||||
.collect(Collectors.toList());
|
||||
List<HrmDepartmentComInfo> departmentComInfos = comInfoCache.getCacheList(HrmDepartmentComInfo.class, departmentIds);
|
||||
List<DeptInfo> departmentComInfos = employBiz.getDeptInfoList(departmentIds);
|
||||
// 查询分部信息
|
||||
List<Object> subDepartmentIds = taxAgentManageRanges.stream()
|
||||
List<Long> subDepartmentIds = taxAgentManageRanges.stream()
|
||||
.filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue()))
|
||||
.map(TaxAgentManageRangePO::getTargetId)
|
||||
.collect(Collectors.toList());
|
||||
List<HrmDepartmentComInfo> subDepartmentComInfos = comInfoCache.getCacheList(HrmDepartmentComInfo.class, subDepartmentIds);
|
||||
|
||||
List<SubCompanyInfo> subDepartmentComInfos = employBiz.getSubCompanyInfoList(subDepartmentIds);
|
||||
// 查询岗位信息
|
||||
List<Object> positionIds = taxAgentManageRanges.stream()
|
||||
List<Long> positionIds = taxAgentManageRanges.stream()
|
||||
.filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.POSITION.getValue()))
|
||||
.map(TaxAgentManageRangePO::getTargetId)
|
||||
.collect(Collectors.toList());
|
||||
List<HrmPositionComInfo> positionComInfos = comInfoCache.getCacheList(HrmPositionComInfo.class, positionIds);
|
||||
List<PositionInfo> positionComInfos = employBiz.listPositionInfo(positionIds);
|
||||
// 分页参数
|
||||
PageInfo<TaxAgentManageRangeListDTO> dtoPage = PageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentManageRangeListDTO.class);
|
||||
// 查询人员状态
|
||||
List<HrmStatus> hrmStatusList = hrmCommonHrmStatusService.list();
|
||||
// List<HrmStatus> hrmStatusList = hrmCommonHrmStatusService.list();
|
||||
List<HrmStatus> hrmStatusList = UserStatusEnum.getHrmStatusList();
|
||||
// 薪资账套的人员范围po转换成列表dto
|
||||
List<TaxAgentManageRangeListDTO> taxAgentManageRangeList = TaxAgentBO.convert2ListDTO(taxAgentManageRanges, employeeComInfos, departmentComInfos, subDepartmentComInfos, positionComInfos, hrmStatusList);
|
||||
// 根据对象名称过滤
|
||||
|
|
@ -333,13 +343,12 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
/**
|
||||
* 根据个税口角义务人id保存管理范围
|
||||
*
|
||||
* @param saveParam 保存参数
|
||||
* @param employeeId 人员id
|
||||
* @param saveParam 保存参数
|
||||
*/
|
||||
@Override
|
||||
public void save(TaxAgentRangeSaveParam saveParam, Long employeeId) {
|
||||
public void save(TaxAgentRangeSaveParam saveParam) {
|
||||
// 查询薪资账套
|
||||
TaxAgentPO taxAgent = taxAgentService.getById(saveParam.getTaxAgentId());
|
||||
TaxAgentPO taxAgent = getTaxAgentV2Service(user).getById(saveParam.getTaxAgentId());
|
||||
if (Objects.isNull(taxAgent)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,个税扣缴义务人不存在或者已被删除"));
|
||||
}
|
||||
|
|
@ -348,7 +357,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(saveParam.getIncludeType())).collect(Collectors.toList());
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, saveParam, taxAgent.getId(), employeeId);
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, saveParam, taxAgent.getId(), (long) user.getUID());
|
||||
|
||||
/** 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================start */
|
||||
List<TaxAgentManageRangePO> allRanges = Lists.newArrayList(taxAgentManageAllRanges);
|
||||
|
|
@ -372,18 +381,20 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
}
|
||||
/** 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */
|
||||
// 保存
|
||||
// todo 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) {
|
||||
this.saveBatch(result.getNeedInsertTaxAgentManageRanges());
|
||||
// this.saveBatch(result.getNeedInsertTaxAgentManageRanges());
|
||||
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) {
|
||||
this.updateBatchById(result.getNeedUpdateTaxAgentManageRanges());
|
||||
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
|
||||
// this.updateBatchById(result.getNeedUpdateTaxAgentManageRanges());
|
||||
}
|
||||
|
||||
/** 同步本地人员范围的关联人员=========================== */
|
||||
taskExecutor.execute(() -> {
|
||||
try {
|
||||
syncLocalEmp(saveParam.getTaxAgentId(), allSalaryEmployees, allSubAdminRanges, employeeId);
|
||||
syncLocalEmp(saveParam.getTaxAgentId(), allSalaryEmployees, allSubAdminRanges, (long) user.getUID());
|
||||
} finally {
|
||||
}
|
||||
});
|
||||
|
|
@ -398,16 +409,16 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
* @return
|
||||
*/
|
||||
private List<TaxAgentManageRangePO> listByTaxAgentId(Long taxAgentId) {
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.TAXAGENT.getValue()).build());
|
||||
}
|
||||
|
||||
private List<TaxAgentManageRangePO> listSunAdminRangeByTaxAgentId(Long taxAgentId) {
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentId(taxAgentId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save4SubAdmin(TaxAgentSubAdminRangeSaveParam saveParam, Long employeeId) {
|
||||
public void save4SubAdmin(TaxAgentSubAdminRangeSaveParam saveParam) {
|
||||
// 查询薪资账套
|
||||
TaxAgentSubAdminPO taxAgentSubAdmin = taxAgentSubAdminService.getById(saveParam.getSubAdminId());
|
||||
if (Objects.isNull(taxAgentSubAdmin)) {
|
||||
|
|
@ -417,7 +428,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
List<TaxAgentManageRangePO> taxAgentManageAllRanges = listBySubAdminId(saveParam.getSubAdminId());
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(saveParam.getIncludeType())).collect(Collectors.toList());
|
||||
// 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新)
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleSubAdminRange(taxAgentManageRanges, saveParam, taxAgentSubAdmin.getTaxAgentId(), taxAgentSubAdmin.getId(), employeeId);
|
||||
TaxAgentBO.Result result = TaxAgentBO.handleSubAdminRange(taxAgentManageRanges, saveParam, taxAgentSubAdmin.getTaxAgentId(), taxAgentSubAdmin.getId(), (long) user.getUID());
|
||||
|
||||
// 当前库中所有分管理员的管理范围
|
||||
List<TaxAgentManageRangePO> allSubAdminRangesExist = listSunAdminRangeByTaxAgentId(taxAgentSubAdmin.getTaxAgentId());
|
||||
|
|
@ -430,11 +441,11 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
allSubAdminRangesCuttent.addAll(result.getNeedUpdateTaxAgentManageRanges());
|
||||
|
||||
// 当前分管理员的所有人员
|
||||
List<SalaryEmployee> currentSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allSubAdminRangesCuttent);
|
||||
List<DataCollectionEmployee> currentSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allSubAdminRangesCuttent);
|
||||
// 其他分管理员的所有人员
|
||||
List<SalaryEmployee> otherSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), otherSubAdminRangesExist);
|
||||
for (SalaryEmployee se : currentSubAdminSalaryEmployees) {
|
||||
Optional<SalaryEmployee> optionalSe = otherSubAdminSalaryEmployees.stream().filter(f -> f.getEmployeeId().equals(se.getEmployeeId())).findFirst();
|
||||
List<DataCollectionEmployee> otherSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), otherSubAdminRangesExist);
|
||||
for (DataCollectionEmployee se : currentSubAdminSalaryEmployees) {
|
||||
Optional<DataCollectionEmployee> optionalSe = otherSubAdminSalaryEmployees.stream().filter(f -> f.getEmployeeId().equals(se.getEmployeeId())).findFirst();
|
||||
if (optionalSe.isPresent()) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110149, "不可包含其他分管理员的人员"));
|
||||
}
|
||||
|
|
@ -452,10 +463,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
), ArrayList::new));
|
||||
// 所属个税扣缴义务人的所有人员
|
||||
List<TaxAgentManageRangePO> allRanges = listByTaxAgentId(taxAgentSubAdmin.getTaxAgentId());
|
||||
List<SalaryEmployee> allSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allRanges);
|
||||
List<DataCollectionEmployee> allSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allRanges);
|
||||
// 所有分管理员的所有人员
|
||||
List<SalaryEmployee> allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allSubAdminRanges);
|
||||
List<Long> allSalaryEmployeeIds = allSalaryEmployees.stream().map(SalaryEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, taxAgentSubAdmin.getTaxAgentId(), allSubAdminRanges);
|
||||
List<Long> allSalaryEmployeeIds = allSalaryEmployees.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
allSubAdminSalaryEmployees.removeIf(a -> allSalaryEmployeeIds.contains(a.getEmployeeId()));
|
||||
if (CollectionUtils.isNotEmpty(allSubAdminSalaryEmployees)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110125, "超出了整体人员范围"));
|
||||
|
|
@ -464,19 +475,19 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) {
|
||||
this.saveBatch(result.getNeedInsertTaxAgentManageRanges());
|
||||
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range));
|
||||
// todo this.saveBatch(result.getNeedInsertTaxAgentManageRanges());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) {
|
||||
this.updateBatchById(result.getNeedUpdateTaxAgentManageRanges());
|
||||
result.getNeedUpdateTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
|
||||
// todo this.updateBatchById(result.getNeedUpdateTaxAgentManageRanges());
|
||||
}
|
||||
/** 同步本地人员范围的关联人员=========================== */
|
||||
List<TaxAgentManageRangePO> finalAllSubAdminRanges = allSubAdminRanges;
|
||||
taskExecutor.execute(() -> {
|
||||
try {
|
||||
DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
syncLocalEmp(taxAgentSubAdmin.getTaxAgentId(), allSalaryEmployees, finalAllSubAdminRanges, employeeId);
|
||||
syncLocalEmp(taxAgentSubAdmin.getTaxAgentId(), allSalaryEmployees, finalAllSubAdminRanges, (long) user.getUID());
|
||||
} finally {
|
||||
DSTenantKeyThreadVar.tenantKey.remove();
|
||||
}
|
||||
});
|
||||
// 记录日志 todo
|
||||
|
|
@ -489,18 +500,18 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
* @return
|
||||
*/
|
||||
private List<TaxAgentManageRangePO> listBySubAdminId(Long subAdminId) {
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().taxAgentSubAdminId(subAdminId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentSubAdminId(subAdminId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).build());
|
||||
}
|
||||
|
||||
private List<TaxAgentManageRangePO> listByIds(Collection<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return taxAgentManageRangeMapper.listSome(TaxAgentManageRangePO.builder().ids(ids).build());
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().ids(ids).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByIds(Collection<Long> ids, Long employeeId) {
|
||||
public void deleteByIds(Collection<Long> ids) {
|
||||
// 查询管理范围
|
||||
List<TaxAgentManageRangePO> taxAgentManageRanges = listByIds(ids);
|
||||
if (CollectionUtils.isEmpty(taxAgentManageRanges)) {
|
||||
|
|
@ -526,12 +537,12 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110160, "分管理员存在超出整体人员范围以外的人员,不可删除"));
|
||||
}
|
||||
// 删除管理范围
|
||||
taxAgentManageRangeMapper.deleteByIds(ids);
|
||||
getTaxAgentManageRangeMapper().deleteByIds(ids);
|
||||
|
||||
/** 同步本地人员范围的关联人员=========================== */
|
||||
taskExecutor.execute(() -> {
|
||||
try {
|
||||
syncLocalEmp(taxAgentId, allSalaryEmployees, allSubAdminRanges, employeeId);
|
||||
syncLocalEmp(taxAgentId, allSalaryEmployees, allSubAdminRanges, (long) user.getUID());
|
||||
} finally {
|
||||
}
|
||||
});
|
||||
|
|
@ -539,60 +550,47 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTaxAgentIds(Collection<Long> taxAgentIds, String tenantKey) {
|
||||
new LambdaUpdateChainWrapper<>(taxAgentManageRangeMapper)
|
||||
.eq(TaxAgentManageRangePO::getDeleteType, 0)
|
||||
.eq(TaxAgentManageRangePO::getTenantKey)
|
||||
.in(TaxAgentManageRangePO::getTaxAgentId, taxAgentIds)
|
||||
.set(TaxAgentManageRangePO::getDeleteType, 1)
|
||||
.update();
|
||||
public void deleteByTaxAgentIds(Collection<Long> taxAgentIds) {
|
||||
getTaxAgentManageRangeMapper().deleteByTaxAgentIds(taxAgentIds);
|
||||
// 删除管理范围下的所有人员
|
||||
taxAgentEmployeeService.deleteByTaxAgentIds(taxAgentIds);
|
||||
getTaxAgentEmpService(user).deleteByTaxAgentIds(taxAgentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySubAdmins(Collection<Long> subAdminIds, String tenantKey) {
|
||||
public void deleteBySubAdmins(Collection<Long> subAdminIds) {
|
||||
if (CollectionUtils.isEmpty(subAdminIds)) {
|
||||
return;
|
||||
}
|
||||
new LambdaUpdateChainWrapper<>(taxAgentManageRangeMapper)
|
||||
.eq(TaxAgentManageRangePO::getDeleteType, 0)
|
||||
.eq(TaxAgentManageRangePO::getTenantKey)
|
||||
.in(TaxAgentManageRangePO::getTaxAgentSubAdminId, subAdminIds)
|
||||
.set(TaxAgentManageRangePO::getDeleteType, 1)
|
||||
.update();
|
||||
getTaxAgentManageRangeMapper().deleteBySubAdminIds(subAdminIds);
|
||||
// 删除管理范围下的所有人员
|
||||
taxAgentSubAdminEmployeeService.deleteBySubAdminIds(subAdminIds);
|
||||
}
|
||||
|
||||
@AsyncListener(topic = "hrm_resource_queue")
|
||||
public void receiveHrmResourceQueue(AsyncBean<HrmCommonQueue> asyncBean) {
|
||||
log.info("接受到人员变动的结果:{}", JSONObject.toJSONString(asyncBean));
|
||||
// todo 过滤必要性事件类型进行处理,后续加上时间间隔,避免人事批量操作时,监听事件过多
|
||||
if (asyncBean == null || asyncBean.getMessage() == null) {
|
||||
log.error("接受到人员变动的结果失败");
|
||||
}
|
||||
String tenantKey = asyncBean.getMessage().getTenantKey();
|
||||
// 开始同步
|
||||
taskExecutor.execute(() -> {
|
||||
try {
|
||||
handleSyncTaxAgentEmpData();
|
||||
} finally {
|
||||
}
|
||||
});
|
||||
}
|
||||
//fixme
|
||||
// @AsyncListener(topic = "hrm_resource_queue")
|
||||
// public void receiveHrmResourceQueue(AsyncBean<HrmCommonQueue> asyncBean) {
|
||||
// log.info("接受到人员变动的结果:{}", JSONObject.toJSONString(asyncBean));
|
||||
// // todo 过滤必要性事件类型进行处理,后续加上时间间隔,避免人事批量操作时,监听事件过多
|
||||
// if (asyncBean == null || asyncBean.getMessage() == null) {
|
||||
// log.error("接受到人员变动的结果失败");
|
||||
// }
|
||||
// String tenantKey = asyncBean.getMessage().getTenantKey();
|
||||
// // 开始同步
|
||||
// taskExecutor.execute(() -> {
|
||||
// try {
|
||||
// handleSyncTaxAgentEmpData();
|
||||
// } finally {
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 同步处理所有人员泛微
|
||||
* 同步处理所有人员范围
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
private void handleSyncTaxAgentEmpData() {
|
||||
List<TaxAgentManageRangePO> allManageRanges = new LambdaQueryChainWrapper<>(taxAgentManageRangeMapper)
|
||||
.eq(TaxAgentManageRangePO::getTenantKey)
|
||||
.eq(TaxAgentManageRangePO::getDeleteType, 0)
|
||||
.orderByDesc(TaxAgentManageRangePO::getId)
|
||||
.list();
|
||||
List<TaxAgentManageRangePO> allManageRanges = getTaxAgentManageRangeMapper().listAll();
|
||||
if (CollectionUtils.isEmpty(allManageRanges)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -611,7 +609,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
});
|
||||
Long employeeId = 0L;
|
||||
// 同步管理员的人员
|
||||
taxAgentEmployeeService.syncTaxAgentEmployee(taxAgentEmpSaveParamList, employeeId);
|
||||
getTaxAgentEmpService(user).syncTaxAgentEmployee(taxAgentEmpSaveParamList, employeeId);
|
||||
// 同步分管理员的人员
|
||||
taxAgentSubAdminEmployeeService.syncTaxAgentSubAdminEmployee(subAdminEmpSaveParamList, employeeId);
|
||||
}
|
||||
|
|
@ -664,7 +662,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
private void syncLocalEmp(Long taxAgentId, List<DataCollectionEmployee> allSalaryEmployees, List<TaxAgentManageRangePO> allSubAdminRanges, Long employeeId) {
|
||||
List<TaxAgentEmpSaveParam> taxAgentEmpSaveParamList = Collections.singletonList(getTaxAgentEmpSyncParam(taxAgentId, allSalaryEmployees));
|
||||
// 同步个税扣缴义务人的人员
|
||||
taxAgentEmployeeService.syncTaxAgentEmployee(taxAgentEmpSaveParamList, employeeId);
|
||||
getTaxAgentEmpService(user).syncTaxAgentEmployee(taxAgentEmpSaveParamList, employeeId);
|
||||
|
||||
List<TaxAgentSubAdminEmpSaveParam> subAdminEmpSaveParamList = getTaxAgentSubAdminEmpSyncParam(taxAgentId, allSubAdminRanges);
|
||||
// 同步分管理员的人员
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
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.salary.constant.TaxAgentPermissionConstant;
|
||||
import com.engine.salary.biz.SalaryRoleBiz;
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
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.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
||||
|
|
@ -16,7 +18,6 @@ import com.engine.salary.entity.taxagent.param.TaxAgentAdminChangeCheckParam;
|
|||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentSaveParam;
|
||||
import com.engine.salary.entity.taxagent.po.*;
|
||||
import com.engine.salary.enums.SalaryJobFlagEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
|
|
@ -30,47 +31,89 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
|||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service {
|
||||
|
||||
private TaxAgentMapper taxAgentMapper;
|
||||
// private ExtEmployeeService extEmployeeService;
|
||||
SalaryRoleBiz salaryRoleBiz = new SalaryRoleBiz();
|
||||
|
||||
private TaxAgentBaseService getTaxAgentBaseService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private EmployMapper employMapper;
|
||||
|
||||
|
||||
// private ExtEmployeeService extEmployeeService;
|
||||
|
||||
private TaxAgentBaseService taxAgentBaseService;
|
||||
|
||||
private TaxAgentAdminService taxAgentAdminService;
|
||||
private TaxAgentAdminService getTaxAgentAdminService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentAdminServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentSubAdminService taxAgentSubAdminService;
|
||||
// private TaxAgentSubAdminService getTaxAgentSubAdminService(User user) {
|
||||
// return ServiceUtil.getService(TaxAgentSubAdminServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
private TaxAgentManageRangeService taxAgentManageRangeService;
|
||||
private TaxAgentManageRangeService getTaxAgentManageRangeService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentEmpService taxAgentEmpService;
|
||||
private TaxAgentEmpService getTaxAgentEmpService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentEmpServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentSubAdminEmpService taxAgentSubAdminEmpService;
|
||||
// private TaxAgentSubAdminEmpService getTaxAgentSubAdminEmpService(User user) {
|
||||
// return ServiceUtil.getService(TaxAgentSubAdminEmpServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
private SalaryArchiveMapper salaryArchiveMapper;
|
||||
private HrmCommonService getHrmCommonService(User user) {
|
||||
return ServiceUtil.getService(HrmCommonServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private AddUpDeductionMapper addUpDeductionMapper;
|
||||
|
||||
private OtherDeductionMapper otherDeductionMapper;
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private AddUpSituationMapper addUpSituationMapper;
|
||||
private SIAccountService getSIAccountService(User user) {
|
||||
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveMapper getSalaryArchiveMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryArchiveMapper.class);
|
||||
}
|
||||
|
||||
private AddUpDeductionMapper getAddUpDeductionMapper() {
|
||||
return MapperProxyFactory.getProxy(AddUpDeductionMapper.class);
|
||||
}
|
||||
|
||||
private OtherDeductionMapper getOtherDeductionMapper() {
|
||||
return MapperProxyFactory.getProxy(OtherDeductionMapper.class);
|
||||
}
|
||||
|
||||
private AddUpSituationMapper getAddUpSituationMapper() {
|
||||
return MapperProxyFactory.getProxy(AddUpSituationMapper.class);
|
||||
}
|
||||
|
||||
private TaxAgentMapper getTaxAgentMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
||||
}
|
||||
|
||||
private EmployMapper getEmployMapper() {
|
||||
return MapperProxyFactory.getProxy(EmployMapper.class);
|
||||
}
|
||||
|
||||
|
||||
// private PaymentAgencyMapper paymentAgencyMapper;
|
||||
|
|
@ -83,11 +126,9 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
// private AuthorityService authorityService;
|
||||
|
||||
private SalaryAcctRecordService salaryAcctRecordService;
|
||||
|
||||
private SIAccountService siAccountService;
|
||||
|
||||
private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
// private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
|
||||
@Override
|
||||
public TaxAgentRoleTypeEnum getRoleType(Long currentEmployeeId) {
|
||||
|
|
@ -96,9 +137,9 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
return TaxAgentRoleTypeEnum.CHIEF;
|
||||
}
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (!isOpenDevolution) {
|
||||
List<TaxAgentAdminPO> taxAgentAdmins = taxAgentAdminService.listByEmployeeId(currentEmployeeId);
|
||||
List<TaxAgentAdminPO> taxAgentAdmins = getTaxAgentAdminService(user).listByEmployeeId(currentEmployeeId);
|
||||
if (CollectionUtils.isNotEmpty(taxAgentAdmins)) {
|
||||
return TaxAgentRoleTypeEnum.ADMIN;
|
||||
}
|
||||
|
|
@ -112,15 +153,18 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
@Override
|
||||
public Boolean isChief(Long currentEmployeeId) {
|
||||
String allAdminRoleId = salaryRoleBiz.getAllAdminRoleId();
|
||||
|
||||
return currentEmployeeId == 1;
|
||||
|
||||
List<Object> roleInfo = getHrmCommonService(user).getRoleInfo(user.getUID());
|
||||
Map map = roleInfo.stream().map(m -> (Map) m).filter(m -> m.get("roleid") != null && m.get("roleid").toString().equals(allAdminRoleId)).findFirst().orElse(null);
|
||||
return map != null;
|
||||
//return authorityService.checkPermissionSet(TaxAgentPermissionConstant.MENU_CODE, TaxAgentPermissionConstant.ITEM_CODE_DEVOLUTION, currentEmployeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isDefaultOpen(Long currentEmployeeId) {
|
||||
return authorityService.checkPermissionSet(TaxAgentPermissionConstant.MENU_CODE, TaxAgentPermissionConstant.ITEM_CODE_DEFAULT, currentEmployeeId);
|
||||
return true;
|
||||
// return authorityService.checkPermissionSet(TaxAgentPermissionConstant.MENU_CODE, TaxAgentPermissionConstant.ITEM_CODE_DEFAULT, currentEmployeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -132,7 +176,7 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
return Boolean.FALSE;
|
||||
} else {
|
||||
// 自己有没有被分配为管理员
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByEmployeeId(currentEmployeeId);
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByEmployeeId(currentEmployeeId);
|
||||
return CollectionUtils.isNotEmpty(taxAgentAdminList);
|
||||
}
|
||||
}
|
||||
|
|
@ -143,55 +187,55 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
@Override
|
||||
public PageInfo<TaxAgentPO> listPage(TaxAgentQueryParam queryParam) {
|
||||
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<TaxAgentPO> taxAgentPOS = taxAgentMapper.listBySome(queryParam);
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listBySome(queryParam);
|
||||
return new PageInfo<>(taxAgentPOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxAgentPO> list(TaxAgentQueryParam queryParam) {
|
||||
return taxAgentMapper.listBySome(queryParam);
|
||||
return getTaxAgentMapper().listBySome(queryParam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaxAgentPO> listByIds(Collection<Long> ids) {
|
||||
return taxAgentMapper.listBySome(TaxAgentQueryParam.builder().ids(ids).build());
|
||||
return getTaxAgentMapper().listBySome(TaxAgentQueryParam.builder().ids(ids).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxAgentPO> listAll() {
|
||||
return taxAgentMapper.listAll();
|
||||
return getTaxAgentMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaxAgentPO getById(Long id) {
|
||||
return taxAgentMapper.getById(id);
|
||||
return getTaxAgentMapper().getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<TaxAgentListDTO> findAll() {
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listAll();
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
||||
return TaxAgentBO.convertToListDTO(taxAgents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<TaxAgentPO> listAllTaxAgents(Long employeeId) {
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listAll();
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
||||
return handleForDevolution(taxAgents, employeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<TaxAgentPO> listAllTaxAgentsAsAdmin(Long employeeId) {
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listAll();
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (!isOpenDevolution) {
|
||||
return taxAgents;
|
||||
}
|
||||
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
List<Long> enableTaxAgentIds = Lists.newArrayList();
|
||||
// 1.判断自己是否是管理员, 如果是管理员,就是能够查看所属个税扣缴义务人
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByTaxAgentIds(taxAgentIds);
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds);
|
||||
// 是管理员的列表
|
||||
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().filter(f -> f.getEmployeeId().equals(employeeId)).map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
|
||||
|
||||
|
|
@ -201,10 +245,10 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
@Override
|
||||
public Collection<TaxAgentEmployeeTaxAgentDTO> listAllTaxAgentsAsRange(List<Long> employeeIds) {
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listAll();
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
||||
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
|
||||
List<TaxAgentEmpPO> taxAgentEmployees = taxAgentEmpService.listByTaxAgentIds(taxAgentIds);
|
||||
List<TaxAgentEmpPO> taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds);
|
||||
|
||||
if (CollectionUtils.isEmpty(taxAgentEmployees)) {
|
||||
return Lists.newArrayList();
|
||||
|
|
@ -224,13 +268,15 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
}
|
||||
|
||||
@Override
|
||||
public String save(TaxAgentSaveParam saveParam, Long employeeId) {
|
||||
public String save(TaxAgentSaveParam saveParam) {
|
||||
ValidUtil.doValidator(saveParam);
|
||||
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (isOpenDevolution && saveParam.getAdminUserId() == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(106271, "请选择管理员"));
|
||||
}
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listByName(saveParam.getName());
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listByName(saveParam.getName());
|
||||
if (CollectionUtils.isNotEmpty(taxAgents)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98080, "名称不允许重复"));
|
||||
}
|
||||
|
|
@ -244,10 +290,10 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
// }
|
||||
// 保存
|
||||
saveParam.setId(IdGenerator.generate());
|
||||
TaxAgentPO taxAgent = TaxAgentBO.convertToPO(saveParam, employeeId);
|
||||
taxAgentMapper.insert(taxAgent);
|
||||
TaxAgentPO taxAgent = TaxAgentBO.convertToPO(saveParam, (long) user.getUID());
|
||||
getTaxAgentMapper().insert(taxAgent);
|
||||
if (isOpenDevolution) {
|
||||
taxAgentAdminService.batchInsert(saveParam.getId(), Collections.singletonList(saveParam.getAdminUserId()));
|
||||
getTaxAgentAdminService(user).batchInsert(saveParam.getId(), Collections.singletonList(saveParam.getAdminUserId()));
|
||||
}
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordAddSingleLog(taxAgentLoggerTemplate,
|
||||
|
|
@ -262,24 +308,26 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
@Override
|
||||
public String paymentAgencyUpdate(TaxAgentPO taxAgentPO) {
|
||||
taxAgentMapper.update(taxAgentPO);
|
||||
getTaxAgentMapper().update(taxAgentPO);
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String update(TaxAgentSaveParam saveParam, Long employeeId) {
|
||||
public String update(TaxAgentSaveParam saveParam) {
|
||||
ValidUtil.doValidator(saveParam, RuntimeTypeEnum.UPDATE);
|
||||
|
||||
TaxAgentPO taxAgent = getById(saveParam.getId());
|
||||
if (taxAgent == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在"));
|
||||
}
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (isOpenDevolution && saveParam.getAdminUserId() == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(106271, "请选择管理员"));
|
||||
}
|
||||
|
||||
List<TaxAgentPO> individualTaxWithholdingAgents = taxAgentMapper.listByName(saveParam.getName());
|
||||
List<TaxAgentPO> individualTaxWithholdingAgents = getTaxAgentMapper().listByName(saveParam.getName());
|
||||
boolean nameExist = individualTaxWithholdingAgents.stream().anyMatch(e -> !Objects.equals(e.getId(), saveParam.getId()));
|
||||
if (nameExist) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98080, "名称不允许重复"));
|
||||
|
|
@ -288,19 +336,19 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
BeanUtils.copyProperties(taxAgent, taxAgentNew);
|
||||
BeanUtils.copyProperties(saveParam, taxAgentNew);
|
||||
taxAgentNew.setUpdateTime(new Date());
|
||||
taxAgentMapper.update(taxAgentNew);
|
||||
getTaxAgentMapper().update(taxAgentNew);
|
||||
if (isOpenDevolution) {
|
||||
Boolean isUnEnableChange = adminChangeCheck(TaxAgentAdminChangeCheckParam.builder()
|
||||
.taxAgentId(saveParam.getId())
|
||||
.adminUserId(saveParam.getAdminUserId())
|
||||
.build(), employeeId);
|
||||
.build());
|
||||
if (isUnEnableChange) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(115937, "该管理员有未归档核算数据,不可更换管理员"));
|
||||
}
|
||||
// 删除管理员
|
||||
taxAgentAdminService.deleteByTaxAgentIds(Collections.singletonList(taxAgent.getId()));
|
||||
getTaxAgentAdminService(user).deleteByTaxAgentIds(Collections.singletonList(taxAgent.getId()));
|
||||
// 新增管理员
|
||||
taxAgentAdminService.batchInsert(saveParam.getId(), Collections.singletonList(saveParam.getAdminUserId()));
|
||||
getTaxAgentAdminService(user).batchInsert(saveParam.getId(), Collections.singletonList(saveParam.getAdminUserId()));
|
||||
}
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(taxAgentLoggerTemplate,
|
||||
|
|
@ -315,17 +363,17 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
}
|
||||
|
||||
@Override
|
||||
public Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam, Long currentEmployeeId) {
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByTaxAgentIds(Collections.singletonList(checkParam.getTaxAgentId()));
|
||||
public Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam) {
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIds(Collections.singletonList(checkParam.getTaxAgentId()));
|
||||
Long adminUserId = CollectionUtils.isNotEmpty(taxAgentAdminList) ? taxAgentAdminList.get(0).getEmployeeId() : 0L;
|
||||
boolean isChanged = checkParam.getAdminUserId() != null && !adminUserId.equals(checkParam.getAdminUserId());
|
||||
// 更换了管理员
|
||||
if (isChanged) {
|
||||
// 检查是否核算
|
||||
//todo 1.社保福利档案是否有核算未归档
|
||||
Boolean checkedValue = false;// siAccountService.changeAdminUnfiledCheck(adminUserId);
|
||||
Boolean checkedValue = false;// getSIAccountService(user).changeAdminUnfiledCheck(adminUserId);
|
||||
// 2.薪资核算是否有核算未归档
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = salaryAcctRecordService.listByStatusAndEmployeeId(SalaryAcctRecordStatusEnum.NOT_ARCHIVED, adminUserId);
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listByStatusAndEmployeeId(SalaryAcctRecordStatusEnum.NOT_ARCHIVED, adminUserId);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctRecords) || checkedValue) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
|
@ -335,9 +383,13 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String delete(Collection<Long> ids, Long employeeId) {
|
||||
public String delete(Collection<Long> ids) {
|
||||
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listBySome(TaxAgentQueryParam.builder().ids(ids).build());
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(ids)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||
}
|
||||
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listBySome(TaxAgentQueryParam.builder().ids(ids).build());
|
||||
if (CollectionUtils.isEmpty(taxAgents)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(85382, "要删除的个税扣缴义务人在不存在或已删除"));
|
||||
}
|
||||
|
|
@ -347,13 +399,13 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100570, "正在使用的记录不允许删除"));
|
||||
}
|
||||
// 删除管理员
|
||||
taxAgentAdminService.deleteByTaxAgentIds(ids);
|
||||
getTaxAgentAdminService(user).deleteByTaxAgentIds(ids);
|
||||
// 删除分管理员和对应管理范围
|
||||
taxAgentSubAdminService.deleteByTaxAgentIds(ids);
|
||||
// todo taxAgentSubAdminService.deleteByTaxAgentIds(ids);
|
||||
// 删除人员范围
|
||||
taxAgentManageRangeService.deleteByTaxAgentIds(ids);
|
||||
getTaxAgentManageRangeService(user).deleteByTaxAgentIds(ids);
|
||||
|
||||
taxAgentMapper.deleteByIds(ids);
|
||||
getTaxAgentMapper().deleteByIds(ids);
|
||||
|
||||
// 记录日志
|
||||
// taxAgents.forEach(e -> SalaryLoggerUtil.recordDeleteSingleLog(taxAgentLoggerTemplate,
|
||||
|
|
@ -373,16 +425,16 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
* @return
|
||||
*/
|
||||
private boolean checkUsed(Collection<Long> ids) {
|
||||
// 被薪资档案引用
|
||||
List<SalaryArchivePO> salaryArchiveList = new LambdaQueryChainWrapper<>(salaryArchiveMapper)
|
||||
.eq(SalaryArchivePO::getDeleteType, 0)
|
||||
.eq(SalaryArchivePO::getTenantKey)
|
||||
.in(SalaryArchivePO::getTaxAgentId, ids)
|
||||
.list();
|
||||
salaryArchiveMapper.listSome(SalaryArchivePO.builder().t)
|
||||
if (CollectionUtils.isNotEmpty(salaryArchiveList)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
//fixme 被薪资档案引用
|
||||
// List<SalaryArchivePO> salaryArchiveList = new LambdaQueryChainWrapper<>(getSalaryArchiveMapper())
|
||||
// .eq(SalaryArchivePO::getDeleteType, 0)
|
||||
// .eq(SalaryArchivePO::getTenantKey)
|
||||
// .in(SalaryArchivePO::getTaxAgentId, ids)
|
||||
// .list();
|
||||
// getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().t);
|
||||
// if (CollectionUtils.isNotEmpty(salaryArchiveList)) {
|
||||
// return Boolean.TRUE;
|
||||
// }
|
||||
// todo 被社保福利档案引用
|
||||
// List<InsuranceArchivesSocialSchemePO> socialSchemePOList = new LambdaQueryChainWrapper<>(siArchivesSocialMapper)
|
||||
// .eq(InsuranceArchivesSocialSchemePO::getTenantKey)
|
||||
|
|
@ -417,17 +469,17 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
// }
|
||||
|
||||
// 被累计专项附加扣除引用
|
||||
List<AddUpDeduction> addUpDeductionList = addUpDeductionMapper.listSome(AddUpDeduction.builder().taxAgentIds(ids).build());
|
||||
List<AddUpDeduction> addUpDeductionList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().taxAgentIds(ids).build());
|
||||
if (CollectionUtils.isNotEmpty(addUpDeductionList)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
// 被其他免税扣除引用
|
||||
List<OtherDeductionPO> otherDeductionList = otherDeductionMapper.listSome(OtherDeductionPO.builder().taxAgentIds(ids).build());
|
||||
List<OtherDeductionPO> otherDeductionList = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().taxAgentIds(ids).build());
|
||||
if (CollectionUtils.isNotEmpty(otherDeductionList)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
// 被往期累计情况引用
|
||||
List<AddUpSituation> addUpSituationList = addUpSituationMapper.listSome(AddUpSituation.builder().taxAgentIds(ids).build());
|
||||
List<AddUpSituation> addUpSituationList = getAddUpSituationMapper().listSome(AddUpSituation.builder().taxAgentIds(ids).build());
|
||||
if (CollectionUtils.isNotEmpty(addUpSituationList)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
|
@ -436,9 +488,9 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectList(Long currentEmployeeId) {
|
||||
List<TaxAgentPO> taxAgents = taxAgentMapper.listAll();
|
||||
taxAgents = handleForDevolution(taxAgents, currentEmployeeId);
|
||||
public List<Map<String, Object>> selectList() {
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
|
||||
taxAgents = handleForDevolution(taxAgents, (long) user.getUID());
|
||||
return taxAgents.stream().map(m -> {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("id", String.valueOf(m.getId()));
|
||||
|
|
@ -456,14 +508,14 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
*/
|
||||
private List<TaxAgentPO> handleForDevolution(List<TaxAgentPO> taxAgents, Long currentEmployeeId) {
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (!isOpenDevolution || isChief(currentEmployeeId)) {
|
||||
return taxAgents;
|
||||
}
|
||||
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
List<Long> enableTaxAgentIds = Lists.newArrayList();
|
||||
// 1.判断自己是否是管理员, 如果是管理员,就是能够查看所属个税扣缴义务人
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByTaxAgentIdsAndEmployeeId(taxAgentIds, currentEmployeeId);
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIdsAndEmployeeId(taxAgentIds, currentEmployeeId);
|
||||
// 是管理员的列表
|
||||
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
|
||||
|
||||
|
|
@ -482,7 +534,7 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
|
||||
@Override
|
||||
public Boolean isOpenDevolution() {
|
||||
return taxAgentBaseService.isOpenDevolution();
|
||||
return getTaxAgentBaseService(user).isOpenDevolution();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -505,7 +557,7 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
}
|
||||
|
||||
List<Long> taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
List<TaxAgentEmployeePO> allEmployees = taxAgentMapper.listEmployee();
|
||||
List<TaxAgentEmployeePO> allEmployees = getTaxAgentMapper().listEmployee();
|
||||
if (employeeStatus != null) {
|
||||
List<String> personnelStatusList;
|
||||
// 查询人员状态
|
||||
|
|
@ -522,7 +574,7 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
}
|
||||
|
||||
// 1.判断自己是否是管理员, 如果是管理员,就是能够操作所属个税扣缴义务人下的所有人的数据
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByTaxAgentIdsAndEmployeeId(taxAgentIds, employeeId);
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIdsAndEmployeeId(taxAgentIds, (long) user.getUID());
|
||||
// 是管理员的列表
|
||||
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
|
||||
|
||||
|
|
@ -584,7 +636,7 @@ public class TaxAgentV2ServiceImpl extends Service implements TaxAgentV2Service
|
|||
*/
|
||||
private List<TaxAgentManageRangeEmployeeDTO> getTaxAgentEmp(List<TaxAgentPO> allTaxAgents, List<Long> taxAgentIds, List<TaxAgentEmployeePO> allEmployees) {
|
||||
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeList = Lists.newArrayList();
|
||||
List<TaxAgentEmpPO> taxAgentEmps = taxAgentEmpService.listByTaxAgentIds(taxAgentIds);
|
||||
List<TaxAgentEmpPO> taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds);
|
||||
|
||||
taxAgentEmps = taxAgentEmps.stream().filter(f -> allEmployees.stream().anyMatch(e -> e.getEmployeeId().equals(f.getEmployeeId()))).collect(Collectors.toList());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.taxagent.dto.*;
|
||||
import com.engine.salary.entity.taxagent.param.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.TaxAgentBaseWrapper;
|
||||
import com.engine.salary.wrapper.TaxAgentSubAdminWrapper;
|
||||
import com.engine.salary.wrapper.TaxAgentWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.general.BaseBean;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -20,17 +25,27 @@ import javax.ws.rs.Produces;
|
|||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentController {
|
||||
|
||||
private BaseBean logger = new BaseBean();
|
||||
|
||||
private TaxAgentService getService(User user) {
|
||||
return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentWrapper taxAgentWrapper;
|
||||
private TaxAgentBaseWrapper getTaxAgentBaseWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseWrapper.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentSubAdminWrapper getTaxAgentSubAdminWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxAgentSubAdminWrapper.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentWrapper getTaxAgentWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxAgentWrapper.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是薪酬模块总管理员
|
||||
|
|
@ -38,80 +53,374 @@ public class TaxAgentController {
|
|||
@GET
|
||||
@Path("/isChief")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String isChief() {
|
||||
public String isChief(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::list,ParamUtil.request2Map(request));
|
||||
return WeaResult.success(taxAgentWrapper.isChief(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
return new ResponseResult<Long, Boolean>(user).run(getTaxAgentWrapper(user)::isChief, (long) user.getUID());
|
||||
}
|
||||
|
||||
@GetMapping("/permission")
|
||||
@ApiOperation("权限信息")
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<Map<String, Boolean>> permission() {
|
||||
return WeaResult.success(taxAgentWrapper.permission(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
//个税扣缴义务人列表
|
||||
/**
|
||||
* 权限信息
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/permission")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String permission(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Map<String, Boolean>>(user).run(getTaxAgentWrapper(user)::permission, (long) user.getUID());
|
||||
}
|
||||
|
||||
/* ****** 基础信息 start ***********************************************************************************************/
|
||||
|
||||
/**
|
||||
* 获取个税扣缴义务人基础信息表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/base/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getBaseFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, TaxAgentBasePO>(user).run(getTaxAgentBaseWrapper(user)::getFrom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存个税扣缴义务人基础信息
|
||||
*
|
||||
* @param saveBaseParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/base/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveBase(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSaveBaseParam saveBaseParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSaveBaseParam, String>(user).run(getTaxAgentBaseWrapper(user)::save, saveBaseParam);
|
||||
}
|
||||
/* ******* 基础信息 end ***********************************************************************************************/
|
||||
|
||||
/* ******* 个税扣缴义务人 start ***********************************************************************************************/
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::list,ParamUtil.request2Map(request));
|
||||
return new ResponseResult<TaxAgentQueryParam, Map<String, Object>>(user).run(getTaxAgentWrapper(user)::list, queryParam);
|
||||
}
|
||||
|
||||
//获取个税扣缴义务人表单
|
||||
//查询个税扣缴义务人下面的代缴机构")
|
||||
@GET
|
||||
@Path("/paymentAgency/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String paymentAgencyList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
TaxAgentQueryParam queryParam = new TaxAgentQueryParam();
|
||||
queryParam.setIds(Collections.singleton(id));
|
||||
return new ResponseResult<TaxAgentQueryParam, List<Map<String, Object>>>(user).run(getTaxAgentWrapper(user)::paymentAgencyList, queryParam);
|
||||
}
|
||||
|
||||
//保存个税扣缴义务人下的代缴机构")
|
||||
@POST
|
||||
@Path("/paymentAgency/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String paymentAgencySave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSaveParam, String>(user).run(getTaxAgentWrapper(user)::paymentAgencySave, saveParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取个税扣缴义务人表单
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm,ParamUtil.request2Map(request));
|
||||
return new ResponseResult<Long, TaxAgentFormDTO>(user).run(getTaxAgentWrapper(user)::getFrom, id);
|
||||
}
|
||||
|
||||
//新建个税扣缴义务人
|
||||
/**
|
||||
* 新建个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::save,ParamUtil.request2Map(request));
|
||||
return new ResponseResult<TaxAgentSaveParam, String>(user).run(getTaxAgentWrapper(user)::save, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update,ParamUtil.request2Map(request));
|
||||
return new ResponseResult<TaxAgentSaveParam, String>(user).run(getTaxAgentWrapper(user)::update, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑个税扣缴义务人
|
||||
* 更换管理员校验
|
||||
*
|
||||
* @param checkParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/adminChangeCheck")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String adminChangeCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentAdminChangeCheckParam checkParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentAdminChangeCheckParam, Boolean>(user).run(getTaxAgentWrapper(user)::adminChangeCheck, checkParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除个税扣缴义务人
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Collection<Long>, String>(user).run(getService(user)::delete, ids);
|
||||
return new ResponseResult<Collection<Long>, String>(user).run(getTaxAgentWrapper(user)::delete, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员范围列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/range/listInclude")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String rangeListInclude(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentRangeQueryParam, PageInfo<TaxAgentManageRangeListDTO>>(user).run(getTaxAgentWrapper(user)::listRangeInclude, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分管理员管理范围排除列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/range/listExclude")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String rangeListExclude(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentRangeQueryParam, PageInfo<TaxAgentManageRangeListDTO>>(user).run(getTaxAgentWrapper(user)::listRangeExclude, queryParam);
|
||||
}
|
||||
|
||||
//获取人员范围表单")
|
||||
@POST
|
||||
@Path("/range/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getRangeFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, TaxAgentManageRangeFormDTO>(user).run(getTaxAgentWrapper(user)::getRangeFrom);
|
||||
}
|
||||
|
||||
//保存人员范围
|
||||
@POST
|
||||
@Path("/range/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentRangeSaveParam, String>(user).run(getTaxAgentWrapper(user)::saveRange, saveParam);
|
||||
}
|
||||
|
||||
//删除人员范围
|
||||
@POST
|
||||
@Path("/range/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Collection<Long>, String>(user).run(getTaxAgentWrapper(user)::deleteRange, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人下拉列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@POST
|
||||
@Path("/selectList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::selectList,ParamUtil.request2Map(request));
|
||||
return new ResponseResult<Collection<Long>, List<Map<String, Object>>>(user).run(getTaxAgentWrapper(user)::selectList);
|
||||
}
|
||||
/* ******* 个税扣缴义务人 end ***********************************************************************************************/
|
||||
|
||||
/* ******* 分管理员 start ***********************************************************************************************/
|
||||
|
||||
/**
|
||||
* 分管理员列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/subAdmin/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String subAdminList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminQueryParam, PageInfo<TaxAgentSubAdminListDTO>>(user).run(getTaxAgentSubAdminWrapper(user)::list, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分管理员基础设置表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/subAdmin/getBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSubAdminBaseFrom(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminBaseFormParam baseFormParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminBaseFormParam, TaxAgentSubAdminBaseFormDTO>(user).run(getTaxAgentSubAdminWrapper(user)::getBaseFrom, baseFormParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分管理员基础设置保存
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/subAdmin/saveBase")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSubAdminBase(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminBaseSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminBaseSaveParam, String>(user).run(getTaxAgentSubAdminWrapper(user)::saveBase, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除个税扣缴义务人分管理员
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/subAdmin/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteSubAdmin(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Collection<Long>, String>(user).run(getTaxAgentSubAdminWrapper(user)::delete, ids);
|
||||
}
|
||||
|
||||
//分管理员的管理范围列表
|
||||
@POST
|
||||
@Path("/subAdmin/range/listInclude")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String subAdminRangeListInclude(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminRangeQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminRangeQueryParam, PageInfo<TaxAgentManageRangeListDTO>>(user).run(getTaxAgentSubAdminWrapper(user)::listRangeInclude, queryParam);
|
||||
}
|
||||
|
||||
//分管理员的管理范围排除列表
|
||||
@POST
|
||||
@Path("/subAdmin/range/listExclude")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String subAdminRangeListExclude(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminRangeQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminRangeQueryParam, PageInfo<TaxAgentManageRangeListDTO>>(user).run(getTaxAgentSubAdminWrapper(user)::listRangeExclude, queryParam);
|
||||
}
|
||||
|
||||
//获取分管理员的管理范围表单
|
||||
@POST
|
||||
@Path("/subAdmin/range/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSubAdminRangeFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminRangeQueryParam, TaxAgentManageRangeFormDTO>(user).run(getTaxAgentSubAdminWrapper(user)::getRangeFrom);
|
||||
}
|
||||
|
||||
//保存分管理员的管理范围
|
||||
@POST
|
||||
@Path("/subAdmin/range/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSubAdminRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentSubAdminRangeSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<TaxAgentSubAdminRangeSaveParam, TaxAgentManageRangeFormDTO>(user).run(getTaxAgentSubAdminWrapper(user)::saveRange, saveParam);
|
||||
}
|
||||
|
||||
//删除分管理员的管理范围
|
||||
@POST
|
||||
@Path("/subAdmin/range/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteSubAdminRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Collection<Long>, String>(user).run(getTaxAgentSubAdminWrapper(user)::deleteRange, ids);
|
||||
}
|
||||
|
||||
/******** 分管理员 end ***********************************************************************************************/
|
||||
|
||||
|
||||
// //------------------------------------------------------------------------------------------
|
||||
//
|
||||
// //个税扣缴义务人列表
|
||||
// @GET
|
||||
// @Path("/list")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::list, ParamUtil.request2Map(request));
|
||||
// }
|
||||
//
|
||||
// //获取个税扣缴义务人表单
|
||||
// @GET
|
||||
// @Path("/getForm")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm, ParamUtil.request2Map(request));
|
||||
// }
|
||||
//
|
||||
// //新建个税扣缴义务人
|
||||
// @POST
|
||||
// @Path("/save")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::save, ParamUtil.request2Map(request));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑个税扣缴义务人
|
||||
// */
|
||||
// @POST
|
||||
// @Path("/update")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String update(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update, ParamUtil.request2Map(request));
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,6 +89,4 @@ public class TaxRateController {
|
|||
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delete,map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentSaveBaseParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.service.TaxAgentBaseService;
|
||||
import com.engine.salary.service.impl.TaxAgentBaseServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人基础信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class TaxAgentBaseWrapper extends Service {
|
||||
|
||||
private TaxAgentBaseService getTaxAgentBaseService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个税扣缴义务人基本信息表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public TaxAgentBasePO getFrom() {
|
||||
TaxAgentBasePO base = getTaxAgentBaseService(user).getBaseInfo();
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存个税扣缴义务人基本信息
|
||||
*
|
||||
* @param saveBaseParam
|
||||
* @return
|
||||
*/
|
||||
public String save(TaxAgentSaveBaseParam saveBaseParam) {
|
||||
return getTaxAgentBaseService(user).save(saveBaseParam);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.EmployBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.*;
|
||||
import com.engine.salary.entity.taxagent.param.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentSubAdminPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.TaxAgentManageRangeService;
|
||||
import com.engine.salary.service.TaxAgentSubAdminService;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 个税义务人分管理员
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class TaxAgentSubAdminWrapper extends Service {
|
||||
|
||||
private TaxAgentSubAdminService taxAgentSubAdminService;
|
||||
private TaxAgentManageRangeService taxAgentManageRangeService;
|
||||
// private HrmCommonEmployeeService hrmCommonEmployeeService;
|
||||
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
|
||||
/**
|
||||
* 获取分管理员列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<TaxAgentSubAdminListDTO> list(TaxAgentSubAdminQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
|
||||
List<TaxAgentSubAdminPO> list = taxAgentSubAdminService.listByTaxAgentIds(Collections.singletonList(queryParam.getTaxAgentId()));
|
||||
String range = SalaryI18nUtil.getI18nLabel(106290, "详情");
|
||||
List<DataCollectionEmployee> subAdminList = employBiz.getEmployeeByIds(list.stream().map(TaxAgentSubAdminPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
|
||||
List<TaxAgentSubAdminListDTO> records = TaxAgentBO.convertToSubAdminListDTO(list, range, subAdminList);
|
||||
PageInfo<TaxAgentSubAdminListDTO> listPage = PageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentSubAdminListDTO.class);
|
||||
// 填充总数和当页数据
|
||||
listPage.setTotal(records.size());
|
||||
listPage.setList(PageUtil.subList(listPage.getPageNum(), listPage.getSize(), records));
|
||||
|
||||
return listPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分管理员
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public String delete(Collection<Long> ids) {
|
||||
return taxAgentSubAdminService.deleteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基础设置表单
|
||||
*
|
||||
* @param baseFormParam
|
||||
* @return
|
||||
*/
|
||||
public TaxAgentSubAdminBaseFormDTO getBaseFrom(TaxAgentSubAdminBaseFormParam baseFormParam) {
|
||||
ValidUtil.doValidator(baseFormParam);
|
||||
|
||||
TaxAgentSubAdminBaseFormDTO taxAgentSubAdminBaseFormDTO = new TaxAgentSubAdminBaseFormDTO();
|
||||
Long id = baseFormParam.getId();
|
||||
if (id != null) {
|
||||
TaxAgentSubAdminPO taxAgentSubAdmin = taxAgentSubAdminService.getById(id);
|
||||
if (taxAgentSubAdmin == null) {
|
||||
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(106466, "分管理员不存在") + "[id:%s]", id));
|
||||
}
|
||||
if (!baseFormParam.getTaxAgentId().equals(taxAgentSubAdmin.getTaxAgentId())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(106685, "分管理员与所属个税扣缴义务人不匹配"));
|
||||
}
|
||||
taxAgentSubAdminBaseFormDTO.setId(taxAgentSubAdmin.getId());
|
||||
taxAgentSubAdminBaseFormDTO.setDescription(taxAgentSubAdmin.getRemark());
|
||||
TaxAgentEmployeeOptionDTO taxAgentEmployee = new TaxAgentEmployeeOptionDTO();
|
||||
taxAgentEmployee.setId(taxAgentSubAdmin.getEmployeeId());
|
||||
DataCollectionEmployee employee = employBiz.getEmployeeById(taxAgentEmployee.getId());
|
||||
taxAgentEmployee.setContent(employee == null ? "" : employee.getUsername());
|
||||
|
||||
taxAgentSubAdminBaseFormDTO.setSubAdminUser(Collections.singletonList(taxAgentEmployee));
|
||||
} else {
|
||||
taxAgentSubAdminBaseFormDTO.setSubAdminUser(Lists.newArrayList());
|
||||
}
|
||||
|
||||
return taxAgentSubAdminBaseFormDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存分管理员基础设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public String saveBase(TaxAgentSubAdminBaseSaveParam saveParam) {
|
||||
return taxAgentSubAdminService.saveBase(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 范围列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listRangeInclude(TaxAgentSubAdminRangeQueryParam queryParam) {
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = taxAgentManageRangeService.listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE);
|
||||
return listPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 范围排除列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listRangeExclude(TaxAgentSubAdminRangeQueryParam queryParam) {
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = taxAgentManageRangeService.listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO);
|
||||
return listPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理范围表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public TaxAgentManageRangeFormDTO getRangeFrom() {
|
||||
return TaxAgentManageRangeFormDTO.builder().employeeStatus(UserStatusEnum.getHrmStatusList()).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存管理范围
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public String saveRange(TaxAgentSubAdminRangeSaveParam saveParam) {
|
||||
taxAgentManageRangeService.save4SubAdmin(saveParam);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理范围
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public String deleteRange(Collection<Long> ids) {
|
||||
taxAgentManageRangeService.deleteByIds(ids);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,39 +2,31 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.salary.entity.agency.po.PaymentAgencyPO;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeOptionDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentFormDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeFormDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentAdminChangeCheckParam;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentRangeQueryParam;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentSaveParam;
|
||||
import com.engine.salary.entity.taxagent.param.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.weaver.common.component.browser.combination.TypesBrowserOption;
|
||||
import com.weaver.common.component.form.WeaForm;
|
||||
import com.weaver.common.component.form.item.WeaFormOption;
|
||||
import com.weaver.common.hrm.domain.employee.HrmStatus;
|
||||
import com.weaver.hrm.salary.entity.taxagent.dto.TaxAgentManageRangeFormDTO;
|
||||
import com.weaver.hrm.salary.entity.taxagent.param.*;
|
||||
import com.weaver.hrm.salary.service.*;
|
||||
import com.weaver.hrm.salary.util.SalaryFormatUtil;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -47,26 +39,35 @@ import java.util.stream.Collectors;
|
|||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class TaxAgentWrapper {
|
||||
public class TaxAgentWrapper extends Service {
|
||||
|
||||
public TaxAgentBaseService getTaxAgentBaseService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentBaseService taxAgentBaseService;
|
||||
public TaxAgentAdminService getTaxAgentAdminService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentAdminServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentAdminService taxAgentAdminService;
|
||||
public TaxAgentV2Service getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentV2ServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentV2Service taxAgentService;
|
||||
public SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryEmployeeService employeeService;
|
||||
public TaxAgentManageRangeService getTaxAgentManageRangeService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentManageRangeService taxAgentManageRangeService;
|
||||
|
||||
private PaymentAgencyService paymentAgencyService;
|
||||
|
||||
private SIEmployeeStatusMapper siEmployeeStatusMapper;
|
||||
|
||||
private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
|
||||
private HrmConfigSetCache hrmConfigSetCache;
|
||||
// private PaymentAgencyService paymentAgencyService;
|
||||
//
|
||||
// private SIEmployeeStatusMapper siEmployeeStatusMapper;
|
||||
//
|
||||
// private HrmCommonHrmStatusService hrmCommonHrmStatusService;
|
||||
//
|
||||
// private HrmConfigSetCache hrmConfigSetCache;
|
||||
|
||||
/**
|
||||
* 是否是薪酬模块总管理员
|
||||
|
|
@ -75,7 +76,7 @@ public class TaxAgentWrapper {
|
|||
* @return
|
||||
*/
|
||||
public Boolean isChief(Long currentEmployeeId) {
|
||||
return taxAgentService.isChief(currentEmployeeId);
|
||||
return getTaxAgentService(user).isChief(currentEmployeeId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -87,8 +88,8 @@ public class TaxAgentWrapper {
|
|||
public Map<String, Boolean> permission(Long currentEmployeeId) {
|
||||
Map<String, Boolean> resultMap = Maps.newHashMap();
|
||||
Boolean isChief = isChief(currentEmployeeId);
|
||||
Boolean isDefaultOpen = taxAgentService.isDefaultOpen(currentEmployeeId);
|
||||
Boolean isAdminEnable = taxAgentService.isAdminEnable(currentEmployeeId);
|
||||
Boolean isDefaultOpen = getTaxAgentService(user).isDefaultOpen(currentEmployeeId);
|
||||
Boolean isAdminEnable = getTaxAgentService(user).isAdminEnable(currentEmployeeId);
|
||||
resultMap.put("isChief", isChief);
|
||||
resultMap.put("isDefaultOpen", isDefaultOpen);
|
||||
resultMap.put("isAdminEnable", isAdminEnable);
|
||||
|
|
@ -99,26 +100,25 @@ public class TaxAgentWrapper {
|
|||
* 个税口角义务人列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> list(TaxAgentQueryParam queryParam, Long currentEmployeeId) {
|
||||
public Map<String, Object> list(TaxAgentQueryParam queryParam) {
|
||||
// 是否是总管理员
|
||||
Boolean isChief = taxAgentService.isChief(currentEmployeeId);
|
||||
Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
|
||||
// List<PaymentAgencyPO> paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);
|
||||
|
||||
PageInfo<TaxAgentPO> page = null;
|
||||
if (isChief) {
|
||||
page = taxAgentService.listPage(queryParam);
|
||||
page = getTaxAgentService(user).listPage(queryParam);
|
||||
} else {
|
||||
// 分权情况下,根据自己作为管理员过滤列表
|
||||
if (isOpenDevolution) {
|
||||
List<TaxAgentPO> list = taxAgentService.list(queryParam);
|
||||
List<TaxAgentPO> list = getTaxAgentService(user).list(queryParam);
|
||||
// 1.判断自己是否是管理员, 如果是管理员,就是能够操作所属个税扣缴义务人下的所有人的数据
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = taxAgentAdminService.listByTaxAgentIdsAndEmployeeId(list.stream().map(TaxAgentPO::getId).collect(Collectors.toList()), currentEmployeeId);
|
||||
List<TaxAgentAdminPO> taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIdsAndEmployeeId(list.stream().map(TaxAgentPO::getId).collect(Collectors.toList()), (long) user.getUID());
|
||||
// 是管理员的列表
|
||||
List<Long> adminTaxAgentIds = taxAgentAdminList.stream().map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f -> adminTaxAgentIds.contains(f.getId())).collect(Collectors.toList());
|
||||
|
|
@ -137,8 +137,8 @@ public class TaxAgentWrapper {
|
|||
if (isOpenDevolution) {
|
||||
List<TaxAgentPO> list = page.getList();
|
||||
List<Long> taxAgentIds = list.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
List<TaxAgentAdminPO> taxAgentAdmins = taxAgentAdminService.listByTaxAgentIds(taxAgentIds);
|
||||
List<DataCollectionEmployee> adminList = employeeService.listByIds(taxAgentAdmins.stream().map(TaxAgentAdminPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
List<TaxAgentAdminPO> taxAgentAdmins = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds);
|
||||
List<DataCollectionEmployee> adminList = getSalaryEmployeeService(user).listByIds(taxAgentAdmins.stream().map(TaxAgentAdminPO::getEmployeeId).distinct().collect(Collectors.toList()));
|
||||
listPage.setList(TaxAgentBO.convertToTableListDTO(page.getList(), null, taxAgentAdmins, adminList, setLabel));
|
||||
} else {
|
||||
listPage.setList(TaxAgentBO.convertToTableListDTO(page.getList(), null, setLabel));
|
||||
|
|
@ -168,16 +168,17 @@ public class TaxAgentWrapper {
|
|||
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> paymentAgencyList(TaxAgentQueryParam queryParam, Long currentEmployeeId) {
|
||||
List<TaxAgentPO> taxAgentPOS = taxAgentService.listByIds(queryParam.getIds());
|
||||
List<PaymentAgencyPO> paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);
|
||||
SalaryAssert.notEmpty(taxAgentPOS, "taxagent data is not exist");
|
||||
TaxAgentPO taxAgentPO = taxAgentPOS.get(0);
|
||||
return TaxAgentBO.buildPaymentAgency(taxAgentPO.getPaymentAgency(), paymentAgencyPOS);
|
||||
public List<Map<String, Object>> paymentAgencyList(TaxAgentQueryParam queryParam) {
|
||||
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(queryParam.getIds());
|
||||
// List<PaymentAgencyPO> paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);
|
||||
// SalaryAssert.notEmpty(taxAgentPOS, "taxagent data is not exist");
|
||||
// TaxAgentPO taxAgentPO = taxAgentPOS.get(0);
|
||||
// return TaxAgentBO.buildPaymentAgency(taxAgentPO.getPaymentAgency(), paymentAgencyPOS);
|
||||
return null;
|
||||
}
|
||||
|
||||
public String paymentAgencySave(TaxAgentSaveParam param, Long currentEmploueeId) {
|
||||
// List<TaxAgentPO> taxAgentPOS = taxAgentService.listByIds(Collections.singletonList(param.getId()));
|
||||
public String paymentAgencySave(TaxAgentSaveParam param) {
|
||||
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(Collections.singletonList(param.getId()));
|
||||
// SalaryAssert.notEmpty(taxAgentPOS, "data is not exist");
|
||||
// TaxAgentPO taxAgentPO = taxAgentPOS.get(0);
|
||||
// List<String> errorList = new ArrayList<>();
|
||||
|
|
@ -211,7 +212,7 @@ public class TaxAgentWrapper {
|
|||
// currentEmploueeId, 115129, "缴纳社保福利,不可取消关联");
|
||||
// } else {
|
||||
// taxAgentPO.setPaymentAgency(param.getPaymentAgency());
|
||||
// taxAgentService.paymentAgencyUpdate(taxAgentPO, currentEmploueeId);
|
||||
// getTaxAgentService(user).paymentAgencyUpdate(taxAgentPO, currentEmploueeId);
|
||||
// }
|
||||
return "";
|
||||
}
|
||||
|
|
@ -225,21 +226,21 @@ public class TaxAgentWrapper {
|
|||
public TaxAgentFormDTO getFrom(Long id) {
|
||||
TaxAgentFormDTO taxAgentFromDTO = new TaxAgentFormDTO();
|
||||
if (id != null) {
|
||||
TaxAgentPO taxAgent = taxAgentService.getById(id);
|
||||
TaxAgentPO taxAgent = getTaxAgentService(user).getById(id);
|
||||
if (taxAgent == null) {
|
||||
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(100543, "个税扣缴人不存在") + "[id:%s]", id));
|
||||
}
|
||||
BeanUtils.copyProperties(taxAgent, taxAgentFromDTO);
|
||||
}
|
||||
// 是否开启分权
|
||||
boolean isOpenDevolution = taxAgentBaseService.isOpenDevolution();
|
||||
boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();
|
||||
if (isOpenDevolution) {
|
||||
List<TaxAgentAdminPO> admins = taxAgentAdminService.listByTaxAgentIds(Collections.singletonList(id));
|
||||
List<TaxAgentAdminPO> admins = getTaxAgentAdminService(user).listByTaxAgentIds(Collections.singletonList(id));
|
||||
// 目前是一个
|
||||
TaxAgentEmployeeOptionDTO taxAgentEmployee = new TaxAgentEmployeeOptionDTO();
|
||||
taxAgentEmployee.setId(CollectionUtils.isEmpty(admins) ? null : admins.get(0).getEmployeeId());
|
||||
if (taxAgentEmployee.getId() != null) {
|
||||
DataCollectionEmployee employee = employeeService.getEmployeeById(taxAgentEmployee.getId());
|
||||
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(taxAgentEmployee.getId());
|
||||
taxAgentEmployee.setContent(employee == null ? "" : employee.getUsername());
|
||||
}
|
||||
taxAgentFromDTO.setAdminUser(Collections.singletonList(taxAgentEmployee));
|
||||
|
|
@ -254,54 +255,49 @@ public class TaxAgentWrapper {
|
|||
* 保存个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public String save(TaxAgentSaveParam saveParam, Long currentEmployeeId) {
|
||||
return taxAgentService.save(saveParam, currentEmployeeId);
|
||||
public String save(TaxAgentSaveParam saveParam) {
|
||||
return getTaxAgentService(user).save(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑个税扣缴义务人
|
||||
*
|
||||
* @param saveParam
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public String update(TaxAgentSaveParam saveParam, Long currentEmployeeId) {
|
||||
return taxAgentService.update(saveParam, currentEmployeeId);
|
||||
public String update(TaxAgentSaveParam saveParam) {
|
||||
return getTaxAgentService(user).update(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更换管理员校验
|
||||
*
|
||||
* @param checkParam
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam, Long currentEmployeeId) {
|
||||
return taxAgentService.adminChangeCheck(checkParam, currentEmployeeId);
|
||||
public Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam) {
|
||||
return getTaxAgentService(user).adminChangeCheck(checkParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除个税扣缴义务人
|
||||
*
|
||||
* @param ids
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public String delete(Collection<Long> ids, Long currentEmployeeId) {
|
||||
return taxAgentService.delete(ids, currentEmployeeId);
|
||||
public String delete(Collection<Long> ids) {
|
||||
return getTaxAgentService(user).delete(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人下拉列表
|
||||
*
|
||||
* @param currentEmployeeId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectList(Long currentEmployeeId) {
|
||||
return taxAgentService.selectList(currentEmployeeId);
|
||||
public List<Map<String, Object>> selectList() {
|
||||
return getTaxAgentService(user).selectList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -311,7 +307,7 @@ public class TaxAgentWrapper {
|
|||
* @return
|
||||
*/
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listRangeInclude(TaxAgentRangeQueryParam queryParam) {
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = taxAgentManageRangeService.listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE);
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE);
|
||||
return listPage;
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +318,7 @@ public class TaxAgentWrapper {
|
|||
* @return
|
||||
*/
|
||||
public PageInfo<TaxAgentManageRangeListDTO> listRangeExclude(TaxAgentRangeQueryParam queryParam) {
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = taxAgentManageRangeService.listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO);
|
||||
PageInfo<TaxAgentManageRangeListDTO> listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO);
|
||||
return listPage;
|
||||
}
|
||||
|
||||
|
|
@ -331,43 +327,21 @@ public class TaxAgentWrapper {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public WeaForm getRangeFrom() {
|
||||
public TaxAgentManageRangeFormDTO getRangeFrom() {
|
||||
// 查询人员状态
|
||||
List<UserStatusEnum> hrmStatusList = UserStatusEnum.getEffectiveList();
|
||||
List<WeaFormOption> weaFormOptions = hrmStatusList.stream().map(hrmStatus -> {
|
||||
WeaFormOption weaFormOption = new WeaFormOption();
|
||||
weaFormOption.setId("" + hrmStatus.getCodeId());
|
||||
weaFormOption.setContent(hrmStatus.getName());
|
||||
return weaFormOption;
|
||||
}).collect(Collectors.toList());
|
||||
Long employeeId = UserContext.getCurrentEmployeeId();
|
||||
List<TypesBrowserOption> browserOptions = new ArrayList<>();
|
||||
browserOptions.add(new TypesBrowserOption("user", SalaryI18nUtil.getI18nLabel(1869, "人员")));
|
||||
browserOptions.add(new TypesBrowserOption("dept", SalaryI18nUtil.getI18nLabel(1250, "部门")));
|
||||
if (hrmConfigSetCache.isSubcompanySupport(tenantKey)) {
|
||||
browserOptions.add(new TypesBrowserOption("subcompany", SalaryI18nUtil.getI18nLabel(107369, "分部")));
|
||||
}
|
||||
browserOptions.add(new TypesBrowserOption("position", SalaryI18nUtil.getI18nLabel(1245, "岗位")));
|
||||
List<HrmStatus> hrmStatusList = UserStatusEnum.getHrmStatusList();
|
||||
|
||||
WeaForm weaForm = SalaryFormatUtil.<TaxAgentManageRangeFormDTO>getInstance().buildForm(TaxAgentManageRangeFormDTO.class, TaxAgentManageRangeFormDTO.builder().targetOptions(browserOptions).build());
|
||||
weaForm.getItems().forEach((key, value) -> {
|
||||
if (StringUtils.equals("employeeStatus", key)) {
|
||||
value.setOptions(weaFormOptions);
|
||||
}
|
||||
});
|
||||
return weaForm;
|
||||
return TaxAgentManageRangeFormDTO.builder().employeeStatus(hrmStatusList).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存管理范围
|
||||
*
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
public String saveRange(TaxAgentRangeSaveParam saveParam, Long employeeId, String tenantKey) {
|
||||
taxAgentManageRangeService.save(saveParam, employeeId, tenantKey);
|
||||
public String saveRange(TaxAgentRangeSaveParam saveParam) {
|
||||
getTaxAgentManageRangeService(user).save(saveParam);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
|
|
@ -375,11 +349,10 @@ public class TaxAgentWrapper {
|
|||
* 删除管理范围
|
||||
*
|
||||
* @param ids
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
public String deleteRange(Collection<Long> ids, Long employeeId, String tenantKey) {
|
||||
taxAgentManageRangeService.deleteByIds(ids, employeeId, tenantKey);
|
||||
public String deleteRange(Collection<Long> ids) {
|
||||
getTaxAgentManageRangeService(user).deleteByIds(ids);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue