收款处理-补推清帐单
This commit is contained in:
parent
02d9b1c94b
commit
13fc0b0ebb
|
|
@ -0,0 +1,202 @@
|
|||
package shjh.jhzj7.fi.fi.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.operate.OperateOptionConst;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.container.Tab;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.control.Label;
|
||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.control.events.RowClickEvent;
|
||||
import kd.bos.form.control.events.RowClickEventListener;
|
||||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import shjh.jhzj7.fi.fi.plugin.form.info.RecFieldsInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
* 【收款处理】-分录-补推清帐单按钮
|
||||
*/
|
||||
public class RecBillAddEntryPushPlugin extends AbstractBillPlugIn implements RowClickEventListener,Plugin {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(RecBillAddTopPushPlugin.class);
|
||||
|
||||
private static final String ENTITY_REC_BILL = "cas_recbill";
|
||||
private static final String TARGET_NAME="shjh_supplementpush";
|
||||
private static final String ACTION_ADD_ENTRY_PUSH = "addEntryPush";
|
||||
private static final String FIELD_NOTICE_USER = "shjh_noticeuser";
|
||||
private static final String OPERATION_PUSH_CLEAR = "pushclear";
|
||||
private static final String ENTRY = "entry";
|
||||
|
||||
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
super.registerListener(e);
|
||||
this.addItemClickListeners("advcontoolbarap");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加校验
|
||||
* 符合推送的数据:
|
||||
*【单据状态】=已收款 and
|
||||
*【SAP凭证号】≠空 and
|
||||
*分录行【是否需要下推清账单】=否 and
|
||||
* 【收款金额】>0
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||
super.beforeItemClick(evt);
|
||||
String key = evt.getItemKey();
|
||||
if (!RecFieldsInfo.BUTTON_ADD_ENTRY_PUSH.equalsIgnoreCase(key)) {
|
||||
return;
|
||||
}
|
||||
StringBuilder errorMessage = new StringBuilder();
|
||||
// 校验分录行
|
||||
DynamicObjectCollection entries = this.getModel().getEntryEntity(ENTRY);
|
||||
if (entries == null || entries.stream().allMatch(entry -> entry.getBoolean(RecFieldsInfo.NEED_PUSH_BILL))) {
|
||||
errorMessage.append("是否需要下推清账单=否\r\n");
|
||||
}
|
||||
// 校验单据状态
|
||||
if (!"D".equals(this.getModel().getValue(RecFieldsInfo.TOP_BILL_STATUS))) {
|
||||
errorMessage.append("单据状态=已收款\r\n");
|
||||
}
|
||||
// 校验SAP凭证号
|
||||
String voucherNum = (String) this.getModel().getValue(RecFieldsInfo.SAP_VOUCHER_NUM);
|
||||
if (voucherNum.isEmpty()) {
|
||||
errorMessage.append("SAP凭证号≠空\r\n");
|
||||
}
|
||||
// 校验收款金额
|
||||
BigDecimal actAmount = (BigDecimal) this.getModel().getValue(RecFieldsInfo.ACT_REC_AMT);
|
||||
if (actAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
errorMessage.append("收款金额>0\r\n");
|
||||
}
|
||||
if (errorMessage.length() > 0) {
|
||||
errorMessage.insert(0,"不符合补推条件:\r\n");
|
||||
this.getView().showMessage(errorMessage.toString());
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
// 判断点击的是否为指定的按钮
|
||||
if (StringUtils.equals(RecFieldsInfo.BUTTON_ADD_ENTRY_PUSH, evt.getItemKey())) {
|
||||
//传参
|
||||
HashMap<String, Object> map = new HashMap<>(3);
|
||||
//按钮区分标识
|
||||
map.put("buttonKey","addEntryPush");
|
||||
FormShowParameter showParameter = new FormShowParameter();
|
||||
//需要打开单据的标识
|
||||
showParameter.setFormId(TARGET_NAME);
|
||||
//打开方式
|
||||
showParameter.getOpenStyle().setShowType(ShowType.Modal);
|
||||
//传到子页面参数
|
||||
showParameter.setCustomParams(map);
|
||||
//回调方法
|
||||
showParameter.setCloseCallBack(new CloseCallBack(this,"addEntryPush"));
|
||||
this.getView().showForm(showParameter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调
|
||||
* 1.修改分录数据-是否下推清帐单-true
|
||||
* 2.下推清帐单
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void closedCallBack(ClosedCallBackEvent evt) {
|
||||
super.closedCallBack(evt);
|
||||
if (!ACTION_ADD_ENTRY_PUSH.equals(evt.getActionId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicObject returnData = (DynamicObject) evt.getReturnData();
|
||||
if (returnData == null) {
|
||||
return;
|
||||
}
|
||||
// 获取表单的主键值
|
||||
Object pkValue = this.getModel().getValue("id");
|
||||
|
||||
// 获取分录表格控件
|
||||
EntryGrid entryGrid = this.getControl(ENTRY);
|
||||
|
||||
// 获取选中的行索引
|
||||
int[] selectRows = entryGrid.getSelectRows();
|
||||
|
||||
// 如果没有选中任何行,提示用户并返回
|
||||
if (selectRows.length == 0) {
|
||||
this.getView().showMessage("请选择需要补推的分录数据。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据主键值加载单据数据
|
||||
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(pkValue, ENTITY_REC_BILL);
|
||||
if (dynamicObject != null) {
|
||||
dynamicObject.set(FIELD_NOTICE_USER,returnData);
|
||||
// 获取分录数据集合
|
||||
DynamicObjectCollection collection = dynamicObject.getDynamicObjectCollection(ENTRY);
|
||||
|
||||
if (collection != null && collection.size() > 0) {
|
||||
// 遍历选中的行索引
|
||||
for (int rowIndex : selectRows) {
|
||||
// 确保选中的行索引在有效范围内
|
||||
if (rowIndex >= 0 && rowIndex < collection.size()) {
|
||||
// 获取对应的分录数据
|
||||
DynamicObject entry = collection.get(rowIndex);
|
||||
// 在这里对选中的分录数据进行处理
|
||||
boolean isNeedPush = entry.getBoolean(RecFieldsInfo.NEED_PUSH_BILL);
|
||||
if (!isNeedPush){
|
||||
entry.set(RecFieldsInfo.NEED_PUSH_BILL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
SaveServiceHelper.update(dynamicObject);
|
||||
OperateOption operateOption = OperateOption.create();
|
||||
operateOption.setVariableValue(OperateOptionConst.IGNOREWARN, String.valueOf(true)); // 不执行警告级别校验器
|
||||
operateOption.setVariableValue(OperateOptionConst.IGNOREINTERACTION, String.valueOf(true)); // 不显示交互提示
|
||||
operateOption.setVariableValue(OperateOptionConst.STRICTVALIDATION, String.valueOf(true)); // 全部校验通过才保存
|
||||
operateOption.setVariableValue(OperateOptionConst.MUTEX_ISSTRICT, String.valueOf(true)); // 严格互斥
|
||||
try {
|
||||
OperationResult operationResult = OperationServiceHelper.executeOperate(
|
||||
OPERATION_PUSH_CLEAR, ENTITY_REC_BILL, new DynamicObject[]{dynamicObject}, operateOption
|
||||
);
|
||||
|
||||
if (!operationResult.isSuccess()) {
|
||||
logger.error("下推清账单失败: " + operationResult.getMessage());
|
||||
this.getView().showMessage("下推清账单失败,请检查数据后重试!");
|
||||
}else {
|
||||
this.getView().showMessage("下推成功!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("下推清账单异常", e);
|
||||
this.getView().showMessage("下推清账单异常,请稍后重试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package shjh.jhzj7.fi.fi.plugin.form;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.form.control.Button;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.events.BeforeClosedEvent;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
/**
|
||||
* 动态表单插件
|
||||
* 补推清帐单弹窗
|
||||
*/
|
||||
public class RecBillAddPushWindowPlugin extends AbstractFormPlugin implements Plugin {
|
||||
|
||||
/**
|
||||
* 按钮监听
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
super.registerListener(e);
|
||||
//确定按钮
|
||||
Button butOk = this.getView().getControl("btnok");
|
||||
butOk.addClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按钮点击方法
|
||||
*
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void click(EventObject evt) {
|
||||
DynamicObject user = (DynamicObject) this.getModel().getValue("shjh_noticeuser");
|
||||
if (null==user){
|
||||
this.getView().showTipNotification("请选择被通知用户!");
|
||||
return;
|
||||
}
|
||||
Control source = (Control) evt.getSource();
|
||||
String key = source.getKey();
|
||||
if (StringUtils.equals("btnok", key)) {
|
||||
this.getView().returnDataToParent(user);
|
||||
this.getView().close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 窗口关闭传值
|
||||
*
|
||||
* @param e
|
||||
*/
|
||||
@Override
|
||||
public void beforeClosed(BeforeClosedEvent e) {
|
||||
super.beforeClosed(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
package shjh.jhzj7.fi.fi.plugin.form;
|
||||
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.EntityMetadataCache;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.operate.OperateOptionConst;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
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.ClosedCallBackEvent;
|
||||
import kd.bos.list.BillList;
|
||||
import kd.bos.list.plugin.AbstractListPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import shjh.jhzj7.fi.fi.plugin.form.info.ClaimFieldsInfo;
|
||||
import shjh.jhzj7.fi.fi.plugin.form.info.RecFieldsInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 标准单据列表插件
|
||||
* 【收款处理】-列表-补推清帐单按钮
|
||||
*/
|
||||
public class RecBillAddTopPushPlugin extends AbstractListPlugin implements Plugin {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(RecBillAddTopPushPlugin.class);
|
||||
|
||||
/** 动态表单 */
|
||||
private static final String TARGET_NAME="shjh_supplementpush";
|
||||
|
||||
// 定义常量
|
||||
private static final String ACTION_ADD_TOP_PUSH = "addTopPush";
|
||||
private static final String ENTITY_REC_BILL = "cas_recbill";
|
||||
private static final String OPERATION_PUSH_CLEAR = "pushclear";
|
||||
private static final String FIELD_NOTICE_USER = "shjh_noticeuser";
|
||||
|
||||
|
||||
/**
|
||||
* 添加校验
|
||||
* 符合推送的数据:
|
||||
* 【客户拆分】=否 and
|
||||
* 【单据状态】=已收款 and
|
||||
* 【SAP凭证号】≠空 and
|
||||
* 【收款金额】>0 and
|
||||
* 分录行【是否需要下推清账单】=否
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||
super.beforeItemClick(evt);
|
||||
String key = evt.getItemKey();
|
||||
if (!RecFieldsInfo.BUTTON_ADD_TOP_PUSH.equalsIgnoreCase(key)) {
|
||||
return;
|
||||
}
|
||||
ListSelectedRowCollection selectedRows = getSelectedRows();
|
||||
if (selectedRows == null || selectedRows.isEmpty()) {
|
||||
this.getView().showTipNotification("请选择需要操作的收款单!");
|
||||
evt.setCancel(true);
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder errorMessage = new StringBuilder();
|
||||
for (ListSelectedRow selectedRow : selectedRows) {
|
||||
Object primaryKeyValue = selectedRow.getPrimaryKeyValue();
|
||||
DynamicObject recBills = BusinessDataServiceHelper.loadSingle(primaryKeyValue, "cas_recbill");
|
||||
String number = recBills.getString(RecFieldsInfo.TOP_BILL_NUMBER);
|
||||
|
||||
// 校验客户拆分
|
||||
if (recBills.getBoolean(RecFieldsInfo.CUSTOMER_SPLIT)) {
|
||||
errorMessage.append("【").append(number).append("】不符合条件:客户拆分=否\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验单据状态
|
||||
if (!"D".equals(recBills.getString(RecFieldsInfo.TOP_BILL_STATUS))) {
|
||||
errorMessage.append("【").append(number).append("】不符合条件:单据状态=已收款\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验SAP凭证号
|
||||
if (recBills.getString(RecFieldsInfo.SAP_VOUCHER_NUM).isEmpty()) {
|
||||
errorMessage.append("【").append(number).append("】不符合条件:SAP凭证号≠空\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验收款金额
|
||||
if (recBills.getBigDecimal(RecFieldsInfo.ACT_REC_AMT).compareTo(BigDecimal.ZERO) <= 0) {
|
||||
errorMessage.append("【").append(number).append("】不符合条件:收款金额>0\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 校验分录行
|
||||
DynamicObjectCollection entries = recBills.getDynamicObjectCollection("entry");
|
||||
if (entries == null || entries.stream().allMatch(entry -> entry.getBoolean(RecFieldsInfo.NEED_PUSH_BILL))) {
|
||||
errorMessage.append("【").append(number).append("】没有符合下推的收款明细数据\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessage.length() > 0) {
|
||||
this.getView().showMessage(errorMessage.toString());
|
||||
evt.setCancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开动态表单弹窗并传参
|
||||
*
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
//点击【关联预付款单】按钮
|
||||
if (evt.getItemKey().equals(RecFieldsInfo.BUTTON_ADD_TOP_PUSH)) {
|
||||
//传参
|
||||
HashMap<String, Object> map = new HashMap<>(3);
|
||||
//按钮区分标识
|
||||
map.put("buttonKey","addTopPush");
|
||||
FormShowParameter showParameter = new FormShowParameter();
|
||||
//需要打开单据的标识
|
||||
showParameter.setFormId(TARGET_NAME);
|
||||
//打开方式
|
||||
showParameter.getOpenStyle().setShowType(ShowType.Modal);
|
||||
//传到子页面参数
|
||||
showParameter.setCustomParams(map);
|
||||
//回调方法
|
||||
showParameter.setCloseCallBack(new CloseCallBack(this,"addTopPush"));
|
||||
this.getView().showForm(showParameter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调
|
||||
* 1.修改分录数据-是否下推清帐单-true
|
||||
* 2.下推清帐单
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void closedCallBack(ClosedCallBackEvent evt) {
|
||||
super.closedCallBack(evt);
|
||||
if (!ACTION_ADD_TOP_PUSH.equals(evt.getActionId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicObject returnData = (DynamicObject) evt.getReturnData();
|
||||
if (returnData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取选中的行
|
||||
ListSelectedRowCollection selectedRows = getSelectedRows();
|
||||
if (selectedRows == null || selectedRows.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 更新分录数据并收集需要下推的收款单
|
||||
List<DynamicObject> recBillsToUpdate = new ArrayList<>();
|
||||
for (ListSelectedRow selectedRow : selectedRows) {
|
||||
DynamicObject recBill = BusinessDataServiceHelper.loadSingle(selectedRow.getPrimaryKeyValue(), ENTITY_REC_BILL);
|
||||
if (recBill != null) {
|
||||
updateRecBillEntries(recBill, returnData); // 更新分录数据
|
||||
recBillsToUpdate.add(recBill);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存更新后的收款单
|
||||
saveRecBills(recBillsToUpdate);
|
||||
|
||||
// 执行下推清账单操作
|
||||
pushClearBill(recBillsToUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新收款单的分录数据
|
||||
*/
|
||||
private void updateRecBillEntries(DynamicObject recBill, DynamicObject returnData) {
|
||||
recBill.set(FIELD_NOTICE_USER, returnData); // 设置被通知人
|
||||
|
||||
DynamicObjectCollection entries = recBill.getDynamicObjectCollection("entry");
|
||||
if (entries != null) {
|
||||
entries.stream()
|
||||
.filter(entry -> !entry.getBoolean(RecFieldsInfo.NEED_PUSH_BILL)) // 过滤未下推的分录
|
||||
.forEach(entry -> entry.set(RecFieldsInfo.NEED_PUSH_BILL, true)); // 设置为已下推
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新后的收款单
|
||||
*/
|
||||
private void saveRecBills(List<DynamicObject> recBills) {
|
||||
if (recBills.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
SaveServiceHelper.update(recBills.toArray(new DynamicObject[0]));
|
||||
} catch (Exception e) {
|
||||
logger.error("保存收款单失败", e);
|
||||
this.getView().showMessage("保存收款单失败,请稍后重试!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行下推清账单操作
|
||||
*/
|
||||
private void pushClearBill(List<DynamicObject> recBills) {
|
||||
if (recBills.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OperateOption operateOption = OperateOption.create();
|
||||
operateOption.setVariableValue(OperateOptionConst.IGNOREWARN, String.valueOf(true)); // 不执行警告级别校验器
|
||||
operateOption.setVariableValue(OperateOptionConst.IGNOREINTERACTION, String.valueOf(true)); // 不显示交互提示
|
||||
operateOption.setVariableValue(OperateOptionConst.STRICTVALIDATION, String.valueOf(true)); // 全部校验通过才保存
|
||||
operateOption.setVariableValue(OperateOptionConst.MUTEX_ISSTRICT, String.valueOf(true)); // 严格互斥
|
||||
|
||||
try {
|
||||
OperationResult operationResult = OperationServiceHelper.executeOperate(
|
||||
OPERATION_PUSH_CLEAR, ENTITY_REC_BILL, recBills.toArray(new DynamicObject[0]), operateOption
|
||||
);
|
||||
|
||||
if (!operationResult.isSuccess()) {
|
||||
logger.error("下推清账单失败: " + operationResult.getMessage());
|
||||
this.getView().showMessage("下推清账单失败,请检查数据后重试!");
|
||||
}else {
|
||||
this.getView().showMessage("下推成功!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("下推清账单异常", e);
|
||||
this.getView().showMessage("下推清账单异常,请稍后重试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,11 +25,14 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin {
|
|||
@Override
|
||||
public void afterBindData(EventObject e) {
|
||||
super.afterBindData(e);
|
||||
String value = (String) this.getModel().getValue("shjh_qzzt");
|
||||
if (value.isEmpty()){
|
||||
DynamicObjectCollection entry = (DynamicObjectCollection) this.getModel().getValue("entry");
|
||||
if (null != entry && entry.size() != 0) {
|
||||
setClosingStatus(entry);
|
||||
String state = (String) this.getModel().getValue(RecFieldsInfo.TOP_BILL_STATUS);
|
||||
if ("A".equals(state)){
|
||||
String value = (String) this.getModel().getValue(RecFieldsInfo.CLOSING_STATUS);
|
||||
if (value==null || "".equals(value)){
|
||||
DynamicObjectCollection entry = (DynamicObjectCollection) this.getModel().getValue("entry");
|
||||
if (null != entry && entry.size() != 0) {
|
||||
setClosingStatus(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO:分录默认清账状态
|
||||
|
|
|
|||
|
|
@ -5,52 +5,119 @@ package shjh.jhzj7.fi.fi.plugin.form.info;
|
|||
*/
|
||||
public class RecFieldsInfo {
|
||||
|
||||
//-------------------------表头字段---------------------------------
|
||||
/**
|
||||
* 清账状态
|
||||
*/
|
||||
public static final String CLOSING_STATUS="shjh_qzzt";
|
||||
/**
|
||||
* 客户拆分
|
||||
*/
|
||||
public static final String CUSTOMER_SPLIT="shjh_customersplit";
|
||||
//-------------------------表头字段---------------------------------//
|
||||
/** 单据编号 */
|
||||
public static final String TOP_BILL_NUMBER = "billno";
|
||||
|
||||
public static final String FEE="fee";
|
||||
public static final String BANK_CHARGES="shjh_bankcharges";
|
||||
public static final String THIRD_PARTY_FEES="shjh_thirdpartyfees";
|
||||
public static final String PAYER_TYPE="payertype";
|
||||
/** 单据编号 */
|
||||
public static final String TOP_BILL_STATUS = "billstatus";
|
||||
|
||||
public static final String CUSTOMER_F7="customerf7";
|
||||
public static final String SUPPLIER_F7="f7_payer";
|
||||
/** SAP凭证号 */
|
||||
public static final String SAP_VOUCHER_NUM = "shjh_vouchernum";
|
||||
|
||||
/** 清账状态 */
|
||||
public static final String CLOSING_STATUS = "shjh_qzzt";
|
||||
|
||||
/** 客户拆分 */
|
||||
public static final String CUSTOMER_SPLIT = "shjh_customersplit";
|
||||
|
||||
/** 手续费 */
|
||||
public static final String TOP_FEE = "fee";
|
||||
|
||||
/** 银行手续费 */
|
||||
public static final String BANK_CHARGES = "shjh_bankcharges";
|
||||
|
||||
/** 第三方手续费 */
|
||||
public static final String THIRD_PARTY_FEES = "shjh_thirdpartyfees";
|
||||
|
||||
/** 付款人类型 */
|
||||
public static final String PAYER_TYPE = "payertype";
|
||||
|
||||
/** 付款人名称(客户) */
|
||||
public static final String CUSTOMER_F7 = "customerf7";
|
||||
|
||||
/** 付款人(供应商) */
|
||||
public static final String SUPPLIER_F7 = "f7_payer";
|
||||
|
||||
/** 收款金额 */
|
||||
public static final String ACT_REC_AMT = "actrecamt";
|
||||
|
||||
|
||||
//------------------------分录字段----------------------------------//
|
||||
|
||||
/** 是否需要下推清账单 */
|
||||
public static final String NEED_PUSH_BILL = "shjh_needpushbill";
|
||||
|
||||
/** 是否已下推清账单 */
|
||||
public static final String PUSH_BILL = "shjh_pushbill";
|
||||
|
||||
/** 分录客户 */
|
||||
public static final String ENTRY_CUSTOMER = "shjh_entrycustomer";
|
||||
|
||||
/** 清账状态 */
|
||||
public static final String ENTRY_CLOSING_STATUS = "shjh_closingstatus";
|
||||
|
||||
/** 单据号 */
|
||||
public static final String BILL_NUMBER = "shjh_billnum";
|
||||
|
||||
/** 采购订单号 */
|
||||
public static final String PURCHASE_NUMBER = "shjh_purchasenum";
|
||||
|
||||
/** 采购订单行号 */
|
||||
public static final String PURCHASE_LINE_NUMBER = "shjh_purchaselinenum";
|
||||
|
||||
/** 单据主题 */
|
||||
public static final String BILL_SUBJECT = "shjh_billsubject";
|
||||
|
||||
/** 预付款日期 */
|
||||
public static final String PREPAYMENT_DATE = "shjh_prepaymentdate";
|
||||
|
||||
/** 预付款金额(RMB_人民币) */
|
||||
public static final String PAYMENT_AMOUNT = "shjh_paymentamount";
|
||||
|
||||
/** 单据可退还金额 */
|
||||
public static final String DOCUMENT_AMOUNT = "shjh_documentamount";
|
||||
|
||||
/** 本次退还本位币金额(RMB_人民币) */
|
||||
public static final String REFUNDED_AMOUNT = "shjh_refundedamount";
|
||||
|
||||
/** 借款单号 */
|
||||
public static final String LOAN_NUMBER = "shjh_loannum";
|
||||
|
||||
/** 借款金额 */
|
||||
public static final String LOAN_AMOUNT = "shjh_loanamount";
|
||||
|
||||
/** 借款余额 */
|
||||
public static final String LOAN_BALANCE = "shjh_loanbalance";
|
||||
|
||||
/** 本次还款金额(本位币) */
|
||||
public static final String REPAYMENT_AMOUNT = "shjh_repaymentamount";
|
||||
|
||||
/** 核销单凭证号 */
|
||||
public static final String VERIFICATION_NUMBER = "shjh_verificationnum";
|
||||
|
||||
/** 会计年度 */
|
||||
public static final String FISCAL_YEAR = "shjh_fiscalyear";
|
||||
|
||||
/** 员工工号 */
|
||||
public static final String USER_CODE = "shjh_usercode";
|
||||
|
||||
/** 部门编码 */
|
||||
public static final String DEPT_CODE = "shjh_deptcode";
|
||||
|
||||
/** 关联ID */
|
||||
public static final String BILL_HEADER_ID = "shjh_billheaderid";
|
||||
|
||||
/** 关联明细ID */
|
||||
public static final String DETAIL_ID = "shjh_detailid";
|
||||
|
||||
|
||||
//------------------------按钮----------------------------------//
|
||||
|
||||
//------------------------分录字段----------------------------------
|
||||
/** 补推清帐单(列表) */
|
||||
public static final String BUTTON_ADD_TOP_PUSH = "shjh_addtoppush";
|
||||
|
||||
public static final String NEED_PUSH_BILL="shjh_needpushbill";
|
||||
public static final String PUSH_BILL="shjh_pushbill";
|
||||
/**
|
||||
* 分录客户
|
||||
*/
|
||||
public static final String ENTRY_CUSTOMER="shjh_entrycustomer";
|
||||
/**
|
||||
* 清账状态
|
||||
*/
|
||||
public static final String ENTRY_CLOSING_STATUS="shjh_closingstatus";
|
||||
public static final String BILL_NUMBER="shjh_billnum";
|
||||
public static final String PURCHASE_NUMBER="shjh_purchasenum";
|
||||
public static final String PURCHASE_LINE_NUMBER="shjh_purchaselinenum";
|
||||
public static final String BILL_SUBJECT="shjh_billsubject";
|
||||
public static final String PREPAYMENT_DATE="shjh_prepaymentdate";
|
||||
public static final String PAYMENT_AMOUNT="shjh_paymentamount";
|
||||
public static final String DOCUMENT_AMOUNT="shjh_documentamount";
|
||||
public static final String REFUNDED_AMOUNT="shjh_refundedamount";
|
||||
public static final String LOAN_NUMBER="shjh_loannum";
|
||||
public static final String LOAN_AMOUNT="shjh_loanamount";
|
||||
public static final String LOAN_BALANCE="shjh_loanbalance";
|
||||
public static final String REPAYMENT_AMOUNT="shjh_repaymentamount";
|
||||
public static final String VERIFICATION_NUMBER="shjh_verificationnum";
|
||||
public static final String FISCAL_YEAR="shjh_fiscalyear";
|
||||
/** 补推清帐单(分录) */
|
||||
public static final String BUTTON_ADD_ENTRY_PUSH = "shjh_addentrypush";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue