Compare commits

...

18 Commits

Author SHA1 Message Date
Harryxzy 1b27ed68be 领悦法人主体增加是否启用筛选 2025-04-25 15:56:16 +08:00
Harryxzy c259f6c8df 领悦二开增加:
1、增加项目期数、房屋类别辅助核算固定值配置。
2、自动带出核算账簿信息
2025-04-21 14:46:40 +08:00
Harryxzy e620efbc5d 领悦生成逻辑调整 2025-04-18 14:22:40 +08:00
Harryxzy 56d4ef206c 领悦修改制单人参数 2025-04-17 16:44:40 +08:00
Harryxzy 9addd39bf0 领悦nc调整 2025-04-17 14:20:06 +08:00
Harryxzy d172cb402e 领悦 二开 2025-04-16 14:14:03 +08:00
Harryxzy 59cb927806 2100bug修复 2025-04-16 11:24:58 +08:00
Harryxzy b2e82f7f83 领悦数据库兼容问题修复 2025-04-15 10:08:19 +08:00
Harryxzy 649f8c2432 Merge branch 'release/3.0.2.2504.01' into custom/领悦业务线
# Conflicts:
#	src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml
2025-04-10 13:36:23 +08:00
Harryxzy 0bcafd3934 修复个税申报 不同税款所属期校验bug 2025-04-09 17:20:48 +08:00
钱涛 c04dad0c4d 修改字段名 2025-04-09 14:23:38 +08:00
钱涛 c32dab5562 数据撤回功能 2025-04-07 13:50:34 +08:00
钱涛 f4c025e078 数据推送 2025-04-07 09:19:47 +08:00
钱涛 d4f45d5eb3 扩展排序字段 2025-04-03 10:49:10 +08:00
钱涛 0a78f17230 记录推送耗时 2025-04-02 17:05:04 +08:00
钱涛 ba650b9fe6 推送记录状态变更;
推送明细状态变更;
2025-04-02 14:59:32 +08:00
钱涛 0777f99870 创建推送记录接口;
重推接口;
2025-04-01 17:35:29 +08:00
钱涛 8e3c4bfacc 数据推送配置sql 2025-04-01 16:43:02 +08:00
82 changed files with 1805 additions and 360 deletions

View File

@ -0,0 +1,70 @@
CREATE TABLE hrsa_push_setting
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
able number,
salary_sob_ids varchar2(2000),
mode_id number,
mode_name varchar2(200),
table_name varchar2(200),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_setting_item
(
id NUMBER(38,0) NOT NULL,
setting_id NUMBER(38,0),
source varchar2(100),
item varchar2(200),
item_name varchar2(200),
field_name varchar2(200),
field_type number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record
(
id NUMBER(38,0) NOT NULL,
name varchar2(200),
setting_id NUMBER(38,0),
mode_id number,
table_name varchar2(100),
acct_record_id NUMBER(38,0),
type number,
status number,
start_time date,
end_time date,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record_detail
(
id NUMBER(38,0) NOT NULL,
record_id NUMBER(38,0),
acct_emp_id NUMBER(38,0),
formula CLOB,
execute_time date,
status number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_record ADD fail_reason varchar2(4000);
/
ALTER TABLE hrsa_push_record_detail ADD fail_reason varchar2(4000);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_setting_item ADD sorted_index NUMBER;
/
ALTER TABLE hrsa_push_record_detail ADD data_id NUMBER(38,0);
/

View File

@ -0,0 +1,70 @@
CREATE TABLE hrsa_push_setting
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
able number,
salary_sob_ids varchar2(2000),
mode_id number,
mode_name varchar2(200),
table_name varchar2(200),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_setting_item
(
id NUMBER(38,0) NOT NULL,
setting_id NUMBER(38,0),
source varchar2(100),
item varchar2(200),
item_name varchar2(200),
field_name varchar2(200),
field_type number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record
(
id NUMBER(38,0) NOT NULL,
name varchar2(200),
setting_id NUMBER(38,0),
mode_id number,
table_name varchar2(100),
acct_record_id NUMBER(38,0),
type number,
status number,
start_time date,
end_time date,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record_detail
(
id NUMBER(38,0) NOT NULL,
record_id NUMBER(38,0),
acct_emp_id NUMBER(38,0),
formula CLOB,
execute_time date,
status number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_record ADD fail_reason varchar2(4000);
/
ALTER TABLE hrsa_push_record_detail ADD fail_reason varchar2(4000);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_setting_item ADD sorted_index NUMBER;
/
ALTER TABLE hrsa_push_record_detail ADD data_id NUMBER(38,0);
/

View File

@ -0,0 +1,70 @@
CREATE TABLE hrsa_push_setting
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
able number,
salary_sob_ids varchar2(2000),
mode_id number,
mode_name varchar2(200),
table_name varchar2(200),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_setting_item
(
id NUMBER(38,0) NOT NULL,
setting_id NUMBER(38,0),
source varchar2(100),
item varchar2(200),
item_name varchar2(200),
field_name varchar2(200),
field_type number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record
(
id NUMBER(38,0) NOT NULL,
name varchar2(200),
setting_id NUMBER(38,0),
mode_id number,
table_name varchar2(100),
acct_record_id NUMBER(38,0),
type number,
status number,
start_time date,
end_time date,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record_detail
(
id NUMBER(38,0) NOT NULL,
record_id NUMBER(38,0),
acct_emp_id NUMBER(38,0),
formula CLOB,
execute_time date,
status number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_record ADD fail_reason varchar2(4000);
/
ALTER TABLE hrsa_push_record_detail ADD fail_reason varchar2(4000);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_setting_item ADD sorted_index NUMBER;
/
ALTER TABLE hrsa_push_record_detail ADD data_id NUMBER(38,0);
/

View File

@ -33,3 +33,39 @@ CREATE TABLE hrsa_push_setting_item
PRIMARY KEY (id) USING BTREE
);
CREATE TABLE hrsa_push_record
(
id bigint(0) NOT NULL,
name varchar(200),
setting_id bigint(0),
mode_id int(0),
table_name varchar(100),
acct_record_id bigint(0),
type int(0),
status int(0),
start_time datetime(0),
end_time datetime(0),
creator bigint(0),
create_time datetime(0),
update_time datetime(0),
delete_type int(0),
tenant_key varchar(10),
PRIMARY KEY (id) USING BTREE
);
CREATE TABLE hrsa_push_record_detail
(
id bigint(0) NOT NULL,
record_id bigint(0),
acct_emp_id bigint(0),
formula text,
execute_time datetime(0),
status int(0),
creator bigint(0),
create_time datetime(0),
update_time datetime(0),
delete_type int(0),
tenant_key varchar(10),
PRIMARY KEY (id) USING BTREE
);

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_push_record ADD COLUMN fail_reason varchar(4000);
ALTER TABLE hrsa_push_record_detail ADD COLUMN fail_reason varchar(4000) ;

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_push_setting_item ADD COLUMN sorted_index int(0);
ALTER TABLE hrsa_push_record_detail ADD COLUMN data_id bigint(0);

View File

@ -0,0 +1,71 @@
CREATE TABLE hrsa_push_setting
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
able number,
salary_sob_ids varchar2(2000),
mode_id number,
mode_name varchar2(200),
table_name varchar2(200),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/
CREATE TABLE hrsa_push_setting_item
(
id NUMBER(38,0) NOT NULL,
setting_id NUMBER(38,0),
source varchar2(100),
item varchar2(200),
item_name varchar2(200),
field_name varchar2(200),
field_type number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/
CREATE TABLE hrsa_push_record
(
id NUMBER(38,0) NOT NULL,
name varchar2(200),
setting_id NUMBER(38,0),
mode_id number,
table_name varchar2(100),
acct_record_id NUMBER(38,0),
type number,
status number,
start_time date,
end_time date,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/
CREATE TABLE hrsa_push_record_detail
(
id NUMBER(38,0) NOT NULL,
record_id NUMBER(38,0),
acct_emp_id NUMBER(38,0),
formula CLOB,
execute_time date,
status number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/

View File

@ -0,0 +1,5 @@
ALTER TABLE hrsa_push_record ADD fail_reason varchar2(4000);
/
ALTER TABLE hrsa_push_record_detail ADD fail_reason varchar2(4000);
/

View File

@ -0,0 +1,5 @@
ALTER TABLE hrsa_push_setting_item ADD sorted_index NUMBER;
/
ALTER TABLE hrsa_push_record_detail ADD data_id NUMBER(38,0);
/

View File

@ -0,0 +1,71 @@
CREATE TABLE hrsa_push_setting
(
id bigint NOT NULL,
name varchar(200),
able int,
salary_sob_ids varchar(2000),
mode_id int,
mode_name varchar(200),
table_name varchar(200),
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
);
CREATE TABLE hrsa_push_setting_item
(
id bigint NOT NULL,
setting_id bigint,
source varchar(100),
item varchar(200),
item_name varchar(200),
field_name varchar(200),
field_type int,
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
);
CREATE TABLE hrsa_push_record
(
id bigint NOT NULL,
name varchar(200),
setting_id bigint,
mode_id int,
table_name varchar(100),
acct_record_id bigint,
type int,
status int,
start_time timestamp,
end_time timestamp,
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
);
CREATE TABLE hrsa_push_record_detail
(
id bigint NOT NULL,
record_id bigint,
acct_emp_id bigint,
formula text,
execute_time timestamp,
status int,
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
);

View File

@ -0,0 +1,3 @@
alter table hrsa_push_record add fail_reason VARCHAR(4000) ;
alter table hrsa_push_record_detail add fail_reason VARCHAR(4000) ;

View File

@ -0,0 +1,3 @@
alter table hrsa_push_setting_item add sorted_index int ;
alter table hrsa_push_record_detail add data_id bigint ;

View File

@ -0,0 +1,75 @@
CREATE TABLE hrsa_push_setting
(
id bigint NOT NULL,
name varchar(200),
able int,
salary_sob_ids varchar(2000),
mode_id int,
mode_name varchar(200),
table_name varchar(200),
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
)
GO
CREATE TABLE hrsa_push_setting_item
(
id bigint NOT NULL,
setting_id bigint,
source varchar(100),
item varchar(200),
item_name varchar(200),
field_name varchar(200),
field_type int,
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
)
GO
CREATE TABLE hrsa_push_record
(
id bigint NOT NULL,
name varchar(200),
setting_id bigint,
mode_id int,
table_name varchar(100),
acct_record_id bigint,
type int,
status int,
start_time datetime,
end_time datetime,
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
)
GO
CREATE TABLE hrsa_push_record_detail
(
id bigint NOT NULL,
record_id bigint,
acct_emp_id bigint,
formula text,
execute_time datetime,
status int,
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10),
PRIMARY KEY (id)
)
GO

View File

@ -0,0 +1,5 @@
alter table hrsa_push_record add fail_reason VARCHAR(4000)
go
alter table hrsa_push_record_detail add fail_reason VARCHAR(4000)
go

View File

@ -0,0 +1,5 @@
alter table hrsa_push_setting_item add sorted_index int
go
alter table hrsa_push_record_detail add data_id bigint
go

View File

@ -0,0 +1,70 @@
CREATE TABLE hrsa_push_setting
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
able number,
salary_sob_ids varchar2(2000),
mode_id number,
mode_name varchar2(200),
table_name varchar2(200),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_setting_item
(
id NUMBER(38,0) NOT NULL,
setting_id NUMBER(38,0),
source varchar2(100),
item varchar2(200),
item_name varchar2(200),
field_name varchar2(200),
field_type number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record
(
id NUMBER(38,0) NOT NULL,
name varchar2(200),
setting_id NUMBER(38,0),
mode_id number,
table_name varchar2(100),
acct_record_id NUMBER(38,0),
type number,
status number,
start_time date,
end_time date,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_push_record_detail
(
id NUMBER(38,0) NOT NULL,
record_id NUMBER(38,0),
acct_emp_id NUMBER(38,0),
formula CLOB,
execute_time date,
status number,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_record ADD fail_reason varchar2(4000);
/
ALTER TABLE hrsa_push_record_detail ADD fail_reason varchar2(4000);
/

View File

@ -0,0 +1,6 @@
ALTER TABLE hrsa_push_setting_item ADD sorted_index NUMBER;
/
ALTER TABLE hrsa_push_record_detail ADD data_id NUMBER(38,0);
/

View File

@ -125,6 +125,42 @@ public class DataCollectionEmployee {
@SalaryFormulaVar(defaultLabel = "账号类型编码", labelId = 98622, dataType = "string")
private Integer accountType;
// 基本信息
@SalaryFormulaVar(defaultLabel = "公司", labelId = 0, dataType = "string")
private String field136;
@SalaryFormulaVar(defaultLabel = "片区", labelId = 0, dataType = "string")
private String field137;
@SalaryFormulaVar(defaultLabel = "岗位名称", labelId = 0, dataType = "string")
private String field128;
@SalaryFormulaVar(defaultLabel = "岗位职级", labelId = 0, dataType = "string")
private String field1;
@SalaryFormulaVar(defaultLabel = "人员类型", labelId = 0, dataType = "string")
private String field7;
// 工作信息
@SalaryFormulaVar(defaultLabel = "岗级", labelId = 0, dataType = "string")
private String field121;
@SalaryFormulaVar(defaultLabel = "星级评定", labelId = 0, dataType = "string")
private String field152;
@SalaryFormulaVar(defaultLabel = "工资发放主体", labelId = 0, dataType = "string")
private String field124;
@SalaryFormulaVar(defaultLabel = "五险购买主体", labelId = 0, dataType = "string")
private String field141;
@SalaryFormulaVar(defaultLabel = "公积金购买主体", labelId = 0, dataType = "string")
private String field142;
@SalaryFormulaVar(defaultLabel = "成本归属本体", labelId = 0, dataType = "string")
private String field125;
@SalaryFormulaVar(defaultLabel = "开户行名称", labelId = 0, dataType = "string")
private String field31;
@SalaryFormulaVar(defaultLabel = "银行卡号", labelId = 0, dataType = "string")
private String field46;
@SalaryFormulaVar(defaultLabel = "发薪银行", labelId = 0, dataType = "string")
private String field145;
//是否是系统管理员
private Boolean isAdmin;

View File

@ -428,6 +428,25 @@ public class HrmSnapshotPO {
private BigDecimal workyear;
// 基本信息
private String field136;
private String field137;
private String field128;
private String field1;
private String field7;
// 工作信息
private String field121;
private String field152;
private String field124;
private String field141;
private String field142;
private String field125;
private String field31;
private String field46;
private String field145;
//主键id集合
private Collection<Long> ids;

View File

@ -57,4 +57,9 @@ public class LyFzhsInfo {
*/
private String fzhsyxzh;
/**
* nc账簿
*/
private String nczb;
}

View File

@ -52,4 +52,6 @@ public class LySalaryReportQueryParam extends BaseQueryParam {
private List<Integer> ffStatus;
private boolean export;
private List<Long> taxAgentIds;
}

View File

@ -25,6 +25,8 @@ public class LyFundReportPO {
private Long subcompanyId;
private Long departmentId;
/**
* 职能项目类型
*/

View File

@ -30,6 +30,8 @@ public class LySalaryReportPO {
private Long subcompanyId;
private Long departmentId;
// 职能项目类型 是职能还是项目
@Alias("职能项目类型")
private String znxmlx;

View File

@ -25,6 +25,8 @@ public class LySocialReportPO {
private Long subcompanyId;
private Long departmentId;
/**
* 职能项目类型
*/

View File

@ -21,6 +21,8 @@ public class UfGjjInfo {
// 分部
private Long fb;
private Long bm;
// 员工
private Long yg;

View File

@ -21,6 +21,8 @@ public class UfSbInfo {
// 分部
private Integer fb;
private Integer bm;
// 员工
private Long yg;

View File

@ -3,6 +3,7 @@ package com.engine.salary.entity.push.dto;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.annotation.TableTitle;
import com.engine.salary.enums.push.PushRecordStatusEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -50,7 +51,7 @@ public class PushRecordDTO {
/**
* 数据库表名
*/
@TableTitle(title = "记录名", dataIndex = "name", key = "name")
@TableTitle(title = "数据表名", dataIndex = "tableName", key = "tableName")
private String tableName;
@ -59,56 +60,53 @@ public class PushRecordDTO {
*
* @see PushRecordStatusEnum
*/
@TableTitle(title = "推送状态", dataIndex = "status", key = "status")
@TableTitle(title = "推送状态", dataIndex = "statusName", key = "statusName")
private String statusName;
private Integer status;
/**
* 执行时间
*/
@TableTitle(title = "执行时间", dataIndex = "startTime", key = "startTime")
@TableTitle(title = "执行开始时间", dataIndex = "startTime", key = "startTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
/**
* 结束时间
*/
@ElogTransform(name = "结束时间")
@TableTitle(title = "执行结束时间", dataIndex = "endTime", key = "endTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
/**
* 推送类型0推送1撤回
*/
@ElogTransform(name = "推送类型")
private Integer type;
/**
* 创建时间
*/
@ElogTransform(name = "创建时间")
private Date createTime;
/**
* 创建人
*/
@ElogTransform(name = "创建人")
private Long creator;
/**
* 是否已删除0未删除1已删除
*/
@ElogTransform(name = "是否已删除。0未删除、1已删除")
private Integer deleteType;
/**
* 租户ID
*/
@ElogTransform(name = "租户ID")
private String tenantKey;
/**
* 更新时间
*/
@ElogTransform(name = "更新时间")
private Date updateTime;

View File

@ -33,18 +33,22 @@ public class PushRecordDetailDTO {
*/
private Long acctEmpId;
@TableTitle(title = "人员", dataIndex = "username",key = "username")
private String username;
/**
* 执行状态
* @see com.engine.salary.enums.push.PushRecordDetailStatusEnum
*/
@TableTitle(title = "执行状态", dataIndex = "status",key = "status")
@TableTitle(title = "执行状态", dataIndex = "statusName",key = "statusName")
private String statusName;
private Integer status;
/**
* 失败原因
*/
@TableTitle(title = "失败原因", dataIndex = "fail_reason",key = "status")
private String fail_reason;
private String failReason;
/**
* 执行sql

View File

@ -59,4 +59,7 @@ public class PushSettingItemDTO {
@TableTitle(title = "字段类型", dataIndex = "fieldTypeName", key = "fieldTypeName")
private String fieldTypeName;
@TableTitle(title = "排序", dataIndex = "sortedIndex", key = "sortedIndex")
private Integer sortedIndex;
}

View File

@ -0,0 +1,29 @@
package com.engine.salary.entity.push.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 创建推送记录
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CreatePushParam {
private List<Long> salaryAcctRecordIds;
}

View File

@ -13,6 +13,8 @@ import lombok.NoArgsConstructor;
public class PushParam {
private Long id;
private Long salaryAcctRecordId;

View File

@ -59,6 +59,11 @@ public class PushSettingItemSaveParam {
@DataCheck(require = true, message = "字段类型为空")
private PushItemFieldEnum fieldType;
/**
* 排序
*/
private Integer sortedIndex;
//主键id集合
private Collection<Long> ids;

View File

@ -34,6 +34,11 @@ public class PushRecordDetailPO {
@ElogTransform(name = "核算人员id")
private Long acctEmpId;
/**
* 核算人员id
*/
private Long dataId;
/**
* 执行状态
* @see com.engine.salary.enums.push.PushRecordDetailStatusEnum
@ -45,13 +50,13 @@ public class PushRecordDetailPO {
* 失败原因
*/
@ElogTransform(name = "失败原因")
private String fail_reason;
private String failReason;
/**
* 执行sql
*/
@ElogTransform(name = "执行sql")
private String execute;
private String formula;
/**
* 创建时间

View File

@ -64,7 +64,7 @@ public class PushRecordPO {
* 失败原因
*/
@ElogTransform(name = "失败原因")
private String fail_reason;
private String failReason;
/**
* 开始时间

View File

@ -62,6 +62,10 @@ public class PushSettingItemPO {
@ElogTransform(name = "字段类型")
private Integer fieldType;
@ElogTransform(name = "排序")
private Integer sortedIndex;
/**
* 租户ID
*/

View File

@ -17,6 +17,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.Util;
import weaver.wechat.util.Utils;
import java.util.*;
import java.util.stream.Collectors;
@ -80,6 +81,7 @@ public class SalaryAcctEmployeeBO {
public static List<SalaryAcctEmployeePO> convert2Employee(Collection<DataCollectionEmployee> employee,
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
Map<Long, Map<String, String>> ufJobtitleMap,
Long employeeId) {
if (CollectionUtils.isEmpty(employee)) {
return Collections.emptyList();
@ -96,6 +98,7 @@ public class SalaryAcctEmployeeBO {
if (CollectionUtils.isEmpty(taxAgentIds)) {
taxAgentIds.add(0L);
}
Map<String, String> ufJobtitleInfo = ufJobtitleMap.get(emp.getEmployeeId()) == null ? Collections.emptyMap() : ufJobtitleMap.get(emp.getEmployeeId());
for (Long taxAgentId : taxAgentIds) {
SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder()
.salaryAcctRecordId(salaryAcctRecord.getId())
@ -108,8 +111,10 @@ public class SalaryAcctEmployeeBO {
.departmentName(emp.getDepartmentName())
.jobcall(emp.getJobcall())
.jobcallId(emp.getJobcallId())
.jobtitleId(emp.getJobtitleId())
.jobtitleName(emp.getJobtitleName())
// .jobtitleId(emp.getJobtitleId())
// .jobtitleName(emp.getJobtitleName())
.jobtitleId(NumberUtils.isCreatable(ufJobtitleInfo.get("jobtitleId")) ? Long.valueOf(ufJobtitleInfo.get("jobtitleId")) : null)
.jobtitleName(Utils.null2String(ufJobtitleInfo.get("jobtitleName")))
.subcompanyId(emp.getSubcompanyid())
.subcompanyName(emp.getSubcompanyName())
.status(emp.getStatus())

View File

@ -155,6 +155,40 @@ public class SalaryAcctEmployeePO {
@SalaryFormulaVar(defaultLabel = "状态编码", labelId = 86321, dataType = "string")
private String status;
// 基本信息
@SalaryFormulaVar(defaultLabel = "公司", labelId = 0, dataType = "string")
private String field136;
@SalaryFormulaVar(defaultLabel = "片区", labelId = 0, dataType = "string")
private String field137;
@SalaryFormulaVar(defaultLabel = "岗位名称", labelId = 0, dataType = "string")
private String field128;
@SalaryFormulaVar(defaultLabel = "岗位职级", labelId = 0, dataType = "string")
private String field1;
@SalaryFormulaVar(defaultLabel = "人员类型", labelId = 0, dataType = "string")
private String field7;
// 工作信息
@SalaryFormulaVar(defaultLabel = "岗级", labelId = 0, dataType = "string")
private String field121;
@SalaryFormulaVar(defaultLabel = "星级评定", labelId = 0, dataType = "string")
private String field152;
@SalaryFormulaVar(defaultLabel = "工资发放主体", labelId = 0, dataType = "string")
private String field124;
@SalaryFormulaVar(defaultLabel = "五险购买主体", labelId = 0, dataType = "string")
private String field141;
@SalaryFormulaVar(defaultLabel = "公积金购买主体", labelId = 0, dataType = "string")
private String field142;
@SalaryFormulaVar(defaultLabel = "成本归属本体", labelId = 0, dataType = "string")
private String field125;
@SalaryFormulaVar(defaultLabel = "开户行名称", labelId = 0, dataType = "string")
private String field31;
@SalaryFormulaVar(defaultLabel = "银行卡号", labelId = 0, dataType = "string")
private String field46;
@SalaryFormulaVar(defaultLabel = "发薪银行", labelId = 0, dataType = "string")
private String field145;
//锁定的项目
private List<Long> lockItems;

View File

@ -17,7 +17,8 @@ public enum PushRecordDetailStatusEnum implements BaseEnum<Integer> {
PREPARE(0, "待推送", 87625),
SUCCESS(1, "推送成功", 85393),
FAIL(2, "推送失败", 85393),
WITHDRAW(3, "已撤回", 85393);
WITHDRAW_SUCCESS(3, "已撤回", 85393),
WITHDRAW_FAIL(4, "撤回失败", 85393);
private int value;
@ -52,7 +53,7 @@ public enum PushRecordDetailStatusEnum implements BaseEnum<Integer> {
return salaryDataSourceEnum;
}
}
return null;
return PREPARE;
}
public static String getDefaultLabelByValue(Integer value) {

View File

@ -14,13 +14,14 @@ import java.util.Objects;
* @version 1.0
**/
public enum PushRecordStatusEnum implements BaseEnum<Integer> {
DATA_PREPARE(0, "数据构建", 87625),
DATA_FINISH(1, "构建完毕", 87625),
RUN_WAITING(2, "等待执行", 87625),
RUN_PROGRESS(3, "执行中", 85393),
RUN_COMPLETE(4, "执行完毕", 85393),
RUN_SUCCESS(5, "执行成功", 85393),
RUN_FAIL(6, "执行失败", 85393);
DATA_PREPARE(0, "准备中", 87625),
DATA_FINISH(1, "准备完毕", 87625),
RUN_PROGRESS(2, "推送中", 85393),
RUN_SUCCESS(3, "推送成功", 85393),
RUN_FAIL(4, "推送失败", 85393),
WITHDRAW(5, "撤回中", 85393),
WITHDRAW_SUCCESS(6, "已撤回", 85393),
WITHDRAW_FAIL(7, "撤回失败", 85393);
private int value;
@ -55,7 +56,7 @@ public enum PushRecordStatusEnum implements BaseEnum<Integer> {
return salaryDataSourceEnum;
}
}
return null;
return DATA_PREPARE;
}
public static String getDefaultLabelByValue(Integer value) {

View File

@ -83,5 +83,16 @@ public interface HrmSnapshotMapper {
*/
List<HrmSnapshotPO> currentEmpData();
/**
* 自定义基本信息
* @return
*/
List<HrmSnapshotPO> currentEmpBaseData();
/**
* 自定义工作信息
* @return
*/
List<HrmSnapshotPO> currentEmpWorkData();
}

View File

@ -70,6 +70,21 @@
<result column="WORKROOM" property="workroom"/>
<result column="workstartdate" property="workstartdate"/>
<result column="workyear" property="workyear"/>
<result column="field136" property="field136"/>
<result column="field137" property="field137"/>
<result column="field128" property="field128"/>
<result column="field1" property="field1"/>
<result column="field7" property="field7"/>
<result column="field121" property="field121"/>
<result column="field152" property="field152"/>
<result column="field124" property="field124"/>
<result column="field141" property="field141"/>
<result column="field142" property="field142"/>
<result column="field125" property="field125"/>
<result column="field31" property="field31"/>
<result column="field46" property="field46"/>
<result column="field145" property="field145"/>
</resultMap>
<!-- 表字段 -->
@ -144,6 +159,20 @@
, t.WORKROOM
, t.workstartdate
, t.workyear
, t.field136
, t.field137
, t.field128
, t.field1
, t.field7
, t.field121
, t.field152
, t.field124
, t.field141
, t.field142
, t.field125
, t.field31
, t.field46
, t.field145
</sql>
<!-- 查询全部 -->
@ -600,6 +629,49 @@
<if test="workyear != null">
workyear,
</if>
<if test="field136 != null">
field136,
</if>
<if test="field137 != null">
field137,
</if>
<if test="field128 != null">
field128,
</if>
<if test="field1 != null">
field1,
</if>
<if test="field7 != null">
field7,
</if>
<if test="field121 != null">
field121,
</if>
<if test="field152 != null">
field152,
</if>
<if test="field124 != null">
field124,
</if>
<if test="field141 != null">
field141,
</if>
<if test="field142 != null">
field142,
</if>
<if test="field125 != null">
field125,
</if>
<if test="field31 != null">
field31,
</if>
<if test="field46 != null">
field46,
</if>
<if test="field145 != null">
field145,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="accountid1 != null">
@ -806,6 +878,49 @@
<if test="workyear != null">
#{workyear},
</if>
<if test="field136 != null">
#{field136},
</if>
<if test="field137 != null">
#{field137},
</if>
<if test="field128 != null">
#{field128},
</if>
<if test="field1 != null">
#{field1},
</if>
<if test="field7 != null">
#{field7},
</if>
<if test="field121 != null">
#{field121},
</if>
<if test="field152 != null">
#{field152},
</if>
<if test="field124 != null">
#{field124},
</if>
<if test="field141 != null">
#{field141},
</if>
<if test="field142 != null">
#{field142},
</if>
<if test="field125 != null">
#{field125},
</if>
<if test="field31 != null">
#{field31},
</if>
<if test="field46 != null">
#{field46},
</if>
<if test="field145 != null">
#{field145},
</if>
</trim>
</insert>
@ -1198,4 +1313,30 @@
left join hrmjobcall job on e.jobcall=job.id
</select>
<select id="currentEmpBaseData" resultType="com.engine.salary.entity.hrm.po.HrmSnapshotPO">
select
id as employeeId,
field136,
field137,
field128,
field1,
field7
from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=-1
</select>
<select id="currentEmpWorkData" resultType="com.engine.salary.entity.hrm.po.HrmSnapshotPO">
select
id as employeeId,
field121,
field152,
field124,
field141,
field142,
field125,
field31,
field46,
field145
from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3
</select>
</mapper>

View File

@ -19,6 +19,7 @@
<result column="id" property="id" />
<result column="salary_month" property="salaryMonth" />
<result column="subcompany_id" property="subcompanyId" />
<result column="department_id" property="departmentId" />
<result column="update_time" property="updateTime" />
<result column="znxmlx" property="znxmlx" />
<result column="znxmmc" property="znxmmc" />
@ -43,6 +44,7 @@
, t.id
, t.salary_month
, t.subcompany_id
, t.department_id
, t.update_time
, t.znxmlx
, t.znxmmc
@ -196,6 +198,9 @@
<if test="subcompanyId != null">
subcompany_id,
</if>
<if test="departmentId != null">
department_id,
</if>
<if test="updateTime != null">
update_time,
</if>
@ -258,6 +263,9 @@
<if test="subcompanyId != null" >
#{subcompanyId},
</if>
<if test="departmentId != null">
#{departmentId},
</if>
<if test="updateTime != null" >
#{updateTime},
</if>
@ -274,25 +282,11 @@
<update id="update" parameterType="com.engine.salary.entity.ly.po.LyFundReportPO">
UPDATE hrsa_ly_fund_report
<set>
create_time=#{createTime},
creator=#{creator},
data_sorce=#{dataSorce},
delete_type=#{deleteType},
ftemp_num=#{ftempNum},
fwf=#{fwf},
fycdgsqc=#{fycdgsqc},
gjj_gjjhj=#{gjjGjjhj},
gjj_grbf=#{gjjGrbf},
gjj_gsbf=#{gjjGsbf},
gjjffpz_flag=#{gjjffpzFlag},
gjjjtpz_flag=#{gjjjtpzFlag},
gkgrygzhje=#{gkgrygzhje},
gmgsqc=#{gmgsqc},
salary_month=#{salaryMonth},
subcompany_id=#{subcompanyId},
update_time=#{updateTime},
znxmlx=#{znxmlx},
znxmmc=#{znxmmc},
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.engine.salary.entity.ly.po.LySalaryReportPO">
<result column="id" property="id" />
<result column="subcompany_id" property="subcompanyId" />
<result column="department_id" property="departmentId" />
<result column="ffgsqc" property="ffgsqc" />
<result column="fycdgsqc" property="fycdgsqc" />
<result column="znxmmc" property="znxmmc" />
@ -43,6 +44,7 @@
<sql id="baseColumns">
t.id
, t.subcompany_id
, t.department_id
, t.salary_month
, t.ffgsqc
, t.fycdgsqc
@ -222,6 +224,9 @@
<if test="subcompanyId != null">
subcompany_id,
</if>
<if test="departmentId != null">
department_id,
</if>
<if test="znxmlx != null">
znxmlx,
</if>
@ -335,6 +340,9 @@
<if test="subcompanyId != null" >
#{subcompanyId},
</if>
<if test="departmentId != null">
#{departmentId},
</if>
<if test="znxmlx != null">
#{znxmlx},
</if>

View File

@ -36,6 +36,9 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_type" property="deleteType" />
<result column="znxmlx" property="znxmlx" />
<result column="subcompany_id" property="subcompanyId" />
<result column="department_id" property="departmentId" />
</resultMap>
<!-- 表字段 -->
@ -76,6 +79,7 @@
, t.delete_type
, t.znxmlx
, t.subcompany_id
, t.department_id
</sql>
<!-- 查询全部 -->
@ -223,6 +227,9 @@
<if test="subcompanyId != null">
subcompany_id,
</if>
<if test="departmentId != null">
department_id,
</if>
<if test="znxmlx != null">
znxmlx,
</if>
@ -333,6 +340,9 @@
<if test="subcompanyId != null" >
#{subcompanyId},
</if>
<if test="departmentId != null">
#{departmentId},
</if>
<if test="znxmlx != null" >
#{znxmlx},
</if>
@ -442,37 +452,12 @@
<update id="update" parameterType="com.engine.salary.entity.ly.po.LySocialReportPO">
UPDATE hrsa_ly_social_report
<set>
salary_month=#{salaryMonth},
gmgsqc=#{gmgsqc},
fycdgsqc=#{fycdgsqc},
znxmmc=#{znxmmc},
ftemp_num=#{ftempNum},
yl_gsbf=#{ylGsbf},
yl_grbf=#{ylGrbf},
yiliao_gsbf=#{yiliaoGsbf},
yiliao_grbf=#{yiliaoGrbf},
sy_gsbf=#{syGsbf},
sy_grbf=#{syGrbf},
shengy_gsbf=#{shengyGsbf},
gs_gsbf=#{gsGsbf},
bcyljqt_gsbf=#{bcyljqtGsbf},
sb_gsbf=#{sbGsbf},
sb_grbf=#{sbGrbf},
sb_sbhj=#{sbSbhj},
gjj_gsbf=#{gjjGsbf},
gjj_grbf=#{gjjGrbf},
gjj_gjjhj=#{gjjGjjhj},
fwf=#{fwf},
gkgrygzhje=#{gkgrygzhje},
data_sorce=#{dataSorce},
xzjtpz_flag=#{xzjtpzFlag},
xzffpz_flag=#{xzffpzFlag},
sbjtpz_flag=#{sbjtpzFlag},
sbffpz_flag=#{sbffpzFlag},
gjjjtpz_flag=#{gjjjtpzFlag},
gjjffpz_flag=#{gjjffpzFlag},
creator=#{creator},
create_time=#{createTime},
update_time=#{updateTime},
delete_type=#{deleteType},
</set>

View File

@ -5,6 +5,7 @@
<resultMap id="SbBaseResultMap" type="com.engine.salary.entity.ly.po.UfSbInfo">
<result column="dbylbx" property="dbylbx" />
<result column="fb" property="fb" />
<result column="bm" property="bm" />
<result column="fuwufi" property="fuwufi" />
<result column="fyszq" property="fyszq" />
<result column="gkgrygzhje" property="gkgrygzhje" />
@ -40,6 +41,7 @@
<sql id="sbBaseColumns">
t.dbylbx
, t.fb
, t.bm
, t.fuwufi
, t.fyszq
, t.gkgrygzhje
@ -86,6 +88,7 @@
<resultMap id="GjjBaseResultMap" type="com.engine.salary.entity.ly.po.UfGjjInfo">
<result column="fuwufi" property="fuwufi" />
<result column="fb" property="fb" />
<result column="bm" property="bm" />
<result column="fycdgsqc" property="fycdgsqc" />
<result column="fyszq" property="fyszq" />
<result column="gjjcdgsmc" property="gjjcdgsmc" />
@ -104,6 +107,7 @@
<sql id="gjjBaseColumns">
t.fuwufi
, t.fb
, t.bm
, t.fycdgsqc
, t.fyszq
, t.gjjcdgsmc

View File

@ -1,5 +1,6 @@
package com.engine.salary.mapper.push;
import com.engine.salary.entity.push.dto.PushRecordDetailDTO;
import com.engine.salary.entity.push.po.PushRecordDetailPO;
import org.apache.ibatis.annotations.Param;
@ -21,7 +22,9 @@ public interface PushRecordDetailMapper {
* @return 返回集合没有返回空List
*/
List<PushRecordDetailPO> listSome(PushRecordDetailPO pushRecordDetail);
List<PushRecordDetailDTO> listDTO(PushRecordDetailDTO dto);
/**
* 根据主键查询

View File

@ -6,12 +6,14 @@
<result column="create_time" property="createTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="execute" property="execute"/>
<result column="formula" property="formula"/>
<result column="id" property="id"/>
<result column="record_id" property="recordId"/>
<result column="status" property="status"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="fail_reason" property="failReason"/>
<result column="data_id" property="dataId"/>
</resultMap>
<!-- 表字段 -->
@ -22,12 +24,14 @@
, t.create_time
, t.creator
, t.delete_type
, t.execute
, t.formula
, t.id
, t.record_id
, t.status
, t.tenant_key
, t.update_time
, t.fail_reason
, t.data_id
</sql>
<!-- 查询全部 -->
@ -64,8 +68,8 @@
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="execute != null">
AND execute = #{execute}
<if test="formula != null">
AND formula = #{formula}
</if>
<if test="id != null">
AND id = #{id}
@ -88,6 +92,54 @@
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<select id="listDTO" resultType="com.engine.salary.entity.push.dto.PushRecordDetailDTO" parameterType="com.engine.salary.entity.push.dto.PushRecordDetailDTO">
SELECT
t.acct_emp_id
, t.create_time
, t.creator
, t.delete_type
, t.formula
, t.id
, t.record_id
, t.status
, t.tenant_key
, t.update_time
, t.fail_reason as failReason
, t.data_id as dataId
, e.LASTNAME as username
FROM hrsa_push_record_detail t
left join hrsa_salary_acct_emp emp
on t.acct_emp_id=emp.id
left join hrsa_salary_sob sob
on emp.salary_sob_id = sob.id
left join hrmresource e
on emp.employee_id=e.id
WHERE t.delete_type = 0
and emp.delete_type = 0
and sob.delete_type = 0
<if test="acctEmpId != null">
AND t.acct_emp_id = #{acctEmpId}
</if>
<if test="id != null">
AND t.id = #{id}
</if>
<if test="recordId != null">
AND t.record_id = #{recordId}
</if>
<if test="status != null">
AND t.status = #{status}
</if>
ORDER BY id DESC
</select>
@ -109,8 +161,8 @@
<if test="deleteType != null">
delete_type,
</if>
<if test="execute != null">
execute,
<if test="formula != null">
formula,
</if>
<if test="id != null">
id,
@ -127,6 +179,12 @@
<if test="updateTime != null">
update_time,
</if>
<if test="failReason != null">
fail_reason,
</if>
<if test="dataId != null">
data_id,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="acctEmpId != null">
@ -141,8 +199,8 @@
<if test="deleteType != null">
#{deleteType},
</if>
<if test="execute != null">
#{execute},
<if test="formula != null">
#{formula},
</if>
<if test="id != null">
#{id},
@ -159,6 +217,12 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="failReason != null">
#{failReason},
</if>
<if test="dataId != null">
#{dataId},
</if>
</trim>
</insert>
@ -170,11 +234,13 @@
create_time=#{createTime},
creator=#{creator},
delete_type=#{deleteType},
execute=#{execute},
formula=#{formula},
record_id=#{recordId},
status=#{status},
tenant_key=#{tenantKey},
update_time=#{updateTime},
fail_reason=#{failReason},
data_id=#{dataId},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -196,8 +262,8 @@
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="execute != null">
execute=#{execute},
<if test="formula != null">
formula=#{formula},
</if>
<if test="recordId != null">
record_id=#{recordId},
@ -211,6 +277,12 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="failReason != null">
fail_reason=#{failReason},
</if>
<if test="dataId != null">
data_id=#{dataId},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -3,18 +3,21 @@
<mapper namespace="com.engine.salary.mapper.push.PushRecordMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.push.po.PushRecordPO">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="acct_record_id" property="acctRecordId"/>
<result column="setting_id" property="settingId"/>
<result column="mode_id" property="modeId"/>
<result column="table_name" property="tableName"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="status" property="status"/>
<result column="setting_id" property="settingId"/>
<result column="acct_record_id" property="acctRecordId"/>
<result column="type" property="type"/>
<result column="create_time" property="createTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="fail_reason" property="failReason"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
</resultMap>
<!-- 表字段 -->
@ -34,6 +37,9 @@
, t.tenant_key
, t.type
, t.update_time
, t.fail_reason
, t.start_time
, t.end_time
</sql>
<!-- 查询全部 -->
@ -98,6 +104,15 @@
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="failReason != null">
AND fail_reason = #{failReason}
</if>
<if test="startTime != null">
AND start_time = #{startTime}
</if>
<if test="endTime != null">
AND end_time = #{endTime}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -152,6 +167,15 @@
<if test="updateTime != null">
update_time,
</if>
<if test="failReason != null">
fail_reason,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="modeId != null">
@ -193,6 +217,15 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="failReason != null">
#{failReason},
</if>
<if test="startTime != null">
#{startTime},
</if>
<if test="endTime != null">
#{endTime},
</if>
</trim>
</insert>
@ -212,6 +245,9 @@
tenant_key=#{tenantKey},
type=#{type},
update_time=#{updateTime},
fail_reason=#{failReason},
start_time=#{startTime},
end_time=#{endTime},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -257,6 +293,15 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="failReason != null">
fail_reason=#{failReason},
</if>
<if test="startTime != null">
start_time=#{startTime},
</if>
<if test="endTime != null">
end_time=#{endTime},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -12,6 +12,7 @@
<result column="item_name" property="itemName"/>
<result column="source" property="source"/>
<result column="setting_id" property="settingId"/>
<result column="sorted_index" property="sortedIndex"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
</resultMap>
@ -32,6 +33,7 @@
, t.setting_id
, t.tenant_key
, t.update_time
, t.sorted_index
</sql>
<!-- 查询全部 -->
@ -40,6 +42,7 @@
<include refid="baseColumns"/>
FROM hrsa_push_setting_item t
WHERE delete_type = 0
ORDER BY sorted_index DESC
</select>
<!-- 根据主键获取单条记录 -->
@ -85,6 +88,9 @@
</if>
<if test="settingId != null">
AND setting_id = #{settingId}
</if>
<if test="sortedIndex != null">
AND sorted_index = #{sortedIndex}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
@ -98,7 +104,7 @@
#{id}
</foreach>
</if>
ORDER BY id DESC
ORDER BY sorted_index DESC
</select>
@ -137,6 +143,9 @@
<if test="settingId != null">
setting_id,
</if>
<if test="sortedIndex != null">
sorted_index,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
@ -175,6 +184,9 @@
<if test="settingId != null">
#{settingId},
</if>
<if test="sortedIndex != null">
#{sortedIndex},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
@ -197,6 +209,7 @@
item_name=#{itemName},
source=#{source},
setting_id=#{settingId},
sorted_index=#{sortedIndex},
tenant_key=#{tenantKey},
update_time=#{updateTime},
</set>
@ -235,6 +248,9 @@
<if test="settingId != null">
setting_id=#{settingId},
</if>
<if test="sortedIndex != null">
sorted_index=#{sortedIndex},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>

View File

@ -27,6 +27,20 @@
<result column="status" property="status"/>
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
<result column="account_type" property="accountType"/>
<result column="field136" property="field136"/>
<result column="field137" property="field137"/>
<result column="field128" property="field128"/>
<result column="field1" property="field1"/>
<result column="field7" property="field7"/>
<result column="field121" property="field121"/>
<result column="field152" property="field152"/>
<result column="field124" property="field124"/>
<result column="field141" property="field141"/>
<result column="field142" property="field142"/>
<result column="field125" property="field125"/>
<result column="field31" property="field31"/>
<result column="field46" property="field46"/>
<result column="field145" property="field145"/>
</resultMap>
<resultMap id="SalaryAccEmployeeCountMap"
@ -62,7 +76,21 @@
t.jobcall_id,
t.status,
t.lock_items,
t.account_type
t.account_type,
t.field136,
t.field137,
t.field128,
t.field1,
t.field7,
t.field121,
t.field152,
t.field124,
t.field141,
t.field142,
t.field125,
t.field31,
t.field46,
t.field145
</sql>
<sql id="emp1Column">
@ -86,7 +114,21 @@
jobcall,
jobcall_id,
status,
account_type)
account_type,
field136,
field137,
field128,
field1,
field7,
field121,
field152,
field124,
field141,
field142,
field125,
field31,
field46,
field145)
VALUES
<foreach collection="collection" item="emp" separator=",">
(
@ -111,7 +153,21 @@
#{emp.jobcall},
#{emp.jobcallId},
#{emp.status},
#{emp.accountType}
#{emp.accountType},
#{emp.field136},
#{emp.field137},
#{emp.field128},
#{emp.field1},
#{emp.field7},
#{emp.field121},
#{emp.field152},
#{emp.field124},
#{emp.field141},
#{emp.field142},
#{emp.field125},
#{emp.field31},
#{emp.field46},
#{emp.field145}
)
</foreach>
</insert>
@ -128,7 +184,21 @@
jobcall,
jobcall_id,
status,
account_type
account_type,
field136,
field137,
field128,
field1,
field7,
field121,
field152,
field124,
field141,
field142,
field125,
field31,
field46,
field145
)
<foreach collection="collection" item="emp" separator="union all">
select
@ -153,7 +223,21 @@
#{emp.jobcall,jdbcType=VARCHAR},
#{emp.jobcallId,jdbcType=DOUBLE},
#{emp.status,jdbcType=VARCHAR},
#{emp.accountType,jdbcType=INTEGER}
#{emp.accountType,jdbcType=INTEGER},
#{emp.field136,jdbcType=VARCHAR},
#{emp.field137,jdbcType=VARCHAR},
#{emp.field128,jdbcType=VARCHAR},
#{emp.field1,jdbcType=VARCHAR},
#{emp.field7,jdbcType=VARCHAR},
#{emp.field121,jdbcType=VARCHAR},
#{emp.field152,jdbcType=VARCHAR},
#{emp.field124,jdbcType=VARCHAR},
#{emp.field141,jdbcType=VARCHAR},
#{emp.field142,jdbcType=VARCHAR},
#{emp.field125,jdbcType=VARCHAR},
#{emp.field31,jdbcType=VARCHAR},
#{emp.field46,jdbcType=VARCHAR},
#{emp.field145,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -171,7 +255,21 @@
jobcall,
jobcall_id,
status,
account_type
account_type,
field136,
field137,
field128,
field1,
field7,
field121,
field152,
field124,
field141,
field142,
field125,
field31,
field46,
field145
)
VALUES
(
@ -196,7 +294,21 @@
#{emp.jobcall},
#{emp.jobcallId},
#{emp.status},
#{emp.accountType}
#{emp.accountType},
#{emp.field136},
#{emp.field137},
#{emp.field128},
#{emp.field1},
#{emp.field7},
#{emp.field121},
#{emp.field152},
#{emp.field124},
#{emp.field141},
#{emp.field142},
#{emp.field125},
#{emp.field31},
#{emp.field46},
#{emp.field145}
)
</foreach>
</insert>
@ -1063,6 +1175,20 @@
, t.status
, t.lock_items
, t.account_type
, t.field136
, t.field137
, t.field128
, t.field1
, t.field7
, t.field121
, t.field152
, t.field124
, t.field141
, t.field142
, t.field125
, t.field31
, t.field46
, t.field145
</sql>

View File

@ -143,6 +143,9 @@
<if test="taxCycleDateRange != null and taxCycleDateRange.endDate != null">
AND t.tax_cycle <![CDATA[ <= ]]> #{taxCycleDateRange.endDate}
</if>
<if test="taxAgentId != null">
AND sob.tax_agent_id = #{taxAgentId}
</if>
ORDER BY t.salary_month desc,t.id DESC
</select>
<select id="listByCreateDate" resultType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">

View File

@ -1,5 +1,6 @@
package com.engine.salary.service;
import com.engine.salary.entity.ly.dto.LyFzhsInfo;
import com.engine.salary.entity.ly.param.LyFzhslxParam;
import com.engine.salary.entity.ly.param.LyPZGenParam;
import com.engine.salary.entity.ly.param.LyVoucherPushParam;
@ -7,6 +8,7 @@ import com.engine.salary.entity.ly.param.LyVoucherQueryParam;
import com.engine.salary.entity.ly.po.LyVoucherPO;
import com.engine.salary.util.page.PageInfo;
import java.util.List;
import java.util.Map;
/**
@ -25,6 +27,8 @@ public interface LyPZService {
*/
Map<String, Object> genPZ(LyPZGenParam queryParam);
List<LyFzhsInfo> listFzhsByFrzt(List<String> frztNameList);
Map<String, String> listAllFrzt();
/**

View File

@ -149,4 +149,8 @@ public interface LySalaryReportService {
void generateCymxSbReport(String salaryMonth);
void generateCymxGjjReport(String salaryMonth);
void deleteByIds(List<Long> needDeleteIds);
Map<String, String> getHszb(String ffgsqc);
}

View File

@ -58,19 +58,18 @@ public interface PushService {
*/
void deleteItem(Long id);
/**
* 推送一条核算记录下的所有数据
*
* @param salaryAcctRecordId
* @return
*/
void pushOneRecord(Long salaryAcctRecordId);
void createPushRecord(Long salaryAcctRecordId);
void withdrawPushRecord(Long salaryAcctRecordId);
void push(Long id);
void withdraw(Long id);
void removeRecords(List<Long> records);
PageInfo<PushRecordDTO> recordList(RecordListQueryParam param);
PageInfo<PushRecordDetailDTO> recordDetailList(RecordDetailListQueryParam param);
}

View File

@ -44,7 +44,7 @@ public interface SalaryAcctEmployeeService {
* @param ids 主键id
* @return
*/
List<SalaryAcctEmployeePO> listByIds(Collection<Long> ids);
List<SalaryAcctEmployeePO> listByIds(List<Long> ids);
/**
* 根据薪资核算记录id查询薪资核算人员

View File

@ -210,4 +210,11 @@ public interface SalaryEmployeeService {
* @return
*/
List<LyFzhsInfo> listFzhsInfoByDeptIds(List<Long> departmentIds);
/**
* 领悦 - 获取自定义岗位信息
* @param employeeIds
* @return
*/
Map<Long, Map<String, String>> listUfJobtitleMap(List<Long> employeeIds);
}

View File

@ -383,7 +383,9 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 转换成薪资核算人员po
Date salaryDate = SalaryDateUtil.dateStrToLocalDate(salaryYearMonth + "-01");
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, (long) user.getUID());
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤掉不属于当前账套扣缴义务人的人员
employeeIds = salaryAcctEmployeePOS.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList());

View File

@ -153,13 +153,32 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
// 获取本月是否已有报表数据
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
// 过滤出已推送成功的数据
List<String> canNotGenGmgsqcList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(lyFundReportPOS)) {
throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
List<LyFundReportPO> canNotDeleteList = lyFundReportPOS.stream()
.filter(report -> (report.getGjjffpzFlag() != null && report.getGjjffpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getGjjjtpzFlag() != null && report.getGjjjtpzFlag().equals(NumberUtils.INTEGER_ONE)))
.collect(Collectors.toList());
// 获取不能生成的发放公司全称
canNotGenGmgsqcList = canNotDeleteList.stream().map(LyFundReportPO::getGmgsqc).distinct().collect(Collectors.toList());
// 删除其余未推送成功的报表数据
List<String> finalCanNotGenGmgsqcList = canNotGenGmgsqcList;
List<Long> needDeleteIds = lyFundReportPOS.stream().filter(po -> !finalCanNotGenGmgsqcList.contains(po.getGmgsqc()))
.map(LyFundReportPO::getId)
.collect(Collectors.toList());
deleteByIds(needDeleteIds);
}
// if (CollectionUtils.isNotEmpty(lyFundReportPOS)) {
// throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
// }
// 获取建模中社保数据
List<UfGjjInfo> gjjInfoList = listUfGjjInfoBySalaryMonth(salaryMonthDate);
if (CollectionUtils.isNotEmpty(gjjInfoList)) {
// 获取所有法人主体信息
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
List<String> finalCanNotGenGmgsqcList1 = canNotGenGmgsqcList;
gjjInfoList = gjjInfoList.stream().filter(gjjInfo -> !finalCanNotGenGmgsqcList1.contains(frztMap.get(gjjInfo.getFycdgsqc()))).collect(Collectors.toList());
Map<String, List<UfGjjInfo>> resultGroup = SalaryEntityUtil.group2Map(gjjInfoList, gjjInfo -> Util.null2String(gjjInfo.getFycdgsqc())
+ "-split" + Util.null2String(gjjInfo.getGjjcdgsmc())
+ "-split" + Util.null2String(gjjInfo.getZnxmmc()));
@ -167,8 +186,6 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
LinkedHashMap<String, List<UfGjjInfo>> sortedMap = new LinkedHashMap<>();
resultGroup.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
// 获取所有法人主体信息
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
Date now = new Date();
sortedMap.forEach((key, valueList) -> {
String[] split = key.split("-split");
@ -176,11 +193,13 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
String fycdgsqc = split.length > 1 ? split[1] : "";
String znxmmc = split.length > 2 ? split[2] : "";
Long subcompanyId = CollectionUtils.isEmpty(valueList) ? 0L : valueList.get(0).getFb() == null ? 0L : Long.valueOf(valueList.get(0).getFb());
Long departmentId = CollectionUtils.isEmpty(valueList) ? 0L : valueList.get(0).getBm() == null ? 0L : Long.valueOf(valueList.get(0).getBm());
String znxmlxStr = CollectionUtils.isEmpty(valueList) ? "" : valueList.get(0).getZnxmlb() == null ? "" : valueList.get(0).getZnxmlb();
LyFundReportPO build = LyFundReportPO.builder()
.id(IdGenerator.generate())
.subcompanyId(subcompanyId)
.departmentId(departmentId)
.ftempNum(CollectionUtils.isEmpty(valueList) ? 0 : valueList.size())
.salaryMonth(salaryMonthDate)
.znxmlx(znxmlxStr)
@ -659,7 +678,10 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
if (CollectionUtils.isEmpty(ids)) {
return;
}
getLyFundReportMapper().deleteByIds(ids);
List<List<Long>> partition = Lists.partition(ids, 500);
partition.forEach(part -> {
getLyFundReportMapper().deleteByIds(part);
});
}
@Override

View File

@ -124,7 +124,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
// 获取所有的部门信息
List<DeptInfo> deptInfos = getSalaryEmployeeService(user).listAllDeptInfoList();
// key:分部id-部门名称 value:部门id
Map<String, DeptInfo> depInfoMap = SalaryEntityUtil.convert2Map(deptInfos, dep -> dep.getSubcompanyid1() + "-" + dep.getName());
// Map<String, DeptInfo> depInfoMap = SalaryEntityUtil.convert2Map(deptInfos, dep -> dep.getSubcompanyid1() + "-" + dep.getName());
Map<String, DeptInfo> depInfoMap = SalaryEntityUtil.convert2Map(deptInfos, dep -> dep.getId().toString());
Set<Long> subCompanyIds = new HashSet<>();
Set<Long> departmentIds = new HashSet<>();
Set<String> frztNameList = new HashSet<>();
@ -146,7 +147,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
singleCount = true;
} else if (znxmlxContent.equals("职能")) {
// 获取部门信息
DeptInfo dept = depInfoMap.get(subcompanyId + "-" + varMap.getOrDefault("职能项目名称", ""));
// DeptInfo dept = depInfoMap.get(subcompanyId + "-" + varMap.getOrDefault("职能项目名称", ""));
DeptInfo dept = depInfoMap.get(varMap.getOrDefault("departmentId", ""));
// 获取部门属性信息
if (dept == null) {
singleCount = true;
@ -255,26 +257,37 @@ public class LyPZServiceImpl extends Service implements LyPZService {
queryParam.setSalaryMonthDate(SalaryDateUtil.dateStrToLocalYearMonth(queryParam.getSalaryMonth()));
String chnYearMonth = SalaryDateUtil.getFormatCHNYearMonth(queryParam.getSalaryMonthDate());
// 获取特殊摘要对应的会计科目编码
// // 生育津贴
// String syjtKjkm = baseBean.getPropValue("lySalaryNCVoucher", "syjt_kjkm_bm");
// // 银行存款
// String yhckKjkm = baseBean.getPropValue("lySalaryNCVoucher", "yhck_kjkm_bm");
// // 母子公司往来款
// String mzgswlkKjkm = baseBean.getPropValue("lySalaryNCVoucher", "mzgswlk_kjkm_bm");
// // 代买社保公积金
// String dmsbgjjKjkm = baseBean.getPropValue("lySalaryNCVoucher", "dmsbgjj_kjkm_bm");
// 获取薪资发放凭证中需要固定的客商信息
List<String> xzffNeedFixedKsKjkmList = new ArrayList<>();
Map<String, String> xzffFixedKsValueMap = new HashMap<>();
// 获取薪资发放凭证中需要固定的项目期数信息
List<String> xzffNeedFixedXmqsKjkmList = new ArrayList<>();
Map<String, String> xzffFixedXmqsValueMap = new HashMap<>();
// 获取薪资发放凭证中需要固定的房屋类别信息
List<String> xzffNeedFixedFwlbKjkmList = new ArrayList<>();
Map<String, String> xzffFixedFwlbValueMap = new HashMap<>();
if (queryParam.getPzlx().equals(LyPZTypeEnum.XZFFPZ.getValue())) {
// 客商
xzffNeedFixedKsKjkmList = Arrays.stream(baseBean.getPropValue("lySalaryNCVoucher", "xzff_need_fixed_ks_kjkm").split(",")).collect(Collectors.toList());
for (String kjkm : xzffNeedFixedKsKjkmList) {
String ksValue = baseBean.getPropValue("lySalaryNCVoucher", "xzff_ks_" + kjkm);
xzffFixedKsValueMap.put(kjkm, Util.null2String(ksValue));
fzhsBmList.add(ksValue);
}
// 项目期数
xzffNeedFixedXmqsKjkmList = Arrays.stream(baseBean.getPropValue("lySalaryNCVoucher", "xzff_need_fixed_xmqs_kjkm").split(",")).collect(Collectors.toList());
for (String kjkm : xzffNeedFixedXmqsKjkmList) {
String xmqsValue = baseBean.getPropValue("lySalaryNCVoucher", "xzff_xmqs_" + kjkm);
xzffFixedXmqsValueMap.put(kjkm, Util.null2String(xmqsValue));
fzhsBmList.add(xmqsValue);
}
// 房屋类别
xzffNeedFixedFwlbKjkmList = Arrays.stream(baseBean.getPropValue("lySalaryNCVoucher", "xzff_need_fixed_fwlb_kjkm").split(",")).collect(Collectors.toList());
for (String kjkm : xzffNeedFixedFwlbKjkmList) {
String fwlbValue = baseBean.getPropValue("lySalaryNCVoucher", "xzff_fwlb_" + kjkm);
xzffFixedFwlbValueMap.put(kjkm, Util.null2String(fwlbValue));
fzhsBmList.add(fwlbValue);
}
}
// 根据辅助核算编码获取辅助核算浏览框yx
Map<String, LyFzhsBrowser> fzhsBrowserMap = getFzhsBrowserByBm(fzhsBmList);
@ -329,9 +342,18 @@ public class LyPZServiceImpl extends Service implements LyPZService {
.fzhsYxzh(frztFzhs != null && kjkm.isFzhsYhzhFlag() ? fzhsBrowserMap.get(frztFzhs.getFzhsyxzh()) : null)
.dataSource(reportDataIds)
.build();
// 固定客商
if (xzffNeedFixedKsKjkmList.contains(kjkm.getKmbm())) {
build.setFzhsKs(frztFzhs != null && kjkm.isFzhsKsFlag() ? fzhsBrowserMap.get(xzffFixedKsValueMap.get(kjkm.getKmbm())) : null);
}
// 固定项目期数
if (xzffNeedFixedXmqsKjkmList.contains(kjkm.getKmbm())) {
build.setFzhsXmqs(frztFzhs != null && kjkm.isFzhsFlag() ? fzhsBrowserMap.get(xzffFixedXmqsValueMap.get(kjkm.getKmbm())) : null);
}
// 固定房屋列表
if (xzffNeedFixedFwlbKjkmList.contains(kjkm.getKmbm())) {
build.setFzhsFwlb(frztFzhs != null && kjkm.isFzhsFwlbFlag() ? fzhsBrowserMap.get(xzffFixedFwlbValueMap.get(kjkm.getKmbm())) : null);
}
String zy = genZy(build, queryParam.getFfgsqc(), Utils.null2String(kjkmValueMap.get("frzt")), chnYearMonth, kjkm);
build.setZy(zy);
@ -395,7 +417,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
* @param frztNameList
* @return
*/
private List<LyFzhsInfo> listFzhsByFrzt(List<String> frztNameList) {
public List<LyFzhsInfo> listFzhsByFrzt(List<String> frztNameList) {
if (CollectionUtils.isEmpty(frztNameList)) {
return Collections.emptyList();
}
@ -403,17 +425,19 @@ public class LyPZServiceImpl extends Service implements LyPZService {
List<List<String>> partition = Lists.partition(frztNameList, 500);
List<LyFzhsInfo> resultList = new ArrayList<>();
partition.forEach(part -> {
rs.execute("select frzt,sllb,ks,yxzh from uf_frzt where frzt in ('" +StringUtils.join(part, "','")+ "')");
rs.execute("select frzt,sllb,ks,yxzh,nczb from uf_frzt where (sfqy =0 or sfqy is null) and frzt in ('" +StringUtils.join(part, "','")+ "')");
while (rs.next()) {
String frzt = rs.getString("frzt");
String sllb = rs.getString("sllb");
String ks = rs.getString("ks");
String yxzh = rs.getString("yxzh");
String nczb = rs.getString("nczb");
LyFzhsInfo build = LyFzhsInfo.builder()
.frzt(frzt)
.fzhssllb(sllb)
.fzhsks(ks)
.fzhsyxzh(yxzh)
.nczb(nczb)
.build();
resultList.add(build);
}
@ -429,7 +453,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
public Map<String, String> listAllFrzt() {
RecordSet rs = new RecordSet();
Map<String, String> resultMap = new HashMap<>();
rs.execute("select id,frzt from uf_frzt ");
rs.execute("select id,frzt from uf_frzt where sfqy =0 or sfqy is null");
while (rs.next()) {
String frzt = rs.getString("frzt");
String id = rs.getString("id");
@ -536,9 +560,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
Map<String, Object> resultMap = getLySalaryReportService(user).listSalaryReport(LySalaryReportQueryParam.builder()
.salaryMonth(queryParam.getSalaryMonth())
.ffgsqc(Collections.singletonList(queryParam.getFfgsqc()))
.fycdgsqc(queryParam.getFycdgsqc())
.jtStatus(queryParam.getJtStatus())
.ffStatus(queryParam.getFfStatus())
// .fycdgsqc(queryParam.getFycdgsqc())
// .jtStatus(queryParam.getJtStatus())
// .ffStatus(queryParam.getFfStatus())
.export(true).build());
List<LySalaryReportPO> dataList = ((PageInfo<LySalaryReportPO>)resultMap.get("data")).getList();
// 将每一个结果转换成map的格式并作为变量存储
@ -564,9 +588,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
Map<String, Object> resultMap = getLySocialReportService(user).listSIReport(LySalaryReportQueryParam.builder()
.salaryMonth(queryParam.getSalaryMonth())
.ffgsqc(Collections.singletonList(queryParam.getFfgsqc()))
.fycdgsqc(queryParam.getFycdgsqc())
.jtStatus(queryParam.getJtStatus())
.ffStatus(queryParam.getFfStatus())
// .fycdgsqc(queryParam.getFycdgsqc())
// .jtStatus(queryParam.getJtStatus())
// .ffStatus(queryParam.getFfStatus())
.export(true).build());
List<LySocialReportPO> dataList = ((PageInfo<LySocialReportPO>)resultMap.get("data")).getList();
// 将每一个结果转换成map的格式并作为变量存储
@ -593,9 +617,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
.salaryMonth(queryParam.getSalaryMonth())
.ffgsqc(Collections.singletonList(queryParam.getFfgsqc()))
.export(true)
.fycdgsqc(queryParam.getFycdgsqc())
.jtStatus(queryParam.getJtStatus())
.ffStatus(queryParam.getFfStatus())
// .fycdgsqc(queryParam.getFycdgsqc())
// .jtStatus(queryParam.getJtStatus())
// .ffStatus(queryParam.getFfStatus())
.build());
List<LyFundReportPO> dataList = ((PageInfo<LyFundReportPO>)resultMap.get("data")).getList();
// 将每一个结果转换成map的格式并作为变量存储
@ -988,8 +1012,18 @@ public class LyPZServiceImpl extends Service implements LyPZService {
// 制单日期 非空
lyNCVoucher.setPrepareddate(SalaryDateUtil.getFormatLocalDateTime(cal.getTime()));
// 制单人 非空 用户
String pkPrepared = baseBean.getPropValue("lySalaryNCVoucherPushParam", "pk_prepared");
lyNCVoucher.setPkPrepared(pkPrepared);
// String pkPrepared = baseBean.getPropValue("lySalaryNCVoucherPushParam", "pk_prepared");
// 获取当前登录人的nc账号
String zdr = "";
RecordSet rs = new RecordSet();
rs.executeQuery("select field64 from cus_fielddata where scopeid = 3 and id = ?", new Object[]{user.getUID()});
if (rs.next()) {
zdr = rs.getString(1);
}
if (StringUtils.isBlank(zdr)) {
throw new SalaryRunTimeException("制单人为空");
}
lyNCVoucher.setPkPrepared(zdr);
//所属组织 非空 组织
lyNCVoucher.setPkOrg(pushParam.getZbbm().split("-")[0]);
// lyNCVoucher.setPkOrg("201");
@ -1007,7 +1041,6 @@ public class LyPZServiceImpl extends Service implements LyPZService {
}
});
ArrayList<LyNCVoucherDetail> lyNCVoucherDetailList = new ArrayList<>();
RecordSet rs = new RecordSet();
// 借方分录
for (int i = 0; i < jfDetailList.size(); i++) {
LyVoucherDetailPushParam detailParam = jfDetailList.get(i);

View File

@ -7,6 +7,7 @@ import com.engine.salary.common.LocalDateRange;
import com.engine.salary.component.WeaTableColumnGroup;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.ly.dto.LyFzhsInfo;
import com.engine.salary.entity.ly.param.LySalaryReportQueryParam;
import com.engine.salary.entity.ly.po.LySalaryReportPO;
import com.engine.salary.entity.ly.po.UfGjjInfo;
@ -206,9 +207,24 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
// 获取本月是否已有报表数据
List<LySalaryReportPO> lySalaryReportPOS = listBySalaryMonth(salaryMonthDate);
// 过滤出已推送成功的数据
List<String> canNotGenFfgsqcList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(lySalaryReportPOS)) {
throw new SalaryRunTimeException("本薪资所属月已生成薪资汇总报表,无法生成薪资报表数据");
List<LySalaryReportPO> canNotDeleteList = lySalaryReportPOS.stream()
.filter(report -> (report.getXzjtpzFlag() != null && report.getXzjtpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getXzffpzFlag() != null && report.getXzffpzFlag().equals(NumberUtils.INTEGER_ONE)))
.collect(Collectors.toList());
// 获取不能生成的发放公司全称
canNotGenFfgsqcList = canNotDeleteList.stream().map(LySalaryReportPO::getFfgsqc).distinct().collect(Collectors.toList());
// 删除其余未推送成功的报表数据
List<String> finalCanNotGenFfgsqcList = canNotGenFfgsqcList;
List<Long> needDeleteIds = lySalaryReportPOS.stream().filter(po -> !finalCanNotGenFfgsqcList.contains(po.getFfgsqc()))
.map(LySalaryReportPO::getId)
.collect(Collectors.toList());
deleteByIds(needDeleteIds);
}
// if (CollectionUtils.isNotEmpty(lySalaryReportPOS)) {
// throw new SalaryRunTimeException("本薪资所属月已生成薪资汇总报表,无法生成薪资报表数据");
// }
BaseBean baseBean = new BaseBean();
// 获取薪资核算结果
@ -224,15 +240,22 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) {
String dataSourceStr = StringUtils.join(salaryAcctRecordIds, ",");
// 获取这些人的发放公司全称数据
List<Long> salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
Long ffgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_ffgsqc_item_id");
List<SalaryAcctResultPO> acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, Collections.singletonList(ffgsqcItemId));
List<String> finalCanNotGenFfgsqcList1 = canNotGenFfgsqcList;
List<Long> needExcludeAcctEmpIds = acctResultList.stream().filter(result -> finalCanNotGenFfgsqcList1.contains(result.getResultValue()))
.map(SalaryAcctResultPO::getSalaryAcctEmpId).collect(Collectors.toList());
salaryAcctEmployeePOList = salaryAcctEmployeePOList.stream().filter(employee -> !needExcludeAcctEmpIds.contains(employee.getId())).collect(Collectors.toList());
// 获取薪资项目id
List<Long> salaryItemIds = new ArrayList<>();
// 是职能还是项目
Long znxmlxItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_znxmlx_item_id");
salaryItemIds.add(znxmlxItemId);
// 发放公司全称
Long ffgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_ffgsqc_item_id");
// 发放公司全称
salaryItemIds.add(ffgsqcItemId);
// 费用承担公司全称
Long fycdgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_fycdgsqc_item_id");
@ -298,11 +321,12 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
salaryItemIds.add(bysfItemId);
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(salaryItemIds);
salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
List<Long> salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
// 获取薪资核算结果
List<SalaryAcctResultPO> acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
List<SalarySobEmpFieldPO> salarySobEmpFields = new ArrayList<>();
salarySobEmpFields.add(SalarySobEmpFieldPO.builder().fieldCode("subcompanyId").build());
salarySobEmpFields.add(SalarySobEmpFieldPO.builder().fieldCode("departmentId").build());
List<Map<String, Object>> resultMapList = buildData4LyReport(salaryItemList, salaryAcctEmployeePOList, salarySobEmpFields, acctResultList, false);
// 根据费用承担公司全称职能/项目名称进行分组
Map<String, List<Map<String, Object>>> resultGroup = SalaryEntityUtil.group2Map(resultMapList, map -> (map.get(ffgsqcItemId.toString()) == null ? " " : map.get(ffgsqcItemId.toString()).toString())
@ -340,6 +364,7 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
.salaryMonth(salaryMonthDate)
.znxmlx(valueMap.getOrDefault(znxmlxItemId.toString(), "").toString())
.subcompanyId(Long.valueOf(valueMap.getOrDefault("subcompanyId", "0").toString()))
.departmentId(Long.valueOf(valueMap.getOrDefault("departmentId", "0").toString()))
.ffgsqc(ffgsqc)
.fycdgsqc(fycdgsqc)
.znxmmc(znxmmc)
@ -481,6 +506,7 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
itemSum.put("idNo", CollectionUtils.isEmpty(value) ? "" : value.get(0).get("idNo"));
itemSum.put("employeeId", CollectionUtils.isEmpty(value) ? "" : value.get(0).get("employeeId"));
itemSum.put("subcompanyId", CollectionUtils.isEmpty(value) ? "" : value.get(0).get("subcompanyId") == null ? "0" : value.get(0).get("subcompanyId"));
itemSum.put("departmentId", CollectionUtils.isEmpty(value) ? "" : value.get(0).get("departmentId") == null ? "0" : value.get(0).get("departmentId"));
if (ffgsztItemId != null) {
Map<String, Object> map = value.get(0);
String rylb = map.get(ffgsztItemId.toString()) == null ? "" : map.get(ffgsztItemId.toString()).toString();
@ -527,8 +553,8 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
.filter(po -> canManageFrztByUid.contains(po.getFfgsqc()) || canManageSubCompanyIds.contains(po.getSubcompanyId()))
.collect(Collectors.toList());
}
if (CollectionUtils.isNotEmpty(param.getFycdgsqc())) {
lySalaryReportPOS = lySalaryReportPOS.stream().filter(lySalaryReportPO -> param.getFycdgsqc().contains(lySalaryReportPO.getFfgsqc())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
lySalaryReportPOS = lySalaryReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getFfgsqc())).collect(Collectors.toList());
}
// 费用承担公司
if (CollectionUtils.isNotEmpty(param.getFycdgsqc())) {
@ -611,17 +637,18 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
return resultList;
}
RecordSet rs = new RecordSet();
String sql = "select subcomid,ncbbckqxry from hrmsubcompanydefined where ncbbckqxry is not null and ncbbckqxry != ''";
String sql = "select subcomid,ncbbckqxry from hrmsubcompanydefined where ncbbckqxry is not null";
rs.executeQuery(sql);
while (rs.next()) {
String ncbbckqxryStr = rs.getString("ncbbckqxry");
List<Long> empIds = Arrays.stream(ncbbckqxryStr.split(","))
.filter(NumberUtils::isCreatable)
.map(Long::valueOf)
.collect(Collectors.toList());
if (empIds.contains(uid)) {
resultList.add(Long.valueOf(rs.getInt("subcomid")));
if (StringUtils.isNotBlank(ncbbckqxryStr)) {
List<Long> empIds = Arrays.stream(ncbbckqxryStr.split(","))
.filter(NumberUtils::isCreatable)
.map(Long::valueOf)
.collect(Collectors.toList());
if (empIds.contains(uid)) {
resultList.add(Long.valueOf(rs.getInt("subcomid")));
}
}
}
return resultList;
@ -719,8 +746,8 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
// 获取本月是否已有报表数据
List<LySalaryReportPO> lySalaryReportPOS = listBySalaryMonth(salaryMonthDate);
if (CollectionUtils.isNotEmpty(param.getFycdgsqc())) {
lySalaryReportPOS = lySalaryReportPOS.stream().filter(lySalaryReportPO -> param.getFycdgsqc().contains(lySalaryReportPO.getFfgsqc())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
lySalaryReportPOS = lySalaryReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getFfgsqc())).collect(Collectors.toList());
}
// 分权
@ -815,11 +842,42 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
.build();
}
private void deleteByIds(List<Long> salaryReportIds) {
@Override
public void deleteByIds(List<Long> salaryReportIds) {
if (CollectionUtils.isEmpty(salaryReportIds)) {
return;
}
getLySalaryReportMapper().deleteByIds(salaryReportIds);
List<List<Long>> partition = Lists.partition(salaryReportIds, 500);
partition.forEach(part -> {
getLySalaryReportMapper().deleteByIds(part);
});
}
@Override
public Map<String, String> getHszb(String ffgsqc) {
HashMap<String, String> resultMap = new HashMap<>();
if (StringUtils.isBlank(ffgsqc)) {
return resultMap;
}
List<LyFzhsInfo> frztFzhsList = getLyPZService(user).listFzhsByFrzt(Collections.singletonList(ffgsqc));
Map<String, LyFzhsInfo> frztFzhsInfoMap = SalaryEntityUtil.convert2Map(frztFzhsList, LyFzhsInfo::getFrzt);
// 默认核算账簿
LyFzhsInfo ffgsqcFrzt = frztFzhsInfoMap.get(ffgsqc);
String zbmc = "";
String zbbm = "";
if (ffgsqcFrzt != null) {
String nczbBm = ffgsqcFrzt.getNczb();
String sql = "select zbbm,zbmc from uf_nc_zbxx where zbbm = '" + nczbBm + "'";
RecordSet rs = new RecordSet();
rs.execute(sql);
if (rs.next()) {
zbmc = rs.getString("zbmc");
zbbm = rs.getString("zbbm");
}
}
resultMap.put("name", zbmc);
resultMap.put("id", zbbm);
return resultMap;
}
@Override
@ -885,7 +943,7 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
return Collections.emptyList();
}
RecordSet rs = new RecordSet();
rs.execute("select frzt,ncbbqxry from uf_frzt ");
rs.execute("select frzt,ncbbqxry from uf_frzt where sfqy =0 or sfqy is null");
HashMap<String, List<Long>> frztInfoMap = new HashMap<>();
while (rs.next()) {
String frzt = rs.getString("frzt");
@ -937,6 +995,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
param.setSalaryMonthDate(salaryMonthDate);
// 查询核算账套
List<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build();
// 获取核算记录
@ -1091,6 +1152,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
param.setSalaryMonthDate(salaryMonthDate);
// 查询核算账套
List<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build();
// 获取核算记录
@ -1213,6 +1277,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
param.setSalaryMonthDate(salaryMonthDate);
// 查询核算账套
List<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build();
// 获取核算记录
@ -1375,6 +1442,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
param.setSalaryMonthDate(salaryMonthDate);
// 查询核算账套
List<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build();
// 获取核算记录

View File

@ -170,13 +170,36 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
// 获取本月是否已有报表数据
List<LySocialReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
// 过滤出已推送成功的数据
List<String> canNotGenGmgsqcList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
throw new SalaryRunTimeException("本薪资所属月已生成社保汇总报表,无法生成社保汇总报表数据");
List<LySocialReportPO> canNotDeleteList = lySocialReportPOS.stream()
.filter(report -> (report.getSbjtpzFlag() != null && report.getSbjtpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getSbffpzFlag() != null && report.getSbffpzFlag().equals(NumberUtils.INTEGER_ONE)))
.collect(Collectors.toList());
// 获取不能生成的购买公司全称
canNotGenGmgsqcList = canNotDeleteList.stream().map(LySocialReportPO::getGmgsqc).distinct().collect(Collectors.toList());
// 删除其余未推送成功的报表数据
List<String> finalCanNotGenGmgsqcList = canNotGenGmgsqcList;
List<Long> needDeleteIds = lySocialReportPOS.stream().filter(po -> !finalCanNotGenGmgsqcList.contains(po.getGmgsqc()))
.map(LySocialReportPO::getId)
.collect(Collectors.toList());
deleteByIds(needDeleteIds);
}
// if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
// throw new SalaryRunTimeException("本薪资所属月已生成社保汇总报表,无法生成社保汇总报表数据");
// }
// 获取建模中社保数据
List<UfSbInfo> sbInfoList = listUfSbInfoBySalaryMonth(salaryMonthDate);
if (CollectionUtils.isNotEmpty(sbInfoList)) {
// 获取所有法人主体信息
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
// 过滤购买公司
List<String> finalCanNotGenGmgsqcList1 = canNotGenGmgsqcList;
sbInfoList = sbInfoList.stream().filter(sbInfo -> !finalCanNotGenGmgsqcList1.contains(frztMap.get(sbInfo.getGmgsqc()))).collect(Collectors.toList());
Map<String, List<UfSbInfo>> resultGroup = SalaryEntityUtil.group2Map(sbInfoList, sbInfo -> Util.null2String(sbInfo.getGmgsqc())
+ "-split" + Util.null2String(sbInfo.getSbcdgsmc())
+ "-split" + Util.null2String(sbInfo.getZnxmmc()));
@ -184,8 +207,6 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
LinkedHashMap<String, List<UfSbInfo>> sortedMap = new LinkedHashMap<>();
resultGroup.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
// 获取所有法人主体信息
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
Date now = new Date();
sortedMap.forEach((key, valueList) -> {
String[] split = key.split("-split");
@ -193,11 +214,13 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
String fycdgsqc = split.length > 1 ? split[1] : "";
String znxmmc = split.length > 2 ? split[2] : "";
Long subcompanyId = CollectionUtils.isEmpty(valueList) ? 0L : valueList.get(0).getFb() == null ? 0L : Long.valueOf(valueList.get(0).getFb());
Long departmentId = CollectionUtils.isEmpty(valueList) ? 0L : valueList.get(0).getBm() == null ? 0L : Long.valueOf(valueList.get(0).getBm());
String znxmlxStr = CollectionUtils.isEmpty(valueList) ? "" : valueList.get(0).getZnxmlb() == null ? "" : valueList.get(0).getZnxmlb();
LySocialReportPO build = LySocialReportPO.builder()
.id(IdGenerator.generate())
.subcompanyId(subcompanyId)
.departmentId(departmentId)
.ftempNum(CollectionUtils.isEmpty(valueList) ? 0 : valueList.size())
.salaryMonth(salaryMonthDate)
.znxmlx(znxmlxStr)
@ -917,7 +940,10 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
if (CollectionUtils.isEmpty(ids)) {
return;
}
getLySocialReportMapper().deleteByIds(ids);
List<List<Long>> partition = Lists.partition(ids, 500);
partition.forEach(part -> {
getLySocialReportMapper().deleteByIds(part);
});
}
@Override

View File

@ -191,6 +191,7 @@ public class PushServiceImpl extends Service implements PushService {
.fieldName(po.getFieldName())
.fieldType(PushItemFieldEnum.parseByValue(po.getFieldType()))
.fieldTypeName(PushItemFieldEnum.parseByValue(po.getFieldType()).getDefaultLabel())
.sortedIndex(po.getSortedIndex())
.build()
).collect(Collectors.toList());
@ -212,6 +213,7 @@ public class PushServiceImpl extends Service implements PushService {
.source(param.getSource())
.fieldName(param.getFieldName())
.fieldType(param.getFieldType().getValue())
.sortedIndex(param.getSortedIndex())
.creator((long) user.getUID())
.createTime(now)
.updateTime(now)
@ -232,6 +234,7 @@ public class PushServiceImpl extends Service implements PushService {
po.setSource(param.getSource());
po.setFieldName(param.getFieldName());
po.setFieldType(param.getFieldType().getValue());
po.setSortedIndex(param.getSortedIndex());
po.setUpdateTime(now);
getPushSettingItemMapper().update(po);
@ -246,120 +249,6 @@ public class PushServiceImpl extends Service implements PushService {
getPushSettingItemMapper().delete(PushSettingItemPO.builder().id(id).build());
}
@Override
public void pushOneRecord(Long salaryAcctRecordId) {
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
if (salaryAcctRecordPO == null) {
throw new SalaryRunTimeException("核算记录不存在!");
}
//查询核算人员
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
//薪资项目
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
//查询薪资核算记录的薪资周期考勤周期等
SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordPO.getId());
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
.setSalaryAcctRecordPO(salaryAcctRecordPO)
.setSalarySobPO(new SalarySobPO())
.setSalarySobCycleDTO(salarySobCycleDTO)
.setOtherSalaryAcctRecordPOS(new ArrayList<>())
.setSalarySobItemPOS(new ArrayList<>())
.setSalaryItemIdWithPriorityList(new ArrayList<>())
.setExpressFormulas(new ArrayList<>())
.setSalaryItemPOS(salaryItemPOS)
.setSalarySobAdjustRulePOS(new ArrayList<>())
.setWelfareColumns(new HashMap<>())
.setAttendQuoteFieldListDTOS(new ArrayList<>())
.setSalaryAcctEmployeePOS(salaryAcctEmployeePOS)
.setIssuedFieldIds(new HashSet<>())
.setChildMonitor(null)
.setResults(null)
.setCalculateKey(null)
.setVariableItems(new ArrayList<>())
.setTaxDeclarationFunction(TaxDeclarationFunctionEnum.OPEN);
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>(),new ArrayList<>());
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
pushSettingPOS.stream()
.filter(po -> po.getSalarySobIds().contains(salaryAcctRecordPO.getSalarySobId()))
.forEach(setting -> {
Long id = setting.getId();
List<PushSettingItemPO> pushSettingItemPOS = getPushSettingItemMapper().listSome(PushSettingItemPO.builder().settingId(id).build());
//每个人插入一条
for (SalaryAcctEmployeePO emp : salaryAcctEmployeePOS) {
//1 获取当前薪资核算人员的公式中的变量的值
List<CalculateFormulaVarBO.FormulaVarValue> formulaVarValues = formulaVarMap.get(emp.getEmployeeId() + "_" + emp.getTaxAgentId());
//2 人员信息
List<CalculateFormulaVarBO.FormulaVarValue> empInfo = formulaVarMap.get(emp.getEmployeeId() + "");
formulaVarValues.addAll(empInfo);
Map<String, String> formulaVarValueMap = SalaryEntityUtil.convert2Map(formulaVarValues, CalculateFormulaVarBO.FormulaVarValue::getFieldId, CalculateFormulaVarBO.FormulaVarValue::getFieldValue);
Integer modeId = setting.getModeId();
List<String> fields = new ArrayList<String>() {{
add("formmodeid");
add("modedatacreater");
add("modedatacreatertype");
add("modedatacreatedate");
add("modedatacreatetime");
}};
String currDate = TimeUtil.getCurrentDateString();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String currTime = sdf.format(new Date());
List<Object> values = new ArrayList<Object>() {{
add(modeId);
add(1);
add(0);
add(String.format("'%s'", currDate));
add(String.format("'%s'", currTime));
}};
for (PushSettingItemPO item : pushSettingItemPOS) {
//数据库字段
String fieldName = item.getFieldName();
fields.add(fieldName);
// 公式变量的值
String field = item.getItem();
String value = formulaVarValueMap.getOrDefault(field, StringUtils.EMPTY);
PushItemFieldEnum pushItemFieldEnum = PushItemFieldEnum.parseByValue(item.getFieldType());
values.add(pushItemFieldEnum.convertValue(value));
}
String tableName = setting.getTableName();
String sql = String.format("insert into %s (%s) values (%s)", tableName, String.join(",", fields), values.stream().map(Object::toString).collect(Collectors.joining(",")));
RecordSet rs = new RecordSet();
rs.execute(sql);
if (modeId != null) {
rs.executeQuery("select max(id) from " + tableName);
int mainId = 0;
if (rs.next()) {
mainId = rs.getInt(1);
}
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, modeId, mainId);
}
}
});
}
@Override
public void createPushRecord(Long salaryAcctRecordId) {
Date now = new Date();
@ -371,7 +260,7 @@ public class PushServiceImpl extends Service implements PushService {
//查询推送配置
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
if(CollUtil.isEmpty(pushSettingPOS)){
if (CollUtil.isEmpty(pushSettingPOS)) {
return;
}
@ -489,7 +378,7 @@ public class PushServiceImpl extends Service implements PushService {
.acctEmpId(emp.getId())
.recordId(record.getId())
.status(PushRecordDetailStatusEnum.PREPARE.getValue())
.execute(sql)
.formula(sql)
.createTime(now)
.updateTime(now)
.creator((long) user.getUID())
@ -506,40 +395,43 @@ public class PushServiceImpl extends Service implements PushService {
}
);
} catch (Exception e) {
log.error("推送失败", e);
log.error("创建推送记录失败", e);
removeRecords(recordIds);
throw new SalaryRunTimeException("推送失败");
throw new SalaryRunTimeException("创建推送记录失败");
}
//开始
startBatchPush(recordIds);
recordIds.forEach(this::push);
}
/**
* 启动推送
*
* @param recordIds
*/
private void startBatchPush(List<Long> recordIds) {
@Override
public void withdrawPushRecord(Long salaryAcctRecordId) {
List<PushRecordPO> pushRecordPOS = getPushRecordMapper().listSome(PushRecordPO.builder().acctRecordId(salaryAcctRecordId).status(PushRecordStatusEnum.RUN_SUCCESS.getValue()).build());
if (CollUtil.isEmpty(pushRecordPOS)) {
return;
}
pushRecordPOS.stream().map(PushRecordPO::getId).forEach(this::withdraw);
}
recordIds.forEach(recordId -> {
//待推送
PushRecordPO pushRecordPO = getPushRecordMapper().getById(recordId);
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_WAITING.getValue());
@Override
public void push(Long id) {
//待推送
PushRecordPO pushRecordPO = getPushRecordMapper().getById(id);
try {
pushRecordPO.setStartTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_PROGRESS.getValue());
getPushRecordMapper().updateIgnoreNull(pushRecordPO);
try {
pushRecordPO.setStartTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_PROGRESS.getValue());
getPushRecordMapper().updateIgnoreNull(pushRecordPO);
List<PushRecordDetailPO> pushRecordDetailPOS = getPushRecordDetailMapper().listSome(PushRecordDetailPO.builder().recordId(pushRecordPO.getId()).build());
pushRecordDetailPOS.forEach(pushRecordDetailPO -> {
List<PushRecordDetailPO> pushRecordDetailPOS = getPushRecordDetailMapper().listSome(PushRecordDetailPO.builder().recordId(pushRecordPO.getId()).build());
pushRecordDetailPOS.forEach(pushRecordDetailPO -> {
try {
String execute = pushRecordDetailPO.getExecute();
RecordSet rs = new RecordSet();
rs.execute(execute);
try {
String formula = pushRecordDetailPO.getFormula();
RecordSet rs = new RecordSet();
boolean success = rs.execute(formula);
if (success) {
//建模需要权限重构
Integer modeId = pushRecordPO.getModeId();
if (modeId != null) {
@ -552,23 +444,70 @@ public class PushServiceImpl extends Service implements PushService {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, modeId, mainId);
}
//记录数据id
pushRecordDetailPO.setDataId((long) mainId);
}
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.SUCCESS.getValue());
} catch (Exception e) {
pushRecordDetailPO.setFail_reason(e.getMessage());
} else {
pushRecordDetailPO.setFailReason("sql执行失败");
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.FAIL.getValue());
}
});
} catch (Exception e) {
pushRecordDetailPO.setFailReason(e.getMessage());
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.FAIL.getValue());
}
getPushRecordDetailMapper().updateIgnoreNull(pushRecordDetailPO);
});
pushRecordPO.setEndTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_SUCCESS.getValue());
} catch (Exception e) {
pushRecordPO.setFail_reason(e.getMessage());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_FAIL.getValue());
}
pushRecordPO.setEndTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_SUCCESS.getValue());
} catch (Exception e) {
pushRecordPO.setFailReason(e.getMessage());
pushRecordPO.setStatus(PushRecordStatusEnum.RUN_FAIL.getValue());
}
getPushRecordMapper().updateIgnoreNull(pushRecordPO);
}
@Override
public void withdraw(Long id) {
//待撤回
PushRecordPO pushRecordPO = getPushRecordMapper().getById(id);
try {
pushRecordPO.setStartTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.WITHDRAW.getValue());
getPushRecordMapper().updateIgnoreNull(pushRecordPO);
});
PushSettingPO pushSettingPO = getPushSettingMapper().getById(pushRecordPO.getSettingId());
String tableName = pushSettingPO.getTableName();
List<PushRecordDetailPO> pushRecordDetailPOS = getPushRecordDetailMapper().listSome(PushRecordDetailPO.builder().recordId(pushRecordPO.getId()).build());
pushRecordDetailPOS.forEach(pushRecordDetailPO -> {
try {
RecordSet rs = new RecordSet();
String sql = String.format("delete from %s where id = %s", tableName, pushRecordDetailPO.getDataId());
boolean execute = rs.execute(sql);
if (execute) {
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.WITHDRAW_SUCCESS.getValue());
} else {
pushRecordDetailPO.setFailReason("sql执行失败");
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.WITHDRAW_FAIL.getValue());
}
} catch (Exception e) {
pushRecordDetailPO.setFailReason(e.getMessage());
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.WITHDRAW_FAIL.getValue());
}
getPushRecordDetailMapper().updateIgnoreNull(pushRecordDetailPO);
});
pushRecordPO.setEndTime(new Date());
pushRecordPO.setStatus(PushRecordStatusEnum.WITHDRAW_SUCCESS.getValue());
} catch (Exception e) {
pushRecordPO.setFailReason(e.getMessage());
pushRecordPO.setStatus(PushRecordStatusEnum.WITHDRAW_FAIL.getValue());
}
getPushRecordMapper().updateIgnoreNull(pushRecordPO);
}
@ -598,6 +537,7 @@ public class PushServiceImpl extends Service implements PushService {
.acctRecordId(po.getAcctRecordId())
.type(po.getType())
.status(po.getStatus())
.statusName(PushRecordStatusEnum.parseByValue(po.getStatus()).getDefaultLabel())
.startTime(po.getStartTime())
.endTime(po.getEndTime())
.build())
@ -612,22 +552,13 @@ public class PushServiceImpl extends Service implements PushService {
public PageInfo<PushRecordDetailDTO> recordDetailList(RecordDetailListQueryParam param) {
ValidUtil.doValidator(param);
List<PushRecordDetailPO> pushRecordDetailPOS = getPushRecordDetailMapper().listSome(PushRecordDetailPO.builder().recordId(param.getRecordId()).build());
List<PushRecordDetailDTO> listDTOS = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), pushRecordDetailPOS)
.stream()
.map(po -> PushRecordDetailDTO.builder()
.id(po.getId())
.recordId(po.getRecordId())
.acctEmpId(po.getAcctEmpId())
.status(po.getStatus())
.fail_reason(po.getFail_reason())
.execute(po.getExecute())
.createTime(po.getCreateTime())
.creator(po.getCreator())
.build())
.collect(Collectors.toList());
PageInfo<PushRecordDetailDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PushRecordDetailDTO.class);
pageInfo.setTotal(pushRecordDetailPOS.size());
List<PushRecordDetailDTO> list = getPushRecordDetailMapper().listDTO(PushRecordDetailDTO.builder().recordId(param.getRecordId()).build());
List<PushRecordDetailDTO> listDTOS = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), list);
listDTOS.forEach(dto -> dto.setStatusName(PushRecordDetailStatusEnum.parseByValue(dto.getStatus()).getDefaultLabel()));
PageInfo<PushRecordDetailDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), PushRecordDetailDTO.class);
pageInfo.setList(listDTOS);
pageInfo.setTotal(list.size());
return pageInfo;
}
}

View File

@ -16,8 +16,8 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.entity.salarysob.param.SalarySobQueryParam;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
@ -31,7 +31,6 @@ import com.engine.salary.mapper.salarysob.SobTaxLinkMapper;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
import com.engine.salary.service.*;
import com.engine.salary.sys.constant.SalarySysConstant;
import com.engine.salary.service.auth.AuthService;
import com.engine.salary.service.auth.AuthServiceImpl;
import com.engine.salary.sys.constant.SalarySysConstant;
@ -50,7 +49,9 @@ import com.google.common.collect.Sets;
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.beans.BeanUtils;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import java.util.*;
@ -148,8 +149,14 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
}
@Override
public List<SalaryAcctEmployeePO> listByIds(Collection<Long> ids) {
return getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().ids(ids).build());
public List<SalaryAcctEmployeePO> listByIds(List<Long> ids) {
List<List<Long>> partition = Lists.partition(ids, 300);
List<SalaryAcctEmployeePO> resultList = new ArrayList<>();
partition.forEach(part -> {
resultList.addAll(getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().ids(part).build()));
});
return resultList;
}
@Override
@ -439,8 +446,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
// 查询薪资档案
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), saveParam.getEmployeeIds(), taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap((List) saveParam.getEmployeeIds());
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤不是扣缴义务人下的人员
@ -484,18 +494,44 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
List<Long> employees = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
List<DataCollectionEmployee> snapshot = getSalaryEmployeeService(user).snapshot(employees, shotTime);
Map<Long, DataCollectionEmployee> shotEmpMap = SalaryEntityUtil.convert2Map(snapshot, DataCollectionEmployee::getEmployeeId);
RecordSet rs = new RecordSet();
salaryAcctEmployeePOS.forEach(salaryAcctEmployeePO -> {
DataCollectionEmployee shotEmp = shotEmpMap.getOrDefault(salaryAcctEmployeePO.getEmployeeId(), new DataCollectionEmployee());
salaryAcctEmployeePO.setDepartmentId(shotEmp.getDepartmentId());
salaryAcctEmployeePO.setDepartmentName(shotEmp.getDepartmentName());
salaryAcctEmployeePO.setJobcall(shotEmp.getJobcall());
salaryAcctEmployeePO.setJobcallId(shotEmp.getJobcallId());
salaryAcctEmployeePO.setJobtitleId(shotEmp.getJobtitleId());
salaryAcctEmployeePO.setJobtitleName(shotEmp.getJobtitleName());
// salaryAcctEmployeePO.setJobtitleId(shotEmp.getJobtitleId());
// salaryAcctEmployeePO.setJobtitleName(shotEmp.getJobtitleName());
// 领悦 - 取自定义的岗位信息
Long jobtitleId = NumberUtils.isCreatable(shotEmp.getField128()) ? Long.valueOf(shotEmp.getField128()) : null;
salaryAcctEmployeePO.setJobtitleId(jobtitleId);
rs.executeQuery("select gwmc from uf_xcbz where id= ?", new Object[]{jobtitleId});
if (rs.next()) {
salaryAcctEmployeePO.setJobtitleName(rs.getString("gwmc"));
} else {
salaryAcctEmployeePO.setJobtitleName("");
}
salaryAcctEmployeePO.setSubcompanyId(shotEmp.getSubcompanyid());
salaryAcctEmployeePO.setSubcompanyName(shotEmp.getSubcompanyName());
salaryAcctEmployeePO.setStatus(shotEmp.getStatus());
salaryAcctEmployeePO.setAccountType(shotEmp.getAccountType());
salaryAcctEmployeePO.setField136(shotEmp.getField136());
salaryAcctEmployeePO.setField137(shotEmp.getField137());
salaryAcctEmployeePO.setField128(shotEmp.getField128());
salaryAcctEmployeePO.setField1(shotEmp.getField1());
salaryAcctEmployeePO.setField7(shotEmp.getField7());
salaryAcctEmployeePO.setField121(shotEmp.getField121());
salaryAcctEmployeePO.setField152(shotEmp.getField152());
salaryAcctEmployeePO.setField124(shotEmp.getField124());
salaryAcctEmployeePO.setField141(shotEmp.getField141());
salaryAcctEmployeePO.setField142(shotEmp.getField142());
salaryAcctEmployeePO.setField125(shotEmp.getField125());
salaryAcctEmployeePO.setField31(shotEmp.getField31());
salaryAcctEmployeePO.setField46(shotEmp.getField46());
salaryAcctEmployeePO.setField145(shotEmp.getField145());
});
}
@ -504,7 +540,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
return;
}
List<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 50);
List<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 20);
partition.forEach(getSalaryAcctEmployeeMapper()::batchInsert);
}
@ -601,8 +637,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
// 查询薪资档案获取人员的个税扣缴义务人
List<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤掉不属于当前账套扣缴义务人的人员
salaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList());
@ -637,8 +675,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
// 查询薪资档案获取人员的个税扣缴义务人
List<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤掉不属于当前账套扣缴义务人的人员
newEmps = newEmps.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList());
Map<String, SalaryAcctEmployeePO> newEmpMap = SalaryEntityUtil.convert2Map(newEmps, e -> e.getTaxAgentId() + "_" + e.getEmployeeId());
@ -833,7 +873,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
@Override
public void lockEmp(SalaryAcctResultUpdateLockStatusParam updateParam) {
List<SalaryAcctEmployeePO> salaryAcctEmployees = listByIds(updateParam.getAcctEmpIds());
List<SalaryAcctEmployeePO> salaryAcctEmployees = listByIds(updateParam.getAcctEmpIds().stream().collect(Collectors.toList()));
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
return;
}

View File

@ -543,7 +543,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
getSalaryStatisticsReportService(user).removeReportCache();
//获取推送配置
//开始推送数据
getPushService(user).createPushRecord(salaryAcctRecordId);
@ -570,6 +570,9 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
// 重新核算
reCalcOrBackCalc(salaryAcctRecordPO, true);
//开始推送数据
getPushService(user).withdrawPushRecord(salaryAcctRecordId);
// // 查询税款所在年的该个税扣缴义务人所有薪资核算记录
// // 获取账套所属个税扣缴义务人的核算记录

View File

@ -14,7 +14,6 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
import com.engine.salary.entity.datacollection.po.VariableItemPO;
import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.hrm.JobCallInfo;
import com.engine.salary.entity.hrm.PositionInfo;
import com.engine.salary.entity.hrm.SubCompanyInfo;
import com.engine.salary.entity.progress.ProgressDTO;
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
@ -63,6 +62,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.util.StopWatch;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.hrm.User;
@ -603,6 +603,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除"));
}
// 更新员工基本信息值
RecordSet rs = new RecordSet();
saveParam.getEmployeeInfos().stream().forEach(info -> {
if (info.getFieldValue() != null && StringUtils.isNotBlank(info.getFieldValue().toString())) {
if (info.getFieldCode().equals("departmentName") || info.getFieldCode().equals("departmentId")) {
@ -622,13 +623,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
salaryAcctEmployeePO.setSubcompanyId(subCompanyInfo.getId());
}
} else if (info.getFieldCode().equals("jobtitleName") || info.getFieldCode().equals("jobtitleId")) {
// 修改岗位信息
PositionInfo positionInfo = getSalaryEmployeeService(user).getPositionInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
? Long.valueOf(info.getFieldValue().toString()) : 0L);
if (Objects.nonNull(positionInfo)) {
salaryAcctEmployeePO.setJobtitleName(positionInfo.getName());
salaryAcctEmployeePO.setJobtitleId(positionInfo.getId());
if (info.getFieldValue() != null && StringUtils.isNotBlank(info.getFieldValue().toString())) {
// 领悦 - 取自定义的岗位信息
rs.executeQuery("select gwmc from uf_xcbz where id= ?", new Object[]{info.getFieldValue()});
if (rs.next()) {
salaryAcctEmployeePO.setJobtitleName(rs.getString("gwmc"));
salaryAcctEmployeePO.setJobtitleId(NumberUtils.isCreatable(info.getFieldValue().toString()) ? Long.valueOf(info.getFieldValue().toString()) : 0L);
}
}
// salaryAcctEmployeePO.setJobtitleName(positionInfo.getName());
// salaryAcctEmployeePO.setJobtitleId(positionInfo.getId());
// 修改岗位信息
// PositionInfo positionInfo = getSalaryEmployeeService(user).getPositionInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
// ? Long.valueOf(info.getFieldValue().toString()) : 0L);
} else if (info.getFieldCode().equals("jobcall") || info.getFieldCode().equals("jobcallId")) {
// 修改职称信息
JobCallInfo jobCallInfo = getSalaryEmployeeService(user).getJobCallInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
@ -835,7 +842,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
if (CollectionUtils.isEmpty(calculateParam.getIds())) {
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
} else {
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByIds(calculateParam.getIds());
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByIds(calculateParam.getIds().stream().collect(Collectors.toList()));
}
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "薪资核算人员不能为空"));

View File

@ -681,6 +681,20 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
.idNo(hrmSnapshotPO.getCertificatenum())
.accountTypeName(AccountTypeEnum.getDefaultLabelByValue(hrmSnapshotPO.getAccounttype()))
.accountType(hrmSnapshotPO.getAccounttype())
.field136(hrmSnapshotPO.getField136())
.field137(hrmSnapshotPO.getField137())
.field128(hrmSnapshotPO.getField128())
.field1(hrmSnapshotPO.getField1())
.field7(hrmSnapshotPO.getField7())
.field121(hrmSnapshotPO.getField121())
.field152(hrmSnapshotPO.getField152())
.field124(hrmSnapshotPO.getField124())
.field141(hrmSnapshotPO.getField141())
.field142(hrmSnapshotPO.getField142())
.field125(hrmSnapshotPO.getField125())
.field31(hrmSnapshotPO.getField31())
.field46(hrmSnapshotPO.getField46())
.field145(hrmSnapshotPO.getField145())
.build())
.orElse(currentEmployeeMap.get(employeeId));
}).collect(Collectors.toList());
@ -700,4 +714,30 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
}
return getEmployMapper().listFzhsInfoByDeptIds(departmentIds);
}
@Override
public Map<Long, Map<String, String>> listUfJobtitleMap(List<Long> employeeIds) {
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyMap();
}
RecordSet rs = new RecordSet();
List<List<Long>> partition = Lists.partition(employeeIds, 500);
Map<Long, Map<String, String>> resultMap = new HashMap<Long, Map<String, String>>();
partition.forEach(part -> {
String empIdStr = StringUtils.join(part, ",");
String sql = "select a.id,a.field128,b.gwmc FROM cus_fielddata a left join uf_xcbz b on a.field128 = b.id where a.SCOPEID = -1 and a.id in (" +empIdStr + ")";
rs.execute(sql);
while (rs.next()) {
Long id = Long.valueOf(rs.getInt("id"));
String jobtitleId = Util.null2String(rs.getString("field128"));
String gwmc = Util.null2String(rs.getString("gwmc"));
Map<String, String> jobtitleInfoMap = new HashMap<>();
jobtitleInfoMap.put("jobtitleId", jobtitleId);
jobtitleInfoMap.put("jobtitleName", gwmc);
resultMap.put(id, jobtitleInfoMap);
}
});
return resultMap;
}
}

View File

@ -205,7 +205,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
}
// 查询薪资所属月的薪资核算记录
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).taxAgentId(taxAgentId).build());
// 无薪资核算记录不允许生成个税申报表
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import com.engine.salary.entity.hrm.po.HrmSnapshotPO;
import com.engine.salary.mapper.hrm.HrmSnapshotMapper;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import lombok.extern.slf4j.Slf4j;
@ -13,6 +14,7 @@ import weaver.interfaces.schedule.BaseCronJob;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Slf4j
public class HrmSnapshotJob extends BaseCronJob {
@ -32,6 +34,12 @@ public class HrmSnapshotJob extends BaseCronJob {
try {
List<HrmSnapshotPO> hrmSnapshotPOS = getHrmSnapshotMapper().currentEmpData();
// 查询基本信息
List<HrmSnapshotPO> hrmSnapshotBasePOS = getHrmSnapshotMapper().currentEmpBaseData();
Map<Long, HrmSnapshotPO> baseMap = SalaryEntityUtil.convert2Map(hrmSnapshotBasePOS, HrmSnapshotPO::getEmployeeId);
// 查询工作信息
List<HrmSnapshotPO> hrmSnapshotWorkPOS = getHrmSnapshotMapper().currentEmpWorkData();
Map<Long, HrmSnapshotPO> workMap = SalaryEntityUtil.convert2Map(hrmSnapshotWorkPOS, HrmSnapshotPO::getEmployeeId);
Date snapshotTime = StrUtil.isNotBlank(appointSnapshotTime) && SalaryDateUtil.checkDay(appointSnapshotTime) ? SalaryDateUtil.dateStrToLocalDate(appointSnapshotTime) : SalaryDateUtil.localDateToDate(LocalDate.now());
@ -39,7 +47,26 @@ public class HrmSnapshotJob extends BaseCronJob {
getHrmSnapshotMapper().deleteBySnapshotTime(snapshotTime);
hrmSnapshotPOS.forEach(hrmSnapshotPO -> {
HrmSnapshotPO baseInfo = baseMap.get(hrmSnapshotPO.getEmployeeId());
if (baseInfo != null) {
hrmSnapshotPO.setField136(baseInfo.getField136());
hrmSnapshotPO.setField137(baseInfo.getField137());
hrmSnapshotPO.setField128(baseInfo.getField128());
hrmSnapshotPO.setField1(baseInfo.getField1());
hrmSnapshotPO.setField7(baseInfo.getField7());
}
HrmSnapshotPO workInfo = workMap.get(hrmSnapshotPO.getEmployeeId());
if (workInfo != null) {
hrmSnapshotPO.setField121(workInfo.getField121());
hrmSnapshotPO.setField152(workInfo.getField152());
hrmSnapshotPO.setField124(workInfo.getField124());
hrmSnapshotPO.setField141(workInfo.getField141());
hrmSnapshotPO.setField142(workInfo.getField142());
hrmSnapshotPO.setField125(workInfo.getField125());
hrmSnapshotPO.setField31(workInfo.getField31());
hrmSnapshotPO.setField46(workInfo.getField46());
hrmSnapshotPO.setField145(workInfo.getField145());
}
hrmSnapshotPO.setId(IdGenerator.generate());
hrmSnapshotPO.setSnapshotTime(snapshotTime);

View File

@ -457,6 +457,15 @@ public class LySalaryController {
return new ResponseResult<LyPZGenParam, Map<String, Object>>(user).run(getLySalaryWrapper(user)::genPZ, param);
}
@POST
@Path("/PZ/getHszb")
@Produces(MediaType.APPLICATION_JSON)
public String getHszb(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LyPZGenParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<LyPZGenParam, Map<String, String>>(user).run(getLySalaryWrapper(user)::getHszb, param);
}
// 推送UC并本地保存
@POST
@Path("/PZ/pushUCAndSave")

View File

@ -92,14 +92,6 @@ public class PushController {
return new ResponseResult<Long, String>(user).run(getPushWrapper(user)::deleteItem, id);
}
@POST
@Path("/push")
@Produces(MediaType.APPLICATION_JSON)
public String push(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PushParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<PushParam, String>(user).run(getPushWrapper(user)::push, param);
}
@POST
@Path("/record/list")
@Produces(MediaType.APPLICATION_JSON)
@ -115,4 +107,20 @@ public class PushController {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<RecordDetailListQueryParam, PageInfo<PushRecordDetailDTO>>(user).run(getPushWrapper(user)::recordDetailList, param);
}
@POST
@Path("/record/create")
@Produces(MediaType.APPLICATION_JSON)
public String createPushRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CreatePushParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<CreatePushParam, String>(user).run(getPushWrapper(user)::createPushRecord, param);
}
@POST
@Path("/record/push")
@Produces(MediaType.APPLICATION_JSON)
public String push(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PushParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<PushParam, String>(user).run(getPushWrapper(user)::push, param);
}
}

View File

@ -126,6 +126,14 @@ public class TaxAgentController {
return new ResponseResult<TaxAgentQueryParam, List<TaxAgentPO>>(user).run(getTaxAgentWrapper(user)::listAuth, queryParam);
}
@POST
@Path("/listAll")
@Produces(MediaType.APPLICATION_JSON)
public String selectAllList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, List<TaxAgentPO>>(user).run(getTaxAgentWrapper(user)::selectAllList);
}
//查询个税扣缴义务人下面的代缴机构")
@GET
@Path("/paymentAgency/list")

View File

@ -343,4 +343,8 @@ public class LySalaryWrapper extends Service {
public void generateCymxGjjReport(String salaryMonth) {
getLySalaryReportService(user).generateCymxGjjReport(salaryMonth);
}
public Map<String, String> getHszb(LyPZGenParam param) {
return getLySalaryReportService(user).getHszb(param.getFfgsqc());
}
}

View File

@ -35,6 +35,7 @@ public class PushWrapper extends Service {
return execute;
}
public PageInfo<PushSettingDTO> settingList(PushSettingQueryParam param) {
return getPushService(user).settingList(param);
}
@ -60,14 +61,20 @@ public class PushWrapper extends Service {
getPushService(user).deleteItem(id);
}
public void push(PushParam pushParam) {
// getPushService(user).pushOneRecord(pushParam.getSalaryAcctRecordId());
getPushService(user).createPushRecord(pushParam.getSalaryAcctRecordId());
public void createPushRecord(CreatePushParam param) {
param.getSalaryAcctRecordIds().forEach(id -> {
getPushService(user).createPushRecord(id);
});
}
public PageInfo<PushRecordDTO> recordList(RecordListQueryParam param) {
public void push(PushParam pushParam) {
getPushService(user).push(pushParam.getId());
}
return getPushService(user).recordList(param);
public PageInfo<PushRecordDTO> recordList(RecordListQueryParam param) {
return getPushService(user).recordList(param);
}
public PageInfo<PushRecordDetailDTO> recordDetailList(RecordDetailListQueryParam param) {

View File

@ -364,11 +364,17 @@ public class SalaryArchiveWrapper extends Service {
SalaryArchiveBaseInfoFormDTO build = SalaryArchiveBaseInfoFormDTO.builder()
.username(employee.getUsername())
.department(employee.getDepartmentName())
.position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName())
// .position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName())
.hiredate(employee.getCompanystartdate())
.mobile(employee.getMobile())
.taxAgent(taxAgent.getName())
.build();
// 获取领悦自定义岗位
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(Collections.singletonList(po.getEmployeeId()));
Map<String, String> jobtitleMap = ufJobtitleMap.get(po.getEmployeeId());
if (jobtitleMap != null && jobtitleMap.get("jobtitleName") != null) {
build.setPosition(jobtitleMap.get("jobtitleName"));
}
baseInfo.put("employee", build);
List<Map<String, Object>> salaryItems = Lists.newArrayList();

View File

@ -151,6 +151,10 @@ public class TaxAgentWrapper extends Service {
return getTaxAgentService(user).listAuth(taxAgentQueryParam);
}
public List<TaxAgentPO> selectAllList() {
return getTaxAgentService(user).listAll();
}
public List<Map<String, Object>> paymentAgencyList(TaxAgentQueryParam queryParam) {
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(queryParam.getIds());
// List<PaymentAgencyPO> paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);