bug修复

This commit is contained in:
xiaoshi 2025-06-20 14:34:35 +08:00
parent 6ee4e48246
commit 284ad9842a
3 changed files with 21 additions and 16 deletions

View File

@ -72,9 +72,11 @@ public class ContractPublicBillPlugin extends AbstractBillPlugIn implements Plug
String priceType = pricetype.toString(); String priceType = pricetype.toString();
if(priceType.equals("gddj")){ if(priceType.equals("gddj")){
this.getModel().setValue("isonlist", true); this.getModel().setValue("isonlist", true);
this.getView().setEnable(false,"isonlist");
((FieldEdit)this.getView().getControl("treeprice")).setMustInput(true); ((FieldEdit)this.getView().getControl("treeprice")).setMustInput(true);
}else { }else {
this.getModel().setValue("isonlist", false); this.getModel().setValue("isonlist", false);
this.getView().setEnable(true,"isonlist");
((FieldEdit)this.getView().getControl("treeprice")).setMustInput(true); ((FieldEdit)this.getView().getControl("treeprice")).setMustInput(true);
} }
} }

View File

@ -25,30 +25,31 @@ import java.util.*;
public class RenewalContractBillPlugin extends AbstractListPlugin { public class RenewalContractBillPlugin extends AbstractListPlugin {
@Override @Override
public void afterCopyData(EventObject e) { public void afterCopyData(EventObject e) {
//获取列表父界面缓存信息 //获取列表父界面缓存信息
Object srcBillNo2 = this.getView().getParentView().getPageCache().get("srcBillNo"); Object srcBillNo2 = this.getView().getParentView().getPageCache().get("srcBillNo");
if(srcBillNo2!=null){ if (srcBillNo2 != null) {
// this.getView().showMessage("源单编号:"+srcBillNo2); // this.getView().showMessage("源单编号:"+srcBillNo2);
// BillModel billModel = (BillModel) e.getSource(); // BillModel billModel = (BillModel) e.getSource();
DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,billname,zcgj_renewal,zcgj_isrenewal", new QFilter[]{new QFilter("billno", QCP.equals, srcBillNo2.toString())}); DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,billname,zcgj_renewal,zcgj_isrenewal", new QFilter[]{new QFilter("billno", QCP.equals, srcBillNo2.toString())});
this.getModel().setValue("id", null);//id this.getModel().setValue("id", null);//id
this.getModel().setValue("billno", null);//合同编码 this.getModel().setValue("billno", null);//合同编码
this.getModel().setValue("billname", contract.getString("billname")+"-续签");//合同名称 this.getModel().setValue("billname", contract.getString("billname") + "-续签");//合同名称
this.getModel().setValue("zcgj_startdate", null);//起始日期 this.getModel().setValue("zcgj_startdate", null);//起始日期
this.getModel().setValue("zcgj_enddate", null);//终止日期 this.getModel().setValue("zcgj_enddate", null);//终止日期
// DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,zcgj_renewal", new QFilter[]{new QFilter("billno", QCP.equals, billno)}); // DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,zcgj_renewal", new QFilter[]{new QFilter("billno", QCP.equals, billno)});
this.getModel().setValue("zcgj_renewal", contract);//续签主合同 this.getModel().setValue("zcgj_renewal", contract);//续签主合同
this.getModel().setValue("zcgj_isrenewal", true);//是否续签 this.getModel().setValue("zcgj_isrenewal", true);//是否续签
this.getModel().setValue("treelistentry",null);
this.getModel().setValue("sublistentry",null);
this.getView().getParentView().getPageCache().remove("srcBillNo");//读取后清理缓存 this.getView().getParentView().getPageCache().remove("srcBillNo");//读取后清理缓存
} }
} }
@Override @Override
public void registerListener(EventObject e) { public void registerListener(EventObject e) {
super.registerListener(e); super.registerListener(e);
@ -76,20 +77,20 @@ public class RenewalContractBillPlugin extends AbstractListPlugin {
DynamicObject receiveApplication = receiveApplications[0]; DynamicObject receiveApplication = receiveApplications[0];
String billno = receiveApplication.getString("billno"); String billno = receiveApplication.getString("billno");
QFilter qf = new QFilter("zcgj_renewal.billno", QCP.equals,billno); QFilter qf = new QFilter("zcgj_renewal.billno", QCP.equals, billno);
DynamicObject[] recontracts = BusinessDataServiceHelper.load("ec_in_contract", "id,billno,billname,zcgj_renewal", new QFilter[]{qf}); DynamicObject[] recontracts = BusinessDataServiceHelper.load("ec_in_contract", "id,billno,billname,zcgj_renewal", new QFilter[]{qf});
for (DynamicObject recontract : recontracts) { for (DynamicObject recontract : recontracts) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("type","ec_in_contract"); jsonObject.put("type", "ec_in_contract");
jsonObject.put("zcgj_billno",billno); jsonObject.put("zcgj_billno", billno);
jsonObject.put("zcgj_billname",receiveApplication.getString("billname")); jsonObject.put("zcgj_billname", receiveApplication.getString("billname"));
jsonObject.put("zcgj_renewalnum",recontract.getString("billno")); jsonObject.put("zcgj_renewalnum", recontract.getString("billno"));
jsonObject.put("zcgj_renewalname",recontract.getString("billname")); jsonObject.put("zcgj_renewalname", recontract.getString("billname"));
// objects.add( )); // objects.add( ));
// map.put(recontract.getLong("id"),recontract.getString("billno")); // map.put(recontract.getLong("id"),recontract.getString("billno"));
jsonArray.add(jsonObject); jsonArray.add(jsonObject);
} }
if (jsonArray.size()<1){ if (jsonArray.size() < 1) {
this.getView().showTipNotification("该合同暂无续签合同!"); this.getView().showTipNotification("该合同暂无续签合同!");
return; return;
} }
@ -127,13 +128,13 @@ public class RenewalContractBillPlugin extends AbstractListPlugin {
DynamicObject[] receiveApplications = BusinessDataServiceHelper.load("ec_in_contract", "billno,zcgj_renewal,zcgj_isrenewal,contstatus", new QFilter[]{new QFilter("id", "in", setIds)}); DynamicObject[] receiveApplications = BusinessDataServiceHelper.load("ec_in_contract", "billno,zcgj_renewal,zcgj_isrenewal,contstatus", new QFilter[]{new QFilter("id", "in", setIds)});
DynamicObject receiveApplication = receiveApplications[0]; DynamicObject receiveApplication = receiveApplications[0];
boolean isrenewal = receiveApplication.getBoolean("zcgj_isrenewal"); boolean isrenewal = receiveApplication.getBoolean("zcgj_isrenewal");
if (isrenewal){ if (isrenewal) {
this.getView().showTipNotification("续签合同不能进行续签!"); this.getView().showTipNotification("续签合同不能进行续签!");
evt.setCancel(true); evt.setCancel(true);
return; return;
} }
String contstatus = receiveApplication.getString("contstatus"); String contstatus = receiveApplication.getString("contstatus");
if (!contstatus.equals("01")){ if (!contstatus.equals("01")) {
this.getView().showTipNotification("收入合同需执行中才可进行续签!"); this.getView().showTipNotification("收入合同需执行中才可进行续签!");
evt.setCancel(true); evt.setCancel(true);
return; return;
@ -155,10 +156,10 @@ public class RenewalContractBillPlugin extends AbstractListPlugin {
super.beforeDoOperation(args); super.beforeDoOperation(args);
FormOperate operate = (FormOperate) args.getSource(); FormOperate operate = (FormOperate) args.getSource();
String operateNo = operate.getOperateKey(); String operateNo = operate.getOperateKey();
if(operateNo.equalsIgnoreCase("copy")){ if (operateNo.equalsIgnoreCase("copy")) {
ListSelectedRowCollection listSelectedData = args.getListSelectedData(); ListSelectedRowCollection listSelectedData = args.getListSelectedData();
String srcBillNo = listSelectedData.get(0).getBillNo(); String srcBillNo = listSelectedData.get(0).getBillNo();
this.getView().getPageCache().put("srcBillNo",srcBillNo); this.getView().getPageCache().put("srcBillNo", srcBillNo);
} }
} }

View File

@ -43,6 +43,8 @@ public class RenewalOutContractBillPlugin extends AbstractListPlugin {
// DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,zcgj_renewal", new QFilter[]{new QFilter("billno", QCP.equals, billno)}); // DynamicObject contract = BusinessDataServiceHelper.loadSingle("ec_out_contract", "id,billno,zcgj_renewal", new QFilter[]{new QFilter("billno", QCP.equals, billno)});
this.getModel().setValue("zcgj_renewal", contract);//续签主合同 this.getModel().setValue("zcgj_renewal", contract);//续签主合同
this.getModel().setValue("zcgj_isrenewal", true);//是否续签 this.getModel().setValue("zcgj_isrenewal", true);//是否续签
this.getModel().setValue("treelistentry",null);
this.getModel().setValue("sublistentry",null);
this.getView().getParentView().getPageCache().remove("srcBillNo");//读取后清理缓存 this.getView().getParentView().getPageCache().remove("srcBillNo");//读取后清理缓存
} }
} }