Browse Source

日志存储

huangxingxing 1 năm trước cách đây
mục cha
commit
2ebb84ccbb
19 tập tin đã thay đổi với 279 bổ sung51 xóa
  1. 1 0
      dbscript/init/generate/03-functionInit.sql
  2. 112 0
      generated/com/miniframe/generate/business/system/model/D000015BaseModel.java
  3. 99 0
      generated/com/miniframe/generate/comm/httpclientapater/D000015Client.java
  4. 0 13
      generated/com/miniframe/generate/comm/system/A_D000014.java
  5. 0 13
      generated/com/miniframe/generate/comm/system/A_D00009.java
  6. 0 3
      generated/validateform/a_d000014Form.xml
  7. 0 3
      generated/validateform/a_d00009Form.xml
  8. 0 1
      generated/validator/resources_a_d000014Form_validator.properties
  9. 0 1
      generated/validator/resources_a_d000014Form_validator_zh_CN.properties
  10. 0 1
      generated/validator/resources_a_d00009Form_validator.properties
  11. 0 1
      generated/validator/resources_a_d00009Form_validator_zh_CN.properties
  12. 8 6
      src/main/java/com/miniframe/bisiness/system/D000014Service.java
  13. 8 5
      src/main/java/com/miniframe/bisiness/system/D00009Service.java
  14. 44 0
      src/test/java/com/miniframe/comm/httpclientapater/D000015Test.java
  15. 3 1
      系统设计/系统模块/SYSTEM(基础系统).csv
  16. 0 1
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000014_A(灾情结果几何文件获取).csv
  17. 2 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000015_A(日志文件获取).csv
  18. 1 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000015_D(日志文件获取).csv
  19. 1 2
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D00009_A(灾情结果文件获取).csv

+ 1 - 0
dbscript/init/generate/03-functionInit.sql

@@ -38,3 +38,4 @@ INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D0
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D000012', '基础系统','灾情点源检测数据修改',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D000013', '基础系统','灾情点源检测数据删除',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D000014', '基础系统','灾情几何文件获取',true);
+INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D000015', '基础系统','日志文件获取',true);

+ 112 - 0
generated/com/miniframe/generate/business/system/model/D000015BaseModel.java

@@ -0,0 +1,112 @@
+package com.miniframe.generate.business.system.model;
+
+import java.util.Map;
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import com.miniframe.core.BaseMapModel;
+import com.miniframe.core.ext.UtilTools;
+import com.miniframe.core.ext.HttpMapFormater;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import com.miniframe.generate.global.AppGlobalVariableSysconfig;
+
+import com.miniframe.generate.comm.system.A_SYSTEMHEAD;
+import com.miniframe.generate.comm.system.D_SYSTEMHEAD;
+import com.miniframe.generate.comm.system.A_D000015;
+import com.miniframe.generate.comm.system.D_D000015;
+
+/**
+ * 系统服务,“日志文件获取”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class D000015BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_SYSTEMHEAD a_systemhead;//上行头
+	D_SYSTEMHEAD d_systemhead;//下行头
+	A_D000015 a_d000015;//上行体
+	D_D000015 d_d000015;//下行体
+
+	public D000015BaseModel(){
+		a_systemhead=new A_SYSTEMHEAD();
+		d_systemhead=new D_SYSTEMHEAD();
+		a_d000015=new A_D000015();
+		d_d000015=new D_D000015();
+	}
+
+	public void validater() throws Exception {
+		this.a_systemhead.validater();
+		this.a_d000015.validater();
+	}
+
+	public void setTransMap(Map map) throws Exception {
+		Map headMap = HttpMapFormater.format(map, A_SYSTEMHEAD.class);
+		this.a_systemhead = UtilTools.map2Obj(headMap, A_SYSTEMHEAD.class);
+		Map bodyMap = HttpMapFormater.format(map, A_D000015.class);
+		this.a_d000015 = UtilTools.map2Obj(bodyMap, A_D000015.class);
+	}
+
+	public Map getTransMap() throws Exception {
+		Map reMap = new LinkedHashMap();
+
+		if(UtilTools.isNullOrBlank((this.d_systemhead).getTransCode())){
+			(this.d_systemhead).setTransCode((this.a_systemhead).getTransCode());
+		}
+		if(UtilTools.isNullOrBlank((this.d_systemhead).getChannelNo())){
+			(this.d_systemhead).setChannelNo((this.a_systemhead).getChannelNo());
+		}
+		if(UtilTools.isNullOrBlank((this.d_systemhead).getUserId())){
+			(this.d_systemhead).setUserId((this.a_systemhead).getUserId());
+		}
+        if(UtilTools.isNullOrBlank((this.d_systemhead).getTransTime())){
+            (this.d_systemhead).setTransTime(DateTimeFormatter.ofPattern(AppGlobalVariableSysconfig.DATETIMEFORMAT).format(ZonedDateTime.now()));
+        }
+
+		reMap.putAll(UtilTools.obj2Map(this.d_systemhead));
+		reMap.putAll(UtilTools.obj2Map(this.d_d000015));
+
+		return reMap;
+	}
+
+	public A_SYSTEMHEAD getA_systemhead() {
+		return this.a_systemhead;
+	}
+
+	public void setA_systemhead(A_SYSTEMHEAD a_systemhead) {
+		this.a_systemhead=a_systemhead;
+	}
+
+	public D_SYSTEMHEAD getD_systemhead() {
+		return d_systemhead;
+	}
+
+	public void setD_systemhead(D_SYSTEMHEAD d_systemhead) {
+		this.d_systemhead=d_systemhead;
+	}
+
+	public A_D000015 getA_d000015() {
+		return a_d000015;
+	}
+
+	public void setA_d000015(A_D000015 a_d000015) {
+		this.a_d000015=a_d000015;
+	}
+
+	public D_D000015 getD_d000015() {
+		return this.d_d000015;
+	}
+
+	public void setD_d000015(D_D000015 d_d000015) {
+		this.d_d000015=d_d000015;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpclientapater/D000015Client.java

@@ -0,0 +1,99 @@
+package com.miniframe.generate.comm.httpclientapater;
+
+import com.miniframe.spring.httpclient.MFHttpRespInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import com.miniframe.core.Transmitter;
+import com.miniframe.core.ext.UtilTools;
+import com.miniframe.generate.comm.system.D_D000015;
+import com.miniframe.generate.comm.system.D_SYSTEMHEAD;
+
+import com.miniframe.generate.business.system.model.D000015BaseModel;
+
+public class D000015Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(D000015Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [系统服务->日志文件获取((D000015)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000015BaseModel execute(D000015BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000015BaseModel execute(D000015BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(D000015BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(D000015BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_systemhead().getTransCode())){
+			model.getA_systemhead().setTransCode("D000015");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_systemhead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_d000015()));
+		if(extMap!=null && extMap.size()>0){
+			inMap.putAll(extMap);
+		}
+
+		Transmitter httpclientApater = (Transmitter) UtilTools.getBean("httpclientApater");
+		MFHttpRespInfo respInfo;
+		if(UtilTools.isNotNullAndBlank(url)){
+			respInfo = httpclientApater.doPostDataToRespInfo(inMap,url);
+		}else{
+			respInfo = httpclientApater.doPostDataToRespInfo(inMap);
+		}
+
+		if(respInfo!=null) {
+			Map outMap=respInfo.getParamMap();
+			D_SYSTEMHEAD d_systemhead =  UtilTools.map2Obj(outMap, D_SYSTEMHEAD.class);
+			D_D000015 d_d000015 =  UtilTools.map2Obj(outMap, D_D000015.class);
+			model.setD_systemhead(d_systemhead);
+			model.setD_d000015(d_d000015);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(D000015BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000015BaseModel execute(D000015BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

+ 0 - 13
generated/com/miniframe/generate/comm/system/A_D000014.java

@@ -22,17 +22,4 @@ public class A_D000014 extends BaseMapModel implements Serializable {
 	public int getAid() {
 		return this.aid;
 	}
-	String stype;//灾情类型
-	/**
-	 *灾情类型
-	 */
-	public void setStype(String stype) {
-		this.stype=stype;
-	}
-	/**
-	 *灾情类型
-	 */
-	public String getStype() {
-		return this.stype;
-	}
 }

+ 0 - 13
generated/com/miniframe/generate/comm/system/A_D00009.java

@@ -22,19 +22,6 @@ public class A_D00009 extends BaseMapModel implements Serializable {
 	public int getAid() {
 		return this.aid;
 	}
-	String stype;//灾情类型
-	/**
-	 *灾情类型
-	 */
-	public void setStype(String stype) {
-		this.stype=stype;
-	}
-	/**
-	 *灾情类型
-	 */
-	public String getStype() {
-		return this.stype;
-	}
 	int step;//文件步数
 	/**
 	 *文件步数

+ 0 - 3
generated/validateform/a_d000014Form.xml

@@ -7,9 +7,6 @@
 <field property="aid" depends="required">
     <arg0 key="a_d000014.aid"/>
 </field>
-<field property="stype" depends="required">
-    <arg0 key="a_d000014.stype"/>
-</field>
 </form>
 </formset>
 </form-validation>

+ 0 - 3
generated/validateform/a_d00009Form.xml

@@ -7,9 +7,6 @@
 <field property="aid" depends="required">
     <arg0 key="a_d00009.aid"/>
 </field>
-<field property="stype" depends="required">
-    <arg0 key="a_d00009.stype"/>
-</field>
 <field property="step" depends="required">
     <arg0 key="a_d00009.step"/>
 </field>

+ 0 - 1
generated/validator/resources_a_d000014Form_validator.properties

@@ -1,3 +1,2 @@
 a_d000014.aid = \u4E8B\u6545ID
-a_d000014.stype = \u707E\u60C5\u7C7B\u578B
 a_d000014Form = true

+ 0 - 1
generated/validator/resources_a_d000014Form_validator_zh_CN.properties

@@ -1,3 +1,2 @@
 a_d000014.aid = \u4E8B\u6545ID
-a_d000014.stype = \u707E\u60C5\u7C7B\u578B
 a_d000014Form = true

+ 0 - 1
generated/validator/resources_a_d00009Form_validator.properties

@@ -1,4 +1,3 @@
 a_d00009.aid = \u4E8B\u6545ID
-a_d00009.stype = \u707E\u60C5\u7C7B\u578B
 a_d00009.step = \u6587\u4EF6\u6B65\u6570
 a_d00009Form = true

+ 0 - 1
generated/validator/resources_a_d00009Form_validator_zh_CN.properties

@@ -1,4 +1,3 @@
 a_d00009.aid = \u4E8B\u6545ID
-a_d00009.stype = \u707E\u60C5\u7C7B\u578B
 a_d00009.step = \u6587\u4EF6\u6B65\u6570
 a_d00009Form = true

+ 8 - 6
src/main/java/com/miniframe/bisiness/system/D000014Service.java

@@ -7,6 +7,8 @@ import com.miniframe.core.ExecProcessFlow;
 import com.miniframe.core.ext.UtilTools;
 import com.miniframe.generate.business.system.model.D000014BaseModel;
 import com.miniframe.httpserver.HttpServerTransFile;
+import com.miniframe.model.system.DAccident;
+import com.miniframe.model.system.dao.DAccidentMapper;
 import com.miniframe.template.TemplateGenerator;
 import com.miniframe.utils.MFMimeTypeUtils;
 
@@ -22,17 +24,17 @@ public class D000014Service extends D000014BaseModel implements ExecProcessFlow
  	 */
 	public void transExecute() throws Exception {
 		Integer aid= getA_d000014().getAid();
-		String  stype =getA_d000014().getStype();
-
+		DAccidentMapper accidentDao  = UtilTools.getBean(DAccidentMapper.class);
+		DAccident accident= accidentDao.selectByPrimaryKey(aid);
 //		String id = getA_b00022().getId();
 		String outPath="";
 		String fileName ="";
-		if(stype.endsWith("Fire")){
-			outPath= TemplateGenerator.BPATH+"/"+aid+"/fire/out";
+		if(accident.getStype().endsWith("Fire")){
+			outPath= TemplateGenerator.BPATH+"/"+aid+"/"+accident.getSid()+"/fire/out";
 			fileName ="FireGrid.vtk";
 		}
-		if(stype.endsWith("Water")){
-			outPath=TemplateGenerator.BPATH+"/"+aid+"/water/out";
+		if(accident.getStype().endsWith("Water")){
+			outPath=TemplateGenerator.BPATH+"/"+aid+"/"+accident.getSid()+"/water/out";
 			fileName ="WaterGrid.vtk";
 		}
 		Path path = Paths.get(outPath+"/"+fileName);

+ 8 - 5
src/main/java/com/miniframe/bisiness/system/D00009Service.java

@@ -8,7 +8,9 @@ import com.miniframe.core.exception.BusinessException;
 import com.miniframe.core.ext.UtilTools;
 import com.miniframe.generate.business.system.model.D00009BaseModel;
 import com.miniframe.httpserver.HttpServerTransFile;
+import com.miniframe.model.system.DAccident;
 import com.miniframe.model.system.SysFile;
+import com.miniframe.model.system.dao.DAccidentMapper;
 import com.miniframe.model.system.dao.SysFileMapper;
 import com.miniframe.template.TemplateGenerator;
 import com.miniframe.tools.XIFileUtils;
@@ -27,17 +29,18 @@ public class D00009Service extends D00009BaseModel implements ExecProcessFlow {
 	public void transExecute() throws Exception {
 		Integer aid= getA_d00009().getAid();
 		Integer step =getA_d00009().getStep();
-		String  stype =getA_d00009().getStype();
+		DAccidentMapper accidentDao  = UtilTools.getBean(DAccidentMapper.class);
+		DAccident accident= accidentDao.selectByPrimaryKey(aid);
 
 //		String id = getA_b00022().getId();
 		String outPath="";
 		String fileName ="";
-		if(stype.endsWith("Fire")){
-			outPath=TemplateGenerator.BPATH+"/"+aid+"/fire/out";
+		if(accident.getStype().endsWith("Fire")){
+			outPath=TemplateGenerator.BPATH+"/"+aid+"/"+accident.getJid()+"/fire/out";
 			fileName ="POST"+step+".vtk";
 		}
-		if(stype.endsWith("Water")){
-			outPath=TemplateGenerator.BPATH+"/"+aid+"/water/out";
+		if(accident.getStype().endsWith("Water")){
+			outPath=TemplateGenerator.BPATH+"/"+aid+"/"+accident.getJid()+"/water/out";
 			fileName ="Post"+step+".vtk";
 		}
 		Path path = Paths.get(outPath+"/"+fileName);

+ 44 - 0
src/test/java/com/miniframe/comm/httpclientapater/D000015Test.java

@@ -0,0 +1,44 @@
+package com.miniframe.comm.httpclientapater;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.miniframe.comm.httpclientapater.HttpclientapaterUtil;
+import com.miniframe.generate.comm.system.A_D000015;
+import com.miniframe.generate.comm.httpclientapater.D000015Client;
+import com.miniframe.generate.business.system.model.D000015BaseModel;
+
+public class D000015Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(D000015Test.class);
+
+	/**
+	 * 日志文件获取,获取报文体
+	 * @return
+	 */
+	public static A_D000015 getA_d000015() {
+		A_D000015 a_d000015 = new A_D000015();
+
+		// ----------以下增加【日志文件获取】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_d000015;
+	}
+	
+	/**
+	 * 运行客户端测试,日志文件获取
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		D000015BaseModel model = new D000015BaseModel();
+		model.setA_systemhead(HttpclientapaterUtil.getA_systemhead("D000015"));
+		model.setA_d000015(D000015Test.getA_d000015());
+		D000015Client client = new D000015Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

+ 3 - 1
系统设计/系统模块/SYSTEM(基础系统).csv

@@ -40,4 +40,6 @@
 300011,D000011,灾情点源数据删除,service,,
 300012,D000012,灾情点源检测数据修改,service,,
 300013,D000013,灾情点源检测数据删除,service,,
-300014,D000014,灾情几何文件获取,service,,
+300014,D000014,灾情几何文件获取,service,,
+
+300015,D000015,日志文件获取,service,,

+ 0 - 1
系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000014_A(灾情结果几何文件获取).csv

@@ -1,3 +1,2 @@
 序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
 1,aid,事故ID,int,,,是,,,,,,,,
-2,stype,灾情类型,string,,,是,,,,,,,,

+ 2 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000015_A(日志文件获取).csv

@@ -0,0 +1,2 @@
+序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
+1,aid,事故ID,int,,,是,,,,,,,,

+ 1 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000015_D(日志文件获取).csv

@@ -0,0 +1 @@
+序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA

+ 1 - 2
系统设计/通信设计/通讯报文/system(系统服务)/报文体/D00009_A(灾情结果文件获取).csv

@@ -1,4 +1,3 @@
 序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
 1,aid,事故ID,int,,,是,,,,,,,,
-2,stype,灾情类型,string,,,是,,,,,,,,
-3,step,文件步数,int,,,是,,,,,,,,
+2,step,文件步数,int,,,是,,,,,,,,