Merge branch 'release/2.19.1.2501.01' into feature/日期函数精度计算
This commit is contained in:
commit
26836523db
|
|
@ -6,36 +6,36 @@ loginid varchar2(100),
|
|||
LASTNAME varchar2(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar2(60),
|
||||
MOBILE varchar2(60) ,
|
||||
MOBILECALL varchar2(60) ,
|
||||
EMAIL varchar2(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar2(60),
|
||||
HOMEADDRESS varchar2(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar2(200) ,
|
||||
JOBACTIVITYDESC varchar2(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar2(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar2(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar2(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar2(60) ,
|
||||
NATIVEPLACE varchar2(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar2(60) ,
|
||||
|
|
@ -44,8 +44,8 @@ HEALTHINFO char(1) ,
|
|||
RESIDENTPLACE varchar2(200) ,
|
||||
POLICY varchar2(30) ,
|
||||
DEGREE varchar2(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar2(200) ,
|
||||
ACCUMFUNDACCOUNT varchar2(30),
|
||||
BIRTHPLACE varchar2(60) ,
|
||||
|
|
@ -54,14 +54,14 @@ RESIDENTPHONE varchar2(60) ,
|
|||
RESIDENTPOSTCODE varchar2(60) ,
|
||||
EXTPHONE varchar2(50) ,
|
||||
MANAGERSTR varchar2(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar2(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar2(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar2(200) ,
|
||||
companystartdate varchar2(10),
|
||||
workstartdate varchar2(10) ,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_page_list_template add file_id int;
|
||||
/
|
||||
|
||||
|
|
@ -6,36 +6,36 @@ loginid varchar2(100),
|
|||
LASTNAME varchar2(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar2(60),
|
||||
MOBILE varchar2(60) ,
|
||||
MOBILECALL varchar2(60) ,
|
||||
EMAIL varchar2(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar2(60),
|
||||
HOMEADDRESS varchar2(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar2(200) ,
|
||||
JOBACTIVITYDESC varchar2(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar2(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar2(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar2(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar2(60) ,
|
||||
NATIVEPLACE varchar2(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar2(60) ,
|
||||
|
|
@ -44,8 +44,8 @@ HEALTHINFO char(1) ,
|
|||
RESIDENTPLACE varchar2(200) ,
|
||||
POLICY varchar2(30) ,
|
||||
DEGREE varchar2(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar2(200) ,
|
||||
ACCUMFUNDACCOUNT varchar2(30),
|
||||
BIRTHPLACE varchar2(60) ,
|
||||
|
|
@ -54,14 +54,14 @@ RESIDENTPHONE varchar2(60) ,
|
|||
RESIDENTPOSTCODE varchar2(60) ,
|
||||
EXTPHONE varchar2(50) ,
|
||||
MANAGERSTR varchar2(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar2(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar2(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar2(200) ,
|
||||
companystartdate varchar2(10),
|
||||
workstartdate varchar2(10) ,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_page_list_template add file_id int;
|
||||
/
|
||||
|
||||
|
|
@ -6,36 +6,36 @@ loginid varchar2(100),
|
|||
LASTNAME varchar2(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar2(60),
|
||||
MOBILE varchar2(60) ,
|
||||
MOBILECALL varchar2(60) ,
|
||||
EMAIL varchar2(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar2(60),
|
||||
HOMEADDRESS varchar2(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar2(200) ,
|
||||
JOBACTIVITYDESC varchar2(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar2(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar2(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar2(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar2(60) ,
|
||||
NATIVEPLACE varchar2(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar2(60) ,
|
||||
|
|
@ -44,8 +44,8 @@ HEALTHINFO char(1) ,
|
|||
RESIDENTPLACE varchar2(200) ,
|
||||
POLICY varchar2(30) ,
|
||||
DEGREE varchar2(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar2(200) ,
|
||||
ACCUMFUNDACCOUNT varchar2(30),
|
||||
BIRTHPLACE varchar2(60) ,
|
||||
|
|
@ -54,14 +54,14 @@ RESIDENTPHONE varchar2(60) ,
|
|||
RESIDENTPOSTCODE varchar2(60) ,
|
||||
EXTPHONE varchar2(50) ,
|
||||
MANAGERSTR varchar2(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar2(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar2(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar2(200) ,
|
||||
companystartdate varchar2(10),
|
||||
workstartdate varchar2(10) ,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_page_list_template add file_id int;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_page_list_template ADD COLUMN file_id int(0);
|
||||
|
|
@ -6,36 +6,36 @@ loginid varchar2(100),
|
|||
LASTNAME varchar2(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar2(60),
|
||||
MOBILE varchar2(60) ,
|
||||
MOBILECALL varchar2(60) ,
|
||||
EMAIL varchar2(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar2(60),
|
||||
HOMEADDRESS varchar2(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar2(200) ,
|
||||
JOBACTIVITYDESC varchar2(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar2(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar2(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar2(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar2(60) ,
|
||||
NATIVEPLACE varchar2(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar2(60) ,
|
||||
|
|
@ -44,8 +44,8 @@ HEALTHINFO char(1) ,
|
|||
RESIDENTPLACE varchar2(200) ,
|
||||
POLICY varchar2(30) ,
|
||||
DEGREE varchar2(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar2(200) ,
|
||||
ACCUMFUNDACCOUNT varchar2(30),
|
||||
BIRTHPLACE varchar2(60) ,
|
||||
|
|
@ -54,14 +54,14 @@ RESIDENTPHONE varchar2(60) ,
|
|||
RESIDENTPOSTCODE varchar2(60) ,
|
||||
EXTPHONE varchar2(50) ,
|
||||
MANAGERSTR varchar2(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar2(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar2(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar2(200) ,
|
||||
companystartdate varchar2(10),
|
||||
workstartdate varchar2(10) ,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_page_list_template add file_id int
|
||||
/
|
||||
|
|
@ -0,0 +1 @@
|
|||
alter table hrsa_page_list_template add file_id int;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_page_list_template add file_id int
|
||||
go
|
||||
|
|
@ -6,36 +6,36 @@ loginid varchar2(100),
|
|||
LASTNAME varchar2(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar2(60),
|
||||
MOBILE varchar2(60) ,
|
||||
MOBILECALL varchar2(60) ,
|
||||
EMAIL varchar2(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar2(60),
|
||||
HOMEADDRESS varchar2(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar2(200) ,
|
||||
JOBACTIVITYDESC varchar2(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar2(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar2(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar2(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar2(60) ,
|
||||
NATIVEPLACE varchar2(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar2(60) ,
|
||||
|
|
@ -44,8 +44,8 @@ HEALTHINFO char(1) ,
|
|||
RESIDENTPLACE varchar2(200) ,
|
||||
POLICY varchar2(30) ,
|
||||
DEGREE varchar2(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar2(200) ,
|
||||
ACCUMFUNDACCOUNT varchar2(30),
|
||||
BIRTHPLACE varchar2(60) ,
|
||||
|
|
@ -54,14 +54,14 @@ RESIDENTPHONE varchar2(60) ,
|
|||
RESIDENTPOSTCODE varchar2(60) ,
|
||||
EXTPHONE varchar2(50) ,
|
||||
MANAGERSTR varchar2(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar2(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar2(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar2(200) ,
|
||||
companystartdate varchar2(10),
|
||||
workstartdate varchar2(10) ,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_page_list_template add file_id int;
|
||||
/
|
||||
|
||||
|
|
@ -96,15 +96,18 @@ public class CheckStopSalaryAction implements Action {
|
|||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -115,15 +118,17 @@ public class CheckStopSalaryAction implements Action {
|
|||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
if(salaryArchiveList.size() > 1){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("停薪校验异常", e);
|
||||
log.error("停薪检查异常", e);
|
||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,15 +107,18 @@ public class StopSalaryAction implements Action {
|
|||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -123,10 +126,12 @@ public class StopSalaryAction implements Action {
|
|||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
if(salaryArchiveList.size() > 1){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
// 设置最后发薪日期
|
||||
|
|
|
|||
|
|
@ -439,11 +439,11 @@ public class SIAccountBiz extends Service {
|
|||
public List<Long> listCanPayEmpIds(Long paymentOrganization, String billMonth) {
|
||||
List<Long> listCanPayEmpIds = new ArrayList<>();
|
||||
//社保档案中可进行缴纳的人员
|
||||
List<Long> socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
List<Long> socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
//公积金档案中可进行缴纳的人员
|
||||
List<Long> fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
List<Long> fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
//其他福利档案中可进行缴纳的人员
|
||||
List<Long> otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
List<Long> otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
if (socialCanPayEmpIds != null && socialCanPayEmpIds.size() > 0) {
|
||||
listCanPayEmpIds.addAll(socialCanPayEmpIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
|||
import com.engine.salary.mapper.salarybill.SalarySendRangeObjMapper;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
|
@ -23,6 +25,10 @@ public class SalarySendRangeObjBiz {
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class);
|
||||
}
|
||||
|
||||
private SalarySendRangeObjMapper getSalarySendRangeObjMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySendRangeObjMapper.class);
|
||||
}
|
||||
|
||||
public <R> R applyMapper(Function<SalarySendRangeObjMapper, R> mapper) {
|
||||
try (SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession()) {
|
||||
final SalarySendRangeObjMapper salarySendRangeObjMapper = sqlSession.getMapper(SalarySendRangeObjMapper.class);
|
||||
|
|
@ -41,7 +47,13 @@ public class SalarySendRangeObjBiz {
|
|||
}
|
||||
|
||||
public List<SalarySendUserInfoDTO> getSalarySendUserInfoDTOs(List<Long> employees) {
|
||||
List<SalarySendUserInfoDTO> userDTOs = applyMapper(mapper -> mapper.getUserInfoByEmployeeIds(employees));
|
||||
List<SalarySendUserInfoDTO> userDTOs = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(employees, 500);
|
||||
partition.forEach(l->{
|
||||
List<SalarySendUserInfoDTO> userInfos = getSalarySendRangeObjMapper().getUserInfoByEmployeeIds(l);
|
||||
userDTOs.addAll(userInfos);
|
||||
});
|
||||
|
||||
Map<Long, SalarySendUserInfoDTO> userMap = userDTOs.stream()
|
||||
.collect(Collectors.toMap(SalarySendUserInfoDTO::getResourceId, Function.identity()));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.entity.extemp.dto;
|
||||
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 外部人员
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_external_employee
|
||||
@ElogTransform( name = "非系统人员")
|
||||
public class ExtEmpDTO {
|
||||
|
||||
@ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName")
|
||||
private String subcompanyName;
|
||||
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate")
|
||||
private String companystartdate;
|
||||
|
||||
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@TableTitle(title = "工号", dataIndex = "workcode", key = "workcode")
|
||||
private String workcode;
|
||||
|
||||
}
|
||||
|
|
@ -59,6 +59,11 @@ public class PageListTemplateDTO {
|
|||
@TableTitle(title = "范围",dataIndex = "limits",key = "limits")
|
||||
private String limits;
|
||||
|
||||
@TableTitle(title = "导出模板",dataIndex = "fileName",key = "fileName")
|
||||
private String fileName;
|
||||
private Integer fileId;
|
||||
|
||||
|
||||
/**
|
||||
* 限制
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
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 DownloadTemplateParam {
|
||||
|
||||
@DataCheck(require = true,message = "请选择表头")
|
||||
private List<String> heads;
|
||||
|
||||
@DataCheck(require = true,message = "请选择设置")
|
||||
private List<String> setting;
|
||||
|
||||
}
|
||||
|
|
@ -40,4 +40,9 @@ public class PageListTemplateSaveParam {
|
|||
*/
|
||||
@DataCheck(require = true,message = "请选择设置")
|
||||
private List<String> setting;
|
||||
|
||||
/**
|
||||
* 导出模板id
|
||||
*/
|
||||
private Integer fileId;
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
* 页面模板表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
|
@ -64,6 +64,12 @@ public class PageListTemplatePO {
|
|||
@ElogTransform(name = "限制")
|
||||
private List<Long> limitIds;
|
||||
|
||||
/**
|
||||
* excel模板文件id
|
||||
*/
|
||||
@ElogTransform(name = "模板文件id")
|
||||
private Integer fileId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 生成个税申报表参数
|
||||
|
|
@ -42,4 +44,10 @@ public class TaxDeclarationSaveParam {
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class AddUpSituationManager extends Service {
|
|||
// 调用生成申报单接口
|
||||
YearMonth yearMonth = YearMonth.of(localDate.getYear(), localDate.getMonth());
|
||||
try {
|
||||
getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(yearMonth).taxAgentId(po.getTaxAgentId()).build());
|
||||
getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(yearMonth).salaryDate(po.getSalaryMonth()).taxCycle(po.getTaxCycle()).taxAgentId(po.getTaxAgentId()).build());
|
||||
} catch (Exception e) {
|
||||
bb.writeLog("错误:" + e);
|
||||
result = false;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and (t.employee_type is null or t.employee_type = 0)
|
||||
and e.status not in (7)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and (t.employee_type is null or t.employee_type = 0)
|
||||
and e.status not in (7)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
|
|
@ -322,7 +322,7 @@
|
|||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
WHERE t.delete_type = 0
|
||||
and t.employee_type is null
|
||||
and (t.employee_type is null or t.employee_type = 0)
|
||||
and e.status not in (7)
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
|
|
|
|||
|
|
@ -9,11 +9,12 @@
|
|||
<result column="limit_ids" property="limitIds" typeHandler="com.engine.salary.handle.LongListTypeHandler"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="page" property="page"/>
|
||||
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler" />
|
||||
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="shared_type" property="sharedType"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="file_id" property="fileId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
, t.system_type
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
, t.file_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -75,13 +77,16 @@
|
|||
<if test="page != null">
|
||||
AND page = #{page}
|
||||
</if>
|
||||
<if test="fileId != null">
|
||||
AND file_id = #{fileId}
|
||||
</if>
|
||||
<if test="setting != null">
|
||||
AND setting = #{setting}
|
||||
</if>
|
||||
<if test="sharedType != null">
|
||||
AND shared_type = #{sharedType}
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
<if test="systemType != null">
|
||||
AND system_type = #{systemType}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
|
|
@ -141,6 +146,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="fileId != null">
|
||||
file_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
|
|
@ -179,6 +187,9 @@
|
|||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="fileId != null">
|
||||
#{fileId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -197,6 +208,7 @@
|
|||
system_type=#{systemType},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
file_id=#{fileId},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -239,6 +251,7 @@
|
|||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
file_id=#{fileId},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public interface SIAccountDetailTempMapper {
|
|||
*/
|
||||
void batchDelByEmpIdsAndMonthAndPayOrg(@Param("employeeIds") Collection<Long> employeeIds, @Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
|
||||
|
||||
void batchDelByMonthAndPayOrg(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
* @param accounts
|
||||
|
|
|
|||
|
|
@ -139,6 +139,14 @@
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="batchDelByMonthAndPayOrg">
|
||||
UPDATE hrsa_bill_detail_temp
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND bill_month = #{billMonth}
|
||||
AND payment_organization = #{paymentOrganization}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="batchSaveAccountTempDetails">
|
||||
INSERT INTO hrsa_bill_detail_temp
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public interface FundSchemeMapper {
|
|||
* @param paymentOrganization
|
||||
* @return
|
||||
*/
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth);
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth, @Param("nonPayment") Integer nonPayment);
|
||||
|
||||
List<InsuranceArchivesFundSchemePO> listAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@
|
|||
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} OR fund_end_time ='')
|
||||
AND non_payment = #{nonPayment}
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public interface OtherSchemeMapper {
|
|||
* @param paymentOrganization
|
||||
* @return
|
||||
*/
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth);
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth, @Param("nonPayment") Integer nonPayment);
|
||||
|
||||
List<InsuranceArchivesOtherSchemePO> listAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@
|
|||
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} OR other_end_time ='')
|
||||
AND non_payment = #{nonPayment}
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public interface SocialSchemeMapper {
|
|||
* @param paymentOrganization
|
||||
* @return
|
||||
*/
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth);
|
||||
List<Long> listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth, @Param("nonPayment")Integer nonPayment);
|
||||
|
||||
List<InsuranceArchivesSocialSchemePO> listAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -909,6 +909,7 @@
|
|||
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} OR social_end_time ='')
|
||||
AND non_payment = #{nonPayment}
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ public class SalaryStatisticsEmployeeSalaryQueryParam extends BaseQueryParam {
|
|||
// 关键字
|
||||
private String keyword;
|
||||
|
||||
//人员ids
|
||||
private List<Long> employeeIds;
|
||||
|
||||
// 起始年月
|
||||
private String startDateStr;
|
||||
private Date startDate;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
|
|
@ -248,12 +249,23 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
||||
Map<Long, Integer> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
|
||||
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Map<Long, String> itemDataTypeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getId, SalaryItemPO::getDataType);
|
||||
|
||||
|
||||
Map<Long, List<SalaryAcctResultPO>> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
Map<Long, Map<String, String>> acctResultValueMap = new HashMap<>();
|
||||
Map<Long, Map<String, Object>> acctResultValueMap = new HashMap<>();
|
||||
acctResultValueList.forEach((k, v) -> {
|
||||
Map<String, String> map = new HashMap();
|
||||
Map<String, Object> map = new HashMap();
|
||||
v.forEach(l -> {
|
||||
map.put(l.getSalaryItemId() + "", l.getResultValue());
|
||||
String dataType = itemDataTypeMap.getOrDefault(l.getSalaryItemId(), "string");
|
||||
SalaryDataTypeEnum typeEnum = SalaryDataTypeEnum.parseByValue(dataType);
|
||||
String resultValue = l.getResultValue();
|
||||
if (typeEnum == SalaryDataTypeEnum.NUMBER && NumberUtil.isNumber(resultValue)) {
|
||||
map.put(l.getSalaryItemId() + "", Double.valueOf(resultValue));
|
||||
} else {
|
||||
map.put(l.getSalaryItemId() + "", resultValue);
|
||||
}
|
||||
});
|
||||
acctResultValueMap.put(k, map);
|
||||
});
|
||||
|
|
@ -265,7 +277,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
Map<String, Object> map;
|
||||
for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
|
||||
map = Maps.newHashMap();
|
||||
Map<String, String> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||
Map<String, Object> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||
Map<String, Object> finalMap = map;
|
||||
resultValueMap.forEach((k, v) -> {
|
||||
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
|
||||
|
|
@ -332,6 +344,13 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//人员浏览按钮筛选
|
||||
List<Long> employeeIds = queryParam.getEmployeeIds();
|
||||
if(CollectionUtils.isNotEmpty(employeeIds)){
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import com.engine.salary.component.WeaTableColumnGroup;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
|
||||
|
|
@ -29,6 +31,7 @@ import com.engine.salary.sys.service.SalarySysConfService;
|
|||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ExcelFillUtils;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -38,9 +41,11 @@ 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.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -183,10 +188,12 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
|
||||
|
||||
List<WeaTableColumn> weaTableColumns = getSettingService(user).getPageListColumns(SALARY_DETAILS_REPORT.getValue());
|
||||
|
||||
List<PageListTemplatePO> pageListTemplates = getSettingService(user).getPageListTemplates(PageListTemplateQueryParam.builder().page(SALARY_DETAILS_REPORT.getValue()).build());
|
||||
Integer fileId = pageListTemplates.stream().filter(PageListTemplatePO::getChecked).findFirst().map(PageListTemplatePO::getFileId).orElse(null);
|
||||
// 结果
|
||||
resultMap.put("columns", weaTableColumns);
|
||||
resultMap.put("pageInfo", pageInfo);
|
||||
resultMap.put("fileId", fileId);
|
||||
if (queryParam.isExport()) {
|
||||
Map<String, Object> countResultMap = Maps.newHashMap();
|
||||
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
|
||||
|
|
@ -270,8 +277,17 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
Map<String, Object> resultMap = salaryList(queryParam);
|
||||
List<WeaTableColumn> columns = (List<WeaTableColumn>) resultMap.get("columns");
|
||||
List<Map<String, Object>> resultList = ((PageInfo<Map<String, Object>>) resultMap.get("pageInfo")).getList();
|
||||
Map<String, Object> countResult = (Map<String, Object>) resultMap.get("countResult");
|
||||
|
||||
//根据上传的模板导出
|
||||
Object fileId = resultMap.get("fileId");
|
||||
if (fileId != null) {
|
||||
InputStream inputStream = ImageFileManager.getInputStreamById((Integer) fileId);
|
||||
XSSFWorkbook workbook = ExcelFillUtils.fillOneSheet(inputStream, 0, resultList);
|
||||
return workbook;
|
||||
}
|
||||
|
||||
//根据显示列表导出
|
||||
Map<String, Object> countResult = (Map<String, Object>) resultMap.get("countResult");
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
|
||||
// 获取薪资项目保留小数位数
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
|
|
|
|||
|
|
@ -100,14 +100,6 @@ public interface AddUpDeductionService {
|
|||
*/
|
||||
List<AddUpDeduction> getAddUpDeductionList(YearMonth declareMonth, List<Long> employeeIds, Long taxAgentId);
|
||||
|
||||
/**
|
||||
* 根据年月获取已核算数据
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth);
|
||||
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -17,7 +18,7 @@ public interface ExtEmpService {
|
|||
|
||||
List<ExtEmpPO> list(ExtEmpQueryParam param);
|
||||
|
||||
PageInfo<ExtEmpPO> listPage (ExtEmpQueryParam param);
|
||||
PageInfo<ExtEmpDTO> listPage (ExtEmpQueryParam param);
|
||||
|
||||
void save(ExtEmpSaveParam po);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,10 @@ public interface SalaryEmployeeService {
|
|||
* 根据薪资账套id查询人员
|
||||
*
|
||||
* @param salarySobId 薪资账套id
|
||||
* @param hasExtEmp 是否含非系统人员
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listBySalarySobId(Long salarySobId);
|
||||
List<DataCollectionEmployee> listBySalarySobId(Long salarySobId, boolean hasExtEmp);
|
||||
|
||||
/**
|
||||
* 获取人员信息
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO;
|
|||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -45,6 +46,13 @@ public interface SettingService {
|
|||
*/
|
||||
PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param);
|
||||
|
||||
/**
|
||||
* 下载导出模板文件
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook downloadPageExportTemplateFile(DownloadTemplateParam param);
|
||||
|
||||
/**
|
||||
* 更换模板
|
||||
* @param param
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
|||
import com.cloudstore.dev.api.util.Util_DataCache;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.AddUpDeductionBiz;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.biz.AddUpDeductionBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
|
|
@ -26,6 +25,7 @@ import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
|||
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
|
|
@ -33,6 +33,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
|
|
@ -116,6 +117,10 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return ServiceUtil.getService(SpecialAddDeductionServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
|
|
@ -188,7 +193,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 查询已有数据
|
||||
Date declareMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER));
|
||||
List<AddUpDeduction> list = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(declareMonth).build());
|
||||
|
|
@ -459,7 +464,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId())).findFirst();
|
||||
|
|
@ -507,7 +512,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 查询已有数据
|
||||
Date declareMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER));
|
||||
List<AddUpDeduction> list = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(declareMonth).build());
|
||||
|
|
@ -773,8 +778,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<AddUpDeduction> updateList = new ArrayList<>();
|
||||
List<AddUpDeduction> insertList = new ArrayList<>();
|
||||
List<Long> errorMessages = new ArrayList<>();
|
||||
List<SalaryAcctEmployeePO> accountedEmployeeData =
|
||||
getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM"));
|
||||
List<SalaryAcctEmployeePO> accountedEmployeeData = getAccountedEmployeeDataByTaxYearMonth(DateUtil.format(yearMonth, "yyyy-MM"));
|
||||
for (TaxAgentPO taxAgent : taxAgents) {
|
||||
List<SpecialAddDeductionPO> employeePOs = getSpecialAddDeductionService(user)
|
||||
.getSpecialAddDeductionPOByEmployee(null, taxAgent.getId());
|
||||
|
|
@ -1093,12 +1097,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
cellList.add(Util.null2String(dto.getJobNum()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpChildEducation()) ? new BigDecimal(dto.getAddUpChildEducation()) : Util.null2String(dto.getAddUpChildEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) :Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) :Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) :Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) :Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) :Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) :Util.null2String(dto.getAddUpInfantCare()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) : Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) : Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) : Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) : Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) : Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) : Util.null2String(dto.getAddUpInfantCare()));
|
||||
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
|
|
@ -1243,12 +1247,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
cellList.add(Util.null2String(dto.getIdNo()));
|
||||
cellList.add(Util.null2String(dto.getHiredate()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpChildEducation()) ? new BigDecimal(dto.getAddUpChildEducation()) : Util.null2String(dto.getAddUpChildEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) :Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) :Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) :Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) :Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) :Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) :Util.null2String(dto.getAddUpInfantCare()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) : Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) : Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) : Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) : Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) : Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) : Util.null2String(dto.getAddUpInfantCare()));
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
|
@ -1256,45 +1260,24 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据年月获取已核算数据
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth) {
|
||||
List<SalaryAcctEmployeePO> list = Lists.newArrayList();
|
||||
LocalDate salaryMonthDate = LocalDate.parse(yearMonth + "-01", SalaryDateUtil.DATE_FORMATTER);
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryMonthDate)).endDate(SalaryDateUtil.localDateToDate(salaryMonthDate)).build());
|
||||
salaryAcctRecords.forEach(e -> {
|
||||
boolean isAccounted = e.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue();
|
||||
if (isAccounted) {
|
||||
// list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecords.get(0).getId())));
|
||||
list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId())));
|
||||
}
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth) {
|
||||
List<SalaryAcctEmployeePO> list = Lists.newArrayList();
|
||||
YearMonth month = YearMonth.parse(yearMonth);
|
||||
LocalDate salaryMonthDate = month.atDay(1);
|
||||
LocalDate salaryMonthEndDate = month.atEndOfMonth();
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listByTaxCycle(
|
||||
LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryMonthDate))
|
||||
.endDate(SalaryDateUtil.localDateToDate(salaryMonthEndDate)).build(),
|
||||
null);
|
||||
salaryAcctRecords.forEach(e -> {
|
||||
boolean isAccounted = e.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue();
|
||||
if (isAccounted) {
|
||||
// list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecords.get(0).getId())));
|
||||
list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId())));
|
||||
}
|
||||
});
|
||||
Date taxCycle = SalaryDateUtil.localDateToDate(month.atDay(1));
|
||||
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listSome(SalaryAcctRecordPO.builder().taxCycle(taxCycle).build());
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listAll();
|
||||
List<Long> sobIds = salarySobPOS.stream()
|
||||
.filter(e -> IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().equals(e.getIncomeCategory()))
|
||||
.map(SalarySobPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
salaryAcctRecords.stream()
|
||||
.filter(e -> !SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue().equals(e.getStatus()))
|
||||
.filter(e -> sobIds.contains(e.getSalarySobId()))
|
||||
.forEach(e -> {
|
||||
list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId())));
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -952,7 +952,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(taxYearMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(taxYearMonthStr);
|
||||
//税款所属期
|
||||
Date taxYearMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(taxYearMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER));
|
||||
// 查询已有数据
|
||||
|
|
@ -1079,7 +1079,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER);
|
||||
salaryMonthDate = salaryMonthDate.plusMonths(1);
|
||||
String format = salaryMonthDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(format);
|
||||
// 判断是否有核算过
|
||||
List<AddUpSituation> deletePOList = new ArrayList<>();
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
|
|
@ -1157,7 +1157,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER);
|
||||
String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(format);
|
||||
for (AddUpSituation item : list) {
|
||||
if (CollectionUtils.isNotEmpty(employees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salarySobId);
|
||||
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId);
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId,false);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
errorMsg = errorMsg + "【" + salarySobPO.getName() + "】薪资账套没有人员; ";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -78,9 +79,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||
List<ExtEmpPO> extEmpPOS = list(param);
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
|
||||
|
||||
List<ExtEmpDTO> list = extEmpPOS.stream().map(po -> {
|
||||
return ExtEmpDTO.builder()
|
||||
.id(po.getId())
|
||||
.username(po.getUsername())
|
||||
.departmentName(po.getDepartmentName())
|
||||
.subcompanyName(po.getSubcompanyName())
|
||||
.companystartdate(po.getCompanystartdate())
|
||||
.workcode(po.getWorkcode())
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, ExtEmpDTO.class);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
//税款所属期
|
||||
Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01");
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 查询已有数据
|
||||
List<OtherDeductionPO> list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build());
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
||||
}
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(otherDeductionParam.getEmployeeId()) && f.getTaxAgentId().equals(otherDeductionParam.getTaxAgentId())).findFirst();
|
||||
|
|
@ -718,7 +718,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
//税款所属期
|
||||
Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01");
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 查询已有数据
|
||||
List<OtherDeductionPO> list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build());
|
||||
//合规数据
|
||||
|
|
@ -795,7 +795,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
List<Long> deleteIds = deleteParam.getIds();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
List<OtherDeductionPO> resultList = new ArrayList<>();
|
||||
|
|
@ -869,7 +869,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
// 获取所有想要删除的数据
|
||||
List<OtherDeductionPO> list = otherDeductionBiz.listSome(queryParam);
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
for (OtherDeductionPO item : list) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
|
|
@ -921,9 +921,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
@Override
|
||||
public String extendToLastMonth(OtherDeductionExtendLastParam param) {
|
||||
//查询已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees =
|
||||
getAddUpDeductionService(user)
|
||||
.getAccountedEmployeeData(param.getDeclareMonth());
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(param.getDeclareMonth());
|
||||
Map<String, List<SalaryAcctEmployeePO>> acctInfoMap = salaryAcctEmployees.stream()
|
||||
.distinct().collect(Collectors.groupingBy(
|
||||
i -> i.getTaxAgentId() + "" + i.getEmployeeId()));
|
||||
|
|
|
|||
|
|
@ -5073,13 +5073,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
// Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = siArchivesBiz.buildBatchAccount(ids, paymentOrganization);
|
||||
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
|
||||
List<InsuranceAccountDetailPO> historyDetailData = new ArrayList<>();
|
||||
List<DataCollectionEmployee> employeeList = new ArrayList<>();
|
||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
||||
if (!isFirstFlag) {
|
||||
// 不是首次核算,需要把社保历史数据取出
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(ids).build()));
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().extList(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(ids).build()));
|
||||
} else {
|
||||
employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
||||
List<List<Long>> partition = Lists.partition(ids, 100);
|
||||
partition.forEach(part -> {
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().extList(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(part).build()));
|
||||
});
|
||||
}
|
||||
Map<Long, InsuranceAccountDetailPO> historyDetailDataMap = SalaryEntityUtil.convert2Map(historyDetailData, InsuranceAccountDetailPO::getEmployeeId);
|
||||
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||
|
|
@ -5101,7 +5102,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue());
|
||||
insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization);
|
||||
if (isFirstFlag) {
|
||||
|
||||
InsuranceAccountDetailPO historyDetail = historyDetailDataMap.get(k);
|
||||
if (isFirstFlag || historyDetail == null) {
|
||||
// 初次核算
|
||||
DataCollectionEmployee employee = employeeMap.get(k);
|
||||
if (employee != null) {
|
||||
|
|
@ -5116,18 +5119,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
insuranceAccountDetailPO.setStatus(employee.getStatus());
|
||||
}
|
||||
} else {
|
||||
InsuranceAccountDetailPO historyDetail = historyDetailDataMap.get(k);
|
||||
if (historyDetail != null) {
|
||||
insuranceAccountDetailPO.setSubcompanyName(historyDetail.getSubcompanyName());
|
||||
insuranceAccountDetailPO.setSubcompanyId(historyDetail.getSubcompanyId());
|
||||
insuranceAccountDetailPO.setDepartmentName(historyDetail.getDepartmentName());
|
||||
insuranceAccountDetailPO.setDepartmentId(historyDetail.getDepartmentId());
|
||||
insuranceAccountDetailPO.setJobtitleName(historyDetail.getJobtitleName());
|
||||
insuranceAccountDetailPO.setJobtitleId(historyDetail.getJobtitleId());
|
||||
insuranceAccountDetailPO.setJobcall(historyDetail.getJobcall());
|
||||
insuranceAccountDetailPO.setJobcallId(historyDetail.getJobcallId());
|
||||
insuranceAccountDetailPO.setStatus(historyDetail.getStatus());
|
||||
}
|
||||
insuranceAccountDetailPO.setSubcompanyName(historyDetail.getSubcompanyName());
|
||||
insuranceAccountDetailPO.setSubcompanyId(historyDetail.getSubcompanyId());
|
||||
insuranceAccountDetailPO.setDepartmentName(historyDetail.getDepartmentName());
|
||||
insuranceAccountDetailPO.setDepartmentId(historyDetail.getDepartmentId());
|
||||
insuranceAccountDetailPO.setJobtitleName(historyDetail.getJobtitleName());
|
||||
insuranceAccountDetailPO.setJobtitleId(historyDetail.getJobtitleId());
|
||||
insuranceAccountDetailPO.setJobcall(historyDetail.getJobcall());
|
||||
insuranceAccountDetailPO.setJobcallId(historyDetail.getJobcallId());
|
||||
insuranceAccountDetailPO.setStatus(historyDetail.getStatus());
|
||||
}
|
||||
|
||||
//核算社保
|
||||
|
|
@ -5157,10 +5157,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
|
||||
}
|
||||
//临时表入库前先对(可能存在的)历史数据进行删除
|
||||
List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
|
||||
partition.forEach(part -> {
|
||||
getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
|
||||
});
|
||||
// List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
|
||||
// partition.forEach(part -> {
|
||||
// getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
|
||||
// });
|
||||
// 根据人员id删,会少删不再参与社保核算的人。
|
||||
getSIAccountDetailTempMapper().batchDelByMonthAndPayOrg(billMonth, paymentOrganization);
|
||||
//临时表数据入库
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
|
||||
|
|
@ -5711,12 +5713,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
*/
|
||||
public List<Long> listCanPayEmpIds(Long paymentOrganization, String billMonth) {
|
||||
List<Long> listCanPayEmpIds = new ArrayList<>();
|
||||
//社保档案中可进行缴纳的人员
|
||||
List<Long> socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
//公积金档案中可进行缴纳的人员
|
||||
List<Long> fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
//其他福利档案中可进行缴纳的人员
|
||||
List<Long> otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth);
|
||||
//社保档案中可进行缴纳的人员 (未勾选暂不缴纳)
|
||||
List<Long> socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
//公积金档案中可进行缴纳的人员(未勾选暂不缴纳)
|
||||
List<Long> fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
//其他福利档案中可进行缴纳的人员(未勾选暂不缴纳)
|
||||
List<Long> otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth, 0);
|
||||
if (socialCanPayEmpIds != null && socialCanPayEmpIds.size() > 0) {
|
||||
listCanPayEmpIds.addAll(socialCanPayEmpIds);
|
||||
}
|
||||
|
|
@ -5744,16 +5746,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size());
|
||||
List<List<Long>> partitionIds = Lists.partition((List<Long>) ids, 100);
|
||||
log.info("bill_detail入库前删除数据数量:{}", ids.size());
|
||||
for (List<Long> part : partitionIds) {
|
||||
getInsuranceAccountDetailMapper().batchDelAccountDetails(part, billMonth, param.getPaymentOrganization(), paymentStatus);
|
||||
getInsuranceAccountDetailMapper().batchDelAccountDetails(Collections.emptyList(), billMonth, param.getPaymentOrganization(), paymentStatus);
|
||||
|
||||
//删除账单月份+个税扣缴义务人+人员id下的调差数据
|
||||
getInsuranceCompensationMapper().deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO.builder()
|
||||
.billMonth(billMonth)
|
||||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.employeeIds(part)
|
||||
.build());
|
||||
}
|
||||
//删除账单月份+个税扣缴义务人+人员id下的调差数据
|
||||
getInsuranceCompensationMapper().deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO.builder()
|
||||
.billMonth(billMonth)
|
||||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.build());
|
||||
// for (List<Long> part : partitionIds) {
|
||||
// getInsuranceAccountDetailMapper().batchDelAccountDetails(part, billMonth, param.getPaymentOrganization(), paymentStatus);
|
||||
//
|
||||
// //删除账单月份+个税扣缴义务人+人员id下的调差数据
|
||||
// getInsuranceCompensationMapper().deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO.builder()
|
||||
// .billMonth(billMonth)
|
||||
// .paymentOrganization(param.getPaymentOrganization())
|
||||
// .employeeIds(part)
|
||||
// .build());
|
||||
// }
|
||||
|
||||
//生成bill_detail入库数据
|
||||
List<InsuranceAccountDetailPO> collect = list.stream().map(item -> {
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
@Override
|
||||
public void initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "未查询到账套下关联人员"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -193,6 +195,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
private VariableItemService getVariableItemService(User user) {
|
||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -862,6 +865,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 12.4、是否采用系统算税
|
||||
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
|
||||
// 12.5、多线程运算,运算结果存放在临时表中
|
||||
//是否同步计算
|
||||
boolean isSync = "0".equals(getSalarySysConfService(user).getValueByCode(SALARY_ACCT_SYNC_TYPE));
|
||||
for (List<SalaryAcctEmployeePO> acctEmployeePOS : partition) {
|
||||
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
||||
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
||||
|
|
@ -883,13 +888,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.setVariableItems(variableItemPOS)
|
||||
.setTaxDeclarationFunction(taxDeclarationFunction);
|
||||
List<SalarySobBackItemPO> finalSalarySobBackItems = salarySobBackItems;
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
if (isSync) {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
} else {
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
}
|
||||
}
|
||||
// 13、等待所有子线程执行完毕
|
||||
childMonitor.await();
|
||||
|
|
@ -918,7 +927,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true);
|
||||
|
||||
//更新薪资核算记录最后操作日期
|
||||
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(),new Date());
|
||||
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(), new Date());
|
||||
|
||||
stopWatch.stop();
|
||||
log.info(stopWatch.prettyPrint());
|
||||
|
|
@ -926,6 +935,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 记录日志
|
||||
// 查询操作日志的targetName
|
||||
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
||||
Collection<Long> ids = calculateParam.getIds();
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
targetName += ids;
|
||||
}
|
||||
LoggerContext<SalaryCheckResultPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
|
||||
|
|
|
|||
|
|
@ -1425,7 +1425,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
if (CollectionUtils.isEmpty(employeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, 500);
|
||||
List<SalaryArchivePO> resultList = new ArrayList<>();
|
||||
partition.forEach(part -> {
|
||||
resultList.addAll(getSalaryArchiveMapper().listPayEndDateIsNull(part));
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -169,16 +169,6 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
&& Optional.ofNullable(salaryBillProgress.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(136104, "有其他人员正在发送中,请等待其他人员发送结束后再操作"));
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = ProgressDTO.builder()
|
||||
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
|
||||
.totalQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.progress(BigDecimal.ZERO)
|
||||
.status(true)
|
||||
.message("")
|
||||
.build();
|
||||
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
|
||||
|
||||
List<Long> ids = param.getIds();
|
||||
|
||||
|
|
@ -190,6 +180,17 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
throw new SalaryRunTimeException("工资发放范围内没有匹配员工");
|
||||
}
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = ProgressDTO.builder()
|
||||
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
|
||||
.totalQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.progress(BigDecimal.ZERO)
|
||||
.status(true)
|
||||
.message("")
|
||||
.build();
|
||||
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
|
||||
|
||||
// 异步执行
|
||||
List<Long> finalIds = ids;
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionEmployee> listBySalarySobId(Long salarySobId) {
|
||||
public List<DataCollectionEmployee> listBySalarySobId(Long salarySobId, boolean hasExtEmp) {
|
||||
|
||||
List<DataCollectionEmployee> includeSalaryEmployees = new ArrayList<>();
|
||||
|
||||
|
|
@ -174,13 +174,15 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
|
||||
//外部人员
|
||||
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
|
||||
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
|
||||
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
|
||||
List<DataCollectionEmployee> extEmps = getExtEmpService(user).getEmployeeByIds(ids);
|
||||
extEmps = extEmps.stream().distinct().collect(Collectors.toList());
|
||||
if(hasExtEmp){
|
||||
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
|
||||
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
|
||||
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
|
||||
List<DataCollectionEmployee> extEmps = getExtEmpService(user).getEmployeeByIds(ids);
|
||||
extEmps = extEmps.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
includeSalaryEmployees.addAll(extEmps);
|
||||
includeSalaryEmployees.addAll(extEmps);
|
||||
}
|
||||
}
|
||||
|
||||
if (!openSecondaryAccount) {
|
||||
|
|
@ -639,11 +641,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
.departmentName(hrmSnapshotPO.getDepartmentname())
|
||||
.departmentId(hrmSnapshotPO.getDepartmentid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getDepartmentid())))
|
||||
.subcompanyName(hrmSnapshotPO.getSubcompanyname())
|
||||
.subcompanyid(hrmSnapshotPO.getSubcompanyid1() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getSubcompanyid1())))
|
||||
.costcenterId(hrmSnapshotPO.getCostcenterid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getCostcenterid())))
|
||||
.locationId(hrmSnapshotPO.getLocationid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getLocationid())))
|
||||
.subcompanyid(hrmSnapshotPO.getSubcompanyid1() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getSubcompanyid1())))
|
||||
.costcenterId(hrmSnapshotPO.getCostcenterid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getCostcenterid())))
|
||||
.locationId(hrmSnapshotPO.getLocationid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getLocationid())))
|
||||
.jobtitleName(hrmSnapshotPO.getJobtitlename())
|
||||
.jobtitleId(hrmSnapshotPO.getJobtitle() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobtitle())))
|
||||
.jobtitleId(hrmSnapshotPO.getJobtitle() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobtitle())))
|
||||
.companystartdate(hrmSnapshotPO.getCompanystartdate())
|
||||
.mobile(hrmSnapshotPO.getMobile())
|
||||
// .dismissdate()
|
||||
|
|
@ -654,7 +656,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
.email(hrmSnapshotPO.getEmail())
|
||||
.telephone(hrmSnapshotPO.getTelephone())
|
||||
.jobcall(hrmSnapshotPO.getJobcallname())
|
||||
.jobcallId(hrmSnapshotPO.getJobcall() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobcall())))
|
||||
.jobcallId(hrmSnapshotPO.getJobcall() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobcall())))
|
||||
.birthday(hrmSnapshotPO.getBirthday())
|
||||
.workYear(hrmSnapshotPO.getWorkyear() == null ? null : hrmSnapshotPO.getWorkyear().doubleValue())
|
||||
.companyWorkYear(hrmSnapshotPO.getCompanyworkyear() == null ? null : hrmSnapshotPO.getCompanyworkyear().doubleValue())
|
||||
|
|
|
|||
|
|
@ -29,9 +29,12 @@ 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.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -329,6 +332,7 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
.systemType(0)
|
||||
.limitIds(param.getLimitIds())
|
||||
.setting(param.getSetting())
|
||||
.fileId(param.getFileId())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
|
|
@ -344,6 +348,7 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
po.setSharedType(param.getSharedType());
|
||||
po.setLimitIds(param.getLimitIds());
|
||||
po.setSetting(param.getSetting());
|
||||
po.setFileId(param.getFileId());
|
||||
po.setUpdateTime(now);
|
||||
getPageListTemplateMapper().updateIgnoreNull(po);
|
||||
}
|
||||
|
|
@ -351,6 +356,21 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook downloadPageExportTemplateFile(DownloadTemplateParam param) {
|
||||
List<List<String>> rowList = new ArrayList<>();
|
||||
List<String> heads = param.getHeads();
|
||||
List<String> setting = param.getSetting();
|
||||
if (CollUtil.isEmpty(heads)||CollUtil.isEmpty(setting)||!Objects.equals(heads.size(), setting.size())){
|
||||
throw new SalaryRunTimeException("未选择字段");
|
||||
}
|
||||
setting = setting.stream().map(s -> String.format("{.%s}", s)).collect(Collectors.toList());
|
||||
rowList.add(heads);
|
||||
rowList.add(setting);
|
||||
|
||||
return ExcelUtilPlus.genWorkbook(rowList, "薪资明细");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePageListTemplate(PageListTemplateChangeParam param) {
|
||||
|
||||
|
|
@ -400,19 +420,31 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
return CollectionUtil.isEmpty(limitIds) || CollectionUtil.intersection(limitIds, taxIds).size() != 0;
|
||||
}
|
||||
return true;
|
||||
}).map(po -> PageListTemplateDTO.builder()
|
||||
.id(po.getId())
|
||||
.page(po.getPage())
|
||||
.name(po.getName())
|
||||
.sharedType(po.getSharedType())
|
||||
.systemType(po.getSystemType())
|
||||
.sharedTypeName(SharedTypeEnum.parseByValue(po.getSharedType()).getDefaultLabel())
|
||||
.systemTypeName(po.getSystemType() == 1 ? "系统模板" : "自定义")
|
||||
.limits(CollUtil.isEmpty(po.getLimitIds()) ? "所有" : Optional.ofNullable(po.getLimitIds()).orElse(new ArrayList<>()).stream().map(id -> idNameMap.getOrDefault(id, "")).collect(Collectors.joining(",")))
|
||||
.limitIds(CollUtil.isEmpty(po.getLimitIds()) ? new ArrayList<>() : po.getLimitIds())
|
||||
.setting(po.getSetting())
|
||||
.canEdit(chief || (Objects.equals((long) user.getUID(), po.getCreator()) && po.getSystemType() == 0))
|
||||
.build())
|
||||
}).map(po -> {
|
||||
Integer fileId = po.getFileId();
|
||||
String fileName = "";
|
||||
if (fileId != null) {
|
||||
ImageFileManager imageFileManager = new ImageFileManager();
|
||||
imageFileManager.getImageFileInfoById(fileId);
|
||||
fileName = imageFileManager.getImageFileName();
|
||||
}
|
||||
|
||||
return PageListTemplateDTO.builder()
|
||||
.id(po.getId())
|
||||
.page(po.getPage())
|
||||
.name(po.getName())
|
||||
.sharedType(po.getSharedType())
|
||||
.systemType(po.getSystemType())
|
||||
.sharedTypeName(SharedTypeEnum.parseByValue(po.getSharedType()).getDefaultLabel())
|
||||
.systemTypeName(po.getSystemType() == 1 ? "系统模板" : "自定义")
|
||||
.limits(CollUtil.isEmpty(po.getLimitIds()) ? "所有" : Optional.ofNullable(po.getLimitIds()).orElse(new ArrayList<>()).stream().map(id -> idNameMap.getOrDefault(id, "")).collect(Collectors.joining(",")))
|
||||
.limitIds(CollUtil.isEmpty(po.getLimitIds()) ? new ArrayList<>() : po.getLimitIds())
|
||||
.setting(po.getSetting())
|
||||
.canEdit(chief || (Objects.equals((long) user.getUID(), po.getCreator()) && po.getSystemType() == 0))
|
||||
.fileId(fileId)
|
||||
.fileName(fileName)
|
||||
.build();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), templateDTOS, PageListTemplateDTO.class);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
|
@ -22,6 +22,8 @@ import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
|||
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
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;
|
||||
|
|
@ -38,6 +40,8 @@ import java.time.YearMonth;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.TAX_DECLARATION_DATE_TYPE;
|
||||
|
||||
@Slf4j
|
||||
public class TaxDeclarationServiceImpl extends Service implements TaxDeclarationService {
|
||||
|
||||
|
|
@ -87,6 +91,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//是否根据税款所属期进行申报
|
||||
private final boolean isTaxDeclarationByTaxCycle = "1".equals(getSalarySysConfService(user).getValueByCode(TAX_DECLARATION_DATE_TYPE));
|
||||
|
||||
@Override
|
||||
public List<TaxDeclarationPO> listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection<Long> taxAgentIds) {
|
||||
if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
|
|
@ -180,51 +191,96 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
// 查询个税扣缴义务人
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS;
|
||||
Date taxCycle;
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS;
|
||||
Set<Long> salaryAcctRecordIds;
|
||||
//根据税款所属期申报
|
||||
if (isTaxDeclarationByTaxCycle) {
|
||||
taxCycle = saveParam.getTaxCycle();
|
||||
if (Objects.isNull(taxCycle)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "税款所属期参数错误"));
|
||||
}
|
||||
|
||||
// 薪资所属月的日期范围
|
||||
LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)));
|
||||
if (Objects.isNull(salaryMonthDateRange)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "薪资所属月参数错误"));
|
||||
}
|
||||
// 查询税款所属期个税扣缴义务人已经生成过的个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarationPOS = listByTaxCycle(TaxDeclarationPO.builder().taxCycle(taxCycle).taxAgentIds(taxAgentNameMap.keySet()).build());
|
||||
// 已经生成过个税申报表,不允许再次生成个税申报表
|
||||
if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成")
|
||||
.replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId()))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(taxCycle)));
|
||||
}
|
||||
// 查询薪资所属月的薪资核算记录
|
||||
salaryAcctRecordPOS = listByTaxCycle(SalaryAcctRecordPO.builder().taxCycle(taxCycle).build());
|
||||
// 无薪资核算记录,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", SalaryDateUtil.getFormatYearMonth(taxCycle)));
|
||||
}
|
||||
// 查询薪资核算结果
|
||||
salaryAcctResultPOS = getSalaryAcctResultService(user)
|
||||
.listBySalaryAcctRecordIdsAndTaxAgentIds(SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId), taxAgentIds);
|
||||
|
||||
// 查询薪资所属月个税扣缴义务人已经生成过的个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarationPOS = listBySalaryMonthTax(TaxDeclarationPO.builder().salaryMonths(salaryMonthDateRange).taxAgentIds(taxAgentNameMap.keySet()).build());
|
||||
// 已经生成过个税申报表,不允许再次生成个税申报表
|
||||
if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成")
|
||||
.replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId()))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 查询薪资所属月的薪资核算记录
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
||||
// 无薪资核算记录,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||
}
|
||||
// 查询薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user)
|
||||
.listBySalaryAcctRecordIdsAndTaxAgentIds(SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId), taxAgentIds);
|
||||
// 无薪资核算结果,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctResultPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
|
||||
// 无薪资核算结果,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctResultPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId);
|
||||
salaryAcctRecordPOS = salaryAcctRecordPOS.stream().filter(salaryAcctRecordPO -> salaryAcctRecordIds.contains(salaryAcctRecordPO.getId())).collect(Collectors.toList());
|
||||
// 如果存在未归档的,也不允许生成个税申报表
|
||||
boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()));
|
||||
if (notArchived) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
} else {
|
||||
//根据薪资所属月申报
|
||||
// 薪资所属月的日期范围
|
||||
LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)));
|
||||
if (Objects.isNull(salaryMonthDateRange)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "薪资所属月参数错误"));
|
||||
}
|
||||
|
||||
Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId);
|
||||
salaryAcctRecordPOS = salaryAcctRecordPOS.stream().filter(salaryAcctRecordPO -> salaryAcctRecordIds.contains(salaryAcctRecordPO.getId())).collect(Collectors.toList());
|
||||
// 如果存在未归档的,也不允许生成个税申报表
|
||||
boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()));
|
||||
if (notArchived) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表
|
||||
Date taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle();
|
||||
boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0);
|
||||
if (differentTaxCycle) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
// 查询薪资所属月个税扣缴义务人已经生成过的个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarationPOS = listBySalaryMonthTax(TaxDeclarationPO.builder().salaryMonths(salaryMonthDateRange).taxAgentIds(taxAgentNameMap.keySet()).build());
|
||||
// 已经生成过个税申报表,不允许再次生成个税申报表
|
||||
if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成")
|
||||
.replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId()))
|
||||
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 查询薪资所属月的薪资核算记录
|
||||
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
||||
// 无薪资核算记录,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", saveParam.getSalaryMonth().toString()));
|
||||
}
|
||||
// 查询薪资核算结果
|
||||
salaryAcctResultPOS = getSalaryAcctResultService(user)
|
||||
.listBySalaryAcctRecordIdsAndTaxAgentIds(SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId), taxAgentIds);
|
||||
|
||||
// 无薪资核算结果,不允许生成个税申报表
|
||||
if (CollectionUtils.isEmpty(salaryAcctResultPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
|
||||
salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId);
|
||||
salaryAcctRecordPOS = salaryAcctRecordPOS.stream().filter(salaryAcctRecordPO -> salaryAcctRecordIds.contains(salaryAcctRecordPO.getId())).collect(Collectors.toList());
|
||||
// 如果存在未归档的,也不允许生成个税申报表
|
||||
boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()));
|
||||
if (notArchived) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
// 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表
|
||||
taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle();
|
||||
boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0);
|
||||
if (differentTaxCycle) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表")
|
||||
.replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
|
||||
}
|
||||
}
|
||||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId);
|
||||
|
|
@ -273,8 +329,8 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
loggerContext.setTargetId(declare.getId().toString());
|
||||
loggerContext.setTargetName(targetName);
|
||||
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(declare);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
|
|
@ -315,6 +371,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
return getSalaryAcctRecordMapper().listSome(po);
|
||||
}
|
||||
|
||||
public List<TaxDeclarationPO> listByTaxCycle(TaxDeclarationPO build) {
|
||||
return getTaxDeclarationMapper().listSome(build);
|
||||
}
|
||||
|
||||
public List<SalaryAcctRecordPO> listByTaxCycle(SalaryAcctRecordPO po) {
|
||||
return getSalaryAcctRecordMapper().listSome(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId) {
|
||||
// 判断是否开启了分权
|
||||
|
|
@ -337,7 +401,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
@Override
|
||||
public void withDrawTaxDeclaration(Long taxDeclarationId) {
|
||||
TaxDeclarationPO po = getTaxDeclarationMapper().getById(taxDeclarationId);
|
||||
if(Objects.isNull(po)){
|
||||
if (Objects.isNull(po)) {
|
||||
throw new SalaryRunTimeException("个税申报表不存在");
|
||||
}
|
||||
// 获取当前个税扣缴义务人下的薪资账套
|
||||
|
|
@ -350,22 +414,22 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
// 删除个税申报表
|
||||
getTaxDeclarationMapper().deleteByIdZj(po.getId());
|
||||
// 修改薪资核算记录状态为已归档
|
||||
if(CollectionUtils.isNotEmpty(salaryAcctRecordIds)){
|
||||
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds,SalaryAcctRecordStatusEnum.ARCHIVED);
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) {
|
||||
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED);
|
||||
}
|
||||
|
||||
// 查询个税扣缴义务人名称
|
||||
String bar = "_";
|
||||
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(po.getTaxAgentId());
|
||||
String targetName = SalaryDateUtil.getFormatYearMonth(po.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel();
|
||||
String targetName = SalaryDateUtil.getFormatYearMonth(po.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel();
|
||||
// 记录日志
|
||||
LoggerContext<TaxDeclarationPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(taxDeclarationId.toString());
|
||||
loggerContext.setTargetName(targetName);
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "撤回个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "撤回个税申报表"));
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "撤回个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "撤回个税申报表"));
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,11 @@ public class SalarySysConstant {
|
|||
*/
|
||||
public static final String SALARY_ACCT_EMPLOYEE_RULE = "salaryAcctEmployeeRule";
|
||||
|
||||
/**
|
||||
* 是否采用线程池,同步异步。空/1异步, 0同步
|
||||
*/
|
||||
public static final String SALARY_ACCT_SYNC_TYPE = "SALARY_ACCT_SYNC_TYPE";
|
||||
|
||||
/**
|
||||
* 工资单二次验证方式
|
||||
*/
|
||||
|
|
@ -79,7 +84,7 @@ public class SalarySysConstant {
|
|||
/**
|
||||
* 个税申报撤回
|
||||
*/
|
||||
public static final String WITHDRAW_TAX_DECLARATION ="WITHDRAW_TAX_DECLARATION";
|
||||
public static final String WITHDRAW_TAX_DECLARATION = "WITHDRAW_TAX_DECLARATION";
|
||||
|
||||
/**
|
||||
* 删除薪资档案
|
||||
|
|
@ -124,7 +129,7 @@ public class SalarySysConstant {
|
|||
/**
|
||||
* 首次查看后多少分钟不能查看工资单
|
||||
*/
|
||||
public static final String SALARY_BILL_BURNING_AFTER_READING_MIN= "SALARY_BILL_BURNING_AFTER_READING_MIN";
|
||||
public static final String SALARY_BILL_BURNING_AFTER_READING_MIN = "SALARY_BILL_BURNING_AFTER_READING_MIN";
|
||||
|
||||
/**
|
||||
* 核算固定列头数
|
||||
|
|
@ -215,6 +220,15 @@ public class SalarySysConstant {
|
|||
*/
|
||||
public static final String SHOT_EMP_TIME_TYPE = "SHOT_EMP_TIME_TYPE";
|
||||
|
||||
//是否采集考勤班次数据,0:关闭 1:开启
|
||||
/**
|
||||
* 是否采集考勤班次数据,0:关闭 1:开启
|
||||
*/
|
||||
public static final String ATTENDANCE_SERIAL_COLLECTION_BTN = "ATTENDANCE_SERIAL_COLLECTION_BTN";
|
||||
|
||||
/**
|
||||
* 报税日期类型,薪资所属月/税款所属期
|
||||
* 0:薪资所属月 1:税款所属期
|
||||
* 默认薪资所属月
|
||||
*/
|
||||
public static final String TAX_DECLARATION_DATE_TYPE = "TAX_DECLARATION_DATE_TYPE";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -55,12 +60,6 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
|||
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
|
||||
private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz();
|
||||
|
||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,13 @@ import java.util.*;
|
|||
*/
|
||||
public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user);
|
||||
}
|
||||
|
|
@ -73,39 +80,43 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
|||
}
|
||||
cal.add(Calendar.MONTH, preMonthValue);
|
||||
Map<Long, String> resignationMap = getSalaryEmployeeService(user).getResignationMapByDate(SalaryDateUtil.getFormatDate(cal.getTime()));
|
||||
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
Date now = new Date();
|
||||
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
||||
for(SalaryArchivePO archive : salaryArchivePOS){
|
||||
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
||||
if (StringUtils.isNotBlank(dismissDate)) {
|
||||
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
||||
archive.setUpdateTime(now);
|
||||
needUpdateSalaryArchiveList.add(archive);
|
||||
|
||||
if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive, "false")) {
|
||||
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
Date now = new Date();
|
||||
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
||||
for(SalaryArchivePO archive : salaryArchivePOS){
|
||||
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
||||
if (StringUtils.isNotBlank(dismissDate)) {
|
||||
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
||||
archive.setUpdateTime(now);
|
||||
needUpdateSalaryArchiveList.add(archive);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
||||
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
||||
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
||||
}
|
||||
|
||||
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
||||
if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive, "false")) {
|
||||
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
||||
// List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
// 设置社保、公积金最后缴纳月
|
||||
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
||||
String dismissDate = resignationMap.get(po.getEmployeeId());
|
||||
if (StringUtils.isNotEmpty(dismissDate)) {
|
||||
dismissDate = StringUtils.substring(dismissDate,0,7);
|
||||
// 更新社保最后缴纳月
|
||||
Long socialArchivesId = po.getSocialArchivesId();
|
||||
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
||||
// 更新公积金最后缴纳月
|
||||
Long fundArchivesId = po.getFundArchivesId();
|
||||
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
||||
// 更新企业年金及其他福利最后缴纳月
|
||||
Long otherArchivesId = po.getOtherArchivesId();
|
||||
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
||||
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
// 设置社保、公积金最后缴纳月
|
||||
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
||||
String dismissDate = resignationMap.get(po.getEmployeeId());
|
||||
if (StringUtils.isNotEmpty(dismissDate)) {
|
||||
dismissDate = StringUtils.substring(dismissDate,0,7);
|
||||
// 更新社保最后缴纳月
|
||||
Long socialArchivesId = po.getSocialArchivesId();
|
||||
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
||||
// 更新公积金最后缴纳月
|
||||
Long fundArchivesId = po.getFundArchivesId();
|
||||
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
||||
// 更新企业年金及其他福利最后缴纳月
|
||||
Long otherArchivesId = po.getOtherArchivesId();
|
||||
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
public class FileUtils {
|
||||
private static final String COPY_FILE_SUFFIX = "_副本";
|
||||
|
||||
/**
|
||||
* 将输入流写入文件
|
||||
* @param in 输入流
|
||||
* @param path 输出文件的路径
|
||||
* @param fileName 输出文件的名称
|
||||
*
|
||||
* */
|
||||
public static void writeFile(InputStream in , String path , String fileName) throws FileNotFoundException {
|
||||
|
||||
FileOutputStream outputStream = new FileOutputStream("");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给定一个目录和文件,若该目录存在名称相同的文件,则返回一个可用的副本文件名,否则直接返回输入的文件名。
|
||||
* @param path 文件的目录
|
||||
* @param fileName 文件名
|
||||
* @return 可用的文件名
|
||||
* */
|
||||
public static String getAvailableName(String path ,String fileName){
|
||||
|
||||
File filePath = new File(path);
|
||||
|
||||
String suffix = fileName.substring(fileName.lastIndexOf("."));
|
||||
File[] files = filePath.listFiles( f -> f.getName().endsWith(suffix) );
|
||||
if ( Objects.isNull(files) ) return fileName;
|
||||
|
||||
Set<String> fileNameSet = new HashSet<>();
|
||||
for (File file: files ) {
|
||||
fileNameSet.add(file.getName().substring(0 , file.getName().lastIndexOf(".")));
|
||||
}
|
||||
|
||||
boolean isExist = true;
|
||||
int count = 1;
|
||||
String tempFileName = fileName.substring(0,fileName.lastIndexOf("."));
|
||||
String tempFileName1 = tempFileName;
|
||||
while(isExist){
|
||||
|
||||
if (fileNameSet.contains(tempFileName)){
|
||||
tempFileName = tempFileName1 + COPY_FILE_SUFFIX + count++;
|
||||
}else{
|
||||
isExist = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return tempFileName + suffix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给定一个文件的完整路径,若该文件已经存在,则返回一个可用的副本文件名,否则直接返回输入的文件名。
|
||||
* @param fullPath 文件的完整路径
|
||||
* @return 可用的文件名
|
||||
* */
|
||||
public static String getAvailableName( String fullPath ){
|
||||
File file = new File(fullPath);
|
||||
if ( !file.isFile() ) throw new RuntimeException( String.format("not a file [%s].",fullPath));
|
||||
|
||||
return getAvailableName( file.getParent() ,file.getName() );
|
||||
}
|
||||
|
||||
/**
|
||||
* 给定一个文件的完整路径,若该文件已经存在,则返回一个完整可用的副本文件名,否则直接返回输入的文件名。
|
||||
* @param fullPath 文件的完整路径
|
||||
* @return 完整可用的文件名
|
||||
* */
|
||||
public static String getAvailableFullName( String fullPath ){
|
||||
File file = new File(fullPath);
|
||||
if ( !file.isFile() ) throw new RuntimeException( String.format("not a file [%s].",fullPath));
|
||||
|
||||
return file.getParent() + File.separator + getAvailableName(fullPath);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
package com.engine.salary.util.excel;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.util.FileUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellUtil;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ExcelFillUtils {
|
||||
|
||||
// public static final String FILL_EXPRESSION_REGEX = "\\{\\.\\w+\\}";
|
||||
private static final String FILL_EXPRESSION_REGEX = "\\{\\.[\\p{L}\\p{M}\\S]+\\}";
|
||||
|
||||
|
||||
/**
|
||||
* 给定模板,指定某个页签,将数据填充到模板中的指定页签,并将数据导入到指定文件上。
|
||||
*
|
||||
* @param template 模板文件地址
|
||||
* @param sheetIndex 页签下标
|
||||
* @param data 待填充的数据,数据格式如下
|
||||
* [
|
||||
* {"colName1":v1 ,"colName2":v2...},
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ]
|
||||
* @return 新生成的副本文件
|
||||
*/
|
||||
public static XSSFWorkbook fillOneSheet(String template, Integer sheetIndex, List<Map<String, Object>> data) {
|
||||
|
||||
try {
|
||||
XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(template));
|
||||
fill(workbook, sheetIndex, data);//填充数据
|
||||
return workbook;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给定模板,指定某个页签,将数据填充到模板中的指定页签,并将数据导入到指定文件上。
|
||||
*
|
||||
* @param template 模板文件流
|
||||
* @param sheetIndex 页签名称
|
||||
* @param data 待填充的数据,数据格式如下
|
||||
* [
|
||||
* {"colName1":v1 ,"colName2":v2...},
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ]
|
||||
* @return 新生成的副本文件
|
||||
*/
|
||||
public static XSSFWorkbook fillOneSheet(InputStream template, Integer sheetIndex, List<Map<String, Object>> data) {
|
||||
|
||||
try{
|
||||
XSSFWorkbook workbook = new XSSFWorkbook(template);
|
||||
fill(workbook, sheetIndex, data);//填充数据
|
||||
return workbook;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给定模板,将数据填充到模板中的多个页签,并在模板所在目录生成新的副本文件。
|
||||
*
|
||||
* @param template 模板文件地址
|
||||
* @param datas 待填充的数据集,数据格式如下
|
||||
* {
|
||||
* "SheetName1":[
|
||||
* {"colName1":v1 ,"colName2":v2...},
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ],
|
||||
* "SheetName2":[
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ],
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
public static String fillMultipleSheet(String template, Map<Integer, List<Map<String, Object>>> datas) {
|
||||
return fillMultipleSheet(template, FileUtils.getAvailableFullName(template), datas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给定模板,将数据填充到模板中的多个页签,并将数据导入到指定文件上。
|
||||
*
|
||||
* @param template 模板文件地址
|
||||
* @param datas 待填充的数据集,数据格式如下
|
||||
* {
|
||||
* "SheetName1":[
|
||||
* {"colName1":v1 ,"colName2":v2...},
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ],
|
||||
* "SheetName2":[
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* {"colName1":v1 ,"colName2":v2...}
|
||||
* ,...
|
||||
* ],
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
public static String fillMultipleSheet(String template, String outputFile, Map<Integer, List<Map<String, Object>>> datas) {
|
||||
|
||||
try (Workbook workbook = new XSSFWorkbook(new FileInputStream(template))) {
|
||||
|
||||
datas.forEach((sheetIndex, data) -> fill(workbook, sheetIndex, data));//填充数据
|
||||
refreshFormula(workbook);//刷新公式
|
||||
|
||||
try (FileOutputStream outputStream = new FileOutputStream(outputFile)) {
|
||||
workbook.write(outputStream);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
private static Workbook fill(Workbook workbook, int sheetIndex, List<Map<String, Object>> data) {
|
||||
|
||||
Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
if (sheet == null) {
|
||||
throw new RuntimeException(String.format("sheet [%s] does not exist.", sheetIndex));
|
||||
}
|
||||
|
||||
//找到所有的表达式单元格
|
||||
Map<String, Cell> expressionCellMap = new HashMap<>();
|
||||
for (int i = 0; i < sheet.getPhysicalNumberOfRows(); i++) {
|
||||
Row row = sheet.getRow(i);
|
||||
for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) {
|
||||
Cell cell = row.getCell(j);
|
||||
if (!Objects.isNull(cell) && isFillExpression(cell.getStringCellValue())) {//判断该单元格是否是填充公式
|
||||
expressionCellMap.put(getColNameFromEx(cell.getStringCellValue()), cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//填充数据
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
Map<String, Object> dataRow = data.get(i);
|
||||
for (Map.Entry<String, Object> entry : dataRow.entrySet()) {
|
||||
String colName = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
if (expressionCellMap.containsKey(colName)) {
|
||||
|
||||
Cell cell = expressionCellMap.get(colName);//公式所在的单元格
|
||||
int rowID = cell.getRowIndex() + i;
|
||||
int colId = cell.getColumnIndex();
|
||||
|
||||
Row fillRow = sheet.getRow(rowID);
|
||||
fillRow = Objects.isNull(fillRow) ? sheet.createRow(rowID) : fillRow;
|
||||
Cell fillCell = fillRow.getCell(colId);
|
||||
//创建的新单元格需要复制公式单元格的格式
|
||||
fillCell = Objects.isNull(fillCell) ? CellUtil.createCell(fillRow, colId, "", cell.getCellStyle()) : fillCell;
|
||||
|
||||
if (value instanceof String) {
|
||||
fillCell.setCellValue(String.valueOf(value));
|
||||
} else if (value instanceof Number) {
|
||||
fillCell.setCellValue(((Number) value).doubleValue());
|
||||
} else {
|
||||
throw new RuntimeException(String.format("Unsupported data type [%s].", value.getClass().toString()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return workbook;
|
||||
}
|
||||
|
||||
private static void refreshFormula(Workbook workbook) {
|
||||
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
|
||||
evaluator.evaluateAll();
|
||||
}
|
||||
|
||||
private static boolean isFillExpression(String ex) {
|
||||
if (StrUtil.isBlank(ex)) {
|
||||
return false;
|
||||
}
|
||||
;
|
||||
return Pattern.matches(FILL_EXPRESSION_REGEX, ex);
|
||||
}
|
||||
|
||||
private static String getColNameFromEx(String ex) {
|
||||
if (!isFillExpression(ex)) throw new RuntimeException("Illegal expression " + ex);
|
||||
return ex.substring(2, ex.length() - 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -48,7 +49,7 @@ public class ExtEmpController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpDTO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.engine.salary.util.page.PageInfo;
|
|||
import com.engine.salary.wrapper.SalaryCommonWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -20,6 +21,11 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -146,6 +152,35 @@ public class SalaryCommonController {
|
|||
return new ResponseResult<PageListTemplateSaveParam, PageListTemplatePO>(user).run(getSalaryCommonWrapper(user)::savePageListTemplate, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/pageList/template/file/download")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response downloadPageExportTemplateFile(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody DownloadTemplateParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
|
||||
XSSFWorkbook workbook = getSalaryCommonWrapper(user).downloadPageExportTemplateFile(param);
|
||||
|
||||
String fileName = "薪资明细模板示例" + LocalDate.now();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/pageList/template/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -30,7 +31,7 @@ public class ExtEmpWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||
return getExtEmpService(user).listPage(param);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.service.SettingService;
|
|||
import com.engine.salary.service.impl.SalaryCacheServiceImpl;
|
||||
import com.engine.salary.service.impl.SettingServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -64,6 +65,10 @@ public class SalaryCommonWrapper extends Service {
|
|||
return getSettingService(user).savePageListTemplate(param);
|
||||
}
|
||||
|
||||
public XSSFWorkbook downloadPageExportTemplateFile(DownloadTemplateParam param) {
|
||||
return getSettingService(user).downloadPageExportTemplateFile(param);
|
||||
}
|
||||
|
||||
public void deletePageListTemplate(PageListTemplateDeleteParam param) {
|
||||
getSettingService(user).deletePageListTemplate(param);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue