|
@@ -36,7 +36,9 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.bos.servicehelper.org.OrgUnitServiceHelper;
|
|
|
import kd.hr.hbp.business.openservicehelper.hrpi.HRPIPersonServiceHelper;
|
|
|
+import kd.hr.hbp.common.model.org.staff.StaffResponse;
|
|
|
import kd.hr.hbp.common.util.HRDBUtil;
|
|
|
+import nckd.jimin.jyyy.hr.hrmp.hbpm.opplugin.web.position.PositionUtils;
|
|
|
import nckd.jimin.jyyy.hr.tsrsc.plugin.util.RecUtils;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -468,33 +470,44 @@ public class YearCrApplyFormPlugin extends AbstractBillPlugIn implements BeforeF
|
|
|
private Object getFieldValue(DynamicObject nckd_recruitpost) {
|
|
|
Object num = null;
|
|
|
if(ObjectUtils.isNotEmpty(nckd_recruitpost)){
|
|
|
- Object nckdSftaff = this.getModel().getValue("nckd_sftaff");
|
|
|
-
|
|
|
- DynamicObject haosStaff = null;
|
|
|
- if(ObjectUtils.isNotEmpty(nckdSftaff)){
|
|
|
- haosStaff = BusinessDataServiceHelper.loadSingle(nckdSftaff,"haos_staff");
|
|
|
- }else{
|
|
|
- QFilter qFilter = new QFilter("enable", QCP.equals, "1");
|
|
|
- DynamicObject[] haosStaffs = BusinessDataServiceHelper.load("haos_staff", "id,name,number", new QFilter[]{qFilter},"year desc");
|
|
|
- if (haosStaffs != null && haosStaffs.length > 0) {
|
|
|
- haosStaff = haosStaffs[0];
|
|
|
- this.getModel().setValue("nckd_sftaff",haosStaff.getPkValue());
|
|
|
- } else {
|
|
|
- return null;
|
|
|
+ //Tyx 2025-09-19 改成直接按照岗位获取编制数
|
|
|
+ List<Long> ids = new ArrayList<Long>();
|
|
|
+ ids.add(nckd_recruitpost.getLong("id"));
|
|
|
+ StaffResponse staffResponse = PositionUtils.getStaffByPosition(ids);
|
|
|
+ if(staffResponse.isSuccess()) {
|
|
|
+ Map data = (Map) staffResponse.getData();
|
|
|
+ if(data.keySet().contains(ids.get(0).toString())) {
|
|
|
+ Map staffMap = (Map) data.get(ids.get(0).toString());
|
|
|
+ num = staffMap.get("staffNum");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- Object pkValue = nckd_recruitpost.get("id");
|
|
|
- QFilter qFilter3 = new QFilter("staff.id", QCP.equals, haosStaff.getPkValue())
|
|
|
- .and("enable", QCP.not_equals, "0")
|
|
|
- .and("datastatus",QCP.not_equals,"-2")
|
|
|
- .and("datastatus",QCP.not_equals,"2")
|
|
|
- .and("datastatus",QCP.not_equals,"-1")
|
|
|
- .and("dutyworkrole.boid",QCP.equals,pkValue);
|
|
|
- DynamicObject[] haosDutyorgdetails = BusinessDataServiceHelper.load("haos_muldimendetail", "id,staff,dutyworkrole,dutyworkrole.boid,yearstaff", new QFilter[]{qFilter3});
|
|
|
- if(haosDutyorgdetails.length > 0) {
|
|
|
- num = haosDutyorgdetails[0].get("yearstaff");
|
|
|
- }
|
|
|
+// Object nckdSftaff = this.getModel().getValue("nckd_sftaff");
|
|
|
+//
|
|
|
+// DynamicObject haosStaff = null;
|
|
|
+// if(ObjectUtils.isNotEmpty(nckdSftaff)){
|
|
|
+// haosStaff = BusinessDataServiceHelper.loadSingle(nckdSftaff,"haos_staff");
|
|
|
+// }else{
|
|
|
+// QFilter qFilter = new QFilter("enable", QCP.equals, "1");
|
|
|
+// DynamicObject[] haosStaffs = BusinessDataServiceHelper.load("haos_staff", "id,name,number", new QFilter[]{qFilter},"year desc");
|
|
|
+// if (haosStaffs != null && haosStaffs.length > 0) {
|
|
|
+// haosStaff = haosStaffs[0];
|
|
|
+// this.getModel().setValue("nckd_sftaff",haosStaff.getPkValue());
|
|
|
+// } else {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// Object pkValue = nckd_recruitpost.get("id");
|
|
|
+// QFilter qFilter3 = new QFilter("staff.id", QCP.equals, haosStaff.getPkValue())
|
|
|
+// .and("enable", QCP.not_equals, "0")
|
|
|
+// .and("datastatus",QCP.not_equals,"-2")
|
|
|
+// .and("datastatus",QCP.not_equals,"2")
|
|
|
+// .and("datastatus",QCP.not_equals,"-1")
|
|
|
+// .and("dutyworkrole.boid",QCP.equals,pkValue);
|
|
|
+// DynamicObject[] haosDutyorgdetails = BusinessDataServiceHelper.load("haos_muldimendetail", "id,staff,dutyworkrole,dutyworkrole.boid,yearstaff", new QFilter[]{qFilter3});
|
|
|
+// if(haosDutyorgdetails.length > 0) {
|
|
|
+// num = haosDutyorgdetails[0].get("yearstaff");
|
|
|
+// }
|
|
|
}
|
|
|
return num;
|
|
|
}
|