- [x] 认领处理单收款类型选了退预付款,但是没有关联预付款单也能提交,需要增加限制不能提交
- [x] 关联预付款单的供应商默认带出来后不允许修改
- [x] 处理排程退单报错
- [x] 排程单据合并/解除(根据规则合并,日期为毫秒舍去后再参与规则比较)
- [x] 认领单选员工还款时默认带出客户
--s
This commit is contained in:
weiyunlong 2025-06-05 17:39:57 +08:00
parent 853e1b6143
commit 9b93abc680
5 changed files with 89 additions and 13 deletions

View File

@ -3,6 +3,7 @@ package shjh.jhzj7.fi.fi.plugin.form;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.IDataModel;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.CloseCallBack;
import kd.bos.form.FormShowParameter;
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");
}
}
}
}

View File

@ -137,7 +137,7 @@ public class ScheduleListPlugin extends AbstractListPlugin {
JSONObject jsonObject = new JSONObject();
String CompanyCode = "";
String CompanyName = "";
DynamicObject openorg = bill.getDynamicObject("openorg");//核算组织
DynamicObject openorg = bill.getDynamicObject("company");//资金组织
if (null != openorg) {
CompanyCode = openorg.getString("number");
CompanyName = openorg.getString("name");
@ -147,21 +147,21 @@ public class ScheduleListPlugin extends AbstractListPlugin {
jsonObject.put("BillHeaderID", bill.getString("shjh_fkbillid"));//费控单据头ID
jsonObject.put("DetailID", bill.getString("shjh_fkentryid"));//费控分录明细ID
String PaymentBank = "";
DynamicObject payerbank = bill.getDynamicObject("payerbank");
if (null != payerbank) {
PaymentBank = payerbank.getString("name");
DynamicObject acctbank = bill.getDynamicObject("acctbank");
if (null != acctbank) {
PaymentBank = acctbank.getString("name");
}
jsonObject.put("PaymentBank", PaymentBank);//付款银行
//付款状态 败笔退回-5取消付款-20付款失败-10部分付款失败30付款成功20部分付款成功25
// 处理中15待付款10未付款0未推送-99已修改-100
jsonObject.put("PaymentStatus", "-5");
String PaymentAccNum = "";
DynamicObject payeracctbank = bill.getDynamicObject("payeracctbank");//银行账号
DynamicObject payeracctbank = bill.getDynamicObject("accountbanks");//银行账号
if (null != payeracctbank) {
PaymentAccNum = payeracctbank.getString("bankaccountnumber");
}
jsonObject.put("PaymentAccNum", PaymentAccNum);//付款账号
Date paydate = bill.getDate("paydate");
Date paydate = bill.getDate("paytime");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String PaymentDate = format.format(paydate);
jsonObject.put("PaymentDate", PaymentDate);//付款时间

View File

@ -46,21 +46,24 @@ public class TextFieldDemo extends AbstractFormPlugin {
BasedataEdit shjh_profitcenter = this.getView().getControl("shjh_pc");
//根据业务小类设置 成本中心,利润中心是否必填
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
if (null != shjhBizsmall) {
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
// 获取成本中心的必填配置
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
shjh_costcenter.setMustInput(shjhCc);
tp.setMustInput(shjhCc);
// 获取利润中心的必填配置
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
shjh_profitcenter.setMustInput(shjhPc);
td.setMustInput(shjhPc);
}else {
shjh_costcenter.setMustInput(false);
tp.setMustInput(false);
shjh_profitcenter.setMustInput(false);
td.setMustInput(false);
}
//赋值结算方式
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");
//根据业务小类设置 成本中心,利润中心是否必填
DynamicObject shjhBizsmall = (DynamicObject)this.getView().getModel().getValue("shjh_bizsmall");
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
if (null != shjhBizsmall) {
shjhBizsmall = BusinessDataServiceHelper.loadSingle(shjhBizsmall.getPkValue(),"shjh_bizsmalltype");
// 获取成本中心的必填配置
boolean shjhCc = shjhBizsmall.getBoolean("shjh_cc");
BasedataProp tp = (BasedataProp) shjh_costcenter.getProperty();
shjh_costcenter.setMustInput(shjhCc);
tp.setMustInput(shjhCc);
// 获取利润中心的必填配置
boolean shjhPc = shjhBizsmall.getBoolean("shjh_pc");
BasedataProp td = (BasedataProp) shjh_profitcenter.getProperty();
shjh_profitcenter.setMustInput(shjhPc);
td.setMustInput(shjhPc);
}else {
shjh_costcenter.setMustInput(false);
tp.setMustInput(false);
shjh_profitcenter.setMustInput(false);
td.setMustInput(false);
}
//赋值结算方式

View File

@ -2,19 +2,72 @@ package shjh.jhzj7.fi.fi.plugin.operate;
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.args.BeforeOperationArgs;
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
import kd.bos.entity.validate.AbstractValidator;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
/**
* 认领处理单提交操作
* shjh_cas_claimbill_ext
*/
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
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
super.beforeExecuteOperationTransaction(e);

View File

@ -18,6 +18,7 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -252,9 +253,11 @@ public class SchedulebillMergeOperation extends AbstractOperationServicePlugIn i
} else if (o instanceof String) {
String str = (String) o;
rule.append(str);
} else if (o instanceof BigDecimal) {
BigDecimal bigDecimal = (BigDecimal) o;
rule.append(bigDecimal);
} else if (o instanceof Date) {
Date date = (Date) o;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = sdf.format(date);
rule.append(formattedDate);
} else if (o instanceof Date) {
long time = ((Date) o).getTime();
rule.append(time);