|
@@ -24,7 +24,6 @@ import kd.bos.exception.KDBizException;
|
|
|
import kd.bos.form.ClientProperties;
|
|
|
import kd.bos.form.ShowType;
|
|
|
import kd.bos.form.control.EntryGrid;
|
|
|
-import kd.bos.form.control.Search;
|
|
|
import kd.bos.form.control.events.BeforeClickEvent;
|
|
|
import kd.bos.form.control.events.BeforeItemClickEvent;
|
|
|
import kd.bos.form.control.events.ItemClickEvent;
|
|
@@ -37,7 +36,6 @@ import kd.bos.image.pojo.ViewImageVo;
|
|
|
import kd.bos.imageplatform.util.SSCImageUtils;
|
|
|
import kd.bos.logging.Log;
|
|
|
import kd.bos.logging.LogFactory;
|
|
|
-import kd.bos.metadata.botp.ConvertRuleReader;
|
|
|
import kd.bos.orm.ORM;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
@@ -163,13 +161,13 @@ public class ReimWorkBenchesDetailFormPlugin extends AbstractFormPlugin implemen
|
|
|
switch (itemKey){
|
|
|
|
|
|
case BTN_REIM:
|
|
|
- doReim(evt);
|
|
|
+ doPushNew(evt,"reim");
|
|
|
break;
|
|
|
case BTN_LOAN:
|
|
|
- doLoan(evt);
|
|
|
+ doPushNew(evt,"loan");
|
|
|
break;
|
|
|
case BTN_REPAY:
|
|
|
- doRepay(evt);
|
|
|
+ doPushNew(evt,"repay");
|
|
|
break;
|
|
|
|
|
|
case BTN_PRINT:
|
|
@@ -199,6 +197,31 @@ public class ReimWorkBenchesDetailFormPlugin extends AbstractFormPlugin implemen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected void doPushNew(ItemClickEvent evt , String type){
|
|
|
+ DynamicObject selectRow = getSelectRows().get(0);
|
|
|
+ String sourceBillType = selectRow.getString("billtype");
|
|
|
+ String billid = selectRow.getString("billid");
|
|
|
+ // 查询配置表
|
|
|
+
|
|
|
+ DynamicObjectCollection pushSettingCol = QueryServiceHelper.query("nckd_reimpushsetting", "nckd_type,nckd_sourcebilltype,nckd_targetbilltype,nckd_ruleid", new QFilter[]{
|
|
|
+ new QFilter("nckd_sourcebilltype", QCP.equals, sourceBillType),
|
|
|
+ new QFilter("nckd_type", QCP.equals, type)
|
|
|
+ });
|
|
|
+
|
|
|
+ if(CollectionUtils.isEmpty(pushSettingCol)){
|
|
|
+ getView().showTipNotification("单据未配置报销工作台下推设置。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(pushSettingCol.size() > 1){
|
|
|
+ getView().showTipNotification("单据存在多条报销工作台下推设置。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ DynamicObject pushSettingInfo = pushSettingCol.get(0);
|
|
|
+ botpCreateBillOpen(billid,pushSettingInfo.getString("nckd_sourcebilltype"),
|
|
|
+ pushSettingInfo.getString("nckd_targetbilltype"),pushSettingInfo.getString("nckd_ruleid"));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
protected void doReim(ItemClickEvent evt){
|
|
|
DynamicObject selectRow = getSelectRows().get(0);
|
|
|
String billtype = selectRow.getString("billtype");
|
|
@@ -573,9 +596,11 @@ public class ReimWorkBenchesDetailFormPlugin extends AbstractFormPlugin implemen
|
|
|
WorkflowServiceHelper.viewFlowchart(getView().getPageId(), entryRow.getString("billid"));
|
|
|
}
|
|
|
}
|
|
|
+ public void botpCreateBillOpen(String sourceBillId,String sourceBillType,String targetBillType) {
|
|
|
+ botpCreateBillOpen(sourceBillId,sourceBillType,targetBillType,"");
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- public void botpCreateBillOpen(String sourceBillId,String sourceBillType,String targetBillType){
|
|
|
+ public void botpCreateBillOpen(String sourceBillId,String sourceBillType,String targetBillType,String ruleId){
|
|
|
// 校验单据权限
|
|
|
|
|
|
//构建选中行数据包
|
|
@@ -583,12 +608,9 @@ public class ReimWorkBenchesDetailFormPlugin extends AbstractFormPlugin implemen
|
|
|
ListSelectedRow selectedRow = new ListSelectedRow(Long.valueOf(sourceBillId));
|
|
|
selectedRows.add(selectedRow);
|
|
|
//获取转换规则id
|
|
|
- ConvertRuleReader read=new ConvertRuleReader();
|
|
|
- List<String> loadRuleIds = read.loadRuleIds(sourceBillType, targetBillType, false);
|
|
|
+ //ConvertRuleCache.loadRules()
|
|
|
+
|
|
|
|
|
|
- if(CollectionUtils.isNotEmpty(loadRuleIds) && loadRuleIds.size() > 1){
|
|
|
- throw new KDBizException("匹配到多条转换规则,请调整转换规则后再试。");
|
|
|
- }
|
|
|
// 创建下推参数
|
|
|
PushArgs pushArgs = new PushArgs();
|
|
|
// 源单标识,必填
|
|
@@ -600,7 +622,7 @@ public class ReimWorkBenchesDetailFormPlugin extends AbstractFormPlugin implemen
|
|
|
//不检查目标单新增权限,非必填
|
|
|
pushArgs.setHasRight(true);
|
|
|
//传入下推使用的转换规则id,不填则使用默认规则
|
|
|
- pushArgs.setRuleId(loadRuleIds.get(0));
|
|
|
+ pushArgs.setRuleId(ruleId);
|
|
|
//下推默认保存,必填
|
|
|
pushArgs.setAutoSave(true);
|
|
|
// 设置源单选中的数据包,必填
|