|
@@ -22,9 +22,6 @@ import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import kd.sdk.swc.hcdm.business.helper.HCDMApplyBillServiceHelper;
|
|
import kd.sdk.swc.hcdm.business.helper.HCDMApplyBillServiceHelper;
|
|
|
-import kd.sdk.swc.hcdm.business.helper.HCDMSalaryStdServiceHelper;
|
|
|
|
|
-import kd.sdk.swc.hcdm.common.dto.stdtab.match.StdTableDataMatchParam;
|
|
|
|
|
-import kd.sdk.swc.hcdm.common.dto.stdtab.match.StdTableDataMatchResult;
|
|
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
import nckd.jxccl.base.common.enums.psms.AdjustTypeEnum;
|
|
import nckd.jxccl.base.common.enums.psms.AdjustTypeEnum;
|
|
|
import nckd.jxccl.base.common.enums.psms.TypeStateEnum;
|
|
import nckd.jxccl.base.common.enums.psms.TypeStateEnum;
|
|
@@ -33,7 +30,6 @@ import nckd.jxccl.base.common.utils.ConvertUtil;
|
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
|
import nckd.jxccl.base.common.utils.StrFormatter;
|
|
import nckd.jxccl.base.common.utils.StrFormatter;
|
|
|
-import nckd.jxccl.base.entity.helper.EntityHelper;
|
|
|
|
|
import nckd.jxccl.base.swc.helper.AdjFileServiceHelper;
|
|
import nckd.jxccl.base.swc.helper.AdjFileServiceHelper;
|
|
|
import nckd.jxccl.hr.psms.common.PositionStructureConstant;
|
|
import nckd.jxccl.hr.psms.common.PositionStructureConstant;
|
|
|
|
|
|
|
@@ -65,12 +61,18 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
|
|
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
|
|
|
|
|
+ logger.info("开始执行职位体系推送薪酬任务, 参数: {}", JSON.toJSONString(map));
|
|
|
|
|
+
|
|
|
//1:为本月数据,2:为上月数据
|
|
//1:为本月数据,2:为上月数据
|
|
|
Integer type = ConvertUtil.toInt(map.get("type"));
|
|
Integer type = ConvertUtil.toInt(map.get("type"));
|
|
|
Date beginDateParam = ConvertUtil.toDate(map.get("beginDateParam"));
|
|
Date beginDateParam = ConvertUtil.toDate(map.get("beginDateParam"));
|
|
|
Date endDateParam = ConvertUtil.toDate(map.get("endDateParam"));
|
|
Date endDateParam = ConvertUtil.toDate(map.get("endDateParam"));
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("解析参数完成: type={}, beginDateParam={}, endDateParam={}", type, beginDateParam, endDateParam);
|
|
|
|
|
+
|
|
|
// 校验日期:要么都为空,要么都不为空
|
|
// 校验日期:要么都为空,要么都不为空
|
|
|
if ((beginDateParam == null && endDateParam != null) || (beginDateParam != null && endDateParam == null)) {
|
|
if ((beginDateParam == null && endDateParam != null) || (beginDateParam != null && endDateParam == null)) {
|
|
|
|
|
+ logger.error("日期参数错误-开始日期和结束日期必须同时为空或同时不为空, beginDateParam={}, endDateParam={}", beginDateParam, endDateParam);
|
|
|
throw new ValidationException("日期参数错误-开始日期和结束日期必须同时为空或同时不为空");
|
|
throw new ValidationException("日期参数错误-开始日期和结束日期必须同时为空或同时不为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -81,17 +83,21 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
if(beginDateParam != null && endDateParam != null){
|
|
if(beginDateParam != null && endDateParam != null){
|
|
|
beginDate = DateUtil.beginOfDay(beginDateParam);
|
|
beginDate = DateUtil.beginOfDay(beginDateParam);
|
|
|
endDate = DateUtil.endOfDay(endDateParam);
|
|
endDate = DateUtil.endOfDay(endDateParam);
|
|
|
|
|
+ logger.info("使用自定义日期范围: beginDate={}, endDate={}", beginDate, endDate);
|
|
|
}else{
|
|
}else{
|
|
|
LocalDateTime now = DateUtil.now();
|
|
LocalDateTime now = DateUtil.now();
|
|
|
if(type == 2){
|
|
if(type == 2){
|
|
|
now = DateUtil.minusMonths(now, 1);
|
|
now = DateUtil.minusMonths(now, 1);
|
|
|
|
|
+ logger.info("处理上月数据");
|
|
|
}else if(type == 1){
|
|
}else if(type == 1){
|
|
|
- //本月
|
|
|
|
|
|
|
+ logger.info("处理本月数据");
|
|
|
}else{
|
|
}else{
|
|
|
|
|
+ logger.error("参数错误-type,只能为1或2, 当前type={}", type);
|
|
|
throw new ValidationException("参数错误-type,只能为1或2");
|
|
throw new ValidationException("参数错误-type,只能为1或2");
|
|
|
}
|
|
}
|
|
|
beginDate = DateUtil.toDate(DateUtil.beginOfMonth(now));
|
|
beginDate = DateUtil.toDate(DateUtil.beginOfMonth(now));
|
|
|
endDate = DateUtil.toDate(DateUtil.endOfMonth(now));
|
|
endDate = DateUtil.toDate(DateUtil.endOfMonth(now));
|
|
|
|
|
+ logger.info("计算日期范围: beginDate={}, endDate={}", beginDate, endDate);
|
|
|
}
|
|
}
|
|
|
filter.and(FormConstant.CREATE_TIME_KEY,QCP.large_equals,beginDate);
|
|
filter.and(FormConstant.CREATE_TIME_KEY,QCP.large_equals,beginDate);
|
|
|
filter.and(FormConstant.CREATE_TIME_KEY,QCP.less_equals,new Date());
|
|
filter.and(FormConstant.CREATE_TIME_KEY,QCP.less_equals,new Date());
|
|
@@ -106,11 +112,17 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
.addIdNumberName(PositionStructureConstant.NCKD_LASTPERSONPOSFILE,PositionStructureConstant.NCKD_JOBLEVELHR)
|
|
.addIdNumberName(PositionStructureConstant.NCKD_LASTPERSONPOSFILE,PositionStructureConstant.NCKD_JOBLEVELHR)
|
|
|
.orderDesc(FormConstant.CREATE_TIME_KEY);
|
|
.orderDesc(FormConstant.CREATE_TIME_KEY);
|
|
|
DynamicObjectCollection personPosFileColl = QueryServiceHelper.query(PositionStructureConstant.PERSONPOSFILE_ENTITYID, queryFieldBuilder.buildSelect(), new QFilter[]{filter});
|
|
DynamicObjectCollection personPosFileColl = QueryServiceHelper.query(PositionStructureConstant.PERSONPOSFILE_ENTITYID, queryFieldBuilder.buildSelect(), new QFilter[]{filter});
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("查询到 {} 条职位档案记录", personPosFileColl.size());
|
|
|
|
|
+
|
|
|
// 按人员分组,Map<Long,List<DynamicObject>>
|
|
// 按人员分组,Map<Long,List<DynamicObject>>
|
|
|
Map<Long, List<DynamicObject>> personPosFileMap = personPosFileColl.stream()
|
|
Map<Long, List<DynamicObject>> personPosFileMap = personPosFileColl.stream()
|
|
|
.collect(Collectors.groupingBy(
|
|
.collect(Collectors.groupingBy(
|
|
|
obj -> obj.getLong(String.join(".", PositionStructureConstant.NCKD_PERSON, FormConstant.ID_KEY))
|
|
obj -> obj.getLong(String.join(".", PositionStructureConstant.NCKD_PERSON, FormConstant.ID_KEY))
|
|
|
));
|
|
));
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("按人员分组完成,共 {} 个员工", personPosFileMap.size());
|
|
|
|
|
+
|
|
|
//需要推送调薪的员工档案id
|
|
//需要推送调薪的员工档案id
|
|
|
List<Long> needAdjustSalaryId = new ArrayList<>();
|
|
List<Long> needAdjustSalaryId = new ArrayList<>();
|
|
|
List<Long> needPersonId = new ArrayList<>();
|
|
List<Long> needPersonId = new ArrayList<>();
|
|
@@ -154,62 +166,19 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("筛选出需要推送调薪的记录 {} 条", needAdjustSalaryId.size());
|
|
|
|
|
|
|
|
if(!needAdjustSalaryId.isEmpty()){
|
|
if(!needAdjustSalaryId.isEmpty()){
|
|
|
|
|
+ logger.info("开始获取人员最新岗位工资标准定薪记录");
|
|
|
//获取人员最新岗位工资标准定薪记录
|
|
//获取人员最新岗位工资标准定薪记录
|
|
|
List<AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResultList = AdjFileServiceHelper.getLastDecAdjRecords(needPersonId, FormConstant.STANDARDITEM_ID_KEY);
|
|
List<AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResultList = AdjFileServiceHelper.getLastDecAdjRecords(needPersonId, FormConstant.STANDARDITEM_ID_KEY);
|
|
|
- Map<Long,AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResultMap = new HashMap<>(salaryAdjustmentResultList.size());
|
|
|
|
|
|
|
+ Map<Long, List<AdjFileServiceHelper.SalaryAdjustmentResult>> salaryAdjustmentResultMap = salaryAdjustmentResultList.stream()
|
|
|
|
|
+ .collect(Collectors.groupingBy(result -> result.employee.getLong(FormConstant.ID_KEY)));
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("获取到 {} 条定薪记录", salaryAdjustmentResultList.size());
|
|
|
|
|
+
|
|
|
if (!salaryAdjustmentResultList.isEmpty()) {
|
|
if (!salaryAdjustmentResultList.isEmpty()) {
|
|
|
- //薪酬标准ID
|
|
|
|
|
- List<Long> salaryStIds = salaryAdjustmentResultList.stream().map(result -> result.salaryStDv.getLong(FormConstant.ID_KEY)).collect(Collectors.toList());
|
|
|
|
|
- QFilter salaryStandardFilter = new QFilter(FormConstant.ID_KEY, QCP.in, salaryStIds)
|
|
|
|
|
- .and(String.join(".", "rankentry", "rank", FormConstant.NUMBER_KEY), QCP.equals, "01");
|
|
|
|
|
- //获取标准表中01档的薪档
|
|
|
|
|
- QueryFieldBuilder salaryStandFieldBuilder = QueryFieldBuilder.create()
|
|
|
|
|
- .add(FormConstant.ID_KEY)
|
|
|
|
|
- .addIdNumberNameWithExtras(new String[]{"rankentry", "rank"},FormConstant.INDEX_KEY);
|
|
|
|
|
- DynamicObjectCollection salaryStandardColl = QueryServiceHelper.query("hcdm_salarystandard", salaryStandFieldBuilder.buildSelect(), new QFilter[]{salaryStandardFilter});
|
|
|
|
|
- Map<Long, DynamicObject> salaryStandardMap = salaryStandardColl.stream()
|
|
|
|
|
- .collect(Collectors.toMap(
|
|
|
|
|
- obj -> obj.getLong(FormConstant.ID_KEY),
|
|
|
|
|
- obj -> obj
|
|
|
|
|
- ));
|
|
|
|
|
-
|
|
|
|
|
- if (!salaryStandardMap.isEmpty()) {
|
|
|
|
|
- List<StdTableDataMatchParam> matchParams = new ArrayList<>();
|
|
|
|
|
- for (AdjFileServiceHelper.SalaryAdjustmentResult result : salaryAdjustmentResultList) {
|
|
|
|
|
- StdTableDataMatchParam stdTableDataMatchParam = new StdTableDataMatchParam();
|
|
|
|
|
- stdTableDataMatchParam.setStdTableId(result.salaryStDv.getLong(FormConstant.ID_KEY));
|
|
|
|
|
- stdTableDataMatchParam.setStdItemId(FormConstant.STANDARDITEM_ID_KEY);
|
|
|
|
|
- stdTableDataMatchParam.setGradeId(result.salaryGrade.getLong(FormConstant.ID_KEY));
|
|
|
|
|
- DynamicObject dynamicObject = salaryStandardMap.get(result.salaryStDv.getLong(FormConstant.ID_KEY));
|
|
|
|
|
- if(dynamicObject != null) {
|
|
|
|
|
- long rankId = dynamicObject.getLong(String.join(".", "rankentry", "rank", FormConstant.ID_KEY));
|
|
|
|
|
- stdTableDataMatchParam.setRankId(rankId);
|
|
|
|
|
- result.salaryRank = EntityHelper.newEntity(FormConstant.HSBS_SALARYRANK, rankId);
|
|
|
|
|
- matchParams.add(stdTableDataMatchParam);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if(!matchParams.isEmpty()) {
|
|
|
|
|
- //获取薪酬项目、薪等、薪档对应金额(入参params的数组下标和出参的数组下标一一对应)
|
|
|
|
|
- List<StdTableDataMatchResult> stdTableDataMatchResults = HCDMSalaryStdServiceHelper.matchStdTableData(matchParams);
|
|
|
|
|
- for (int i = 0; i < salaryAdjustmentResultList.size(); i++) {
|
|
|
|
|
- AdjFileServiceHelper.SalaryAdjustmentResult result = salaryAdjustmentResultList.get(i);
|
|
|
|
|
- if (i < stdTableDataMatchResults.size() && stdTableDataMatchResults.get(i) != null) {
|
|
|
|
|
- //当前薪等01档的金额
|
|
|
|
|
- result.amount = stdTableDataMatchResults.get(i).getAmount();
|
|
|
|
|
- salaryAdjustmentResultMap.put(result.employee.getLong(FormConstant.ID_KEY), result);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- logger.warn("未获取薪酬标准表中01档的薪档数据,薪酬标准ID:{}",salaryStIds);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- logger.warn("未获取到人员岗位工资标准定薪记录,人员ID:{}",needPersonId);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(!salaryAdjustmentResultMap.isEmpty()){
|
|
|
|
|
Map<Long, DynamicObject> jobLevelMap = new HashMap<>(jobLevelIds.size());
|
|
Map<Long, DynamicObject> jobLevelMap = new HashMap<>(jobLevelIds.size());
|
|
|
if(!jobLevelIds.isEmpty()) {
|
|
if(!jobLevelIds.isEmpty()) {
|
|
|
MainEntityType jobLevelEntityType = EntityMetadataCache.getDataEntityType(FormConstant.HBJM_JOBLEVELHR);
|
|
MainEntityType jobLevelEntityType = EntityMetadataCache.getDataEntityType(FormConstant.HBJM_JOBLEVELHR);
|
|
@@ -220,11 +189,16 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
obj -> obj.getLong(FormConstant.ID_KEY),
|
|
obj -> obj.getLong(FormConstant.ID_KEY),
|
|
|
obj -> obj
|
|
obj -> obj
|
|
|
));
|
|
));
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("加载 {} 条职级信息", load.length);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<DynamicObject> updatePersonPosFile = new ArrayList<>();
|
|
List<DynamicObject> updatePersonPosFile = new ArrayList<>();
|
|
|
MainEntityType personPosFileEntityType = EntityMetadataCache.getDataEntityType(PositionStructureConstant.PERSONPOSFILE_ENTITYID);
|
|
MainEntityType personPosFileEntityType = EntityMetadataCache.getDataEntityType(PositionStructureConstant.PERSONPOSFILE_ENTITYID);
|
|
|
DynamicObject[] personPosFileArray = BusinessDataServiceHelper.load(needAdjustSalaryId.toArray(), personPosFileEntityType);
|
|
DynamicObject[] personPosFileArray = BusinessDataServiceHelper.load(needAdjustSalaryId.toArray(), personPosFileEntityType);
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("加载 {} 条职位档案记录用于更新", personPosFileArray.length);
|
|
|
|
|
+
|
|
|
for (DynamicObject personPosFile : personPosFileArray) {
|
|
for (DynamicObject personPosFile : personPosFileArray) {
|
|
|
long jobLevelId = personPosFile.getLong(String.join(".", PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
|
|
long jobLevelId = personPosFile.getLong(String.join(".", PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
|
|
|
long lastJobLevelId = personPosFile.getLong(String.join(".",PositionStructureConstant.NCKD_LASTPERSONPOSFILE, PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
|
|
long lastJobLevelId = personPosFile.getLong(String.join(".",PositionStructureConstant.NCKD_LASTPERSONPOSFILE, PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
|
|
@@ -234,21 +208,20 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
if(jobLevel != null) {
|
|
if(jobLevel != null) {
|
|
|
DynamicObject person = personPosFile.getDynamicObject(FormConstant.NCKD_PERSON);
|
|
DynamicObject person = personPosFile.getDynamicObject(FormConstant.NCKD_PERSON);
|
|
|
Date date = personPosFile.getDate(PositionStructureConstant.NCKD_BEGINDATE);
|
|
Date date = personPosFile.getDate(PositionStructureConstant.NCKD_BEGINDATE);
|
|
|
- AdjFileServiceHelper.SalaryAdjustmentResult salaryAdjustmentResult = salaryAdjustmentResultMap.get(person.getLong(FormConstant.ID_KEY));
|
|
|
|
|
- if (salaryAdjustmentResult != null && salaryAdjustmentResult.amount.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
|
|
+ List<AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResults = salaryAdjustmentResultMap.get(person.getLong(FormConstant.ID_KEY));
|
|
|
|
|
+ if (salaryAdjustmentResults != null) {
|
|
|
|
|
+ AdjFileServiceHelper.SalaryAdjustmentResult salaryAdjustmentResult = salaryAdjustmentResults.get(0);
|
|
|
BigDecimal coefficient = jobLevel.getBigDecimal(PositionStructureConstant.NCKD_COEFFICIENT);
|
|
BigDecimal coefficient = jobLevel.getBigDecimal(PositionStructureConstant.NCKD_COEFFICIENT);
|
|
|
- BigDecimal finalAmount = BigDecimal.ZERO;
|
|
|
|
|
- if(coefficient.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
- //职位津贴=职位系数 X 所在岗级岗位工资一档金额
|
|
|
|
|
- finalAmount = coefficient.multiply(salaryAdjustmentResult.amount);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("处理员工 {}, 职位档案ID: {}, 职级系数: {}",
|
|
|
|
|
+ person.getString(FormConstant.NAME_KEY),
|
|
|
|
|
+ personPosFile.getLong(FormConstant.ID_KEY),
|
|
|
|
|
+ coefficient);
|
|
|
|
|
+
|
|
|
//触发定调薪
|
|
//触发定调薪
|
|
|
Map<String, Object> applyBill = new HashMap<>();
|
|
Map<String, Object> applyBill = new HashMap<>();
|
|
|
applyBill.put("billname", StrFormatter.format("【{}】的职位体系调整(职位津贴)",person.getString(FormConstant.NAME_KEY)));
|
|
applyBill.put("billname", StrFormatter.format("【{}】的职位体系调整(职位津贴)",person.getString(FormConstant.NAME_KEY)));
|
|
|
Long orgId = RequestContext.get().getOrgId();
|
|
Long orgId = RequestContext.get().getOrgId();
|
|
|
-
|
|
|
|
|
String uniquecode = UUID.randomUUID().toString().replace("-", "");
|
|
String uniquecode = UUID.randomUUID().toString().replace("-", "");
|
|
|
applyBill.put("_uniquecode", uniquecode);
|
|
applyBill.put("_uniquecode", uniquecode);
|
|
|
if(salaryAdjustmentResult.hcdmOrg != null){
|
|
if(salaryAdjustmentResult.hcdmOrg != null){
|
|
@@ -256,7 +229,6 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
}else{
|
|
}else{
|
|
|
applyBill.put("org", orgId);
|
|
applyBill.put("org", orgId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
//定调薪明细字段显示方案 调薪明细字段
|
|
//定调薪明细字段显示方案 调薪明细字段
|
|
|
applyBill.put("billtype", 2215975998602655744L);
|
|
applyBill.put("billtype", 2215975998602655744L);
|
|
|
//国家
|
|
//国家
|
|
@@ -293,7 +265,7 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
lastJobLevel == null ? "无" : lastJobLevel.getString(FormConstant.JOBLEVELSEQ)+"级",
|
|
lastJobLevel == null ? "无" : lastJobLevel.getString(FormConstant.JOBLEVELSEQ)+"级",
|
|
|
jobLevel.getString(FormConstant.NAME_KEY),
|
|
jobLevel.getString(FormConstant.NAME_KEY),
|
|
|
jobLevel.getString(FormConstant.JOBLEVELSEQ),
|
|
jobLevel.getString(FormConstant.JOBLEVELSEQ),
|
|
|
- coefficient
|
|
|
|
|
|
|
+ coefficient
|
|
|
);
|
|
);
|
|
|
applyBill.put("description", description);
|
|
applyBill.put("description", description);
|
|
|
List<Map<String, Object>> applyBillEntryData = new ArrayList<>();
|
|
List<Map<String, Object>> applyBillEntryData = new ArrayList<>();
|
|
@@ -304,11 +276,11 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
applyBillEntry.put("employee", employeeId);
|
|
applyBillEntry.put("employee", employeeId);
|
|
|
applyBillEntry.put("standarditem", 2321901533681170432L); //定调薪项目 职位系数
|
|
applyBillEntry.put("standarditem", 2321901533681170432L); //定调薪项目 职位系数
|
|
|
applyBillEntry.put("frequency", 1095454108284088320L); //频度 月
|
|
applyBillEntry.put("frequency", 1095454108284088320L); //频度 月
|
|
|
- applyBillEntry.put("amount", finalAmount);
|
|
|
|
|
|
|
+ applyBillEntry.put("amount", coefficient);
|
|
|
applyBillEntry.put("position", positionId);
|
|
applyBillEntry.put("position", positionId);
|
|
|
applyBillEntry.put("joblevel", jobLevel.getLong(FormConstant.ID_KEY));
|
|
applyBillEntry.put("joblevel", jobLevel.getLong(FormConstant.ID_KEY));
|
|
|
- applyBillEntry.put("salarygrade", salaryAdjustmentResult.salaryGrade.getLong(FormConstant.ID_KEY));
|
|
|
|
|
- applyBillEntry.put("salaryrank", salaryAdjustmentResult.salaryRank.getLong(FormConstant.ID_KEY));
|
|
|
|
|
|
|
+ /*applyBillEntry.put("salarygrade", salaryAdjustmentResult.salaryGrade.getLong(FormConstant.ID_KEY));
|
|
|
|
|
+ applyBillEntry.put("salaryrank", salaryAdjustmentResult.salaryRank.getLong(FormConstant.ID_KEY));*/
|
|
|
applyBillEntry.put("reason", description);
|
|
applyBillEntry.put("reason", description);
|
|
|
applyBillEntryData.add(applyBillEntry);
|
|
applyBillEntryData.add(applyBillEntry);
|
|
|
applyBill.put("applybillent", applyBillEntryData);
|
|
applyBill.put("applybillent", applyBillEntryData);
|
|
@@ -317,24 +289,33 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
Map<String, Object> papams = new HashMap<>();
|
|
Map<String, Object> papams = new HashMap<>();
|
|
|
papams.put("data", applyBillData);
|
|
papams.put("data", applyBillData);
|
|
|
papams.put("isUseMatchAmount", Boolean.TRUE);
|
|
papams.put("isUseMatchAmount", Boolean.TRUE);
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("准备推送员工 {} 的定调薪申请单", person.getString(FormConstant.NAME_KEY));
|
|
|
Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
|
|
Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
|
|
|
if (!ConvertUtil.toBoolean(result.get("success")) || result.get("data") == null || ConvertUtil.toList(result.get("data")).isEmpty()) {
|
|
if (!ConvertUtil.toBoolean(result.get("success")) || result.get("data") == null || ConvertUtil.toList(result.get("data")).isEmpty()) {
|
|
|
|
|
+ logger.error("【{}】推送定调薪失败,原因:{}", person.getString(FormConstant.NAME_KEY), JSON.toJSONString(result));
|
|
|
throw new ValidationException("【"+person.getString(FormConstant.NAME_KEY)+"】推送定调薪失败,原因:" + JSON.toJSONString(result));
|
|
throw new ValidationException("【"+person.getString(FormConstant.NAME_KEY)+"】推送定调薪失败,原因:" + JSON.toJSONString(result));
|
|
|
}else{
|
|
}else{
|
|
|
personPosFile.set(PositionStructureConstant.NCKD_ISSALADJPUSH, Boolean.TRUE);
|
|
personPosFile.set(PositionStructureConstant.NCKD_ISSALADJPUSH, Boolean.TRUE);
|
|
|
personPosFile.set(PositionStructureConstant.NCKD_SALADJPUSHTIME, new Date());
|
|
personPosFile.set(PositionStructureConstant.NCKD_SALADJPUSHTIME, new Date());
|
|
|
personPosFile.set(PositionStructureConstant.NCKD_SALADJID, ConvertUtil.toMap(ConvertUtil.toList(result.get("data")).get(0)).get("id"));
|
|
personPosFile.set(PositionStructureConstant.NCKD_SALADJID, ConvertUtil.toMap(ConvertUtil.toList(result.get("data")).get(0)).get("id"));
|
|
|
- personPosFile.set(PositionStructureConstant.NCKD_SALADJNUMBER, null);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("成功推送员工 {} 的定调薪申请单,申请单ID: {}",
|
|
|
|
|
+ person.getString(FormConstant.NAME_KEY),
|
|
|
|
|
+ ConvertUtil.toMap(ConvertUtil.toList(result.get("data")).get(0)).get("id"));
|
|
|
|
|
|
|
|
updatePersonPosFile.add(personPosFile);
|
|
updatePersonPosFile.add(personPosFile);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- logger.warn("未获取到员工【{}】最新岗位工资标准定薪记录01档的薪等金额,人员ID:", person.getString(FormConstant.NAME_KEY));
|
|
|
|
|
|
|
+ logger.warn("未获取到员工【{}】最新岗位工资标准定薪记录01档的薪等金额,人员ID:{}", person.getString(FormConstant.NAME_KEY), person.getLong(FormConstant.ID_KEY));
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.warn("员工 {} 的职级信息为空,跳过处理", personPosFile.getDynamicObject(FormConstant.NCKD_PERSON).getString(FormConstant.NAME_KEY));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(!updatePersonPosFile.isEmpty()){
|
|
if(!updatePersonPosFile.isEmpty()){
|
|
|
|
|
+ logger.info("开始保存 {} 条职位档案更新记录", updatePersonPosFile.size());
|
|
|
OperationResult operationResult = SaveServiceHelper.saveOperate(PositionStructureConstant.PERSONPOSFILE_ENTITYID, updatePersonPosFile.toArray(new DynamicObject[0]), OperateOption.create());
|
|
OperationResult operationResult = SaveServiceHelper.saveOperate(PositionStructureConstant.PERSONPOSFILE_ENTITYID, updatePersonPosFile.toArray(new DynamicObject[0]), OperateOption.create());
|
|
|
if (!operationResult.isSuccess()) {
|
|
if (!operationResult.isSuccess()) {
|
|
|
StringJoiner errorMsg = new StringJoiner("\n");
|
|
StringJoiner errorMsg = new StringJoiner("\n");
|
|
@@ -344,12 +325,22 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
|
|
|
if (!ObjectUtils.isEmpty(operationResult.getMessage())) {
|
|
if (!ObjectUtils.isEmpty(operationResult.getMessage())) {
|
|
|
errorMsg.add(operationResult.getMessage());
|
|
errorMsg.add(operationResult.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.error("保存职位档案失败,原因:{}", errorMsg.toString());
|
|
|
throw new ValidationException("保存职位档案失败,原因:" + errorMsg.toString());
|
|
throw new ValidationException("保存职位档案失败,原因:" + errorMsg.toString());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.info("成功保存 {} 条职位档案记录", updatePersonPosFile.size());
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.info("没有需要保存的职位档案更新记录");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.warn("未获取到人员岗位工资标准定薪记录,人员ID:{}",needPersonId);
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
logger.warn("没有需要推送的调薪数据");
|
|
logger.warn("没有需要推送的调薪数据");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ logger.info("职位体系推送薪酬任务执行完成");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|