Quellcode durchsuchen

几何文件获取

huangxingxing vor 1 Jahr
Ursprung
Commit
f2486d311a
20 geänderte Dateien mit 409 neuen und 20 gelöschten Zeilen
  1. 1 0
      dbscript/init/generate/03-functionInit.sql
  2. 112 0
      generated/com/miniframe/generate/business/system/model/D000014BaseModel.java
  3. 99 0
      generated/com/miniframe/generate/comm/httpclientapater/D000014Client.java
  4. 38 0
      generated/com/miniframe/generate/comm/system/A_D000014.java
  5. 12 0
      generated/com/miniframe/generate/comm/system/D_D000014.java
  6. 0 13
      generated/com/miniframe/generate/comm/system/D_D00009.java
  7. 15 0
      generated/validateform/a_d000014Form.xml
  8. 3 0
      generated/validator/resources_a_d000014Form_validator.properties
  9. 3 0
      generated/validator/resources_a_d000014Form_validator_zh_CN.properties
  10. 1 0
      generated/validator/resources_d_d000014Form_validator.properties
  11. 1 0
      generated/validator/resources_d_d000014Form_validator_zh_CN.properties
  12. 1 2
      generated/validator/resources_d_d00009Form_validator.properties
  13. 1 2
      generated/validator/resources_d_d00009Form_validator_zh_CN.properties
  14. 71 0
      src/main/java/com/miniframe/bisiness/system/D000014Service.java
  15. 44 0
      src/test/java/com/miniframe/comm/httpclientapater/D000014Test.java
  16. 2 1
      系统设计/系统模块/SYSTEM(基础系统).csv
  17. 3 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000014_A(灾情结果几何文件获取).csv
  18. 1 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D000014_D(灾情结果几何文件获取).csv
  19. 1 1
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D00009_A(灾情结果文件获取).csv
  20. 0 1
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/D00009_D(灾情结果文件获取).csv

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

@@ -37,3 +37,4 @@ INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D0
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D000011', '基础系统','灾情点源数据删除',true);
 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);

+ 112 - 0
generated/com/miniframe/generate/business/system/model/D000014BaseModel.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_D000014;
+import com.miniframe.generate.comm.system.D_D000014;
+
+/**
+ * 系统服务,“灾情结果几何文件获取”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class D000014BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_SYSTEMHEAD a_systemhead;//上行头
+	D_SYSTEMHEAD d_systemhead;//下行头
+	A_D000014 a_d000014;//上行体
+	D_D000014 d_d000014;//下行体
+
+	public D000014BaseModel(){
+		a_systemhead=new A_SYSTEMHEAD();
+		d_systemhead=new D_SYSTEMHEAD();
+		a_d000014=new A_D000014();
+		d_d000014=new D_D000014();
+	}
+
+	public void validater() throws Exception {
+		this.a_systemhead.validater();
+		this.a_d000014.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_D000014.class);
+		this.a_d000014 = UtilTools.map2Obj(bodyMap, A_D000014.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_d000014));
+
+		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_D000014 getA_d000014() {
+		return a_d000014;
+	}
+
+	public void setA_d000014(A_D000014 a_d000014) {
+		this.a_d000014=a_d000014;
+	}
+
+	public D_D000014 getD_d000014() {
+		return this.d_d000014;
+	}
+
+	public void setD_d000014(D_D000014 d_d000014) {
+		this.d_d000014=d_d000014;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpclientapater/D000014Client.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_D000014;
+import com.miniframe.generate.comm.system.D_SYSTEMHEAD;
+
+import com.miniframe.generate.business.system.model.D000014BaseModel;
+
+public class D000014Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(D000014Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [系统服务->灾情结果几何文件获取((D000014)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000014BaseModel execute(D000014BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000014BaseModel execute(D000014BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(D000014BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(D000014BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_systemhead().getTransCode())){
+			model.getA_systemhead().setTransCode("D000014");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_systemhead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_d000014()));
+		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_D000014 d_d000014 =  UtilTools.map2Obj(outMap, D_D000014.class);
+			model.setD_systemhead(d_systemhead);
+			model.setD_d000014(d_d000014);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(D000014BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public D000014BaseModel execute(D000014BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

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

@@ -0,0 +1,38 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 灾情结果几何文件获取
+ */
+public class A_D000014 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	int aid;//事故ID
+	/**
+	 *事故ID
+	 */
+	public void setAid(int aid) {
+		this.aid=aid;
+	}
+	/**
+	 *事故ID
+	 */
+	public int getAid() {
+		return this.aid;
+	}
+	String stype;//灾情类型
+	/**
+	 *灾情类型
+	 */
+	public void setStype(String stype) {
+		this.stype=stype;
+	}
+	/**
+	 *灾情类型
+	 */
+	public String getStype() {
+		return this.stype;
+	}
+}

+ 12 - 0
generated/com/miniframe/generate/comm/system/D_D000014.java

@@ -0,0 +1,12 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 灾情结果几何文件获取
+ */
+public class D_D000014 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+}

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

@@ -9,17 +9,4 @@ import java.io.Serializable;
  */
 public class D_D00009 extends BaseMapModel implements Serializable {
 	private static final long serialVersionUID = -1463838678425832212L;
-	String id;//文件id
-	/**
-	 *文件id
-	 */
-	public void setId(String id) {
-		this.id=id;
-	}
-	/**
-	 *文件id
-	 */
-	public String getId() {
-		return this.id;
-	}
 }

+ 15 - 0
generated/validateform/a_d000014Form.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN" "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
+<!-- 灾情结果几何文件获取Form配置文件系统生成请勿修改,否则重新生成将覆盖 -->
+<form-validation>
+<formset>
+<form name="a_d000014Form">
+<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>

+ 3 - 0
generated/validator/resources_a_d000014Form_validator.properties

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

+ 3 - 0
generated/validator/resources_a_d000014Form_validator_zh_CN.properties

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

+ 1 - 0
generated/validator/resources_d_d000014Form_validator.properties

@@ -0,0 +1 @@
+d_d000014Form = false

+ 1 - 0
generated/validator/resources_d_d000014Form_validator_zh_CN.properties

@@ -0,0 +1 @@
+d_d000014Form = false

+ 1 - 2
generated/validator/resources_d_d00009Form_validator.properties

@@ -1,2 +1 @@
-d_d00009.id = \u6587\u4EF6id
-d_d00009Form = true
+d_d00009Form = false

+ 1 - 2
generated/validator/resources_d_d00009Form_validator_zh_CN.properties

@@ -1,2 +1 @@
-d_d00009.id = \u6587\u4EF6id
-d_d00009Form = true
+d_d00009Form = false

+ 71 - 0
src/main/java/com/miniframe/bisiness/system/D000014Service.java

@@ -0,0 +1,71 @@
+package com.miniframe.bisiness.system;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Map;
+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.template.TemplateGenerator;
+import com.miniframe.utils.MFMimeTypeUtils;
+
+/**
+ * 基础系统,“灾情几何文件获取”逻辑处理(重新生成不覆盖)。
+ */
+public class D000014Service extends D000014BaseModel implements ExecProcessFlow {
+	
+	private static final long serialVersionUID = -7051358269847459502L;
+		
+	/**
+	 * 基础系统,“灾情几何文件获取”业务核心处理
+ 	 */
+	public void transExecute() throws Exception {
+		Integer aid= getA_d000014().getAid();
+		String  stype =getA_d000014().getStype();
+
+//		String id = getA_b00022().getId();
+		String outPath="";
+		String fileName ="";
+		if(stype.endsWith("Fire")){
+			outPath= TemplateGenerator.BPATH+"/"+aid+"/fire/out";
+			fileName ="FireGrid.vtk";
+		}
+		if(stype.endsWith("Water")){
+			outPath=TemplateGenerator.BPATH+"/"+aid+"/water/out";
+			fileName ="WaterGrid.vtk";
+		}
+		Path path = Paths.get(outPath+"/"+fileName);
+		String mimeType = MFMimeTypeUtils.getMimeType(path);
+		HttpServerTransFile transFile = new HttpServerTransFile(fileName, mimeType, path);
+		UtilTools.setHttpServerTransFile(transFile);
+	}
+	
+	/**
+	 * 基础系统,“灾情几何文件获取”业务前处理
+ 	 */
+	public void preTransFlow() throws Exception {
+		this.validater();
+	}
+	
+	/**
+	 * 基础系统,“灾情几何文件获取”业务后处理
+ 	 */
+	public void afterTransFlow() throws Exception {
+	
+	}
+	
+	/**
+	 * 基础系统,“灾情几何文件获取”逻辑入口处理方法
+ 	 */
+ 	@SuppressWarnings("rawtypes")
+	@Override
+	public Map execute(Map vars) throws Exception {
+		this.setTransMap(vars);
+		preTransFlow();// 执行业务开始的规则检查和校验
+		transExecute();// 执行核心业务段
+		afterTransFlow();// 执行核心逻辑完成后的收尾逻辑
+		return this.getTransMap();
+	}
+
+}

+ 44 - 0
src/test/java/com/miniframe/comm/httpclientapater/D000014Test.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_D000014;
+import com.miniframe.generate.comm.httpclientapater.D000014Client;
+import com.miniframe.generate.business.system.model.D000014BaseModel;
+
+public class D000014Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(D000014Test.class);
+
+	/**
+	 * 灾情结果几何文件获取,获取报文体
+	 * @return
+	 */
+	public static A_D000014 getA_d000014() {
+		A_D000014 a_d000014 = new A_D000014();
+
+		// ----------以下增加【灾情结果几何文件获取】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_d000014;
+	}
+	
+	/**
+	 * 运行客户端测试,灾情结果几何文件获取
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		D000014BaseModel model = new D000014BaseModel();
+		model.setA_systemhead(HttpclientapaterUtil.getA_systemhead("D000014"));
+		model.setA_d000014(D000014Test.getA_d000014());
+		D000014Client client = new D000014Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

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

@@ -39,4 +39,5 @@
 300010,D000010,灾情点源数据修改,service,,
 300011,D000011,灾情点源数据删除,service,,
 300012,D000012,灾情点源检测数据修改,service,,
-300013,D000013,灾情点源检测数据删除,service,,
+300013,D000013,灾情点源检测数据删除,service,,
+300014,D000014,灾情几何文件获取,service,,

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

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

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

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

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

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

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

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