Browse Source

项目初始化

18870042648 2 years ago
parent
commit
999a942d76

+ 1 - 0
zjnytwo_cd/.gitignore

@@ -27,3 +27,4 @@ hs_err_pid*
 .settings
 target
 bin
+hotwebs

+ 26 - 0
zjnytwo_cd/.project

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<projectDescription> 
+  <name>zjnytwo_cd</name>  
+  <comment/>  
+  <projects></projects>  
+  <buildSpec> 
+    <buildCommand> 
+      <name>org.eclipse.jdt.core.javabuilder</name>  
+      <arguments></arguments> 
+    </buildCommand>  
+    <buildCommand> 
+      <name>com.yonyou.studio.udt.core.builder</name>  
+      <arguments></arguments> 
+    </buildCommand>  
+    <buildCommand>
+      <name>com.yonyou.ria.g2.riabuilder</name>
+      <arguments/>
+    </buildCommand>
+  </buildSpec>  
+  <natures> 
+    <nature>org.eclipse.jdt.core.javanature</nature>  
+    <nature>com.yonyou.studio.udt.core.nature</nature>  
+    <nature>com.yonyou.ria.g2.rianature</nature>
+  </natures> 
+</projectDescription>

+ 7 - 0
zjnytwo_cd/META-INF/module.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="gb2312"?>
+<module name="zjny">
+    <public>
+    </public>
+    <private>
+    </private>
+</module>

+ 36 - 0
zjnytwo_cd/META-INF/setup.ini

@@ -0,0 +1,36 @@
+#code
+code=${code}
+#name
+name=${name}
+#version
+version=${version}
+#setup disk type,examples: new(disk) or patch(patch disk)
+disk.type=new
+#Master be install ,values: true or false
+must.selected=false
+#Depend on previous version, Supported wildcards: * or ?
+preversion=
+#Depend on other products [code,name, version1, version2,...]&[code,name, version1, version2,...]
+required.related.module=
+db.create.script=dbcreate
+bill.templet.script=billtemplet
+query.templet.script=querytemplet
+report.templet.script=reporttemplet
+print.templet.script=printtemplet
+sys.templet.script=systemtemplet
+bill.type.script=billtype
+metadata.script=metadata
+busi.type.script=
+system.type.script=systemtype
+subj.class.script=
+voucher.templet.script=
+project.templet.script=
+business.script=business
+menu.script=funcregister
+ml.script=lang
+ddc.initdata=
+hasdynamictempletdata=
+need_deploy_ejb=
+containproductcode=
+dbml.script=dbml
+blob.script=querytemplet

+ 2 - 0
zjnytwo_cd/META-INF/version.properties

@@ -0,0 +1,2 @@
+version=NC Cloud 2020.05
+encoding=GBK

+ 8 - 0
zjnytwo_cd/bill/META-INF/server.upm

@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<module>
+<!--ÄÚ²¿½Ó¿Ú-->
+	<public>
+	</public>
+	<private>
+	</private>
+</module>

+ 8 - 0
zjnytwo_cd/bill/META-INF/service.upm

@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<module>
+<!--¶ÔÍâ½Ó¿Ú-->
+	<public>
+	</public>
+	<private>
+	</private>
+</module>

+ 1 - 0
zjnytwo_cd/bill/classes/.gitignore

@@ -0,0 +1 @@
+/nc/

+ 9 - 0
zjnytwo_cd/bill/classes/.gitkeep

@@ -0,0 +1,9 @@
+# .gitignore 
+
+# ignore all files in lib/
+
+# except for .gitkeep
+!.gitkeep
+# ignore TODO file in root directory,not subdir/TODO
+/TODO
+public

+ 3 - 0
zjnytwo_cd/bill/component.xml

@@ -0,0 +1,3 @@
+<component name="bill" displayname="bill">
+  <dependencies/>
+</component>

+ 3 - 0
zjnytwo_cd/bill/script/conf/initdata/items.xml

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<items>
+</items>

+ 9 - 0
zjnytwo_cd/bill/src/client/.gitkeep

@@ -0,0 +1,9 @@
+# .gitignore 
+
+# ignore all files in lib/
+
+# except for .gitkeep
+!.gitkeep
+# ignore TODO file in root directory,not subdir/TODO
+/TODO
+client

+ 88 - 0
zjnytwo_cd/bill/src/private/nc/bs/servlet/service/BaseServlet.java

@@ -0,0 +1,88 @@
+package nc.bs.servlet.service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+
+import org.codehaus.jettison.json.JSONException;
+
+import uap.json.JSONObject;
+
+/**
+ * 提供一些公共方法 
+ * 具体业务请在实际服务类实现
+ */
+@SuppressWarnings("restriction")
+public class BaseServlet {
+
+	public static String STATUS_SUCCESS ="success";
+	public static String STATUS_FAILURE ="fail";
+
+	/**
+	 * 格式化传入的数据,JSON化在具体服务类实现
+	 * @param req
+	 * @param resp
+	 * @param 类名
+	 * @return
+	 * @throws ServletException
+	 * @throws IOException
+	 */
+	protected String buildJson(HttpServletRequest req,
+							   HttpServletResponse resp, String classname)
+			throws ServletException, IOException {
+		req.setCharacterEncoding("UTF-8");
+		/* 设置格式为text/json */
+		resp.setContentType("text/json");
+		/* 设置字符集为'UTF-8' */
+		resp.setCharacterEncoding("UTF-8");
+		String reqJsonData = null;
+		// 接收流
+		BufferedReader reader = new BufferedReader(new InputStreamReader(
+				req.getInputStream(), "UTF-8"));
+		StringBuffer jsonStr = new StringBuffer();
+		try {
+			String line = "";
+			while ((line = reader.readLine()) != null) {
+				jsonStr.append(line);
+			}
+			if (jsonStr != null && !"".equals(jsonStr.toString())) {
+				reqJsonData = jsonStr.toString();
+//				PrLogger.error(new UFDateTime(System.currentTimeMillis()).toString()
+//						+ "客户端传入:" + classname + "~~" + reqJsonData);
+			} else {
+				throw new ServletException("传入的数据不合法!");
+			}
+		} catch (IOException e) {
+			throw new IOException("数据读取失败" + e.getMessage());
+		} finally {
+			reader.close();
+		}
+		return reqJsonData;
+	}
+
+
+
+	/**
+	 * 格式返回json数据
+	 *
+	 * @return
+	 * @throws JSONException
+	 * @throws Exception
+	 */
+	public static JSONObject formatRSJsonData(String status,String vbillcode,String message){
+		JSONObject rs = new JSONObject();
+		rs.put("status", status);
+		rs.put("vbillcode", vbillcode);
+		rs.put("message", message);
+		
+		
+		return rs;
+	}
+
+}

+ 81 - 0
zjnytwo_cd/bill/src/private/nc/log/NcLog.java

@@ -0,0 +1,81 @@
+package nc.log;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import nc.bs.framework.common.RuntimeEnv;
+
+import org.apache.log4j.Logger;
+/**
+ * ncLog
+ * @author YY
+ * @dateTime 2021-9-29 
+ */
+public class NcLog
+{
+  private static final Logger logger = Logger.getLogger(NcLog.class);
+  private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+  private static SimpleDateFormat format$ = new SimpleDateFormat("yyyy-MM-dd");
+
+  public static void info(String str)
+  {
+    String logFilePath = getLogFile();
+    File file = new File(logFilePath);
+    BufferedWriter fos = null;
+    try
+    {
+      fos = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
+      str = format.format(new Date()) + " " + str + "\r\n";
+      
+      fos.write(str + "\r\n");
+      fos.flush();
+    }
+    catch (Exception localException)
+    {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException)
+        {
+        }
+    }
+    finally {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException2)
+        {
+        }
+    }
+  }
+
+  private static String getLogFile() {
+    String destFileFolder = RuntimeEnv.getInstance().getNCHome() + File.separator + "mancLog" + File.separator + format$.format(new Date());
+    String destFilePath = destFileFolder + File.separator + "org.log";
+    File destFolder = new File(destFileFolder);
+    if (!destFolder.exists()) {
+      destFolder.mkdirs();
+    }
+    File destFile = new File(destFilePath);
+    if (!destFile.exists()) {
+      try
+      {
+        destFile.createNewFile();
+      }
+      catch (Exception e)
+      {
+        logger.info(e);
+      }
+    }
+    return destFilePath;
+  }
+}

+ 9 - 0
zjnytwo_cd/bill/src/public/.gitkeep

@@ -0,0 +1,9 @@
+# .gitignore 
+
+# ignore all files in lib/
+
+# except for .gitkeep
+!.gitkeep
+# ignore TODO file in root directory,not subdir/TODO
+/TODO
+public

+ 9 - 0
zjnytwo_cd/bill/src/test/.gitkeep

@@ -0,0 +1,9 @@
+# .gitignore 
+
+# ignore all files in lib/
+
+# except for .gitkeep
+!.gitkeep
+# ignore TODO file in root directory,not subdir/TODO
+/TODO
+test