Browse Source

数据字典

huangxingxing 1 month ago
parent
commit
9ffd969e0c

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

@@ -6,6 +6,7 @@ INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AC
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AC00003', '气动设计系统','项目删除',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AC00004', '气动设计系统','项目属性查询',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('AC00005', '气动设计系统','项目属性添加修改',true);
+INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('BES001', '气动设计系统','基础字典查询',true);
 -- 基础系统
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('A00000', '基础系统','获取图片验证码',true);
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('A00001', '基础系统','获取短信验证码',true);

+ 112 - 0
generated/com/miniframe/generate/business/ac/model/BES001BaseModel.java

@@ -0,0 +1,112 @@
+package com.miniframe.generate.business.ac.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.ac.A_ACHEAD;
+import com.miniframe.generate.comm.ac.D_ACHEAD;
+import com.miniframe.generate.comm.ac.A_BES001;
+import com.miniframe.generate.comm.ac.D_BES001;
+
+/**
+ * 气动设计,“基础字典查询”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class BES001BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_ACHEAD a_achead;//上行头
+	D_ACHEAD d_achead;//下行头
+	A_BES001 a_bes001;//上行体
+	D_BES001 d_bes001;//下行体
+
+	public BES001BaseModel(){
+		a_achead=new A_ACHEAD();
+		d_achead=new D_ACHEAD();
+		a_bes001=new A_BES001();
+		d_bes001=new D_BES001();
+	}
+
+	public void validater() throws Exception {
+		this.a_achead.validater();
+		this.a_bes001.validater();
+	}
+
+	public void setTransMap(Map map) throws Exception {
+		Map headMap = HttpMapFormater.format(map, A_ACHEAD.class);
+		this.a_achead = UtilTools.map2Obj(headMap, A_ACHEAD.class);
+		Map bodyMap = HttpMapFormater.format(map, A_BES001.class);
+		this.a_bes001 = UtilTools.map2Obj(bodyMap, A_BES001.class);
+	}
+
+	public Map getTransMap() throws Exception {
+		Map reMap = new LinkedHashMap();
+
+		if(UtilTools.isNullOrBlank((this.d_achead).getTransCode())){
+			(this.d_achead).setTransCode((this.a_achead).getTransCode());
+		}
+		if(UtilTools.isNullOrBlank((this.d_achead).getChannelNo())){
+			(this.d_achead).setChannelNo((this.a_achead).getChannelNo());
+		}
+		if(UtilTools.isNullOrBlank((this.d_achead).getUserId())){
+			(this.d_achead).setUserId((this.a_achead).getUserId());
+		}
+        if(UtilTools.isNullOrBlank((this.d_achead).getTransTime())){
+            (this.d_achead).setTransTime(DateTimeFormatter.ofPattern(AppGlobalVariableSysconfig.DATETIMEFORMAT).format(ZonedDateTime.now()));
+        }
+
+		reMap.putAll(UtilTools.obj2Map(this.d_achead));
+		reMap.putAll(UtilTools.obj2Map(this.d_bes001));
+
+		return reMap;
+	}
+
+	public A_ACHEAD getA_achead() {
+		return this.a_achead;
+	}
+
+	public void setA_achead(A_ACHEAD a_achead) {
+		this.a_achead=a_achead;
+	}
+
+	public D_ACHEAD getD_achead() {
+		return d_achead;
+	}
+
+	public void setD_achead(D_ACHEAD d_achead) {
+		this.d_achead=d_achead;
+	}
+
+	public A_BES001 getA_bes001() {
+		return a_bes001;
+	}
+
+	public void setA_bes001(A_BES001 a_bes001) {
+		this.a_bes001=a_bes001;
+	}
+
+	public D_BES001 getD_bes001() {
+		return this.d_bes001;
+	}
+
+	public void setD_bes001(D_BES001 d_bes001) {
+		this.d_bes001=d_bes001;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 25 - 0
generated/com/miniframe/generate/comm/ac/A_BES001.java

@@ -0,0 +1,25 @@
+/**
+ * 气动设计
+ */
+package com.miniframe.generate.comm.ac;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 基础字典查询
+ */
+public class A_BES001 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	String type;//类型
+	/**
+	 *类型
+	 */
+	public void setType(String type) {
+		this.type=type;
+	}
+	/**
+	 *类型
+	 */
+	public String getType() {
+		return this.type;
+	}
+}

+ 26 - 0
generated/com/miniframe/generate/comm/ac/D_BES001.java

@@ -0,0 +1,26 @@
+/**
+ * 气动设计
+ */
+package com.miniframe.generate.comm.ac;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+import java.util.*;
+/**
+ * 基础字典查询
+ */
+public class D_BES001 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	List <D_BES001_ROWS_RECODE> rows;//数据
+	/**
+	 *数据
+	 */
+	public void setRows(List <D_BES001_ROWS_RECODE> rows) {
+		this.rows=rows;
+	}
+	/**
+	 *数据
+	 */
+	public List <D_BES001_ROWS_RECODE> getRows() {
+		return this.rows;
+	}
+}

+ 51 - 0
generated/com/miniframe/generate/comm/ac/D_BES001_ROWS_RECODE.java

@@ -0,0 +1,51 @@
+/**
+ * 气动设计
+ */
+package com.miniframe.generate.comm.ac;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 基础字典查询->数据
+ */
+public class D_BES001_ROWS_RECODE extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+	String type;//类型
+	/**
+	 *类型
+	 */
+	public void setType(String type) {
+		this.type=type;
+	}
+	/**
+	 *类型
+	 */
+	public String getType() {
+		return this.type;
+	}
+	String tag;//显示
+	/**
+	 *显示
+	 */
+	public void setTag(String tag) {
+		this.tag=tag;
+	}
+	/**
+	 *显示
+	 */
+	public String getTag() {
+		return this.tag;
+	}
+	String val;//值
+	/**
+	 *值
+	 */
+	public void setVal(String val) {
+		this.val=val;
+	}
+	/**
+	 *值
+	 */
+	public String getVal() {
+		return this.val;
+	}
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpesapater/BES001Client.java

@@ -0,0 +1,99 @@
+package com.miniframe.generate.comm.httpesapater;
+
+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.ac.D_BES001;
+import com.miniframe.generate.comm.ac.D_ACHEAD;
+
+import com.miniframe.generate.business.ac.model.BES001BaseModel;
+
+public class BES001Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(BES001Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [气动设计->基础字典查询((BES001)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public BES001BaseModel execute(BES001BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public BES001BaseModel execute(BES001BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(BES001BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(BES001BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_achead().getTransCode())){
+			model.getA_achead().setTransCode("BES001");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_achead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_bes001()));
+		if(extMap!=null && extMap.size()>0){
+			inMap.putAll(extMap);
+		}
+
+		Transmitter httpesApater = (Transmitter) UtilTools.getBean("httpesApater");
+		MFHttpRespInfo respInfo;
+		if(UtilTools.isNotNullAndBlank(url)){
+			respInfo = httpesApater.doPostDataToRespInfo(inMap,url);
+		}else{
+			respInfo = httpesApater.doPostDataToRespInfo(inMap);
+		}
+
+		if(respInfo!=null) {
+			Map outMap=respInfo.getParamMap();
+			D_ACHEAD d_achead =  UtilTools.map2Obj(outMap, D_ACHEAD.class);
+			D_BES001 d_bes001 =  UtilTools.map2Obj(outMap, D_BES001.class);
+			model.setD_achead(d_achead);
+			model.setD_bes001(d_bes001);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(BES001BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public BES001BaseModel execute(BES001BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

+ 70 - 0
src/main/java/com/miniframe/bisiness/ac/BES001Service.java

@@ -0,0 +1,70 @@
+package com.miniframe.bisiness.ac;
+
+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.ac.model.BES001BaseModel;
+import com.miniframe.generate.comm.ac.D_BES001_ROWS_RECODE;
+import com.miniframe.model.system.SysAppcode;
+import com.miniframe.model.system.SysAppcodeSQLBuilder;
+import com.miniframe.model.system.dao.SysAppcodeMapper;
+
+/**
+ * 气动设计系统,“基础字典查询”逻辑处理(重新生成不覆盖)。
+ */
+public class BES001Service extends BES001BaseModel implements ExecProcessFlow {
+	
+	private static final long serialVersionUID = -7051358269847459502L;
+		
+	/**
+	 * 气动设计系统,“基础字典查询”业务核心处理
+ 	 */
+	public void transExecute() throws Exception {
+		String type = this.getA_bes001().getType();
+		SysAppcodeMapper codedao = UtilTools.getBean(SysAppcodeMapper.class);
+		SysAppcodeSQLBuilder csb = new SysAppcodeSQLBuilder();
+		SysAppcodeSQLBuilder.Criteria csc = csb.createCriteria();
+		csc.andCodeTypeEqualTo(type);
+		csb.setOrderByClause("code_order asc");
+		List<SysAppcode> clist = codedao.selectByExample(csb);
+		List<D_BES001_ROWS_RECODE> rows = new ArrayList<>();
+		for (SysAppcode c:clist) {
+			D_BES001_ROWS_RECODE row =new D_BES001_ROWS_RECODE();
+			row.setTag(c.getCodeDesc());
+			row.setVal(c.getCodeValue());
+			row.setType(c.getCodeType());
+			rows.add(row);
+		}
+		this.getD_bes001().setRows(rows);
+	}
+	
+	/**
+	 * 气动设计系统,“基础字典查询”业务前处理
+ 	 */
+	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/httpesapater/BES001Test.java

@@ -0,0 +1,44 @@
+package com.miniframe.comm.httpesapater;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.miniframe.comm.httpesapater.HttpesapaterUtil;
+import com.miniframe.generate.comm.ac.A_BES001;
+import com.miniframe.generate.comm.httpesapater.BES001Client;
+import com.miniframe.generate.business.ac.model.BES001BaseModel;
+
+public class BES001Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(BES001Test.class);
+
+	/**
+	 * 基础字典查询,获取报文体
+	 * @return
+	 */
+	public static A_BES001 getA_bes001() {
+		A_BES001 a_bes001 = new A_BES001();
+
+		// ----------以下增加【基础字典查询】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_bes001;
+	}
+	
+	/**
+	 * 运行客户端测试,基础字典查询
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		BES001BaseModel model = new BES001BaseModel();
+		model.setA_achead(HttpesapaterUtil.getA_achead("BES001"));
+		model.setA_bes001(BES001Test.getA_bes001());
+		BES001Client client = new BES001Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

+ 3 - 1
系统设计/系统模块/ac(气动设计系统).csv

@@ -3,4 +3,6 @@
 100002,AC00002,项目添加修改,service,
 100003,AC00003,项目删除,service,
 100004,AC00004,项目属性查询,service,
-100006,AC00005,项目属性添加修改,service,
+100006,AC00005,项目属性添加修改,service,
+
+110001,BES001,基础字典查询,service,

+ 2 - 0
系统设计/通信设计/通讯报文/ac(气动设计)/报文体/BES001_A(基础字典查询).csv

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

+ 5 - 0
系统设计/通信设计/通讯报文/ac(气动设计)/报文体/BES001_D(基础字典查询).csv

@@ -0,0 +1,5 @@
+"序号","英文名称","中文名称","数据类型","默认值","格式化","非空/引用","最小(长度/值)","最大(长度/值)","验证规则","标准数据ID","XML样式","TAG标签","映射/子标签","CDATA"
+1,rows,数据,list,,,,0,,,,,,,
+1.1,type,类型,string,,,,,,,,,,,
+1.2,tag,显示,string,,,,,,,,,,,
+1.3,val,值,string,,,,,,,,,,,