Commit a527e6d8 by 吴佳

Merge remote-tracking branch 'origin/ejs-20230802' into ejs-20230802

parents 610b8efa c70a2719
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://www.zkoss.org/2005/zul" xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" height="100%" width="100%" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<style src="/public/template.css"/>
<script src="/public/template.js" type="text/javascript"/>
<borderlayout>
<center autoscroll="true" border="none" zclass="z-center">
<div style="width:800px;height:1860px;">
<label multiline="true" style="position:absolute;left:20px;top:100px;height:16px;width:40.0px;" value="致" zclass="z-label"/>
<label multiline="true" style="position:absolute;left:20px;top:140px;height:16px;width:92.0px;" value="到单号:" zclass="z-label"/>
<textbox readonly="true" rows="1" style="position:absolute;left:110px;top:140px;height:16px;width:180.0px;ime-mode:disabled;" text="IC3500230163BR" zclass="z-textbox"/>
<textbox readonly="true" rows="1" style="position:absolute;left:511px;top:140px;height:16px;width:50.0px;ime-mode:disabled;" text="CNY" zclass="z-textbox"/>
<decimalbox format="#,##0.00" readonly="true" style="position:absolute;left:564px;top:140px;height:16px;width:120.0px;text-align:right;ime-mode:disabled;" text="55,555.00" zclass="z-decimalbox"/>
<label multiline="true" style="position:absolute;left:20px;top:179px;height:16px;width:92.0px;" value="合同号:" zclass="z-label"/>
<textbox readonly="true" rows="1" style="position:absolute;left:110px;top:179px;height:16px;width:180.0px;ime-mode:disabled;" text="135" zclass="z-textbox"/>
<textbox readonly="true" rows="1" style="position:absolute;left:420px;top:377px;height:24px;width:180.0px;ime-mode:disabled;" text="" zclass="z-textbox"/>
<textbox cols="35" multiline="true" readonly="true" rows="4" style="position:absolute;left:420px;top:407px;height:60px;width:310.0px;resize:none;ime-mode:disabled;" text="${aa}" zclass="z-textbox"/>
<label multiline="true" style="position:absolute;left:420px;top:357px;height:16px;width:100.0px;" value="付款人:" zclass="z-label"/>
<textbox readonly="true" rows="1" style="position:absolute;left:420px;top:237px;height:24px;width:180.0px;ime-mode:disabled;" text="" zclass="z-textbox"/>
<textbox cols="35" multiline="true" readonly="true" rows="4" style="position:absolute;left:420px;top:267px;height:60px;width:310.0px;resize:none;ime-mode:disabled;" text="1" zclass="z-textbox"/>
<label multiline="true" style="position:absolute;left:420px;top:217px;height:16px;width:100.0px;" value="收款人:" zclass="z-label"/>
<label multiline="true" style="position:absolute;left:20px;top:460px;height:16px;width:100.0px;" value="申请事项:" zclass="z-label"/>
<combobox disabled="true" style="position:absolute;left:120px;top:460px;height:16px;width:90.0px;background:#FFFFA0;ime-mode:disabled;border-bottom:solid red;" text="承兑" zclass="z-combobox"/>
<combobox disabled="true" style="position:absolute;left:60px;top:100px;height:16px;width:240.0px;background:#FFFFA0;ime-mode:disabled;" text="中国光大银行股份有限公司天津分行南开支行" zclass="z-combobox"/>
<label multiline="true" style="font-size:13px;font-weight:bold;;position:absolute;left:259px;top:60px;height:16px;width:205.0px;" value="进口代收承兑/付款/拒付申请" zclass="z-label"/>
<label multiline="true" style="position:absolute;left:420px;top:140px;height:16px;" value="合同金额:" zclass="z-label"/>
<label multiline="true" style="position:absolute;left:20px;top:260px;height:16px;" value="交单方式" zclass="z-label"/>
<combobox disabled="true" style="position:absolute;left:110px;top:260px;height:16px;width:180.0px;ime-mode:disabled;" text="D/A Documents against Acceptance" zclass="z-combobox"/>
<label multiline="true" style="position:absolute;left:20px;top:220px;height:16px;" value="到期日" zclass="z-label"/>
<datebox disabled="true" format="yyyy/MM/dd" style="position:absolute;left:110px;top:220px;height:16px;width:75.0px;ime-mode:disabled;" zclass="z-datebox"/>
<textbox readonly="true" rows="1" style="position:absolute;left:20px;top:340px;height:24px;width:180.0px;ime-mode:disabled;" text="" zclass="z-textbox"/>
<textbox cols="35" multiline="true" readonly="true" rows="4" style="position:absolute;left:20px;top:370px;height:60px;width:310.0px;resize:none;ime-mode:disabled;" text="" zclass="z-textbox"/>
<label multiline="true" style="position:absolute;left:20px;top:320px;height:16px;width:100.0px;" value="代收行:" zclass="z-label"/>
<label multiline="true" style="position:absolute;left:420px;top:100px;height:16px;width:60.0px;" value="申请日期:" zclass="z-label"/>
<datebox disabled="true" format="yyyy/MM/dd" style="position:absolute;left:511px;top:100px;height:16px;width:99.0px;background:#FFFFA0;ime-mode:disabled;" text="2023/07/26" zclass="z-datebox"/>
<window style="position:absolute;left:0px;top:500px;height:1086px;width:860.0px;">
<label multiline="true" style="position:absolute;left:20px;top:160px;height:16px;width:57.0px;" value="备注:" zclass="z-label"/>
<textbox cols="65" multiline="true" readonly="true" rows="10" style="position:absolute;left:100px;top:160px;height:72px;width:592.0px;resize:none;" text="" zclass="z-textbox"/>
<label multiline="true" style="position:absolute;left:5px;top:280px;height:16px;width:107.0px;" value="历史备注:" zclass="z-label"/>
<textbox cols="200" multiline="true" readonly="true" rows="10" style="position:absolute;left:5px;top:300px;height:76px;width:700.0px;resize:none;" text="" zclass="z-textbox"/>
<label multiline="true" style="position:absolute;left:5px;top:400px;height:16px;width:281.0px;" value="给下步操作人员的提示(不超过200字):" zclass="z-label"/>
<textbox cols="200" multiline="true" readonly="true" rows="10" style="position:absolute;left:5px;top:420px;height:84px;width:700.0px;resize:none;" text="" zclass="z-textbox"/>
</window>
<label multiline="true" style="position:absolute;left:420px;top:180px;height:16px;" value="索偿金额:" zclass="z-label"/>
<decimalbox format="#,##0.00" readonly="true" style="position:absolute;left:564px;top:180px;height:16px;width:120.0px;text-align:right;ime-mode:disabled;" text="0.00" zclass="z-decimalbox"/>
<combobox disabled="true" style="position:absolute;left:511px;top:180px;height:16px;width:50.0px;ime-mode:disabled;" text="人民币元" zclass="z-combobox"/>
</div>
</center>
</borderlayout>
</window>
......@@ -2,8 +2,9 @@ package com.brilliance.mda.runtime.mda.driver;
import com.brilliance.mda.runtime.annotation.Transaction;
import com.brilliance.mda.runtime.mda.*;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.EnvConfig;
import com.brilliance.mda.runtime.mda.snapshot.SnapshotFactory;
import com.brilliance.mda.runtime.mda.snapshot.SnapshotService;
import com.brilliance.mda.runtime.request.BaseVO;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -16,7 +17,6 @@ import java.util.*;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
public class MdaContext implements IContext {
private static final String DISPLAY_TEMPLATE_PATH = "displayTemplate/";
......@@ -51,6 +51,7 @@ public class MdaContext implements IContext {
//支持setValues函数
private Map<String, CodeEntity> valuesSet = new LinkedHashMap<>();
private SnapshotFactory snapshotFactory;
public MdaContext(IModule root) {
this.root = root;
......@@ -68,6 +69,7 @@ public class MdaContext implements IContext {
this.config = MdaEnv.getBean(EnvConfig.class);
this.display = MdaEnv.getBean(IDisplay.class);
this.locker = MdaEnv.getBean(ILocker.class);
this.snapshotFactory = MdaEnv.getBean(SnapshotFactory.class);
}
public MdaContext(IRuleEmitter emitter, IModule root) {
......@@ -251,18 +253,20 @@ public class MdaContext implements IContext {
@Override
public boolean saveDisplay(IPanel[] panels, String fileName) {
return false;
boolean f = false;
for (IPanel panel : panels) {
f = saveDisplay(panel.getPath(), fileName);
}
return f;
}
@Override
public boolean saveDisplay(IPanel panel, String fileName) {
return false;
return saveDisplay(panel.getPath(), fileName);
}
@Override
public boolean saveDisplay(String panelPath, String fileName) {
IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR);
String templateContent = getTemplateContent(panelPath);
if (StringUtils.isBlank(templateContent)) {
return false;
......@@ -271,19 +275,13 @@ public class MdaContext implements IContext {
int b = fileName.lastIndexOf("\\");
int e = fileName.lastIndexOf(".");
String trninr = fileName.substring(b + 1, e);
String sql = "select * from trn where inr='" + trninr + "'";
ctx.getDaoSession().dbExecuteSQL(sql);
Argument<String> objtyp = new Argument<String>("objtyp");
ctx.getDaoSession().dbFetchFields(objtyp);
ctx.getDaoSession().dbCloseCursor();
int errorCode = ctx.getErrorCode();
if (errorCode != NO_ERROR) {
// 将模板中需要的值放入map
SnapshotService snapshotService = snapshotFactory.getSnapshotService(panelPath);
if (snapshotService == null) {
return false;
}
// 将模板中需要的值放入map todo
Map valueMap = new HashMap();
valueMap.put("trninr", trninr);
Map<String, Object> valueMap = snapshotService.getValueMap(trninr);
if (this.display != null) {
return this.display.saveDisplay(fileName, templateContent, valueMap);
}
......
......@@ -19,6 +19,11 @@ public class PanelImpl extends AbstractBaseObject implements IPanel {
this.titleI18nKey = titleI18nKey;
}
public PanelImpl(String path) {
super(null);
this.name = path;
}
public synchronized void dispose() {
if (IPanel.log.isTraceEnabled())
IPanel.log.trace("Panel disposing:" + this.url);
......@@ -67,4 +72,5 @@ public class PanelImpl extends AbstractBaseObject implements IPanel {
sort();
return RuleUtils.invoke(this.eventRules, ctx, event, new int[0]);
}
}
package com.brilliance.mda.runtime.mda.snapshot;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/15
*/
@Service("bctp/bcts1")
public class Bcts1Service implements SnapshotService{
@Override
public Map<String,Object> getValueMap(String trnInr) {
HashMap<String, Object> map = new HashMap<>();
map.put("trninr",trnInr);
map.put("aa","brilliance");
return map;
}
}
package com.brilliance.mda.runtime.mda.snapshot;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/15
*/
@Component
public class SnapshotFactory {
@Autowired
private final Map<String, SnapshotService> serviceMap = Maps.newConcurrentMap();
public SnapshotService getSnapshotService(String path) {
return serviceMap.get(path);
}
}
package com.brilliance.mda.runtime.mda.snapshot;
import java.util.Map;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/15
*/
public interface SnapshotService {
/**
* 获取快照模板中所需的值
*
* @return
*/
Map<String, Object> getValueMap(String trnInr);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment