###
- [x] 认领处理单收款类型选了退预付款,但是没有关联预付款单也能提交,需要增加限制不能提交 - [x] 关联预付款单的供应商默认带出来后不允许修改 - [x] 处理排程退单报错 - [x] 排程单据合并/解除(根据规则合并,日期为毫秒舍去后再参与规则比较) - [x] 认领单选员工还款时默认带出客户 --s
This commit is contained in:
parent
853e1b6143
commit
9b93abc680
|
|
@ -3,6 +3,7 @@ package shjh.jhzj7.fi.fi.plugin.form;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
import kd.bos.entity.datamodel.IDataModel;
|
import kd.bos.entity.datamodel.IDataModel;
|
||||||
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import kd.bos.form.CloseCallBack;
|
import kd.bos.form.CloseCallBack;
|
||||||
import kd.bos.form.FormShowParameter;
|
import kd.bos.form.FormShowParameter;
|
||||||
import kd.bos.form.ShowType;
|
import kd.bos.form.ShowType;
|
||||||
|
|
@ -236,4 +237,17 @@ public class ClaimBillButtonAssPlugin extends AbstractFormPlugin implements Plug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertyChanged(PropertyChangedArgs e) {
|
||||||
|
super.propertyChanged(e);
|
||||||
|
String name = e.getProperty().getName();
|
||||||
|
if ("recpaytype".equals(name)) {
|
||||||
|
DynamicObject value = (DynamicObject)this.getModel().getValue(name);
|
||||||
|
//员工还款时,付款人类型,客户
|
||||||
|
if (null != value && "109".equals(value.getString("number"))) {
|
||||||
|
this.getModel().setValue("paymenttype","bd_customer");
|
||||||
|
this.getView().updateView("paymenttype");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -137,7 +137,7 @@ public class ScheduleListPlugin extends AbstractListPlugin {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
String CompanyCode = "";
|
String CompanyCode = "";
|
||||||
String CompanyName = "";
|
String CompanyName = "";
|
||||||
DynamicObject openorg = bill.getDynamicObject("openorg");//核算组织
|
DynamicObject openorg = bill.getDynamicObject("company");//资金组织
|
||||||
if (null != openorg) {
|
if (null != openorg) {
|
||||||
CompanyCode = openorg.getString("number");
|
CompanyCode = openorg.getString("number");
|
||||||
CompanyName = openorg.getString("name");
|
CompanyName = openorg.getString("name");
|
||||||
|
|
@ -147,21 +147,21 @@ public class ScheduleListPlugin extends AbstractListPlugin {
|
||||||
jsonObject.put("BillHeaderID", bill.getString("shjh_fkbillid"));//费控单据头ID
|
jsonObject.put("BillHeaderID", bill.getString("shjh_fkbillid"));//费控单据头ID
|
||||||
jsonObject.put("DetailID", bill.getString("shjh_fkentryid"));//费控分录明细ID
|
jsonObject.put("DetailID", bill.getString("shjh_fkentryid"));//费控分录明细ID
|
||||||
String PaymentBank = "";
|
String PaymentBank = "";
|
||||||
DynamicObject payerbank = bill.getDynamicObject("payerbank");
|
DynamicObject acctbank = bill.getDynamicObject("acctbank");
|
||||||
if (null != payerbank) {
|
if (null != acctbank) {
|
||||||
PaymentBank = payerbank.getString("name");
|
PaymentBank = acctbank.getString("name");
|
||||||
}
|
}
|
||||||
jsonObject.put("PaymentBank", PaymentBank);//付款银行
|
jsonObject.put("PaymentBank", PaymentBank);//付款银行
|
||||||
//付款状态 (败笔退回:-5、取消付款:-20、付款失败:-10、部分付款失败:30、付款成功:20、部分付款成功:25、
|
//付款状态 (败笔退回:-5、取消付款:-20、付款失败:-10、部分付款失败:30、付款成功:20、部分付款成功:25、
|
||||||
// 处理中:15、待付款:10、未付款:0、未推送:-99、已修改:-100)
|
// 处理中:15、待付款:10、未付款:0、未推送:-99、已修改:-100)
|
||||||
jsonObject.put("PaymentStatus", "-5");
|
jsonObject.put("PaymentStatus", "-5");
|
||||||
String PaymentAccNum = "";
|
String PaymentAccNum = "";
|
||||||
DynamicObject payeracctbank = bill.getDynamicObject("payeracctbank");//银行账号
|
DynamicObject payeracctbank = bill.getDynamicObject("accountbanks");//银行账号
|
||||||
if (null != payeracctbank) {
|
if (null != payeracctbank) {
|
||||||
PaymentAccNum = payeracctbank.getString("bankaccountnumber");
|
PaymentAccNum = payeracctbank.getString("bankaccountnumber");
|
||||||
}
|
}
|
||||||
jsonObject.put("PaymentAccNum", PaymentAccNum);//付款账号
|
jsonObject.put("PaymentAccNum", PaymentAccNum);//付款账号
|
||||||
Date paydate = bill.getDate("paydate");
|
Date paydate = bill.getDate("paytime");
|
||||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
String PaymentDate = format.format(paydate);
|
String PaymentDate = format.format(paydate);
|
||||||
jsonObject.put("PaymentDate", PaymentDate);//付款时间
|
jsonObject.put("PaymentDate", PaymentDate);//付款时间
|
||||||
|
|
|
||||||
|
|
@ -46,21 +46,24 @@ public class TextFieldDemo extends AbstractFormPlugin {
|
||||||
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_pc");
|
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_pc");
|
||||||
//根据业务小类设置 成本中心,利润中心是否必填
|
//根据业务小类设置 成本中心,利润中心是否必填
|
||||||
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
|
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
|
||||||
|
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
|
||||||
|
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
|
||||||
|
|
||||||
if (null != shjhBizsmall) {
|
if (null != shjhBizsmall) {
|
||||||
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
|
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
|
||||||
// 获取成本中心的必填配置
|
// 获取成本中心的必填配置
|
||||||
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
|
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
|
||||||
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
|
|
||||||
shjh_costcenter.setMustInput(shjhCc);
|
shjh_costcenter.setMustInput(shjhCc);
|
||||||
tp.setMustInput(shjhCc);
|
tp.setMustInput(shjhCc);
|
||||||
// 获取利润中心的必填配置
|
// 获取利润中心的必填配置
|
||||||
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
|
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
|
||||||
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
|
|
||||||
shjh_profitcenter.setMustInput(shjhPc);
|
shjh_profitcenter.setMustInput(shjhPc);
|
||||||
td.setMustInput(shjhPc);
|
td.setMustInput(shjhPc);
|
||||||
}else {
|
}else {
|
||||||
shjh_costcenter.setMustInput(false);
|
shjh_costcenter.setMustInput(false);
|
||||||
|
tp.setMustInput(false);
|
||||||
shjh_profitcenter.setMustInput(false);
|
shjh_profitcenter.setMustInput(false);
|
||||||
|
td.setMustInput(false);
|
||||||
}
|
}
|
||||||
//赋值结算方式
|
//赋值结算方式
|
||||||
this.getView().getModel().setValue("shjh_jsfs",this.getView().getModel().getValue("settletype"));
|
this.getView().getModel().setValue("shjh_jsfs",this.getView().getModel().getValue("settletype"));
|
||||||
|
|
@ -75,21 +78,24 @@ public class TextFieldDemo extends AbstractFormPlugin {
|
||||||
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_pc");
|
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_pc");
|
||||||
//根据业务小类设置 成本中心,利润中心是否必填
|
//根据业务小类设置 成本中心,利润中心是否必填
|
||||||
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
|
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
|
||||||
|
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
|
||||||
|
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
|
||||||
|
|
||||||
if (null != shjhBizsmall) {
|
if (null != shjhBizsmall) {
|
||||||
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
|
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
|
||||||
// 获取成本中心的必填配置
|
// 获取成本中心的必填配置
|
||||||
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
|
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
|
||||||
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
|
|
||||||
shjh_costcenter.setMustInput(shjhCc);
|
shjh_costcenter.setMustInput(shjhCc);
|
||||||
tp.setMustInput(shjhCc);
|
tp.setMustInput(shjhCc);
|
||||||
// 获取利润中心的必填配置
|
// 获取利润中心的必填配置
|
||||||
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
|
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
|
||||||
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
|
|
||||||
shjh_profitcenter.setMustInput(shjhPc);
|
shjh_profitcenter.setMustInput(shjhPc);
|
||||||
td.setMustInput(shjhPc);
|
td.setMustInput(shjhPc);
|
||||||
}else {
|
}else {
|
||||||
shjh_costcenter.setMustInput(false);
|
shjh_costcenter.setMustInput(false);
|
||||||
|
tp.setMustInput(false);
|
||||||
shjh_profitcenter.setMustInput(false);
|
shjh_profitcenter.setMustInput(false);
|
||||||
|
td.setMustInput(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//赋值结算方式
|
//赋值结算方式
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,72 @@ package shjh.jhzj7.fi.fi.plugin.operate;
|
||||||
|
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.entity.ExtendedDataEntity;
|
||||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||||
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
||||||
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
||||||
|
import kd.bos.entity.validate.AbstractValidator;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认领处理单提交操作
|
* 认领处理单提交操作
|
||||||
* shjh_cas_claimbill_ext
|
* shjh_cas_claimbill_ext
|
||||||
*/
|
*/
|
||||||
public class ClaimbillSubmitOperation extends AbstractOperationServicePlugIn implements Plugin {
|
public class ClaimbillSubmitOperation extends AbstractOperationServicePlugIn implements Plugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||||
|
//预付款退回时预付款金额大于0
|
||||||
|
//员工还款时借款金额大于0
|
||||||
|
super.onAddValidators(e);
|
||||||
|
e.addValidator(new AbstractValidator() {
|
||||||
|
@Override
|
||||||
|
public void validate() {
|
||||||
|
String operateKey = this.getOperateKey();
|
||||||
|
if ("submit".equals(operateKey)) {
|
||||||
|
ExtendedDataEntity[] entities = this.getDataEntities();
|
||||||
|
for (ExtendedDataEntity entity : entities) {
|
||||||
|
DynamicObject bill = entity.getDataEntity();
|
||||||
|
DynamicObject recpaytype = null;
|
||||||
|
try{
|
||||||
|
recpaytype = bill.getDynamicObject("recpaytype");
|
||||||
|
}catch(Exception e){
|
||||||
|
bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(), "cas_claimbill");
|
||||||
|
recpaytype = bill.getDynamicObject("recpaytype");
|
||||||
|
}
|
||||||
|
|
||||||
|
DynamicObjectCollection entryentity = bill.getDynamicObjectCollection("entryentity");
|
||||||
|
DynamicObject dynamicObject = null;
|
||||||
|
if (!entryentity.isEmpty()) {
|
||||||
|
dynamicObject = entryentity.get(0);
|
||||||
|
}
|
||||||
|
//预付款退回时预付款金额大于0
|
||||||
|
if (null != recpaytype && "103".equals(recpaytype.getString("number")) && null != dynamicObject) {
|
||||||
|
BigDecimal shjh_paymentamount = dynamicObject.getBigDecimal("shjh_paymentamount");
|
||||||
|
boolean isLessOrEqualZero = shjh_paymentamount != null && shjh_paymentamount.compareTo(BigDecimal.ZERO) <= 0;
|
||||||
|
if (isLessOrEqualZero) {
|
||||||
|
this.addErrorMessage(entity, "预付款退回时预付款金额需大于0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//员工还款时借款金额大于0
|
||||||
|
if (null != recpaytype && "109".equals(recpaytype.getString("number")) && null != dynamicObject) {
|
||||||
|
BigDecimal shjh_loanamount = dynamicObject.getBigDecimal("shjh_loanamount");
|
||||||
|
boolean isLessOrEqualZero = shjh_loanamount != null && shjh_loanamount.compareTo(BigDecimal.ZERO) <= 0;
|
||||||
|
if (isLessOrEqualZero) {
|
||||||
|
this.addErrorMessage(entity, "员工还款时借款金额需大于0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
||||||
super.beforeExecuteOperationTransaction(e);
|
super.beforeExecuteOperationTransaction(e);
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
|
@ -252,9 +253,11 @@ public class SchedulebillMergeOperation extends AbstractOperationServicePlugIn i
|
||||||
} else if (o instanceof String) {
|
} else if (o instanceof String) {
|
||||||
String str = (String) o;
|
String str = (String) o;
|
||||||
rule.append(str);
|
rule.append(str);
|
||||||
} else if (o instanceof BigDecimal) {
|
} else if (o instanceof Date) {
|
||||||
BigDecimal bigDecimal = (BigDecimal) o;
|
Date date = (Date) o;
|
||||||
rule.append(bigDecimal);
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
rule.append(formattedDate);
|
||||||
} else if (o instanceof Date) {
|
} else if (o instanceof Date) {
|
||||||
long time = ((Date) o).getTime();
|
long time = ((Date) o).getTime();
|
||||||
rule.append(time);
|
rule.append(time);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue