|
|
@@ -7,9 +7,8 @@ import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
+import kd.hr.hbp.business.servicehelper.HRMServiceHelper;
|
|
|
import kd.sdk.wtc.wtp.business.attfile.AttFileVersion;
|
|
|
-import kd.sdk.wtc.wtp.business.helper.WTPServiceHelper;
|
|
|
-import kd.sdk.wtc.wtp.business.quota.QuotaQueryParam;
|
|
|
import nckd.jxccl.hr.htm.common.quitapply.QuitApplyConstant;
|
|
|
|
|
|
import java.time.ZoneId;
|
|
|
@@ -78,26 +77,16 @@ public class QuitApplyFormPlugin extends AbstractFormPlugin {
|
|
|
* @param contractEndDate 离职日期
|
|
|
*/
|
|
|
private void setUnUsedAnnualLeave(Long employeeId, Date contractEndDate) {
|
|
|
+ // from: kd.sdk.wtc.wtp.business.helper.WTPServiceHelper.getAttFile
|
|
|
// 获取人员考勤档案
|
|
|
- AttFileVersion attFile = WTPServiceHelper.getAttFile(contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId);
|
|
|
+ AttFileVersion attFile = HRMServiceHelper.invokeBizService(QuitApplyConstant.WTC_CLOUD, QuitApplyConstant.WTBS_APP, "IAttFileQueryService", "attFileQuery", new Object[]{contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId});
|
|
|
if (attFile == null) {
|
|
|
getView().showTipNotification("未获取到应休未休剩余年假,请检查离职人员是否存在离职时间内有效的考勤档案");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 查询应休未休剩余年假
|
|
|
- QuotaQueryParam quotaQueryParam = new QuotaQueryParam();
|
|
|
- // 考勤档案
|
|
|
- quotaQueryParam.setAttFileBoId(attFile.getBoId());
|
|
|
- // 休假类型
|
|
|
- quotaQueryParam.setQuotaTypeIdList(Collections.singletonList(1666695290893207552L));
|
|
|
- // 仅使用范围过滤
|
|
|
- quotaQueryParam.setRangQueryType(0);
|
|
|
- // 开始时间
|
|
|
- quotaQueryParam.setStartDate(contractEndDate);
|
|
|
- // 结束时间
|
|
|
- quotaQueryParam.setEndDate(contractEndDate);
|
|
|
- List<DynamicObject> quotaList = WTPServiceHelper.queryQuota(quotaQueryParam);
|
|
|
+ // from: kd.sdk.wtc.wtp.business.helper.WTPServiceHelper.queryQuota
|
|
|
+ List<DynamicObject> quotaList = HRMServiceHelper.invokeBizService(QuitApplyConstant.WTC_CLOUD, QuitApplyConstant.WTP_APP, "IQTService", "queryQuota", new Object[]{attFile.getBoId(), 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));
|