设备成本核算自动取数逻辑调整
This commit is contained in:
parent
ad4ca8b63e
commit
beefa099a9
|
|
@ -12,6 +12,8 @@ import kd.bos.form.MessageBoxOptions;
|
|||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.control.events.BeforeClickEvent;
|
||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||
import kd.bos.form.operate.FormOperate;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
|
|
@ -44,9 +46,11 @@ public class EquipmentCostAutoGetDataFormPlugin extends AbstractBillPlugIn {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||
//工具栏上的所有按钮的点击都会激活itemClick和beforeItemClick方法, 需 //要开发人员实现不同按钮的逻辑
|
||||
if (evt.getItemKey().equals("autosplit")) {
|
||||
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
||||
super.beforeDoOperation(args);
|
||||
FormOperate operate = (FormOperate) args.getSource();
|
||||
String opKey = operate.getOperateKey();
|
||||
if (opKey.equals("autosplit")) {
|
||||
Long currentUserId = UserServiceHelper.getCurrentUserId();
|
||||
|
||||
// this.getView().showMessage("自动取数 beforeItemClick");
|
||||
|
|
@ -64,7 +68,7 @@ public class EquipmentCostAutoGetDataFormPlugin extends AbstractBillPlugIn {
|
|||
DynamicObject[] loadsettle = BusinessDataServiceHelper.load("eceq_settle", "",
|
||||
new QFilter[]{new QFilter("org", "=", org.getLong("id"))
|
||||
, new QFilter("period", "=", splitperiod.getLong("id")),
|
||||
new QFilter("billstatus", "=", "C").or(new QFilter("billstatus", "=", "B"))});
|
||||
new QFilter("billstatus", "=", "C").or(new QFilter("billstatus", "=", "B"))});
|
||||
if(loadsettle.length == 0){
|
||||
//eceq_settle
|
||||
DynamicObject eceqsettle =BusinessDataServiceHelper.newDynamicObject("eceq_settle");//设备费用结算
|
||||
|
|
@ -79,7 +83,7 @@ public class EquipmentCostAutoGetDataFormPlugin extends AbstractBillPlugIn {
|
|||
eceqsettle.set("enddate",monthStartAndEnd.get("end"));
|
||||
eceqsettle.set("creator",currentUserId);
|
||||
eceqsettle.set("billname",org.getString("name")+"设备结算");
|
||||
eceqsettle.set("billstatus","A");
|
||||
eceqsettle.set("billstatus","C");
|
||||
int i=0;
|
||||
DynamicObjectCollection entryentity = eceqsettle.getDynamicObjectCollection("entryentity");//设备结算分录
|
||||
BigDecimal allAmount = BigDecimal.ZERO;
|
||||
|
|
@ -110,25 +114,17 @@ public class EquipmentCostAutoGetDataFormPlugin extends AbstractBillPlugIn {
|
|||
|
||||
if(i>0){
|
||||
SaveServiceHelper.saveOperate("eceq_settle", new DynamicObject[]{eceqsettle}, null);//设备结算
|
||||
OperateOption option= OperateOption.create();
|
||||
OperationResult resultsubmit = OperationServiceHelper.executeOperate("submit", "eceq_settle", new DynamicObject[]{eceqsettle}, option);
|
||||
//OperateOption option= OperateOption.create();
|
||||
//OperationResult resultsubmit = OperationServiceHelper.executeOperate("submit", "eceq_settle", new DynamicObject[]{eceqsettle}, option);
|
||||
//OperationResult resultaudit = OperationServiceHelper.executeOperate("audit", "eceq_settle", new DynamicObject[]{eceqsettle}, option);
|
||||
|
||||
}else{
|
||||
//this.getView().showMessage("无设备结算生成!");
|
||||
}
|
||||
this.getView().showLoading(new LocaleString("拉取数据中,请稍后!"), 5000);
|
||||
// this.getView().showMessage("拉取数据中,请稍后!");
|
||||
this.getView().showLoading(new LocaleString("拉取数据中,请稍后!"), 2000);
|
||||
// this.getView().showMessage("拉取数据中,请稍后!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
super.beforeItemClick(evt);
|
||||
/*try {
|
||||
Thread.sleep(5000);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue