Compare commits
12 Commits
55c8680ab2
...
93708f5327
| Author | SHA1 | Date |
|---|---|---|
|
|
93708f5327 | |
|
|
eb35dddfbd | |
|
|
b83a916610 | |
|
|
10a11dcca4 | |
|
|
cb423962a2 | |
|
|
00fc87ffd8 | |
|
|
85e0b85871 | |
|
|
6a061592e5 | |
|
|
e6a474261c | |
|
|
3dd8db37dc | |
|
|
b4994dab3f | |
|
|
f1bd47f8b7 |
|
|
@ -1,41 +1,42 @@
|
|||
CREATE TABLE hrsa_hrm_snapshot (
|
||||
ID bigint(0) NOT NULL,
|
||||
CREATE TABLE hrsa_hrm_snapshot
|
||||
(
|
||||
ID bigint NOT NULL,
|
||||
snapshot_time timestamp,
|
||||
employee_id bigint(0),
|
||||
employee_id bigint,
|
||||
loginid varchar(100),
|
||||
LASTNAME varchar(60),
|
||||
SEX char(1),
|
||||
BIRTHDAY char(10) ,
|
||||
NATIONALITY int(0) ,
|
||||
NATIONALITY int ,
|
||||
MARITALSTATUS char(1) ,
|
||||
TELEPHONE varchar(60),
|
||||
MOBILE varchar(60) ,
|
||||
MOBILECALL varchar(60) ,
|
||||
EMAIL varchar(60),
|
||||
LOCATIONID int(0),
|
||||
LOCATIONID int,
|
||||
WORKROOM varchar(60),
|
||||
HOMEADDRESS varchar(100),
|
||||
RESOURCETYPE char(1) ,
|
||||
STARTDATE char(10) ,
|
||||
ENDDATE char(10),
|
||||
JOBTITLE int(0) ,
|
||||
JOBTITLE int ,
|
||||
JOBTITLENAME varchar(200) ,
|
||||
JOBACTIVITYDESC varchar(200),
|
||||
JOBLEVEL int(0) ,
|
||||
SECLEVEL int(0) ,
|
||||
DEPARTMENTID int(0) ,
|
||||
JOBLEVEL int ,
|
||||
SECLEVEL int ,
|
||||
DEPARTMENTID int ,
|
||||
DEPARTMENTNAME varchar(200) ,
|
||||
SUBCOMPANYID1 int(0) ,
|
||||
SUBCOMPANYID1 int ,
|
||||
SUBCOMPANYNAME varchar(200) ,
|
||||
COSTCENTERID int(0) ,
|
||||
MANAGERID int(0) ,
|
||||
ASSISTANTID int(0),
|
||||
BANKID1 int(0) ,
|
||||
COSTCENTERID int ,
|
||||
MANAGERID int ,
|
||||
ASSISTANTID int,
|
||||
BANKID1 int ,
|
||||
ACCOUNTID1 varchar(100) ,
|
||||
LASTLOGINDATE char(10) ,
|
||||
CERTIFICATENUM varchar(60) ,
|
||||
NATIVEPLACE varchar(100) ,
|
||||
EDUCATIONLEVEL int(0) ,
|
||||
EDUCATIONLEVEL int ,
|
||||
BEMEMBERDATE char(10) ,
|
||||
BEPARTYDATE char(10) ,
|
||||
WORKCODE varchar(60) ,
|
||||
|
|
@ -44,8 +45,8 @@ CREATE TABLE hrsa_hrm_snapshot (
|
|||
RESIDENTPLACE varchar(200) ,
|
||||
POLICY varchar(30) ,
|
||||
DEGREE varchar(30) ,
|
||||
USEKIND int(0) ,
|
||||
JOBCALL int(0) ,
|
||||
USEKIND int ,
|
||||
JOBCALL int ,
|
||||
jobcallname varchar(200) ,
|
||||
ACCUMFUNDACCOUNT varchar(30),
|
||||
BIRTHPLACE varchar(60) ,
|
||||
|
|
@ -54,14 +55,14 @@ CREATE TABLE hrsa_hrm_snapshot (
|
|||
RESIDENTPOSTCODE varchar(60) ,
|
||||
EXTPHONE varchar(50) ,
|
||||
MANAGERSTR varchar(500),
|
||||
STATUS int(0) ,
|
||||
STATUS int ,
|
||||
FAX varchar(60) ,
|
||||
ISLABOUUNION char(1),
|
||||
TEMPRESIDENTNUMBER varchar(60),
|
||||
PROBATIONENDDATE char(10),
|
||||
COUNTRYID int(0) ,
|
||||
ACCOUNTTYPE int(0) ,
|
||||
BELONGTO int(0) ,
|
||||
COUNTRYID int ,
|
||||
ACCOUNTTYPE int ,
|
||||
BELONGTO int ,
|
||||
ACCOUNTNAME varchar(200) ,
|
||||
companystartdate varchar(10),
|
||||
workstartdate varchar(10) ,
|
||||
|
|
|
|||
|
|
@ -46,11 +46,13 @@ update hrsa_other_archives set delete_type=3;
|
|||
update hrsa_tax_agent_emp set delete_type=3;
|
||||
|
||||
|
||||
-- 删除核算记录和工资单信息
|
||||
update hrsa_salary_acct_record set delete_type=3 where delete_type=0;
|
||||
update hrsa_salary_acct_emp set delete_type=3 where delete_type=0;
|
||||
update hrsa_salary_acct_result set delete_type=3 where delete_type=0;
|
||||
update hrsa_salary_send set delete_type=3 where delete_type=0;
|
||||
update hrsa_salary_send_info set delete_type=3 where delete_type=0;
|
||||
-- 删除核算记录
|
||||
update hrsa_salary_acct_record set delete_type=3 where delete_type=0 and id= 核算记录id;
|
||||
update hrsa_salary_acct_emp set delete_type=3 where delete_type=0 and salary_acct_record_id=核算记录id;
|
||||
update hrsa_salary_acct_result set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;
|
||||
|
||||
--删除工资单信息
|
||||
update hrsa_salary_send set delete_type=3 where delete_type=0 and salary_accounting_id = 核算记录id;
|
||||
update hrsa_salary_send_info set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -720,6 +720,7 @@ public class TaxDeclarationBO {
|
|||
private static String findStringValue(String fieldCode, Map<Long, List<SalaryAcctResultPO>> resultMap, Map<String, Long> salaryItemMap) {
|
||||
return resultMap.getOrDefault(salaryItemMap.getOrDefault(fieldCode, 0L), Collections.emptyList()).stream()
|
||||
.map(SalaryAcctResultPO::getResultValue)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst().orElse("");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@
|
|||
WHERE
|
||||
1=1
|
||||
AND base.delete_type = 0
|
||||
AND base.employee_type is null
|
||||
AND (base.employee_type is null or base.employee_type = 0)
|
||||
<include refid="condition"></include>
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
throw new SalaryRunTimeException("该维度值中无数据!");
|
||||
}
|
||||
// 同一个人放在一起
|
||||
listByDimensionValue = listByDimensionValue.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getEmployeeId)).collect(Collectors.toList());
|
||||
listByDimensionValue = listByDimensionValue.stream().sorted((a,b)-> b.getSalaryMonth().compareTo(a.getSalaryMonth())).collect(Collectors.toList());
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOList = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), listByDimensionValue);
|
||||
|
||||
// 获取此分页的核算人员
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
Map<Long, DataCollectionEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity()));
|
||||
list.forEach(item -> {
|
||||
Map<String, Object> record = new HashMap<>();
|
||||
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId());
|
||||
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId()) ==null?new DataCollectionEmployee():collect.get(item.getEmployeeId());
|
||||
record.put("id", item.getId());
|
||||
record.put("employeeId", item.getEmployeeId());
|
||||
record.put("billMonth", item.getBillMonth());
|
||||
|
|
|
|||
|
|
@ -1736,7 +1736,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
// Long taxAgentId = 0L;
|
||||
|
||||
List<InsuranceAccountDetailPO> list = new ArrayList<>();
|
||||
|
||||
String username = (String) map.getOrDefault("姓名", "");
|
||||
String billMonth = (String) map.getOrDefault("账单月份", "");
|
||||
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
|
||||
String supplementaryMonth = (String) map.getOrDefault("补缴月份", "");
|
||||
|
|
@ -1840,11 +1840,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
//校验补缴人员是否存在福利档案基础信息,并且runStatus处于正在缴纳或者待减员
|
||||
InsuranceArchivesBaseInfoPO insuranceBaseInfo = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(paymentOrganization, employeeId);
|
||||
if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) ) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补缴人员中存在未设置福利档案人员或相关人员不在福利在缴人员中,不可新建补缴信息!"));
|
||||
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(0, "补缴未设置福利档案人员或不在福利在缴人员中,不可新建补缴信息!"));
|
||||
}
|
||||
List<Long> empIdsInPayMonthRange = listCanPayEmpIds(paymentOrganization, billMonth.substring(0, 7));
|
||||
if (!empIdsInPayMonthRange.contains(employeeId)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
|
||||
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
|
||||
}
|
||||
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
|
||||
// 封装InsuranceAccountDetailPO
|
||||
|
|
|
|||
|
|
@ -485,8 +485,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
|
|||
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
|
||||
if(socialComMap !=null){
|
||||
socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
}
|
||||
List<String> socialIds = new ArrayList<>();
|
||||
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
|
||||
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());
|
||||
|
|
|
|||
|
|
@ -340,14 +340,25 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isNotEmpty(otherConditions)) {
|
||||
List<Long> items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList());
|
||||
List<SalaryAcctResultPO> list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items);
|
||||
Map<Long, List<SalaryAcctResultPO>> acctEmpResultsMap = SalaryEntityUtil.group2Map(list, SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
Set<Long> removeAcctEmpIds = new HashSet<>();
|
||||
for (Long acctEmpId : acctEmpResultsMap.keySet()) {
|
||||
List<SalaryAcctResultPO> acctEmpResults = acctEmpResultsMap.get(acctEmpId);
|
||||
//如果有一个条件不成立就删除
|
||||
for (int i = 0; i < otherConditions.size(); i++) {
|
||||
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
|
||||
Long itemId = otherCondition.getItemId();
|
||||
FilterEnum filter = otherCondition.getFilter();
|
||||
List<String> params = otherCondition.getParams();
|
||||
list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList());
|
||||
for (SalaryAcctResultPO po : acctEmpResults) {
|
||||
if(Objects.equals(po.getSalaryItemId(), itemId) && !filter.filter(params).test(po.getResultValue())){
|
||||
removeAcctEmpIds.add(po.getSalaryAcctEmpId());
|
||||
}
|
||||
List<Long> salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
acctEmpResultsMap.keySet().removeAll(removeAcctEmpIds);
|
||||
List<Long> salaryAcctEmpId = Lists.newArrayList(acctEmpResultsMap.keySet());
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmpId)) {
|
||||
//条件不满足直接返回空列表
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
|
|
@ -417,10 +418,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
result.addAll(employBiz.listByVirtualParams(virtualParams));
|
||||
|
||||
for (SalarySobRangeEmpQueryParam param:includeQueryParams) {
|
||||
if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){
|
||||
List<Long> empIds = new ArrayList<>();
|
||||
includeQueryParams.stream()
|
||||
.filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name()))
|
||||
.forEach(param -> {
|
||||
String sql = param.getTarget();
|
||||
RecordSet rs = new RecordSet();
|
||||
if (rs.execute(sql)) {
|
||||
|
|
@ -428,9 +428,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
empIds.add((long) rs.getInt("id"));
|
||||
}
|
||||
}
|
||||
});
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
|
||||
result.addAll(employees);
|
||||
if(CollUtil.isNotEmpty(empIds)){
|
||||
Collection<String> employeeStatus = param.getEmployeeStatus();
|
||||
List<DataCollectionEmployee> employeeByIdsAll = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
|
||||
List<DataCollectionEmployee> collect = employeeByIdsAll.stream().filter(e -> employeeStatus.contains(e.getStatus())).collect(Collectors.toList());
|
||||
result.addAll(collect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据,需要根据人员id去重
|
||||
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ public class SalaryBillController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String batGrant(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendBatParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::batGrant, queryParam);
|
||||
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batGrant, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -499,7 +499,7 @@ public class SalaryBillController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String batWithdraw(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendBatParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::batWithdraw, queryParam);
|
||||
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batWithdraw, queryParam);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
*
|
||||
* @param param 短信验证码发送参数
|
||||
*/
|
||||
public void sendMobileCode(SMSCodeSendParam param) {
|
||||
|
|
@ -709,6 +710,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
|
||||
/**
|
||||
* 校验短信验证码
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -753,26 +755,48 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
}
|
||||
|
||||
|
||||
public void batGrant(SalarySendBatParam param) {
|
||||
public String batGrant(SalarySendBatParam param) {
|
||||
List<Long> salarySendIds = param.getSalarySendIds();
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
String failMsg = "";
|
||||
for (int i = 0; i < salarySendIds.size(); i++) {
|
||||
try {
|
||||
Long sendId = salarySendIds.get(i);
|
||||
SalarySendGrantParam grantParam = SalarySendGrantParam.builder()
|
||||
.salarySendId(sendId)
|
||||
.build();
|
||||
grant(grantParam);
|
||||
successCount++;
|
||||
} catch (Exception e) {
|
||||
failCount++;
|
||||
failMsg = failMsg + "第" + (i + 1) + "个发放失败!失败原因:" + e.getMessage() + "\n";
|
||||
}
|
||||
}
|
||||
public void batWithdraw(SalarySendBatParam param) {
|
||||
|
||||
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
|
||||
}
|
||||
|
||||
public String batWithdraw(SalarySendBatParam param) {
|
||||
List<Long> salarySendIds = param.getSalarySendIds();
|
||||
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
String failMsg = "";
|
||||
for (int i = 0; i < salarySendIds.size(); i++) {
|
||||
try {
|
||||
Long sendId = salarySendIds.get(i);
|
||||
SalarySendWithdrawParam grantParam = SalarySendWithdrawParam.builder()
|
||||
.salarySendId(sendId)
|
||||
.build();
|
||||
withdraw(grantParam);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failCount++;
|
||||
failMsg = failMsg + "第" + (i + 1) + "个撤回失败!失败原因:" + e.getMessage() + "\n";
|
||||
}
|
||||
|
||||
}
|
||||
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue