hxx 2 anos atrás
pai
commit
ba2bdc6f2f
22 arquivos alterados com 838 adições e 103 exclusões
  1. 1 0
      dbscript/init/generate/03-functionInit.sql
  2. 112 0
      generated/com/miniframe/generate/business/system/model/AFT001BaseModel.java
  3. 99 0
      generated/com/miniframe/generate/comm/httpclientapater/AFT001Client.java
  4. 64 0
      generated/com/miniframe/generate/comm/system/A_AFT001.java
  5. 12 0
      generated/com/miniframe/generate/comm/system/D_AFT001.java
  6. 48 0
      generated/validateform/a_aft001Form.xml
  7. 5 0
      generated/validator/resources_a_aft001Form_validator.properties
  8. 5 0
      generated/validator/resources_a_aft001Form_validator_zh_CN.properties
  9. 1 0
      generated/validator/resources_d_aft001Form_validator.properties
  10. 1 0
      generated/validator/resources_d_aft001Form_validator_zh_CN.properties
  11. 0 89
      src/main/java/com/miniframe/CellCenters.java
  12. 68 0
      src/main/java/com/miniframe/aftercure/ActionMsg.java
  13. 74 0
      src/main/java/com/miniframe/bisiness/system/AFT001Service.java
  14. 21 10
      src/main/java/com/miniframe/service/mq/CaeMQ.java
  15. 259 0
      src/main/java/com/miniframe/service/mq/CaeViewMFMqDynamic.java
  16. 5 0
      src/main/java/com/miniframe/service/mq/XIMQDynamic.java
  17. 0 1
      src/main/java/com/miniframe/websocket/WebsocketEndPoint.java
  18. 9 2
      src/test/java/com/miniframe/MqTest.java
  19. 44 0
      src/test/java/com/miniframe/comm/httpclientapater/AFT001Test.java
  20. 3 1
      系统设计/系统模块/SYSTEM(基础系统).csv
  21. 5 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT001_A(后处理消息操作消息发送).csv
  22. 2 0
      系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT001_D(后处理消息操作消息发送).csv

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

@@ -31,3 +31,4 @@ INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('C0
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('C00006', '基础系统','项目求解日志',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('C00007', '基础系统','项目求解每步数据',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('C00008', '基础系统','求解任务状态更新',true);
+INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AFT001', '基础系统','后处理消息发送',true);

+ 112 - 0
generated/com/miniframe/generate/business/system/model/AFT001BaseModel.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_AFT001;
+import com.miniframe.generate.comm.system.D_AFT001;
+
+/**
+ * 系统服务,“后处理消息操作消息发送”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class AFT001BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_SYSTEMHEAD a_systemhead;//上行头
+	D_SYSTEMHEAD d_systemhead;//下行头
+	A_AFT001 a_aft001;//上行体
+	D_AFT001 d_aft001;//下行体
+
+	public AFT001BaseModel(){
+		a_systemhead=new A_SYSTEMHEAD();
+		d_systemhead=new D_SYSTEMHEAD();
+		a_aft001=new A_AFT001();
+		d_aft001=new D_AFT001();
+	}
+
+	public void validater() throws Exception {
+		this.a_systemhead.validater();
+		this.a_aft001.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_AFT001.class);
+		this.a_aft001 = UtilTools.map2Obj(bodyMap, A_AFT001.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_aft001));
+
+		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_AFT001 getA_aft001() {
+		return a_aft001;
+	}
+
+	public void setA_aft001(A_AFT001 a_aft001) {
+		this.a_aft001=a_aft001;
+	}
+
+	public D_AFT001 getD_aft001() {
+		return this.d_aft001;
+	}
+
+	public void setD_aft001(D_AFT001 d_aft001) {
+		this.d_aft001=d_aft001;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpclientapater/AFT001Client.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_AFT001;
+import com.miniframe.generate.comm.system.D_SYSTEMHEAD;
+
+import com.miniframe.generate.business.system.model.AFT001BaseModel;
+
+public class AFT001Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(AFT001Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [系统服务->后处理消息操作消息发送((AFT001)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT001BaseModel execute(AFT001BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT001BaseModel execute(AFT001BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(AFT001BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(AFT001BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_systemhead().getTransCode())){
+			model.getA_systemhead().setTransCode("AFT001");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_systemhead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_aft001()));
+		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_AFT001 d_aft001 =  UtilTools.map2Obj(outMap, D_AFT001.class);
+			model.setD_systemhead(d_systemhead);
+			model.setD_aft001(d_aft001);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(AFT001BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public AFT001BaseModel execute(AFT001BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

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

@@ -0,0 +1,64 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 后处理消息操作消息发送
+ */
+public class A_AFT001 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;
+	}
+	String solverConfigid;//求解配置Id
+	/**
+	 *求解配置Id
+	 */
+	public void setSolverConfigid(String solverConfigid) {
+		this.solverConfigid=solverConfigid;
+	}
+	/**
+	 *求解配置Id
+	 */
+	public String getSolverConfigid() {
+		return this.solverConfigid;
+	}
+	String action;//操作
+	/**
+	 *操作
+	 */
+	public void setAction(String action) {
+		this.action=action;
+	}
+	/**
+	 *操作
+	 */
+	public String getAction() {
+		return this.action;
+	}
+	String paramJson;//操作参数
+	/**
+	 *操作参数
+	 */
+	public void setParamJson(String paramJson) {
+		this.paramJson=paramJson;
+	}
+	/**
+	 *操作参数
+	 */
+	public String getParamJson() {
+		return this.paramJson;
+	}
+}

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

@@ -0,0 +1,12 @@
+/**
+ * 系统服务
+ */
+package com.miniframe.generate.comm.system;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 后处理消息操作消息发送
+ */
+public class D_AFT001 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+}

+ 48 - 0
generated/validateform/a_aft001Form.xml

@@ -0,0 +1,48 @@
+<?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_aft001Form">
+<field property="id" depends="minlength,maxlength">
+    <arg0 key="a_aft001.id"/>
+    <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="action" depends="minlength,maxlength">
+    <arg0 key="a_aft001.action"/>
+    <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>2048</var-value>
+    </var>
+</field>
+<field property="paramJson" depends="minlength,maxlength">
+    <arg0 key="a_aft001.paramJson"/>
+    <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>128</var-value>
+    </var>
+</field>
+</form>
+</formset>
+</form-validation>

+ 5 - 0
generated/validator/resources_a_aft001Form_validator.properties

@@ -0,0 +1,5 @@
+a_aft001.id = \u9879\u76EEID
+a_aft001.solverConfigid = \u6C42\u89E3\u914D\u7F6EId
+a_aft001.action = \u64CD\u4F5C
+a_aft001.paramJson = \u64CD\u4F5C\u53C2\u6570
+a_aft001Form = true

+ 5 - 0
generated/validator/resources_a_aft001Form_validator_zh_CN.properties

@@ -0,0 +1,5 @@
+a_aft001.id = \u9879\u76EEID
+a_aft001.solverConfigid = \u6C42\u89E3\u914D\u7F6EId
+a_aft001.action = \u64CD\u4F5C
+a_aft001.paramJson = \u64CD\u4F5C\u53C2\u6570
+a_aft001Form = true

+ 1 - 0
generated/validator/resources_d_aft001Form_validator.properties

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

+ 1 - 0
generated/validator/resources_d_aft001Form_validator_zh_CN.properties

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

+ 0 - 89
src/main/java/com/miniframe/CellCenters.java

@@ -1,89 +0,0 @@
-package com.miniframe;
-
-import vtk.vtkActor;
-import vtk.vtkNativeLibrary;
-import vtk.vtkRenderWindow;
-import vtk.vtkRenderWindowInteractor;
-import vtk.vtkRenderer;
-import vtk.vtkImageData;
-import vtk.vtkCellCenters;
-import vtk.vtkDataSetMapper;
-
-
-public class CellCenters
-{
-    // -----------------------------------------------------------------
-    // Load VTK library and print which library was not properly loaded
-    static
-    {
-        if (!vtkNativeLibrary.LoadAllNativeLibraries())
-        {
-            for (vtkNativeLibrary lib : vtkNativeLibrary.values())
-            {
-                if (!lib.IsLoaded())
-                {
-                    System.out.println(lib.GetLibraryName() + " not loaded");
-                }
-            }
-        }
-        vtkNativeLibrary.DisableOutputWindow(null);
-    }
-    // -----------------------------------------------------------------
-
-    public static void main(String args[])
-    {
-        // Create an image data
-        vtkImageData imageData = new vtkImageData();
-
-        // Specify the size of the image data
-        imageData.SetDimensions(3,3,3); //尺寸
-        imageData.SetSpacing(1.0, 1.0, 1.0);//间距
-        imageData.SetOrigin(0.0, 0.0, 0.0);//原点
-
-        vtkCellCenters cellCentersFilter = new vtkCellCenters();//中心点过滤器
-        cellCentersFilter.SetInputData(imageData);
-        cellCentersFilter.VertexCellsOn();//顶点单元开启
-        cellCentersFilter.Update();
-
-        // Access the cell centers
-        for(int i = 0; i < cellCentersFilter.GetOutput().GetNumberOfPoints(); i++)
-        {
-            double p[] = new double[3];
-            cellCentersFilter.GetOutput().GetPoint(i, p);
-            System.out.print("Point " + " " + i + " : " + " " +  p[0] + " , " + p[1] + " , " + p[2] + "\n");
-        }
-
-        // Display the cell centers
-        vtkDataSetMapper centerMapper = new vtkDataSetMapper();
-        centerMapper.SetInputConnection(cellCentersFilter.GetOutputPort());
-
-        vtkActor centerActor = new vtkActor();
-        centerActor.SetMapper(centerMapper);
-
-        vtkDataSetMapper mapper = new vtkDataSetMapper();
-        mapper.SetInputData(imageData);
-
-        vtkActor actor = new vtkActor();
-        actor.SetMapper(mapper);
-        actor.GetProperty().SetRepresentationToWireframe();//只显示边
-
-        // Create the renderer, render window and interactor.
-        vtkRenderer ren = new vtkRenderer();
-        vtkRenderWindow renWin = new vtkRenderWindow();
-        renWin.AddRenderer(ren);
-        vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
-        iren.SetRenderWindow(renWin);
-
-        // Visualize
-        ren.AddActor(actor);
-        ren.AddActor(centerActor);
-
-        renWin.SetWindowName("中心点过滤器");
-        renWin.SetSize(300, 300);
-        renWin.Render();
-
-        iren.Initialize();
-        iren.Start();
-    }
-}
-

+ 68 - 0
src/main/java/com/miniframe/aftercure/ActionMsg.java

@@ -0,0 +1,68 @@
+package com.miniframe.aftercure;
+
+/**
+ * 操作消息
+ */
+public class ActionMsg {
+    /**
+     * 用户ID
+     */
+    private String usrId ;
+    /**
+     * 求解配置ID
+     */
+    private String solverConfigid ;
+    /**
+     * 项目ID
+     */
+    private String proId ;
+    /**
+     * 操作参数
+     */
+    private String paramJson ;
+    /**
+     * 操作
+     */
+    private String action ;
+
+
+    public String getUsrId() {
+        return usrId;
+    }
+
+    public void setUsrId(String usrId) {
+        this.usrId = usrId;
+    }
+
+    public String getSolverConfigid() {
+        return solverConfigid;
+    }
+
+    public void setSolverConfigid(String solverConfigid) {
+        this.solverConfigid = solverConfigid;
+    }
+
+    public String getProId() {
+        return proId;
+    }
+
+    public void setProId(String proId) {
+        this.proId = proId;
+    }
+
+    public String getParamJson() {
+        return paramJson;
+    }
+
+    public void setParamJson(String paramJson) {
+        this.paramJson = paramJson;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+}

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

@@ -0,0 +1,74 @@
+package com.miniframe.bisiness.system;
+
+import java.util.Map;
+
+import com.miniframe.aftercure.ActionMsg;
+import com.miniframe.core.ExecProcessFlow;
+import com.miniframe.core.ext.UtilTools;
+import com.miniframe.generate.business.system.model.AFT001BaseModel;
+import com.miniframe.model.system.SysUserSQLBuilder;
+import com.miniframe.model.system.dao.SysUserMapper;
+import com.miniframe.service.mq.CaeMQ;
+import com.miniframe.spring.mq.MFMqUtils;
+import com.miniframe.tools.XiJsonUtil;
+import org.json.JSONObject;
+
+/**
+ * 基础系统,“后处理消息发送”逻辑处理(重新生成不覆盖)。
+ */
+public class AFT001Service extends AFT001BaseModel implements ExecProcessFlow {
+	
+	private static final long serialVersionUID = -7051358269847459502L;
+		
+	/**
+	 * 基础系统,“后处理消息发送”业务核心处理
+ 	 */
+	public void transExecute() throws Exception {
+		String usrId =this.getA_systemhead().getUserId();
+		String solverConfigid =getA_aft001().getSolverConfigid();
+		String proId =getA_aft001().getId();
+		String paramJson =getA_aft001().getParamJson();
+		String action =getA_aft001().getAction();
+		ActionMsg msg =new ActionMsg();
+		msg.setUsrId(usrId);
+		msg.setSolverConfigid(solverConfigid);
+		msg.setProId(proId);
+		msg.setAction(action);
+		msg.setParamJson(paramJson);
+
+		System.out.println(XiJsonUtil.objectToJson(msg));
+
+
+
+		MFMqUtils.get(CaeMQ.class).sendCaein(XiJsonUtil.objectToJson(msg));
+
+	}
+	
+	/**
+	 * 基础系统,“后处理消息发送”业务前处理
+ 	 */
+	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();
+	}
+
+}

+ 21 - 10
src/main/java/com/miniframe/service/mq/CaeMQ.java

@@ -1,6 +1,8 @@
 package com.miniframe.service.mq;
 
+import com.miniframe.core.ext.UtilTools;
 import com.miniframe.spring.mq.*;
+import com.miniframe.websocket.WebsocketEndPoint;
 import com.rabbitmq.client.Channel;
 import org.springframework.amqp.core.AcknowledgeMode;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -37,12 +39,13 @@ import java.util.Map;
 
 @Component
 @ConditionalOnProperty(prefix = "mf.mq", name = "enable", havingValue = "true", matchIfMissing = false)
-public class CaeMQ extends AbstractMFMqDynamic {
+public class CaeMQ extends CaeViewMFMqDynamic {
 
     public CaeMQ(MFMqConfig mfMqConfig) {
         super(mfMqConfig);
-        setLocalMqOp(new CaeMqOp(),"caedyout");//设置监听
-//        setDefOp(new DefMqOp());//设置默认监听
+//        setLocalMqOp(new CaeMqOp(),"caedyout");//设置监听
+        setLocalMqOp(new CaeMqOp(),"caeout");//设置监听
+//        setDefOp(new CaeMqOp());//设置默认监听
     }
 
     @Override
@@ -52,7 +55,8 @@ public class CaeMQ extends AbstractMFMqDynamic {
 
     @Override
     public String[] declareListenerQueueLocal(){
-        return new String[]{"caedyout","caedyDlx"};
+        return new String[]{"caeout"};
+//        return new String[]{};
     }
 
 
@@ -61,9 +65,8 @@ public class CaeMQ extends AbstractMFMqDynamic {
         //TTLMS: 0,不设置x-message-ttl 参数
         //enableDlx : false 不申明dlx queue
         List<MFMqInfo> mfMqInfoList=new ArrayList<>();
-        mfMqInfoList.add(new MFMqInfo("caedyin","caedy",30000l,true));
-        mfMqInfoList.add(new MFMqInfo("caedyout","caedy",30000l,true));
-        mfMqInfoList.add(new MFMqInfo("caedyDlx","caedy",MFMqInfo.MFMQExchangeType.LOCAL_DLX));
+        mfMqInfoList.add(new MFMqInfo("caein","caein",0,false,MFMqInfo.MFMQExchangeType.GLOBAL_DATA));
+        mfMqInfoList.add(new MFMqInfo("caeout","caeout",0,false,MFMqInfo.MFMQExchangeType.GLOBAL_DATA));
         return mfMqInfoList;
     }
 
@@ -71,10 +74,16 @@ public class CaeMQ extends AbstractMFMqDynamic {
      * 向未处理信息队列 发送消息
      * @param data
      */
-    public void sendDynamic(String data){
-        sendData("caedyin",data);
+    public void sendCaein(String data){
+        sendData("caein",data);
+    }
+    /**
+     * 向未处理信息队列 发送消息
+     * @param data
+     */
+    public void sendCaeout(String data){
+        sendData("caeout",data);
     }
-
 
     /**
      * 返回消息队列 数据处理
@@ -83,6 +92,8 @@ public class CaeMQ extends AbstractMFMqDynamic {
         @Override
         public boolean handle(String data, long deliveryTag, Map<String, Object> headers, Channel channel) throws Exception {
             System.out.println("Queue : "+getAMQPConsumerQueue(headers)+", Data : "+ data);
+            WebsocketEndPoint point =  (WebsocketEndPoint) UtilTools.getBean("websocketEndPoint");
+            point.sendMessageToAllUsers(data);
             return true;
         }
     }

+ 259 - 0
src/main/java/com/miniframe/service/mq/CaeViewMFMqDynamic.java

@@ -0,0 +1,259 @@
+package com.miniframe.service.mq;
+
+import com.miniframe.core.ext.UtilTools;
+import com.miniframe.spring.mq.*;
+
+import com.rabbitmq.client.Channel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.amqp.core.AcknowledgeMode;
+import org.springframework.amqp.core.Binding;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.core.Queue;
+import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
+import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
+import org.springframework.amqp.support.converter.MessageConverter;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+public abstract class CaeViewMFMqDynamic extends AbstractMFMq {
+    private static Logger log = LoggerFactory.getLogger(CaeViewMFMqDynamic.class);
+    private List<String> listenQueue = new ArrayList();
+    private SimpleMessageListenerContainer messageListenerContainer = null;
+    private MFMqListenerInfo mfMqListenerInfo;
+    private Map<String, IMFMqOp> imfMqOpMap = new HashMap();
+    private IMFMqOp defOp = null;
+
+    public MFMqListenerInfo declareListenerInfo() {
+        return getDefMqListenerInfo();
+    }
+
+    public String[] declareListenerQueueLocal() {
+        return null;
+    }
+
+    public String[] declareListenerQueueGlobal() {
+        return null;
+    }
+
+    public CaeViewMFMqDynamic(MFMqConfig mfMqConfig) {
+        super(mfMqConfig);
+        if (this.declareListenerInfo() != null) {
+            this.mfMqListenerInfo = this.declareListenerInfo();
+        } else {
+            this.mfMqListenerInfo = new MFMqListenerInfo();
+            this.mfMqListenerInfo.setPrefetchCount(mfMqConfig.getRabbitProperties().getListener().getSimple().getPrefetch());
+            this.mfMqListenerInfo.setAcknowledgeMode(mfMqConfig.getRabbitProperties().getListener().getSimple().getAcknowledgeMode());
+            this.mfMqListenerInfo.setConcurrentConsumers(mfMqConfig.getRabbitProperties().getListener().getSimple().getConcurrency());
+            this.mfMqListenerInfo.setMaxConcurrentConsumers(mfMqConfig.getRabbitProperties().getListener().getSimple().getMaxConcurrency());
+        }
+
+        List<String> queueLocalList = null;
+        List<String> queueGlobalList = null;
+        if (this.declareListenerQueueLocal() != null) {
+            queueLocalList = Arrays.asList(this.declareListenerQueueLocal());
+            queueLocalList = (List)queueLocalList.stream().filter((str) -> {
+
+                return UtilTools.isNotNullAndBlank(str);
+            }).map((str) -> {
+                return this.toQueueLocalRealName(str);
+            }).distinct().collect(Collectors.toList());
+        } else {
+            queueLocalList = this.getQueueLocalNameList();
+        }
+
+        if (this.declareListenerQueueGlobal() != null) {
+            queueGlobalList = Arrays.asList(this.declareListenerQueueGlobal());
+            queueGlobalList = (List)queueGlobalList.stream().filter((str) -> {
+                return UtilTools.isNotNullAndBlank(str);
+            }).distinct().collect(Collectors.toList());
+        } else {
+            queueGlobalList = this.getQueueGlobalNameList();
+        }
+
+        this.listenQueue.addAll(queueLocalList);
+        this.listenQueue.addAll(queueGlobalList);
+        this.initContainer();
+    }
+
+    public String[] getListenQueueArray() {
+        String[] arr = (String[])this.listenQueue.toArray(new String[this.listenQueue.size()]);
+        return arr;
+    }
+
+    public static MFMqListenerInfo getDefMqListenerInfo() {
+        return new MFMqListenerInfo();
+    }
+
+    private void initContainer() {
+        this.messageListenerContainer = this.messageListenerContainer(this.getMfMqConfig().getConnectionFactory());
+        if (this.messageListenerContainer != null) {
+            this.start();
+        }
+
+    }
+
+    private SimpleMessageListenerContainer messageListenerContainer(CachingConnectionFactory connectionFactory) {
+        SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
+        container.setQueueNames(this.getListenQueueArray());
+        container.setExposeListenerChannel(true);
+        container.setPrefetchCount(this.mfMqListenerInfo.getPrefetchCount());
+        container.setConcurrentConsumers(this.mfMqListenerInfo.getConcurrentConsumers());
+        container.setMaxConcurrentConsumers(this.mfMqListenerInfo.getMaxConcurrentConsumers());
+        container.setAcknowledgeMode(this.mfMqListenerInfo.getAcknowledgeMode());
+        container.setMessageListener(new CaeViewMFMqDynamic.MessageConsumerHandler());
+        return container;
+    }
+
+    public void start() {
+        if (this.messageListenerContainer != null && !this.messageListenerContainer.isRunning()) {
+            this.messageListenerContainer.start();
+        }
+
+    }
+
+    public List<String> getQueueNameListInContainer() {
+        return (List)this.getQueueNameMapInContainer().keySet().stream().collect(Collectors.toList());
+    }
+
+    public Map<String, String> getQueueNameMapInContainer() {
+        Map<String, String> map = new HashMap();
+        if (this.messageListenerContainer != null) {
+            String[] queues = this.messageListenerContainer.getQueueNames();
+            String[] var3 = queues;
+            int var4 = queues.length;
+
+            for(int var5 = 0; var5 < var4; ++var5) {
+                String q = var3[var5];
+                map.put(q, q);
+            }
+        }
+
+        return map;
+    }
+
+    public void addQueueName(String queueName) {
+        this.addQueueName(queueName, MFMqInfo.MFMQExchangeType.LOCAL_DATA, (IMFMqOp)null);
+    }
+
+    public void addQueueName(String queueName, MFMqInfo.MFMQExchangeType exchangeType) {
+        this.addQueueName(queueName, exchangeType, (IMFMqOp)null);
+    }
+
+    public void addQueueName(String queueName, MFMqInfo.MFMQExchangeType exchangeType, IMFMqOp imfMqOp) {
+        if (!exchangeType.isValid()) {
+            exchangeType = MFMqInfo.MFMQExchangeType.LOCAL_DATA;
+        }
+
+        String queueRealName = queueName;
+        if (exchangeType.isLocal()) {
+            queueRealName = this.toQueueLocalRealName(queueName);
+        }
+
+        if (!this.getQueueNameMapInContainer().containsKey(queueRealName)) {
+            Queue queue;
+            queue = this.getMfMqConfig().createQueue(queueRealName, exchangeType);
+            Binding binding = this.getMfMqConfig().createBindingToExchange(queue, queueName, exchangeType);
+            this.getMfMqConfig().getAmqpAdmin().declareQueue(queue);
+            this.getMfMqConfig().getAmqpAdmin().declareBinding(binding);
+            if (this.messageListenerContainer != null) {
+                try {
+                    this.messageListenerContainer.addQueueNames(new String[]{queueRealName});
+                } catch (Exception var8) {
+                    log.error("addQueueNames ", var8);
+                }
+            }
+        }
+
+        this.imfMqOpMap.put(queueRealName, imfMqOp);
+    }
+
+    public IMFMqOp getLocalMqOp(String queueName) {
+        return (IMFMqOp)this.imfMqOpMap.get(this.toQueueLocalRealName(queueName));
+    }
+
+    public void setLocalMqOp(IMFMqOp imfMqOp, String... queueName) {
+        String[] var3 = queueName;
+        int var4 = queueName.length;
+
+        for(int var5 = 0; var5 < var4; ++var5) {
+            String name = var3[var5];
+            this.imfMqOpMap.put(this.toQueueLocalRealName(name), imfMqOp);
+        }
+
+    }
+
+    public IMFMqOp getGlobalMqOp(String queueName) {
+        return (IMFMqOp)this.imfMqOpMap.get(queueName);
+    }
+
+    public void setGlobalMqOp(IMFMqOp imfMqOp, String... queueName) {
+        String[] var3 = queueName;
+        int var4 = queueName.length;
+
+        for(int var5 = 0; var5 < var4; ++var5) {
+            String name = var3[var5];
+            this.imfMqOpMap.put(name, imfMqOp);
+        }
+
+    }
+
+    public void setDefOp(IMFMqOp imfMqOp) {
+        this.defOp = imfMqOp;
+    }
+
+    public IMFMqOp getDefOp() {
+        return this.defOp;
+    }
+
+    private class MessageConsumerHandler implements ChannelAwareMessageListener {
+        private MessageConsumerHandler() {
+        }
+        @Override
+        public void onMessage(Message message, Channel channel) throws Exception {
+            String data = "";
+            data = new String(message.getBody());
+            Long deliveryTag = message.getMessageProperties().getDeliveryTag();
+            Map<String, Object> headers = new HashMap();
+            headers.put("amqp_deliveryTag", message.getMessageProperties().getDeliveryTag());
+            headers.put("amqp_consumerQueue", message.getMessageProperties().getConsumerQueue());
+            headers.put("amqp_consumerTag", message.getMessageProperties().getConsumerTag());
+            headers.put("amqp_receivedExchange", message.getMessageProperties().getReceivedExchange());
+            headers.put("amqp_receivedRoutingKey", message.getMessageProperties().getReceivedRoutingKey());
+            try {
+                boolean isOp = true;
+                IMFMqOp imfMqOp = (IMFMqOp)CaeViewMFMqDynamic.this.imfMqOpMap.getOrDefault(message.getMessageProperties().getConsumerQueue(), (IMFMqOp)null);
+                if (imfMqOp == null) {
+                    imfMqOp = CaeViewMFMqDynamic.this.defOp;
+                }
+
+                if (imfMqOp != null) {
+                    try {
+                        isOp = imfMqOp.handle(data, deliveryTag, headers, channel);
+                    } catch (Exception var10) {
+                        isOp = false;
+                        CaeViewMFMqDynamic.log.error("Handle :" + data, var10);
+                    }
+                }
+
+                if (CaeViewMFMqDynamic.this.mfMqListenerInfo.getAcknowledgeMode() == AcknowledgeMode.MANUAL) {
+                    if (isOp) {
+                        CaeViewMFMqDynamic.this.getMfMqConfig().consumerAck(channel, deliveryTag);
+                    } else {
+                        CaeViewMFMqDynamic.this.getMfMqConfig().consumerNAck(channel, deliveryTag, false, true);
+                    }
+                }
+
+            } catch (Exception var11) {
+                CaeViewMFMqDynamic.log.error("onMessage : ", var11);
+                throw var11;
+            }
+        }
+
+
+
+    }
+}

+ 5 - 0
src/main/java/com/miniframe/service/mq/XIMQDynamic.java

@@ -1,12 +1,15 @@
 package com.miniframe.service.mq;
 
+import com.miniframe.core.ext.UtilTools;
 import com.miniframe.spring.mq.AbstractMFMqDynamic;
 import com.miniframe.spring.mq.IMFMqOp;
 import com.miniframe.spring.mq.MFMqConfig;
 import com.miniframe.spring.mq.MFMqInfo;
 import com.miniframe.spring.mq.MFMqListenerInfo;
+import com.miniframe.websocket.WebsocketEndPoint;
 import com.rabbitmq.client.Channel;
 import org.springframework.amqp.core.AcknowledgeMode;
+import org.springframework.amqp.support.converter.MessageConverter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.stereotype.Component;
 
@@ -97,9 +100,11 @@ public class XIMQDynamic extends AbstractMFMqDynamic {
 
     private static class DefMqOp implements IMFMqOp{
 
+
         @Override
         public boolean handle(String data, long deliveryTag, Map<String, Object> headers, Channel channel) throws Exception {
             System.out.println("DefMqOp Queue : "+getAMQPConsumerQueue(headers)+", Data : "+ data);
+
             return true;
         }
     }

+ 0 - 1
src/main/java/com/miniframe/websocket/WebsocketEndPoint.java

@@ -34,7 +34,6 @@ import org.springframework.web.socket.handler.TextWebSocketHandler;
 public class WebsocketEndPoint extends TextWebSocketHandler {
 
 	@Autowired
-
 	private final static Map<String, WebSocketSession> userMap = new ConcurrentHashMap<String, WebSocketSession>();
 
 	/**

+ 9 - 2
src/test/java/com/miniframe/MqTest.java

@@ -1,5 +1,6 @@
 package com.miniframe;
 
+import com.miniframe.service.mq.CaeMQ;
 import com.miniframe.service.mq.XIMQDynamic;
 import com.miniframe.spring.mq.MFMqUtils;
 import org.junit.jupiter.api.Test;
@@ -11,7 +12,13 @@ public class MqTest {
 
 
     @Test
-    void test(){
-        MFMqUtils.get(XIMQDynamic.class).sendData("asdfasdf");
+    void test() throws InterruptedException {
+        int i =1;
+        while (i<3){
+            i++ ;
+            MFMqUtils.get(CaeMQ.class).sendCaein("in message"+i);
+            Thread.sleep(1000);
+        }
+
     }
 }

+ 44 - 0
src/test/java/com/miniframe/comm/httpclientapater/AFT001Test.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_AFT001;
+import com.miniframe.generate.comm.httpclientapater.AFT001Client;
+import com.miniframe.generate.business.system.model.AFT001BaseModel;
+
+public class AFT001Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(AFT001Test.class);
+
+	/**
+	 * 后处理消息操作消息发送,获取报文体
+	 * @return
+	 */
+	public static A_AFT001 getA_aft001() {
+		A_AFT001 a_aft001 = new A_AFT001();
+
+		// ----------以下增加【后处理消息操作消息发送】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_aft001;
+	}
+	
+	/**
+	 * 运行客户端测试,后处理消息操作消息发送
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		AFT001BaseModel model = new AFT001BaseModel();
+		model.setA_systemhead(HttpclientapaterUtil.getA_systemhead("AFT001"));
+		model.setA_aft001(AFT001Test.getA_aft001());
+		AFT001Client client = new AFT001Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

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

@@ -29,4 +29,6 @@
 300005,C00005,求解,service,,
 300006,C00006,项目求解日志,service,,
 300007,C00007,项目求解每步数据,service,,
-300008,C00008,求解任务状态更新,service,,
+300008,C00008,求解任务状态更新,service,,
+
+400008,AFT001,后处理消息发送,service,,

+ 5 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT001_A(后处理消息操作消息发送).csv

@@ -0,0 +1,5 @@
+序号,英文名称,中文名称,数据类型,默认值,格式化,非空/引用,最小(长度/值),最大(长度/值),验证规则,标准数据ID,XML样式,TAG标签,映射/子标签,CDATA
+1,id,项目ID,string,,,,1,1024,,,,,,
+2,solverConfigid,求解配置Id,string,,,,,,,,,,,
+3,action,操作,string,,,,1,2048,,,,,,
+4,paramJson,操作参数,string,,,,1,128,,,,,,

+ 2 - 0
系统设计/通信设计/通讯报文/system(系统服务)/报文体/AFT001_D(后处理消息操作消息发送).csv

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