Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
afa4d081e0
|
@ -0,0 +1,66 @@
|
||||||
|
package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.form.FormShowParameter;
|
||||||
|
import kd.bos.form.ShowType;
|
||||||
|
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||||
|
import kd.bos.form.control.events.ItemClickEvent;
|
||||||
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||||
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||||
|
import kd.bos.form.events.SetFilterEvent;
|
||||||
|
import kd.bos.form.operate.FormOperate;
|
||||||
|
import kd.bos.list.ListShowParameter;
|
||||||
|
import kd.bos.list.events.BeforeShowBillFormEvent;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
import kd.bos.mvc.list.ListView;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对公报销单无合同列表插件
|
||||||
|
*/
|
||||||
|
public class PublicreimbursebillNoContractListPlugin extends AbstractListPlugin {
|
||||||
|
|
||||||
|
private static String current_opkey = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setFilter(SetFilterEvent e) {
|
||||||
|
ListShowParameter param = (ListShowParameter) this.getView().getFormShowParameter();
|
||||||
|
String isec = param.getCustomParam("isec");
|
||||||
|
if (isec!=null) {
|
||||||
|
if(isec.equals("true")) {
|
||||||
|
this.getView().setVisible(false, "tblnew");
|
||||||
|
}
|
||||||
|
e.addCustomQFilter(new QFilter("zcgj_isec", "=", Boolean.valueOf(isec)));
|
||||||
|
}else{
|
||||||
|
e.addCustomQFilter(new QFilter("zcgj_isec", "=", false));
|
||||||
|
this.getView().setVisible(false, "zcgj_newecbill");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeShowBill(BeforeShowBillFormEvent e) {
|
||||||
|
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||||
|
if(null!=formShowParameter && current_opkey.equals("zcgj_newecbill")){
|
||||||
|
Map<String, Object> customParams =formShowParameter.getCustomParams();
|
||||||
|
if(null!=customParams){
|
||||||
|
customParams.put("isec",true);
|
||||||
|
e.getParameter().setCustomParams(customParams);
|
||||||
|
}
|
||||||
|
current_opkey ="";
|
||||||
|
}
|
||||||
|
super.beforeShowBill(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||||
|
String itemKey = evt.getItemKey();
|
||||||
|
if("zcgj_newecbill".equals(itemKey)) {
|
||||||
|
System.out.println();
|
||||||
|
current_opkey = "zcgj_newecbill";
|
||||||
|
}
|
||||||
|
super.beforeItemClick(evt);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对公报销单无合同列表插件
|
||||||
|
*/
|
||||||
|
public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn {
|
||||||
|
|
||||||
|
private static boolean editTitle = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCreateNewData(EventObject e) {
|
||||||
|
|
||||||
|
Object isecObj = this.getView().getFormShowParameter().getCustomParam("isec");
|
||||||
|
if(null!=isecObj){
|
||||||
|
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,119 @@
|
||||||
|
package zcgj.zcdev.zcdev.fs.plugin.operate;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.entity.ExtendedDataEntity;
|
||||||
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||||
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.entity.validate.AbstractValidator;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借款单提交操作插件
|
||||||
|
* 说明:校验备用金类型中的借款金额是否满足对应备用金类型的条件
|
||||||
|
*/
|
||||||
|
public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn {
|
||||||
|
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||||
|
super.onPreparePropertys(e);
|
||||||
|
e.getFieldKeys().add("costcompany");//核算组织(费用承担公司)
|
||||||
|
e.getFieldKeys().add("zcgj_impresttype");//备用金类型
|
||||||
|
e.getFieldKeys().add("loanamount");//借款金额合计
|
||||||
|
e.getFieldKeys().add("applier");//申请人
|
||||||
|
e.getFieldKeys().add("bizdate");//申请日期
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||||
|
super.onAddValidators(e);
|
||||||
|
e.getValidators().add(new ValidatorExt());
|
||||||
|
}
|
||||||
|
|
||||||
|
class ValidatorExt extends AbstractValidator {
|
||||||
|
@Override
|
||||||
|
public void validate() {
|
||||||
|
ExtendedDataEntity[] dataEntities = this.getDataEntities();
|
||||||
|
for (ExtendedDataEntity dataEnt : dataEntities) {
|
||||||
|
DynamicObject er_dailyLoanBill = dataEnt.getDataEntity();
|
||||||
|
DynamicObject companyObj = (DynamicObject) er_dailyLoanBill.get("costcompany");//核算组织(费用承担公司)
|
||||||
|
if (companyObj != null) {
|
||||||
|
Long companyId = companyObj.getLong("id");
|
||||||
|
if (OrgCheckUtils.isKS(companyId)) {
|
||||||
|
String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型
|
||||||
|
DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人
|
||||||
|
Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期
|
||||||
|
LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
|
String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份
|
||||||
|
if (impRestType != null && !"".equals(impRestType)) {
|
||||||
|
if (impRestType.equals("0")) {
|
||||||
|
//定额备用金
|
||||||
|
BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计
|
||||||
|
|
||||||
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员
|
||||||
|
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份
|
||||||
|
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger",
|
||||||
|
new QFilter[]{filter});//定额备用金初始台账
|
||||||
|
if (quotaImprestLedger == null) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您未在定额备用金初始化台账里!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录
|
||||||
|
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||||
|
DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员
|
||||||
|
if (person.getPkValue().equals(applier.getPkValue())) {
|
||||||
|
BigDecimal zcgj_remainingquota = entryEntity.getBigDecimal("zcgj_remainingquota");//剩余额度
|
||||||
|
if (zcgj_remainingquota.compareTo(loanAmount) < 0) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "借款金额超过剩余额度!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (impRestType.equals("1")) {
|
||||||
|
//临时备用金
|
||||||
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员
|
||||||
|
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份
|
||||||
|
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger",
|
||||||
|
"id", new QFilter[]{filter});//定额备用金初始台账
|
||||||
|
if (quotaImprestLedger != null) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您在定额备用金初始化台账里,所以不能使用临时备用金!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QFilter filter1 = new QFilter("balanceamount", QCP.not_equals, 0);
|
||||||
|
DynamicObject er_dailyLoanBill1 = BusinessDataServiceHelper.loadSingle("er_dailyloanbill",
|
||||||
|
"id", new QFilter[]{filter1});//定额备用金初始台账
|
||||||
|
if (er_dailyLoanBill1 != null){
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您存在未还完的借款!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (impRestType.equals("2")) {
|
||||||
|
//项目筹备备用金
|
||||||
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员
|
||||||
|
filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用
|
||||||
|
filter.and(new QFilter("zcgj_entryentity.zcgj_company", QCP.equals, companyId));// 公司
|
||||||
|
DynamicObject projectReserveFund = BusinessDataServiceHelper.loadSingle("zcgj_projectreservefund",
|
||||||
|
"id", new QFilter[]{filter});//项目筹备备用金公司
|
||||||
|
if (projectReserveFund == null) {
|
||||||
|
this.addFatalErrorMessage(dataEnt, "您未在项目筹备备用金公司里,所以不能使用项目筹备备用金!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
package zcgj.zcdev.zcdev.fs.plugin.operate;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借款单提交撤销和反审核操作插件
|
||||||
|
* 说明:将对应备用金类型中的借款金额反写至对应基础资料中
|
||||||
|
*/
|
||||||
|
public class LoanSlipReserveFundReverserOp extends AbstractOperationServicePlugIn {
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
|
||||||
|
String operationKey = e.getOperationKey();//操作标识
|
||||||
|
OperationResult operationResult = getOperationResult();
|
||||||
|
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||||
|
List<DynamicObject> modifiedEntities = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Object model : successPkIds) {
|
||||||
|
long id = (long) model;
|
||||||
|
QFilter f1 = new QFilter("id", "=", id);
|
||||||
|
DynamicObject er_dailyLoanBill = BusinessDataServiceHelper.loadSingle("er_dailyloanbill", new QFilter[]{f1});//借款单
|
||||||
|
DynamicObject companyObj = (DynamicObject) er_dailyLoanBill.get("costcompany");//核算组织(费用承担公司)
|
||||||
|
if (companyObj != null) {
|
||||||
|
Long companyId = companyObj.getLong("id");
|
||||||
|
if (OrgCheckUtils.isKS(companyId)) {
|
||||||
|
String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型
|
||||||
|
if (impRestType != null && !"".equals(impRestType)) {
|
||||||
|
if (impRestType.equals("0")) {
|
||||||
|
//定额备用金
|
||||||
|
DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人
|
||||||
|
Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期
|
||||||
|
BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计
|
||||||
|
LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
|
String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份
|
||||||
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());
|
||||||
|
filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));
|
||||||
|
DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", new QFilter[]{filter});//定额备用金初始台账
|
||||||
|
DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录
|
||||||
|
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||||
|
DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员
|
||||||
|
if (person.getPkValue().equals(applier.getPkValue())) {
|
||||||
|
if (operationKey.equals("submit")) {
|
||||||
|
//提交
|
||||||
|
BigDecimal zcgj_usedquota = entryEntity.getBigDecimal("zcgj_usedquota").add(loanAmount);//已使用+借款金额
|
||||||
|
entryEntity.set("zcgj_usedquota", zcgj_usedquota);//已使用
|
||||||
|
BigDecimal zcgj_quota = entryEntity.getBigDecimal("zcgj_quota");//额度
|
||||||
|
BigDecimal zcgj_remainingquota = zcgj_quota.subtract(entryEntity.getBigDecimal("zcgj_usedquota"));//额度-已使用
|
||||||
|
entryEntity.set("zcgj_remainingquota", zcgj_remainingquota);//剩余额度
|
||||||
|
} else if (operationKey.equals("unsubmit") || operationKey.equals("unaudit")) {
|
||||||
|
//撤销、反审核
|
||||||
|
BigDecimal zcgj_usedquota = entryEntity.getBigDecimal("zcgj_usedquota").subtract(er_dailyLoanBill.getBigDecimal("loanamount"));//已使用+借款金额
|
||||||
|
entryEntity.set("zcgj_usedquota", zcgj_usedquota);//已使用
|
||||||
|
BigDecimal zcgj_remainingquota = entryEntity.getBigDecimal("zcgj_quota").add(entryEntity.getBigDecimal("zcgj_usedquota"));//额度-已使用
|
||||||
|
entryEntity.set("zcgj_remainingquota", zcgj_remainingquota);//剩余额度
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modifiedEntities.add(quotaImprestLedger);
|
||||||
|
}/* else if (impRestType.equals("1")) {
|
||||||
|
//临时备用金
|
||||||
|
} else if (impRestType.equals("2")) {
|
||||||
|
//项目筹备备用金
|
||||||
|
}*/
|
||||||
|
if (!modifiedEntities.isEmpty()) {
|
||||||
|
try {
|
||||||
|
SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0]));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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",
|
DynamicObject[] load = BusinessDataServiceHelper.load("zcgj_ec_fundingplanapply",
|
||||||
"zcgj_period," +
|
"zcgj_period," +
|
||||||
"zcgj_infundproject_entry.zcgj_in_fundproject,zcgj_infundproject_entry.zcgj_in_custom,zcgj_infundproject_entry.zcgj_iinitialreceivable " +
|
"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" +
|
",zcgj_outfundproject_entry.zcgj_out_fundproject,zcgj_outfundproject_entry.zcgj_out_supplier,zcgj_outfundproject_entry.zcgj_openingpayable" +
|
||||||
",createtime",
|
",createtime",
|
||||||
searchFilterList.toArray(new QFilter[]{}), "createtime desc");
|
searchFilterList.toArray(new QFilter[]{}), "createtime desc");
|
||||||
|
|
|
@ -40,6 +40,10 @@ public class OutContractFinaceConfirmeCkOp extends AbstractOperationServicePlugI
|
||||||
for (DynamicObject dynamicObject : expenseitementry) {
|
for (DynamicObject dynamicObject : expenseitementry) {
|
||||||
i++;
|
i++;
|
||||||
DynamicObject zcgjAccounttype = dynamicObject.getDynamicObject("zcgj_accounttype");
|
DynamicObject zcgjAccounttype = dynamicObject.getDynamicObject("zcgj_accounttype");
|
||||||
|
if(zcgjAccounttype == null){
|
||||||
|
this.addFatalErrorMessage(extendedDataEntity, String.format("费用项目分录,第%d行科目分类不能为空!",i));
|
||||||
|
return;
|
||||||
|
}
|
||||||
String number = zcgjAccounttype.getString("number");
|
String number = zcgjAccounttype.getString("number");
|
||||||
DynamicObject cbs = dynamicObject.getDynamicObject("zcgj_cbs");
|
DynamicObject cbs = dynamicObject.getDynamicObject("zcgj_cbs");
|
||||||
if(StringUtils.equals(number, "FL001") && cbs == null){ //生成成本时,工序必录
|
if(StringUtils.equals(number, "FL001") && cbs == null){ //生成成本时,工序必录
|
||||||
|
|
Loading…
Reference in New Issue