Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
8559696cf1
|
@ -1,14 +1,22 @@
|
|||
package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.bill.BillShowParameter;
|
||||
import kd.bos.bill.OperationStatus;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.LocaleString;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.form.events.PreOpenFormEventArgs;
|
||||
import kd.bos.form.events.SetFilterEvent;
|
||||
import kd.bos.form.operate.FormOperate;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.list.plugin.AbstractListPlugin;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.QueryServiceHelper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
|
@ -17,6 +25,8 @@ import java.util.EventObject;
|
|||
*/
|
||||
public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn {
|
||||
|
||||
private static boolean editTitle = false;
|
||||
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
|
||||
|
@ -25,8 +35,46 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn {
|
|||
boolean isec1 = (boolean)isecObj;
|
||||
IDataModel model = this.getModel();
|
||||
model.setValue("zcgj_isec", isec1);
|
||||
editTitle = isec1;
|
||||
this.getView().updateView("zcgj_isec");
|
||||
if(isec1){
|
||||
this.getView().setFormTitle(new LocaleString("无合同付款申请单"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBindData(EventObject e) {
|
||||
super.afterBindData(e);
|
||||
boolean isec=(boolean)this.getModel().getValue("zcgj_isec");
|
||||
if(isec){
|
||||
this.getView().setFormTitle(new LocaleString("无合同付款申请单"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preOpenForm(PreOpenFormEventArgs e) {
|
||||
super.preOpenForm(e);
|
||||
/* OperationStatus status = e.getFormShowParameter().getStatus();
|
||||
if (!status.equals(OperationStatus.ADDNEW)) {
|
||||
Object pkId = ((BillShowParameter)e.getSource()).getPkId();
|
||||
if (pkId == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String formId = e.getFormShowParameter().getFormId();
|
||||
DynamicObject upLookBill = QueryServiceHelper.queryOne(formId, "zcgj_isec", new QFilter[]{new QFilter("id", "=", pkId)});
|
||||
boolean isec = upLookBill.getBoolean("zcgj_isec");
|
||||
if (isec) {
|
||||
BillShowParameter billShowParameter = (BillShowParameter)e.getFormShowParameter();
|
||||
billShowParameter.setCaption(ResManager.loadKDString("无合同付款申请单", "PublicReimAssetBillEdit_1", "fi-er-formplugin", new Object[0]));
|
||||
}
|
||||
} catch (Exception var8) {
|
||||
//logger.error("没有找到相应的对公报销单,其pk为:" + pkId);
|
||||
}
|
||||
}if(editTitle){
|
||||
BillShowParameter billShowParameter = (BillShowParameter)e.getFormShowParameter();
|
||||
billShowParameter.setCaption(ResManager.loadKDString("无合同付款申请单", "PublicReimAssetBillEdit_1", "fi-er-formplugin", new Object[0]));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
package zcgj.zcdev.zcdev.fs.plugin.operate;
|
||||
|
||||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.ExtendedDataEntity;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 无合同付款申请单(对公报销单)合同必录校验
|
||||
*/
|
||||
public class PublicBillContractCkOp extends AbstractOperationServicePlugIn {
|
||||
|
||||
@Override
|
||||
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||
super.onPreparePropertys(e);
|
||||
e.getFieldKeys().add("costcompany");
|
||||
e.getFieldKeys().add("zcgj_isec");
|
||||
e.getFieldKeys().add("zcgj_invoiceremark");//特殊说明
|
||||
e.getFieldKeys().add("zcgj_nocontract");//合同付款类型 无合同付款 NOCONTRACT , 合同付款 CONTRACT
|
||||
e.getFieldKeys().add("contractentry");//关联合同
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||
super.onAddValidators(e);
|
||||
e.getValidators().add(new ValidatorExt());
|
||||
}
|
||||
|
||||
class ValidatorExt extends AbstractValidator {
|
||||
@Override
|
||||
public void validate() {
|
||||
ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
|
||||
|
||||
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
|
||||
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
||||
Object costcompanyObj = dataEntity.get("costcompany");
|
||||
Object costdeptObj = dataEntity.get("costdept");
|
||||
if(costcompanyObj!=null && costdeptObj != null){
|
||||
DynamicObject costcompany = (DynamicObject)costcompanyObj;
|
||||
long costcompanyId = costcompany.getLong("id");
|
||||
if(OrgCheckUtils.isKS(costcompanyId)){
|
||||
boolean isec = dataEntity.getBoolean("zcgj_isec");
|
||||
if(isec){
|
||||
String nocontract = dataEntity.getString("zcgj_nocontract");
|
||||
if("CONTRACT".equals(nocontract)){ //如果是合同付款
|
||||
DynamicObjectCollection contractentry = dataEntity.getDynamicObjectCollection("contractentry");
|
||||
String invoiceremark = dataEntity.getString("zcgj_invoiceremark");
|
||||
if((contractentry == null || contractentry.isEmpty()) && StringUtils.isEmpty(invoiceremark)){
|
||||
this.addFatalErrorMessage(extendedDataEntity, String.format("合同付款类型为合同付款时,关联合同分录不能为空或填写特殊说明!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -82,7 +82,7 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
|
|||
DynamicObject[] load = BusinessDataServiceHelper.load("zcgj_ec_fundingplanapply",
|
||||
"zcgj_period," +
|
||||
"zcgj_infundproject_entry.zcgj_in_fundproject,zcgj_infundproject_entry.zcgj_in_custom,zcgj_infundproject_entry.zcgj_iinitialreceivable " +
|
||||
",zcgj_infundproject_entry.zcgj_expectedmonetarycap,zcgj_infundproject_entry.zcgj_expectedmonetaryfund,zcgj_infundproject_entry.zcgj_otheramount,zcgj_infundproject_entry.zcgj_expectedreceivableba "+
|
||||
",zcgj_infundproject_entry.zcgj_expectedmonetarycap,zcgj_infundproject_entry.zcgj_expectedmonetaryfund,zcgj_infundproject_entry.zcgj_otheramount,zcgj_infundproject_entry.zcgj_expectedreceivableba,zcgj_infundproject_entry.zcgj_plannedoutputvalue "+
|
||||
",zcgj_outfundproject_entry.zcgj_out_fundproject,zcgj_outfundproject_entry.zcgj_out_supplier,zcgj_outfundproject_entry.zcgj_openingpayable" +
|
||||
",createtime",
|
||||
searchFilterList.toArray(new QFilter[]{}), "createtime desc");
|
||||
|
|
Loading…
Reference in New Issue