浏览代码

1.批量职等调整新增薪酬调整功能
2.MDM人员同步优化:兼职所属岗位及上级岗位变化时也需要同步

Tyx 4 天之前
父节点
当前提交
855e581352

+ 1 - 1
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/hrmp/hbpm/task/SyncPersonTask.java

@@ -117,7 +117,7 @@ public class SyncPersonTask extends AbstractTask implements Plugin {
         sb.append("   (to_char(pos.fmodifytime,'yyyy-MM-dd hh24:mi:ss') <= '"+endTime+"' and to_char(pos.fmodifytime,'yyyy-MM-dd hh24:mi:ss') >=  '"+startTime+"' ) or \n");
         sb.append("   (to_char(pos1.fmodifytime,'yyyy-MM-dd hh24:mi:ss') <= '"+endTime+"' and to_char(pos1.fmodifytime,'yyyy-MM-dd hh24:mi:ss') >=  '"+startTime+"' ) or \n");
         sb.append("   (a.fid in (select fpersonid from t_hrpi_ermanfile where to_char(fmodifytime,'yyyy-MM-dd hh24:mi:ss') <= '"+endTime+"' and to_char(fmodifytime,'yyyy-MM-dd hh24:mi:ss') >= '"+startTime+"')) or \n");
-        sb.append("   (a.fid in (" + updatePartSb.toString() + ") \n");
+        sb.append("   (a.fid in (" + updatePartSb.toString() + ")) \n");
         sb.append("   )");
         log.info("-------- 查询人员sql :" + sb.toString() + " -------- ");
         DataSet dataSet = DB.queryDataSet(this.getClass().getName(), DBRoute.of("hr"), sb.toString());

+ 88 - 1
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/swc/hcdm/formplugin/web/AdjustJobBillEdit.java

@@ -20,7 +20,9 @@ import kd.bos.entity.operate.result.OperateErrorInfo;
 import kd.bos.entity.operate.result.OperationResult;
 import kd.bos.entity.validate.ValidateResult;
 import kd.bos.ext.hr.metadata.edit.MulPersonEdit;
+import kd.bos.ext.hr.metadata.edit.MulQueryEdit;
 import kd.bos.form.*;
+import kd.bos.form.control.Control;
 import kd.bos.form.control.EntryGrid;
 import kd.bos.form.control.events.BeforeItemClickEvent;
 import kd.bos.form.control.events.EntryGridBindDataEvent;
@@ -29,6 +31,7 @@ import kd.bos.form.control.events.ItemClickEvent;
 import kd.bos.form.events.*;
 import kd.bos.form.field.BasedataEdit;
 import kd.bos.form.field.DateEdit;
+import kd.bos.form.field.MulBasedataEdit;
 import kd.bos.form.field.events.BeforeF7SelectEvent;
 import kd.bos.form.field.events.BeforeF7SelectListener;
 import kd.bos.form.field.events.DateClickListener;
@@ -38,14 +41,18 @@ import kd.bos.list.ListShowParameter;
 import kd.bos.logging.Log;
 import kd.bos.logging.LogFactory;
 import kd.bos.mvc.SessionManager;
+import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
 import kd.bos.orm.util.CollectionUtils;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.bos.servicehelper.QueryServiceHelper;
 import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.workflow.WorkflowServiceHelper;
 import kd.hr.hbp.bussiness.cert.HRCertCommonHelper;
 import kd.hr.hbp.bussiness.cert.HRCertNoticeTypeEnum;
 import kd.hr.hbp.common.util.*;
 import kd.hr.hbp.formplugin.web.HRDataBaseEdit;
+import kd.hrmp.hrpi.business.infrastructure.utils.QFilterUtil;
 import kd.tdc.tdcs.bussiness.formservice.FormCommonService;
 import kd.tdc.tdcs.bussiness.license.TDCSCertCommonHelper;
 import kd.tdc.tjga.business.application.quickchange.BatchChangeGradeLevelApplication;
@@ -70,13 +77,17 @@ public class AdjustJobBillEdit extends HRDataBaseEdit implements BeforeF7SelectL
         super.registerListener(e);
         MulPersonEdit ermanfileF7 = (MulPersonEdit)this.getControl("ermanfiles");
         ermanfileF7.addBeforeF7SelectListener(this);
+        MulBasedataEdit muladjFileF7 = (MulBasedataEdit) this.getControl("nckd_muladjrecord");
+        muladjFileF7.addBeforeF7SelectListener(this);
         BasedataEdit hrbu = (BasedataEdit)this.getControl("hrbu");
         hrbu.addBeforeF7SelectListener(this);
         BasedataEdit jobGrade = (BasedataEdit)this.getControl("jobgrade");
         jobGrade.addBeforeF7SelectListener(this);
         BasedataEdit jobLevel = (BasedataEdit)this.getControl("joblevel");
         jobLevel.addBeforeF7SelectListener(this);
-        this.addItemClickListeners(new String[]{"advcontoolbarap"});
+        BasedataEdit standardItem = (BasedataEdit)this.getControl("nckd_standarditem");
+        standardItem.addBeforeF7SelectListener(this);
+        this.addItemClickListeners(new String[]{"advcontoolbarap","nckd_advcontoolbarap"});
         DateEdit dateEdit = (DateEdit)this.getControl("changeeffdate");
         dateEdit.addDateClickListener(this);
         EntryGrid changeEntry = (EntryGrid)this.getControl("changeentry");
@@ -404,6 +415,11 @@ public class AdjustJobBillEdit extends HRDataBaseEdit implements BeforeF7SelectL
             BasedataEdit talentfile = (BasedataEdit)this.getControl("ermanfiles");
             talentfile.click();
         }
+        if(HRStringUtils.equals(key, "nckd_addsalemp")) {
+            (new ControlDataSyn()).entryToMulBaseEdit(this, "nckd_muladjrecord", "nckd_entryentity", "nckd_adjrecord");
+            BasedataEdit muladjFile = (BasedataEdit)this.getControl("nckd_muladjrecord");
+            muladjFile.click();
+        }
     }
 
     public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
@@ -420,6 +436,26 @@ public class AdjustJobBillEdit extends HRDataBaseEdit implements BeforeF7SelectL
             formShowParameter.setCloseCallBack(new CloseCallBack(this, "ermanfiles"));
         }
 
+        //多选定调薪信息之前,过滤当前版本
+        if("nckd_muladjrecord".equals(name)) {
+            List<QFilter> customQFilters = beforeF7SelectEvent.getCustomQFilters();
+            customQFilters.add(new QFilter("iscurrentversion", "=", "1"));
+            formShowParameter.setCloseCallBack(new CloseCallBack(this, "muladjrecord"));
+        }
+
+        //过滤,只能选择定调薪信息里面的定调薪项目
+        if("nckd_standarditem".equals(name)) {
+            int currRow = this.getModel().getEntryCurrentRowIndex("nckd_entryentity");
+            DynamicObject entryRowEntity = this.getModel().getEntryRowEntity("nckd_entryentity", currRow);
+            DynamicObject fileObj = entryRowEntity.getDynamicObject("nckd_adjrecord");
+            QFilter filter = QFilterUtil.getCurrentQf();
+            filter.and("salaryadjfile.id", QCP.equals, fileObj.getPkValue());
+            DynamicObjectCollection records = QueryServiceHelper.query("hcdm_salaryadjrecord", "standarditem.id", new QFilter[]{filter});
+            List<Long> itemIds = records.stream().map((dyx -> dyx.getLong("standarditem.id"))).collect(Collectors.toList());
+            List<QFilter> customQFilters = beforeF7SelectEvent.getCustomQFilters();
+            customQFilters.add(new QFilter("id", QCP.in, itemIds));
+        }
+
         if ("hrbu".equals(name)) {
             formShowParameter.setMultiSelect(false);
         }
@@ -445,6 +481,57 @@ public class AdjustJobBillEdit extends HRDataBaseEdit implements BeforeF7SelectL
     public void closedCallBack(ClosedCallBackEvent closedCallBackEvent) {
         String actionId = closedCallBackEvent.getActionId();
         long entryGradeId;
+
+        if("muladjrecord".equals(actionId)) {
+            List<Object> primaryIds = getCallBackSelectIds(closedCallBackEvent);
+            if (HRCollUtil.isEmpty(primaryIds)) {
+                return;
+            }
+
+            if (primaryIds.size() >= 100000) {
+                this.getView().showErrorNotification(ResManager.loadKDString("最多只能添加100000条数据。", "BatchChangeGradeLevelEdit_11", "tdc-tjga-formplugin", new Object[0]));
+                return;
+            }
+            BatchChangeGradeLevelFormService formService = new BatchChangeGradeLevelFormService();
+            List<Long> primaryIdList = (List)primaryIds.stream().map((p) -> {
+                return (Long)p;
+            }).collect(Collectors.toList());
+            DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("nckd_entryentity");
+            Set<Long> existsFileId = (Set)entryEntity.stream().map((d) -> {
+                return d.getLong("nckd_adjrecord.id");
+            }).collect(Collectors.toSet());
+            Set<Long> checkProcessingId = (Set)primaryIdList.stream().filter((id) -> {
+                return !existsFileId.contains(id);
+            }).collect(Collectors.toSet());
+            Set<Long> processingFileIds = (Set)formService.showProcessingEmp(this, checkProcessingId);
+            Set<Long> notProcessingIds = (Set)primaryIdList.stream().filter((id) -> {
+                return !processingFileIds.contains(id);
+            }).collect(Collectors.toSet());
+            this.getModel().setValue("nckd_muladjrecord", notProcessingIds.toArray());
+            Set<Long> newIdSet = (new ControlDataSyn()).mulBaseEditToEntry(this, "nckd_muladjrecord", new String[]{"id"}, "nckd_entryentity", new String[]{"nckd_adjrecord"});
+            DynamicObjectCollection changeCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("nckd_entryentity");
+            Set<Long> empIdSet = (Set)changeCollection.stream().filter((d) -> {
+                return newIdSet.contains(d.getLong("nckd_adjrecord.id"));
+            }).map((d) -> {
+                return d.getLong("nckd_adjrecord.id");
+            }).collect(Collectors.toSet());
+            IDataModel model = this.getModel();
+            model.beginInit();
+            for(int rowNum = 0; rowNum < changeCollection.size(); ++rowNum) {
+                DynamicObject changeRowObj = (DynamicObject)changeCollection.get(rowNum);
+                DynamicObject record = changeRowObj.getDynamicObject("nckd_adjrecord");
+                Long adjFileId = record.getLong("salaryadjfile.id");
+                DynamicObject adjFile = BusinessDataServiceHelper.loadSingle(adjFileId, "hcdm_adjfileinfo");
+                model.setValue("nckd_adjfile", adjFile, rowNum);
+                model.setValue("nckd_salname", adjFile.getString("person.name"), rowNum);
+                model.setValue("nckd_salnumber", adjFile.getString("person.number"), rowNum);
+                model.setValue("nckd_standarditem", record.getDynamicObject("standarditem"), rowNum);
+            }
+            model.endInit();
+            this.getView().updateView("nckd_entryentity");
+        }
+
+
         if ("ermanfiles".equals(actionId)) {
             List<Object> primaryIds = getCallBackSelectIds(closedCallBackEvent);
             if (HRCollUtil.isEmpty(primaryIds)) {

+ 88 - 1
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/swc/hcdm/formplugin/web/AdjustJobBillEffectOp.java

@@ -1,11 +1,20 @@
 package nckd.jimin.jyyy.hr.swc.hcdm.formplugin.web;
 
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
 import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
 import kd.bos.entity.plugin.args.AfterOperationArgs;
+import kd.bos.exception.KDBizException;
+import kd.bos.logging.Log;
+import kd.bos.logging.LogFactory;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.sdk.plugin.Plugin;
+import kd.swc.hcdm.business.salaryadjfile.DecAdjInfoServiceHelper;
 import kd.tdc.tjga.business.task.ScheduleExecutor;
+import nckd.jimin.jyyy.hr.swc.hsas.formplugin.web.helper.AdjSalFileHelper;
 
-import java.util.HashMap;
+import java.util.*;
 
 /**
  * 批量职等调整单生效插件
@@ -14,6 +23,8 @@ import java.util.HashMap;
  * 2025-06-08
  */
 public class AdjustJobBillEffectOp extends AbstractOperationServicePlugIn implements Plugin {
+    private static DecAdjInfoServiceHelper helper = new DecAdjInfoServiceHelper();
+    private static final Log log = LogFactory.getLog(AdjustJobBillEffectOp.class);
 
     @Override
     public void afterExecuteOperationTransaction(AfterOperationArgs e) {
@@ -21,5 +32,81 @@ public class AdjustJobBillEffectOp extends AbstractOperationServicePlugIn implem
         ScheduleExecutor scheduleExecutor = new ScheduleExecutor();
         scheduleExecutor.setJobCustomParams("5/BIP+ZNTT/6", new HashMap(4));
         scheduleExecutor.dispatch("5/BIRZNR2F16", ScheduleExecutor.isSerialWithJobTask("5/BIP+ZNTT/6"));
+
+        //薪酬调整处理
+        DynamicObject[] bills = e.getDataEntities();
+        for (DynamicObject bill : bills) {
+            DynamicObjectCollection entryCols = bill.getDynamicObjectCollection("nckd_entryentity");
+            if(entryCols.size() > 0) {
+
+                for(DynamicObject entry : entryCols) {
+                    //定调薪信息
+                    Long adjRecordId = entry.getLong("nckd_adjrecord.id");
+                    DynamicObject adjRecord = BusinessDataServiceHelper.loadSingle(adjRecordId, "hcdm_salaryadjrecord");
+                    //定调薪档案
+                    Long adjFileId = entry.getLong("nckd_adjfile.id");
+                    //定调薪人员信息
+
+                    Long relPersonId = adjRecord.getLong("relpersonid");
+                    DynamicObject relPerson = BusinessDataServiceHelper.loadSingle(relPersonId, "hcdm_decadjrelperson");
+                    List<Map<String, Object>> list = buildContent(bill, entry, adjRecord, relPerson);
+                    Map<String, Object> returnMap = helper.saveDecAdjRecord(list);
+                    if(!Boolean.valueOf(returnMap.get("success").toString())) {
+                        entry.set("nckd_synclog", returnMap.get("msg").toString());
+                    }
+                    else {
+                        entry.set("nckd_salsyncstatus", "1");
+                    }
+                }
+                SaveServiceHelper.save(bills);
+            }
+        }
     }
+
+    /**
+     * 构建参数
+     *
+     * @param bill
+     * @param entry
+     * @param adjRecord
+     * @param relPerson
+     * @return
+     */
+    public static List<Map<String, Object>> buildContent(DynamicObject bill, DynamicObject entry, DynamicObject adjRecord, DynamicObject relPerson) {
+        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+        Map info = new HashMap();
+        //数据模式 1-变更 2-禁用
+        info.put("datamode", "1");
+        //UUID码
+        String uuid = UUID.randomUUID().toString().replace("-", "");
+        info.put("uuid", uuid);
+        info.put("uniquecode", uuid);
+        info.put("calctype", adjRecord.getString("calctype"));
+        info.put("salaryadjfile", adjRecord.getLong("salaryadjfile.id"));
+        info.put("currency", adjRecord.getLong("currency.id"));
+        info.put("salaryadjrsn", adjRecord.getLong("salaryadjrsn.id"));
+        info.put("bsed", entry.getDate("nckd_salchangeeffdate"));
+        info.put("datasource", adjRecord.getString("datasource"));
+        info.put("businessid", bill.getPkValue().toString());
+        info.put("standarditem", adjRecord.getLong("standarditem.id"));
+        info.put("frequency", adjRecord.getLong("frequency.id"));
+        info.put("nckd_fxxs", adjRecord.getBigDecimal("nckd_fxxs"));
+        info.put("grade", adjRecord.getLong("grade.id"));
+        info.put("rank", adjRecord.getLong("rank.id"));
+        info.put("amount", entry.getBigDecimal("nckd_amount"));
+
+        //人员相关信息
+        Map relperson_data = new HashMap();
+        relperson_data.put("personname", relPerson.getString("personname"));
+        relperson_data.put("empnumber", relPerson.getString("empnumber"));
+        relperson_data.put("org", relPerson.getLong("org.id"));
+        relperson_data.put("depemp", relPerson.getLong("depemp.id"));
+        relperson_data.put("country", 1000001L);
+        relperson_data.put("joblevel",relPerson.getLong("joblevel.id"));
+        relperson_data.put("salaystructure", relPerson.getLong("salaystructure.id"));
+        info.put("relperson_data", relperson_data);
+        list.add(info);
+        return list;
+    }
+
 }

+ 1 - 0
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/tsrsc/plugin/form/CasRecrApplyFormPlugin.java

@@ -391,6 +391,7 @@ public class CasRecrApplyFormPlugin extends AbstractBillPlugIn implements Before
                     this.getModel().setValue("nckd_currentnum",null,iRow);
                 }
                 this.getModel().setValue("nckd_recruitnum",0,iRow);
+                this.getView().updateView("entryentity");
                 break;
             case "nckd_recruitnum":
                 // 人数字段统计

+ 4 - 0
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/wtc/wtam/explugin/TvlBillTimeBucketSplitExtPluginEx.java

@@ -42,7 +42,11 @@ public class TvlBillTimeBucketSplitExtPluginEx implements TvlBillTimeBucketSplit
                 LocalDate shiftstartDate = tvlBillTimeBucketSplitEvent.getStartDate();
                 LocalDate shiftendDate = tvlBillTimeBucketSplitEvent.getEndDate();
                 Set<AttBillTimeBucketExt> timeBucketExtSet = Sets.newHashSet();
+                LocalDate date = LocalDate.of(2025,6, 1);
                 while (shiftstartDate.compareTo((ChronoLocalDate)shiftendDate) <= 0) {
+                    //正式环境 加个判断 需要大于6-1
+                    if(shiftstartDate.compareTo(date) < 0)
+                        continue;
                     LocalDateTime shiftStart = this.getshiftStartDateTime(shiftstartDate, shiftTableSingleExt);
                     LocalDateTime shiftEnd = this.getshiftEndDateTime(shiftstartDate, shiftTableSingleExt);
                     LocalDateTime shiftStartNext = this.getshiftStartDateTime(shiftstartDate.plusDays(1L), shiftTableSingleExt);