Merge branch 'release/3.0.2.2504.01' into custom/联特

# Conflicts:
#	resource/WEB-INF/prop/hrmSalary.properties
#	src/com/engine/salary/service/SalaryAcctRecordService.java
#	src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java
#	src/com/engine/salary/web/TaxDeclarationController.java
#	src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
#	src/com/engine/salary/wrapper/TaxDeclarationWrapper.java
This commit is contained in:
钱涛 2025-12-12 15:55:20 +08:00
commit 18c8a88744
64 changed files with 799 additions and 99 deletions

View File

@ -1,5 +1,5 @@
log=false
defaultCloseNonStandard149=true
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
version=3.0.2.250708.04
openFormulaForcedEditing=true
version=3.0.2.2510.01.ts
openFormulaForcedEditing=false

View File

@ -1,41 +1,42 @@
CREATE TABLE hrsa_hrm_snapshot (
ID bigint(0) NOT NULL,
CREATE TABLE hrsa_hrm_snapshot
(
ID bigint NOT NULL,
snapshot_time timestamp,
employee_id bigint(0),
employee_id bigint,
loginid varchar(100),
LASTNAME varchar(60),
SEX char(1),
BIRTHDAY char(10) ,
NATIONALITY int(0) ,
NATIONALITY int ,
MARITALSTATUS char(1) ,
TELEPHONE varchar(60),
MOBILE varchar(60) ,
MOBILECALL varchar(60) ,
EMAIL varchar(60),
LOCATIONID int(0),
LOCATIONID int,
WORKROOM varchar(60),
HOMEADDRESS varchar(100),
RESOURCETYPE char(1) ,
STARTDATE char(10) ,
ENDDATE char(10),
JOBTITLE int(0) ,
JOBTITLE int ,
JOBTITLENAME varchar(200) ,
JOBACTIVITYDESC varchar(200),
JOBLEVEL int(0) ,
SECLEVEL int(0) ,
DEPARTMENTID int(0) ,
JOBLEVEL int ,
SECLEVEL int ,
DEPARTMENTID int ,
DEPARTMENTNAME varchar(200) ,
SUBCOMPANYID1 int(0) ,
SUBCOMPANYID1 int ,
SUBCOMPANYNAME varchar(200) ,
COSTCENTERID int(0) ,
MANAGERID int(0) ,
ASSISTANTID int(0),
BANKID1 int(0) ,
COSTCENTERID int ,
MANAGERID int ,
ASSISTANTID int,
BANKID1 int ,
ACCOUNTID1 varchar(100) ,
LASTLOGINDATE char(10) ,
CERTIFICATENUM varchar(60) ,
NATIVEPLACE varchar(100) ,
EDUCATIONLEVEL int(0) ,
EDUCATIONLEVEL int ,
BEMEMBERDATE char(10) ,
BEPARTYDATE char(10) ,
WORKCODE varchar(60) ,
@ -44,8 +45,8 @@ CREATE TABLE hrsa_hrm_snapshot (
RESIDENTPLACE varchar(200) ,
POLICY varchar(30) ,
DEGREE varchar(30) ,
USEKIND int(0) ,
JOBCALL int(0) ,
USEKIND int ,
JOBCALL int ,
jobcallname varchar(200) ,
ACCUMFUNDACCOUNT varchar(30),
BIRTHPLACE varchar(60) ,
@ -54,14 +55,14 @@ CREATE TABLE hrsa_hrm_snapshot (
RESIDENTPOSTCODE varchar(60) ,
EXTPHONE varchar(50) ,
MANAGERSTR varchar(500),
STATUS int(0) ,
STATUS int ,
FAX varchar(60) ,
ISLABOUUNION char(1),
TEMPRESIDENTNUMBER varchar(60),
PROBATIONENDDATE char(10),
COUNTRYID int(0) ,
ACCOUNTTYPE int(0) ,
BELONGTO int(0) ,
COUNTRYID int ,
ACCOUNTTYPE int ,
BELONGTO int ,
ACCOUNTNAME varchar(200) ,
companystartdate varchar(10),
workstartdate varchar(10) ,

View File

@ -18,7 +18,8 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人
二、删除停薪员工档案
update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive set delete_type=3 where delete_type=0 and run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive_item set delete_type=3 where delete_type=0
二、删除停薪员工社保档案
update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
@ -28,10 +29,10 @@ update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
--删除社保福利档案
update hrsa_insurance_base_info set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_insurance_base_info set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
-- 删除薪资档案
update hrsa_salary_archive set delete_type=3 where employee_id = ? and tax_agent_id=?
@ -45,4 +46,13 @@ update hrsa_other_archives set delete_type=3;
update hrsa_tax_agent_emp set delete_type=3;
-- 删除核算记录
update hrsa_salary_acct_record set delete_type=3 where delete_type=0 and id= 核算记录id;
update hrsa_salary_acct_emp set delete_type=3 where delete_type=0 and salary_acct_record_id=核算记录id;
update hrsa_salary_acct_result set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;
--删除工资单信息
update hrsa_salary_send set delete_type=3 where delete_type=0 and salary_accounting_id = 核算记录id;
update hrsa_salary_send_info set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;

View File

@ -1,3 +1,5 @@
## 薪资档案生成不了
select id from hrsa_tax_agent_emp
where tax_agent_id =扣缴义务人id
and delete_type = 0
@ -6,5 +8,14 @@ and employee_id not in
where tax_agent_id =扣缴义务人id and delete_type = 0)
update hrsa_tax_agent_emp set delete_type = 3
where tax_agent_id=扣缴义务人id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =扣缴义务人id and delete_type = 0)
update hrsa_tax_agent_emp set delete_type = 3 where delete_type = 0
where tax_agent_id=扣缴义务人id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =扣缴义务人id and delete_type = 0)
## 考勤引用
drop sequence HRSA_ATTEND_QUOTE_ID
/
drop trigger HRSA_ATTEND_QUOTE_TRI
/

View File

@ -80,6 +80,8 @@ public class CheckEditSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, CheckEditSIArchiveAction.SalaryField::getSalaryName, CheckEditSIArchiveAction.SalaryField::getValue));
log.info("CheckEditSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = list.stream().filter(f -> f.salaryName.equals("档案状态")).findFirst().map(CheckEditSIArchiveAction.SalaryField::getValue).orElse("1");

View File

@ -78,6 +78,7 @@ public class CheckEditSalaryAction implements Action {
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
log.info("CheckEditSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
.importDatas(importData)
.build();

View File

@ -98,7 +98,7 @@ public class CheckInitSalaryAction implements Action {
list.add(new SalaryField(processField, salaryName, value));
}
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("CheckInitSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
return doSalaryArchiveInit(requestInfo, importDataMap);
} catch (Exception e) {
log.error("定薪检查异常", e);

View File

@ -89,6 +89,7 @@ public class CheckStayAddToPaySIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStayAddToPaySIArchiveAction.SalaryField::getSalaryName, CheckStayAddToPaySIArchiveAction.SalaryField::getValue);
log.info("CheckStayAddToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -88,6 +88,7 @@ public class CheckStayDelToStopSIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStayDelToStopSIArchiveAction.SalaryField::getSalaryName, CheckStayDelToStopSIArchiveAction.SalaryField::getValue);
log.info("CheckStayDelToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -92,6 +92,7 @@ public class CheckStopSalaryAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStopSalaryAction.SalaryField::getSalaryName, CheckStopSalaryAction.SalaryField::getValue);
log.info("CheckStopSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -88,6 +88,7 @@ public class CopyToPaySIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, CopyToPaySIArchiveAction.SalaryField::getSalaryName, CopyToPaySIArchiveAction.SalaryField::getValue));
log.info("CopyToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//操作人
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(CopyToPaySIArchiveAction.SalaryField::getValue).orElse("1");
//增员

View File

@ -79,6 +79,7 @@ public class EditSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditSIArchiveAction.SalaryField::getSalaryName, EditSIArchiveAction.SalaryField::getValue));
log.info("EditSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = list.stream().filter(f -> f.salaryName.equals("档案状态")).findFirst().map(EditSIArchiveAction.SalaryField::getValue).orElse("1");

View File

@ -77,7 +77,7 @@ public class EditSalaryAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
log.info("EditSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
.importDatas(importData)
.build();

View File

@ -97,6 +97,7 @@ public class EditToPaySIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditToPaySIArchiveAction.SalaryField::getSalaryName, EditToPaySIArchiveAction.SalaryField::getValue));
log.info("EditToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = EmployeeStatusEnum.STAY_ADD.getValue();

View File

@ -97,6 +97,7 @@ public class EditToStopSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditToStopSIArchiveAction.SalaryField::getSalaryName, EditToStopSIArchiveAction.SalaryField::getValue));
log.info("EditToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = EmployeeStatusEnum.PAYING.getValue();

View File

@ -100,7 +100,7 @@ public class InitSalaryAction implements Action {
}
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("InitSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
return doSalaryArchiveInit(requestInfo, importDataMap);
} catch (Exception e) {
log.error("定薪异常", e);

View File

@ -108,6 +108,7 @@ public class RehireAction implements Action {
list.add(new SalaryField(processField, salaryName, value));
}
Map<String, Object> salaryFieldMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("RehireActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), salaryFieldMap);
String taxAgentName = salaryFieldMap.getOrDefault("个税扣缴义务人", "").toString();
String empIdStr = salaryFieldMap.getOrDefault("员工id", "").toString();
if (StringUtils.isBlank(taxAgentName) || StringUtils.isBlank(empIdStr)) {

View File

@ -93,6 +93,7 @@ public class StayAddToPaySIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StayAddToPaySIArchiveAction.SalaryField::getSalaryName, StayAddToPaySIArchiveAction.SalaryField::getValue);
log.info("StayAddToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -94,6 +94,7 @@ public class StayDelToStopSIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StayDelToStopSIArchiveAction.SalaryField::getSalaryName, StayDelToStopSIArchiveAction.SalaryField::getValue);
log.info("StayDelToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -99,6 +99,7 @@ public class StopSalaryAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StopSalaryAction.SalaryField::getSalaryName, StopSalaryAction.SalaryField::getValue);
log.info("StopSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
//操作人
String uid = importDataMap.getOrDefault("操作人","1").toString();
User user = new User(Integer.parseInt(uid));

View File

@ -117,6 +117,7 @@ public class UpdateSISchemeDetailAction implements Action {
rs.beforFirst();
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, UpdateSISchemeDetailAction.SalaryField::getSalaryName, UpdateSISchemeDetailAction.SalaryField::getValue);
log.info("UpdateSISchemeDetailActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
//设置更新对象元素
String schemeId = importDataMap.getOrDefault("福利方案id", "").toString();
String schemeName = importDataMap.getOrDefault("福利方案名称", "").toString();

View File

@ -0,0 +1,27 @@
package com.engine.salary.entity.salaryBill.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 工资单批量操作参数
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalarySendBatParam {
// 工资单发放Id
private List<Long> salarySendIds;
}

View File

@ -0,0 +1,34 @@
package com.engine.salary.entity.salaryacct.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* 批量操作参数
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryAcctBatParam {
//薪资所属月
private Date salaryMonth;
//薪资账套id
private List<Long> salarySobIds;
//备注
private String description;
private List<Long> salaryAcctRecordIds;
}

View File

@ -28,4 +28,6 @@ public class SalarySobQueryParam extends BaseQueryParam {
* 数据过滤级别
*/
private AuthFilterTypeEnum filterType;
private boolean isShare;
}

View File

@ -0,0 +1,40 @@
package com.engine.salary.entity.siaccount.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 AccountBatParam {
//账单月份")
//@NotNull
@DataCheck(require = true,message = "账单月份不能为空")
private String billMonth;
//备注")
//@Length(max = 60)
@DataCheck(max = 60,message = "备注长度不能超过60个字符")
private String remarks;
/**
* 个税扣缴义务人id
*/
@DataCheck(require = true,message = "个税扣缴义务人不能为空")
private List<Long> paymentOrganizations;
private List<Long> ids;
}

View File

@ -26,4 +26,6 @@ public class TaxAgentQueryParam extends BaseQueryParam {
//个税扣缴义务人名称
private String name;
private boolean isShare;
}

View File

@ -721,6 +721,7 @@ public class TaxDeclarationBO {
private static String findStringValue(String fieldCode, Map<Long, List<SalaryAcctResultPO>> resultMap, Map<String, Long> salaryItemMap) {
return resultMap.getOrDefault(salaryItemMap.getOrDefault(fieldCode, 0L), Collections.emptyList()).stream()
.map(SalaryAcctResultPO::getResultValue)
.filter(Objects::nonNull)
.findFirst().orElse("");
}

View File

@ -0,0 +1,54 @@
package com.engine.salary.entity.taxdeclaration.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.YearMonth;
import java.util.Date;
import java.util.List;
/**
* 生成个税申报表参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TaxDeclarationBatParam {
/**
* 个税申报id
*/
private Long taxDeclarationId;
/**
* 薪资所属月
*/
private YearMonth salaryMonth;
/**
* 个税扣缴义务人
*/
private List<Long> taxAgentIds;
/**
* 备注
*/
private String description;
private String salaryMonthStr;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date taxCycle;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date salaryDate;
}

View File

@ -11,7 +11,6 @@ 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.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
@ -31,6 +30,8 @@ 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.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
@ -49,6 +50,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>
@ -103,6 +106,11 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
return ServiceUtil.getService(SettingServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private final boolean isRealOrg = "1".equals(getSalarySysConfService(user).getValueByCode(REPORT_ORGANIZATIN_TYPE));
@Override
public PageInfo<SalaryStatisticsEmployeeListDTO> listPage(SalaryStatisticsEmployeeQueryParam queryParam) {
List<SalaryStatisticsEmployeeListDTO> list = Collections.emptyList();
@ -262,14 +270,22 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
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()));
map.put("department", Util.null2String(emp.getDepartmentName()));
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("idNo", Util.null2String(emp.getIdNo()));
map.put("companystartdate", Util.null2String(emp.getCompanystartdate()));
if(isRealOrg){
map.put("subCompany", Util.null2String(emp.getSubcompanyName()));
map.put("department", Util.null2String(emp.getDepartmentName()));
map.put("jobTitle", Util.null2String(emp.getJobtitleName()));
map.put("status", Util.null2String(NumberUtil.isNumber(emp.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(emp.getStatus())).getDefaultLabel() : null));
}else {
map.put("subCompany", Util.null2String(se.getSubcompanyName()));
map.put("department", Util.null2String(se.getDepartmentName()));
map.put("jobTitle", Util.null2String(se.getJobtitleName()));
map.put("status", Util.null2String(NumberUtil.isNumber(se.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(se.getStatus())).getDefaultLabel() : null));
}
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
// map.put("incomeCategory", Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
list.add(map);

View File

@ -525,7 +525,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
throw new SalaryRunTimeException("该维度值中无数据!");
}
// 同一个人放在一起
listByDimensionValue = listByDimensionValue.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getEmployeeId)).collect(Collectors.toList());
listByDimensionValue = listByDimensionValue.stream().sorted((a,b)-> b.getSalaryMonth().compareTo(a.getSalaryMonth())).collect(Collectors.toList());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOList = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), listByDimensionValue);
// 获取此分页的核算人员

View File

@ -303,6 +303,7 @@ public class SalaryStatisticsReportWrapper extends Service {
// 如果是被分享的报表校验分享权限通过后将user赋值为报表创建人
User creator = new User();
creator.setUid(po.getCreator().intValue());
creator.setLogintype("1");
user = creator;
} else {
// 判断报表是否是登陆人创建的,或薪酬总管理员

View File

@ -324,5 +324,13 @@ public interface SIAccountService {
void deleteSocialAcctEmp(SaveCommonAccountParam param);
String addSocialAcctEmp(SaveCommonAccountParam param);
void batSave(AccountBatParam param);
void batDelete(AccountBatParam param);
void batFile(AccountBatParam param);
void batSocialSecurityBenefitsRecalculate(AccountBatParam batParam);
}

View File

@ -1,6 +1,7 @@
package com.engine.salary.service;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.entity.salaryacct.param.SalaryAcctBatParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
@ -233,4 +234,11 @@ public interface SalaryAcctRecordService {
* @param ids
*/
void generateCBSPushList(List<Long> ids);
void batSave(SalaryAcctBatParam saveParam);
void batFile(SalaryAcctBatParam param);
void batReCalculate(SalaryAcctBatParam param);
}

View File

@ -21,6 +21,7 @@ import com.engine.salary.mapper.auth.AuthRoleMapper;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.HashSet;
@ -156,7 +157,7 @@ public class AuthDataServiceImpl extends Service implements AuthDataService {
public List<AuthRoleDataDTO> listRoleData( AuthDataQueryParam param) {
List<AuthRoleDataDTO> authRoleDataDTOS = getAuthRoleDataMapper().listRoleData(param.getRoleId());
if (StrUtil.isNotEmpty(param.getUsername())){
authRoleDataDTOS = authRoleDataDTOS.stream().filter(authRoleDataDTO -> authRoleDataDTO.getUsername().contains(param.getUsername())).collect(Collectors.toList());
authRoleDataDTOS = authRoleDataDTOS.stream().filter(authRoleDataDTO -> StringUtils.isNotBlank(authRoleDataDTO.getUsername()) && authRoleDataDTO.getUsername().contains(param.getUsername())).collect(Collectors.toList());
}
return authRoleDataDTOS;
}

View File

@ -24,6 +24,7 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -196,7 +197,7 @@ public class AuthMemberServiceImpl extends Service implements AuthMemberService
public List<AuthRoleEmpDTO> listRoleEmp(AuthMemberQueryParam param) {
List<AuthRoleEmpDTO> empDTOS = getAuthRoleEmpMapper().getByRoleId(param.getRoleId());
if(StrUtil.isNotEmpty(param.getUsername())){
empDTOS = empDTOS.stream().filter(item -> item.getUsername().contains(param.getUsername())).collect(Collectors.toList());
empDTOS = empDTOS.stream().filter(item -> StringUtils.isNotBlank(item.getUsername()) && item.getUsername().contains(param.getUsername())).collect(Collectors.toList());
}
return empDTOS;

View File

@ -1,6 +1,7 @@
package com.engine.salary.service.auth;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrmelog.entity.dto.LoggerContext;
@ -63,6 +64,12 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
public PageInfo<AuthRoleDTO> roleList(AuthRoleListQueryParam param) {
List<AuthRolePO> authRolePOS = getAuthRoleMapper().list(param);
String name = param.getName();
if(StrUtil.isNotBlank(name)){
authRolePOS = authRolePOS.stream().filter(po -> po.getName().contains(name)).collect(Collectors.toList());
}
int total = authRolePOS.size();
List<AuthRoleDTO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)

View File

@ -275,7 +275,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
.collect(Collectors.toList());
effectiveFields.forEach(attendQuoteField -> {
header.add(attendQuoteField.getFieldName());
header.add(Util.formatMultiLang(attendQuoteField.getFieldName(), String.valueOf(user.getLanguage())));
}
);
}
@ -519,7 +519,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<Map<String, Object>> attendQuoteSyncData = new ArrayList<>();
Attend4Salary attend4Salary = new Attend4Salary();
try {
int partSize = 500;
int partSize = 100;
List<List<Long>> partition = Lists.partition(employeeIds, partSize);
for (List<Long> part : partition) {
attend4Salary.setBeginDate(attendCycleRange.getFromDate());
@ -606,7 +606,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
header.add(SalaryI18nUtil.getI18nLabel(86317, "证件号码"));
// 动态列
for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) {
header.add(attendQuoteField.getFieldName());
header.add(Util.formatMultiLang(attendQuoteField.getFieldName(), String.valueOf(user.getLanguage())));
}
List<List<Object>> rows = new ArrayList<>();
rows.add(header);

View File

@ -27,6 +27,7 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.*;
@ -292,7 +293,7 @@ public class AttendQuoteFieldServiceImpl extends Service implements AttendQuoteF
Map<String, String> column = columnsOptional.get();
updates.add(AttendQuoteFieldPO.builder()
.code(column.get("code"))
.fieldName(column.get("name"))
.fieldName(Util.formatMultiLang(column.get("name"), String.valueOf(user.getLanguage())))
.updateTime(now)
.build());
}
@ -312,7 +313,7 @@ public class AttendQuoteFieldServiceImpl extends Service implements AttendQuoteF
Optional<Map<String, String>> columnsOptional = columns.stream().filter(column -> code.equals(column.get("code"))).findFirst();
if (columnsOptional.isPresent()) {
Map<String, String> column = columnsOptional.get();
saves.add(buildAttendQuoteField(column.get("code"), column.get("name")));
saves.add(buildAttendQuoteField(column.get("code"), Util.formatMultiLang(column.get("name"), String.valueOf(user.getLanguage()))));
}
}
if (CollectionUtils.isNotEmpty(saves)) {

View File

@ -93,7 +93,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
Map<Long, DataCollectionEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity()));
list.forEach(item -> {
Map<String, Object> record = new HashMap<>();
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId());
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId()) ==null?new DataCollectionEmployee():collect.get(item.getEmployeeId());
record.put("id", item.getId());
record.put("employeeId", item.getEmployeeId());
record.put("billMonth", item.getBillMonth());

View File

@ -36,6 +36,7 @@ import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.general.Util;
import weaver.hrm.User;
import java.lang.reflect.Field;
@ -483,7 +484,7 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic
List<FormulaVar> formulaVars = fields.stream().map(e -> {
FormulaVar formulaVar = new FormulaVar();
formulaVar.setFieldId(referenceEnum.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + e.getId());
formulaVar.setName(e.getFieldName());
formulaVar.setName(Util.formatMultiLang(e.getFieldName(), String.valueOf(user.getLanguage())));
formulaVar.setSource("" + referenceEnum.getValue());
formulaVar.setFieldType(DataType.NUMBER);
return formulaVar;

View File

@ -1666,7 +1666,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
// Long taxAgentId = 0L;
List<InsuranceAccountDetailPO> list = new ArrayList<>();
String username = (String) map.getOrDefault("姓名", "");
String billMonth = (String) map.getOrDefault("账单月份", "");
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
String supplementaryMonth = (String) map.getOrDefault("补缴月份", "");
@ -1770,11 +1770,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//校验补缴人员是否存在福利档案基础信息并且runStatus处于正在缴纳或者待减员
InsuranceArchivesBaseInfoPO insuranceBaseInfo = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(paymentOrganization, employeeId);
if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) ) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补缴人员中存在未设置福利档案人员或相关人员不在福利在缴人员中,不可新建补缴信息!"));
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(0, "补缴未设置福利档案人员或不在福利在缴人员中,不可新建补缴信息!"));
}
List<Long> empIdsInPayMonthRange = listCanPayEmpIds(paymentOrganization, billMonth.substring(0, 7));
if (!empIdsInPayMonthRange.contains(employeeId)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
}
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
// 封装InsuranceAccountDetailPO
@ -6719,6 +6719,55 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(welfareNames));
}
@Override
public void batSave(AccountBatParam accountBatParam) {
List<Long> paymentOrganizations = accountBatParam.getPaymentOrganizations();
for (Long paymentOrganization : paymentOrganizations) {
AccountParam param = AccountParam.builder()
.billMonth(accountBatParam.getBillMonth())
.paymentOrganization(paymentOrganization)
.flag(true)
.remarks(accountBatParam.getRemarks())
.build();
save(param);
}
}
@Override
public void batDelete(AccountBatParam batParam) {
List<Long> ids = batParam.getIds();
for (Long id : ids) {
InsuranceAccountBatchPO po = getInsuranceAccountBatchMapper().getById(id);
AccountParam param = AccountParam.builder()
.billMonth(po.getBillMonth())
.paymentOrganization(po.getPaymentOrganization())
.build();
delete(param);
}
}
@Override
public void batFile(AccountBatParam batParam) {
List<Long> ids = batParam.getIds();
for (Long id : ids) {
InsuranceAccountBatchPO po = getInsuranceAccountBatchMapper().getById(id);
AccountParam param = AccountParam.builder()
.billMonth(po.getBillMonth())
.paymentOrganization(po.getPaymentOrganization())
.build();
file(param);
}
}
@Override
public void batSocialSecurityBenefitsRecalculate(AccountBatParam batParam) {
List<Long> ids = batParam.getIds();
for (Long id : ids) {
InsuranceAccountBatchPO param = InsuranceAccountBatchPO.builder().id(id).build();
socialSecurityBenefitsRecalculate(param);
}
}
public void accountOtherView(InsuranceAccountViewListDTO dto, List<InsuranceAccountDetailPO> pos) {
int otherNum = 0;
BigDecimal otherPaySum = new BigDecimal("0");

View File

@ -1,7 +1,6 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.alipay.oceanbase.jdbc.StringUtils;
import com.cloudstore.eccom.pc.table.WeaTable;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
@ -41,6 +40,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.Column;
import com.google.common.collect.Lists;
import com.engine.salary.util.db.IdGenerator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import weaver.hrm.User;

View File

@ -485,8 +485,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
if(socialComMap !=null){
socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());

View File

@ -2473,6 +2473,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
* @param employeeId
*/
public String update(InsuranceSchemeReqParam updateParam, long employeeId) {
log.info("福利方案更新参数:{}", updateParam);
//查询是否存在福利方案
InsuranceSchemePO insuranceSchemePO = getById(updateParam.getInsuranceScheme().getId());
if (Objects.isNull(insuranceSchemePO)) {
@ -2506,6 +2507,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//更新福利方案主表
InsuranceSchemePO insuranceSchemePO1 = InsuranceSchemeBO.buildInsuranceSchemePO(insuranceSchemePO, updateParam.getInsuranceScheme());
getInsuranceSchemeMapper().update(insuranceSchemePO1);
log.info("福利方案更新主表:{}", insuranceSchemePO1);
//记录主表操作日志
loggerContext.setNewValues(insuranceSchemePO1);
SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext);
@ -2529,6 +2531,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//更新福利方案明细表 先删后插
getInsuranceSchemeDetailMapper().batchDeleteByPrimaryIds(Collections.singleton(updateParam.getInsuranceScheme().getId()));
//更新明细表
log.info("福利方案更新明细表:{}", insuranceSchemeDetailPOS);
encryptUtil.encryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
insuranceSchemeDetailPOS.forEach(getInsuranceSchemeDetailMapper()::insert);

View File

@ -11,6 +11,7 @@ import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctBatParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
@ -52,6 +53,8 @@ import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.time.YearMonth;
import java.time.YearMonth;
import java.util.*;
import java.util.stream.Collectors;
@ -603,7 +606,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
if (StringUtils.isNotBlank(notDeclareTaxAgentIdStr)) {
notDeclareTaxAgentIdList.addAll(Arrays.stream(notDeclareTaxAgentIdStr.split(",")).filter(NumberUtils::isCreatable).map(Long::new).collect(Collectors.toList()));
}
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
if (notDeclareTaxAgentIdList.contains(salaryAcctTaxAgent.getTaxAgentId())) {
@ -1083,4 +1086,39 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
}
}
@Override
public void batSave(SalaryAcctBatParam saveParam) {
List<Long> salarySobIds = saveParam.getSalarySobIds();
YearMonth salaryMonth = SalaryDateUtil.localDate2YearMonth(saveParam.getSalaryMonth());
for (int i = 0; i < salarySobIds.size(); i++) {
Long salarySobId = salarySobIds.get(i);
SalaryAcctRecordSaveParam param = SalaryAcctRecordSaveParam.builder()
.salarySobId(salarySobId)
.salaryMonth(salaryMonth)
.description(saveParam.getDescription())
.build();
save(param);
}
}
@Override
public void batFile(SalaryAcctBatParam param) {
List<Long> salaryAcctRecordIds = param.getSalaryAcctRecordIds();
for (int i = 0; i < salaryAcctRecordIds.size(); i++) {
Long recordId = salaryAcctRecordIds.get(i);
file(recordId);
}
}
@Override
public void batReCalculate(SalaryAcctBatParam param) {
List<Long> salaryAcctRecordIds = param.getSalaryAcctRecordIds();
for (int i = 0; i < salaryAcctRecordIds.size(); i++) {
Long recordId = salaryAcctRecordIds.get(i);
reCalculate(recordId);
}
}
}

View File

@ -374,14 +374,25 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
if (CollectionUtils.isNotEmpty(otherConditions)) {
List<Long> items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList());
List<SalaryAcctResultPO> list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items);
for (int i = 0; i < otherConditions.size(); i++) {
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
Long itemId = otherCondition.getItemId();
FilterEnum filter = otherCondition.getFilter();
List<String> params = otherCondition.getParams();
list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList());
Map<Long, List<SalaryAcctResultPO>> acctEmpResultsMap = SalaryEntityUtil.group2Map(list, SalaryAcctResultPO::getSalaryAcctEmpId);
Set<Long> removeAcctEmpIds = new HashSet<>();
for (Long acctEmpId : acctEmpResultsMap.keySet()) {
List<SalaryAcctResultPO> acctEmpResults = acctEmpResultsMap.get(acctEmpId);
//如果有一个条件不成立就删除
for (int i = 0; i < otherConditions.size(); i++) {
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
Long itemId = otherCondition.getItemId();
FilterEnum filter = otherCondition.getFilter();
List<String> params = otherCondition.getParams();
for (SalaryAcctResultPO po : acctEmpResults) {
if(Objects.equals(po.getSalaryItemId(), itemId) && !filter.filter(params).test(po.getResultValue())){
removeAcctEmpIds.add(po.getSalaryAcctEmpId());
}
}
}
}
List<Long> salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList());
acctEmpResultsMap.keySet().removeAll(removeAcctEmpIds);
List<Long> salaryAcctEmpId = Lists.newArrayList(acctEmpResultsMap.keySet());
if (CollectionUtils.isEmpty(salaryAcctEmpId)) {
//条件不满足直接返回空列表
@ -1334,7 +1345,14 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public void updateLockStatusByParam(SalaryAcctResultUpdateLockStatusParam updateParam) {
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
Set<Long> acctEmpIds = updateParam.getAcctEmpIds();
List<SalaryAcctEmployeePO> salaryAcctEmployees;
if (CollUtil.isNotEmpty(acctEmpIds)) {
salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByIds(acctEmpIds);
} else {
salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
}
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
return;
}

View File

@ -683,8 +683,6 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
public XSSFWorkbook exportAdjustRecordList(SalaryItemAdjustRecordQueryParam queryParam) {
// 1.工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资项目调整记录");
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
String[] header = {
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
SalaryI18nUtil.getI18nLabel(86187, "员工状态"),

View File

@ -519,7 +519,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
// 1.工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案");
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
Object[] header = {
new WeaTableColumnGroup("150px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "", "", 0),
new WeaTableColumnGroup("150px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "", "", 0),

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -173,7 +174,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
}
//外部人员
if(hasExtEmp){
if (hasExtEmp) {
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
@ -417,20 +418,24 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
result.addAll(employBiz.listByVirtualParams(virtualParams));
List<Long> empIds = new ArrayList<>();
includeQueryParams.stream()
.filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name()))
.forEach(param -> {
String sql = param.getTarget();
RecordSet rs = new RecordSet();
if (rs.execute(sql)) {
while (rs.next()) {
empIds.add((long) rs.getInt("id"));
}
for (SalarySobRangeEmpQueryParam param:includeQueryParams) {
if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){
List<Long> empIds = new ArrayList<>();
String sql = param.getTarget();
RecordSet rs = new RecordSet();
if (rs.execute(sql)) {
while (rs.next()) {
empIds.add((long) rs.getInt("id"));
}
});
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
result.addAll(employees);
}
if(CollUtil.isNotEmpty(empIds)){
Collection<String> employeeStatus = param.getEmployeeStatus();
List<DataCollectionEmployee> employeeByIdsAll = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
List<DataCollectionEmployee> collect = employeeByIdsAll.stream().filter(e -> employeeStatus.contains(e.getStatus())).collect(Collectors.toList());
result.addAll(collect);
}
}
}
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据需要根据人员id去重
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));

View File

@ -1,7 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Validator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -1752,9 +1751,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
}
String mobile = employee.getMobile();
if (Validator.isMobile(mobile)) {
throw new SalaryRunTimeException("手机号信息有误");
}
boolean checkSendSMS = MessageUtil.checkSendSMS();
if (!checkSendSMS) {
@ -1782,6 +1778,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
//取出验证码
String cacheValue = getSalaryCacheService(user).get(SALARY_CACHE_SMS_CODE + "_" + id);
if (cacheValue == null) {
throw new SalaryRunTimeException("未获取到验证码,请重新发送");
}
String[] cache = cacheValue.split("_");
String code = cache[0];
//失效时间

View File

@ -254,6 +254,9 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
}
List<SalarySobPO> list = getSalarySobMapper().listSome(build);
if (param.isShare() == true) {
return list;
}
return getAuthService(user).auth(list, param.getFilterType(), SalarySobPO.class);
}

View File

@ -471,15 +471,20 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
SpecialAddDeductionBiz SpecialAddDeductionBiz = new SpecialAddDeductionBiz();
Long currentEmployeeId = (long) user.getUID();
// 获取所有个税扣缴义务人
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList =
getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
// Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList =
// getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
SpecialAddDeductionPO byId = SpecialAddDeductionBiz.getById(specialAddDeductionParam.getId());
if (byId == null) {
throw new SalaryRunTimeException("该数据不存在!");
}
//管理员可以编辑该扣缴义务人数据其他人可以编辑本人数据
boolean canEdit = byId.getEmployeeId().equals((long) user.getUID())
|| taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), byId.getTaxAgentId()));
|| taxAgentList.stream().anyMatch(t -> Objects.equals(t.getId(), byId.getTaxAgentId()));
if (!canEdit) {
//没有编辑权限
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");

View File

@ -291,6 +291,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
public List<TaxAgentPO> listAuth(TaxAgentQueryParam queryParam) {
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listBySome(queryParam);
AuthFilterTypeEnum filterType = queryParam.getFilterType();
if (queryParam.isShare()) {
return taxAgents;
}
return getAuthService(user).auth(taxAgents, filterType, TaxAgentPO.class);
}
@ -586,7 +589,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
public List<Map<String, Object>> selectList(boolean needAuth) {
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
if (needAuth) {
taxAgents = handleForDevolution(taxAgents, (long) user.getUID(), true);
taxAgents = getAuthService(user).auth(taxAgents, AuthFilterTypeEnum.QUERY_DATA, TaxAgentPO.class);
}
return taxAgents.stream().map(m -> {
Map<String, Object> map = new HashMap<>(2);

View File

@ -8,6 +8,7 @@ import com.engine.salary.common.SalaryContext;
import com.engine.salary.exception.ExceptionUtil;
import com.engine.salary.exception.SalaryRunTimeException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import weaver.general.BaseBean;
@ -15,6 +16,7 @@ import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
@ -52,6 +54,17 @@ public class ResponseResult<T, R> {
SalaryContext.get().setValue("response", response);
}
public T parseParams(HttpServletRequest request, Class<T> clazz) {
T t = null;
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
t = mapper.readValue(request.getInputStream(), clazz);
} catch (IOException e) {
log.error("salary api parseParams fail , param {}", t, e);
}
return t;
}
/**
* 统一返回方法

View File

@ -136,6 +136,15 @@ public class SalaryEntityUtil {
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a));
}
public static <T, K, V> Map<K, V> convert2LinkedMap(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();
}
return objs.stream()
.filter(e -> valueMapper.apply(e) != null && keyMapper.apply(e) != null)
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a, LinkedHashMap::new));
}
public static <R, T> Map<R, List<T>> group2Map(Collection<T> objs, Function<T, R> function) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();

View File

@ -217,6 +217,38 @@ public class SIAccountController {
return new ResponseResult<AccountParam, String>(user).run(getService(user)::save, param);
}
@POST
@Path("/batSave")
@Produces(MediaType.APPLICATION_JSON)
public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AccountBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<AccountBatParam, String>(user).run(getService(user)::batSave, param);
}
@POST
@Path("/batDelete")
@Produces(MediaType.APPLICATION_JSON)
public String batDelete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AccountBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<AccountBatParam, String>(user).run(getService(user)::batDelete, param);
}
@POST
@Path("/batFile")
@Produces(MediaType.APPLICATION_JSON)
public String batFile(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AccountBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<AccountBatParam, String>(user).run(getService(user)::batFile, param);
}
@POST
@Path("/batSocialSecurityBenefitsRecalculate")
@Produces(MediaType.APPLICATION_JSON)
public String batSocialSecurityBenefitsRecalculate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AccountBatParam batParam ){
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<AccountBatParam, String>(user).run(getService(user)::batSocialSecurityBenefitsRecalculate,batParam);
}
/**
* 正常缴纳页核算

View File

@ -151,6 +151,43 @@ public class SalaryAcctController {
return new ResponseResult<Long, Long>(user).run(getSalaryAcctRecordWrapper(user)::reCalculate, param.getSalaryAcctRecordId());
}
//薪资核算
@POST
@Path("/batAccounting")
@Produces(MediaType.APPLICATION_JSON)
public String batAccounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryAcctBatParam, String>(user).run(getSalaryAcctRecordWrapper(user)::batCalculate, param);
}
//保存薪资核算的基本信息
@POST
@Path("/basic/batSave")
@Produces(MediaType.APPLICATION_JSON)
public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryAcctBatParam, Long>(user).run(getSalaryAcctRecordWrapper(user)::batSave, param);
}
//归档薪资核算记录
@POST
@Path("/batFile")
@Produces(MediaType.APPLICATION_JSON)
public String batFile(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryAcctBatParam, Long>(user).run(getSalaryAcctRecordWrapper(user)::batFile, param);
}
//重新核算
@POST
@Path("/batReAccounting")
@Produces(MediaType.APPLICATION_JSON)
public String batReAccounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctBatParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryAcctBatParam, Long>(user).run(getSalaryAcctRecordWrapper(user)::batReCalculate, param);
}
//判断是否存在合并计税
@GET
@Path("/hasConsolidatedTax")

View File

@ -488,6 +488,29 @@ public class SalaryBillController {
return new ResponseResult<SalarySendWithdrawParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::withdraw, queryParam);
}
@POST
@Path("/send/batGrant")
@Produces(MediaType.APPLICATION_JSON)
public String batGrant(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batGrant, queryParam);
}
/**
* 工资单撤回
*
* @param queryParam
* @return
*/
@POST
@Path("/send/batWithdraw")
@Produces(MediaType.APPLICATION_JSON)
public String batWithdraw(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batWithdraw, queryParam);
}
/**
* 工资单发放详情列表的高级搜索
*

View File

@ -5,6 +5,13 @@ import com.engine.salary.entity.taxdeclaration.dto.*;
import com.engine.salary.entity.taxdeclaration.param.*;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
import com.engine.salary.service.TaxDeclarationExcelService;
import com.engine.salary.service.TaxDeclarationService;
import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl;
@ -475,6 +482,15 @@ public class TaxDeclarationController {
return new ResponseResult<TaxDeclareRecordDetailSaveParam, String>(user).run(getTaxDeclareRecordWrapper(user)::add, param);
}
@POST
@Path("/batSave")
@Produces(MediaType.APPLICATION_JSON)
public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBatParam param) {
User user = HrmUserVarify.getUser(request, response);
param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr()));
return new ResponseResult<TaxDeclarationBatParam, Long>(user).run(getTaxDeclarationWrapper(user)::batSave, param);
}
/**
* 编辑

View File

@ -92,7 +92,7 @@ public class AttendQuoteDataWrapper extends Service {
attendQuoteFields.stream()
.filter(attendQuoteField->effectiveColumns.contains(Util.null2String(attendQuoteField.getId())))
.forEach(attendQuoteField -> {
columns.add(Column.builder().title(attendQuoteField.getFieldName())
columns.add(Column.builder().title(Util.formatMultiLang(attendQuoteField.getFieldName(), String.valueOf(user.getLanguage())))
.dataIndex(attendQuoteField.getId() + "_attendQuoteData")
.key(attendQuoteField.getId() + "_attendQuoteData").display(Boolean.TRUE).build());
}

View File

@ -10,12 +10,13 @@ import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO;
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO;
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordListDTO;
import com.engine.salary.entity.salaryacct.param.SalaryAcctBatParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctSobConfigPO;
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
import com.engine.salary.entity.salarysob.po.*;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
@ -55,6 +56,9 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
}
private SalaryAcctResultWrapper getSalaryAcctResultWrapper(User user) {
return ServiceUtil.getService(SalaryAcctResultWrapper.class, user);
}
private SalarySobService getSalarySobService(User user) {
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
@ -388,4 +392,28 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
public void generateCBSPushList(List<Long> ids) {
getSalaryAcctRecordService(user).generateCBSPushList(ids);
}
public void batSave(SalaryAcctBatParam param) {
getSalaryAcctRecordService(user).batSave(param);
}
public void batFile(SalaryAcctBatParam param) {
getSalaryAcctRecordService(user).batFile(param);
}
public void batReCalculate(SalaryAcctBatParam param) {
getSalaryAcctRecordService(user).batReCalculate(param);
}
public void batCalculate(SalaryAcctBatParam param) {
List<Long> salaryAcctRecordIds = param.getSalaryAcctRecordIds();
for (int i = 0; i < salaryAcctRecordIds.size(); i++) {
Long recordId = salaryAcctRecordIds.get(i);
SalaryAcctCalculateParam calculateParam = SalaryAcctCalculateParam.builder().salaryAcctRecordId(recordId).build();
getSalaryAcctResultWrapper(user).calculate(calculateParam);
}
}
}

View File

@ -534,9 +534,6 @@ public class SalaryArchiveWrapper extends Service {
return map;
}
public Map<String, Object> selectSalaryArchiveColumns(String importType) {
return getSalaryArchiveService(user).selectSalaryArchiveColumns(SalaryArchiveImportTypeEnum.parseByValue(importType));
}
public Map<String, Object> checkSalaryArchiveInit(SalaryArchiveImportActionParam importData) {

View File

@ -117,9 +117,9 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
list.forEach(dto -> {
// 回算过但是查看的是普通工资单不能查看详情;回算过但是查看的是回算工资单可以发记录没回算过可以发
if(Objects.equals(dto.getSalaryAcctRecordType(), NumberUtils.INTEGER_ONE) && Objects.equals(dto.getSalaryAcctType(),NumberUtils.INTEGER_ZERO)){
if (Objects.equals(dto.getSalaryAcctRecordType(), NumberUtils.INTEGER_ONE) && Objects.equals(dto.getSalaryAcctType(), NumberUtils.INTEGER_ZERO)) {
dto.setCanSeeDetail(false);
}else{
} else {
dto.setCanSeeDetail(true);
}
});
@ -142,7 +142,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? salaryTemplatePO.getReplenishName() : salaryTemplatePO.getName());
e.setTemplateId(salaryTemplatePO.getId());
if ((salaryTemplatePO.getAckFeedbackStatus() != null && salaryTemplatePO.getAckFeedbackStatus() == 1) ||
(salaryTemplatePO.getFeedbackStatus() != null && salaryTemplatePO.getFeedbackStatus() == 1) ) {
(salaryTemplatePO.getFeedbackStatus() != null && salaryTemplatePO.getFeedbackStatus() == 1)) {
e.setAckFeedbackStatus(1);
} else {
e.setAckFeedbackStatus(0);
@ -688,6 +688,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
/**
* 发送短信验证码
*
* @param param 短信验证码发送参数
*/
public void sendMobileCode(SMSCodeSendParam param) {
@ -696,6 +697,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
/**
* 校验短信验证码
*
* @param param
* @return
*/
@ -706,7 +708,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
public PayrollCheckTypeEnum payrollCheckType() {
SalarySysConfPO conf = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_PAYROLL_CHECK_TYPE);
if(conf == null){
if (conf == null) {
return PayrollCheckTypeEnum.PWD;
}
@ -714,14 +716,14 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
}
public void confirmSalaryBill(Long salaryInfoId) {
if(ObjectUtil.isNull(salaryInfoId)){
if (ObjectUtil.isNull(salaryInfoId)) {
throw new SalaryRunTimeException("工资单id不能为空");
}
getSalaryBillService(user).confirmSalaryBill(salaryInfoId);
}
public void feedBackSalaryBill(Long salaryInfoId) {
if(ObjectUtil.isNull(salaryInfoId)){
if (ObjectUtil.isNull(salaryInfoId)) {
throw new SalaryRunTimeException("工资单id不能为空");
}
getSalaryBillService(user).feedBackSalaryBill(salaryInfoId);
@ -738,4 +740,50 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
public String genPdfBeforeExport(SalaryExportPdfParam salaryExportPdfParam) {
return getSalaryBillService(user).genPdfBeforeExport(salaryExportPdfParam);
}
public String batGrant(SalarySendBatParam param) {
List<Long> salarySendIds = param.getSalarySendIds();
int successCount = 0;
int failCount = 0;
String failMsg = "";
for (int i = 0; i < salarySendIds.size(); i++) {
try {
Long sendId = salarySendIds.get(i);
SalarySendGrantParam grantParam = SalarySendGrantParam.builder()
.salarySendId(sendId)
.build();
grant(grantParam);
successCount++;
} catch (Exception e) {
failCount++;
failMsg = failMsg + "" + (i + 1) + "个发放失败!失败原因:" + e.getMessage() + "\n";
}
}
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
}
public String batWithdraw(SalarySendBatParam param) {
List<Long> salarySendIds = param.getSalarySendIds();
int successCount = 0;
int failCount = 0;
String failMsg = "";
for (int i = 0; i < salarySendIds.size(); i++) {
try {
Long sendId = salarySendIds.get(i);
SalarySendWithdrawParam grantParam = SalarySendWithdrawParam.builder()
.salarySendId(sendId)
.build();
withdraw(grantParam);
} catch (Exception e) {
failCount++;
failMsg = failMsg + "" + (i + 1) + "个撤回失败!失败原因:" + e.getMessage() + "\n";
}
}
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
}
}

View File

@ -2,6 +2,18 @@ package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.component.WeaFormOption;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.TaxDeclarationService;
@ -32,4 +44,125 @@ public class TaxDeclarationWrapper extends Service {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
/**
* 个税申报表列表
*
* @param queryParam 列表查询条件
* @param
* @return
*/
public PageInfo listPage(TaxDeclarationListQueryParam queryParam) {
// 询个税申报表分页
PageInfo<TaxDeclarationPO> page = getTaxDeclarationService(user).listPageByParam(queryParam);
PageInfo<TaxDeclarationListDTO> dtoPage = new PageInfo<TaxDeclarationListDTO>(TaxDeclarationListDTO.class);
dtoPage.setPageNum(queryParam.getCurrent());
dtoPage.setPageSize(queryParam.getPageSize());
dtoPage.setTotal(page.getTotal());
List<TaxDeclarationPO> list = page.getList();
if (CollectionUtils.isNotEmpty(list)) {
// 查询人员
List<Long> employeeIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getCreator, Collectors.toList());
List<DataCollectionEmployee> employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
// 查询个税扣缴义务人
Set<Long> taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getTaxAgentId);
List<TaxAgentPO> taxAgentPOS = getTaxDeclarationService(user).countByTaxDeclarationId(taxAgentIds);
// 转换成列表dto
List<TaxDeclarationListDTO> taxDeclarationListDTOS = TaxDeclarationBO.convert2ListDTO(list, employeeComInfos, taxAgentPOS);
dtoPage.setList(taxDeclarationListDTOS);
}
return dtoPage;
}
public TaxDeclarationFormDTO getForm(Long id) {
TaxDeclarationFormDTO formDTO = new TaxDeclarationFormDTO();
if (Objects.nonNull(id)) {
// 查询个税申报表
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id);
if (Objects.isNull(taxDeclaration)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除"));
}
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(id);
//日期转换
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth());
// 转换成个税申报表详情dto
formDTO = TaxDeclarationFormDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgent).map(TaxAgentPO::getName).orElse("")).description(taxDeclaration.getDescription()).build();
}
// 转换成前端所需的数据格式
// WeaForm weaForm = SalaryFormatUtil.<TaxDeclarationFormDTO>getInstance().buildForm(TaxDeclarationFormDTO.class, formDTO);
// 查询租户所有的个税扣缴义务人
Collection<TaxAgentPO> taxAgentListDTOS = getTaxAgentService(user).listAll();
// 表单中个税扣缴义务人的可选项
List<WeaFormOption> weaFormOptions = Lists.newArrayListWithExpectedSize(taxAgentListDTOS.size());
for (TaxAgentPO taxAgent : taxAgentListDTOS) {
weaFormOptions.add(new WeaFormOption("" + taxAgent.getId(), taxAgent.getName()));
}
// weaForm.getItems().forEach((k, v) -> {
// if (StringUtils.equals("taxAgentId", k)) {
// v.setOptions(weaFormOptions);
// }
// if (StringUtils.equals("salaryMonth", k)) {
// Map<String, Object> otherParams = new HashMap<>();
// otherParams.put("type", "month");
// v.setOtherParams(otherParams);
// }
// });
return formDTO;
}
/**
* 查询个税申报表的基本信息
*
* @param id 个税申报表id
* @return
*/
public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) {
// 查询个税申报表
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id);
if (Objects.isNull(taxDeclaration)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除"));
}
//日期转换
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth());
// 查询个税扣缴义务人
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId());
return TaxDeclarationInfoDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build();
}
/**
* 保存
*
* @param saveParam 保存参数
*/
public void save(TaxDeclarationSaveParam saveParam) {
getTaxDeclarationService(user).save(saveParam);
}
/**
* 撤回个税申报
* @param taxDeclarationId
*/
public void withDrawTaxDeclaration(Long taxDeclarationId) {
getTaxDeclarationService(user).withDrawTaxDeclaration(taxDeclarationId);
}
public void batSave(TaxDeclarationBatParam param) {
List<Long> taxAgentIds = param.getTaxAgentIds();
for (int i = 0; i < taxAgentIds.size(); i++) {
Long taxAgentId = taxAgentIds.get(i);
TaxDeclarationSaveParam saveParam = TaxDeclarationSaveParam.builder()
.salaryMonth(param.getSalaryMonth())
.taxAgentId(taxAgentId)
.description(param.getDescription())
.taxCycle(param.getTaxCycle())
.salaryDate(param.getSalaryDate())
.build();
save(saveParam);
}
}
}