Commit d6727218 authored by 王业明's avatar 王业明
Browse files

Fix:优化编译文件格式,去除行尾空格等

parent d3824844
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.externalJavaSearch"/>
<classpathentry kind="output" path=""/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>External Plug-in Libraries</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
This diff is collapsed.
......@@ -138,7 +138,9 @@ public class CGC extends BapCompile
File objdir = folder.getFolder(INavigatorConstants.NV_NODE_RESCPL).getLocation().toFile();
File pyFile = new File(objdir, folder.getName() + ".py");
FileUtil.createFile(pyFile, content, IBapConstants.ENCODING_GBK);
String cgcVer = BapPreActivator.getDefault().getPreferenceStore().getString(IBapConstants.BAP_PREF_CPL_CGC_VER);
FileUtil.createFile(pyFile, content, IBapConstants.BAP_PREF_CPL_CGC_VER_V1_0_0.equals(cgcVer)
? IBapConstants.ENCODING_GBK : IBapConstants.ENCODING_UTF_8);
isError = false;
}
......
......@@ -35,10 +35,12 @@ import cn.com.bankit.common.castor.model.workflow.Node;
import cn.com.bankit.common.castor.model.workflow.Workflow;
import cn.com.bankit.ide.bap.compile.cgc.template.CodeUtil;
import cn.com.bankit.ide.bap.compile.cgc.template.TemplateUtil;
import cn.com.bankit.ide.bap.constants.IBapConstants;
import cn.com.bankit.ide.bap.constants.IComponentConstants;
import cn.com.bankit.ide.bap.constants.IWorkflowConstants;
import cn.com.bankit.ide.bap.navigator.model.desc.Directory;
import cn.com.bankit.ide.bap.navigator.model.desc.Filelist;
import cn.com.bankit.ide.bap.preferences.BapPreActivator;
import cn.com.bankit.ide.bap.util.BapString;
import cn.com.bankit.ide.bap.util.BapUtil;
import cn.com.bankit.ide.bap.util.file.BapFileUtil;
......@@ -104,7 +106,10 @@ public class BizCodeGenV1 extends CodeGen<IFolder>
content.put("crttime", BapUtil.getCurrentTime());
content.put("mdftime", BapUtil.getCurrentTime());
content.put("curdate", BapUtil.getCurrentTime());
content.put("version", "V1.0.0");
String cgcVer = BapPreActivator.getDefault().getPreferenceStore().getString(IBapConstants.BAP_PREF_CPL_CGC_VER);
// content.put("version", "V1.0.0");
content.put("version", IBapConstants.BAP_PREF_CPL_CGC_VER_V1_0_0.equals(cgcVer)
? "V1.0.0" : "V3_PY3");
content.put("content", "notempty");
// content.put("errcode", CodeUtil.getErrcode(0,0));
......
......@@ -31,8 +31,10 @@ import cn.com.bankit.common.castor.model.workflow.Node;
import cn.com.bankit.common.castor.model.workflow.Workflow;
import cn.com.bankit.ide.bap.compile.cgc.template.CodeUtil;
import cn.com.bankit.ide.bap.compile.cgc.template.TemplateUtil;
import cn.com.bankit.ide.bap.constants.IBapConstants;
import cn.com.bankit.ide.bap.constants.IComponentConstants;
import cn.com.bankit.ide.bap.constants.IWorkflowConstants;
import cn.com.bankit.ide.bap.preferences.BapPreActivator;
import cn.com.bankit.ide.bap.util.BapString;
import cn.com.bankit.ide.bap.util.BapUtil;
......@@ -76,7 +78,10 @@ public class TrdCodeGenV1 extends CodeGen<Workflow>
tradeInfo.put(IWorkflowConstants.WF_G_P_MODIFY_TIME, BapUtil.getCurrentTime());
}
tradeInfo.put("curdate", BapUtil.getCurrentTime());
tradeInfo.put("version", "V1.0.0");
String cgcVer = BapPreActivator.getDefault().getPreferenceStore().getString(IBapConstants.BAP_PREF_CPL_CGC_VER);
// tradeInfo.put("version", "V1.0.0");
tradeInfo.put("version", IBapConstants.BAP_PREF_CPL_CGC_VER_V1_0_0.equals(cgcVer)
? "V1.0.0" : "V3_PY3");
tradeInfo.put("content", "notempty");
//没有节点的情况下
if(root.getNode().length == 0 || root.getNode()[0].getNode().length == 0)
......
......@@ -445,11 +445,23 @@ public class CodeUtil
//兼用bapc,这里有些使用到了内部的 __MSG__
if("__ECD__".equals(inArg.trim()) || "__MSG__".equals(inArg.trim()) || "__RST__".equals(inArg.trim()))
{
String cgcVer = BapPreActivator.getDefault().getPreferenceStore().getString(IBapConstants.BAP_PREF_CPL_CGC_VER);
if(IBapConstants.BAP_PREF_CPL_CGC_VER_V3_PY3.equals(cgcVer)){
// "__RST__" not in __REQ__
// '__ECD__' in __REQ__
buffer.append(" if '" + inArg + "' in __REQ__ :\n");
//buffer.append(" if __REQ__.has_key('" + inArg + "') :\n");
buffer.append(" objArg" + (index) + " = __REQ__['"+ inArg+"']\n");
buffer.append(" else :\n");
buffer.append(" objArg" + (index) + " = None\n");
} else {
// inArg= "__REQ__.has_key('" + inArg + "') and __REQ__['"+ inArg+"'] or '" + inArg +"'" ;
buffer.append(" if __REQ__.has_key('" + inArg + "') :\n");
buffer.append(" objArg" + (index) + " = __REQ__['"+ inArg+"']\n");
buffer.append(" else :\n");
buffer.append(" objArg" + (index) + " = None \n");
buffer.append(" objArg" + (index) + " = None\n");
}
}
else
{
......
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