Merge branch 'custom/领悦' into custom/领悦业务线
# Conflicts: # src/com/engine/salary/constant/SalaryDefaultTenantConstant.java # src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java # src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java # src/com/engine/salary/service/VariableArchiveService.java # src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java
This commit is contained in:
commit
b99ce85dd9
|
|
@ -1,5 +1,5 @@
|
|||
log=false
|
||||
defaultCloseNonStandard149=true
|
||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||
version=2.15.2.2409.01
|
||||
version=2.16.1.2410.01
|
||||
openFormulaForcedEditing=false
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD (
|
||||
type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id number primary key ,
|
||||
setting clob ,
|
||||
page varchar2(200),
|
||||
creator number,
|
||||
create_time date ,
|
||||
update_time date,
|
||||
delete_type int ,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar2(4000) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD (
|
||||
type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id number primary key ,
|
||||
setting clob ,
|
||||
page varchar2(200),
|
||||
creator number,
|
||||
create_time date ,
|
||||
update_time date,
|
||||
delete_type int ,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar2(4000) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD (
|
||||
type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id number primary key ,
|
||||
setting clob ,
|
||||
page varchar2(200),
|
||||
creator number,
|
||||
create_time date ,
|
||||
update_time date,
|
||||
delete_type int ,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar2(4000) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD COLUMN type int(0) NULL ;
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
CREATE TABLE hrsa_page_list_setting
|
||||
(
|
||||
id bigint(0) NOT NULL ,
|
||||
setting text ,
|
||||
page varchar(200),
|
||||
creator bigint(0),
|
||||
create_time datetime(0) ,
|
||||
update_time datetime(0),
|
||||
delete_type int(0) ,
|
||||
tenant_key varchar(10) ,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp ADD COLUMN lock_items varchar(4000);
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD (
|
||||
type number NULL
|
||||
)
|
||||
/
|
||||
|
||||
update hrsa_acct_result_template set type = 0
|
||||
/
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id number primary key ,
|
||||
setting clob ,
|
||||
page varchar2(200),
|
||||
creator number,
|
||||
create_time date ,
|
||||
update_time date,
|
||||
delete_type int ,
|
||||
tenant_key varchar2(10)
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar2(4000) NULL
|
||||
/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_acct_result_template add type int null ;
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id bigint primary key ,
|
||||
setting text ,
|
||||
page varchar(200),
|
||||
creator bigint,
|
||||
create_time timestamp ,
|
||||
update_time timestamp,
|
||||
delete_type int ,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
|
|
@ -0,0 +1 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar(4000);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD type int NULL
|
||||
GO
|
||||
|
||||
update hrsa_acct_result_template set type = 0
|
||||
GO
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id bigint primary key ,
|
||||
setting ntext ,
|
||||
page varchar(200),
|
||||
creator bigint,
|
||||
create_time datetime ,
|
||||
update_time datetime,
|
||||
delete_type int ,
|
||||
tenant_key varchar(10)
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp ADD lock_items varchar(4000)
|
||||
GO
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_acct_result_template ADD (
|
||||
type number NULL
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_acct_result_template set type = 0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_page_list_setting
|
||||
(
|
||||
id number primary key ,
|
||||
setting clob ,
|
||||
page varchar2(200),
|
||||
creator number,
|
||||
create_time date ,
|
||||
update_time date,
|
||||
delete_type int ,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_acct_emp add lock_items varchar2(4000) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.datacollection.po;
|
||||
|
||||
import com.engine.salary.annotation.Encrypt;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -41,6 +42,7 @@ public class VariableArchiveItemPO {
|
|||
/**
|
||||
* 浮动值
|
||||
*/
|
||||
@Encrypt
|
||||
private String itemValue;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,4 +26,7 @@ public class LyFzhsBrowser {
|
|||
|
||||
// 辅助核算类型
|
||||
private String fzhslx;
|
||||
|
||||
// 辅助核算类型编号
|
||||
private String fzhslxbh;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,4 +33,17 @@ public class LyNCVoucherReturn {
|
|||
|
||||
@XStreamAsAttribute
|
||||
private String successful;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private String isexchange;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private String replace;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private String roottag;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private String sender;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.ly.param;
|
||||
|
||||
import com.engine.salary.entity.ly.dto.LyFzhsBrowser;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -27,19 +28,19 @@ public class LyVoucherDetailPushParam {
|
|||
private String kjkm;
|
||||
|
||||
// 辅助核算项目期数编码
|
||||
private String fzhsXmqs;
|
||||
private LyFzhsBrowser fzhsXmqs;
|
||||
|
||||
// 辅助核算房屋类别
|
||||
private String fzhsFwlb;
|
||||
private LyFzhsBrowser fzhsFwlb;
|
||||
|
||||
// 辅助核算税率类别
|
||||
private String fzhsSllb;
|
||||
private LyFzhsBrowser fzhsSllb;
|
||||
|
||||
// 辅助核算客商
|
||||
private String fzhsKs;
|
||||
private LyFzhsBrowser fzhsKs;
|
||||
|
||||
// 辅助核算其余辅助核算信息
|
||||
private List<String> fzhsOtherBmList;
|
||||
private List<LyFzhsBrowser> fzhsOtherBmList;
|
||||
private String fzhsOtherBmStr;
|
||||
|
||||
// 借方金额
|
||||
|
|
|
|||
|
|
@ -52,5 +52,10 @@ public class LyVoucherPushParam {
|
|||
*/
|
||||
private List<LyVoucherDetailPushParam> details;
|
||||
|
||||
/**
|
||||
* 账簿编码
|
||||
*/
|
||||
private String zbbm;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
package com.engine.salary.entity.ly.po;
|
||||
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName LyFundReportPO
|
||||
* @date 2024/10/18 15:03
|
||||
* @description
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LyFundReportPO {
|
||||
private Long id;
|
||||
|
||||
private Long subcompanyId;
|
||||
|
||||
/**
|
||||
* 职能项目类型
|
||||
*/
|
||||
@Alias("职能项目类型")
|
||||
private String znxmlx;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
|
||||
@Alias("费用所属期")
|
||||
private Date salaryMonth;
|
||||
|
||||
/**
|
||||
* 购买公司全称
|
||||
*/
|
||||
@Alias("购买公司全称")
|
||||
private String gmgsqc;
|
||||
|
||||
/**
|
||||
* 费用承担公司全称
|
||||
*/
|
||||
@Alias("费用承担公司全称")
|
||||
private String fycdgsqc;
|
||||
|
||||
/**
|
||||
* 职能/项目名称
|
||||
*/
|
||||
@Alias("职能项目名称")
|
||||
private String znxmmc;
|
||||
|
||||
/**
|
||||
* 分摊人数
|
||||
*/
|
||||
@Alias("分摊人数")
|
||||
private Integer ftempNum;
|
||||
|
||||
/**
|
||||
* 公积金-公司部分
|
||||
*/
|
||||
@Alias("公积金_公司部分")
|
||||
private String gjjGsbf;
|
||||
|
||||
/**
|
||||
* 公积金-个人部分
|
||||
*/
|
||||
@Alias("公积金_个人部分")
|
||||
private String gjjGrbf;
|
||||
|
||||
/**
|
||||
* 公积金-公积金合计
|
||||
*/
|
||||
@Alias("公积金_公积金合计")
|
||||
private String gjjGjjhj;
|
||||
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
@Alias("服务费")
|
||||
private String fwf;
|
||||
|
||||
/**
|
||||
* 挂靠个人应该转回金额
|
||||
*/
|
||||
@Alias("挂靠个人应该转回金额")
|
||||
private String gkgrygzhje;
|
||||
|
||||
/**
|
||||
* 数据来源哪些核算记录id
|
||||
*/
|
||||
private String dataSorce;
|
||||
|
||||
/**
|
||||
* 公积金计提凭证生成标识
|
||||
*/
|
||||
private Integer gjjjtpzFlag;
|
||||
private String gjjjtpzFlagStr;
|
||||
/**
|
||||
* 公积金生成凭证生成标识
|
||||
*/
|
||||
private Integer gjjffpzFlag;
|
||||
private String gjjffpzFlagStr;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -180,10 +180,12 @@ public class LySocialReportPO {
|
|||
* 社保计提凭证生成标识
|
||||
*/
|
||||
private Integer sbjtpzFlag;
|
||||
private String sbjtpzFlagStr;
|
||||
/**
|
||||
* 社保发放凭证生成标识
|
||||
*/
|
||||
private Integer sbffpzFlag;
|
||||
private String sbffpzFlagStr;
|
||||
/**
|
||||
* 公积金计提凭证生成标识
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class LyVoucherPO {
|
|||
* 创建时间
|
||||
*/
|
||||
@TableTitle(title = "推送时间", dataIndex = "createTime", key = "createTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
|||
import com.engine.salary.entity.datacollection.po.VariableItemPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
|
|
@ -49,13 +48,6 @@ public class SalaryAcctCalculateBO {
|
|||
*/
|
||||
private SalarySobCycleDTO salarySobCycleDTO;
|
||||
|
||||
/**
|
||||
* 核算锁定值
|
||||
*/
|
||||
private Map<String, SalaryAcctResultPO> salaryAcctLockResultPOS;
|
||||
private List<Long> lockSalaryItemIds;
|
||||
|
||||
|
||||
/**
|
||||
* 相同税款所属期内其他薪资核算记录(薪资类型为工资薪金的账套的)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -321,8 +321,8 @@ public class SalaryAcctResultBO {
|
|||
}
|
||||
// 主键id
|
||||
map.put("id", e.getId());
|
||||
//锁定状态
|
||||
map.put("lockStatus", LockStatusEnum.getByValue(e.getLockStatus()).getDefaultLabel());
|
||||
//锁定数据
|
||||
map.put("lockItems", e.getLockItems() != null ? e.getLockItems().stream().filter(Objects::nonNull).map(Object::toString).collect(Collectors.toList()) : new ArrayList<>());
|
||||
//人员id
|
||||
map.put("employeeId", e.getEmployeeId());
|
||||
// 个税扣缴义务人
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import com.engine.salary.util.valid.DataCheck;
|
|||
import lombok.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 薪资核算人员列表查询条件
|
||||
|
|
@ -59,4 +61,7 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam {
|
|||
private List<Long> ids;
|
||||
|
||||
private String workcode;
|
||||
|
||||
private List<Long> taxAgentIds;
|
||||
private Set<Date> salaryMonths;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资数据单元格锁定
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SalaryAcctResultLockParam {
|
||||
//锁定状态
|
||||
@DataCheck(require = true,message = "锁定状态不能为空")
|
||||
private LockStatusEnum lockStatus;
|
||||
|
||||
//薪资核算人员Id
|
||||
@DataCheck(require = true,message = "薪资核算人员不能为空")
|
||||
private Long acctEmpId;
|
||||
|
||||
//薪资项目的Id
|
||||
@DataCheck(require = true,message = "薪资项目不能为空")
|
||||
private Long salaryItemId;
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import lombok.experimental.Accessors;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资核算人员
|
||||
|
|
@ -112,6 +113,7 @@ public class SalaryAcctEmployeePO {
|
|||
private Date updateTime;
|
||||
|
||||
|
||||
@Deprecated
|
||||
@ElogTransform(name = "锁定状态")
|
||||
private Integer lockStatus;
|
||||
|
||||
|
|
@ -144,6 +146,9 @@ public class SalaryAcctEmployeePO {
|
|||
*/
|
||||
private String status;
|
||||
|
||||
//锁定的项目
|
||||
private List<Long> lockItems;
|
||||
|
||||
|
||||
//--------条件----------
|
||||
//主键id集合
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ public class SalaryAcctRecordPO {
|
|||
/**
|
||||
* 锁定的薪资项目
|
||||
*/
|
||||
@Deprecated
|
||||
private List<Long> lockSalaryItemIds;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.util.Date;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
//hrsa_acct_result_template
|
||||
public class SalaryAcctResultTemplatePO {
|
||||
/**
|
||||
* 主键id
|
||||
|
|
@ -29,6 +30,11 @@ public class SalaryAcctResultTemplatePO {
|
|||
*/
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 模板类型, 0:导出模板 1:公共导出模板 2:导入模板
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
|
|
@ -51,4 +57,5 @@ public class SalaryAcctResultTemplatePO {
|
|||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
private Collection<Integer> types;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.salary.entity.setting.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListSettingDTO {
|
||||
|
||||
private String name;
|
||||
|
||||
private String value;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListSettingQueryParam {
|
||||
|
||||
@DataCheck(require = true,message = "请选择页面")
|
||||
private String page;
|
||||
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListSettingSaveParam {
|
||||
|
||||
/**
|
||||
* 页面,0:薪资明细
|
||||
*/
|
||||
@DataCheck(require = true,message = "请选择页面")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@DataCheck(require = true,message = "请选择设置")
|
||||
private List<Long> setting;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.engine.salary.entity.setting.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListSettingPO {
|
||||
|
||||
|
||||
@ElogTransform(name = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 页面,0:薪资明细
|
||||
*/
|
||||
@ElogTransform(name = "页面,0:薪资明细")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@ElogTransform(name = "设置")
|
||||
private String setting;
|
||||
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@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;
|
||||
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -261,8 +261,11 @@ public class SalaryAcctManager extends Service {
|
|||
// 7、查询考勤引用的所有字段
|
||||
List<AttendQuoteFieldListDTO> attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll();
|
||||
|
||||
// //核算锁定值
|
||||
// List<Long> lockSalaryItemIds = salaryAcctRecordPO.getLockSalaryItemIds();
|
||||
//fixme 先全部锁定
|
||||
|
||||
// //将除重新核算的项目外的所有的值都锁定
|
||||
// List<Long> salaryItemIds = calculateParam.getSalaryItemIds();
|
||||
// List<Long> lockSalaryItemIds = salaryItemPOS.stream().map(SalaryItemPO::getId).filter(id -> !salaryItemIds.contains(id)).collect(Collectors.toList());
|
||||
// Map<String, SalaryAcctResultPO> acctResults = new HashMap<>();
|
||||
// if (CollectionUtils.isNotEmpty(lockSalaryItemIds)) {
|
||||
// List<SalaryAcctResultPO> acctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
|
||||
|
|
@ -273,19 +276,6 @@ public class SalaryAcctManager extends Service {
|
|||
// .collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
// }
|
||||
|
||||
//将除重新核算的项目外的所有的值都锁定
|
||||
List<Long> salaryItemIds = calculateParam.getSalaryItemIds();
|
||||
List<Long> lockSalaryItemIds = salaryItemPOS.stream().map(SalaryItemPO::getId).filter(id -> !salaryItemIds.contains(id)).collect(Collectors.toList());
|
||||
Map<String, SalaryAcctResultPO> acctResults = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(lockSalaryItemIds)) {
|
||||
List<SalaryAcctResultPO> acctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
|
||||
acctResults = Optional.ofNullable(acctResultPOS)
|
||||
.orElse(new ArrayList<>())
|
||||
.stream()
|
||||
.filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId()))
|
||||
.collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
}
|
||||
|
||||
|
||||
// 8、查询公式详情
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
|
||||
|
|
@ -323,8 +313,6 @@ public class SalaryAcctManager extends Service {
|
|||
.setSalarySobPO(salarySobPO)
|
||||
.setSalarySobCycleDTO(salarySobCycleDTO)
|
||||
.setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS)
|
||||
.setSalaryAcctLockResultPOS(MapUtils.emptyIfNull(acctResults))
|
||||
.setLockSalaryItemIds(lockSalaryItemIds)
|
||||
.setSalarySobItemPOS(salarySobItemPOS)
|
||||
.setSalaryItemIdWithPriorityList(salarySobItemsWithPriority)
|
||||
.setExpressFormulas(expressFormulas)
|
||||
|
|
|
|||
|
|
@ -8,12 +8,6 @@ import org.apache.ibatis.annotations.Param;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
*
|
||||
* @Date 2022/4/18
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface InsuranceExportMapper {
|
||||
|
||||
List<ExcelAccountExportPO> exportExcelAccount(@Param("param") InsuranceComparisonResultQueryParam param);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SQLMapper
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SQLMapper {
|
||||
List<Map> runSQL(@Param("sql") String sql);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.engine.salary.mapper.SQLMapper">
|
||||
<select id="runSQL" resultType="java.util.Map">
|
||||
${sql}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -84,4 +84,6 @@ public interface VariableArchiveItemMapper {
|
|||
void deleteByIds(@Param("collection")List<Long> part);
|
||||
|
||||
void deleteByArchiveIds(@Param("collection")List<Long> part);
|
||||
|
||||
void updateBatchSelective(@Param("list")List<VariableArchiveItemPO> variableArchiveItemPOS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,22 @@
|
|||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
<update id="updateBatchSelective">
|
||||
update hrsa_variable_archive_item
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="item_value = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.itemValue != null">
|
||||
when id = #{item.id} then #{item.itemValue}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@
|
|||
</if>
|
||||
<!-- 工号 -->
|
||||
<if test="param.workcode != null and param.workcode != ''">
|
||||
AND e.workcode like '%'+#{workcode}+'%'
|
||||
AND e.workcode like '%'+#{param.workcode}+'%'
|
||||
</if>
|
||||
<!-- 部门 -->
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.mapper.ly;
|
||||
|
||||
import com.engine.salary.entity.ly.po.LyFundReportPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName LyFundReportMapper
|
||||
* @date 2024/10/18 15:12
|
||||
* @description
|
||||
*/
|
||||
public interface LyFundReportMapper {
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<LyFundReportPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<LyFundReportPO> listSome(LyFundReportPO lyFundReport);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
LyFundReportPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param lyFundReport 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(LyFundReportPO lyFundReport);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param lyFundReport 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(LyFundReportPO lyFundReport);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param lyFundReport 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(LyFundReportPO lyFundReport);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param lyFundReport 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(LyFundReportPO lyFundReport);
|
||||
|
||||
void deleteByIds(@Param("ids") List<Long> ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,384 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.ly.LyFundReportMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.ly.po.LyFundReportPO">
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="creator" property="creator" />
|
||||
<result column="data_sorce" property="dataSorce" />
|
||||
<result column="delete_type" property="deleteType" />
|
||||
<result column="ftemp_num" property="ftempNum" />
|
||||
<result column="fwf" property="fwf" />
|
||||
<result column="fycdgsqc" property="fycdgsqc" />
|
||||
<result column="gjj_gjjhj" property="gjjGjjhj" />
|
||||
<result column="gjj_grbf" property="gjjGrbf" />
|
||||
<result column="gjj_gsbf" property="gjjGsbf" />
|
||||
<result column="gjjffpz_flag" property="gjjffpzFlag" />
|
||||
<result column="gjjjtpz_flag" property="gjjjtpzFlag" />
|
||||
<result column="gkgrygzhje" property="gkgrygzhje" />
|
||||
<result column="gmgsqc" property="gmgsqc" />
|
||||
<result column="id" property="id" />
|
||||
<result column="salary_month" property="salaryMonth" />
|
||||
<result column="subcompany_id" property="subcompanyId" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="znxmlx" property="znxmlx" />
|
||||
<result column="znxmmc" property="znxmmc" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.create_time
|
||||
, t.creator
|
||||
, t.data_sorce
|
||||
, t.delete_type
|
||||
, t.ftemp_num
|
||||
, t.fwf
|
||||
, t.fycdgsqc
|
||||
, t.gjj_gjjhj
|
||||
, t.gjj_grbf
|
||||
, t.gjj_gsbf
|
||||
, t.gjjffpz_flag
|
||||
, t.gjjjtpz_flag
|
||||
, t.gkgrygzhje
|
||||
, t.gmgsqc
|
||||
, t.id
|
||||
, t.salary_month
|
||||
, t.subcompany_id
|
||||
, t.update_time
|
||||
, t.znxmlx
|
||||
, t.znxmmc
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_ly_fund_report t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_ly_fund_report t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.ly.po.LyFundReportPO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_ly_fund_report t
|
||||
WHERE delete_type = 0
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="dataSorce != null">
|
||||
AND data_sorce = #{dataSorce}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="ftempNum != null">
|
||||
AND ftemp_num = #{ftempNum}
|
||||
</if>
|
||||
<if test="fwf != null">
|
||||
AND fwf = #{fwf}
|
||||
</if>
|
||||
<if test="fycdgsqc != null">
|
||||
AND fycdgsqc = #{fycdgsqc}
|
||||
</if>
|
||||
<if test="gjjGjjhj != null">
|
||||
AND gjj_gjjhj = #{gjjGjjhj}
|
||||
</if>
|
||||
<if test="gjjGrbf != null">
|
||||
AND gjj_grbf = #{gjjGrbf}
|
||||
</if>
|
||||
<if test="gjjGsbf != null">
|
||||
AND gjj_gsbf = #{gjjGsbf}
|
||||
</if>
|
||||
<if test="gjjffpzFlag != null">
|
||||
AND gjjffpz_flag = #{gjjffpzFlag}
|
||||
</if>
|
||||
<if test="gjjjtpzFlag != null">
|
||||
AND gjjjtpz_flag = #{gjjjtpzFlag}
|
||||
</if>
|
||||
<if test="gkgrygzhje != null">
|
||||
AND gkgrygzhje = #{gkgrygzhje}
|
||||
</if>
|
||||
<if test="gmgsqc != null">
|
||||
AND gmgsqc = #{gmgsqc}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
AND salary_month = #{salaryMonth}
|
||||
</if>
|
||||
<if test="subcompanyId != null">
|
||||
AND subcompany_id = #{subcompanyId}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="znxmlx != null">
|
||||
AND znxmlx = #{znxmlx}
|
||||
</if>
|
||||
<if test="znxmmc != null">
|
||||
AND znxmmc = #{znxmmc}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.ly.po.LyFundReportPO">
|
||||
INSERT INTO hrsa_ly_fund_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="dataSorce != null">
|
||||
data_sorce,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="ftempNum != null">
|
||||
ftemp_num,
|
||||
</if>
|
||||
<if test="fwf != null">
|
||||
fwf,
|
||||
</if>
|
||||
<if test="fycdgsqc != null">
|
||||
fycdgsqc,
|
||||
</if>
|
||||
<if test="gjjGjjhj != null">
|
||||
gjj_gjjhj,
|
||||
</if>
|
||||
<if test="gjjGrbf != null">
|
||||
gjj_grbf,
|
||||
</if>
|
||||
<if test="gjjGsbf != null">
|
||||
gjj_gsbf,
|
||||
</if>
|
||||
<if test="gjjffpzFlag != null">
|
||||
gjjffpz_flag,
|
||||
</if>
|
||||
<if test="gjjjtpzFlag != null">
|
||||
gjjjtpz_flag,
|
||||
</if>
|
||||
<if test="gkgrygzhje != null">
|
||||
gkgrygzhje,
|
||||
</if>
|
||||
<if test="gmgsqc != null">
|
||||
gmgsqc,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="salaryMonth != null">
|
||||
salary_month,
|
||||
</if>
|
||||
<if test="subcompanyId != null">
|
||||
subcompany_id,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="znxmlx != null">
|
||||
znxmlx,
|
||||
</if>
|
||||
<if test="znxmmc != null">
|
||||
znxmmc,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null" >
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="dataSorce != null" >
|
||||
#{dataSorce},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="ftempNum != null" >
|
||||
#{ftempNum},
|
||||
</if>
|
||||
<if test="fwf != null" >
|
||||
#{fwf},
|
||||
</if>
|
||||
<if test="fycdgsqc != null" >
|
||||
#{fycdgsqc},
|
||||
</if>
|
||||
<if test="gjjGjjhj != null" >
|
||||
#{gjjGjjhj},
|
||||
</if>
|
||||
<if test="gjjGrbf != null" >
|
||||
#{gjjGrbf},
|
||||
</if>
|
||||
<if test="gjjGsbf != null" >
|
||||
#{gjjGsbf},
|
||||
</if>
|
||||
<if test="gjjffpzFlag != null" >
|
||||
#{gjjffpzFlag},
|
||||
</if>
|
||||
<if test="gjjjtpzFlag != null" >
|
||||
#{gjjjtpzFlag},
|
||||
</if>
|
||||
<if test="gkgrygzhje != null" >
|
||||
#{gkgrygzhje},
|
||||
</if>
|
||||
<if test="gmgsqc != null" >
|
||||
#{gmgsqc},
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
#{id},
|
||||
</if>
|
||||
<if test="salaryMonth != null" >
|
||||
#{salaryMonth},
|
||||
</if>
|
||||
<if test="subcompanyId != null" >
|
||||
#{subcompanyId},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="znxmlx != null" >
|
||||
#{znxmlx},
|
||||
</if>
|
||||
<if test="znxmmc != null" >
|
||||
#{znxmmc},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<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>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.ly.po.LyFundReportPO">
|
||||
UPDATE hrsa_ly_fund_report
|
||||
<set>
|
||||
<if test="createTime != null" >
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null" >
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="dataSorce != null" >
|
||||
data_sorce=#{dataSorce},
|
||||
</if>
|
||||
<if test="deleteType != null" >
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="ftempNum != null" >
|
||||
ftemp_num=#{ftempNum},
|
||||
</if>
|
||||
<if test="fwf != null" >
|
||||
fwf=#{fwf},
|
||||
</if>
|
||||
<if test="fycdgsqc != null" >
|
||||
fycdgsqc=#{fycdgsqc},
|
||||
</if>
|
||||
<if test="gjjGjjhj != null" >
|
||||
gjj_gjjhj=#{gjjGjjhj},
|
||||
</if>
|
||||
<if test="gjjGrbf != null" >
|
||||
gjj_grbf=#{gjjGrbf},
|
||||
</if>
|
||||
<if test="gjjGsbf != null" >
|
||||
gjj_gsbf=#{gjjGsbf},
|
||||
</if>
|
||||
<if test="gjjffpzFlag != null" >
|
||||
gjjffpz_flag=#{gjjffpzFlag},
|
||||
</if>
|
||||
<if test="gjjjtpzFlag != null" >
|
||||
gjjjtpz_flag=#{gjjjtpzFlag},
|
||||
</if>
|
||||
<if test="gkgrygzhje != null" >
|
||||
gkgrygzhje=#{gkgrygzhje},
|
||||
</if>
|
||||
<if test="gmgsqc != null" >
|
||||
gmgsqc=#{gmgsqc},
|
||||
</if>
|
||||
<if test="salaryMonth != null" >
|
||||
salary_month=#{salaryMonth},
|
||||
</if>
|
||||
<if test="subcompanyId != null" >
|
||||
subcompany_id=#{subcompanyId},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="znxmlx != null" >
|
||||
znxmlx=#{znxmlx},
|
||||
</if>
|
||||
<if test="znxmmc != null" >
|
||||
znxmmc=#{znxmmc},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.ly.po.LyFundReportPO">
|
||||
UPDATE hrsa_ly_fund_report
|
||||
SET delete_type=1
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</delete>
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_ly_fund_report
|
||||
SET delete_type=1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -124,4 +124,6 @@ public interface SalaryAcctEmployeeMapper {
|
|||
void lockByRecordId(@Param("lockStatus") Integer lockStatus, @Param("recordId") Long recordId);
|
||||
|
||||
void updateIgnoreNull(@Param("salaryAcctEmployeePO")SalaryAcctEmployeePO salaryAcctEmployeePO);
|
||||
|
||||
void lock(SalaryAcctEmployeePO salaryAcctEmployeePO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
<result column="jobcall" property="jobcall"/>
|
||||
<result column="jobcall_id" property="jobcallId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SalaryAccEmployeeCountMap"
|
||||
|
|
@ -58,7 +59,8 @@
|
|||
t.jobtitle_id,
|
||||
t.jobcall,
|
||||
t.jobcall_id,
|
||||
t.status
|
||||
t.status,
|
||||
t.lock_items
|
||||
</sql>
|
||||
|
||||
<sql id="emp1Column">
|
||||
|
|
@ -521,7 +523,6 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
<include refid="SalaryAcctEmployeeParamSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -538,7 +539,6 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
<include refid="SalaryAcctEmployeeParamSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -555,7 +555,6 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
<include refid="SalaryAcctEmployeeParamSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
|
|
@ -564,6 +563,9 @@
|
|||
</select>
|
||||
|
||||
<sql id="SalaryAcctEmployeeParamSql">
|
||||
<if test="param.salaryAcctRecordId != null">
|
||||
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -573,6 +575,18 @@
|
|||
<if test="param.taxAgentId != null">
|
||||
AND t.tax_agent_id = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
|
||||
AND t.salary_month IN
|
||||
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
|
||||
#{salaryMonth}
|
||||
</foreach>
|
||||
</if>
|
||||
-- 分部
|
||||
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
|
||||
AND t.subcompany_id IN
|
||||
|
|
@ -625,6 +639,9 @@
|
|||
</if>
|
||||
</sql>
|
||||
<sql id="SalaryAcctEmployeeParamSql" databaseId="oracle">
|
||||
<if test="param.salaryAcctRecordId != null">
|
||||
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -634,6 +651,18 @@
|
|||
<if test="param.taxAgentId != null">
|
||||
AND t.tax_agent_id = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
|
||||
AND t.salary_month IN
|
||||
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
|
||||
#{salaryMonth}
|
||||
</foreach>
|
||||
</if>
|
||||
-- 分部
|
||||
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
|
||||
AND t.subcompany_id IN
|
||||
|
|
@ -684,6 +713,9 @@
|
|||
</if>
|
||||
</sql>
|
||||
<sql id="SalaryAcctEmployeeParamSql" databaseId="sqlserver">
|
||||
<if test="param.salaryAcctRecordId != null">
|
||||
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
|
||||
</if>
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -693,6 +725,18 @@
|
|||
<if test="param.taxAgentId != null">
|
||||
AND t.tax_agent_id = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
AND t.tax_agent_id IN
|
||||
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
|
||||
AND t.salary_month IN
|
||||
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
|
||||
#{salaryMonth}
|
||||
</foreach>
|
||||
</if>
|
||||
-- 分部
|
||||
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
|
||||
AND t.subcompany_id IN
|
||||
|
|
@ -924,6 +968,7 @@
|
|||
<result column="jobcall" property="jobcall"/>
|
||||
<result column="jobcall_id" property="jobcallId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -952,6 +997,7 @@
|
|||
, t.jobcall
|
||||
, t.jobcall_id
|
||||
, t.status
|
||||
, t.lock_items
|
||||
</sql>
|
||||
|
||||
|
||||
|
|
@ -1124,4 +1170,13 @@
|
|||
WHERE id = #{salaryAcctEmployeePO.id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
<update id="lock" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
|
||||
UPDATE hrsa_salary_acct_emp
|
||||
<set>
|
||||
lock_items =
|
||||
#{lockItems, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<result column="template_name" property="templateName" />
|
||||
<result column="tenant_key" property="tenantKey" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="type" property="type" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -24,6 +25,7 @@
|
|||
, t.template_name
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
, t.type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -75,12 +77,21 @@
|
|||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="types != null and types.size()>0">
|
||||
AND type IN
|
||||
<foreach collection="types" open="(" item="type" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
|
@ -117,6 +128,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null" >
|
||||
|
|
@ -146,6 +160,9 @@
|
|||
<if test="updateTime != null" >
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
#{type},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -161,6 +178,7 @@
|
|||
template_name=#{templateName},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
type=#{type},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -194,6 +212,9 @@
|
|||
<if test="updateTime != null" >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type=#{type},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
package com.engine.salary.mapper.setting;
|
||||
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface PageListSettingMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageListSettingPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<PageListSettingPO> listSome(PageListSettingPO pageListSetting);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
PageListSettingPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param pageListSetting 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(PageListSettingPO pageListSetting);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param pageListSetting 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(PageListSettingPO pageListSetting);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param pageListSetting 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(PageListSettingPO pageListSetting);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param pageListSetting 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(PageListSettingPO pageListSetting);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
PageListSettingPO getByPage(String page);
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.setting.PageListSettingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="page" property="page"/>
|
||||
<result column="setting" property="setting"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.id
|
||||
, t.page
|
||||
, t.setting
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE delete_type = 0
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="page != null">
|
||||
AND page = #{page}
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
AND setting = #{setting}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
INSERT INTO hrsa_page_list_setting
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page,
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
#{page},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
#{setting},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
UPDATE hrsa_page_list_setting
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
page=#{page},
|
||||
setting=#{setting},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageListSettingPO">
|
||||
UPDATE hrsa_page_list_setting
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="page != null">
|
||||
page=#{page},
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
setting=#{setting},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_page_list_setting
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_page_list_setting
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getByPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_list_setting t
|
||||
WHERE delete_type = 0
|
||||
and page = #{page}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
AND payment_organization = #{paymentOrganization}
|
||||
AND fund_scheme_id is not null
|
||||
AND fund_start_time is not null AND fund_start_time <![CDATA[ <= ]]> #{billMonth}
|
||||
AND (fund_end_time is null OR fund_end_time <![CDATA[ >= ]]> #{billMonth})
|
||||
AND (fund_end_time is null OR fund_end_time <![CDATA[ >= ]]> #{billMonth} OR fund_end_time ='')
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@
|
|||
AND payment_organization = #{paymentOrganization}
|
||||
AND other_scheme_id is not null
|
||||
AND other_start_time is not null AND other_start_time <![CDATA[ <= ]]> #{billMonth}
|
||||
AND (other_end_time is null OR other_end_time <![CDATA[ >= ]]> #{billMonth})
|
||||
AND (other_end_time is null OR other_end_time <![CDATA[ >= ]]> #{billMonth} OR other_end_time ='')
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -909,7 +909,7 @@
|
|||
AND payment_organization = #{paymentOrganization}
|
||||
AND social_scheme_id is not null
|
||||
AND social_start_time is not null AND social_start_time <![CDATA[ <= ]]> #{billMonth}
|
||||
AND (social_end_time is null OR social_end_time <![CDATA[ >= ]]> #{billMonth})
|
||||
AND (social_end_time is null OR social_end_time <![CDATA[ >= ]]> #{billMonth} OR social_end_time ='')
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -131,11 +131,10 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
|
||||
@Override
|
||||
public List<Map<String, String>> getDatas(Attend4Salary attend4Salary) {
|
||||
ValidUtil.doValidator(attend4Salary);
|
||||
log.info("salaryAttend开始获取的考勤数据,参数{}", attend4Salary);
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
|
||||
try {
|
||||
ValidUtil.doValidator(attend4Salary);
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
paramsMap.put("pageIndex", 1);
|
||||
paramsMap.put("pageSize", 500);
|
||||
|
|
@ -152,6 +151,8 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("data", JSONObject.toJSONString(paramsMap));
|
||||
temp.put("reportType", "month");
|
||||
|
||||
log.info("salaryAttend开始获取的考勤数据,参数{}", temp);
|
||||
list = (List<Map<String, String>>) commandExecutor.execute(new GetKQReportCmd(temp, user)).get("datas");
|
||||
if (isLog) {
|
||||
log.info("salaryAttend获取的考勤数据,{}", JSONUtils.toJSONString(list));
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import cn.hutool.core.util.NumberUtil;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
|
|
@ -28,10 +30,7 @@ import com.engine.salary.service.*;
|
|||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -96,6 +95,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SettingService getSettingService(User user) {
|
||||
return ServiceUtil.getService(SettingServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<SalaryStatisticsEmployeeListDTO> listPage(SalaryStatisticsEmployeeQueryParam queryParam) {
|
||||
List<SalaryStatisticsEmployeeListDTO> list = Collections.emptyList();
|
||||
|
|
@ -117,7 +120,9 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
.collect(Collectors.toSet());
|
||||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByTaxAgentAndSalaryMonth(taxAgentIds, salaryMonths);
|
||||
// 查询薪资核算人员
|
||||
SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().salaryMonths(salaryMonths).taxAgentIds(taxAgentIds).build();
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam);
|
||||
salaryAcctEmployeeList = getAuthService(user).auth(salaryAcctEmployeeList, AuthFilterTypeEnum.QUERY_DATA,SalaryAcctEmployeePO.class,"report");
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
|
|
@ -239,7 +244,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
map.put("id", se.getId().toString());
|
||||
map.put("salaryMonth", SalaryDateUtil.getFormatYearMonth(se.getSalaryMonth()));
|
||||
map.put("taxAgent", taxAgentMap.get(se.getTaxAgentId()));
|
||||
map.put("salarySob",SalarySobMap.get(se.getSalarySobId()));
|
||||
map.put("salarySob", SalarySobMap.get(se.getSalarySobId()));
|
||||
map.put("acctTimes", salaryAcctRecordMap.get(se.getSalaryAcctRecordId()));
|
||||
map.put("userName", Util.null2String(emp.getUsername()));
|
||||
map.put("subCompany", Util.null2String(emp.getSubcompanyName()));
|
||||
|
|
@ -247,6 +252,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
map.put("jobTitle", Util.null2String(emp.getJobtitleName()));
|
||||
map.put("status", Util.null2String(NumberUtil.isNumber(emp.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(emp.getStatus())).getDefaultLabel() : null));
|
||||
map.put("workCode", Util.null2String(emp.getWorkcode()));
|
||||
map.put("companystartdate", Util.null2String(emp.getCompanystartdate()));
|
||||
|
||||
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
|
||||
// map.put("incomeCategory", Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
|
||||
|
|
@ -272,10 +278,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
// 2.年月参数处理,注意:薪资所属月居然是用字符串存储的,无法通过sql between处理
|
||||
List<Date> dataParam = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(queryParam.getStartDateStr())) {
|
||||
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getStartDateStr()+ "-01 00:00:00"));
|
||||
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getStartDateStr() + "-01 00:00:00"));
|
||||
}
|
||||
if (StringUtils.isNotBlank(queryParam.getEndDateStr())) {
|
||||
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getEndDateStr()+ "-01 00:00:00"));
|
||||
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getEndDateStr() + "-01 00:00:00"));
|
||||
}
|
||||
Set<Date> salaryMonths = SalaryStatisticsEmployeeBO.getSalaryMonths(null, dataParam)
|
||||
.stream()
|
||||
|
|
@ -283,20 +289,21 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
.collect(Collectors.toSet());
|
||||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByTaxAgentAndSalaryMonth(taxAgentIds, salaryMonths);
|
||||
SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().salaryMonths(salaryMonths).taxAgentIds(taxAgentIds).build();
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam);
|
||||
salaryAcctEmployeeList = getAuthService(user).auth(salaryAcctEmployeeList, AuthFilterTypeEnum.QUERY_DATA,SalaryAcctEmployeePO.class,"report");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(queryParam.getSubCompanyIds()) || CollectionUtils.isNotEmpty(queryParam.getDepartmentIds()) || StringUtils.isNotBlank(queryParam.getKeyword())) {
|
||||
// 根据分部、部门筛选
|
||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listBySubCompanyOrDepartment(queryParam.getSubCompanyIds(), queryParam.getDepartmentIds());
|
||||
// 根据关键词过滤
|
||||
if(StringUtils.isNotBlank(queryParam.getKeyword())) {
|
||||
if (StringUtils.isNotBlank(queryParam.getKeyword())) {
|
||||
employeeList = employeeList.stream()
|
||||
.filter(e -> (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword()))))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter( acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return new PageInfo<>();
|
||||
|
|
@ -306,8 +313,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
if (CollectionUtils.isNotEmpty(queryParam.getIds())) {
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(emp -> queryParam.getIds().contains(emp.getId())).collect(Collectors.toList());
|
||||
}
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getSalaryMonth)).collect(Collectors.toList());
|
||||
Collections.reverse(salaryAcctEmployeeList);
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getSalaryMonth).reversed()).collect(Collectors.toList());
|
||||
PageInfo<SalaryAcctEmployeePO> SalaryAcctEmployeePageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salaryAcctEmployeeList);
|
||||
if (queryParam.isExport()) {
|
||||
SalaryAcctEmployeePageInfo.setList(salaryAcctEmployeeList);
|
||||
|
|
@ -317,11 +323,33 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
|
||||
@Override
|
||||
public SalaryStatisticsEmployeeDetailResultDTO getDetailSalaryAcctResultByAcctEmp(List<SalaryAcctEmployeePO> salaryAcctEmployeeList) {
|
||||
// 3.获取薪资项目
|
||||
PageListSettingQueryParam param = PageListSettingQueryParam.builder().page("salary_details_report").build();
|
||||
Map setting = getSettingService(user).getPageListSetting(param);
|
||||
List<Long> checked = setting.get("checked") != null ? JsonUtil.parseList(setting.get("checked"), Long.class) : new ArrayList<>();
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(checked);
|
||||
// salaryItemList = salaryItemList.stream()
|
||||
// .sorted(new Comparator<SalaryItemPO>() {
|
||||
// @Override
|
||||
// public int compare(SalaryItemPO o1, SalaryItemPO o2) {
|
||||
// if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
|
||||
// Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
|
||||
// Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
|
||||
// return systemType1.compareTo(systemType2);
|
||||
// } else {
|
||||
// Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
|
||||
// Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
|
||||
// return sortedIndex2.compareTo(sortedIndex1);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return SalaryStatisticsEmployeeDetailResultDTO.builder()
|
||||
.salaryAcctEmployeeList(Collections.emptyList())
|
||||
.salaryAcctResultValueList(Collections.emptyList())
|
||||
.salaryItemList(Collections.emptyList())
|
||||
.salaryItemList(salaryItemList)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -329,24 +357,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
|
||||
// 3.获取薪资项目
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
salaryItemList = salaryItemList.stream()
|
||||
.sorted(new Comparator<SalaryItemPO>() {
|
||||
@Override
|
||||
public int compare(SalaryItemPO o1, SalaryItemPO o2) {
|
||||
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
|
||||
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
|
||||
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
|
||||
return systemType1.compareTo(systemType2);
|
||||
} else {
|
||||
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
|
||||
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
|
||||
return sortedIndex2.compareTo(sortedIndex1);
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
return SalaryStatisticsEmployeeDetailResultDTO.builder()
|
||||
.salaryAcctEmployeeList(salaryAcctEmployeeList)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ import com.engine.salary.report.service.SalaryStatisticsReportService;
|
|||
import com.engine.salary.report.util.ReportTimeUtil;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
|
|
@ -54,6 +56,8 @@ import weaver.wechat.util.Utils;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.REPORT_ORGANIZATIN_TYPE;
|
||||
|
||||
/**
|
||||
* 薪酬统计报表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -71,6 +75,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
public static final String LAST_INFO = "lastInfoList";
|
||||
public static final String SAME_INFO = "sameInfoList";
|
||||
|
||||
private final boolean isRealOrg = "1".equals(getSalarySysConfService(user).getValueByCode(REPORT_ORGANIZATIN_TYPE));
|
||||
|
||||
private SalaryStatisticsReportMapper getSalaryStatisticsReportMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryStatisticsReportMapper.class);
|
||||
|
|
@ -112,6 +117,9 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
// private ExtEmployeeService extEmployeeService;
|
||||
//
|
||||
// private HrmCommonEmployeeService hrmCommonEmployeeService;
|
||||
|
|
@ -197,16 +205,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
this.getSalaryStatisticsReportMapper().updateIgnoreNull(poNew);
|
||||
|
||||
// 记录日志
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(poNew.getId()));
|
||||
loggerContext.setTargetName(poNew.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "更新报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "更新报表"));
|
||||
loggerContext.setOldValues(po);
|
||||
loggerContext.setNewValues(poNew);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(poNew.getId()));
|
||||
loggerContext.setTargetName(poNew.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更新报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新报表"));
|
||||
loggerContext.setOldValues(po);
|
||||
loggerContext.setNewValues(poNew);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
} else {
|
||||
List<SalaryStatisticsReportPO> list = listByName(saveParam.getReportName());
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
@ -217,15 +225,15 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
getSalaryStatisticsReportMapper().insertIgnoreNull(poNew);
|
||||
|
||||
// 记录日志
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(poNew.getId()));
|
||||
loggerContext.setTargetName(poNew.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增报表"));
|
||||
loggerContext.setNewValues(poNew);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(poNew.getId()));
|
||||
loggerContext.setTargetName(poNew.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增报表"));
|
||||
loggerContext.setNewValues(poNew);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
|
@ -305,16 +313,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
getSalaryStatisticsItemService(user).saveOrUpdateBatch(salaryStatisticsItemList);
|
||||
|
||||
//记录日志
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(po.getId()));
|
||||
loggerContext.setTargetName(po.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "更新报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新报表"));
|
||||
loggerContext.setOldValues(oldPO);
|
||||
loggerContext.setNewValues(po);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(po.getId()));
|
||||
loggerContext.setTargetName(po.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更新报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新报表"));
|
||||
loggerContext.setOldValues(oldPO);
|
||||
loggerContext.setNewValues(po);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
|
|
@ -333,17 +341,17 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
getSalaryStatisticsReportMapper().deleteByIds(deleteIds);
|
||||
//删除薪资项
|
||||
getSalaryStatisticsItemService(user).deleteByReportIds(deleteIds);
|
||||
list.forEach(e -> {
|
||||
// 记录日志
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(e.getId()));
|
||||
loggerContext.setTargetName(e.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除报表") + e.getReportName());
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
list.forEach(e -> {
|
||||
// 记录日志
|
||||
LoggerContext<SalaryStatisticsReportPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(e.getId()));
|
||||
loggerContext.setTargetName(e.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除报表") + e.getReportName());
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>(2);
|
||||
|
|
@ -396,8 +404,8 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
loggerContext.setTargetId(String.valueOf(po.getId()));
|
||||
loggerContext.setTargetName(po.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增报表"));
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增报表"));
|
||||
loggerContext.setNewValues(po);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
|
@ -474,7 +482,15 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listBySalaryStatisticsReportParam(queryParam);
|
||||
|
||||
// 设置dimensionValue为维度值
|
||||
SalaryStatisticsReportDataDTO salaryStatisticsReportData = SalaryStatisticsReportDataDTO.builder().list(salaryAcctEmployeeList).lastList(Collections.emptyList()).sameList(Collections.emptyList()).salaryStatisticsItemList(salaryStatisticsItemPOS).employeeId((long) user.getUID()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).dimensionValue(param.getDimensionValue()).build();
|
||||
SalaryStatisticsReportDataDTO salaryStatisticsReportData = SalaryStatisticsReportDataDTO.builder()
|
||||
.list(salaryAcctEmployeeList)
|
||||
.lastList(Collections.emptyList())
|
||||
.sameList(Collections.emptyList())
|
||||
.salaryStatisticsItemList(salaryStatisticsItemPOS)
|
||||
.employeeId((long) user.getUID())
|
||||
.dimensionValue(param.getDimensionValue())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
|
||||
Map<Long, Map<String, String>> resultMap = new HashMap<>();
|
||||
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
|
|
@ -780,38 +796,74 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
Map<Long, String> subComIdNameMap = new HashMap<>();
|
||||
Map<Long, Long> lastEmpIdSubComMap = new HashMap<>();
|
||||
Map<Long, Long> sameEmpIdSubComMap = new HashMap<>();
|
||||
comInfoMap.forEach((k, v) -> {
|
||||
subComIdNameMap.put(v.getSubcompanyid(), v.getSubcompanyName());
|
||||
empIdSubComMap.put(k, v.getSubcompanyid());
|
||||
subComIds.add(v.getSubcompanyid());
|
||||
});
|
||||
lastComInfoMap.forEach((k, v) -> {
|
||||
lastEmpIdSubComMap.put(k, v.getSubcompanyid());
|
||||
});
|
||||
sameComInfoMap.forEach((k, v) -> {
|
||||
sameEmpIdSubComMap.put(k, v.getSubcompanyid());
|
||||
});
|
||||
|
||||
if (isRealOrg) {
|
||||
comInfoMap.forEach((k, v) -> {
|
||||
subComIdNameMap.put(v.getSubcompanyid(), v.getSubcompanyName());
|
||||
empIdSubComMap.put(k, v.getSubcompanyid());
|
||||
subComIds.add(v.getSubcompanyid());
|
||||
});
|
||||
lastComInfoMap.forEach((k, v) -> {
|
||||
lastEmpIdSubComMap.put(k, v.getSubcompanyid());
|
||||
});
|
||||
sameComInfoMap.forEach((k, v) -> {
|
||||
sameEmpIdSubComMap.put(k, v.getSubcompanyid());
|
||||
});
|
||||
} else {
|
||||
data.getList().forEach(employee -> {
|
||||
if (employee.getSubcompanyId() != null && employee.getSubcompanyId() != null) {
|
||||
subComIdNameMap.put(employee.getSubcompanyId(), employee.getSubcompanyName());
|
||||
subComIds.add(employee.getDepartmentId());
|
||||
empIdSubComMap.put(employee.getEmployeeId(), employee.getSubcompanyId());
|
||||
}
|
||||
});
|
||||
data.getLastList().forEach(employee -> {
|
||||
if (employee.getSubcompanyId() != null && employee.getSubcompanyId() != null) {
|
||||
lastEmpIdSubComMap.put(employee.getEmployeeId(), employee.getSubcompanyId());
|
||||
}
|
||||
});
|
||||
data.getSameList().forEach(employee -> {
|
||||
if (employee.getSubcompanyId() != null && employee.getSubcompanyId() != null) {
|
||||
sameEmpIdSubComMap.put(employee.getEmployeeId(), employee.getSubcompanyId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
String dimensionValue = data.getDimensionValue();
|
||||
subComIds.forEach(subComId -> {
|
||||
if (dimensionValue == null) {
|
||||
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastSubComEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameSubComEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(po.getSubcompanyId(), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastSubComEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(po.getSubcompanyId(), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameSubComEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(po.getSubcompanyId(), subComId)).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
lastSubComEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
sameSubComEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
}
|
||||
Map<String, Object> temp = new HashMap<>();
|
||||
temp.put(DM, subComIdNameMap.get(subComId));
|
||||
temp.putAll(SalaryStatisticsReportBO.calculateItem(subComEmployeePOS, lastSubComEmployeePOS, sameSubComEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
||||
records.add(temp);
|
||||
} else if (StringUtils.equals(dimensionValue, subComIdNameMap.get(subComId))) {
|
||||
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(po.getSubcompanyId(), subComId)).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
subComEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdSubComMap.get(po.getEmployeeId()), subComId)).collect(Collectors.toList());
|
||||
}
|
||||
data.setListByDimensionValue(subComEmployeePOS);
|
||||
}
|
||||
});
|
||||
|
||||
if (dimensionValue == null) {
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> po.getSubcompanyId() == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> po.getSubcompanyId() == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> po.getSubcompanyId() == null).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
sameNoGroupingList = data.getSameList().stream().filter(po -> sameEmpIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
||||
Map<String, Object> noGrouping = new HashMap<>();
|
||||
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
||||
|
|
@ -820,6 +872,9 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
}
|
||||
} else if (StringUtils.equals(dimensionValue, "无分组")) {
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdSubComMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
noGroupingList = data.getList().stream().filter(po -> po.getSubcompanyId() == null).collect(Collectors.toList());
|
||||
}
|
||||
data.setListByDimensionValue(noGroupingList);
|
||||
}
|
||||
|
||||
|
|
@ -843,44 +898,78 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
Map<Long, Long> lastEmpIdDepartIdMap = new HashMap<>();
|
||||
Map<Long, Long> sameEmpIdDepartIdMap = new HashMap<>();
|
||||
Map<Long, String> departIdNameMap = new HashMap<>();
|
||||
simpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
departIdNameMap.put(employee.getDepartmentId(), employee.getDepartmentName());
|
||||
departIds.add(employee.getDepartmentId());
|
||||
empIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
lastSimpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
lastEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
sameSimpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
sameEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
if (isRealOrg) {
|
||||
simpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
departIdNameMap.put(employee.getDepartmentId(), employee.getDepartmentName());
|
||||
departIds.add(employee.getDepartmentId());
|
||||
empIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
lastSimpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
lastEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
sameSimpleEmployeeList.forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
sameEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
data.getList().forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
departIdNameMap.put(employee.getDepartmentId(), employee.getDepartmentName());
|
||||
departIds.add(employee.getDepartmentId());
|
||||
empIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
data.getLastList().forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
lastEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
data.getSameList().forEach(employee -> {
|
||||
if (employee.getDepartmentName() != null && employee.getDepartmentId() != null) {
|
||||
sameEmpIdDepartIdMap.put(employee.getEmployeeId(), employee.getDepartmentId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String dimensionValue = data.getDimensionValue();
|
||||
departIds.forEach(departId -> {
|
||||
if (dimensionValue == null) {
|
||||
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastDepartEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameDepartEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(po.getDepartmentId(), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastDepartEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(po.getDepartmentId(), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameDepartEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(po.getDepartmentId(), departId)).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
lastDepartEmployeePOS = data.getLastList().stream().filter(po -> Objects.equals(lastEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
sameDepartEmployeePOS = data.getSameList().stream().filter(po -> Objects.equals(sameEmpIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
}
|
||||
Map<String, Object> temp = new HashMap<>();
|
||||
temp.put(DM, departIdNameMap.get(departId));
|
||||
temp.putAll(SalaryStatisticsReportBO.calculateItem(departEmployeePOS, lastDepartEmployeePOS, sameDepartEmployeePOS, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()));
|
||||
records.add(temp);
|
||||
} else if (StringUtils.equals(dimensionValue, departIdNameMap.get(departId))) {
|
||||
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(po.getDepartmentId(), departId)).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
departEmployeePOS = data.getList().stream().filter(po -> Objects.equals(empIdDepartIdMap.get(po.getEmployeeId()), departId)).collect(Collectors.toList());
|
||||
}
|
||||
data.setListByDimensionValue(departEmployeePOS);
|
||||
}
|
||||
});
|
||||
|
||||
if (dimensionValue == null) {
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> po.getDepartmentId() == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> lastNoGroupingList = data.getLastList().stream().filter(po -> po.getDepartmentId() == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> sameNoGroupingList = data.getSameList().stream().filter(po -> po.getDepartmentId() == null).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
lastNoGroupingList = data.getLastList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
sameNoGroupingList = data.getSameList().stream().filter(po -> lastEmpIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(noGroupingList)) {
|
||||
Map<String, Object> noGrouping = new HashMap<>();
|
||||
noGrouping.put(DM, SalaryI18nUtil.getI18nLabel(153462, "无分组"));
|
||||
|
|
@ -888,7 +977,10 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
records.add(noGrouping);
|
||||
}
|
||||
} else if (StringUtils.equals(dimensionValue, "无分组")) {
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> noGroupingList = data.getList().stream().filter(po -> po.getDepartmentId() == null).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
noGroupingList = data.getList().stream().filter(po -> empIdDepartIdMap.get(po.getEmployeeId()) == null).collect(Collectors.toList());
|
||||
}
|
||||
data.setListByDimensionValue(noGroupingList);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class SalaryStatisticsEmployeeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 员工薪资列表
|
||||
* 薪资明细
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "岗位"), "jobTitle"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "员工状态"), "status"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "workCode"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "入职日期"), "companystartdate"));
|
||||
}
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "次数"), "acctTimes").setDisplay(WeaBoolAttr.FALSE));
|
||||
// columns.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 121908, "收入所得项目"), "incomeCategory"));
|
||||
|
|
@ -228,6 +229,9 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
// 获取发薪人员
|
||||
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
|
||||
List<SalaryAcctEmployeePO> employeePOS = salaryAcctEmployeePageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(employeePOS)){
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
Map<String, Object> sumResultMap = Maps.newHashMap();
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,112 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.ly.param.LySalaryReportQueryParam;
|
||||
import com.engine.salary.entity.ly.po.LyFundReportPO;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName LyFundReportService
|
||||
* @date 2024/10/18 17:07
|
||||
* @description
|
||||
*/
|
||||
public interface LyFundReportService {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<LyFundReportPO> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
LyFundReportPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param lySocialReport 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(LyFundReportPO lySocialReport);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param lySocialReport 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(LyFundReportPO lySocialReport);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param lySocialReport 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(LyFundReportPO lySocialReport);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param lySocialReport 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(LyFundReportPO lySocialReport);
|
||||
|
||||
/**
|
||||
* 生成报表数据
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
void generateFundReport(LySalaryReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 查询社保公积金汇总报表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listFundReport(LySalaryReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 社保公积金汇总报表 合计行
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
LyFundReportPO sumRow(LySalaryReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param siReportIds
|
||||
*/
|
||||
void deleteFundReport(List<Long> siReportIds);
|
||||
|
||||
/**
|
||||
* 公积金汇总报表导出
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook exportFundReport(LySalaryReportQueryParam param);
|
||||
|
||||
List<LyFundReportPO> getByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 社保公积金购买公司下拉框list
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> fundReportGmgsList(LySalaryReportQueryParam queryParam);
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public interface LyPZService {
|
|||
*
|
||||
* @param pushParam
|
||||
*/
|
||||
void pushUCAndSave(LyVoucherPushParam pushParam);
|
||||
Map<String, Object> pushUCAndSave(LyVoucherPushParam pushParam);
|
||||
|
||||
/**
|
||||
* 本地历史凭证列表
|
||||
|
|
|
|||
|
|
@ -268,4 +268,6 @@ public interface SalaryAcctEmployeeService {
|
|||
* @param salaryAcctEmployeePO
|
||||
*/
|
||||
void updateIgnoreNull(SalaryAcctEmployeePO salaryAcctEmployeePO);
|
||||
|
||||
void lock(SalaryAcctEmployeePO salaryAcctEmployeePO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ public interface SalaryAcctExcelService {
|
|||
ExcelPreviewDTO previewImportSalaryAcctResult(SalaryAcctImportParam param);
|
||||
|
||||
|
||||
void cacheImportField(List<Long> salaryItems);
|
||||
void cacheImportField(SalaryAcctResultTemplateSaveParam param);
|
||||
|
||||
void cacheExportField(List<Long> salaryItems);
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,13 @@ public interface SalaryAcctResultService {
|
|||
*/
|
||||
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndTaxAgentIds(Collection<Long> salaryAcctRecordIds, Collection<Long> taxAgentIds);
|
||||
|
||||
/**
|
||||
* 锁定单元格
|
||||
* @param param
|
||||
*/
|
||||
void lock(SalaryAcctResultLockParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 锁定项目
|
||||
*
|
||||
|
|
|
|||
|
|
@ -75,5 +75,5 @@ public interface SalaryAcctResultTemplateService {
|
|||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId);
|
||||
List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId,List<Integer> types);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface SettingService {
|
||||
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
|
||||
|
||||
Map getPageListSetting(PageListSettingQueryParam param);
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface VariableArchiveItemService {
|
||||
|
||||
List<VariableArchiveItemPO> listAll();
|
||||
/**
|
||||
* 根据浮动薪资档案id获取
|
||||
*
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public interface VariableArchiveService {
|
|||
* @param variableArchives
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> buildVariableArchiveData(Collection<VariableArchiveListDTO> variableArchives);
|
||||
List<Map<String, Object>> buildVariableArchiveData(List<VariableArchiveListDTO> variableArchives);
|
||||
|
||||
/**
|
||||
* 创建浮动薪酬档案
|
||||
|
|
@ -70,4 +70,7 @@ public interface VariableArchiveService {
|
|||
void deleteSelectVariableArchive(Collection<Long> deleteIds);
|
||||
|
||||
List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds, List<Long> taxAgentIds);
|
||||
List<Map<String, Object>> listBySalaryMonthAndEmployeeIds(YearMonth salaryMonth, List<Long> employeeIds, Long taxAgentId);
|
||||
|
||||
void updateData(VariableArchiveSaveParam updateParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,11 @@ import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
|
|||
import com.engine.salary.formlua.core.QlExpress;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
import com.engine.salary.formlua.entity.standard.ExcelResult;
|
||||
import com.engine.salary.mapper.SQLMapper;
|
||||
import com.engine.salary.service.FormulaRunService;
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.ql.util.express.DefaultContext;
|
||||
import com.ql.util.express.ExpressRunner;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -41,6 +43,9 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
|
||||
QlExpress express = new QlExpress();
|
||||
|
||||
private SQLMapper getSQLMapper(){
|
||||
return MapperProxyFactory.getProxy(SQLMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExcelResult run(ExpressFormula expressFormula, List<FormulaVar> formulaVars, DataCollectionEmployee simpleEmployee) {
|
||||
|
|
@ -123,6 +128,12 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// List<Map> list = getSQLMapper().runSQL(sql);
|
||||
// if(CollectionUtil.isNotEmpty(list)){
|
||||
// result = Util.null2String(list.get(0).get(sqlReturnKey));
|
||||
// }
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
if (rs.execute(sql)) {
|
||||
if (rs.next()) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,587 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.ly.param.LySalaryReportQueryParam;
|
||||
import com.engine.salary.entity.ly.po.LyFundReportPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctFormulaBO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.ly.LyFundReportMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName LyFundReportServiceImpl
|
||||
* @date 2024/10/18 15:10
|
||||
* @description
|
||||
*/
|
||||
public class LyFundReportServiceImpl extends Service implements LyFundReportService {
|
||||
|
||||
private LyFundReportMapper getLyFundReportMapper() {
|
||||
return MapperProxyFactory.getProxy(LyFundReportMapper.class);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LySalaryReportService getLySalaryReportService(User user) {
|
||||
return ServiceUtil.getService(LySalaryReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LyFundReportPO> listAll() {
|
||||
return getLyFundReportMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LyFundReportPO getById(Long id) {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
return getLyFundReportMapper().getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertIgnoreNull(LyFundReportPO lyFundReport) {
|
||||
if (lyFundReport != null) {
|
||||
return getLyFundReportMapper().insertIgnoreNull(lyFundReport);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(LyFundReportPO lyFundReport) {
|
||||
if (lyFundReport != null && lyFundReport.getId() != null) {
|
||||
return getLyFundReportMapper().update(lyFundReport);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIgnoreNull(LyFundReportPO lyFundReport) {
|
||||
if (lyFundReport != null && lyFundReport.getId() != null) {
|
||||
return getLyFundReportMapper().updateIgnoreNull(lyFundReport);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(LyFundReportPO lyFundReport) {
|
||||
return getLyFundReportMapper().delete(lyFundReport);
|
||||
}
|
||||
|
||||
public List<LyFundReportPO> listBySalaryMonth(Date salaryMonth) {
|
||||
if (salaryMonth == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getLyFundReportMapper().listSome(LyFundReportPO.builder().salaryMonth(salaryMonth).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateFundReport(LySalaryReportQueryParam param) {
|
||||
if (StringUtils.isBlank(param.getSalaryMonth())) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数不能为空");
|
||||
}
|
||||
Date salaryMonthDate = SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonth());
|
||||
if (salaryMonthDate == null) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数格式错误");
|
||||
}
|
||||
param.setSalaryMonthDate(salaryMonthDate);
|
||||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LyFundReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
|
||||
}
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
// 获取薪资核算结果
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordList = getSalaryAcctRecordService(user).listBySalaryMonth(LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build());
|
||||
// 过滤账套及状态
|
||||
// List<Long> salarySobIds = Arrays.stream(baseBean.getPropValue("lySalaryNCReport", "salary_sob_ids").split(",")).filter(NumberUtils::isCreatable).map(Long::valueOf).collect(Collectors.toList());
|
||||
// salaryAcctRecordList = salaryAcctRecordList.stream().filter(record -> salarySobIds.contains(record.getSalarySobId()) && record.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()).collect(Collectors.toList());
|
||||
salaryAcctRecordList = salaryAcctRecordList.stream().filter(record -> record.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctRecordList)) {
|
||||
List<Long> salaryAcctRecordIds = salaryAcctRecordList.stream().map(SalaryAcctRecordPO::getId).collect(Collectors.toList());
|
||||
// 获取薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) {
|
||||
String dataSourceStr = StringUtils.join(salaryAcctRecordIds, ",");
|
||||
// 获取薪资项目id
|
||||
List<Long> salaryItemIds = new ArrayList<>();
|
||||
// 职能项目类型
|
||||
Long znxmlxItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_znxmlx_item_id");
|
||||
salaryItemIds.add(znxmlxItemId);
|
||||
// 购买公司全称
|
||||
Long gmgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_gmgsqc_item_id");
|
||||
salaryItemIds.add(gmgsqcItemId);
|
||||
// 费用承担公司全称
|
||||
Long fycdgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_fycdgsqc_item_id");
|
||||
salaryItemIds.add(fycdgsqcItemId);
|
||||
// 职能/项目名称
|
||||
Long znxmmcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_znxmmc_item_id");
|
||||
salaryItemIds.add(znxmmcItemId);
|
||||
// 公积金-公司部分
|
||||
Long gjjgsbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gsbf_item_id");
|
||||
salaryItemIds.add(gjjgsbfItemId);
|
||||
// 公积金-个人部分
|
||||
Long gjjgrbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_grbf_item_id");
|
||||
salaryItemIds.add(gjjgrbfItemId);
|
||||
// 公积金-公积金合计
|
||||
Long gjjgjjhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gjjhj_item_id");
|
||||
salaryItemIds.add(gjjgjjhjItemId);
|
||||
// 服务费
|
||||
Long fwfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_fwf_item_id");
|
||||
salaryItemIds.add(fwfItemId);
|
||||
|
||||
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());
|
||||
// 获取薪资核算结果
|
||||
List<SalaryAcctResultPO> acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields = new ArrayList<>();
|
||||
salarySobEmpFields.add(SalarySobEmpFieldPO.builder().fieldCode("subcompanyId").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(gmgsqcItemId.toString()) == null ? " " : map.get(gmgsqcItemId.toString()).toString())
|
||||
+ "-split" + (map.get(fycdgsqcItemId.toString()) == null ? " " : map.get(fycdgsqcItemId.toString()).toString())
|
||||
+ "-split" + (map.get(znxmmcItemId.toString()) == null ? " " : map.get(znxmmcItemId.toString()).toString()));
|
||||
List<SalaryItemPO> numberItems = salaryItemList.stream().filter(item -> item.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())).collect(Collectors.toList());
|
||||
LinkedHashMap<String, Map<String, Object>> resultMap = getSumResultByGroup(resultGroup, Collections.emptyList(), numberItems, znxmlxItemId);
|
||||
|
||||
// 排序 - 根据key排序
|
||||
LinkedHashMap<String, Map<String, Object>> sortedMap = new LinkedHashMap<>();
|
||||
resultMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
|
||||
resultMap = sortedMap;
|
||||
Date now = new Date();
|
||||
resultMap.forEach((key,valueMap) -> {
|
||||
String[] split = key.split("-split");
|
||||
String gmgsqc = split.length > 0 ? split[0] : "";
|
||||
String fycdgsqc = split.length > 1 ? split[1] : "";
|
||||
String znxmmc = split.length > 2 ? split[2] : "";
|
||||
valueMap.put("gmgsqc", gmgsqc);
|
||||
valueMap.put("fycdgsqc",fycdgsqc);
|
||||
valueMap.put("znxmmc",znxmmc);
|
||||
|
||||
LyFundReportPO build = LyFundReportPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.subcompanyId(Long.valueOf(valueMap.getOrDefault("subcompanyId","0").toString()))
|
||||
.ftempNum(Integer.valueOf(valueMap.getOrDefault("empNums", "0").toString()))
|
||||
.salaryMonth(salaryMonthDate)
|
||||
.znxmlx(valueMap.getOrDefault(znxmlxItemId.toString(), "").toString())
|
||||
.gmgsqc(gmgsqc)
|
||||
.fycdgsqc(fycdgsqc)
|
||||
.znxmmc(znxmmc)
|
||||
.ftempNum(Integer.valueOf(valueMap.getOrDefault("empNums", "0").toString()))
|
||||
.gjjGsbf(valueMap.getOrDefault(gjjgsbfItemId.toString(), "0").toString())
|
||||
.gjjGrbf(valueMap.getOrDefault(gjjgrbfItemId.toString(), "0").toString())
|
||||
.gjjGjjhj(valueMap.getOrDefault(gjjgjjhjItemId.toString(), "0").toString())
|
||||
.fwf(valueMap.getOrDefault(fwfItemId.toString(), "0").toString())
|
||||
.gkgrygzhje("")
|
||||
.dataSorce(dataSourceStr)
|
||||
.gjjjtpzFlag(0)
|
||||
.gjjffpzFlag(0)
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getLyFundReportMapper().insertIgnoreNull(build);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
List<Map<String, Object>> buildData4LyReport(List<SalaryItemPO> salaryItemList, List<SalaryAcctEmployeePO> salaryAcctEmployeeList, List<SalarySobEmpFieldPO> salarySobEmpFields, List<SalaryAcctResultPO> salaryAcctResult, boolean dynamicEmpInfo) {
|
||||
List<Long> empIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(empIds);
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAll();
|
||||
return buildData4Ly(salaryItemList, salarySobEmpFields, employeeList, salaryAcctEmployeeList, salaryAcctResult, taxAgentPOS, dynamicEmpInfo);
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> buildData4Ly(List<SalaryItemPO> salaryItems,
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields,
|
||||
List<DataCollectionEmployee> simpleEmployees,
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees,
|
||||
List<SalaryAcctResultPO> salaryAccountingResults,
|
||||
List<TaxAgentPO> taxAgents,
|
||||
boolean dynamicEmpInfo) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
SalaryI18nUtil.i18nList(salaryAcctEmployees);
|
||||
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
return salaryAcctEmployees.stream().map(e -> {
|
||||
Map<Long, Object> resultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(e.getId(), Collections.emptyList()),
|
||||
SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
|
||||
// 薪资项目的值
|
||||
Map<String, Object> map = SalaryEntityUtil.convert2Map(salaryItems, o -> "" + o.getId(), o -> resultValueMap.getOrDefault(o.getId(), StringUtils.EMPTY));
|
||||
// 人员信息字段的值
|
||||
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()), e, true);
|
||||
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
|
||||
// 员工信息字段的字段类型
|
||||
if (dynamicEmpInfo) {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
} else {
|
||||
if ("departmentName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentName", e.getDepartmentName());
|
||||
} else if ("departmentId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentId", e.getDepartmentId());
|
||||
} else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("subcompanyName", e.getSubcompanyName());
|
||||
} else if ("subcompanyId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("subcompanyId", e.getSubcompanyId());
|
||||
} else if ("jobcall".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcall", e.getJobcall());
|
||||
} else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcallId", e.getJobcallId());
|
||||
} else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleName", e.getJobtitleName());
|
||||
} else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleId", e.getJobtitleId());
|
||||
} else if ("status".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("status", e.getStatus());
|
||||
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(e.getStatus())));
|
||||
} else {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
}
|
||||
}
|
||||
map.put(salarySobEmpField.getFieldCode() + "_type", SalaryDataTypeEnum.STRING.getValue());
|
||||
}
|
||||
// 主键id
|
||||
map.put("id", e.getId());
|
||||
//人员id
|
||||
map.put("employeeId", e.getEmployeeId());
|
||||
map.put("userName", fieldValueMap.get("username"));
|
||||
// 个税扣缴义务人
|
||||
String taxAgentName = taxAgentNameMap.getOrDefault(e.getTaxAgentId(), StringUtils.EMPTY);
|
||||
map.put("taxAgentName", taxAgentName);
|
||||
map.put("taxAgentId", e.getTaxAgentId());
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Map<String, Object>> getSumResultByGroup(Map<String, List<Map<String, Object>>> groupBy,
|
||||
List<SalarySobItemPO> salarySobItemPOS,
|
||||
List<SalaryItemPO> numberItems,
|
||||
Long znxmlxItemId) {
|
||||
LinkedHashMap<String, Map<String, Object>> result = new LinkedHashMap<>();
|
||||
// 本次薪资核算所用的薪资账套下的薪资项目
|
||||
Map<Long, SalarySobItemPO> salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
for(Map.Entry<String, List<Map<String, Object>>> entrySet : groupBy.entrySet()){
|
||||
// 每个分类中的核算数据
|
||||
List<Map<String, Object>> value = entrySet.getValue();
|
||||
|
||||
Map<String, Object> itemSum = new HashMap<>();
|
||||
numberItems.forEach(item -> {
|
||||
List<String> itemValue = value.stream().filter(v -> v.get(item.getId().toString()) != null).map(v -> (String)v.get(item.getId().toString())).collect(Collectors.toList());
|
||||
BigDecimal sum = itemValue
|
||||
.stream()
|
||||
.filter(NumberUtils::isCreatable)
|
||||
.map(BigDecimal::new)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
itemSum.put( item.getId().toString(), SalaryAcctFormulaBO.roundResultValue(sum.toString(), item, Collections.emptyList(), Collections.emptyMap(), salaryItemIdKeySalarySobItemPOMap) );
|
||||
});
|
||||
itemSum.put("empNums", entrySet.getValue().size());
|
||||
itemSum.put("userName", CollectionUtils.isEmpty(value) ? "" : value.get(0).get("userName"));
|
||||
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"));
|
||||
if (znxmlxItemId != null) {
|
||||
Map<String, Object> map = value.get(0);
|
||||
String znxmlx = map.get(znxmlxItemId.toString()) == null ? "" : map.get(znxmlxItemId.toString()).toString();
|
||||
itemSum.put(znxmlxItemId.toString(), znxmlx);
|
||||
}
|
||||
|
||||
result.put(entrySet.getKey(), itemSum);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private Long getPropLongValue (BaseBean baseBean, String propFileName, String key ){
|
||||
return NumberUtils.isCreatable(baseBean.getPropValue(propFileName, key))
|
||||
? Long.valueOf(baseBean.getPropValue(propFileName, key)) : 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listFundReport(LySalaryReportQueryParam param) {
|
||||
if (StringUtils.isBlank(param.getSalaryMonth())) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数不能为空");
|
||||
}
|
||||
Date salaryMonthDate = SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonth());
|
||||
if (salaryMonthDate == null) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数格式错误");
|
||||
}
|
||||
param.setSalaryMonthDate(salaryMonthDate);
|
||||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
// 分权
|
||||
// 是否是薪酬总管理员
|
||||
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
if (!isChief) {
|
||||
List<String> canManageFrztByUid = getLySalaryReportService(user).getCanManageFrztByUid(user);
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(po -> canManageFrztByUid.contains(po.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
PageInfo<LyFundReportPO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize());
|
||||
if (param.isExport()) {
|
||||
// 是导出
|
||||
pageInfo.setList(lyFundReportPOS);
|
||||
} else {
|
||||
pageInfo.setTotal(lyFundReportPOS.size());
|
||||
pageInfo.setList(SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), lyFundReportPOS));
|
||||
}
|
||||
pageInfo.getList().stream().forEach(po -> {
|
||||
po.setGjjffpzFlagStr((po.getGjjffpzFlag() != null && po.getGjjffpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
|
||||
po.setGjjjtpzFlagStr((po.getGjjjtpzFlag() != null && po.getGjjjtpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
|
||||
});
|
||||
List<WeaTableColumnGroup> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumnGroup("150px", "购买公司全称", "gmgsqc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "分摊人数", "ftempNum"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "费用承担公司全称", "fycdgsqc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "职能/项目名称", "znxmmc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "费用所属期", "salaryMonth"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "计提状态", "gjjjtpzFlagStr"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "发放状态", "gjjffpzFlagStr"));
|
||||
|
||||
WeaTableColumnGroup gjjGroup = new WeaTableColumnGroup("150px", "公积金", "公积金");
|
||||
List<WeaTableColumnGroup> gjjChildList = new ArrayList<>();
|
||||
gjjChildList.add(new WeaTableColumnGroup("150px", "公司部分", "gjjGsbf"));
|
||||
gjjChildList.add(new WeaTableColumnGroup("150px", "个人部分", "gjjGrbf"));
|
||||
gjjChildList.add(new WeaTableColumnGroup("150px", "公积金合计", "gjjGjjhj"));
|
||||
gjjGroup.setChildren(gjjChildList);
|
||||
columns.add(gjjGroup);
|
||||
|
||||
columns.add(new WeaTableColumnGroup("150px", "服务费", "fwf"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "挂靠个人应该转回金额", "gkgrygzhje"));
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("data", pageInfo);
|
||||
resultMap.put("columns", columns);
|
||||
// 导出包含合计行
|
||||
if(param.isExport()) {
|
||||
LyFundReportPO sumData = buildSumData(pageInfo.getList());
|
||||
resultMap.put("sum", sumData);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LyFundReportPO sumRow(LySalaryReportQueryParam param) {
|
||||
if (StringUtils.isBlank(param.getSalaryMonth())) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数不能为空");
|
||||
}
|
||||
Date salaryMonthDate = SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonth());
|
||||
if (salaryMonthDate == null) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数格式错误");
|
||||
}
|
||||
param.setSalaryMonthDate(salaryMonthDate);
|
||||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 分权
|
||||
// 是否是薪酬总管理员
|
||||
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
if (!isChief) {
|
||||
List<String> canManageFrztByUid = getLySalaryReportService(user).getCanManageFrztByUid(user);
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(po -> canManageFrztByUid.contains(po.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
return buildSumData(lyFundReportPOS);
|
||||
}
|
||||
|
||||
|
||||
private LyFundReportPO buildSumData (List<LyFundReportPO> lyFundReportPOS ) {
|
||||
Map<String, BigDecimal> map = new HashMap<>();
|
||||
lyFundReportPOS.stream().forEach(reportPO -> {
|
||||
BigDecimal empNum = reportPO.getFtempNum() == null ? BigDecimal.ZERO : new BigDecimal(reportPO.getFtempNum()) ;
|
||||
map.put("empNum" ,map.getOrDefault("empNum", BigDecimal.valueOf(0)).add(empNum));
|
||||
BigDecimal gjjGsbf = NumberUtils.isCreatable(reportPO.getGjjGsbf()) ? new BigDecimal(reportPO.getGjjGsbf()) : BigDecimal.ZERO;
|
||||
map.put("gjjGsbf" ,map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).add(gjjGsbf));
|
||||
BigDecimal gjjGrbf = NumberUtils.isCreatable(reportPO.getGjjGrbf()) ? new BigDecimal(reportPO.getGjjGrbf()) : BigDecimal.ZERO;
|
||||
map.put("gjjGrbf" ,map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).add(gjjGrbf));
|
||||
BigDecimal gjjGjjhj = NumberUtils.isCreatable(reportPO.getGjjGjjhj()) ? new BigDecimal(reportPO.getGjjGjjhj()) : BigDecimal.ZERO;
|
||||
map.put("gjjGjjhj" ,map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).add(gjjGjjhj));
|
||||
BigDecimal fwf = NumberUtils.isCreatable(reportPO.getFwf()) ? new BigDecimal(reportPO.getFwf()) : BigDecimal.ZERO;
|
||||
map.put("fwf" ,map.getOrDefault("fwf", BigDecimal.valueOf(0)).add(fwf));
|
||||
});
|
||||
|
||||
return LyFundReportPO.builder()
|
||||
.ftempNum(map.getOrDefault("empNum", BigDecimal.ZERO).intValue())
|
||||
.gjjGsbf(map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).toString())
|
||||
.gjjGrbf(map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).toString())
|
||||
.gjjGjjhj(map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).toString())
|
||||
.fwf(map.getOrDefault("fwf", BigDecimal.valueOf(0)).toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFundReport(List<Long> fundReportIds) {
|
||||
if (CollectionUtils.isEmpty(fundReportIds)) {
|
||||
return;
|
||||
}
|
||||
List<LyFundReportPO> lyFundReportPOS = getLyFundReportMapper().listSome(LyFundReportPO.builder().ids(fundReportIds).build());
|
||||
List<LyFundReportPO> canNotDeleteList = lyFundReportPOS.stream().filter(report -> report.getGjjjtpzFlag().equals(NumberUtils.INTEGER_ONE) || report.getGjjffpzFlag().equals(NumberUtils.INTEGER_ONE)).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(canNotDeleteList)) {
|
||||
throw new SalaryRunTimeException("当前所选记录中,已生成凭证数据,请联系系统管理员删除相关数据");
|
||||
}
|
||||
deleteByIds(fundReportIds);
|
||||
}
|
||||
|
||||
private void deleteByIds (List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
getLyFundReportMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportFundReport(LySalaryReportQueryParam param) {
|
||||
param.setExport(true);
|
||||
Map<String, Object> resultMap = listFundReport(param);
|
||||
List<LyFundReportPO> dataList = ((PageInfo<LyFundReportPO>)resultMap.get("data")).getList();
|
||||
List<WeaTableColumnGroup> columns = (List<WeaTableColumnGroup>)resultMap.get("columns");
|
||||
LyFundReportPO sum = (LyFundReportPO)resultMap.get("sum");
|
||||
sum.setGmgsqc("合计");
|
||||
dataList.add(sum);
|
||||
|
||||
List<Object> headerList = new ArrayList<>(columns);
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
|
||||
for (LyFundReportPO lySocialReportPO : dataList) {
|
||||
List<Object> row = Lists.newArrayList();
|
||||
row.add(lySocialReportPO.getGmgsqc() == null ? "" : lySocialReportPO.getGmgsqc().toString());
|
||||
row.add(lySocialReportPO.getFtempNum() == null ? "" : lySocialReportPO.getFtempNum().toString());
|
||||
row.add(lySocialReportPO.getFycdgsqc() == null ? "" : lySocialReportPO.getFycdgsqc().toString());
|
||||
row.add(lySocialReportPO.getZnxmmc() == null ? "" : lySocialReportPO.getZnxmmc().toString());
|
||||
row.add(param.getSalaryMonth());
|
||||
row.add(lySocialReportPO.getGjjGsbf() == null ? "" : lySocialReportPO.getGjjGsbf());
|
||||
row.add(lySocialReportPO.getGjjGrbf() == null ? "" : lySocialReportPO.getGjjGrbf());
|
||||
row.add(lySocialReportPO.getGjjGjjhj() == null ? "" : lySocialReportPO.getGjjGjjhj());
|
||||
row.add(lySocialReportPO.getFwf() == null ? "" : lySocialReportPO.getFwf());
|
||||
rows.add(row);
|
||||
}
|
||||
|
||||
//获取excel
|
||||
return ExcelUtilPlus.genWorkbookWithChildTitleColumn(rows, "公积金统计报表", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LyFundReportPO> getByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
List<List<Long>> partition = Lists.partition(ids, 1000);
|
||||
List<LyFundReportPO> resultList = new ArrayList<>();
|
||||
partition.forEach(part -> {
|
||||
resultList.addAll(getLyFundReportMapper().listSome(LyFundReportPO.builder().ids(part).build()));
|
||||
});
|
||||
return resultList;
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> fundReportGmgsList(LySalaryReportQueryParam param) {
|
||||
if (StringUtils.isBlank(param.getSalaryMonth())) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数不能为空");
|
||||
}
|
||||
Date salaryMonthDate = SalaryDateUtil.dateStrToLocalYearMonth(param.getSalaryMonth());
|
||||
if (salaryMonthDate == null) {
|
||||
throw new SalaryRunTimeException("薪资所属月参数格式错误");
|
||||
}
|
||||
param.setSalaryMonthDate(salaryMonthDate);
|
||||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
// 分权
|
||||
// 是否是薪酬总管理员
|
||||
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
if (!isChief) {
|
||||
List<String> canManageFrztByUid = getLySalaryReportService(user).getCanManageFrztByUid(user);
|
||||
lyFundReportPOS = lyFundReportPOS.stream().filter(po -> canManageFrztByUid.contains(po.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 获取所有能够管理的发放公司
|
||||
return lyFundReportPOS.stream()
|
||||
.map(LyFundReportPO::getGmgsqc)
|
||||
.distinct()
|
||||
.map(m -> {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("id", String.valueOf(m));
|
||||
map.put("content", m);
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -6,10 +6,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.ly.dto.LyFzhsBrowser;
|
||||
import com.engine.salary.entity.ly.dto.LyFzhsInfo;
|
||||
import com.engine.salary.entity.ly.dto.LyPzPreview;
|
||||
import com.engine.salary.entity.ly.dto.LyVoucherDetailDTO;
|
||||
import com.engine.salary.entity.ly.dto.*;
|
||||
import com.engine.salary.entity.ly.param.*;
|
||||
import com.engine.salary.entity.ly.po.*;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
|
|
@ -31,10 +28,15 @@ import com.engine.salary.util.db.IdGenerator;
|
|||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.xml.XStreamUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
|
@ -63,6 +65,10 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
return ServiceUtil.getService(LySocialReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LyFundReportService getLyFundReportService(User user) {
|
||||
return ServiceUtil.getService(LyFundReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private FormulaRunService getFormulaRunService(User user) {
|
||||
return ServiceUtil.getService(FormulaRunServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -289,15 +295,18 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
}
|
||||
List<LyFzhsBrowser> lyFzhsBrowserList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String fzhslxFieldId = baseBean.getPropValue("lySalaryNCVoucher", "fzhslx_field_id");
|
||||
List<List<String>> partition = Lists.partition(fzhsBmList, 500);
|
||||
partition.forEach(part -> {
|
||||
String bmIdStr = StringUtils.join(part, "','");
|
||||
rs.execute("SELECT fzhslx,bh,mc FROM uf_ncfuhs where bh in ('" + bmIdStr + "')");
|
||||
rs.execute("SELECT b.SELECTNAME,fzhslx,fzhslxbh,bh,mc FROM uf_ncfuhs a left join workflow_selectitem b on a.fzhslx= b.selectvalue where bh in ('" + bmIdStr + "') and fieldid= " +fzhslxFieldId );
|
||||
while (rs.next()) {
|
||||
LyFzhsBrowser browser = new LyFzhsBrowser();
|
||||
browser.setFzhslx(LyPZTypeEnum.getDefaultLabelByValue(rs.getInt("fzhslx")));
|
||||
browser.setFzhslx(rs.getString("SELECTNAME"));
|
||||
browser.setBh(rs.getString("bh"));
|
||||
browser.setMc(rs.getString("mc"));
|
||||
browser.setFzhslxbh(rs.getString("fzhslxbh"));
|
||||
lyFzhsBrowserList.add(browser);
|
||||
}
|
||||
});
|
||||
|
|
@ -333,9 +342,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
BaseBean baseBean = new BaseBean();
|
||||
String fzhslxFieldId = baseBean.getPropValue("lySalaryNCVoucher", "fzhslx_field_id");
|
||||
if (queryParam.getFzhslx() == null ) {
|
||||
rs.execute("select bh,mc,fzhslx,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId );
|
||||
rs.execute("select bh,mc,fzhslx,fzhslxbh,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId );
|
||||
} else {
|
||||
rs.execute("select bh,mc,fzhslx,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId + "and a.fzhslx = "+ queryParam.getFzhslx());
|
||||
rs.execute("select bh,mc,fzhslx,fzhslxbh,b.selectname from uf_NCfuhs a left join workflow_selectitem b on a. fzhslx= b.SELECTVALUE where b.FIELDID=" + fzhslxFieldId + " and a.fzhslx = "+ queryParam.getFzhslx());
|
||||
}
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
|
|
@ -348,6 +357,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
resultMap.put("bh", rs.getString("bh"));
|
||||
resultMap.put("mc", rs.getString("mc"));
|
||||
resultMap.put("fzhslx", rs.getString("selectname"));
|
||||
resultMap.put("fzhslxbh", rs.getString("fzhslxbh"));
|
||||
resultList.add(resultMap);
|
||||
}
|
||||
}
|
||||
|
|
@ -384,8 +394,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
}
|
||||
formulaVarsList.add(formulaVars);
|
||||
}
|
||||
} else {
|
||||
// 是社保公积金凭证
|
||||
} else if (queryParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue()) || queryParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue())) {
|
||||
// 是社保凭证
|
||||
Map<String, Object> resultMap = getLySocialReportService(user).listSIReport(LySalaryReportQueryParam.builder().salaryMonth(queryParam.getSalaryMonth()).ffgsqc(Collections.singletonList(queryParam.getFfgsqc())).export(true).build());
|
||||
List<LySocialReportPO> dataList = ((PageInfo<LySocialReportPO>)resultMap.get("data")).getList();
|
||||
// 将每一个结果转换成map的格式并作为变量存储
|
||||
|
|
@ -406,6 +416,28 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
}
|
||||
formulaVarsList.add(formulaVars);
|
||||
}
|
||||
} else if (queryParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue()) || queryParam.getPzlx().equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
|
||||
// 是公积金凭证
|
||||
Map<String, Object> resultMap = getLyFundReportService(user).listFundReport(LySalaryReportQueryParam.builder().salaryMonth(queryParam.getSalaryMonth()).ffgsqc(Collections.singletonList(queryParam.getFfgsqc())).export(true).build());
|
||||
List<LyFundReportPO> dataList = ((PageInfo<LyFundReportPO>)resultMap.get("data")).getList();
|
||||
// 将每一个结果转换成map的格式并作为变量存储
|
||||
for (LyFundReportPO po : dataList) {
|
||||
reportDataIds.add(po.getId());
|
||||
Map<String, Object> dataMap = BeanUtil.beanToMap(po);
|
||||
List<FormulaVar> formulaVars = new ArrayList<>();
|
||||
for (Map.Entry<String,Object> entry : dataMap.entrySet()) {
|
||||
FormulaVar build = FormulaVar.builder()
|
||||
.fieldId(entry.getKey())
|
||||
.content(Util.null2String(entry.getValue()))
|
||||
.fieldType(DataType.NUMBER)
|
||||
.build();
|
||||
if(entry.getKey().equals("ffgsqc") || entry.getKey().equals("fycdgsqc") || entry.getKey().equals("znxmmc")) {
|
||||
build.setFieldType(DataType.STRING);
|
||||
}
|
||||
formulaVars.add(build);
|
||||
}
|
||||
formulaVarsList.add(formulaVars);
|
||||
}
|
||||
}
|
||||
return formulaVarsList;
|
||||
}
|
||||
|
|
@ -597,7 +629,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
* @param pushParam
|
||||
*/
|
||||
@Override
|
||||
public void pushUCAndSave(LyVoucherPushParam pushParam) {
|
||||
public Map<String, Object> pushUCAndSave(LyVoucherPushParam pushParam) {
|
||||
// 校验会计科目是否合法
|
||||
verifyKjkm(pushParam);
|
||||
// 推送凭证
|
||||
|
|
@ -605,7 +637,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
// 推送成功后修改报表数据的凭证生成状态
|
||||
updateReportStatus(pushParam);
|
||||
// 推送成功后保存凭证
|
||||
saveVoucher(pushParam);
|
||||
return saveVoucher(pushParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -625,20 +657,25 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
}
|
||||
getLySalaryReportService(user).update(po);
|
||||
});
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue())
|
||||
|| pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue())) {
|
||||
List<LySocialReportPO> socialReportList = getLySocialReportService(user).getByIds(dataSource);
|
||||
socialReportList.stream().forEach(po -> {
|
||||
if (pushParam.getPzlx().equals(LyPZTypeEnum.SBJTPZ.getValue())) {
|
||||
po.setSbjtpzFlag(NumberUtils.INTEGER_ONE);
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.SBFFPZ.getValue())) {
|
||||
po.setSbffpzFlag(NumberUtils.INTEGER_ONE);
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue())) {
|
||||
}
|
||||
getLySocialReportService(user).update(po);
|
||||
});
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue()) || pushParam.getPzlx().equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
|
||||
List<LyFundReportPO> fundReportList = getLyFundReportService(user).getByIds(dataSource);
|
||||
fundReportList.stream().forEach(po -> {
|
||||
if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJJTPZ.getValue())) {
|
||||
po.setGjjjtpzFlag(NumberUtils.INTEGER_ONE);
|
||||
} else if (pushParam.getPzlx().equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
|
||||
po.setGjjffpzFlag(NumberUtils.INTEGER_ONE);
|
||||
}
|
||||
getLySocialReportService(user).update(po);
|
||||
getLyFundReportService(user).update(po);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -647,7 +684,8 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
* 保存凭证
|
||||
* @param pushParam
|
||||
*/
|
||||
private void saveVoucher(LyVoucherPushParam pushParam) {
|
||||
private Map<String, Object> saveVoucher(LyVoucherPushParam pushParam) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
Date now = new Date();
|
||||
long mainId = IdGenerator.generate();
|
||||
LyVoucherPO voucher = LyVoucherPO
|
||||
|
|
@ -673,11 +711,11 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
.voucherId(mainId)
|
||||
.zy(detail.getZy())
|
||||
.kjkmId(detail.getKjkm())
|
||||
.fzhsXmqsBm(detail.getFzhsXmqs())
|
||||
.fzhsFwlbBm(detail.getFzhsFwlb())
|
||||
.fzhsSllbBm(detail.getFzhsSllb())
|
||||
.fzhsKsBm(detail.getFzhsKs())
|
||||
.fzhsOtherBms(CollectionUtils.isEmpty(detail.getFzhsOtherBmList()) ? "" : StringUtils.join(detail.getFzhsOtherBmList(), ","))
|
||||
.fzhsXmqsBm(detail.getFzhsXmqs().getBh())
|
||||
.fzhsFwlbBm(detail.getFzhsFwlb().getBh())
|
||||
.fzhsSllbBm(detail.getFzhsSllb().getBh())
|
||||
.fzhsKsBm(detail.getFzhsKs().getBh())
|
||||
.fzhsOtherBms(CollectionUtils.isEmpty(detail.getFzhsOtherBmList()) ? "" : detail.getFzhsOtherBmList().stream().map(LyFzhsBrowser::getBh).collect(Collectors.joining(",")) )
|
||||
.jfValue(detail.getJfValue())
|
||||
.dfValue(detail.getDfValue())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
|
|
@ -686,7 +724,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
.deleteType(0).build();
|
||||
getLyVoucherDetailMapper().insertIgnoreNull(voucherDetail);
|
||||
});
|
||||
|
||||
resultMap.put("status", (pushParam.getStatus() != null && pushParam.getStatus().equals(NumberUtils.INTEGER_ONE)) ? Boolean.TRUE : Boolean.FALSE);
|
||||
resultMap.put("errMsg", pushParam.getPushMsg());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -694,222 +734,234 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
* @param pushParam
|
||||
*/
|
||||
private void pushVoucher(LyVoucherPushParam pushParam) {
|
||||
pushParam.setStatus(NumberUtils.INTEGER_ONE);
|
||||
pushParam.setPushMsg("推送成功");
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.setTime(new Date());
|
||||
//
|
||||
// LyNCVoucher lyNCVoucher = new LyNCVoucher();
|
||||
// // 凭证类别 非空 (凭证类别)
|
||||
// lyNCVoucher.setPkVouchertype("01");
|
||||
// // 会计年度 非空
|
||||
// lyNCVoucher.setYear(String.valueOf(cal.get(Calendar.YEAR)));
|
||||
// // 来源系统 非空 只支持模块编号
|
||||
// lyNCVoucher.setPkSystem("GL");
|
||||
// // 凭证类型值 0:正常凭证 3:数量调整凭证 不可空
|
||||
// lyNCVoucher.setVoucherkind("0");
|
||||
// // 核算账簿 非空 (账簿_财务核算账簿)
|
||||
// lyNCVoucher.setPkAccountingbook("201-0003");
|
||||
// // 会计期间 非空
|
||||
// lyNCVoucher.setPeriod("02");
|
||||
// // 制单日期 非空
|
||||
// lyNCVoucher.setPrepareddate("2024-02-22 00:00:00");
|
||||
// // 制单人 非空 (用户)
|
||||
// lyNCVoucher.setPkPrepared("fw");
|
||||
// //所属组织 非空 (组织)
|
||||
// lyNCVoucher.setPkOrg("101");
|
||||
// lyNCVoucher.setDiscardflag("N");
|
||||
//
|
||||
//
|
||||
// List<LyVoucherDetailPushParam> jfDetailList = new ArrayList<>();
|
||||
// List<LyVoucherDetailPushParam> dfDetailList = new ArrayList<>();
|
||||
// pushParam.getDetails().stream().forEach(detail -> {
|
||||
// if ((StringUtils.isNotBlank(detail.getJfValue())) && (!"0.00".equals(detail.getJfValue()))) {
|
||||
// jfDetailList.add(detail);
|
||||
// } else {
|
||||
// dfDetailList.add(detail);
|
||||
// }
|
||||
// });
|
||||
// ArrayList<LyNCVoucherDetail> lyNCVoucherDetailList = new ArrayList<>();
|
||||
// // 借方分录
|
||||
// for (int i = 0; i < jfDetailList.size(); i++) {
|
||||
// LyVoucherDetailPushParam detailParam = jfDetailList.get(i);
|
||||
// LyNCVoucherDetail lyNCVoucherDetail = new LyNCVoucherDetail();
|
||||
// // 分录号 非空
|
||||
// lyNCVoucherDetail.setDetailindex(String.valueOf(i+1));
|
||||
// // 摘要 非空
|
||||
// lyNCVoucherDetail.setExplanation(detailParam.getZy());
|
||||
// // 折本汇率
|
||||
// lyNCVoucherDetail.setExcrate2("1");
|
||||
// // 原币借方金额
|
||||
// lyNCVoucherDetail.setDebitamount(detailParam.getJfValue());
|
||||
// // 本币借方金额 可空
|
||||
// lyNCVoucherDetail.setLocaldebitamount(detailParam.getJfValue());
|
||||
// // 币种 非空
|
||||
// lyNCVoucherDetail.setPkCurrtype("CNY");
|
||||
// // 科目 非空
|
||||
// String kjkm = detailParam.getKjkm();
|
||||
// String kjkmbm = kjkm.split("\\\\")[0];
|
||||
// lyNCVoucherDetail.setPkAccasoa(kjkmbm);
|
||||
// // 辅助核算
|
||||
// List<LyNCVoucherAss> lyNCVoucherAssList = new ArrayList<>();
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsXmqs())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsXmqs());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsFwlb())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsFwlb());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsSllb())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsSllb());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsKs())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsKs());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// lyNCVoucherDetail.setAss(lyNCVoucherAssList);
|
||||
// lyNCVoucherDetailList.add(lyNCVoucherDetail);
|
||||
// }
|
||||
//
|
||||
// // 贷方分录
|
||||
// for (int i = 0; i < dfDetailList.size(); i++) {
|
||||
// LyVoucherDetailPushParam detailParam = dfDetailList.get(i);
|
||||
// LyNCVoucherDetail lyNCVoucherDetail = new LyNCVoucherDetail();
|
||||
// // 分录号 非空
|
||||
// lyNCVoucherDetail.setDetailindex(lyNCVoucherDetailList.size() + String.valueOf(i+1));
|
||||
// // 摘要 非空
|
||||
// lyNCVoucherDetail.setExplanation(detailParam.getZy());
|
||||
// // 折本汇率
|
||||
// lyNCVoucherDetail.setExcrate2("1");
|
||||
// // 原币借方金额
|
||||
// lyNCVoucherDetail.setCreditamount(detailParam.getDfValue());
|
||||
// // 本币借方金额 可空
|
||||
// lyNCVoucherDetail.setLocalcreditamount(detailParam.getDfValue());
|
||||
// // 币种 非空
|
||||
// lyNCVoucherDetail.setPkCurrtype("CNY");
|
||||
// // 科目 非空
|
||||
// String kjkm = detailParam.getKjkm();
|
||||
// String kjkmbm = kjkm.split("\\\\")[0];
|
||||
// lyNCVoucherDetail.setPkAccasoa(kjkmbm);
|
||||
// // 辅助核算
|
||||
// List<LyNCVoucherAss> lyNCVoucherAssList = new ArrayList<>();
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsXmqs())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsXmqs());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsFwlb())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsFwlb());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsSllb())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsSllb());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(detailParam.getFzhsKs())) {
|
||||
// LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// ass.setPkChecktype("");
|
||||
// ass.setPkCheckvalue(detailParam.getFzhsKs());
|
||||
// lyNCVoucherAssList.add(ass);
|
||||
// }
|
||||
// lyNCVoucherDetail.setAss(lyNCVoucherAssList);
|
||||
// lyNCVoucherDetailList.add(lyNCVoucherDetail);
|
||||
// }
|
||||
// lyNCVoucher.setDetails(lyNCVoucherDetailList);
|
||||
// LyNCVoucherHead voucherHead = new LyNCVoucherHead();
|
||||
// voucherHead.setVoucherHead(lyNCVoucher);
|
||||
//
|
||||
// LyNCVoucherUfinterface lyNCVoucherUfinterface = new LyNCVoucherUfinterface();
|
||||
// lyNCVoucherUfinterface.setVoucher(voucherHead);
|
||||
// lyNCVoucherUfinterface.setAccount("develop");
|
||||
// lyNCVoucherUfinterface.setBilltype("vouchergl");
|
||||
// lyNCVoucherUfinterface.setBusinessunitcode("develop");
|
||||
// lyNCVoucherUfinterface.setFilename("");
|
||||
// lyNCVoucherUfinterface.setGroupcode("");
|
||||
// lyNCVoucherUfinterface.setIsexchange("");
|
||||
// lyNCVoucherUfinterface.setOrgcode("");
|
||||
// lyNCVoucherUfinterface.setReceiver("0001121000000000JIYO");
|
||||
// lyNCVoucherUfinterface.setReplace("");
|
||||
// lyNCVoucherUfinterface.setRoottag("");
|
||||
// lyNCVoucherUfinterface.setSender("OA");
|
||||
//
|
||||
// String xml = "<?xml version=\"1.0\" encoding='UTF-8'?>" + XStreamUtil.marshal(lyNCVoucherUfinterface);
|
||||
// System.out.println(xml);
|
||||
//
|
||||
//
|
||||
// HttpClient httpClient = new HttpClient();
|
||||
// PostMethod httpPost = new PostMethod("http://172.18.0.10:8090/service/XChangeServlet?account=002&groupcode=leading");
|
||||
// httpPost.setRequestHeader("content-type", "application/json;charset=utf-8");
|
||||
//
|
||||
// String result = "";
|
||||
// try {
|
||||
// RequestEntity entity = new StringRequestEntity(xml, "application/json", "UTF-8");
|
||||
// httpPost.setRequestEntity(entity);
|
||||
// httpClient.executeMethod(httpPost);
|
||||
// result = httpPost.getResponseBodyAsString();
|
||||
// System.out.println(result);
|
||||
// LyNCVoucherReturn lyNCVoucherReturn = XStreamUtil.unmarshal(LyNCVoucherReturn.class, result);
|
||||
// System.out.println(lyNCVoucherReturn);
|
||||
//
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// System.out.println("d");
|
||||
// }
|
||||
// throw new SalaryRunTimeException("hi");
|
||||
Date salaryDate = SalaryDateUtil.dateStrToLocalYearMonth(pushParam.getSalaryMonth());
|
||||
if (salaryDate == null) {
|
||||
throw new SalaryRunTimeException("薪资所属月为空");
|
||||
}
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(salaryDate);
|
||||
BaseBean baseBean = new BaseBean();
|
||||
LyNCVoucher lyNCVoucher = new LyNCVoucher();
|
||||
// 凭证类别 非空 (凭证类别)
|
||||
String pkVoucherType = baseBean.getPropValue("lySalaryNCVoucherPushParam", "pk_voucher_type");
|
||||
lyNCVoucher.setPkVouchertype(pkVoucherType);
|
||||
// 会计年度 非空
|
||||
lyNCVoucher.setYear(String.valueOf(cal.get(Calendar.YEAR)));
|
||||
// 来源系统 非空 只支持模块编号
|
||||
String pkSystem = baseBean.getPropValue("lySalaryNCVoucherPushParam", "pk_system");
|
||||
lyNCVoucher.setPkSystem(pkSystem);
|
||||
// 凭证类型值 0:正常凭证 3:数量调整凭证 不可空
|
||||
String voucherKind = baseBean.getPropValue("lySalaryNCVoucherPushParam", "voucher_kind");
|
||||
lyNCVoucher.setVoucherkind(voucherKind);
|
||||
// 核算账簿 非空 (账簿_财务核算账簿)
|
||||
lyNCVoucher.setPkAccountingbook(pushParam.getZbbm());
|
||||
// lyNCVoucher.setPkAccountingbook("12re23r32");
|
||||
// 会计期间 非空
|
||||
lyNCVoucher.setPeriod(String.valueOf(cal.get(Calendar.MONTH)+1));
|
||||
// 制单日期 非空
|
||||
lyNCVoucher.setPrepareddate(SalaryDateUtil.getFormatLocalDateTime(new Date()));
|
||||
// 制单人 非空 (用户)
|
||||
String pkPrepared = baseBean.getPropValue("lySalaryNCVoucherPushParam", "pk_prepared");
|
||||
lyNCVoucher.setPkPrepared(pkPrepared);
|
||||
//所属组织 非空 (组织)
|
||||
lyNCVoucher.setPkOrg(pushParam.getZbbm().split("-")[0]);
|
||||
// lyNCVoucher.setPkOrg("201");
|
||||
lyNCVoucher.setDiscardflag("N");
|
||||
|
||||
|
||||
// test 生成xml
|
||||
// List<LyVoucherAss> assList = new ArrayList<>();
|
||||
// assList.add(LyVoucherAss.builder()
|
||||
// .pkChecktype("first")
|
||||
// .pkCheckvalue("ff")
|
||||
// .build());
|
||||
// assList.add(LyVoucherAss.builder()
|
||||
// .pkChecktype("second")
|
||||
// .pkCheckvalue("fd")
|
||||
// .build());
|
||||
//
|
||||
// List<LyVoucherDetail> lyVoucherDetails = new ArrayList<>();
|
||||
// lyVoucherDetails.add(LyVoucherDetail.builder()
|
||||
// .detailindex("what")
|
||||
// .explanation("hfdsuhfad")
|
||||
// .debitamount("1000")
|
||||
// .pkCurrtype("RMB")
|
||||
// .pkAccasoa("kemu")
|
||||
// .ass(assList)
|
||||
// .build());
|
||||
//
|
||||
// LyVoucher build = LyVoucher.builder()
|
||||
// .pkVoucher("123")
|
||||
// .pkVouchertype("type")
|
||||
// .year("2024")
|
||||
// .pkSystem("system")
|
||||
// .voucherkind("0")
|
||||
// .pkAccountingbook("1")
|
||||
// .period("04")
|
||||
// .prepareddate("2024-08-01")
|
||||
// .pkPrepared("par")
|
||||
// .pkOrg("org")
|
||||
// .details(lyVoucherDetails)
|
||||
// .build();
|
||||
//
|
||||
// String xml = XStreamUtil.marshal(build);
|
||||
// System.out.println(xml);
|
||||
List<LyVoucherDetailPushParam> jfDetailList = new ArrayList<>();
|
||||
List<LyVoucherDetailPushParam> dfDetailList = new ArrayList<>();
|
||||
pushParam.getDetails().stream().forEach(detail -> {
|
||||
if ((StringUtils.isNotBlank(detail.getJfValue())) && (!"0.00".equals(detail.getJfValue()))) {
|
||||
jfDetailList.add(detail);
|
||||
} else {
|
||||
dfDetailList.add(detail);
|
||||
}
|
||||
});
|
||||
ArrayList<LyNCVoucherDetail> lyNCVoucherDetailList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
// 借方分录
|
||||
for (int i = 0; i < jfDetailList.size(); i++) {
|
||||
LyVoucherDetailPushParam detailParam = jfDetailList.get(i);
|
||||
LyNCVoucherDetail lyNCVoucherDetail = new LyNCVoucherDetail();
|
||||
// 分录号 非空
|
||||
lyNCVoucherDetail.setDetailindex(String.valueOf(i+1));
|
||||
// 摘要 非空
|
||||
lyNCVoucherDetail.setExplanation(detailParam.getZy());
|
||||
// 折本汇率
|
||||
lyNCVoucherDetail.setExcrate2("1");
|
||||
// 原币借方金额
|
||||
lyNCVoucherDetail.setDebitamount(detailParam.getJfValue());
|
||||
// 本币借方金额 可空
|
||||
lyNCVoucherDetail.setLocaldebitamount(detailParam.getJfValue());
|
||||
// 币种 非空
|
||||
lyNCVoucherDetail.setPkCurrtype("CNY");
|
||||
// 科目 非空
|
||||
String kjkm = detailParam.getKjkm();
|
||||
String kjkmbm = kjkm.split("\\\\")[0];
|
||||
lyNCVoucherDetail.setPkAccasoa(kjkmbm);
|
||||
// 辅助核算
|
||||
List<LyNCVoucherAss> lyNCVoucherAssList = new ArrayList<>();
|
||||
if (detailParam.getFzhsXmqs() != null) {
|
||||
// 项目期数
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsXmqs().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsXmqs().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsFwlb() != null) {
|
||||
// 房屋列别
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsFwlb().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsFwlb().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsSllb() != null) {
|
||||
// 税率类别
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsSllb().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsSllb().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsKs() != null) {
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// 客商
|
||||
ass.setPkChecktype(detailParam.getFzhsKs().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsKs().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
// 其他
|
||||
if (CollectionUtils.isNotEmpty(detailParam.getFzhsOtherBmList())) {
|
||||
detailParam.getFzhsOtherBmList().stream().forEach(fzhs -> {
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(fzhs.getFzhslxbh());
|
||||
ass.setPkCheckvalue(fzhs.getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
});
|
||||
}
|
||||
List<LyNCVoucherAss> assList = lyNCVoucherAssList.stream().filter(ass -> StringUtils.isNotBlank(ass.getPkChecktype())).collect(Collectors.toList());
|
||||
lyNCVoucherDetail.setAss(assList);
|
||||
lyNCVoucherDetailList.add(lyNCVoucherDetail);
|
||||
}
|
||||
|
||||
// 贷方分录
|
||||
for (int i = 0; i < dfDetailList.size(); i++) {
|
||||
LyVoucherDetailPushParam detailParam = dfDetailList.get(i);
|
||||
LyNCVoucherDetail lyNCVoucherDetail = new LyNCVoucherDetail();
|
||||
// 分录号 非空
|
||||
lyNCVoucherDetail.setDetailindex(lyNCVoucherDetailList.size() + String.valueOf(i+1));
|
||||
// 摘要 非空
|
||||
lyNCVoucherDetail.setExplanation(detailParam.getZy());
|
||||
// 折本汇率
|
||||
lyNCVoucherDetail.setExcrate2("1");
|
||||
// 原币借方金额
|
||||
lyNCVoucherDetail.setCreditamount(detailParam.getDfValue());
|
||||
// 本币借方金额 可空
|
||||
lyNCVoucherDetail.setLocalcreditamount(detailParam.getDfValue());
|
||||
// 币种 非空
|
||||
lyNCVoucherDetail.setPkCurrtype("CNY");
|
||||
// 科目 非空
|
||||
String kjkm = detailParam.getKjkm();
|
||||
String kjkmbm = kjkm.split("\\\\")[0];
|
||||
lyNCVoucherDetail.setPkAccasoa(kjkmbm);
|
||||
// 辅助核算
|
||||
List<LyNCVoucherAss> lyNCVoucherAssList = new ArrayList<>();
|
||||
if (detailParam.getFzhsXmqs() != null) {
|
||||
// 项目期数
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsXmqs().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsXmqs().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsFwlb() != null) {
|
||||
// 房屋列别
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsFwlb().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsFwlb().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsSllb() != null) {
|
||||
// 税率类别
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(detailParam.getFzhsSllb().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsSllb().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
if (detailParam.getFzhsKs() != null) {
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
// 客商
|
||||
ass.setPkChecktype(detailParam.getFzhsKs().getFzhslxbh());
|
||||
ass.setPkCheckvalue(detailParam.getFzhsKs().getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
}
|
||||
// 其他
|
||||
if (CollectionUtils.isNotEmpty(detailParam.getFzhsOtherBmList())) {
|
||||
detailParam.getFzhsOtherBmList().stream().forEach(fzhs -> {
|
||||
LyNCVoucherAss ass = new LyNCVoucherAss();
|
||||
ass.setPkChecktype(fzhs.getFzhslxbh());
|
||||
ass.setPkCheckvalue(fzhs.getBh());
|
||||
lyNCVoucherAssList.add(ass);
|
||||
});
|
||||
}
|
||||
List<LyNCVoucherAss> assList = lyNCVoucherAssList.stream().filter(ass -> StringUtils.isNotBlank(ass.getPkChecktype())).collect(Collectors.toList());
|
||||
lyNCVoucherDetail.setAss(assList);
|
||||
lyNCVoucherDetailList.add(lyNCVoucherDetail);
|
||||
}
|
||||
lyNCVoucher.setDetails(lyNCVoucherDetailList);
|
||||
LyNCVoucherHead voucherHead = new LyNCVoucherHead();
|
||||
voucherHead.setVoucherHead(lyNCVoucher);
|
||||
|
||||
LyNCVoucherUfinterface lyNCVoucherUfinterface = new LyNCVoucherUfinterface();
|
||||
lyNCVoucherUfinterface.setVoucher(voucherHead);
|
||||
|
||||
String account = baseBean.getPropValue("lySalaryNCVoucherPushParam", "account");
|
||||
lyNCVoucherUfinterface.setAccount(account);
|
||||
String billtype = baseBean.getPropValue("lySalaryNCVoucherPushParam", "billtype");
|
||||
lyNCVoucherUfinterface.setBilltype(billtype);
|
||||
String businessunitcode = baseBean.getPropValue("lySalaryNCVoucherPushParam", "businessunitcode");
|
||||
lyNCVoucherUfinterface.setBusinessunitcode(businessunitcode);
|
||||
lyNCVoucherUfinterface.setFilename("");
|
||||
lyNCVoucherUfinterface.setGroupcode("");
|
||||
lyNCVoucherUfinterface.setIsexchange("");
|
||||
lyNCVoucherUfinterface.setOrgcode("");
|
||||
lyNCVoucherUfinterface.setReceiver("");
|
||||
lyNCVoucherUfinterface.setReplace("");
|
||||
lyNCVoucherUfinterface.setRoottag("");
|
||||
String sender = baseBean.getPropValue("lySalaryNCVoucherPushParam", "sender");
|
||||
lyNCVoucherUfinterface.setSender(sender);
|
||||
// "<?xml version=\"1.0\" encoding='gb2312'?>"
|
||||
String xml = XStreamUtil.marshal(lyNCVoucherUfinterface);
|
||||
System.out.println(xml);
|
||||
|
||||
|
||||
HttpClient httpClient = new HttpClient();
|
||||
String accountParam = baseBean.getPropValue("lySalaryNCVoucherPushParam", "account_param");
|
||||
String groupcodeParam = baseBean.getPropValue("lySalaryNCVoucherPushParam", "groupcode_param");
|
||||
PostMethod httpPost = new PostMethod("http://172.18.0.10:8090/service/XChangeServlet?account="+accountParam+"&groupcode="+groupcodeParam);
|
||||
httpPost.setRequestHeader("content-type", "application/json;charset=utf-8");
|
||||
|
||||
String result = "";
|
||||
try {
|
||||
RequestEntity entity = new StringRequestEntity( xml, "application/json", "UTF-8");
|
||||
httpPost.setRequestEntity(entity);
|
||||
httpClient.executeMethod(httpPost);
|
||||
result = httpPost.getResponseBodyAsString();
|
||||
System.out.println(result);
|
||||
LyNCVoucherReturn lyNCVoucherReturn = XStreamUtil.unmarshal(LyNCVoucherReturn.class, StringUtils.substring(result,result.indexOf("<ufinterface"),result.indexOf("</ufinterface>")+14));
|
||||
boolean success = lyNCVoucherReturn.getSuccessful().equals("Y");
|
||||
if (!success) {
|
||||
// 失败
|
||||
String errorMsg = lyNCVoucherReturn.getSendresult().getResultdescription();
|
||||
pushParam.setStatus(NumberUtils.INTEGER_ZERO);
|
||||
pushParam.setPushMsg(errorMsg);
|
||||
} else {
|
||||
pushParam.setStatus(NumberUtils.INTEGER_ONE);
|
||||
pushParam.setPushMsg("推送成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
baseBean.writeLog("推送错误" + e.getMessage());
|
||||
throw new SalaryRunTimeException("推送错误,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -917,6 +969,9 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
* @param pushParam
|
||||
*/
|
||||
private void verifyKjkm(LyVoucherPushParam pushParam) {
|
||||
if(StringUtils.isBlank(pushParam.getZbbm())) {
|
||||
throw new SalaryRunTimeException("账簿编码不能为空");
|
||||
}
|
||||
// 校验科目id是否合规
|
||||
Map<String, String> kmbmInfoMap = new HashMap<>();
|
||||
List<UfKjkmPO> allKjkm = getUfKjkmMapper().listAll();
|
||||
|
|
@ -974,7 +1029,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
list.stream().forEach(voucher -> {
|
||||
voucher.setPzlxStr(LyPZTypeEnum.getDefaultLabelByValue(voucher.getPzlx()));
|
||||
voucher.setPushStatusStr(voucher.getStatus() != null && voucher.getStatus().equals(NumberUtils.INTEGER_ONE) ? "成功" : "失败");
|
||||
voucher.setErrorMsg(voucher.getStatus() != null && voucher.getStatus().equals(NumberUtils.INTEGER_ONE) ? "" : voucher.getErrorMsg());
|
||||
voucher.setErrorMsg(voucher.getStatus() != null && voucher.getStatus().equals(NumberUtils.INTEGER_ONE) ? "" : voucher.getPushMsg().replace("\n","</br>"));
|
||||
});
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), lyVoucherPOS, LyVoucherPO.class);
|
||||
}
|
||||
|
|
@ -1071,8 +1126,17 @@ public class LyPZServiceImpl extends Service implements LyPZService {
|
|||
}
|
||||
getLySocialReportService(user).updateIgnoreNull(po);
|
||||
});
|
||||
} else {
|
||||
} else if (pzlx.equals(LyPZTypeEnum.GJJJTPZ.getValue()) || pzlx.equals(LyPZTypeEnum.GJJFFPZ.getValue())) {
|
||||
// 公积金
|
||||
List<LyFundReportPO> lyFundReportList = getLyFundReportService(user).getByIds(dataSourceIdList);
|
||||
lyFundReportList.stream().forEach(po -> {
|
||||
if (pzlx.equals(LyPZTypeEnum.GJJJTPZ.getValue())) {
|
||||
po.setGjjjtpzFlag(NumberUtils.INTEGER_ZERO);
|
||||
} else {
|
||||
po.setGjjffpzFlag(NumberUtils.INTEGER_ZERO);
|
||||
}
|
||||
getLyFundReportService(user).updateIgnoreNull(po);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -606,6 +606,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
|
|||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LySalaryReportPO> lySalaryReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
|
||||
lySalaryReportPOS = lySalaryReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getFfgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 分权
|
||||
// 是否是薪酬总管理员
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
// 获取本月是否已有报表数据
|
||||
List<LySocialReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成薪资汇总报表,无法生成社保公积金汇总报表数据");
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成社保汇总报表,无法生成社保汇总报表数据");
|
||||
}
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
|
|
@ -464,12 +464,18 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
pageInfo.setTotal(lySocialReportPOS.size());
|
||||
pageInfo.setList(SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), lySocialReportPOS));
|
||||
}
|
||||
pageInfo.getList().stream().forEach(po -> {
|
||||
po.setSbjtpzFlagStr((po.getSbjtpzFlag() != null && po.getSbjtpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
|
||||
po.setSbffpzFlagStr((po.getSbffpzFlag() != null && po.getSbffpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
|
||||
});
|
||||
List<WeaTableColumnGroup> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumnGroup("150px", "购买公司全称", "gmgsqc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "分摊人数", "ftempNum"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "费用承担公司全称", "fycdgsqc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "职能/项目名称", "znxmmc"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "费用所属期", "salaryMonth"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "计提状态", "sbjtpzFlagStr"));
|
||||
columns.add(new WeaTableColumnGroup("150px", "发放状态", "sbffpzFlagStr"));
|
||||
|
||||
WeaTableColumnGroup ylGroup = new WeaTableColumnGroup("150px", "养老", "养老");
|
||||
List<WeaTableColumnGroup> ylChildList = new ArrayList<>();
|
||||
|
|
@ -553,6 +559,9 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LySocialReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(param.getFfgsqc())) {
|
||||
lySocialReportPOS = lySocialReportPOS.stream().filter(lySalaryReportPO -> param.getFfgsqc().contains(lySalaryReportPO.getGmgsqc())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 分权
|
||||
// 是否是薪酬总管理员
|
||||
|
|
@ -685,7 +694,7 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
}
|
||||
|
||||
//获取excel
|
||||
return ExcelUtilPlus.genWorkbookWithChildTitleColumn(rows, "薪酬统计报表", true);
|
||||
return ExcelUtilPlus.genWorkbookWithChildTitleColumn(rows, "社保统计报表", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
|
@ -163,6 +162,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
sw.start("查询薪资核算人员的薪资核算结果");
|
||||
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
Map<String, String> empItemValueMap = SalaryEntityUtil.convert2Map(salaryAcctResultPOS, p -> p.getSalaryAcctEmpId() + "_" + p.getSalaryItemId(), SalaryAcctResultPO::getResultValue);
|
||||
sw.stop();
|
||||
// 查询浮动薪资
|
||||
sw.start("查询浮动薪资");
|
||||
|
|
@ -175,8 +175,6 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
for (Map.Entry<String, List<SalaryAcctResultPO>> et : collect.entrySet()) {
|
||||
salaryAcctResultPOMap.put(et.getKey(), et.getValue().get(0).getOriginResultValue());
|
||||
}
|
||||
//核算锁定的值
|
||||
Map<String, SalaryAcctResultPO> salaryAcctLockResultPOS = MapUtils.emptyIfNull(salaryAcctCalculateBO.getSalaryAcctLockResultPOS());
|
||||
sw.stop();
|
||||
// 9、查询相同税款所属期内涉及合并计税的其他薪资核算结果
|
||||
sw.start("查询相同税款所属期内涉及合并计税的其他薪资核算结果");
|
||||
|
|
@ -211,6 +209,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
StringBuffer noticeMsg = new StringBuffer();
|
||||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||
Long salaryAcctEmployeePOId = salaryAcctEmployeePO.getId();
|
||||
List<Long> lockItems = salaryAcctEmployeePO.getLockItems();
|
||||
//1 获取当前薪资核算人员的公式中的变量的值
|
||||
List<CalculateFormulaVarBO.FormulaVarValue> formulaVarValues = formulaVarMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
//2 人员信息
|
||||
|
|
@ -273,9 +272,10 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
|
||||
// 处理小数点
|
||||
resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap);
|
||||
|
||||
//是否锁定
|
||||
if (salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId) != null) {
|
||||
resultValue = salaryAcctLockResultPOS.get(salaryItemId + "_" + salaryAcctEmployeePOId).getResultValue();
|
||||
if (lockItems != null && lockItems.contains(salaryItemId)) {
|
||||
resultValue = empItemValueMap.get(salaryAcctEmployeePOId + "_" + salaryItemId);
|
||||
}
|
||||
// 将已经计算过的薪资项目的值转换成公式变量的值添加到集合中
|
||||
String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.hrmelog.entity.dto.LoggerContext;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
|
|
@ -16,6 +17,7 @@ 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.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
|
|
@ -53,6 +55,8 @@ import weaver.hrm.User;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.REPORT_ORGANIZATIN_TYPE;
|
||||
|
||||
/**
|
||||
* 薪资核算人员
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -116,6 +120,16 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCacheService getSalaryCacheService(User user) {
|
||||
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctSobConfigService getSalaryAcctSobConfigService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private boolean isRealOrg = "1".equals(getSalaryCacheService(user).get(REPORT_ORGANIZATIN_TYPE));
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeeCountDTO> countBySalaryAcctRecordId(Collection<Long> salaryAcctRecordIds) {
|
||||
|
|
@ -458,6 +472,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
@Override
|
||||
public void deleteByIds(Collection<Long> ids) {
|
||||
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 删除薪资核算人员
|
||||
getSalaryAcctEmployeeMapper().deleteByIds(ids);
|
||||
// 删除薪资核算人员对应的薪资核算结果
|
||||
|
|
@ -558,36 +577,47 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
@Override
|
||||
public void refresh(Long salaryAcctRecordId) {
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listBySalaryAcctRecordId(salaryAcctRecordId);
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
return;
|
||||
}
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "未查询到账套下关联人员"));
|
||||
}
|
||||
|
||||
// 根据薪资账套查询薪资周期
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
|
||||
|
||||
//查询账套对应的扣缴义务人
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId());
|
||||
//过滤掉不属于当前账套扣缴义务人的人员
|
||||
List<Long> taxAgentIds = salarySobPO.getTaxAgentIds();
|
||||
|
||||
// 查询薪资核算记录所用的帐套的薪资周期
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
|
||||
// 查询薪资档案,获取人员的个税扣缴义务人
|
||||
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
|
||||
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId);
|
||||
// 转换成薪资核算人员po
|
||||
List<SalaryAcctEmployeePO> newSalaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
|
||||
newSalaryAcctEmployeePOS = newSalaryAcctEmployeePOS.stream().filter(po ->taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList());
|
||||
// 删除以前的薪资核算人员
|
||||
getSalaryAcctEmployeeMapper().deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
|
||||
// 插入新的薪资核算人员
|
||||
if (CollectionUtils.isNotEmpty(newSalaryAcctEmployeePOS)) {
|
||||
batchSave(newSalaryAcctEmployeePOS);
|
||||
}
|
||||
List<SalaryAcctEmployeePO> newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
|
||||
//过滤掉不属于当前账套扣缴义务人的人员
|
||||
newEmps = newEmps.stream().filter(po -> Objects.equals(taxAgentId, po.getTaxAgentId())).collect(Collectors.toList());
|
||||
Map<String, SalaryAcctEmployeePO> newEmpMap = SalaryEntityUtil.convert2Map(newEmps, e -> e.getTaxAgentId() + "_" + e.getEmployeeId());
|
||||
|
||||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> oldEmps = listBySalaryAcctRecordId(salaryAcctRecordId);
|
||||
Map<String, SalaryAcctEmployeePO> oldEmpMap = SalaryEntityUtil.convert2Map(oldEmps, e -> e.getTaxAgentId() + "_" + e.getEmployeeId());
|
||||
|
||||
//新增
|
||||
List<SalaryAcctEmployeePO> addEmps = newEmps.stream().filter(po -> !oldEmpMap.containsKey(po.getTaxAgentId() + "_" + po.getEmployeeId())).collect(Collectors.toList());
|
||||
|
||||
//删除
|
||||
List<Long> delIds = oldEmps.stream().filter(po -> !newEmpMap.containsKey(po.getTaxAgentId() + "_" + po.getEmployeeId())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
|
||||
deleteByIds(delIds);
|
||||
batchSave(addEmps);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -652,11 +682,6 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
lambdaQueryChainWrapper.setSalaryMonths(yearMonths);
|
||||
}
|
||||
|
||||
// 收入所得项目
|
||||
// if (CollectionUtils.isNotEmpty(param.getIncomeCategory())) {
|
||||
// lambdaQueryChainWrapper.in(SalaryAcctEmployeePO::getIncomeCategory, param.getIncomeCategory().stream().map(Object::toString).collect(Collectors.toList()));
|
||||
// }
|
||||
|
||||
//排除未归档数据
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
||||
List<Long> salaryAcctRecordIds = salaryAcctRecordPOS.stream()
|
||||
|
|
@ -686,70 +711,47 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
// 获取分部信息
|
||||
List<Long> subCompanyIds = param.getSubCompany();
|
||||
if (CollectionUtils.isNotEmpty(subCompanyIds)) {
|
||||
// SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
// List<String> allSubcompanyIds = new ArrayList<>();
|
||||
// for (Long subCompanyId : subCompanyIds) {
|
||||
// String organizationIds = Util.null2String(subCompanyId);
|
||||
// String allChildSubcompanyId = subCompanyComInfo.getAllChildSubcompanyId(subCompanyId.toString(), organizationIds);
|
||||
// allSubcompanyIds.addAll(Arrays.asList(allChildSubcompanyId.split(",")));
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> subCompanyIds.contains(emp.getSubcompanyid())).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
employeeList = employeeList.stream().filter(emp -> subCompanyIds.contains(emp.getSubcompanyid())).collect(Collectors.toList());
|
||||
} else {
|
||||
list = list.stream().filter(emp -> subCompanyIds.contains(emp.getSubcompanyId())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
// 部门过滤
|
||||
List<Long> depart = param.getDepart();
|
||||
if (CollectionUtils.isNotEmpty(depart)) {
|
||||
// List<String> allDepartIds = new ArrayList<>();
|
||||
// for (Long subDepartId : depart) {
|
||||
// String ids = Util.null2String(subDepartId);
|
||||
// try {
|
||||
// String allDepartId = DepartmentComInfo.getAllChildDepartId(subDepartId.toString(), ids);
|
||||
// allDepartIds.addAll(Arrays.asList(allDepartId.toString().split(",")));
|
||||
// } catch (Exception e) {
|
||||
// log.error("获取子部门失败", e);
|
||||
// }
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> depart.contains(emp.getDepartmentId())).collect(Collectors.toList());
|
||||
if (isRealOrg) {
|
||||
employeeList = employeeList.stream().filter(emp -> depart.contains(emp.getDepartmentId())).collect(Collectors.toList());
|
||||
} else {
|
||||
list = list.stream().filter(emp -> depart.contains(emp.getDepartmentId())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
// 职级过滤
|
||||
// if (CollectionUtils.isNotEmpty(param.getGrade())) {
|
||||
// Set<Long> employeeIdsByGradeFilter = new HashSet<>();
|
||||
// simpleEmployeeList.forEach(simpleEmployee -> {
|
||||
// if (simpleEmployee.getGrade() != null && param.getGrade().contains(simpleEmployee.getGrade().getId())) {
|
||||
// employeeIdsByGradeFilter.add(simpleEmployee.getEmployeeId());
|
||||
// }
|
||||
// });
|
||||
// if (CollectionUtils.isEmpty(employeeIdsByGradeFilter)) {
|
||||
// return Lists.newArrayList();
|
||||
// }
|
||||
// list = list.stream().filter(po -> employeeIdsByGradeFilter.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
// }
|
||||
// 岗位过滤
|
||||
// 岗位过滤
|
||||
List<Long> position = param.getPosition();
|
||||
if (CollectionUtils.isNotEmpty(position)) {
|
||||
// Set<Long> employeeIdsByPostionFilter = new HashSet<>();
|
||||
// simpleEmployeeList.forEach(simpleEmployee -> {
|
||||
// if (simpleEmployee.getPosition() != null && param.getPosition().contains(simpleEmployee.getPosition().getId())) {
|
||||
// employeeIdsByPostionFilter.add(simpleEmployee.getEmployeeId());
|
||||
// }
|
||||
// });
|
||||
// if (CollectionUtils.isEmpty(employeeIdsByPostionFilter)) {
|
||||
// return Lists.newArrayList();
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> position.contains(emp.getJobtitleId())).collect(Collectors.toList());
|
||||
}
|
||||
if (isRealOrg) {
|
||||
employeeList = employeeList.stream().filter(emp -> position.contains(emp.getJobtitleId())).collect(Collectors.toList());
|
||||
} else {
|
||||
list = list.stream().filter(emp -> position.contains(emp.getJobtitleId())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
// 人事状态过滤
|
||||
if (CollectionUtils.isNotEmpty(param.getStatus())) {
|
||||
Set<Long> employeeIdsByStatus = new HashSet<>();
|
||||
employeeList.forEach(simpleEmployee -> {
|
||||
if (simpleEmployee.getStatus() != null && param.getStatus().contains(simpleEmployee.getStatus())) {
|
||||
employeeIdsByStatus.add(simpleEmployee.getEmployeeId());
|
||||
if (isRealOrg) {
|
||||
Set<Long> employeeIdsByStatus = new HashSet<>();
|
||||
employeeList.forEach(simpleEmployee -> {
|
||||
if (simpleEmployee.getStatus() != null && param.getStatus().contains(simpleEmployee.getStatus())) {
|
||||
employeeIdsByStatus.add(simpleEmployee.getEmployeeId());
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isEmpty(employeeIdsByStatus)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isEmpty(employeeIdsByStatus)) {
|
||||
return Lists.newArrayList();
|
||||
list = list.stream().filter(po -> employeeIdsByStatus.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
} else {
|
||||
list = list.stream().filter(po -> po.getStatus() != null && param.getStatus().contains(po.getStatus())).collect(Collectors.toList());
|
||||
}
|
||||
list = list.stream().filter(po -> employeeIdsByStatus.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
// 入职日期
|
||||
if (CollectionUtils.isNotEmpty(param.getHiredate())) {
|
||||
|
|
@ -765,27 +767,15 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
list = list.stream().filter(po -> employeeIdsByHiredate.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
// // 离职日期 todo
|
||||
// if (CollectionUtils.isNotEmpty(param.getLeavedate())) {
|
||||
// Set<Long> employeeIdsByLeavedate = new HashSet<>();
|
||||
// simpleEmployeeList.forEach(simpleEmployee -> {
|
||||
//
|
||||
// if (simpleEmployee.get() != null && ) {
|
||||
// employeeIdsByLeavedate.add(simpleEmployee.getEmployeeId());
|
||||
// }
|
||||
// });
|
||||
// if (CollectionUtils.isEmpty(employeeIdsByLeavedate)) {
|
||||
// return Lists.newArrayList();
|
||||
// }
|
||||
// list = list.stream().filter(po -> employeeIdsByLeavedate.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
// }
|
||||
// 人员
|
||||
if (CollectionUtils.isNotEmpty(param.getEmployee())) {
|
||||
list = list.stream().filter(po -> param.getEmployee().contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
Set<Long> empIds = SalaryEntityUtil.properties(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||
list = list.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
if(isRealOrg){
|
||||
Set<Long> empIds = SalaryEntityUtil.properties(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||
list = list.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
@ -802,12 +792,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
@Override
|
||||
public void lockEmp(SalaryAcctResultUpdateLockStatusParam updateParam) {
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(updateParam.getSalaryAcctRecordId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecord.getLockSalaryItemIds())) {
|
||||
salaryAcctRecord.setLockSalaryItemIds(new ArrayList<>());
|
||||
}
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = listByIds(updateParam.getAcctEmpIds());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -817,13 +802,20 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
throw new SalaryRunTimeException("锁定状态异常!");
|
||||
}
|
||||
|
||||
Set<Long> acctEmpIds = updateParam.getAcctEmpIds();
|
||||
if (CollUtil.isNotEmpty(acctEmpIds)) {
|
||||
//锁定指定人员
|
||||
getSalaryAcctEmployeeMapper().lockByAcctEmpIds(lockStatus.getValue(), acctEmpIds);
|
||||
} else {
|
||||
//锁定全部
|
||||
getSalaryAcctEmployeeMapper().lockByRecordId(lockStatus.getValue(), updateParam.getSalaryAcctRecordId());
|
||||
if (updateParam.getLockStatus() == LockStatusEnum.LOCK){
|
||||
SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(updateParam.getSalaryAcctRecordId());
|
||||
List<SalarySobItemPO> salarySobItems = salaryAcctSobConfig.getSalarySobItems();
|
||||
List<Long> itemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId,Collectors.toList());
|
||||
|
||||
salaryAcctEmployees.forEach(salaryAcctEmployeePO -> {
|
||||
salaryAcctEmployeePO.setLockItems(itemIds);
|
||||
lock(salaryAcctEmployeePO);
|
||||
});
|
||||
}else {
|
||||
salaryAcctEmployees.forEach(salaryAcctEmployeePO -> {
|
||||
salaryAcctEmployeePO.setLockItems(new ArrayList<>());
|
||||
lock(salaryAcctEmployeePO);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -831,4 +823,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
public void updateIgnoreNull(SalaryAcctEmployeePO salaryAcctEmployeePO) {
|
||||
getSalaryAcctEmployeeMapper().updateIgnoreNull(salaryAcctEmployeePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lock(SalaryAcctEmployeePO salaryAcctEmployeePO) {
|
||||
getSalaryAcctEmployeeMapper().lock(salaryAcctEmployeePO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.dev.api.util.Util_DataCache;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
|
|
@ -57,11 +58,9 @@ import com.engine.salary.wrapper.SalarySobItemWrapper;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.wbi.util.Util;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
||||
|
|
@ -69,7 +68,7 @@ import org.apache.poi.ss.usermodel.Sheet;
|
|||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.StopWatch;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -459,7 +458,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
SalaryAcctRecordPO byId = getSalaryAcctRecordService(user).getById(salaryAcctRecordPO.getId());
|
||||
boolean isBackCalc = Objects.equals(byId.getBackCalcStatus(), 1);
|
||||
// 查询薪资账套下的薪资项目+员工信息字段
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getId(),salaryAcctRecordPO.getSalarySobId(), isBackCalc);
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getId(), salaryAcctRecordPO.getSalarySobId(), isBackCalc);
|
||||
// 构建薪资核算结果列表表头
|
||||
List<WeaTableColumnGroup> columnList = SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO, ListUtils.emptyIfNull(salaryAcctRecordPO.getLockSalaryItemIds()));
|
||||
// 获取固定列头数
|
||||
|
|
@ -591,11 +590,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
// .build())
|
||||
// .collect(Collectors.toList());
|
||||
// 缓存勾选
|
||||
String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN;
|
||||
String cacheValue = (String) Util_DataCache.getObjVal(cacheKey);
|
||||
List<Long> checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class);
|
||||
// 转换成dto
|
||||
// return SalaryAcctImportFieldDTO.builder().formulaItems(formulaItems).sqlItems(sqlItems).inputItems(inputItems).checkItems(checkItems).build();
|
||||
List<Long> checkItems = new ArrayList<>();
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), Arrays.asList(2));
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultTemplatePOS)) {
|
||||
String items = salaryAcctResultTemplatePOS.get(0).getSalaryItemIds();
|
||||
checkItems = StrUtil.isNotEmpty(items) ? Arrays.stream(items.split(",")).map(Long::valueOf).collect(Collectors.toList()) : new ArrayList<>();
|
||||
}
|
||||
return SalaryAcctImportFieldDTO.builder().itemsByGroup(itemsByGroup).checkItems(checkItems).build();
|
||||
}
|
||||
|
||||
|
|
@ -667,18 +667,22 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
@Override
|
||||
public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) {
|
||||
// ValidUtil.doValidator(param);
|
||||
// 从缓存中获取所选的薪资项目
|
||||
String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN;
|
||||
String cacheValue = (String) Util_DataCache.getObjVal(cacheKey);
|
||||
List<Long> checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class);
|
||||
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
List<Long> checkItems = new ArrayList<>();
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), Arrays.asList(2));
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultTemplatePOS)) {
|
||||
String items = salaryAcctResultTemplatePOS.get(0).getSalaryItemIds();
|
||||
checkItems = StrUtil.isNotEmpty(items) ? Arrays.stream(items.split(",")).map(Long::valueOf).collect(Collectors.toList()) : new ArrayList<>();
|
||||
}
|
||||
|
||||
// 必须选择导入模板所需的薪资项目
|
||||
if (CollectionUtils.isEmpty(checkItems)) {
|
||||
// 获取所有可以选择的薪资项目
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询薪资核算记录所用的薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId, Collectors.toList());
|
||||
|
|
@ -688,11 +692,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
checkItems = salaryItemIds;
|
||||
}
|
||||
param.setSalaryItemIds(checkItems);
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// // 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
||||
// List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
||||
// "部门",
|
||||
|
|
@ -890,7 +890,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
// headerList.add("手机号");
|
||||
// headerList.add("工号");
|
||||
// 查询薪资账套下的薪资项目
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateByRecordId(exportParam.getSalaryAcctRecordId(),true);
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateByRecordId(exportParam.getSalaryAcctRecordId(), true);
|
||||
|
||||
// // 员工信息
|
||||
// for (SalarySobEmpFieldDTO item : salarySobItemAggregateDTO.getEmpFields()) {
|
||||
|
|
@ -976,9 +976,32 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
|
||||
@Override
|
||||
public void cacheImportField(List<Long> salaryItems) {
|
||||
String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN;
|
||||
Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryItems));
|
||||
public void cacheImportField(SalaryAcctResultTemplateSaveParam saveParam) {
|
||||
Long salaryAcctRecordId = saveParam.getSalaryAcctRecordId();
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if (salaryAcctRecordPO == null) {
|
||||
throw new SalaryRunTimeException("薪资核算记录不存在");
|
||||
}
|
||||
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), Collections.singletonList(2));
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultTemplatePOS)) {
|
||||
salaryAcctResultTemplatePOS.forEach(templatePO -> getSalaryAcctResultTemplateService(user).deleteById(templatePO.getId()));
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
SalaryAcctResultTemplatePO templatePO = SalaryAcctResultTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.type(2)
|
||||
.salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
.salaryItemIds(StringUtils.join(saveParam.getSalaryItemIds(), ","))
|
||||
.templateName("")
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getSalaryAcctResultTemplateService(user).insertIgnoreNull(templatePO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1011,6 +1034,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
|
||||
private Map<String, Object> batchImport(SalaryAcctImportParam param, String importType) {
|
||||
StopWatch stopWatch = new StopWatch("导入核算数据");
|
||||
stopWatch.start("数据准备");
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
ValidUtil.doValidator(param);
|
||||
Date now = new Date();
|
||||
|
|
@ -1028,27 +1053,38 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
if (salaryAcctRecordPO == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
stopWatch.stop();
|
||||
// 薪资账套下的薪资项目副本
|
||||
stopWatch.start("薪资账套下的薪资项目副本");
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// 薪资项目
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
Map<String, Long> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getName, SalaryItemPO::getId);
|
||||
stopWatch.stop();
|
||||
// 薪资核算确认的人员
|
||||
stopWatch.start("薪资核算确认的人员");
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordId);
|
||||
Map<String, SalaryAcctEmployeePO> salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployees, e -> e.getEmployeeId() + "-" + e.getTaxAgentId());
|
||||
stopWatch.stop();
|
||||
// 租户下所有的人员
|
||||
stopWatch.start("薪资核算确认的人员");
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listAllForReport();
|
||||
Map<String, Long> salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId);
|
||||
Map<Long, DataCollectionEmployee> emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
stopWatch.stop();
|
||||
// 租户下所有的个税扣缴义务人
|
||||
stopWatch.start("租户下所有的个税扣缴义务人");
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listAll();
|
||||
Map<String, Long> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId);
|
||||
stopWatch.stop();
|
||||
// 薪资核算人员信息字段
|
||||
stopWatch.start("薪资核算人员信息字段");
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<String> salarySobEmpFields = SalaryEntityUtil.properties(new SalarySobItemAggregateBO().buildEmpField(salarySobEmpFieldPOS), SalarySobEmpFieldDTO::getFieldName, Collectors.toList());
|
||||
List<String> excludeFields = Arrays.asList("个税扣缴义务人", "部门", "姓名");
|
||||
salarySobEmpFields = salarySobEmpFields.stream().filter(field -> !excludeFields.contains(field)).collect(Collectors.toList());
|
||||
stopWatch.stop();
|
||||
// 索引(用于计算进度)
|
||||
int index = 0;
|
||||
// 失败的数量
|
||||
|
|
@ -1078,10 +1114,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
|
||||
stopWatch.start("解析文件");
|
||||
Workbook workbook = ExcelSupport.parseFile(fileInputStream, EXCEL_TYPE_XLSX);
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
stopWatch.stop();
|
||||
|
||||
// 错误提示信息
|
||||
List<Map> excelComments = Lists.newArrayList();
|
||||
|
|
@ -1100,7 +1136,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
// List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
List<Map<String, Object>> data;
|
||||
// if (StringUtils.equals("importSalaryAcctResult", importType)) {
|
||||
data = ExcelParseHelper.parse2Map(workbook, 0, 2, 1);
|
||||
data = ExcelParseHelper.parse2Map(sheet, 2, 1);
|
||||
// } else {
|
||||
// data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
// }
|
||||
|
|
@ -1111,6 +1147,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
if (CollectionUtils.isEmpty(data)) {
|
||||
throw new RuntimeException("无数据");
|
||||
}
|
||||
stopWatch.start("解析数据");
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
|
||||
String row = "第" + (i + 3) + "行";
|
||||
|
|
@ -1145,7 +1182,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
//salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), i, i, j, j);
|
||||
} else {
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode,idNo, null);
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode, idNo, null);
|
||||
|
||||
if (CollectionUtils.isEmpty(employeeSameIds)) {
|
||||
isError = true;
|
||||
|
|
@ -1232,19 +1269,19 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
salaryAcctResultsOfOneEmp.add(salaryAcctResult);
|
||||
|
||||
|
||||
SalaryAcctResultReportPO reportPO = SalaryAcctResultReportPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salaryAcctRecordId(salaryAcctRecordPO.getId())
|
||||
.salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
.salaryItemId(salaryItemId)
|
||||
.resultValue(dataValue)
|
||||
.creator(currentEmployeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
salaryAcctResultReportOfOneEmp.add(reportPO);
|
||||
// SalaryAcctResultReportPO reportPO = SalaryAcctResultReportPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .salaryAcctRecordId(salaryAcctRecordPO.getId())
|
||||
// .salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
// .salaryItemId(salaryItemId)
|
||||
// .resultValue(dataValue)
|
||||
// .creator(currentEmployeeId)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .deleteType(0)
|
||||
// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .build();
|
||||
// salaryAcctResultReportOfOneEmp.add(reportPO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1321,29 +1358,31 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
salaryAcctResultPO.setSalaryAcctEmpId(salaryAcctEmpId);
|
||||
}
|
||||
|
||||
for (SalaryAcctResultReportPO po : salaryAcctResultReportOfOneEmp) {
|
||||
po.setEmployeeId(Util.null2String(employeeId));
|
||||
po.setTaxAgentId(taxAgentId);
|
||||
po.setSalaryAcctEmpId(Util.null2String(salaryAcctEmpId));
|
||||
|
||||
DataCollectionEmployee emp = emps.get(employeeId);
|
||||
po.setSubcompanyId(emp.getSubcompanyid());
|
||||
po.setDepartmentId(emp.getDepartmentId());
|
||||
po.setCostcenterId(emp.getCostcenterId());
|
||||
po.setJobtitleId(emp.getJobtitleId());
|
||||
po.setLocationId(emp.getLocationId());
|
||||
|
||||
}
|
||||
// for (SalaryAcctResultReportPO po : salaryAcctResultReportOfOneEmp) {
|
||||
// po.setEmployeeId(Util.null2String(employeeId));
|
||||
// po.setTaxAgentId(taxAgentId);
|
||||
// po.setSalaryAcctEmpId(Util.null2String(salaryAcctEmpId));
|
||||
//
|
||||
// DataCollectionEmployee emp = emps.get(employeeId);
|
||||
// po.setSubcompanyId(emp.getSubcompanyid());
|
||||
// po.setDepartmentId(emp.getDepartmentId());
|
||||
// po.setCostcenterId(emp.getCostcenterId());
|
||||
// po.setJobtitleId(emp.getJobtitleId());
|
||||
// po.setLocationId(emp.getLocationId());
|
||||
//
|
||||
// }
|
||||
salaryAcctEmpIds.add(salaryAcctEmpId);
|
||||
salaryAcctResults.addAll(salaryAcctResultsOfOneEmp);
|
||||
salaryAcctReports.addAll(salaryAcctResultReportOfOneEmp);
|
||||
// salaryAcctReports.addAll(salaryAcctResultReportOfOneEmp);
|
||||
}
|
||||
successCount++;
|
||||
}
|
||||
stopWatch.stop();
|
||||
// 如果sheet包含错误数据
|
||||
// if (CollectionUtils.isNotEmpty(errorDatas)) {
|
||||
// salaryBatchService.createErrorExcelSheet(headers, errorDatas, excelSheet.getName(), excelComments, errorExcelSheets);
|
||||
// }
|
||||
stopWatch.start("插入数据");
|
||||
if (StringUtils.equals("importExcelAcctResult", importType)) {
|
||||
getSalaryComparisonResultService(user).deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
|
||||
if (CollectionUtils.isNotEmpty(excelAcctResults)) {
|
||||
|
|
@ -1367,16 +1406,9 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
if (CollectionUtils.isNotEmpty(salaryAcctResults)) {
|
||||
// 处理导入薪资项的回算值
|
||||
handleOriginResultValue(deleteResults, salaryAcctResults);
|
||||
// 备份一份加密前的值
|
||||
List<SalaryAcctResultPO> list4log = new ArrayList<>();
|
||||
salaryAcctResults.stream().forEach(source -> {
|
||||
SalaryAcctResultPO target = new SalaryAcctResultPO();
|
||||
BeanUtils.copyProperties(source, target);
|
||||
list4log.add(target);
|
||||
});
|
||||
getSalaryAcctResultService(user).batchSave(salaryAcctResults);
|
||||
|
||||
// 记录操作日志 TODO 这里的数据没有id,id是自增的重新查数据太多效率太低
|
||||
// 记录操作日志
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId());
|
||||
String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth());
|
||||
LoggerContext loggerContext = new LoggerContext<>();
|
||||
|
|
@ -1386,16 +1418,17 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入薪资核算数据"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入薪资核算数据 ") + targetName);
|
||||
loggerContext.setOldValueList(list4log);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
|
||||
//报表
|
||||
getSalaryAcctReportService(user).batchSave(salaryAcctReports);
|
||||
// //报表
|
||||
// getSalaryAcctReportService(user).batchSave(salaryAcctReports);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(newSalaryAcctEmployees)) {
|
||||
getSalaryAcctEmployeeService(user).batchSave(newSalaryAcctEmployees);
|
||||
}
|
||||
}
|
||||
stopWatch.stop();
|
||||
stopWatch.start("锁定数据");
|
||||
SalarySysConfPO autoLock = getSalarySysConfService(user).getOneByCode(SalarySysConstant.EDIT_IMPORT_AUTO_LOCK);
|
||||
if (autoLock != null && StringUtils.equals(autoLock.getConfValue(), "1")) {
|
||||
// 导入的列都自动锁定
|
||||
|
|
@ -1405,6 +1438,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
.lockStatus(LockStatusEnum.LOCK).build();
|
||||
getSalaryAcctResultService(user).updateLockStatusByParam(updateLockStatusParam);
|
||||
}
|
||||
stopWatch.stop();
|
||||
log.info(stopWatch.prettyPrint());
|
||||
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", failCount);
|
||||
|
|
@ -1467,7 +1502,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
throw new SalaryRunTimeException("薪资核算记录不存在");
|
||||
}
|
||||
saveParam.setSalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalaryAcctResultTemplatePO> templateBySobId = getSalaryAcctResultTemplateService(user).listBySalarySobId(saveParam.getSalarySobId());
|
||||
List<SalaryAcctResultTemplatePO> templateBySobId = getSalaryAcctResultTemplateService(user).listBySalarySobId(saveParam.getSalarySobId(), Arrays.asList(0, 1));
|
||||
if (saveParam.getId() != null) {
|
||||
Optional<SalaryAcctResultTemplatePO> saveNameOptional = templateBySobId.stream().filter(po -> po.getTemplateName().equals(saveParam.getTemplateName()) && !po.getId().equals(saveParam.getId())).findFirst();
|
||||
if (saveNameOptional.isPresent()) {
|
||||
|
|
@ -1480,6 +1515,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
salaryAcctResultTemplatePO.setSalaryItemIds(StringUtils.join(saveParam.getSalaryItemIds(), ","));
|
||||
salaryAcctResultTemplatePO.setTemplateName(saveParam.getTemplateName());
|
||||
salaryAcctResultTemplatePO.setType(0);
|
||||
salaryAcctResultTemplatePO.setUpdateTime(new Date());
|
||||
getSalaryAcctResultTemplateService(user).update(salaryAcctResultTemplatePO);
|
||||
} else {
|
||||
|
|
@ -1489,16 +1525,18 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
// 新建
|
||||
Date now = new Date();
|
||||
getSalaryAcctResultTemplateService(user).insertIgnoreNull(SalaryAcctResultTemplatePO.builder()
|
||||
SalaryAcctResultTemplatePO templatePO = SalaryAcctResultTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.type(0)
|
||||
.salarySobId(saveParam.getSalarySobId())
|
||||
.salaryItemIds(StringUtils.join(saveParam.getSalaryItemIds(), ","))
|
||||
.templateName(saveParam.getTemplateName())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.build());
|
||||
.build();
|
||||
getSalaryAcctResultTemplateService(user).insertIgnoreNull(templatePO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1525,7 +1563,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
if (salaryAcctRecordPO == null) {
|
||||
throw new SalaryRunTimeException("薪资核算记录为空");
|
||||
}
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalaryAcctResultTemplatePO> salaryAcctResultTemplatePOS = getSalaryAcctResultTemplateService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), Arrays.asList(0, 1));
|
||||
if (StringUtils.isNotBlank(param.getTemplateName())) {
|
||||
salaryAcctResultTemplatePOS = salaryAcctResultTemplatePOS.stream().filter(po -> po.getTemplateName().contains(param.getTemplateName())).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
|
|
@ -17,7 +16,6 @@ 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.bo.SalaryAcctResultReportBO;
|
||||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.*;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
|
|
@ -51,7 +49,6 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -681,12 +678,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
List<List<SalaryAcctResultPO>> partition = Lists.partition(salaryAcctResultPOS, 100);
|
||||
partition.forEach(getSalaryAcctResultMapper()::batchInsert);
|
||||
}
|
||||
//报表 todo
|
||||
getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds);
|
||||
List<SalaryAcctResultReportPO> salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) {
|
||||
getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
|
||||
}
|
||||
//报表
|
||||
// getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds);
|
||||
// List<SalaryAcctResultReportPO> salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps);
|
||||
// if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) {
|
||||
// getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
|
||||
// }
|
||||
|
||||
|
||||
// 存储薪资核算结果数据来源日志
|
||||
|
|
@ -832,21 +829,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "薪资核算人员不能为空"));
|
||||
}
|
||||
|
||||
//核算锁定值
|
||||
List<Long> lockSalaryItemIds = salaryAcctRecordPO.getLockSalaryItemIds();
|
||||
Map<String, SalaryAcctResultPO> acctResults = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(lockSalaryItemIds)) {
|
||||
List<SalaryAcctResultPO> acctResultPOS = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singleton(calculateParam.getSalaryAcctRecordId()), lockSalaryItemIds);
|
||||
acctResults = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId())).collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
}
|
||||
List<Long> lockEmpIds = salaryAcctEmployeePOS.stream().filter(po -> LockStatusEnum.LOCK.getValue().equals(po.getLockStatus())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(lockEmpIds)) {
|
||||
List<SalaryAcctResultPO> acctResultPOS = listBySalaryAcctEmployeeIds(lockEmpIds);
|
||||
Map<String, SalaryAcctResultPO> acctResultMaps = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
acctResults.putAll(acctResultMaps);
|
||||
}
|
||||
|
||||
stopWatch.stop();
|
||||
stopWatch.start("核算耗时");
|
||||
|
||||
|
|
@ -875,8 +857,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.setSalarySobPO(salarySobPO)
|
||||
.setSalarySobCycleDTO(salarySobCycleDTO)
|
||||
.setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS)
|
||||
.setSalaryAcctLockResultPOS(MapUtils.emptyIfNull(acctResults))
|
||||
.setLockSalaryItemIds(lockSalaryItemIds)
|
||||
.setSalarySobItemPOS(salarySobItemPOS)
|
||||
.setSalaryItemIdWithPriorityList(salarySobItemsWithPriority)
|
||||
.setExpressFormulas(expressFormulas)
|
||||
|
|
@ -1019,13 +999,32 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// return salaryAcctEmployeeService.filterByAuthority(salaryAcctEmployees, employeeId);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void lock(SalaryAcctResultLockParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(param.getAcctEmpId());
|
||||
if (salaryAcctEmployeePO == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Long> lockItemIds = salaryAcctEmployeePO.getLockItems() == null ? new ArrayList<>() : salaryAcctEmployeePO.getLockItems();
|
||||
Long salaryItemId = param.getSalaryItemId();
|
||||
|
||||
if (param.getLockStatus() == LockStatusEnum.LOCK) {
|
||||
lockItemIds.add(salaryItemId);
|
||||
} else {
|
||||
lockItemIds.removeIf(salaryItemId::equals);
|
||||
}
|
||||
|
||||
salaryAcctEmployeePO.setLockItems(Lists.newArrayList(new HashSet(lockItemIds)));
|
||||
|
||||
getSalaryAcctEmployeeService(user).lock(salaryAcctEmployeePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLockStatusByParam(SalaryAcctResultUpdateLockStatusParam updateParam) {
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(updateParam.getSalaryAcctRecordId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecord.getLockSalaryItemIds())) {
|
||||
salaryAcctRecord.setLockSalaryItemIds(new ArrayList<>());
|
||||
}
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
return;
|
||||
|
|
@ -1037,15 +1036,18 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
} else {
|
||||
salaryItemIds = Collections.singleton(updateParam.getSalaryItemId());
|
||||
}
|
||||
if (updateParam.getLockStatus() == LockStatusEnum.LOCK) {
|
||||
Set<Long> lockSalaryItemIds = new HashSet<>();
|
||||
lockSalaryItemIds.addAll(salaryAcctRecord.getLockSalaryItemIds());
|
||||
lockSalaryItemIds.addAll(salaryItemIds);
|
||||
salaryAcctRecord.setLockSalaryItemIds(new ArrayList<Long>(lockSalaryItemIds));
|
||||
} else {
|
||||
salaryAcctRecord.getLockSalaryItemIds().removeAll(salaryItemIds);
|
||||
}
|
||||
getSalaryAcctRecordService(user).updateLockSalaryItemIds(salaryAcctRecord);
|
||||
|
||||
salaryAcctEmployees.forEach(salaryAcctEmployeePO -> {
|
||||
List<Long> lockItemIds = salaryAcctEmployeePO.getLockItems() == null ? new ArrayList<>() : salaryAcctEmployeePO.getLockItems();
|
||||
|
||||
if (updateParam.getLockStatus() == LockStatusEnum.LOCK) {
|
||||
lockItemIds.addAll(salaryItemIds);
|
||||
} else {
|
||||
lockItemIds.removeAll(salaryItemIds);
|
||||
}
|
||||
salaryAcctEmployeePO.setLockItems(Lists.newArrayList(new HashSet(lockItemIds)));
|
||||
getSalaryAcctEmployeeService(user).lock(salaryAcctEmployeePO);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1075,7 +1077,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isEmpty(salaryAcctEmployeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<List<Long>> partition = Lists.partition((List<Long>) salaryAcctEmployeeIds, 200);
|
||||
List<List<Long>> partition = Lists.partition(salaryAcctEmployeeIds, 200);
|
||||
List<SalaryAcctResultPO> result = new ArrayList<>();
|
||||
partition.forEach(empIds -> {
|
||||
SalaryAcctResultPO build = SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).salaryItemIds(salaryItemIds).build();
|
||||
|
|
@ -1188,30 +1190,30 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
|
||||
// 报表
|
||||
SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
.salaryItemId(param.getSalaryItemId())
|
||||
.salaryAcctRecordId(param.getSalaryAcctRecordId())
|
||||
.salaryAcctEmpId(salaryAcctEmployeePO.getId().toString())
|
||||
.employeeId(salaryAcctEmployeePO.getEmployeeId().toString())
|
||||
.taxAgentId(salaryAcctEmployeePO.getTaxAgentId())
|
||||
.resultValue(param.getValue())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployeePO.getEmployeeId());
|
||||
if (dataCollectionEmployee != null) {
|
||||
po.setDepartmentId(dataCollectionEmployee.getDepartmentId());
|
||||
po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid());
|
||||
po.setCostcenterId(dataCollectionEmployee.getCostcenterId());
|
||||
po.setJobtitleId(dataCollectionEmployee.getJobtitleId());
|
||||
po.setLocationId(dataCollectionEmployee.getLocationId());
|
||||
}
|
||||
salaryAcctResultReportPOS.add(po);
|
||||
// SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
// .salaryItemId(param.getSalaryItemId())
|
||||
// .salaryAcctRecordId(param.getSalaryAcctRecordId())
|
||||
// .salaryAcctEmpId(salaryAcctEmployeePO.getId().toString())
|
||||
// .employeeId(salaryAcctEmployeePO.getEmployeeId().toString())
|
||||
// .taxAgentId(salaryAcctEmployeePO.getTaxAgentId())
|
||||
// .resultValue(param.getValue())
|
||||
// .creator(Long.valueOf(user.getUID()))
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .deleteType(NumberUtils.INTEGER_ZERO)
|
||||
// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .build();
|
||||
// DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployeePO.getEmployeeId());
|
||||
// if (dataCollectionEmployee != null) {
|
||||
// po.setDepartmentId(dataCollectionEmployee.getDepartmentId());
|
||||
// po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid());
|
||||
// po.setCostcenterId(dataCollectionEmployee.getCostcenterId());
|
||||
// po.setJobtitleId(dataCollectionEmployee.getJobtitleId());
|
||||
// po.setLocationId(dataCollectionEmployee.getLocationId());
|
||||
// }
|
||||
// salaryAcctResultReportPOS.add(po);
|
||||
});
|
||||
|
||||
// 入库
|
||||
|
|
@ -1224,8 +1226,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
batchSave(needInsertList);
|
||||
|
||||
// 报表入库前先删除
|
||||
getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(param.getIdList(), Collections.singletonList(param.getSalaryItemId()));
|
||||
getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
|
||||
// getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(param.getIdList(), Collections.singletonList(param.getSalaryItemId()));
|
||||
// getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ public class SalaryAcctResultTemplateServiceImpl extends Service implements Sala
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId) {
|
||||
public List<SalaryAcctResultTemplatePO> listBySalarySobId(Long salarySobId,List<Integer> types) {
|
||||
if (salarySobId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryAcctResultTemplateMapper().listSome(SalaryAcctResultTemplatePO.builder().salarySobId(salarySobId).build());
|
||||
return getSalaryAcctResultTemplateMapper().listSome(SalaryAcctResultTemplatePO.builder().salarySobId(salarySobId).types(types).build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.mapper.setting.PageListSettingMapper;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.SettingService;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
|
||||
/**
|
||||
* 薪资核算
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SettingServiceImpl extends Service implements SettingService {
|
||||
|
||||
private PageListSettingMapper getPageListSettingMapper() {
|
||||
return MapperProxyFactory.getProxy(PageListSettingMapper.class);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam) {
|
||||
Date now = new Date();
|
||||
|
||||
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(pageListSettingSaveParam.getPage());
|
||||
if (pageListSettingPO != null) {
|
||||
pageListSettingPO.setSetting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()));
|
||||
pageListSettingPO.setUpdateTime(now);
|
||||
getPageListSettingMapper().updateIgnoreNull(pageListSettingPO);
|
||||
} else {
|
||||
pageListSettingPO = PageListSettingPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.page(pageListSettingSaveParam.getPage())
|
||||
.setting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()))
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.tenantKey(DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
getPageListSettingMapper().insertIgnoreNull(pageListSettingPO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getPageListSetting(PageListSettingQueryParam param) {
|
||||
String page = param.getPage();
|
||||
Map result = new HashMap();
|
||||
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(page);
|
||||
if ("salary_details_report".equals(page)) {
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
salaryItemList = salaryItemList.stream()
|
||||
.filter(po -> {
|
||||
String name = param.getName();
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
return po.getName() != null && po.getName().contains(name);
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.sorted((o1, o2) -> {
|
||||
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
|
||||
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
|
||||
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
|
||||
return systemType1.compareTo(systemType2);
|
||||
} else {
|
||||
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
|
||||
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
|
||||
return sortedIndex2.compareTo(sortedIndex1);
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
result.put("setting", salaryItemList);
|
||||
if (pageListSettingPO != null && StrUtil.isNotEmpty(pageListSettingPO.getSetting())) {
|
||||
result.put("checked", JsonUtil.parseList(pageListSettingPO.getSetting(), Long.class));
|
||||
} else {
|
||||
List<Long> collect = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
result.put("checked", collect);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
||||
import com.engine.salary.mapper.datacollection.VariableArchiveItemMapper;
|
||||
import com.engine.salary.service.VariableArchiveItemService;
|
||||
|
|
@ -18,11 +19,17 @@ import java.util.List;
|
|||
* @description 浮动薪酬档案明细
|
||||
*/
|
||||
public class VariableArchiveItemServiceImpl extends Service implements VariableArchiveItemService {
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
||||
private VariableArchiveItemMapper getVariableArchiveItemMapper(){
|
||||
return MapperProxyFactory.getProxy(VariableArchiveItemMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VariableArchiveItemPO> listAll() {
|
||||
return getVariableArchiveItemMapper().listAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据浮动薪资档案id获取
|
||||
*
|
||||
|
|
@ -34,7 +41,8 @@ public class VariableArchiveItemServiceImpl extends Service implements VariableA
|
|||
if (CollectionUtils.isEmpty(variableArchiveIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getVariableArchiveItemMapper().listSome(VariableArchiveItemPO.builder().variableArchiveIds(variableArchiveIds).build());
|
||||
List<VariableArchiveItemPO> variableArchiveItemPOS = getVariableArchiveItemMapper().listSome(VariableArchiveItemPO.builder().variableArchiveIds(variableArchiveIds).build());
|
||||
return encryptUtil.decryptList(variableArchiveItemPOS, VariableArchiveItemPO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -52,6 +60,7 @@ public class VariableArchiveItemServiceImpl extends Service implements VariableA
|
|||
if (CollectionUtils.isEmpty(insertList)) {
|
||||
return 0;
|
||||
}
|
||||
encryptUtil.encryptList(insertList, VariableArchiveItemPO.class);
|
||||
List<List<VariableArchiveItemPO>> partition = Lists.partition(insertList, 50);
|
||||
partition.forEach(part -> getVariableArchiveItemMapper().batchInsert(part));
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -141,10 +141,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> buildVariableArchiveData(Collection<VariableArchiveListDTO> variableArchives) {
|
||||
if (CollectionUtils.isEmpty(variableArchives)) {
|
||||
// 无数据
|
||||
}
|
||||
public List<Map<String, Object>> buildVariableArchiveData(List<VariableArchiveListDTO> variableArchives) {
|
||||
List<Long> variableArchiveIds = variableArchives.stream().map(VariableArchiveListDTO::getId).collect(Collectors.toList());
|
||||
// 获取浮动薪资档案所对应的浮动薪资项目数据
|
||||
List<VariableArchiveItemPO> variableArchiveItemList = getVariableArchiveItemService(user).listByVariableArchiveIds(variableArchiveIds);
|
||||
|
|
@ -199,9 +196,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
|
||||
List<VariableArchivePO> variableArchivePOList = getVariableArchiveMapper().listSome(VariableArchivePO.builder().salaryMonth(saveParam.getSalaryMonthDate()).taxAgentId(saveParam.getTaxAgentIds()).employeeId(saveParam.getEmployeeId()).build());
|
||||
if (CollectionUtils.isNotEmpty(variableArchivePOList)) {
|
||||
// 先删除原有档案
|
||||
List<Long> variableArchiveIds = variableArchivePOList.stream().map(VariableArchivePO::getId).collect(Collectors.toList());
|
||||
getVariableArchiveMapper().deleteByIds(variableArchiveIds);
|
||||
throw new SalaryRunTimeException("已存在浮动薪酬数据");
|
||||
}
|
||||
|
||||
// 保存浮动薪资档案信息
|
||||
|
|
@ -597,4 +592,41 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
List<VariableArchiveListDTO> variableArchiveListDTO = list(queryParam);
|
||||
return buildVariableArchiveData(variableArchiveListDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateData(VariableArchiveSaveParam updateParam) {
|
||||
if (updateParam.getId() == null) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
// 获取浮动薪酬档案
|
||||
VariableArchivePO variableArchivePO = getVariableArchiveMapper().getById(updateParam.getId());
|
||||
if (variableArchivePO == null) {
|
||||
throw new SalaryRunTimeException("浮动薪酬档案不存在或已被删除");
|
||||
}
|
||||
|
||||
// 删除原有的浮动薪酬档案明细
|
||||
getVariableArchiveItemService(user).deleteByArchiveIds(Collections.singletonList(updateParam.getId()));
|
||||
|
||||
// 保存浮动薪资档案详细信息
|
||||
List<VariableArchiveItemPO> variableArchiveItemList = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
updateParam.getItemValueList().forEach(e -> {
|
||||
variableArchiveItemList.add(VariableArchiveItemPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.employeeId(updateParam.getEmployeeId())
|
||||
.variableArchiveId(variableArchivePO.getId())
|
||||
.variableItemId(e.getVariableItemId())
|
||||
.itemValue(e.getItemValue())
|
||||
.creator(Long.valueOf(user.getUID()))
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build());
|
||||
});
|
||||
|
||||
if (CollectionUtils.isNotEmpty(variableArchiveItemList)) {
|
||||
getVariableArchiveItemService(user).batchInsert(variableArchiveItemList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,4 +145,15 @@ public class SalarySysConstant {
|
|||
* 我的薪资福利工资单个税扣缴义务人显示状态
|
||||
*/
|
||||
public static final String TAX_AGENT_SHOW_STATUS = "taxAgentShowStatus";
|
||||
|
||||
|
||||
/**
|
||||
* 报表是否开启缓存,0:关闭 1:开启
|
||||
*/
|
||||
public static final String REPORT_CACHE = "REPORT_CACHE";
|
||||
|
||||
/**
|
||||
* 报表组织类型,null/0 :核算时组织信息 1:实时组织信息
|
||||
*/
|
||||
public static final String REPORT_ORGANIZATIN_TYPE = "REPORT_ORGANIZATIN_TYPE";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public interface SalarySysConfService {
|
|||
|
||||
SalarySysConfPO getOneByCode(String code);
|
||||
|
||||
String getValueByCode(String code);
|
||||
|
||||
List<SalarySysConfPO> listSome(SalarySysConfPO build);
|
||||
|
||||
void save(SalarySysConfPO salarySysConfPO);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.datacollection.AddUpDeduction;
|
|||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
|
|
@ -24,10 +25,7 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
|||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.*;
|
||||
import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper;
|
||||
import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper;
|
||||
|
|
@ -39,6 +37,8 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
|||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
||||
import com.engine.salary.service.VariableArchiveItemService;
|
||||
import com.engine.salary.service.impl.VariableArchiveItemServiceImpl;
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
|
|
@ -157,6 +157,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private VariableArchiveItemService getVariableArchiveItemService(User user) {
|
||||
return ServiceUtil.getService(VariableArchiveItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作是否需要申报功能
|
||||
|
|
@ -216,6 +219,12 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return getSalarySysConfMapper().getOneByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueByCode(String code) {
|
||||
SalarySysConfPO confPO = getSalarySysConfMapper().getOneByCode(code);
|
||||
return confPO == null ? "" : confPO.getConfValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySysConfPO> listSome(SalarySysConfPO po) {
|
||||
return getSalarySysConfMapper().listSome(po);
|
||||
|
|
@ -1228,14 +1237,42 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return 1;
|
||||
});
|
||||
|
||||
int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get();
|
||||
if (flag == 15) {
|
||||
Future<Integer> submit15 = fixedThreadPool.submit(() -> {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
List<VariableArchiveItemPO> variableArchiveItemPOS = getVariableArchiveItemService(user).listAll();
|
||||
if (CollectionUtils.isNotEmpty(variableArchiveItemPOS)) {
|
||||
variableArchiveItemPOS.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue(), sysConfPo));
|
||||
} else {
|
||||
po.setItemValue(AESEncryptUtil.encrypt(po.getItemValue()));
|
||||
}
|
||||
});
|
||||
List<List<VariableArchiveItemPO>> partition = Lists.partition(variableArchiveItemPOS, 10);
|
||||
VariableArchiveItemMapper mapper = sqlSession.getMapper(VariableArchiveItemMapper.class);
|
||||
partition.forEach(mapper::updateBatchSelective);
|
||||
sqlSession.commit();
|
||||
log.info("finish hrsa_variable_archive_item");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
sqlSession.rollback();
|
||||
log.error("fail hrsa_variable_archive_item", e);
|
||||
return 0;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get() + submit15.get();
|
||||
if (flag == 16) {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30);
|
||||
} else {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30);
|
||||
}
|
||||
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);
|
||||
return flag == 15;
|
||||
return flag == 16;
|
||||
} catch (Exception e) {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30);
|
||||
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.engine.salary.timer;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.ly.param.LySalaryReportQueryParam;
|
||||
import com.engine.salary.service.LyFundReportService;
|
||||
import com.engine.salary.service.LySalaryReportService;
|
||||
import com.engine.salary.service.LySocialReportService;
|
||||
import com.engine.salary.service.impl.LyFundReportServiceImpl;
|
||||
import com.engine.salary.service.impl.LySalaryReportServiceImpl;
|
||||
import com.engine.salary.service.impl.LySocialReportServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -29,6 +31,10 @@ public class LySalaryVoucherReportJob extends BaseCronJob {
|
|||
return ServiceUtil.getService(LySocialReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LyFundReportService getLyFundReportService(User user) {
|
||||
return ServiceUtil.getService(LyFundReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private String salaryAddMonth;
|
||||
|
||||
@Override
|
||||
|
|
@ -43,5 +49,6 @@ public class LySalaryVoucherReportJob extends BaseCronJob {
|
|||
LySalaryReportQueryParam param = LySalaryReportQueryParam.builder().salaryMonth(formatYearMonth).build();
|
||||
getlLySalaryReportService(user).generateSalaryReport(param);
|
||||
getlLySocialReportService(user).generateSocialReport(param);
|
||||
getLyFundReportService(user).generateFundReport(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public class ExcelUtilPlus {
|
|||
rowZeroCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowZeroCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(i, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
patternList.add(columnGroupItem.getPattern());
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -349,7 +349,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -454,7 +454,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -588,7 +588,7 @@ public class ExcelUtilPlus {
|
|||
rowOneCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowOneCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
startIndex++;
|
||||
patternList.add(columnGroupItem.getPattern());
|
||||
} else {
|
||||
|
|
@ -610,7 +610,7 @@ public class ExcelUtilPlus {
|
|||
subHeader.setCellValue(childrenItem.getText().toString());
|
||||
subHeader.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex + j, Math.max(12, childrenItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex + j, Math.min(255, Math.max(12, childrenItem.getText().length() * 4)) * 256);
|
||||
patternList.add(childrenItem.getPattern());
|
||||
}
|
||||
|
||||
|
|
@ -789,7 +789,7 @@ public class ExcelUtilPlus {
|
|||
rowOneCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowOneCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
startIndex++;
|
||||
} else {
|
||||
List<WeaTableColumnGroup> childrenList = columnGroupItem.getChildren();
|
||||
|
|
@ -810,7 +810,7 @@ public class ExcelUtilPlus {
|
|||
subHeader.setCellValue(childrenItem.getText().toString());
|
||||
subHeader.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex + j, Math.max(12, childrenItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex + j, Math.min(255, Math.max(12, childrenItem.getText().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
startIndex += childrenList.size();
|
||||
|
|
|
|||
|
|
@ -176,9 +176,9 @@ public class LySalaryController {
|
|||
//---------------------------------------------------------薪酬汇总报表end--------------------------------------------
|
||||
|
||||
|
||||
//---------------------------------------------------------社保公积金汇总报表start-------------------------------------
|
||||
//---------------------------------------------------------社保汇总报表start-------------------------------------
|
||||
/**
|
||||
* 生成社保公积金汇总报表
|
||||
* 生成社保汇总报表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
|
|
@ -194,7 +194,7 @@ public class LySalaryController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询社保公积金汇总报表
|
||||
* 查询社保汇总报表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
|
|
@ -226,7 +226,7 @@ public class LySalaryController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 社保公积金汇总报表 合计行
|
||||
* 社保汇总报表 合计行
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
|
|
@ -290,7 +290,128 @@ public class LySalaryController {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------社保公积金汇总报表end---------------------------------------
|
||||
//---------------------------------------------------------社保汇总报表end---------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------公积金汇总报表start-------------------------------------
|
||||
/**
|
||||
* 生成公积金汇总报表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/generate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String generateFundReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<LySalaryReportQueryParam, String>(user).run(getLySalaryWrapper(user)::generateFundReport, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公积金汇总报表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listFundReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<LySalaryReportQueryParam, Map<String, Object>>(user).run(getLySalaryWrapper(user)::listFundReport, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公积金汇总报表的发放公司下拉框
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/gmgsList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String fundReportGmgsList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<LySalaryReportQueryParam, List<Map<String, Object>>>(user).run(getLySalaryWrapper(user)::fundReportGmgsList, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公积金汇总报表 合计行
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/sum")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String fundReportSum(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<LySalaryReportQueryParam, Map<String, Object>>(user).run(getLySalaryWrapper(user)::fundReportSum, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公积金报表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/batchDelete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteFundReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<List<Long>, String>(user).run(getLySalaryWrapper(user)::deleteFundReport, param.getIds());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公积金报表数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/FundReport/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportFundReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getLySalaryWrapper(user).exportFundReport(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = param.getSalaryMonth() +"公积金汇总报表" + "-" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("公积金汇总报表导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------公积金汇总报表end---------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------领悦生成凭证start------------------------------------------
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public class SalaryAcctController {
|
|||
@GET
|
||||
@Path("/compareSobConfig")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String compareSobConfig(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) {
|
||||
public String compareSobConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Boolean>(user).run(getSalaryAcctRecordWrapper(user)::compareSobConfig, id);
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ public class SalaryAcctController {
|
|||
@GET
|
||||
@Path("/updateSobConfig")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateSobConfig(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) {
|
||||
public String updateSobConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Boolean>(user).run(getSalaryAcctRecordWrapper(user)::updateSobConfig, id);
|
||||
}
|
||||
|
|
@ -247,13 +247,13 @@ public class SalaryAcctController {
|
|||
return new ResponseResult<Long, String>(user).run(getSalaryAcctEmployeeWrapper(user)::checkTaxAgent, param.getSalaryAcctRecordId());
|
||||
}
|
||||
|
||||
//刷新薪资核算人员的个税扣缴义务人
|
||||
//刷新薪资核算人员
|
||||
@POST
|
||||
@Path("/acctemployee/refreshTaxAgent")
|
||||
@Path("/acctemployee/refresh")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String refreshTaxAgent(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmpRefreshTaxAgentParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getSalaryAcctEmployeeWrapper(user)::refreshTaxAgent, param.getSalaryAcctRecordId());
|
||||
return new ResponseResult<Long, String>(user).run(getSalaryAcctEmployeeWrapper(user)::refresh, param.getSalaryAcctRecordId());
|
||||
}
|
||||
|
||||
//从环比上月减少添加薪资核算人员
|
||||
|
|
@ -464,6 +464,14 @@ public class SalaryAcctController {
|
|||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/acctresult/lock")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String lock(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultLockParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultLockParam, String>(user).run(getSalaryAcctResultWrapper(user)::lock, param);
|
||||
}
|
||||
|
||||
//更新薪资项目锁定状态
|
||||
@POST
|
||||
@Path("/acctresult/updateLockStatus")
|
||||
|
|
@ -583,9 +591,9 @@ public class SalaryAcctController {
|
|||
@POST
|
||||
@Path("/acctresult/cacheImportField")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cacheImportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) {
|
||||
public String cacheImportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<List<Long>, String>(user).run(getSalaryAcctExcelService(user)::cacheImportField, param.getSalaryItems());
|
||||
return new ResponseResult<SalaryAcctResultTemplateSaveParam, String>(user).run(getSalaryAcctExcelService(user)::cacheImportField, param);
|
||||
}
|
||||
|
||||
// 薪资核算导出字段缓存
|
||||
|
|
@ -630,7 +638,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String exportTemplateList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultTemplateSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultTemplateSaveParam, Map<String, Object>>(user).run(getSalaryAcctExcelService(user)::exportTemplateList, param);
|
||||
return new ResponseResult<SalaryAcctResultTemplateSaveParam, Map<String, Object>>(user).run(getSalaryAcctExcelService(user)::exportTemplateList, param);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import com.engine.salary.wrapper.SalaryCommonWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
|
|
@ -52,4 +52,25 @@ public class SalaryCommonController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 页面模板设置
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/pageList/save/setting")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String savePageListSetting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PageListSettingSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListSettingSaveParam, String>(user).run(getSalaryCommonWrapper(user)::savePageListSetting, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/pageList/get/setting")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPageListSetting(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListSettingQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListSettingQueryParam, Map>(user).run(getSalaryCommonWrapper(user)::getPageListSetting, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,12 @@ public class VariableArchiveController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String createData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody VariableArchiveSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<VariableArchiveSaveParam, String>(user).run(getVariableArchiveWrapper(user)::createData, saveParam);
|
||||
if (saveParam.getId() == null) {
|
||||
return new ResponseResult<VariableArchiveSaveParam, String>(user).run(getVariableArchiveWrapper(user)::createData, saveParam);
|
||||
} else {
|
||||
// 更新
|
||||
return new ResponseResult<VariableArchiveSaveParam, String>(user).run(getVariableArchiveWrapper(user)::updateData, saveParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@ package com.engine.salary.wrapper;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.ly.param.*;
|
||||
import com.engine.salary.entity.ly.po.LyFundReportPO;
|
||||
import com.engine.salary.entity.ly.po.LySalaryReportPO;
|
||||
import com.engine.salary.entity.ly.po.LySocialReportPO;
|
||||
import com.engine.salary.entity.ly.po.LyVoucherPO;
|
||||
import com.engine.salary.service.LyFundReportService;
|
||||
import com.engine.salary.service.LyPZService;
|
||||
import com.engine.salary.service.LySalaryReportService;
|
||||
import com.engine.salary.service.LySocialReportService;
|
||||
import com.engine.salary.service.impl.LyFundReportServiceImpl;
|
||||
import com.engine.salary.service.impl.LyPZServiceImpl;
|
||||
import com.engine.salary.service.impl.LySalaryReportServiceImpl;
|
||||
import com.engine.salary.service.impl.LySocialReportServiceImpl;
|
||||
|
|
@ -37,6 +40,10 @@ public class LySalaryWrapper extends Service {
|
|||
return ServiceUtil.getService(LySocialReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LyFundReportService getLyFundReportService(User user) {
|
||||
return ServiceUtil.getService(LyFundReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LyPZService getLyPZService(User user) {
|
||||
return ServiceUtil.getService(LyPZServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -154,8 +161,8 @@ public class LySalaryWrapper extends Service {
|
|||
* 推送凭证到UC并保存到本地
|
||||
* @param pushParam
|
||||
*/
|
||||
public void pushUCAndSave(LyVoucherPushParam pushParam) {
|
||||
getLyPZService(user).pushUCAndSave(pushParam);
|
||||
public Map<String, Object> pushUCAndSave(LyVoucherPushParam pushParam) {
|
||||
return getLyPZService(user).pushUCAndSave(pushParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,4 +193,55 @@ public class LySalaryWrapper extends Service {
|
|||
public List<Map<String, Object>> sIReportGmgsList(LySalaryReportQueryParam queryParam) {
|
||||
return getLySocialReportService(user).sIReportGmgsList(queryParam);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------公积金汇总报表----------------------------------------------------------
|
||||
public void generateFundReport(LySalaryReportQueryParam param) {
|
||||
getLyFundReportService(user).generateFundReport(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公积金汇总报表
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public Map<String, Object> listFundReport(LySalaryReportQueryParam param) {
|
||||
return getLyFundReportService(user).listFundReport(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公积金汇总报表 合计行
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public Map<String, Object> fundReportSum(LySalaryReportQueryParam param) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
|
||||
//合计
|
||||
LyFundReportPO sumRow = getLyFundReportService(user).sumRow(param);
|
||||
datas.put("sumRow", sumRow);
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报表数据
|
||||
*
|
||||
* @param siReportIds
|
||||
*/
|
||||
public void deleteFundReport (List<Long> siReportIds) {
|
||||
getLyFundReportService(user).deleteFundReport(siReportIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公积金统计报表导出
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public XSSFWorkbook exportFundReport(LySalaryReportQueryParam param) {
|
||||
return getLyFundReportService(user).exportFundReport(param);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> fundReportGmgsList(LySalaryReportQueryParam queryParam) {
|
||||
return getLyFundReportService(user).fundReportGmgsList(queryParam);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,11 +184,11 @@ public class SalaryAcctEmployeeWrapper extends Service {
|
|||
}
|
||||
|
||||
/**
|
||||
* 刷新个税扣缴义务人
|
||||
* 刷新核算人员
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录的id
|
||||
*/
|
||||
public void refreshTaxAgent(Long salaryAcctRecordId) {
|
||||
public void refresh(Long salaryAcctRecordId) {
|
||||
getSalaryAcctEmployeeService(user).refresh(salaryAcctRecordId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,11 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
getSalaryAcctResultService(user).save(saveParam);
|
||||
}
|
||||
|
||||
|
||||
public void lock(SalaryAcctResultLockParam param) {
|
||||
getSalaryAcctResultService(user).lock(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新薪资核算结果的值的锁定状态
|
||||
*
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue