在线获取累计专项附加扣除
This commit is contained in:
parent
552eaa4589
commit
96bfdf05ed
|
|
@ -0,0 +1,40 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
request_status number default 1 not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null,
|
||||
tax_agent_id number not null
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||
/
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
employee_id number not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id number not null,
|
||||
reason varchar2(255) not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
request_status number default 1 not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null,
|
||||
tax_agent_id number not null
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||
/
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
employee_id number not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id number not null,
|
||||
reason varchar2(255) not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
request_status number default 1 not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null,
|
||||
tax_agent_id number not null
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||
/
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
employee_id number not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id number not null,
|
||||
reason varchar2(255) not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id bigint primary key comment 'ID' ,
|
||||
create_time datetime comment '创建时间' ,
|
||||
update_time datetime comment '修改时间' ,
|
||||
creator bigint comment '创建人id' ,
|
||||
delete_type int default 0 comment '是否删除' ,
|
||||
tenant_key varchar(10) comment '租户KEY' ,
|
||||
request_id bigint not null comment '查询请求ID' ,
|
||||
request_status tinyint(1) default 1 not null comment '请求处理状态:10待处理 20处理中 99已完成' ,
|
||||
tax_year_month datetime not null comment '税款所属期' ,
|
||||
outer_request_id varchar(50) not null comment '外部接口查询请求ID' ,
|
||||
tax_agent_id bigint not null comment '个税扣缴义务人Id'
|
||||
)
|
||||
;
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int
|
||||
;
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify column lock_version int default 0
|
||||
;
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id bigint primary key comment 'ID' ,
|
||||
create_time datetime comment '创建时间' ,
|
||||
update_time datetime comment '修改时间' ,
|
||||
creator bigint comment '创建人id' ,
|
||||
delete_type int default 0 comment '是否删除' ,
|
||||
tenant_key varchar(10) comment '租户KEY' ,
|
||||
request_id bigint not null comment '查询请求ID' ,
|
||||
employee_id bigint not null comment '员工ID' ,
|
||||
employee_type int not null comment '员工类型' ,
|
||||
tax_agent_id bigint not null comment '个税扣缴义务人ID' ,
|
||||
reason varchar(255) not null comment '失败原因' ,
|
||||
tax_year_month datetime not null comment '税款所属期' ,
|
||||
outer_request_id varchar(50) not null comment '外部接口查询请求id'
|
||||
)
|
||||
;
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
request_status number default 1 not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null,
|
||||
tax_agent_id number not null
|
||||
)
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify lock_version default 0
|
||||
/
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
employee_id number not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id number not null,
|
||||
reason varchar2(255) not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10),
|
||||
request_id bigint not null,
|
||||
request_status smallint default 1 not null,
|
||||
tax_year_month timestamp not null,
|
||||
outer_request_id varchar(50) not null,
|
||||
tax_agent_id bigint not null
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request alter column lock_version set default 0;
|
||||
/
|
||||
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10),
|
||||
request_id bigint not null,
|
||||
employee_id bigint not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id bigint not null,
|
||||
reason varchar(255) not null,
|
||||
tax_year_month timestamp not null,
|
||||
outer_request_id varchar(50) not null
|
||||
);
|
||||
/
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key nvarchar(10),
|
||||
request_id bigint not null,
|
||||
request_status tinyint default 1 not null,
|
||||
tax_year_month datetime not null,
|
||||
outer_request_id nvarchar(50) not null,
|
||||
tax_agent_id bigint not null
|
||||
)
|
||||
GO
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int
|
||||
GO
|
||||
|
||||
alter table hrsa_add_up_deduction_request add constraint df_lock_version_71db6820 default 0 for lock_version
|
||||
GO
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key nvarchar(10),
|
||||
request_id bigint not null,
|
||||
employee_id bigint not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id bigint not null,
|
||||
reason nvarchar(255) not null,
|
||||
tax_year_month datetime not null,
|
||||
outer_request_id nvarchar(50) not null
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
create table hrsa_add_up_deduction_request
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
request_status number default 1 not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null,
|
||||
tax_agent_id number not null
|
||||
);
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||
/
|
||||
|
||||
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||
/
|
||||
|
||||
create table hrsa_add_up_deduction_req_fail
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date,
|
||||
update_time date,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
request_id number not null,
|
||||
employee_id number not null,
|
||||
employee_type int not null,
|
||||
tax_agent_id number not null,
|
||||
reason varchar2(255) not null,
|
||||
tax_year_month date not null,
|
||||
outer_request_id varchar2(50) not null
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.engine.salary.entity.datacollection.bo;
|
||||
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||
import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
|
|
@ -8,6 +12,7 @@ import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
|||
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||||
import com.engine.salary.service.impl.AddUpDeductionServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -17,10 +22,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 数据采集
|
||||
|
|
@ -357,39 +359,40 @@ public class DataCollectionBO {
|
|||
return employeeList;
|
||||
}
|
||||
|
||||
// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) {
|
||||
// return AddUpDeduction.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .addUpChildEducation(feedback.getLjznjyzc().toString())
|
||||
// .addUpContinuingEducation(feedback.getLjjxjyzc().toString())
|
||||
// .addUpHousingRent(feedback.getLjzfzjzc().toString())
|
||||
// .addUpInfantCare(feedback.getLjyyezhzc().toString())
|
||||
// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString())
|
||||
// .addUpSupportElderly(feedback.getLjsylrzc().toString())
|
||||
// .addUpIllnessMedical("0")
|
||||
public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) {
|
||||
return AddUpDeduction.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.addUpChildEducation(feedback.getLjznjyzc().toString())
|
||||
.addUpContinuingEducation(feedback.getLjjxjyzc().toString())
|
||||
.addUpHousingRent(feedback.getLjzfzjzc().toString())
|
||||
.addUpInfantCare(feedback.getLjyyezhzc().toString())
|
||||
.addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString())
|
||||
.addUpSupportElderly(feedback.getLjsylrzc().toString())
|
||||
.addUpIllnessMedical("0")
|
||||
// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue())
|
||||
// .lastUpdateTime(LocalDateTime.now())
|
||||
// .updateTime(LocalDateTime.now())
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||||
// AddUpDeductionRequestPO requestPO,
|
||||
// Long employeeId) {
|
||||
// return AddUpDeductionRequestFailPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .requestId(requestPO.getRequestId())
|
||||
// .outerRequestId(requestPO.getOuterRequestId())
|
||||
// .taxYearMonth(requestPO.getTaxYearMonth())
|
||||
// .taxAgentId(requestPO.getTaxAgentId())
|
||||
// .employeeId(Optional.ofNullable(employeeId).orElse(0L))
|
||||
// .createTime(LocalDateTime.now())
|
||||
// .updateTime(LocalDateTime.now())
|
||||
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
// .creator(requestWrapper.getCurrentEmployeeId())
|
||||
// .tenantKey(requestPO.getTenantKey())
|
||||
// .build();
|
||||
// }
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||||
AddUpDeductionRequestPO requestPO,
|
||||
Long employeeId) {
|
||||
Date now = new Date();
|
||||
return AddUpDeductionRequestFailPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.requestId(requestPO.getRequestId())
|
||||
.outerRequestId(requestPO.getOuterRequestId())
|
||||
.taxYearMonth(requestPO.getTaxYearMonth())
|
||||
.taxAgentId(requestPO.getTaxAgentId())
|
||||
.employeeId(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.creator(requestWrapper.getCurrentEmployeeId())
|
||||
.tenantKey(requestPO.getTenantKey())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||
return AddUpDeductionRequestResultDTO.builder()
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.engine.salary.entity.datacollection.po;
|
||||
|
||||
import com.engine.salary.report.enums.EmployeeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据采集-累计专项附加扣除在线查询失败表
|
||||
|
|
@ -31,10 +32,10 @@ public class AddUpDeductionRequestFailPO implements Serializable {
|
|||
private Long id;
|
||||
|
||||
//创建时间", ignore = true)
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
//修改时间", ignore = true)
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
//创建人id", ignore = true)
|
||||
private long creator;
|
||||
|
|
@ -61,12 +62,15 @@ public class AddUpDeductionRequestFailPO implements Serializable {
|
|||
private String reason;
|
||||
|
||||
//税款所属期")
|
||||
private LocalDate taxYearMonth;
|
||||
private Date taxYearMonth;
|
||||
|
||||
/**
|
||||
* @see com.weaver.hrm.salary.enums.salaryaccounting.EmployeeTypeEnum
|
||||
* @see EmployeeTypeEnum
|
||||
*/
|
||||
//人员类型")
|
||||
private Integer employeeType;
|
||||
|
||||
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -19,49 +20,56 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_add_up_deduction_request")
|
||||
//数据采集-累计专项附加扣除在线查询表")
|
||||
//hrsa_add_up_deduction_request
|
||||
//数据采集-累计专项附加扣除在线查询表
|
||||
public class AddUpDeductionRequestPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1452863635879051515L;
|
||||
|
||||
//ID")
|
||||
//ID
|
||||
private long id;
|
||||
|
||||
//创建时间", ignore = true)
|
||||
//创建时间"
|
||||
private Date createTime;
|
||||
|
||||
//修改时间", ignore = true)
|
||||
//修改时间"
|
||||
private Date updateTime;
|
||||
|
||||
//创建人id", ignore = true)
|
||||
//创建人id"
|
||||
private long creator;
|
||||
|
||||
//是否删除", ignore = true)
|
||||
//是否删除"
|
||||
private int deleteType;
|
||||
|
||||
//租户KEY", ignore = true)
|
||||
//租户KEY"
|
||||
private String tenantKey;
|
||||
|
||||
//乐观锁版本", ignore = true)
|
||||
//乐观锁版本"
|
||||
private int lockVersion;
|
||||
|
||||
//查询请求ID")
|
||||
//查询请求ID
|
||||
private Long requestId;
|
||||
|
||||
//外部接口查询请求ID")
|
||||
//外部接口查询请求ID
|
||||
private String outerRequestId;
|
||||
|
||||
/**
|
||||
* @see EnumAddUpDeductionRequestStatus
|
||||
*/
|
||||
//请求处理状态")
|
||||
//请求处理状态
|
||||
private int requestStatus;
|
||||
|
||||
//税款所属期")
|
||||
//税款所属期
|
||||
private Date taxYearMonth;
|
||||
|
||||
//个税扣缴义务人ID")
|
||||
//个税扣缴义务人ID
|
||||
private Long taxAgentId;
|
||||
|
||||
|
||||
|
||||
private Collection<Long> ids;
|
||||
private Collection<Integer> requestStatuss;
|
||||
private Integer oldStatus;
|
||||
private Integer oldLockVersion;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.mapper.datacollection;
|
||||
|
||||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface AddUpDeductionRequestFailMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<AddUpDeductionRequestFailPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<AddUpDeductionRequestFailPO> listSome(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
AddUpDeductionRequestFailPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param addUpDeductionReqFail 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
void batchInsert(@Param("collection") Collection<AddUpDeductionRequestFailPO> list);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param addUpDeductionReqFail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param addUpDeductionReqFail 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param addUpDeductionReqFail 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,384 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.datacollection.AddUpDeductionRequestFailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="employee_id" property="employeeId"/>
|
||||
<result column="employee_type" property="employeeType"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="outer_request_id" property="outerRequestId"/>
|
||||
<result column="reason" property="reason"/>
|
||||
<result column="request_id" property="requestId"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="tax_year_month" property="taxYearMonth"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.employee_id
|
||||
, t.employee_type
|
||||
, t.id
|
||||
, t.outer_request_id
|
||||
, t.reason
|
||||
, t.request_id
|
||||
, t.tax_agent_id
|
||||
, t.tax_year_month
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_req_fail t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_req_fail t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_req_fail t
|
||||
WHERE delete_type = 0
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
AND employee_id = #{employeeId}
|
||||
</if>
|
||||
<if test="employeeType != null">
|
||||
AND employee_type = #{employeeType}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
AND outer_request_id = #{outerRequestId}
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
AND reason = #{reason}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND request_id = #{requestId}
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
AND tax_year_month = #{taxYearMonth}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull"
|
||||
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||
INSERT INTO hrsa_add_up_deduction_req_fail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
employee_id,
|
||||
</if>
|
||||
<if test="employeeType != null">
|
||||
employee_type,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
outer_request_id,
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
reason,
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id,
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id,
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
tax_year_month,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
#{employeeId},
|
||||
</if>
|
||||
<if test="employeeType != null">
|
||||
#{employeeType},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
#{outerRequestId},
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
#{reason},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
#{requestId},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
#{taxYearMonth},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||
request_id,
|
||||
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||
outer_request_id)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.requestId},
|
||||
#{item.employeeId},
|
||||
#{item.employeeType},
|
||||
#{item.taxAgentId},
|
||||
#{item.reason},
|
||||
#{item.taxYearMonth},
|
||||
#{item.outerRequestId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="postgresql">
|
||||
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||
request_id,
|
||||
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||
outer_request_id)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.requestId},
|
||||
#{item.employeeId},
|
||||
#{item.employeeType},
|
||||
#{item.taxAgentId},
|
||||
#{item.reason},
|
||||
#{item.taxYearMonth},
|
||||
#{item.outerRequestId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||
request_id,
|
||||
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||
outer_request_id)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.requestId},
|
||||
#{item.employeeId},
|
||||
#{item.employeeType},
|
||||
#{item.taxAgentId},
|
||||
#{item.reason},
|
||||
#{item.taxYearMonth},
|
||||
#{item.outerRequestId}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||
request_id,
|
||||
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||
outer_request_id)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.tenantKey},
|
||||
#{item.requestId},
|
||||
#{item.employeeId},
|
||||
#{item.employeeType},
|
||||
#{item.taxAgentId},
|
||||
#{item.reason},
|
||||
#{item.taxYearMonth},
|
||||
#{item.outerRequestId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||
UPDATE hrsa_add_up_deduction_req_fail
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
employee_id=#{employeeId},
|
||||
employee_type=#{employeeType},
|
||||
outer_request_id=#{outerRequestId},
|
||||
reason=#{reason},
|
||||
request_id=#{requestId},
|
||||
tax_agent_id=#{taxAgentId},
|
||||
tax_year_month=#{taxYearMonth},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull"
|
||||
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||
UPDATE hrsa_add_up_deduction_req_fail
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
employee_id=#{employeeId},
|
||||
</if>
|
||||
<if test="employeeType != null">
|
||||
employee_type=#{employeeType},
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
outer_request_id=#{outerRequestId},
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
reason=#{reason},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id=#{requestId},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id=#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
tax_year_month=#{taxYearMonth},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_add_up_deduction_req_fail
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_add_up_deduction_req_fail
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.mapper.datacollection;
|
||||
|
||||
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface AddUpDeductionRequestMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<AddUpDeductionRequestPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<AddUpDeductionRequestPO> listSome(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
AddUpDeductionRequestPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param addUpDeductionRequest 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param addUpDeductionRequest
|
||||
*/
|
||||
void batchInsert(@Param("collection") List<AddUpDeductionRequestPO> addUpDeductionRequest);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param addUpDeductionRequest 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param addUpDeductionRequest 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param addUpDeductionRequest 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
int updateRequestStatusLockVersion(AddUpDeductionRequestPO build);
|
||||
}
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.datacollection.AddUpDeductionRequestMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="lock_version" property="lockVersion"/>
|
||||
<result column="outer_request_id" property="outerRequestId"/>
|
||||
<result column="request_id" property="requestId"/>
|
||||
<result column="request_status" property="requestStatus"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="tax_year_month" property="taxYearMonth"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.id
|
||||
, t.lock_version
|
||||
, t.outer_request_id
|
||||
, t.request_id
|
||||
, t.request_status
|
||||
, t.tax_agent_id
|
||||
, t.tax_year_month
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_request t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_request t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_add_up_deduction_request t
|
||||
WHERE delete_type = 0
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="lockVersion != null">
|
||||
AND lock_version = #{lockVersion}
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
AND outer_request_id = #{outerRequestId}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND request_id = #{requestId}
|
||||
</if>
|
||||
<if test="requestStatus != null">
|
||||
AND request_status = #{requestStatus}
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
AND tax_year_month = #{taxYearMonth}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
INSERT INTO hrsa_add_up_deduction_request
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="lockVersion != null">
|
||||
lock_version,
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
outer_request_id,
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id,
|
||||
</if>
|
||||
<if test="requestStatus != null">
|
||||
request_status,
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id,
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
tax_year_month,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="lockVersion != null">
|
||||
#{lockVersion},
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
#{outerRequestId},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
#{requestId},
|
||||
</if>
|
||||
<if test="requestStatus != null">
|
||||
#{requestStatus},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
#{taxYearMonth},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
|
||||
INSERT INTO hrsa_add_up_deduction_request
|
||||
(
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
lock_version,
|
||||
outer_request_id,
|
||||
request_id,
|
||||
request_status,
|
||||
tax_agent_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.id},
|
||||
#{item.lockVersion},
|
||||
#{item.outerRequestId},
|
||||
#{item.requestId},
|
||||
#{item.requestStatus},
|
||||
#{item.taxAgentId},
|
||||
#{item.taxYearMonth},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
</foreach>
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_add_up_deduction_request (
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
lock_version,
|
||||
outer_request_id,
|
||||
request_id,
|
||||
request_status,
|
||||
tax_agent_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
)
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType,jdbcType=INTEGER},
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.lockVersion,jdbcType=INTEGER},
|
||||
#{item.outerRequestId,jdbcType=DOUBLE},
|
||||
#{item.requestId,jdbcType=DOUBLE},
|
||||
#{item.requestStatus,jdbcType=INTEGER},
|
||||
#{item.taxAgentId,jdbcType=DOUBLE},
|
||||
#{item.taxYearMonth,jdbcType=DATE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.updateTime,jdbcType=DATE}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
INSERT INTO hrsa_add_up_deduction_request (
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
id,
|
||||
lock_version,
|
||||
outer_request_id,
|
||||
request_id,
|
||||
request_status,
|
||||
tax_agent_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.createTime},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.id},
|
||||
#{item.lockVersion},
|
||||
#{item.outerRequestId},
|
||||
#{item.requestId},
|
||||
#{item.requestStatus},
|
||||
#{item.taxAgentId},
|
||||
#{item.taxYearMonth},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
UPDATE hrsa_add_up_deduction_request
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
lock_version=#{lockVersion},
|
||||
outer_request_id=#{outerRequestId},
|
||||
request_id=#{requestId},
|
||||
request_status=#{requestStatus},
|
||||
tax_agent_id=#{taxAgentId},
|
||||
tax_year_month=#{taxYearMonth},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
UPDATE hrsa_add_up_deduction_request
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="lockVersion != null">
|
||||
lock_version=#{lockVersion},
|
||||
</if>
|
||||
<if test="outerRequestId != null">
|
||||
outer_request_id=#{outerRequestId},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id=#{requestId},
|
||||
</if>
|
||||
<if test="requestStatus != null">
|
||||
request_status=#{requestStatus},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id=#{taxAgentId},
|
||||
</if>
|
||||
<if test="taxYearMonth != null">
|
||||
tax_year_month=#{taxYearMonth},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_add_up_deduction_request
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_add_up_deduction_request
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateRequestStatusLockVersion"
|
||||
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||
UPDATE hrsa_add_up_deduction_request
|
||||
<set>
|
||||
request_status=#{requestStatus},
|
||||
lock_version=#{lockVersion},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE delete_type = 0
|
||||
AND request_status=#{oldStatus}
|
||||
AND lock_version=#{oldLockVersion}
|
||||
AND id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -240,4 +240,6 @@ public interface SalaryArchiveService {
|
|||
* @return
|
||||
*/
|
||||
List<SalaryArchivePO> listPayEndDateIsNull(List<Long> employeeIds);
|
||||
|
||||
List<SalaryArchivePO> listByRunStatus(List<String> asList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
|
|||
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionRequestFailMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionRequestMapper;
|
||||
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.report.enums.EmployeeTypeEnum;
|
||||
|
|
@ -75,7 +77,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
|
|
@ -86,7 +87,6 @@ import java.io.InputStream;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -157,6 +157,14 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class);
|
||||
}
|
||||
|
||||
private AddUpDeductionRequestMapper getAddUpDeductionRequestMapper() {
|
||||
return MapperProxyFactory.getProxy(AddUpDeductionRequestMapper.class);
|
||||
}
|
||||
|
||||
private AddUpDeductionRequestFailMapper getAddUpDeductionRequestFailMapper() {
|
||||
return MapperProxyFactory.getProxy(AddUpDeductionRequestFailMapper.class);
|
||||
}
|
||||
|
||||
private ExtEmpService getExtEmpService(User user) {
|
||||
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -1285,8 +1293,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
long employeeId = (long) user.getUID();
|
||||
boolean isChief = getTaxAgentService(user).isChief(employeeId);
|
||||
List<TaxAgentPO> taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAsChief(isOpenDevolution, isChief) : getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||
Set<Long> taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId);
|
||||
List<TaxAgentPO> taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List<TaxAgentPO>) getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||
List<Long> taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList());
|
||||
// 获取薪资档案
|
||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList(
|
||||
SalaryArchiveStatusEnum.FIXED.getValue(),
|
||||
|
|
@ -1363,7 +1371,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
.creator(user.getUID())
|
||||
.lockVersion(0)
|
||||
.build();
|
||||
addUpDeductionRequestMapper.insert(po);
|
||||
getAddUpDeductionRequestMapper().insertIgnoreNull(po);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1407,7 +1415,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
setExistedDataMap(requestWrapper);
|
||||
// 开始处理反馈结果
|
||||
TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper
|
||||
= new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION);
|
||||
= new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION, (long) user.getUID());
|
||||
handleFeedbackData(requestWrapper, apiFlowUpdateWrapper);
|
||||
// 持久化数据
|
||||
persistFeedbackData(requestWrapper);
|
||||
|
|
@ -1419,30 +1427,22 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
|
||||
@Override
|
||||
public PageInfo<AddUpDeductionRequestFailListDTO> onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) {
|
||||
Page<AddUpDeductionRequestFailPO> page = new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper)
|
||||
.eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.eq(AddUpDeductionRequestFailPO::getTenantKey)
|
||||
.eq(AddUpDeductionRequestFailPO::getRequestId, queryParam.getRequestId())
|
||||
.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), queryParam.getTotal(), true));
|
||||
|
||||
List<AddUpDeductionRequestFailPO> addUpDeductionRequestFailPOS = getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(queryParam.getRequestId()).build());
|
||||
List<AddUpDeductionRequestFailPO> list = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), addUpDeductionRequestFailPOS);
|
||||
// 获取薪资档案
|
||||
AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null);
|
||||
this.getEmployeeInfoMap(requestWrapper);
|
||||
|
||||
List<AddUpDeductionRequestFailListDTO> listDTOList = page.getRecords().stream()
|
||||
.map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList());
|
||||
PageInfo<AddUpDeductionRequestFailListDTO> listDTOPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), false);
|
||||
listDTOPage.setRecords(listDTOList);
|
||||
return listDTOPage;
|
||||
List<AddUpDeductionRequestFailListDTO> listDTOList = list.stream().map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList());
|
||||
|
||||
PageInfo<AddUpDeductionRequestFailListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOList, AddUpDeductionRequestFailListDTO.class);
|
||||
page.setTotal(addUpDeductionRequestFailPOS.size());
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AddUpDeductionRequestFailPO> getAddUpDeductionRequestFailPOList(Long requestId) {
|
||||
return new LambdaQueryChainWrapper<>(addUpDeductionRequestFailMapper)
|
||||
.eq(AddUpDeductionRequestFailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.eq(AddUpDeductionRequestFailPO::getTenantKey)
|
||||
.eq(AddUpDeductionRequestFailPO::getRequestId, requestId)
|
||||
.list();
|
||||
return getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(requestId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1476,14 +1476,13 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
rows.add(row);
|
||||
}
|
||||
// 生成表格
|
||||
ExcelUtil.genWorkbookV2(rows,"");
|
||||
ExcelUtil.genWorkbookV2(rows, "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void getEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper wrapper) {
|
||||
// 身份证号
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList());
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||
Map<Long, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getEmployeeId);
|
||||
wrapper.setUserInfoUserIdMap(simpleUserInfoMap);
|
||||
|
|
@ -1492,17 +1491,13 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
Map<Long, DataCollectionEmployee> simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
wrapper.setSimpleEmployeeMap(simpleEmployeeMap);
|
||||
// 外部人员信息
|
||||
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listCanUse(wrapper.getCurrentEmployeeId());
|
||||
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listAll();
|
||||
Map<Long, ExtEmpPO> extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId, e -> e);
|
||||
wrapper.setExtEmployeePOMap(extEmployeePOMap);
|
||||
}
|
||||
|
||||
private List<AddUpDeductionRequestPO> getAddUpDeductionRequestPOS() {
|
||||
return new LambdaQueryChainWrapper<>(addUpDeductionRequestMapper)
|
||||
.eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.eq(AddUpDeductionRequestPO::getTenantKey)
|
||||
.in(AddUpDeductionRequestPO::getRequestStatus, EnumAddUpDeductionRequestStatus.RUNNING.getValue())
|
||||
.list();
|
||||
return getAddUpDeductionRequestMapper().listSome(AddUpDeductionRequestPO.builder().requestStatus(EnumAddUpDeductionRequestStatus.RUNNING.getValue()).build());
|
||||
}
|
||||
|
||||
private void handleFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper) {
|
||||
|
|
@ -1510,8 +1505,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
DataCollectionEmployee simpleUserInfo = requestWrapper.getUserInfoIdNoMap().get(feedback.getZzhm());
|
||||
Long extEmpId = requestWrapper.getExtEmployeeIdCardMap().get(feedback.getZzhm());
|
||||
Long employeeId = Optional.ofNullable(simpleUserInfo)
|
||||
.map(DataCollectionEmployee::getUser)
|
||||
.map(IdEntity::getId)
|
||||
.map(DataCollectionEmployee::getEmployeeId)
|
||||
.orElse(extEmpId);
|
||||
AddUpDeductionRequestPO requestPO = requestWrapper.getRequestPoMap().get(outerRequestId);
|
||||
|
||||
|
|
@ -1563,25 +1557,19 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
Map<Long, DataCollectionEmployee> simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
requestWrapper.setSimpleEmployeeMap(simpleEmployeeMap);
|
||||
// 内部员工(身份证信息)
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId,Collectors.toList());
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||
Map<String, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo);
|
||||
requestWrapper.setUserInfoIdNoMap(simpleUserInfoMap);
|
||||
// 外部员工信息
|
||||
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listCanUse(requestWrapper.getCurrentEmployeeId(), requestWrapper.getTenantKey());
|
||||
Map<String, Long> extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getCardNum, ExtEmpPO::getId);
|
||||
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listAll();
|
||||
Map<String, Long> extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getIdNo, ExtEmpPO::getId);
|
||||
requestWrapper.setExtEmployeeIdCardMap(extEmployeePOMap);
|
||||
}
|
||||
|
||||
private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId);
|
||||
List<AddUpDeduction> poList = new LambdaQueryChainWrapper<>(addUpDeductionMapper)
|
||||
.select(AddUpDeduction::getId, AddUpDeduction::getTaxAgentId, AddUpDeduction::getEmployeeId)
|
||||
.eq(AddUpDeduction::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.eq(AddUpDeduction::getTenantKey, requestWrapper.getTenantKey())
|
||||
.eq(AddUpDeduction::getDeclareMonth, requestWrapper.getRequestPOList().get(0).getTaxYearMonth())
|
||||
.in(AddUpDeduction::getTaxAgentId, taxAgentIds)
|
||||
.list();
|
||||
List<Long> taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList());
|
||||
List<AddUpDeduction> poList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(requestWrapper.getRequestPOList().get(0).getTaxYearMonth()).taxAgentIds(taxAgentIds).build());
|
||||
requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId));
|
||||
}
|
||||
|
||||
|
|
@ -1618,20 +1606,20 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
if (!requestWrapper.getInsertList().isEmpty()) {
|
||||
List<List<AddUpDeduction>> insertPartition = Lists.partition(requestWrapper.getInsertList(), 1000);
|
||||
insertPartition.forEach(list -> {
|
||||
list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey());
|
||||
addUpDeductionMapper.insertData(list);
|
||||
list = encryptUtil.encryptList(list, AddUpDeduction.class);
|
||||
getAddUpDeductionMapper().insertData(list);
|
||||
});
|
||||
}
|
||||
if (!requestWrapper.getUpdateList().isEmpty()) {
|
||||
List<List<AddUpDeduction>> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 1000);
|
||||
updatePartition.forEach(list -> {
|
||||
list = dataSecurityService.encryptBatch(list, AddUpDeduction.class, requestWrapper.getTenantKey());
|
||||
addUpDeductionMapper.updateData(list);
|
||||
list = encryptUtil.encryptList(list, AddUpDeduction.class);
|
||||
getAddUpDeductionMapper().updateData(list);
|
||||
});
|
||||
}
|
||||
if (!requestWrapper.getFailPOList().isEmpty()) {
|
||||
List<List<AddUpDeductionRequestFailPO>> failPartition = Lists.partition(requestWrapper.getFailPOList(), 1000);
|
||||
failPartition.forEach(list -> addUpDeductionRequestFailMapper.batchInsert(list));
|
||||
failPartition.forEach(list -> getAddUpDeductionRequestFailMapper().batchInsert(list));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1649,16 +1637,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
|
||||
public void updateRequestStatus(List<AddUpDeductionRequestPO> requestPOList, Integer oldStatus, Integer newStatus) {
|
||||
for (AddUpDeductionRequestPO requestPO : requestPOList) {
|
||||
boolean update = new LambdaUpdateChainWrapper<>(addUpDeductionRequestMapper)
|
||||
.set(AddUpDeductionRequestPO::getRequestStatus, newStatus)
|
||||
.set(AddUpDeductionRequestPO::getUpdateTime, LocalDateTime.now())
|
||||
.set(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion() + 1)
|
||||
.eq(AddUpDeductionRequestPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.eq(AddUpDeductionRequestPO::getRequestStatus, oldStatus)
|
||||
.eq(AddUpDeductionRequestPO::getId, requestPO.getId())
|
||||
.eq(AddUpDeductionRequestPO::getLockVersion, requestPO.getLockVersion())
|
||||
.update();
|
||||
SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
|
||||
int i = getAddUpDeductionRequestMapper().updateRequestStatusLockVersion(AddUpDeductionRequestPO.builder()
|
||||
.requestStatus(newStatus)
|
||||
.lockVersion(requestPO.getLockVersion() + 1)
|
||||
.updateTime(new Date())
|
||||
.oldStatus(oldStatus)
|
||||
.id(requestPO.getId())
|
||||
.oldLockVersion(oldStatus)
|
||||
.build()
|
||||
);
|
||||
// SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1292,4 +1292,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
}
|
||||
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryArchivePO> listByRunStatus(List<String> list) {
|
||||
return getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().runStatusList(list).build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,18 +7,18 @@ import com.engine.common.util.ParamUtil;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||
import com.engine.salary.entity.datacollection.param.*;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.AddUpDeductionWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -37,7 +37,10 @@ import java.net.URLEncoder;
|
|||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -385,12 +388,9 @@ public class AddUpDeductionController {
|
|||
@Path("/online/request")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionMonthTaxAgentParam param) {
|
||||
Map<String, Object> result = addUpDeductionWrapper.onlineRequest(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
if (Objects.nonNull(result.get("msg"))) {
|
||||
return WeaResult.fail(result.get("msg").toString());
|
||||
}
|
||||
return WeaResult.success(null);
|
||||
public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionMonthTaxAgentParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionMonthTaxAgentParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::onlineRequest, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -401,8 +401,9 @@ public class AddUpDeductionController {
|
|||
@Path("/online/feedback")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String onlineFeedback() {
|
||||
return WeaResult.success(addUpDeductionWrapper.onlineFeedback(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
||||
public String onlineFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionMonthTaxAgentParam, AddUpDeductionRequestResultDTO>(user).run(getAddUpDeductionWrapper(user)::onlineFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -413,45 +414,48 @@ public class AddUpDeductionController {
|
|||
@Path("/online/feedback/fail")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionRequestFailQueryParam queryParam) {
|
||||
return WeaResult.success(addUpDeductionWrapper.onlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), queryParam));
|
||||
public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRequestFailQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionRequestFailQueryParam, PageInfo<AddUpDeductionRequestFailListDTO>>(user).run(getAddUpDeductionWrapper(user)::onlineFeedbackFail, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线获取结果导出
|
||||
*
|
||||
* @return WeaResult 接口返回信息
|
||||
*/
|
||||
@Path("/online/feedback/fail/export")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String exportOnlineFeedbackFail(@RequestParam Long requestId) {
|
||||
return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId));
|
||||
}
|
||||
// /**
|
||||
// * 在线获取结果导出
|
||||
// *
|
||||
// * @return WeaResult 接口返回信息
|
||||
// */
|
||||
// @Path("/online/feedback/fail/export")
|
||||
// @GET
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String exportOnlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam Long requestId) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<AddUpDeductionRequestFailQueryParam, PageInfo<AddUpDeductionRequestFailListDTO>>(user).run(getAddUpDeductionWrapper(user)::exportOnlineFeedbackFail, queryParam);
|
||||
// return WeaResult.success(addUpDeductionWrapper.exportOnlineFeedbackFail(UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey(), requestId));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 在线获取表单
|
||||
*
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/online/request/form")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm() {
|
||||
return WeaResult.success(addUpDeductionWrapper.getRequestForm());
|
||||
}
|
||||
// /**
|
||||
// * 在线获取表单
|
||||
// *
|
||||
// * @return WeaResult 返回结果
|
||||
// */
|
||||
// @Path("/online/request/form")
|
||||
// @GET
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getForm() {
|
||||
// return WeaResult.success(addUpDeductionWrapper.getRequestForm());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 自动计算次月
|
||||
*
|
||||
* @param queryParam 查询条件
|
||||
* @return WeaResult 返回结果
|
||||
*/
|
||||
@Path("/autoCalculate")
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionQueryParam queryParam) {
|
||||
addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
return WeaResult.success(null);
|
||||
}
|
||||
// /**
|
||||
// * 自动计算次月
|
||||
// *
|
||||
// * @param queryParam 查询条件
|
||||
// * @return WeaResult 返回结果
|
||||
// */
|
||||
// @Path("/autoCalculate")
|
||||
// @POST
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionQueryParam queryParam) {
|
||||
// addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||
import com.engine.salary.entity.datacollection.param.*;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.AddUpDeductionService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
|
|
@ -180,50 +179,50 @@ public class AddUpDeductionWrapper extends Service {
|
|||
return getAddUpDeductionService(user).autoAddAll(yearMonth, null);
|
||||
}
|
||||
|
||||
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param, Long currentEmployeeId, String currentTenantKey) {
|
||||
return addUpDeductionService.onlineRequest(param, currentEmployeeId, currentTenantKey);
|
||||
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param) {
|
||||
return getAddUpDeductionService(user).onlineRequest(param);
|
||||
}
|
||||
|
||||
public AddUpDeductionRequestResultDTO onlineFeedback(Long currentEmployeeId, String currentTenantKey) {
|
||||
return addUpDeductionService.onlineFeedback(currentEmployeeId, currentTenantKey);
|
||||
public AddUpDeductionRequestResultDTO onlineFeedback() {
|
||||
return getAddUpDeductionService(user).onlineFeedback();
|
||||
}
|
||||
|
||||
public WeaTable<AddUpDeductionRequestFailListDTO> onlineFeedbackFail(Long currentEmployeeId, String currentTenantKey, AddUpDeductionRequestFailQueryParam queryParam) {
|
||||
public PageInfo<AddUpDeductionRequestFailListDTO> onlineFeedbackFail( AddUpDeductionRequestFailQueryParam queryParam) {
|
||||
if (queryParam.getRequestId() == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 153345, "在线获取的请求ID不可为空"));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153345, "在线获取的请求ID不可为空"));
|
||||
}
|
||||
Page<AddUpDeductionRequestFailListDTO> page = addUpDeductionService.onlineFeedbackFail(currentEmployeeId, currentTenantKey, queryParam);
|
||||
return SalaryFormatUtil.<AddUpDeductionRequestFailListDTO>getInstance().buildTable(AddUpDeductionRequestFailListDTO.class, page);
|
||||
PageInfo<AddUpDeductionRequestFailListDTO> page = getAddUpDeductionService(user).onlineFeedbackFail( queryParam);
|
||||
return page;
|
||||
}
|
||||
|
||||
public Map<String, Object> exportOnlineFeedbackFail(Long employeeId, String tenantKey, Long requestId) {
|
||||
List<AddUpDeductionRequestFailPO> poList = addUpDeductionService.getAddUpDeductionRequestFailPOList(requestId, tenantKey);
|
||||
if (CollectionUtils.isEmpty(poList)) {
|
||||
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 95795, "数据不存在") + "[id:%s]", requestId));
|
||||
}
|
||||
// 构建异步导出参数
|
||||
Map<String, Object> map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail");
|
||||
map.put("sheetName", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 183778, "在线获取专项附加扣除失败数据"));
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
addUpDeductionService.exportOnlineFeedbackFail(map, requestId, employeeId, tenantKey);
|
||||
} finally {
|
||||
DSTenantKeyThreadVar.tenantKey.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.execute(localRunnable);
|
||||
return map;
|
||||
}
|
||||
|
||||
public WeaForm getRequestForm() {
|
||||
WeaForm weaForm = SalaryFormatUtil.<AddUpDeductionRequestFormDTO>getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO());
|
||||
WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM");
|
||||
item.setRequired(true);
|
||||
weaForm.getItems().put("declareMonth", item);
|
||||
return weaForm;
|
||||
}
|
||||
// public Map<String, Object> exportOnlineFeedbackFail( Long requestId) {
|
||||
// List<AddUpDeductionRequestFailPO> poList = getAddUpDeductionService(user).getAddUpDeductionRequestFailPOList(requestId);
|
||||
// if (CollectionUtils.isEmpty(poList)) {
|
||||
// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel( 95795, "数据不存在") + "[id:%s]", requestId));
|
||||
// }
|
||||
// // 构建异步导出参数
|
||||
// Map<String, Object> map = salaryBatchService.buildeExportParam("exportOnlineFeedbackFail");
|
||||
// map.put("sheetName", SalaryI18nUtil.getI18nLabel( 183778, "在线获取专项附加扣除失败数据"));
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// getAddUpDeductionService(user).exportOnlineFeedbackFail(map, requestId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.execute(localRunnable);
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// public WeaForm getRequestForm() {
|
||||
// WeaForm weaForm = SalaryFormatUtil.<AddUpDeductionRequestFormDTO>getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO());
|
||||
// WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM");
|
||||
// item.setRequired(true);
|
||||
// weaForm.getItems().put("declareMonth", item);
|
||||
// return weaForm;
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue