From 035279b1d4523de5e128f3cb92a713a2900148e4 Mon Sep 17 00:00:00 2001 From: Jadan-Z <13625030900@163.com> Date: Sat, 6 Nov 2021 23:22:36 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=E8=A1=A8ds=5Fform?= =?UTF-8?q?=5Fpage=5Ftype=E6=B6=89=E5=8F=8A=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DsFormPageTypeController.java | 115 ++++++++++++++++++ .../com/skyeye/eve/dao/DsFormPageTypeDao.java | 36 ++++++ .../eve/service/DsFormPageTypeService.java | 32 +++++ .../impl/DsFormPageTypeServiceImpl.java | 109 +++++++++++++++++ .../mapper/dsform/DsFormPageTypeMapper.xml | 86 +++++++++++++ .../reqmapping/mapping/reqdsform.xml | 28 ++++- 6 files changed, 405 insertions(+), 1 deletion(-) create mode 100644 skyeye-dsform/src/main/java/com/skyeye/eve/controller/DsFormPageTypeController.java create mode 100644 skyeye-dsform/src/main/java/com/skyeye/eve/dao/DsFormPageTypeDao.java create mode 100644 skyeye-dsform/src/main/java/com/skyeye/eve/service/DsFormPageTypeService.java create mode 100644 skyeye-dsform/src/main/java/com/skyeye/eve/service/impl/DsFormPageTypeServiceImpl.java create mode 100644 skyeye-dsform/src/main/resources/mapper/dsform/DsFormPageTypeMapper.xml diff --git a/skyeye-dsform/src/main/java/com/skyeye/eve/controller/DsFormPageTypeController.java b/skyeye-dsform/src/main/java/com/skyeye/eve/controller/DsFormPageTypeController.java new file mode 100644 index 000000000..4ef6ba491 --- /dev/null +++ b/skyeye-dsform/src/main/java/com/skyeye/eve/controller/DsFormPageTypeController.java @@ -0,0 +1,115 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ +package com.skyeye.eve.controller; + +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import com.skyeye.eve.service.DsFormPageTypeService; +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; + +@Controller +public class DsFormPageTypeController { + + @Autowired + private DsFormPageTypeService dsFormPageTypeService; + + /** + * + * @Title: queryDsFormPageTypeList + * @Description: 获取动态表单页面分类列表 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/queryDsFormPageTypeList") + @ResponseBody + public void queryDsFormPageTypeList(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.queryDsFormPageTypeList(inputObject, outputObject); + } + + /** + * + * @Title: insertDsFormPageType + * @Description: 新增动态表单页面分类 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/insertDsFormPageType") + @ResponseBody + public void insertDsFormPageType(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.insertDsFormPageType(inputObject, outputObject); + } + + /** + * + * @Title: delDsFormPageTypeById + * @Description: 删除动态表单分类 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/delDsFormPageTypeById") + @ResponseBody + public void delDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.delDsFormPageTypeById(inputObject, outputObject); + } + + /** + * + * @Title: queryDsFormPageTypeById + * @Description: 根据id查询动态表单页面分类详情 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/queryDsFormPageTypeById") + @ResponseBody + public void queryDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.queryDsFormPageTypeById(inputObject, outputObject); + } + + /** + * + * @Title: updateDsFormPageTypeById + * @Description: 通过id编辑对应的动态表单分类信息 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/updateDsFormPageTypeById") + @ResponseBody + public void updateDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.updateDsFormPageTypeById(inputObject, outputObject); + } + + /** + * + * @Title: queryDsFormPageTypeByParentId + * @Description: 通过parentId查找对应的动态表单分类列表 + * @param inputObject + * @param outputObject + * @throws Exception 异常 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/DsFormPageTypeController/queryDsFormPageTypeByParentId") + @ResponseBody + public void queryDsFormPageTypeByParentId(InputObject inputObject, OutputObject outputObject) throws Exception{ + dsFormPageTypeService.queryDsFormPageTypeByParentId(inputObject, outputObject); + } +} diff --git a/skyeye-dsform/src/main/java/com/skyeye/eve/dao/DsFormPageTypeDao.java b/skyeye-dsform/src/main/java/com/skyeye/eve/dao/DsFormPageTypeDao.java new file mode 100644 index 000000000..beb06172c --- /dev/null +++ b/skyeye-dsform/src/main/java/com/skyeye/eve/dao/DsFormPageTypeDao.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.eve.dao; + +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: DsFormPageTypeDao + * @Description: 动态表单页面分类数据层 + * @author: skyeye云系列--郑杰 + * @date: 2021/11/6 23:33 + * @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +public interface DsFormPageTypeDao { + + List> queryDsFormPageTypeList(Map map); + + void insertDsFormPageType(Map map); + + Map queryDsFormPageTypeById(@Param("id") String id); + + String queryDsFormPageTypeByParentIdAndTypeName(Map map); + + List> queryDsFormPageTypeByParentId(@Param("parentId") String parentId); + + void updateDsFormPageTypeById(Map map) throws Exception; + + void delDsFormPageTypeById(@Param("id") String id) throws Exception; + +} diff --git a/skyeye-dsform/src/main/java/com/skyeye/eve/service/DsFormPageTypeService.java b/skyeye-dsform/src/main/java/com/skyeye/eve/service/DsFormPageTypeService.java new file mode 100644 index 000000000..2808bff5d --- /dev/null +++ b/skyeye-dsform/src/main/java/com/skyeye/eve/service/DsFormPageTypeService.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.eve.service; + +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +/** + * @ClassName: DsFormPageTypeService + * @Description: 动态表单页面分类业务层 + * @author: skyeye云系列--郑杰 + * @date: 2021/11/6 23:33 + * @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +public interface DsFormPageTypeService { + + void queryDsFormPageTypeList(InputObject inputObject, OutputObject outputObject) throws Exception; + + void insertDsFormPageType(InputObject inputObject, OutputObject outputObject) throws Exception; + + void queryDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception; + + void queryDsFormPageTypeByParentId(InputObject inputObject, OutputObject outputObject) throws Exception; + + void updateDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception; + + void delDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception; + +} diff --git a/skyeye-dsform/src/main/java/com/skyeye/eve/service/impl/DsFormPageTypeServiceImpl.java b/skyeye-dsform/src/main/java/com/skyeye/eve/service/impl/DsFormPageTypeServiceImpl.java new file mode 100644 index 000000000..a19ca5f5a --- /dev/null +++ b/skyeye-dsform/src/main/java/com/skyeye/eve/service/impl/DsFormPageTypeServiceImpl.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.eve.service.impl; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.DateUtil; +import com.skyeye.common.util.ToolUtil; +import com.skyeye.eve.dao.DsFormPageTypeDao; +import com.skyeye.eve.service.DsFormPageTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: DsFormPageTypeServiceImpl + * @Description: 动态表单页面分类业务实现层 + * @author: skyeye云系列--郑杰 + * @date: 2021/11/6 23:33 + * @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@Service +public class DsFormPageTypeServiceImpl implements DsFormPageTypeService { + + @Autowired + private DsFormPageTypeDao dsFormPageTypeDao; + + @Override + public void queryDsFormPageTypeList(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + Page pages = PageHelper.startPage(Integer.parseInt(inputParams.get("page").toString()), Integer.parseInt(inputParams.get("limit").toString())); + List> emailSendModelList = dsFormPageTypeDao.queryDsFormPageTypeList(inputParams); + outputObject.setBeans(emailSendModelList); + outputObject.settotal(pages.getTotal()); + } + + @Override + public void insertDsFormPageType(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + if (checkParentIdExists(inputParams, outputObject)) { + return; + } + inputParams.put("id", ToolUtil.getSurFaceId()); + inputParams.put("createTime", DateUtil.getTimeAndToString()); + inputParams.put("userId", inputObject.getLogParams().get("id")); + dsFormPageTypeDao.insertDsFormPageType(inputParams); + } + + @Override + public void queryDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + Map dsFormPageTypeBean = dsFormPageTypeDao.queryDsFormPageTypeById(inputParams.get("id").toString()); + outputObject.setBean(dsFormPageTypeBean); + outputObject.settotal(1); + } + + @Override + public void queryDsFormPageTypeByParentId(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + List> dsFormPageTypeList = dsFormPageTypeDao.queryDsFormPageTypeByParentId(inputParams.get("parentId").toString()); + outputObject.setBeans(dsFormPageTypeList); + outputObject.settotal(dsFormPageTypeList.size()); + } + + @Override + public void updateDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + if (checkParentIdExists(inputParams, outputObject)) { + return; + } + inputParams.put("lastUpdateTime", DateUtil.getTimeAndToString()); + inputParams.put("userId", inputObject.getLogParams().get("id")); + dsFormPageTypeDao.updateDsFormPageTypeById(inputParams); + } + + /** + * 校验parentId是否存在 + * + * @param inputParams + * @return true: parentId+typeName存在, 反之false + */ + private boolean checkParentIdExists(Map inputParams, OutputObject outputObject) { + Object parentId = inputParams.get("parentId"); + if (parentId != null) { + String tempId = dsFormPageTypeDao.queryDsFormPageTypeByParentIdAndTypeName(inputParams); + if (tempId == null || tempId.equals(inputParams.get("id"))) { + return false; + } + outputObject.setreturnMessage("父节点下已存在该分类名称."); + return true; + } + // 父节点不存在默认赋值0 + inputParams.put("parentId", 0); + return false; + } + + @Override + public void delDsFormPageTypeById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map inputParams = inputObject.getParams(); + dsFormPageTypeDao.delDsFormPageTypeById(inputParams.get("id").toString()); + } +} diff --git a/skyeye-dsform/src/main/resources/mapper/dsform/DsFormPageTypeMapper.xml b/skyeye-dsform/src/main/resources/mapper/dsform/DsFormPageTypeMapper.xml new file mode 100644 index 000000000..db15bb408 --- /dev/null +++ b/skyeye-dsform/src/main/resources/mapper/dsform/DsFormPageTypeMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + INSERT INTO ds_form_page_type + (id, type_name, parent_id, create_id, create_time, last_update_id, last_update_time) + VALUES + (#{id}, #{typeName}, #{parentId}, #{userId}, #{createTime}, #{userId}, #{createTime}) + + + + + + + + + + UPDATE ds_form_page_type + SET + type_name = #{typeName}, + parent_id = #{parentId}, + last_update_id = #{userId}, + last_update_time = #{lastUpdateTime} + WHERE id = #{id} + + + + DELETE FROM ds_form_page_type + WHERE id = #{id} + + \ No newline at end of file diff --git a/skyeye-dsform/src/main/resources/reqmapping/mapping/reqdsform.xml b/skyeye-dsform/src/main/resources/reqmapping/mapping/reqdsform.xml index d57ccee1e..c8978bde7 100644 --- a/skyeye-dsform/src/main/resources/reqmapping/mapping/reqdsform.xml +++ b/skyeye-dsform/src/main/resources/reqmapping/mapping/reqdsform.xml @@ -143,5 +143,31 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- GitLab