|
|
@@ -2,6 +2,7 @@ package nckd.jxccl.hr.htm.plugin.form.quitapply;
|
|
|
|
|
|
import kd.bos.common.enums.EnableEnum;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.serialization.SerializationUtils;
|
|
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
@@ -13,7 +14,9 @@ import nckd.jxccl.hr.htm.common.quitapply.QuitApplyConstant;
|
|
|
import java.time.ZoneId;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 离职申请单表单插件
|
|
|
@@ -77,13 +80,14 @@ public class QuitApplyFormPlugin extends AbstractFormPlugin {
|
|
|
*/
|
|
|
private void setUnUsedAnnualLeave(Long employeeId, Date contractEndDate) {
|
|
|
// 获取人员考勤档案
|
|
|
- Long attFileBoId = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "getAttFileBoId", new Object[]{contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId});
|
|
|
- if (attFileBoId == 0L) {
|
|
|
+ String attFileSerializedString = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "getAttFile", new Object[]{contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId});
|
|
|
+ if (attFileSerializedString == null) {
|
|
|
getView().showTipNotification("未获取到应休未休剩余年假,请检查离职人员是否存在离职时间内有效的考勤档案");
|
|
|
return;
|
|
|
}
|
|
|
+ Map<String, Object> attFile = SerializationUtils.fromJsonString(attFileSerializedString, HashMap.class);
|
|
|
|
|
|
- List<DynamicObject> quotaList = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "queryQuota", new Object[]{attFileBoId, Collections.singletonList(1666695290893207552L), 0, contractEndDate, contractEndDate});
|
|
|
+ List<DynamicObject> quotaList = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "queryQuota", new Object[]{attFile.get("boId"), Collections.singletonList(1666695290893207552L), 0, contractEndDate, contractEndDate});
|
|
|
if (quotaList != null && !quotaList.isEmpty()) {
|
|
|
DynamicObject quotaDy = quotaList.get(0);
|
|
|
getModel().setValue(QuitApplyConstant.NCKD_UNUSEDANNUALLEAVE_KEY, quotaDy.getBigDecimal(QuitApplyConstant.USABLEVALUE_KEY));
|