Kaynağa Gözat

获取每步图片

huangxingxing 2 yıl önce
ebeveyn
işleme
f098cc6df3

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

@@ -36,4 +36,5 @@ INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D0
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('D00002', '基础系统','HCFDMapbc绑定',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AFT001', '基础系统','后处理消息发送',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AFT002', '基础系统','获取步数',true);
+INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AFT003', '基础系统','获取每步图片',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('FEM001', '基础系统','bdf文件绑定',true);

+ 112 - 0
generated/com/miniframe/generate/business/system/model/AFT003BaseModel.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_AFT003;
+import com.miniframe.generate.comm.system.D_AFT003;
+
+/**
+ * 系统服务,“获取每步图片”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class AFT003BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_SYSTEMHEAD a_systemhead;//上行头
+	D_SYSTEMHEAD d_systemhead;//下行头
+	A_AFT003 a_aft003;//上行体
+	D_AFT003 d_aft003;//下行体
+
+	public AFT003BaseModel(){
+		a_systemhead=new A_SYSTEMHEAD();
+		d_systemhead=new D_SYSTEMHEAD();
+		a_aft003=new A_AFT003();
+		d_aft003=new D_AFT003();
+	}
+
+	public void validater() throws Exception {
+		this.a_systemhead.validater();
+		this.a_aft003.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_AFT003.class);
+		this.a_aft003 = UtilTools.map2Obj(bodyMap, A_AFT003.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_aft003));
+
+		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_AFT003 getA_aft003() {
+		return a_aft003;
+	}
+
+	public void setA_aft003(A_AFT003 a_aft003) {
+		this.a_aft003=a_aft003;
+	}
+
+	public D_AFT003 getD_aft003() {
+		return this.d_aft003;
+	}
+
+	public void setD_aft003(D_AFT003 d_aft003) {
+		this.d_aft003=d_aft003;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpclientapater/AFT003Client.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_AFT003;
+import com.miniframe.generate.comm.system.D_SYSTEMHEAD;
+
+import com.miniframe.generate.business.system.model.AFT003BaseModel;
+
+public class AFT003Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(AFT003Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [系统服务->获取每步图片((AFT003)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT003BaseModel execute(AFT003BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT003BaseModel execute(AFT003BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(AFT003BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(AFT003BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_systemhead().getTransCode())){
+			model.getA_systemhead().setTransCode("AFT003");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_systemhead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_aft003()));
+		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_AFT003 d_aft003 =  UtilTools.map2Obj(outMap, D_AFT003.class);
+			model.setD_systemhead(d_systemhead);
+			model.setD_aft003(d_aft003);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(AFT003BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT003BaseModel execute(AFT003BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

+ 64 - 0
generated/com/miniframe/generate/comm/system/A_AFT003.java

@@ -0,0 +1,64 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 获取每步图片
+ */
+public class A_AFT003 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	String pid;//项目ID
+	/**
+	 *项目ID
+	 */
+	public void setPid(String pid) {
+		this.pid=pid;
+	}
+	/**
+	 *项目ID
+	 */
+	public String getPid() {
+		return this.pid;
+	}
+	String solverConfigId;//求解配置Id
+	/**
+	 *求解配置Id
+	 */
+	public void setSolverConfigId(String solverConfigId) {
+		this.solverConfigId=solverConfigId;
+	}
+	/**
+	 *求解配置Id
+	 */
+	public String getSolverConfigId() {
+		return this.solverConfigId;
+	}
+	String animationType;//渲染类型
+	/**
+	 *渲染类型
+	 */
+	public void setAnimationType(String animationType) {
+		this.animationType=animationType;
+	}
+	/**
+	 *渲染类型
+	 */
+	public String getAnimationType() {
+		return this.animationType;
+	}
+	String step;//步数
+	/**
+	 *步数
+	 */
+	public void setStep(String step) {
+		this.step=step;
+	}
+	/**
+	 *步数
+	 */
+	public String getStep() {
+		return this.step;
+	}
+}

+ 77 - 0
generated/com/miniframe/generate/comm/system/D_AFT003.java

@@ -0,0 +1,77 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 获取每步图片
+ */
+public class D_AFT003 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	String pid;//项目ID
+	/**
+	 *项目ID
+	 */
+	public void setPid(String pid) {
+		this.pid=pid;
+	}
+	/**
+	 *项目ID
+	 */
+	public String getPid() {
+		return this.pid;
+	}
+	String solverConfigId;//求解配置Id
+	/**
+	 *求解配置Id
+	 */
+	public void setSolverConfigId(String solverConfigId) {
+		this.solverConfigId=solverConfigId;
+	}
+	/**
+	 *求解配置Id
+	 */
+	public String getSolverConfigId() {
+		return this.solverConfigId;
+	}
+	String animationType;//渲染类型
+	/**
+	 *渲染类型
+	 */
+	public void setAnimationType(String animationType) {
+		this.animationType=animationType;
+	}
+	/**
+	 *渲染类型
+	 */
+	public String getAnimationType() {
+		return this.animationType;
+	}
+	String step;//步数
+	/**
+	 *步数
+	 */
+	public void setStep(String step) {
+		this.step=step;
+	}
+	/**
+	 *步数
+	 */
+	public String getStep() {
+		return this.step;
+	}
+	String img;//图片base64
+	/**
+	 *图片base64
+	 */
+	public void setImg(String img) {
+		this.img=img;
+	}
+	/**
+	 *图片base64
+	 */
+	public String getImg() {
+		return this.img;
+	}
+}

+ 31 - 0
generated/validateform/a_aft003Form.xml

@@ -0,0 +1,31 @@
+<?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_aft003Form">
+<field property="pid" depends="required,minlength,maxlength">
+    <arg0 key="a_aft003.pid"/>
+    <arg1 name="minlength" key="${var:minlength}"/>
+    <var>
+      <var-name>minlength</var-name>
+      <var-value>1</var-value>
+    </var>
+    <arg1 name="maxlength" key="${var:maxlength}"/>
+    <var>
+      <var-name>maxlength</var-name>
+      <var-value>1024</var-value>
+    </var>
+</field>
+<field property="solverConfigId" depends="required">
+    <arg0 key="a_aft003.solverConfigId"/>
+</field>
+<field property="animationType" depends="required">
+    <arg0 key="a_aft003.animationType"/>
+</field>
+<field property="step" depends="required">
+    <arg0 key="a_aft003.step"/>
+</field>
+</form>
+</formset>
+</form-validation>

+ 22 - 0
generated/validateform/d_aft003Form.xml

@@ -0,0 +1,22 @@
+<?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="d_aft003Form">
+<field property="pid" depends="minlength,maxlength">
+    <arg0 key="d_aft003.pid"/>
+    <arg1 name="minlength" key="${var:minlength}"/>
+    <var>
+      <var-name>minlength</var-name>
+      <var-value>1</var-value>
+    </var>
+    <arg1 name="maxlength" key="${var:maxlength}"/>
+    <var>
+      <var-name>maxlength</var-name>
+      <var-value>1024</var-value>
+    </var>
+</field>
+</form>
+</formset>
+</form-validation>

+ 5 - 0
generated/validator/resources_a_aft003Form_validator.properties

@@ -0,0 +1,5 @@
+a_aft003.pid = \u9879\u76EEID
+a_aft003.solverConfigId = \u6C42\u89E3\u914D\u7F6EId
+a_aft003.animationType = \u6E32\u67D3\u7C7B\u578B
+a_aft003.step = \u6B65\u6570
+a_aft003Form = true

+ 5 - 0
generated/validator/resources_a_aft003Form_validator_zh_CN.properties

@@ -0,0 +1,5 @@
+a_aft003.pid = \u9879\u76EEID
+a_aft003.solverConfigId = \u6C42\u89E3\u914D\u7F6EId
+a_aft003.animationType = \u6E32\u67D3\u7C7B\u578B
+a_aft003.step = \u6B65\u6570
+a_aft003Form = true

+ 6 - 0
generated/validator/resources_d_aft003Form_validator.properties

@@ -0,0 +1,6 @@
+d_aft003.pid = \u9879\u76EEID
+d_aft003.solverConfigId = \u6C42\u89E3\u914D\u7F6EId
+d_aft003.animationType = \u6E32\u67D3\u7C7B\u578B
+d_aft003.step = \u6B65\u6570
+d_aft003.img = \u56FE\u7247base64
+d_aft003Form = true

+ 6 - 0
generated/validator/resources_d_aft003Form_validator_zh_CN.properties

@@ -0,0 +1,6 @@
+d_aft003.pid = \u9879\u76EEID
+d_aft003.solverConfigId = \u6C42\u89E3\u914D\u7F6EId
+d_aft003.animationType = \u6E32\u67D3\u7C7B\u578B
+d_aft003.step = \u6B65\u6570
+d_aft003.img = \u56FE\u7247base64
+d_aft003Form = true

+ 74 - 0
src/main/java/com/miniframe/bisiness/system/AFT003Service.java

@@ -0,0 +1,74 @@
+package com.miniframe.bisiness.system;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import com.miniframe.core.ExecProcessFlow;
+import com.miniframe.core.ext.UtilTools;
+import com.miniframe.generate.business.system.model.AFT003BaseModel;
+import com.miniframe.model.system.AdiSolverConfigImg;
+import com.miniframe.model.system.AdiSolverConfigImgSQLBuilder;
+import com.miniframe.model.system.AdiSolverConfigSQLBuilder;
+import com.miniframe.model.system.dao.AdiSolverConfigImgMapper;
+
+/**
+ * 基础系统,“获取每步图片”逻辑处理(重新生成不覆盖)。
+ */
+public class AFT003Service extends AFT003BaseModel implements ExecProcessFlow {
+	
+	private static final long serialVersionUID = -7051358269847459502L;
+		
+	/**
+	 * 基础系统,“获取每步图片”业务核心处理
+ 	 */
+	public void transExecute() throws Exception {
+		String pid = this.getA_aft003().getPid();
+		String solverConfigId =this.getA_aft003().getSolverConfigId();
+		String animationType=this.getA_aft003().getAnimationType();
+		String step =this.getA_aft003().getStep();
+		AdiSolverConfigImgMapper configImgDao= UtilTools.getBean(AdiSolverConfigImgMapper.class);
+		AdiSolverConfigImgSQLBuilder sb = new AdiSolverConfigImgSQLBuilder();
+		AdiSolverConfigImgSQLBuilder.Criteria sc = sb.createCriteria();
+		sc.andPidEqualTo(pid);
+		sc.andActionEqualTo("animation");
+		sc.andStepEqualTo(step);
+		sc.andAnimationtypeEqualTo(animationType);
+		sc.andSolverConfigIdEqualTo(solverConfigId);
+		List<AdiSolverConfigImg> list = configImgDao.selectByExample(sb);
+		if(!list.isEmpty()){
+			this.getD_aft003().setAnimationType(animationType);
+			this.getD_aft003().setPid(pid);
+			this.getD_aft003().setSolverConfigId(solverConfigId);
+			this.getD_aft003().setStep(step);
+			this.getD_aft003().setImg(list.get(0).getImg());
+		}
+	}
+	
+	/**
+	 * 基础系统,“获取每步图片”业务前处理
+ 	 */
+	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/AFT003Test.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_AFT003;
+import com.miniframe.generate.comm.httpclientapater.AFT003Client;
+import com.miniframe.generate.business.system.model.AFT003BaseModel;
+
+public class AFT003Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(AFT003Test.class);
+
+	/**
+	 * 获取每步图片,获取报文体
+	 * @return
+	 */
+	public static A_AFT003 getA_aft003() {
+		A_AFT003 a_aft003 = new A_AFT003();
+
+		// ----------以下增加【获取每步图片】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_aft003;
+	}
+	
+	/**
+	 * 运行客户端测试,获取每步图片
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		AFT003BaseModel model = new AFT003BaseModel();
+		model.setA_systemhead(HttpclientapaterUtil.getA_systemhead("AFT003"));
+		model.setA_aft003(AFT003Test.getA_aft003());
+		AFT003Client client = new AFT003Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

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

@@ -37,5 +37,6 @@
 
 400008,AFT001,后处理消息发送,service,,
 400009,AFT002,获取步数,service,,
+4000010,AFT003,获取每步图片,service,,
 
 410001,FEM001,bdf文件绑定,service,,

+ 5 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT003_A(获取每步图片).csv

@@ -0,0 +1,5 @@
+序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
+1,pid,项目ID,string,,,是,1,1024,,,,,,
+2,solverConfigId,求解配置Id,string,,,是,,,,,,,,
+3,animationType,渲染类型,string,,,是,,,,,,,,
+4,step,步数,string,,,是,,,,,,,,

+ 6 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT003_D(获取每步图片).csv

@@ -0,0 +1,6 @@
+序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
+1,pid,项目ID,string,,,,1,1024,,,,,,
+2,solverConfigId,求解配置Id,string,,,,,,,,,,,
+3,animationType,渲染类型,string,,,,,,,,,,,
+4,step,步数,string,,,,,,,,,,,
+5,img,图片base64,string,,,,,,,,,,,