huangxingxing il y a 3 mois
Parent
commit
c07521b4ff

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

@@ -3,6 +3,7 @@ DELETE FROM SYS_FUNCTION;
 -- 管理系统
 -- 无锡发动机
 INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('ES0001', '无锡发动机','项目查询',true);
+INSERT INTO SYS_FUNCTION(FUNCTIONID, CLASSNAME, FUNCTIONNAME ,ENABLE)VALUES ('ES0002', '无锡发动机','项目新增修改',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/es/model/ES0002BaseModel.java

@@ -0,0 +1,112 @@
+package com.miniframe.generate.business.es.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.es.A_ESHEAD;
+import com.miniframe.generate.comm.es.D_ESHEAD;
+import com.miniframe.generate.comm.es.A_ES0002;
+import com.miniframe.generate.comm.es.D_ES0002;
+
+/**
+ * 无锡发动机,“项目新增修改”模型类(不要维护,重新生成将覆盖)。
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ES0002BaseModel extends BaseMapModel {
+
+	private static final long serialVersionUID = -1326184831746814093L;
+
+	A_ESHEAD a_eshead;//上行头
+	D_ESHEAD d_eshead;//下行头
+	A_ES0002 a_es0002;//上行体
+	D_ES0002 d_es0002;//下行体
+
+	public ES0002BaseModel(){
+		a_eshead=new A_ESHEAD();
+		d_eshead=new D_ESHEAD();
+		a_es0002=new A_ES0002();
+		d_es0002=new D_ES0002();
+	}
+
+	public void validater() throws Exception {
+		this.a_eshead.validater();
+		this.a_es0002.validater();
+	}
+
+	public void setTransMap(Map map) throws Exception {
+		Map headMap = HttpMapFormater.format(map, A_ESHEAD.class);
+		this.a_eshead = UtilTools.map2Obj(headMap, A_ESHEAD.class);
+		Map bodyMap = HttpMapFormater.format(map, A_ES0002.class);
+		this.a_es0002 = UtilTools.map2Obj(bodyMap, A_ES0002.class);
+	}
+
+	public Map getTransMap() throws Exception {
+		Map reMap = new LinkedHashMap();
+
+		if(UtilTools.isNullOrBlank((this.d_eshead).getTransCode())){
+			(this.d_eshead).setTransCode((this.a_eshead).getTransCode());
+		}
+		if(UtilTools.isNullOrBlank((this.d_eshead).getChannelNo())){
+			(this.d_eshead).setChannelNo((this.a_eshead).getChannelNo());
+		}
+		if(UtilTools.isNullOrBlank((this.d_eshead).getUserId())){
+			(this.d_eshead).setUserId((this.a_eshead).getUserId());
+		}
+        if(UtilTools.isNullOrBlank((this.d_eshead).getTransTime())){
+            (this.d_eshead).setTransTime(DateTimeFormatter.ofPattern(AppGlobalVariableSysconfig.DATETIMEFORMAT).format(ZonedDateTime.now()));
+        }
+
+		reMap.putAll(UtilTools.obj2Map(this.d_eshead));
+		reMap.putAll(UtilTools.obj2Map(this.d_es0002));
+
+		return reMap;
+	}
+
+	public A_ESHEAD getA_eshead() {
+		return this.a_eshead;
+	}
+
+	public void setA_eshead(A_ESHEAD a_eshead) {
+		this.a_eshead=a_eshead;
+	}
+
+	public D_ESHEAD getD_eshead() {
+		return d_eshead;
+	}
+
+	public void setD_eshead(D_ESHEAD d_eshead) {
+		this.d_eshead=d_eshead;
+	}
+
+	public A_ES0002 getA_es0002() {
+		return a_es0002;
+	}
+
+	public void setA_es0002(A_ES0002 a_es0002) {
+		this.a_es0002=a_es0002;
+	}
+
+	public D_ES0002 getD_es0002() {
+		return this.d_es0002;
+	}
+
+	public void setD_es0002(D_ES0002 d_es0002) {
+		this.d_es0002=d_es0002;
+	}
+
+	@Override
+	public String toString() {
+		try {
+			return UtilTools.obj2Json(this,true);
+		} catch (IOException e) {
+			return "";
+		}
+	}
+}

+ 116 - 0
generated/com/miniframe/generate/comm/es/A_ES0002.java

@@ -0,0 +1,116 @@
+/**
+ * 无锡发动机
+ */
+package com.miniframe.generate.comm.es;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 项目新增修改
+ */
+public class A_ES0002 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 uid;//用户id
+	/**
+	 *用户id
+	 */
+	public void setUid(String uid) {
+		this.uid=uid;
+	}
+	/**
+	 *用户id
+	 */
+	public String getUid() {
+		return this.uid;
+	}
+	String name;//项目名称
+	/**
+	 *项目名称
+	 */
+	public void setName(String name) {
+		this.name=name;
+	}
+	/**
+	 *项目名称
+	 */
+	public String getName() {
+		return this.name;
+	}
+	String remark;//项目描述
+	/**
+	 *项目描述
+	 */
+	public void setRemark(String remark) {
+		this.remark=remark;
+	}
+	/**
+	 *项目描述
+	 */
+	public String getRemark() {
+		return this.remark;
+	}
+	String image;//base64图片
+	/**
+	 *base64图片
+	 */
+	public void setImage(String image) {
+		this.image=image;
+	}
+	/**
+	 *base64图片
+	 */
+	public String getImage() {
+		return this.image;
+	}
+	String updateTime;//修改时间
+	/**
+	 *修改时间
+	 */
+	public void setUpdateTime(String updateTime) {
+		this.updateTime=updateTime;
+	}
+	/**
+	 *修改时间
+	 */
+	public String getUpdateTime() {
+		return this.updateTime;
+	}
+	String createTime;//创建时间
+	/**
+	 *创建时间
+	 */
+	public void setCreateTime(String createTime) {
+		this.createTime=createTime;
+	}
+	/**
+	 *创建时间
+	 */
+	public String getCreateTime() {
+		return this.createTime;
+	}
+	String flow;//流程
+	/**
+	 *流程
+	 */
+	public void setFlow(String flow) {
+		this.flow=flow;
+	}
+	/**
+	 *流程
+	 */
+	public String getFlow() {
+		return this.flow;
+	}
+}

+ 12 - 0
generated/com/miniframe/generate/comm/es/D_ES0002.java

@@ -0,0 +1,12 @@
+/**
+ * 无锡发动机
+ */
+package com.miniframe.generate.comm.es;
+import com.miniframe.core.BaseMapModel;
+import java.io.Serializable;
+/**
+ * 项目新增修改
+ */
+public class D_ES0002 extends BaseMapModel implements Serializable {
+	private static final long serialVersionUID = -1463838678425832212L;
+}

+ 99 - 0
generated/com/miniframe/generate/comm/httpesapater/ES0002Client.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.es.D_ES0002;
+import com.miniframe.generate.comm.es.D_ESHEAD;
+
+import com.miniframe.generate.business.es.model.ES0002BaseModel;
+
+public class ES0002Client {
+
+	private static final Logger logger = LoggerFactory.getLogger(ES0002Client.class);
+	private MFHttpRespInfo respInfo;
+
+	public MFHttpRespInfo getRespInfo(){
+		return respInfo;
+	}
+
+	/**
+	 * 调用 [无锡发动机->项目新增修改((ES0002)]的通讯接口
+	 * @param model 接口模型
+	 * @param extMap 扩展输入
+	 * @param url 请求地址
+	 * @return model 接口模型
+	 * @throws Exception
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public ES0002BaseModel execute(ES0002BaseModel model,final Map extMap,final String url) throws Exception {
+		this.executeToRespInfo(model,extMap,url);
+		return model;
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public ES0002BaseModel execute(ES0002BaseModel model,final Map extMap) throws Exception {
+		this.executeToRespInfo(model,extMap,null);
+		return model;
+	}
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public MFHttpRespInfo executeToRespInfo(ES0002BaseModel model,final Map extMap,final String url) throws Exception {
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(ES0002BaseModel) - start");
+		}
+
+		if(UtilTools.isNullOrBlank(model.getA_eshead().getTransCode())){
+			model.getA_eshead().setTransCode("ES0002");
+		}
+
+		Map inMap = new LinkedHashMap();
+		inMap.putAll(UtilTools.obj2Map(model.getA_eshead()));
+		inMap.putAll(UtilTools.obj2Map(model.getA_es0002()));
+		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_ESHEAD d_eshead =  UtilTools.map2Obj(outMap, D_ESHEAD.class);
+			D_ES0002 d_es0002 =  UtilTools.map2Obj(outMap, D_ES0002.class);
+			model.setD_eshead(d_eshead);
+			model.setD_es0002(d_es0002);
+
+
+		}
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("execute(ES0002BaseModel) - end");
+		}
+
+        this.respInfo=respInfo;
+
+		return respInfo;
+	}
+
+
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public ES0002BaseModel execute(ES0002BaseModel model) throws Exception {
+		return this.execute(model,null,null);
+	}
+
+
+}

+ 9 - 0
generated/validator/resources_a_es0002Form_validator.properties

@@ -0,0 +1,9 @@
+a_es0002.pid = \u9879\u76EEId
+a_es0002.uid = \u7528\u6237id
+a_es0002.name = \u9879\u76EE\u540D\u79F0
+a_es0002.remark = \u9879\u76EE\u63CF\u8FF0
+a_es0002.image = base64\u56FE\u7247
+a_es0002.updateTime = \u4FEE\u6539\u65F6\u95F4
+a_es0002.createTime = \u521B\u5EFA\u65F6\u95F4
+a_es0002.flow = \u6D41\u7A0B
+a_es0002Form = true

+ 9 - 0
generated/validator/resources_a_es0002Form_validator_zh_CN.properties

@@ -0,0 +1,9 @@
+a_es0002.pid = \u9879\u76EEId
+a_es0002.uid = \u7528\u6237id
+a_es0002.name = \u9879\u76EE\u540D\u79F0
+a_es0002.remark = \u9879\u76EE\u63CF\u8FF0
+a_es0002.image = base64\u56FE\u7247
+a_es0002.updateTime = \u4FEE\u6539\u65F6\u95F4
+a_es0002.createTime = \u521B\u5EFA\u65F6\u95F4
+a_es0002.flow = \u6D41\u7A0B
+a_es0002Form = true

+ 1 - 0
generated/validator/resources_d_es0002Form_validator.properties

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

+ 1 - 0
generated/validator/resources_d_es0002Form_validator_zh_CN.properties

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

+ 45 - 1
src/main/java/com/miniframe/bisiness/es/ES0001Service.java

@@ -1,8 +1,21 @@
 package com.miniframe.bisiness.es;
 
+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.es.model.ES0001BaseModel;
+import com.miniframe.generate.comm.es.D_ES0001_ROWS_RECODE;
+import com.miniframe.model.es.EsPro;
+import com.miniframe.model.es.dao.EsProMapper;
+import com.miniframe.model.system.SysUser;
+import com.miniframe.tools.XIDataUtils;
+import com.miniframe.tools.XIDateTimeUtils;
+import com.miniframe.tools.XIUtils;
+import org.apache.commons.lang3.StringUtils;
+import tk.mybatis.mapper.weekend.Weekend;
+import tk.mybatis.mapper.weekend.WeekendCriteria;
 
 /**
  * 无锡发动机,“项目查询”逻辑处理(重新生成不覆盖)。
@@ -15,7 +28,38 @@ public class ES0001Service extends ES0001BaseModel implements ExecProcessFlow {
 	 * 无锡发动机,“项目查询”业务核心处理
  	 */
 	public void transExecute() throws Exception {
-	
+		Integer count =this.getA_es0001().getCount();
+		Integer page =this.getA_es0001().getPage();
+		String searchtag =this.getA_es0001().getSearchtag();
+
+		EsProMapper proMapper = UtilTools.getBean(EsProMapper.class);
+
+		Weekend weekend = new Weekend<>(EsPro.class);
+		WeekendCriteria<EsPro, Object> keywordCriteria = weekend.weekendCriteria();
+		if (StringUtils.isNotEmpty(searchtag)) {
+			searchtag ="%"+searchtag+"%";
+			keywordCriteria.orLike(EsPro::getName, searchtag)
+					.orLike(EsPro::getRemark, searchtag);
+		}
+		int total = proMapper.selectCountByExample(weekend);
+		XIUtils.pageSet(page, count);
+		List<EsPro>  eList = proMapper.selectByExample(weekend);
+		List<D_ES0001_ROWS_RECODE> rows = new ArrayList<>();
+		for (EsPro p :eList) {
+			D_ES0001_ROWS_RECODE row = new D_ES0001_ROWS_RECODE();
+			row.setUid(p.getUid());
+			row.setPid(p.getId());
+			row.setCreateTime(XIDateTimeUtils.getStrFromDate(p.getCreateTime()));
+			row.setUpdateTime(XIDateTimeUtils.getStrFromDate(p.getUpdateTime()));
+			row.setFlow(p.getFlow());
+			row.setImage(p.getImage());
+			row.setName(p.getName());
+			row.setRemark(p.getRemark());
+			rows.add(row);
+		}
+		this.getD_es0001().setRows(rows);
+		this.getD_es0001().setTotal(total);
+
 	}
 	
 	/**

+ 48 - 0
src/main/java/com/miniframe/bisiness/es/ES0002Service.java

@@ -0,0 +1,48 @@
+package com.miniframe.bisiness.es;
+
+import java.util.Map;
+import com.miniframe.core.ExecProcessFlow;
+import com.miniframe.generate.business.es.model.ES0002BaseModel;
+
+/**
+ * 无锡发动机,“项目新增修改”逻辑处理(重新生成不覆盖)。
+ */
+public class ES0002Service extends ES0002BaseModel implements ExecProcessFlow {
+	
+	private static final long serialVersionUID = -7051358269847459502L;
+		
+	/**
+	 * 无锡发动机,“项目新增修改”业务核心处理
+ 	 */
+	public void transExecute() throws Exception {
+	
+	}
+	
+	/**
+	 * 无锡发动机,“项目新增修改”业务前处理
+ 	 */
+	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();
+	}
+
+}

+ 5 - 2
src/main/java/com/miniframe/tools/encode/XIDESedeCoderUtils.java

@@ -29,8 +29,9 @@ public class XIDESedeCoderUtils {
     private static final String S_CIPHER_ALGORITHM = "DESede/ECB/PKCS5Padding";
 
     public static void main(String[] args) throws Exception {
-        test();
-
+//        test();
+        String t = XIDESedeCoderUtils.enc("123456","03c540b1baf2434b8cffbb69f73b60bf");
+        System.out.println(t);
     }
 
     public static void test() throws Exception {
@@ -143,4 +144,6 @@ public class XIDESedeCoderUtils {
         return secretKey;
     }
 
+
+
 }

+ 44 - 0
src/test/java/com/miniframe/comm/httpesapater/ES0002Test.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.es.A_ES0002;
+import com.miniframe.generate.comm.httpesapater.ES0002Client;
+import com.miniframe.generate.business.es.model.ES0002BaseModel;
+
+public class ES0002Test {
+
+	private static final Logger logger = LoggerFactory.getLogger(ES0002Test.class);
+
+	/**
+	 * 项目新增修改,获取报文体
+	 * @return
+	 */
+	public static A_ES0002 getA_es0002() {
+		A_ES0002 a_es0002 = new A_ES0002();
+
+		// ----------以下增加【项目新增修改】上行体赋值-------------
+
+
+
+		// ---------------------------------------------------
+		return a_es0002;
+	}
+	
+	/**
+	 * 运行客户端测试,项目新增修改
+	 * 
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		ES0002BaseModel model = new ES0002BaseModel();
+		model.setA_eshead(HttpesapaterUtil.getA_eshead("ES0002"));
+		model.setA_es0002(ES0002Test.getA_es0002());
+		ES0002Client client = new ES0002Client();
+		logger.error("客户端发送前总线:\r\n"+model);
+		model = client.execute(model);
+		logger.error("客户端发送后总线:\r\n"+model);
+	}
+}

+ 2 - 1
系统设计/系统模块/ES(无锡发动机).csv

@@ -1,3 +1,4 @@
 序号,交易编码,交易名称,属性,实现类,交易描述
-100000,ES0001,项目查询,service,
+100001,ES0001,项目查询,service,
+100002,ES0002,项目新增修改,service,
 

+ 9 - 0
系统设计/通信设计/通讯报文/es(无锡发动机)/报文体/ES0002_A(项目新增修改).csv

@@ -0,0 +1,9 @@
+"序号","英文名称","中文名称","数据类型","默认值","格式化","非空/引用","最小(长度/值)","最大(长度/值)","验证规则","标准数据ID","XML样式","TAG标签","映射/子标签","CDATA"
+1,pid,项目Id,string,,,,,,,,,,,
+2,uid,用户id,string,,,,,,,,,,,
+3,name,项目名称,string,,,,,,,,,,,
+4,remark,项目描述,string,,,,,,,,,,,
+5,image,base64图片,string,,,,,,,,,,,
+6,updateTime,修改时间,string,,,,,,,,,,,
+7,createTime,创建时间,string,,,,,,,,,,,
+8,flow,流程,string,,,,,,,,,,,

+ 1 - 0
系统设计/通信设计/通讯报文/es(无锡发动机)/报文体/ES0002_D(项目新增修改).csv

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