|
@@ -1,17 +1,17 @@
|
|
|
package nckd.jxccl.hr.tsc.plugin.form;
|
|
package nckd.jxccl.hr.tsc.plugin.form;
|
|
|
|
|
|
|
|
|
|
+import kd.bos.bill.OperationStatus;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
-import kd.bos.entity.datamodel.events.BizDataEventArgs;
|
|
|
|
|
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;
|
|
|
-
|
|
|
|
|
import kd.bos.base.AbstractBasePlugIn;
|
|
import kd.bos.base.AbstractBasePlugIn;
|
|
|
import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
|
|
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.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -22,12 +22,11 @@ import java.util.List;
|
|
|
@SuppressWarnings("unused")
|
|
@SuppressWarnings("unused")
|
|
|
public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugin {
|
|
public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugin {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void createNewData(BizDataEventArgs e) {
|
|
|
|
|
- super.createNewData(e);
|
|
|
|
|
|
|
+ public void afterCreateNewData(EventObject e) {
|
|
|
|
|
|
|
|
Long userId = UserServiceHelper.getCurrentUserId();
|
|
Long userId = UserServiceHelper.getCurrentUserId();
|
|
|
-
|
|
|
|
|
DynamicObject personUserDyn = SWCHelper.queryOne(FormConstant.HRPI_PERSONUSERREL, "employee.id","user",userId);
|
|
DynamicObject personUserDyn = SWCHelper.queryOne(FormConstant.HRPI_PERSONUSERREL, "employee.id","user",userId);
|
|
|
|
|
|
|
|
Long empId = 0L;
|
|
Long empId = 0L;
|
|
@@ -47,6 +46,8 @@ public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugi
|
|
|
if(empDyns != null && empDyns.length > 0){
|
|
if(empDyns != null && empDyns.length > 0){
|
|
|
Long companyId = empDyns[0].getLong("company.id");
|
|
Long companyId = empDyns[0].getLong("company.id");
|
|
|
this.getModel().setValue("nckd_hradminorg", companyId);
|
|
this.getModel().setValue("nckd_hradminorg", companyId);
|
|
|
|
|
+ this.getModel().setValue("nckd_billstatus", "A");
|
|
|
|
|
+ this.getModel().setValue("nckd_istop", false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -55,7 +56,7 @@ public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugi
|
|
|
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
|
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
|
|
FormOperate source = (FormOperate)args.getSource();
|
|
FormOperate source = (FormOperate)args.getSource();
|
|
|
String formOp = source.getOperateKey();
|
|
String formOp = source.getOperateKey();
|
|
|
- DynamicObject data = this.getModel().getDataEntity();
|
|
|
|
|
|
|
+ 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)) {
|
|
@@ -84,4 +85,31 @@ public class AnnouncementsBasePlugin extends AbstractBasePlugIn implements Plugi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void afterBindData(EventObject e) {
|
|
|
|
|
+ super.afterBindData(e);
|
|
|
|
|
+ DynamicObject data = this.getModel().getDataEntity(true);
|
|
|
|
|
+ setEnable(data);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setEnable(DynamicObject data) {
|
|
|
|
|
+ String billstatus = data.getString("nckd_billstatus");
|
|
|
|
|
+ if("A".equals(billstatus)){
|
|
|
|
|
+ this.getView().setStatus(OperationStatus.EDIT);
|
|
|
|
|
+ this.getView().setEnable(Boolean.TRUE, "nckd_downdate");
|
|
|
|
|
+ this.getView().setVisible(Boolean.TRUE, "bar_save");
|
|
|
|
|
+ this.getView().setVisible(Boolean.TRUE, "bar_modify");
|
|
|
|
|
+ this.getView().setVisible(Boolean.TRUE, "nckd_publish");
|
|
|
|
|
+ this.getView().setVisible(Boolean.FALSE, "nckd_withdrawn");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.getView().setStatus(OperationStatus.VIEW);
|
|
|
|
|
+ this.getView().setEnable(Boolean.FALSE, "nckd_downdate");
|
|
|
|
|
+ this.getView().setVisible(Boolean.FALSE, "bar_save");
|
|
|
|
|
+ this.getView().setVisible(Boolean.FALSE, "bar_delete");
|
|
|
|
|
+ this.getView().setVisible(Boolean.FALSE, "bar_modify");
|
|
|
|
|
+ this.getView().setVisible(Boolean.FALSE, "nckd_publish");
|
|
|
|
|
+ this.getView().setVisible(Boolean.TRUE, "nckd_withdrawn");
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|