|
@@ -4,6 +4,8 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
|
|
|
+import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
|
|
|
+import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
|
import kd.bos.exception.KDBizException;
|
|
import kd.bos.exception.KDBizException;
|
|
import kd.bos.logging.Log;
|
|
import kd.bos.logging.Log;
|
|
import kd.bos.logging.LogFactory;
|
|
import kd.bos.logging.LogFactory;
|
|
@@ -26,20 +28,25 @@ public class AdjustJobBillEffectOp extends AbstractOperationServicePlugIn implem
|
|
private static DecAdjInfoServiceHelper helper = new DecAdjInfoServiceHelper();
|
|
private static DecAdjInfoServiceHelper helper = new DecAdjInfoServiceHelper();
|
|
private static final Log log = LogFactory.getLog(AdjustJobBillEffectOp.class);
|
|
private static final Log log = LogFactory.getLog(AdjustJobBillEffectOp.class);
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void endOperationTransaction(EndOperationTransactionArgs e) {
|
|
|
|
+ super.endOperationTransaction(e);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
super.afterExecuteOperationTransaction(e);
|
|
super.afterExecuteOperationTransaction(e);
|
|
- 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();
|
|
DynamicObject[] bills = e.getDataEntities();
|
|
for (DynamicObject bill : bills) {
|
|
for (DynamicObject bill : bills) {
|
|
|
|
+ bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(), bill.getDataEntityType().getName());
|
|
DynamicObjectCollection entryCols = bill.getDynamicObjectCollection("nckd_entryentity");
|
|
DynamicObjectCollection entryCols = bill.getDynamicObjectCollection("nckd_entryentity");
|
|
if(entryCols.size() > 0) {
|
|
if(entryCols.size() > 0) {
|
|
-
|
|
|
|
|
|
+ int index = 1;
|
|
|
|
+ int successCount = 0;
|
|
for(DynamicObject entry : entryCols) {
|
|
for(DynamicObject entry : entryCols) {
|
|
|
|
+ if(entry.getString("nckd_salsyncstatus").equals("1"))
|
|
|
|
+ continue;
|
|
//定调薪信息
|
|
//定调薪信息
|
|
Long adjRecordId = entry.getLong("nckd_adjrecord.id");
|
|
Long adjRecordId = entry.getLong("nckd_adjrecord.id");
|
|
DynamicObject adjRecord = BusinessDataServiceHelper.loadSingle(adjRecordId, "hcdm_salaryadjrecord");
|
|
DynamicObject adjRecord = BusinessDataServiceHelper.loadSingle(adjRecordId, "hcdm_salaryadjrecord");
|
|
@@ -52,15 +59,34 @@ public class AdjustJobBillEffectOp extends AbstractOperationServicePlugIn implem
|
|
List<Map<String, Object>> list = buildContent(bill, entry, adjRecord, relPerson);
|
|
List<Map<String, Object>> list = buildContent(bill, entry, adjRecord, relPerson);
|
|
Map<String, Object> returnMap = helper.saveDecAdjRecord(list);
|
|
Map<String, Object> returnMap = helper.saveDecAdjRecord(list);
|
|
if(!Boolean.valueOf(returnMap.get("success").toString())) {
|
|
if(!Boolean.valueOf(returnMap.get("success").toString())) {
|
|
- entry.set("nckd_synclog", returnMap.get("msg").toString());
|
|
|
|
|
|
+ List dataList = (List) returnMap.get("data");
|
|
|
|
+ Map dataMap = (Map) dataList.get(0);
|
|
|
|
+ entry.set("nckd_synclog",dataMap.get("errormsg").toString());
|
|
|
|
+ //bill.set("billstatus", "B");
|
|
|
|
+ //SaveServiceHelper.save(new DynamicObject[]{bill});
|
|
|
|
+ //throw new KDBizException("第"+ index + "行同步定调薪信息出错:" + dataMap.get("errormsg").toString());
|
|
|
|
+ //
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ successCount++;
|
|
entry.set("nckd_salsyncstatus", "1");
|
|
entry.set("nckd_salsyncstatus", "1");
|
|
}
|
|
}
|
|
|
|
+ index++;
|
|
}
|
|
}
|
|
- SaveServiceHelper.save(bills);
|
|
|
|
|
|
+
|
|
|
|
+ if(successCount != entryCols.size()) {
|
|
|
|
+ bill.set("billstatus", "B");
|
|
|
|
+ SaveServiceHelper.save(new DynamicObject[]{bill});
|
|
|
|
+ throw new KDBizException("定调薪信息出错,请查看薪酬调整明细同步薪酬日志");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SaveServiceHelper.save(new DynamicObject[]{bill});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ ScheduleExecutor scheduleExecutor = new ScheduleExecutor();
|
|
|
|
+ scheduleExecutor.setJobCustomParams("5/BIP+ZNTT/6", new HashMap(4));
|
|
|
|
+ scheduleExecutor.dispatch("5/BIRZNR2F16", ScheduleExecutor.isSerialWithJobTask("5/BIP+ZNTT/6"));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|