diff --git a/skyeye-common/src/main/java/com/skyeye/common/constans/Constants.java b/skyeye-common/src/main/java/com/skyeye/common/constans/Constants.java index edd9c95e29838dc81099444e6650ed74343670d0..4a85bc2878ca2292f0bf50c423ffac9655305368 100644 --- a/skyeye-common/src/main/java/com/skyeye/common/constans/Constants.java +++ b/skyeye-common/src/main/java/com/skyeye/common/constans/Constants.java @@ -87,7 +87,8 @@ public class Constants { /** * 保存模板说明的redis的key */ - public static final String REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTOCODEMODEL = "exexplaintocodemodel"; + public static final String REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTOCODEMODEL = "exexplaintocodemodel";//代码生成器模板规范说明key + public static final String REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT = "exexplaintodsformcontent";//动态表单内容项模板规范说明key } diff --git a/skyeye-dao/src/main/java/com/skyeye/exexplain/dao/ExExplainToDsFormContentDao.java b/skyeye-dao/src/main/java/com/skyeye/exexplain/dao/ExExplainToDsFormContentDao.java new file mode 100644 index 0000000000000000000000000000000000000000..c682587a4baf61e6fea69c7eca5d54eea8fbc85c --- /dev/null +++ b/skyeye-dao/src/main/java/com/skyeye/exexplain/dao/ExExplainToDsFormContentDao.java @@ -0,0 +1,13 @@ +package com.skyeye.exexplain.dao; + +import java.util.Map; + +public interface ExExplainToDsFormContentDao { + + public int insertExExplainToDsFormContentMation(Map map) throws Exception; + + public Map queryExExplainToDsFormContentMation(Map map) throws Exception; + + public int editExExplainToDsFormContentMationById(Map map) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/exexplain/service/ExExplainToDsFormContentService.java b/skyeye-service/src/main/java/com/skyeye/exexplain/service/ExExplainToDsFormContentService.java new file mode 100644 index 0000000000000000000000000000000000000000..d1daccd6a0fd8dd04d8cef2ab255ae871d85f0ed --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/exexplain/service/ExExplainToDsFormContentService.java @@ -0,0 +1,16 @@ +package com.skyeye.exexplain.service; + +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +public interface ExExplainToDsFormContentService { + + public void insertExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void queryExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editExExplainToDsFormContentMationById(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void queryExExplainToDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToCodeModelServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToCodeModelServiceImpl.java index f9df2d2bf6276c04282a6ccbcd03b645d4063dc8..5ef68c62abf74a0d4832e39535d27f8a2200ee23 100644 --- a/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToCodeModelServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToCodeModelServiceImpl.java @@ -7,9 +7,7 @@ import org.springframework.stereotype.Service; import com.skyeye.exexplain.dao.ExExplainToCodeModelDao; import com.skyeye.exexplain.service.ExExplainToCodeModelService; import com.skyeye.jedis.JedisClient; - import net.sf.json.JSONObject; - import com.alibaba.fastjson.JSON; import com.skyeye.common.constans.Constants; import com.skyeye.common.object.InputObject; diff --git a/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToDsFormContentServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToDsFormContentServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..ed6f8163075b6d45c351e7005a772e317698a6d0 --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/exexplain/service/impl/ExExplainToDsFormContentServiceImpl.java @@ -0,0 +1,125 @@ +package com.skyeye.exexplain.service.impl; + +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.skyeye.exexplain.dao.ExExplainToDsFormContentDao; +import com.skyeye.exexplain.service.ExExplainToDsFormContentService; +import com.skyeye.jedis.JedisClient; +import net.sf.json.JSONObject; +import com.alibaba.fastjson.JSON; +import com.skyeye.common.constans.Constants; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.ToolUtil; + +@Service +public class ExExplainToDsFormContentServiceImpl implements ExExplainToDsFormContentService{ + + @Autowired + private ExExplainToDsFormContentDao exExplainToDsFormContentDao; + + @Autowired + public JedisClient jedisClient; + + /** + * + * @Title: insertExExplainToDsFormContentMation + * @Description: 添加动态表单内容项说明信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void insertExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map bean = exExplainToDsFormContentDao.queryExExplainToDsFormContentMation(map); + if(bean == null){ + Map user = inputObject.getLogParams(); + String id = ToolUtil.getSurFaceId(); + map.put("id", id); + map.put("createId", user.get("id")); + map.put("createTime", ToolUtil.getTimeAndToString()); + exExplainToDsFormContentDao.insertExExplainToDsFormContentMation(map); + jedisClient.del(Constants.REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT); + bean = new HashMap<>(); + bean.put("id", id); + outputObject.setBean(bean); + }else{ + outputObject.setreturnMessage("该动态表单内容项说明已存在,不可进行二次保存"); + } + } + + /** + * + * @Title: queryExExplainToDsFormContentMation + * @Description: 编辑动态表单内容项说明信息时进行回显 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void queryExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map bean = exExplainToDsFormContentDao.queryExExplainToDsFormContentMation(map); + outputObject.setBean(bean); + outputObject.settotal(1); + } + + /** + * + * @Title: editExExplainToDsFormContentMationById + * @Description: 编辑动态表单内容项说明信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editExExplainToDsFormContentMationById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map bean = exExplainToDsFormContentDao.queryExExplainToDsFormContentMation(map); + if(bean == null){ + outputObject.setreturnMessage("该动态表单内容项说明不存在,不可进行编辑"); + }else{ + jedisClient.del(Constants.REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT); + exExplainToDsFormContentDao.editExExplainToDsFormContentMationById(map); + } + } + + /** + * + * @Title: queryExExplainToDsFormContentMationToShow + * @Description: 获取动态表单内容项说明信息供展示 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @SuppressWarnings("unchecked") + @Override + public void queryExExplainToDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + if(jedisClient.exists(Constants.REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT)){ + map = JSONObject.fromObject(jedisClient.get(Constants.REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT)); + }else{ + Map bean = exExplainToDsFormContentDao.queryExExplainToDsFormContentMation(map); + if(bean == null){ + map.put("title", "标题"); + map.put("content", "等待发布说明。"); + }else{ + jedisClient.set(Constants.REDIS_CODEMODEL_EXPLAIN_EXEXPLAINTODSFORMCONTENT, JSON.toJSONString(bean)); + map = bean; + } + } + outputObject.setBean(map); + } + +} diff --git a/skyeye-web/src/main/java/com/skyeye/exexplain/controller/ExExplainToDsFormContentController.java b/skyeye-web/src/main/java/com/skyeye/exexplain/controller/ExExplainToDsFormContentController.java new file mode 100644 index 0000000000000000000000000000000000000000..fb9ceb311b1b94901b9883075b004626f9ee6274 --- /dev/null +++ b/skyeye-web/src/main/java/com/skyeye/exexplain/controller/ExExplainToDsFormContentController.java @@ -0,0 +1,81 @@ +package com.skyeye.exexplain.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.skyeye.exexplain.service.ExExplainToDsFormContentService; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +@Controller +public class ExExplainToDsFormContentController { + + @Autowired + private ExExplainToDsFormContentService exExplainToDsFormContentService; + + /** + * + * @Title: insertExExplainToDsFormContentMation + * @Description: 添加动态表单内容项说明信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/ExExplainToDsFormContentController/insertExExplainToDsFormContentMation") + @ResponseBody + public void insertExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception{ + exExplainToDsFormContentService.insertExExplainToDsFormContentMation(inputObject, outputObject); + } + + /** + * + * @Title: queryExExplainToDsFormContentMation + * @Description: 编辑动态表单内容项说明信息时进行回显 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/ExExplainToDsFormContentController/queryExExplainToDsFormContentMation") + @ResponseBody + public void queryExExplainToDsFormContentMation(InputObject inputObject, OutputObject outputObject) throws Exception{ + exExplainToDsFormContentService.queryExExplainToDsFormContentMation(inputObject, outputObject); + } + + /** + * + * @Title: editExExplainToDsFormContentMationById + * @Description: 编辑动态表单内容项说明信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/ExExplainToDsFormContentController/editExExplainToDsFormContentMationById") + @ResponseBody + public void editExExplainToDsFormContentMationById(InputObject inputObject, OutputObject outputObject) throws Exception{ + exExplainToDsFormContentService.editExExplainToDsFormContentMationById(inputObject, outputObject); + } + + /** + * + * @Title: queryExExplainToDsFormContentMationToShow + * @Description: 获取动态表单内容项说明信息供展示 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/ExExplainToDsFormContentController/queryExExplainToDsFormContentMationToShow") + @ResponseBody + public void queryExExplainToDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception{ + exExplainToDsFormContentService.queryExExplainToDsFormContentMationToShow(inputObject, outputObject); + } + +} diff --git a/skyeye-web/src/main/resources/dbmapper/ExExplainToDsFormContentMapper.xml b/skyeye-web/src/main/resources/dbmapper/ExExplainToDsFormContentMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..7bebaed2e60c52b29f9a5f1d88f49f9bdf3dc40e --- /dev/null +++ b/skyeye-web/src/main/resources/dbmapper/ExExplainToDsFormContentMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + INSERT into ex_explain_to_ds_form_content + (id, title, content, create_id, create_time) + VALUES + (#{id}, #{title}, #{content}, #{createId}, #{createTime}) + + + + UPDATE ex_explain_to_ds_form_content + + + title = #{title}, + + + content = #{content}, + + + WHERE id = #{id} + + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index 24516e02c7079b3cd6ba6bea68eeac0962770299..029f2dfceb917ee33d9e47eb5e151a433599a99b 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -397,6 +397,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentadd.js b/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentadd.js index 6de4bcf25080c38c20ec74f5d324e229396765d5..5fa485a96657b39cebc620c9cf568593ab86d24e 100644 --- a/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentadd.js +++ b/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentadd.js @@ -9,6 +9,23 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var $ = layui.$, form = layui.form; + + AjaxPostUtil.request({url:reqBasePath + "exexplaintodsformcontent004", params:{}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + layer.open({ + type: 1, + closeBtn: 0,//关闭按钮 + resize: false,//是否允许拉伸 + offset: 'l', // 具体配置参考:offset参数项 + content: json.bean.content, + area: ['200px', '400px'], + shade: 0, //不显示遮罩 + title: json.bean.title + }); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); var htmlEditor = CodeMirror.fromTextArea(document.getElementById("htmlContent"), { mode : "xml", // 模式 diff --git a/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentedit.js b/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentedit.js index 496043930c8a6e2423e5dfdf75c7b5bba267e018..822c82023f8518f24405143cd11d56a1e37ee2e9 100644 --- a/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentedit.js +++ b/skyeye-web/src/main/webapp/js/dsformcontent/dsformcontentedit.js @@ -11,6 +11,23 @@ layui.config({ form = layui.form; var htmlEditor, jsEditor; + AjaxPostUtil.request({url:reqBasePath + "exexplaintodsformcontent004", params:{}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + layer.open({ + type: 1, + closeBtn: 0,//关闭按钮 + resize: false,//是否允许拉伸 + offset: 'l', // 具体配置参考:offset参数项 + content: json.bean.content, + area: ['200px', '400px'], + shade: 0, //不显示遮罩 + title: json.bean.title + }); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + showGrid({ id: "showForm", url: reqBasePath + "dsform004", diff --git a/skyeye-web/src/main/webapp/js/exexplain/exexplaintodsformcontent.js b/skyeye-web/src/main/webapp/js/exexplain/exexplaintodsformcontent.js new file mode 100644 index 0000000000000000000000000000000000000000..8a8fa9b81b8acf653deff539c6e376aef3395662 --- /dev/null +++ b/skyeye-web/src/main/webapp/js/exexplain/exexplaintodsformcontent.js @@ -0,0 +1,82 @@ + +var rowId = ""; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).define(['table', 'jquery', 'winui'], function (exports) { + winui.renderColor(); + layui.use(['form', 'layedit'], function (form) { + var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 + var $ = layui.$, + form = layui.form, + layedit = layui.layedit; + + var layContent; + + AjaxPostUtil.request({url:reqBasePath + "exexplaintodsformcontent002", params:{}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + if(!isNull(json.bean)){ + rowId = json.bean.id; + $("#title").val(json.bean.title); + $("#content").val(json.bean.content); + } + layContent = layedit.build('content', { + tool: [ + 'strong' //加粗 + ,'italic' //斜体 + ,'underline' //下划线 + ,'del' //删除线 + ,'|' //分割线 + ,'left' //左对齐 + ,'center' //居中对齐 + ,'right' //右对齐 + ,'link' //超链接 + ,'unlink' //清除链接 + ,'face' //表情 + ] + }); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + + form.render(); + + form.on('submit(formAddBean)', function (data) { + //表单验证 + if (winui.verifyForm(data.elem)) { + if(isNull(layedit.getContent(layContent))){ + top.winui.window.msg('请输入内容。', {icon: 2,time: 2000}); + }else{ + var params = { + title: $("#title").val(), + content: encodeURI(layedit.getContent(layContent)), + }; + if(isNull(rowId)){ + AjaxPostUtil.request({url:reqBasePath + "exexplaintodsformcontent001", params:params, type:'json', callback:function(json){ + if(json.returnCode == 0){ + rowId = json.bean.id; + top.winui.window.msg('保存成功', {icon: 1,time: 2000}); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }else{ + params.rowId = rowId; + AjaxPostUtil.request({url:reqBasePath + "exexplaintodsformcontent003", params:params, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg('保存成功', {icon: 1,time: 2000}); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + } + } + } + return false; + }); + + }); + +}); \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/exexplain/exexplaintodsformcontent.html b/skyeye-web/src/main/webapp/tpl/exexplain/exexplaintodsformcontent.html new file mode 100644 index 0000000000000000000000000000000000000000..ba250d8389d8980622b008d1c886033d5f657275 --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/exexplain/exexplaintodsformcontent.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ + + + + \ No newline at end of file