|
@@ -7,11 +7,14 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
|
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
|
|
+import kd.bos.logging.Log;
|
|
|
|
|
+import kd.bos.logging.LogFactory;
|
|
|
import kd.bos.orm.query.QCP;
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
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 java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -23,6 +26,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
*/
|
|
|
public class BuildApplyBillOpPlugin extends AbstractOperationServicePlugIn implements Plugin {
|
|
public class BuildApplyBillOpPlugin extends AbstractOperationServicePlugIn implements Plugin {
|
|
|
|
|
|
|
|
|
|
+ private static final Log logger = LogFactory.getLog(BuildApplyBillOpPlugin.class);
|
|
|
/**
|
|
/**
|
|
|
* 员工待定调薪清单 员工ID
|
|
* 员工待定调薪清单 员工ID
|
|
|
*/
|
|
*/
|
|
@@ -101,19 +105,53 @@ public class BuildApplyBillOpPlugin extends AbstractOperationServicePlugIn imple
|
|
|
applyBillEntry.put("employee", employeeId);
|
|
applyBillEntry.put("employee", employeeId);
|
|
|
applyBillEntry.put("standarditem", 2321899710350111744L); //定调薪项目 岗位工资标准
|
|
applyBillEntry.put("standarditem", 2321899710350111744L); //定调薪项目 岗位工资标准
|
|
|
applyBillEntry.put("frequency", 1095454108284088320L); //频度 月
|
|
applyBillEntry.put("frequency", 1095454108284088320L); //频度 月
|
|
|
- applyBillEntry.put("amount", BigDecimal.ZERO);
|
|
|
|
|
|
|
+ //applyBillEntry.put("amount", BigDecimal.ZERO);
|
|
|
applyBillEntry.put("nckd_postgrade", salaryfile.getLong("position.nckd_postgrade.id")); //岗级
|
|
applyBillEntry.put("nckd_postgrade", salaryfile.getLong("position.nckd_postgrade.id")); //岗级
|
|
|
applyBillEntry.put("position", positionId);
|
|
applyBillEntry.put("position", positionId);
|
|
|
- applyBillEntry.put("salaryrank", data.getLong("nckd_newsalaryrank.id"));
|
|
|
|
|
|
|
+ //applyBillEntry.put("salaryrank", data.getLong("nckd_newsalaryrank.id"));
|
|
|
applyBillEntryData.add(applyBillEntry);
|
|
applyBillEntryData.add(applyBillEntry);
|
|
|
}
|
|
}
|
|
|
applyBill.put("applybillent", applyBillEntryData);
|
|
applyBill.put("applybillent", applyBillEntryData);
|
|
|
applyBillData.add(applyBill);
|
|
applyBillData.add(applyBill);
|
|
|
papams.put("data", applyBillData);
|
|
papams.put("data", applyBillData);
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
|
|
Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
|
|
|
System.out.println("BuildApplyBillOpPlugin:"+result.toString());
|
|
System.out.println("BuildApplyBillOpPlugin:"+result.toString());
|
|
|
- ///返回界面的数据
|
|
|
|
|
- //this.operationResult.setCustomData(result);
|
|
|
|
|
|
|
+ // 判断整体操作是否成功
|
|
|
|
|
+ Boolean overallSuccess = (Boolean) result.get("success");
|
|
|
|
|
+ String errorCode = (String) result.get("errorCode");
|
|
|
|
|
+ String errorMessage = (String) result.get("message");
|
|
|
|
|
+
|
|
|
|
|
+ if (overallSuccess != null && overallSuccess && "success".equals(errorCode)) {
|
|
|
|
|
+ // 提取数据部分
|
|
|
|
|
+ List<Map<String, Object>> dataList = (List<Map<String, Object>>) result.get("data");
|
|
|
|
|
+
|
|
|
|
|
+ if (dataList != null && !dataList.isEmpty()) {
|
|
|
|
|
+ Map<String, Object> dataMap = dataList.get(0);
|
|
|
|
|
+ // 安全地提取 id 值
|
|
|
|
|
+ Long idValue = ((Number) dataMap.get("id")).longValue();
|
|
|
|
|
+ System.out.println("提取的ID值为: " + idValue); // 输出 2360318043084569600
|
|
|
|
|
+ logger.info("员工待定调薪清单 操作成功," + idValue);
|
|
|
|
|
+ params.put("applyID",idValue.toString());
|
|
|
|
|
+ //区别:绿色提示语显示时间较短。红色一直存在。
|
|
|
|
|
+ this.operationResult.setSuccess(true);
|
|
|
|
|
+ ///返回界面的数据
|
|
|
|
|
+ this.operationResult.setCustomData(params);
|
|
|
|
|
+ // TODO: 可以在这里使用提取到的 idValue 进行后续操作
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //区别:绿色提示语显示时间较短。红色一直存在。
|
|
|
|
|
+ this.operationResult.setSuccess(false);
|
|
|
|
|
+ //异常提示语
|
|
|
|
|
+ this.operationResult.setMessage("操作失败," + errorMessage);
|
|
|
|
|
+ logger.info("员工待定调薪清单 操作失败," + errorMessage);
|
|
|
|
|
+ //显示结果
|
|
|
|
|
+ this.operationResult.setShowMessage(true);
|
|
|
|
|
+ System.out.println("操作失败或返回错误码不为success");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//OperationResult updatepersonOp = OperationServiceHelper.executeOperate("updatepersoninfo_and_match", "", new DynamicObject[]{change}, OperateOption.create());
|
|
//OperationResult updatepersonOp = OperationServiceHelper.executeOperate("updatepersoninfo_and_match", "", new DynamicObject[]{change}, OperateOption.create());
|
|
|
|
|
|