|
@@ -2,6 +2,8 @@ package nckd.jxccl.hr.tsc.plugin.form;
|
|
|
|
|
|
|
|
import kd.bos.bill.OperationStatus;
|
|
import kd.bos.bill.OperationStatus;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
|
+import kd.bos.entity.operate.result.OperationResult;
|
|
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
import kd.bos.form.operate.FormOperate;
|
|
import kd.bos.form.operate.FormOperate;
|
|
|
import kd.bos.servicehelper.user.UserServiceHelper;
|
|
import kd.bos.servicehelper.user.UserServiceHelper;
|
|
@@ -10,7 +12,6 @@ import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
import nckd.jxccl.base.swc.helper.SWCHelper;
|
|
import nckd.jxccl.base.swc.helper.SWCHelper;
|
|
|
-
|
|
|
|
|
import java.util.EventObject;
|
|
import java.util.EventObject;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -53,33 +54,24 @@ public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
|
|
|
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs args) {
|
|
|
|
|
+ ///如果有合法检验,需要有判断是否操作成功!
|
|
|
|
|
+ OperationResult operationResult = args.getOperationResult();
|
|
|
|
|
+ if (operationResult != null && !operationResult.isSuccess()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
FormOperate source = (FormOperate)args.getSource();
|
|
FormOperate source = (FormOperate)args.getSource();
|
|
|
String formOp = source.getOperateKey();
|
|
String formOp = source.getOperateKey();
|
|
|
DynamicObject data = this.getModel().getDataEntity(true);
|
|
DynamicObject data = this.getModel().getDataEntity(true);
|
|
|
String billstatus = data.getString("nckd_billstatus");
|
|
String billstatus = data.getString("nckd_billstatus");
|
|
|
HRBaseServiceHelper hrBaseServiceHelper = new HRBaseServiceHelper(FormConstant.NCKD_ANNOUNCEMENTS);
|
|
HRBaseServiceHelper hrBaseServiceHelper = new HRBaseServiceHelper(FormConstant.NCKD_ANNOUNCEMENTS);
|
|
|
if ("publish".equals(formOp)) {
|
|
if ("publish".equals(formOp)) {
|
|
|
-
|
|
|
|
|
- if("C".equals(billstatus) ){
|
|
|
|
|
- args.setCancel(true);
|
|
|
|
|
- this.getView().showTipNotification("已经发布,不能操作!");
|
|
|
|
|
- }
|
|
|
|
|
- if("D".equals(billstatus)){
|
|
|
|
|
- args.setCancel(true);
|
|
|
|
|
- this.getView().showTipNotification("已经下架,不能操作!");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
data.set("nckd_billstatus", "C");
|
|
data.set("nckd_billstatus", "C");
|
|
|
data.set("nckd_publishdate", new java.util.Date());
|
|
data.set("nckd_publishdate", new java.util.Date());
|
|
|
data.set("nckd_publishuser", UserServiceHelper.getCurrentUserId());
|
|
data.set("nckd_publishuser", UserServiceHelper.getCurrentUserId());
|
|
|
Object billPk = hrBaseServiceHelper.saveOne(data);
|
|
Object billPk = hrBaseServiceHelper.saveOne(data);
|
|
|
}
|
|
}
|
|
|
if("withdraw".equals(formOp)){
|
|
if("withdraw".equals(formOp)){
|
|
|
- if("A".equals(billstatus) || "C".equals(billstatus)){
|
|
|
|
|
- args.setCancel(true);
|
|
|
|
|
- this.getView().showTipNotification("不是已下架状态,不能操作!");
|
|
|
|
|
- }
|
|
|
|
|
data.set("nckd_billstatus", "A");
|
|
data.set("nckd_billstatus", "A");
|
|
|
Object billPk = hrBaseServiceHelper.saveOne(data);
|
|
Object billPk = hrBaseServiceHelper.saveOne(data);
|
|
|
}
|
|
}
|