diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/add.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/add.html new file mode 100644 index 00000000..b77448d8 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/add.html @@ -0,0 +1,46 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/bind.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/bind.html new file mode 100644 index 00000000..234385cc --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/bind.html @@ -0,0 +1,38 @@ + + + + + + +
+
+

+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/detail.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/detail.html new file mode 100644 index 00000000..10fc3cbc --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/detail.html @@ -0,0 +1,44 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/edit.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/edit.html new file mode 100644 index 00000000..e5fb9d65 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/edit.html @@ -0,0 +1,53 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/view.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/view.html new file mode 100644 index 00000000..3c2094c6 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/view.html @@ -0,0 +1,115 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/scene/manage.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/scene/manage.html index 2cde9c3f..66c65d9c 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/scene/manage.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/scene/manage.html @@ -1,131 +1,131 @@ - + -
-
-
-
-
-
    -
  • -

    场景名称:

    - -
  • -
  • -

    创建时间:

    - - -
  • +
    +
    +
    + +
    + -
    - -
    +
  • +  搜索 +  重置 +
  • +
+
+ +
- -
-
-
+ +
+
- - + $.modal.openFull("场景详情", url); + } + + function question(id, name) { + table.set(); + $.modal.openFull("场景名称 >>" + name, ctx + "project/question"); + } + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/SceneQuestionController.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/SceneQuestionController.java new file mode 100644 index 00000000..5be82026 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/SceneQuestionController.java @@ -0,0 +1,135 @@ +package com.zdxt.knowledge.controller; + +import com.zdxt.common.ZDResponse; +import com.zdxt.common.controller.BaseController; +import com.zdxt.common.util.TableDataInfo; +import com.zdxt.knowledge.domain.SceneQuestion; +import com.zdxt.knowledge.service.ISceneQuestionService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 场景题目Controller + * + * @author ruoyi + * @date 2023-12-26 + */ +@Controller +@RequestMapping("/project/question") +public class SceneQuestionController extends BaseController +{ + private String prefix = "project/question"; + + @Autowired + private ISceneQuestionService sceneQuestionService; + + @RequiresPermissions("project:question:view") + @GetMapping() + public String question() + { + return prefix + "/view"; + } + + /** + * 查询场景题目列表 + */ + @RequiresPermissions("project:question:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SceneQuestion sceneQuestion) + { + startPage(); + List list = sceneQuestionService.selectSceneQuestionList(sceneQuestion); + return getDataTable(list); + } + + @RequiresPermissions("project:question:detail") + @GetMapping("/detail/{id}") + public String detail(@PathVariable("id") Long id, ModelMap mmap) { + SceneQuestion sceneQuestion = sceneQuestionService.selectSceneQuestionById(id); + mmap.put("sceneQuestion", sceneQuestion); + return prefix + "/detail"; + } + + @RequiresPermissions("project:question:bind") + @GetMapping("/bind/{id}") + public String bind(@PathVariable("id") Long id, ModelMap mmap) { + SceneQuestion sceneQuestion = sceneQuestionService.selectSceneQuestionById(id); + mmap.put("sceneQuestion", sceneQuestion); + return prefix + "/bind"; + } + +// /** +// * 导出场景题目列表 +// */ +// @RequiresPermissions("project:question:export") +// @PostMapping("/export") +// @ResponseBody +// public AjaxResult export(SceneQuestion sceneQuestion) +// { +// List list = sceneQuestionService.selectSceneQuestionList(sceneQuestion); +// ExcelUtil util = new ExcelUtil(SceneQuestion.class); +// return util.exportExcel(list, "question"); +// } + + /** + * 新增场景题目 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存场景题目 + */ + @RequiresPermissions("project:question:add") + @PostMapping("/add") + @ResponseBody + public ZDResponse addSave(SceneQuestion sceneQuestion) + { + return sceneQuestionService.insertSceneQuestion(sceneQuestion) > 0 + ? ZDResponse.success() : ZDResponse.error("新增失败"); + } + + /** + * 修改场景题目 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + SceneQuestion sceneQuestion = sceneQuestionService.selectSceneQuestionById(id); + mmap.put("sceneQuestion", sceneQuestion); + return prefix + "/edit"; + } + + /** + * 修改保存场景题目 + */ + @RequiresPermissions("project:question:edit") + @PostMapping("/edit") + @ResponseBody + public ZDResponse editSave(SceneQuestion sceneQuestion) + { + return sceneQuestionService.updateSceneQuestion(sceneQuestion) > 0 + ? ZDResponse.success() : ZDResponse.error("修改失败"); + } + + /** + * 删除场景题目 + */ + @RequiresPermissions("project:question:remove") + @PostMapping( "/remove") + @ResponseBody + public ZDResponse remove(String ids) + { + return sceneQuestionService.deleteSceneQuestionByIds(ids) > 0 + ? ZDResponse.success() : ZDResponse.error("删除失败"); + } +} diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneManage.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneManage.java index 7e48a401..3c43e8a4 100755 --- a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneManage.java +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneManage.java @@ -1,9 +1,13 @@ package com.zdxt.knowledge.domain; -import com.zdxt.common.BaseEntity; import com.zdxt.common.annotation.Excel; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; /** @@ -12,7 +16,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; * @author ruoyi * @date 2023-12-25 */ -public class SceneManage extends BaseEntity +public class SceneManage implements Serializable { private static final long serialVersionUID = 1L; @@ -51,6 +55,17 @@ public class SceneManage extends BaseEntity @Excel(name = "创建人") private String creator; + /** 创建时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** 请求参数 */ + private Map params; + public void setId(Long id) { this.id = id; @@ -133,6 +148,28 @@ public class SceneManage extends BaseEntity return creator; } + public Date getCreateTime() { + return createTime; + } + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Map getParams() { + return params; + } + + public void setParams(Map params) { + this.params = params; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneQuestion.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneQuestion.java new file mode 100644 index 00000000..63823744 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneQuestion.java @@ -0,0 +1,146 @@ +package com.zdxt.knowledge.domain; + +import com.zdxt.common.annotation.Excel; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +/** + * 场景题目对象 scene_question + * + * @author ruoyi + * @date 2023-12-26 + */ +public class SceneQuestion implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 题目名称 */ + @Excel(name = "题目名称") + private String name; + + /** 分组 */ + @Excel(name = "场景id") + private String parentId; + + /** 角色 */ + @Excel(name = "角色") + private String roleId; + + /** 状态0有效1无效 */ + @Excel(name = "状态0有效1无效") + private Integer status; + + /** 创建人 */ + @Excel(name = "创建人") + private String creator; + + /** 创建时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** 请求参数 */ + private Map params; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setRoleId(String roleId) + { + this.roleId = roleId; + } + + public String getRoleId() + { + return roleId; + } + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + public void setCreator(String creator) + { + this.creator = creator; + } + + public String getCreator() + { + return creator; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("roleId", getRoleId()) + .append("status", getStatus()) + .append("creator", getCreator()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Map getParams() { + return params; + } + + public void setParams(Map params) { + this.params = params; + } +} diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/mapper/SceneQuestionMapper.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/mapper/SceneQuestionMapper.java new file mode 100644 index 00000000..e7505ad3 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/mapper/SceneQuestionMapper.java @@ -0,0 +1,62 @@ +package com.zdxt.knowledge.mapper; + +import com.zdxt.knowledge.domain.SceneQuestion; + +import java.util.List; + +/** + * 场景题目Mapper接口 + * + * @author ruoyi + * @date 2023-12-26 + */ +public interface SceneQuestionMapper +{ + /** + * 查询场景题目 + * + * @param id 场景题目ID + * @return 场景题目 + */ + public SceneQuestion selectSceneQuestionById(Long id); + + /** + * 查询场景题目列表 + * + * @param sceneQuestion 场景题目 + * @return 场景题目集合 + */ + public List selectSceneQuestionList(SceneQuestion sceneQuestion); + + /** + * 新增场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + public int insertSceneQuestion(SceneQuestion sceneQuestion); + + /** + * 修改场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + public int updateSceneQuestion(SceneQuestion sceneQuestion); + + /** + * 删除场景题目 + * + * @param id 场景题目ID + * @return 结果 + */ + public int deleteSceneQuestionById(Long id); + + /** + * 批量删除场景题目 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSceneQuestionByIds(String[] ids); +} diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/ISceneQuestionService.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/ISceneQuestionService.java new file mode 100644 index 00000000..aa1032a6 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/ISceneQuestionService.java @@ -0,0 +1,62 @@ +package com.zdxt.knowledge.service; + +import com.zdxt.knowledge.domain.SceneQuestion; + +import java.util.List; + +/** + * 场景题目Service接口 + * + * @author ruoyi + * @date 2023-12-26 + */ +public interface ISceneQuestionService +{ + /** + * 查询场景题目 + * + * @param id 场景题目ID + * @return 场景题目 + */ + public SceneQuestion selectSceneQuestionById(Long id); + + /** + * 查询场景题目列表 + * + * @param sceneQuestion 场景题目 + * @return 场景题目集合 + */ + public List selectSceneQuestionList(SceneQuestion sceneQuestion); + + /** + * 新增场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + public int insertSceneQuestion(SceneQuestion sceneQuestion); + + /** + * 修改场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + public int updateSceneQuestion(SceneQuestion sceneQuestion); + + /** + * 批量删除场景题目 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSceneQuestionByIds(String ids); + + /** + * 删除场景题目信息 + * + * @param id 场景题目ID + * @return 结果 + */ + public int deleteSceneQuestionById(Long id); +} diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/impl/SceneQuestionServiceImpl.java b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/impl/SceneQuestionServiceImpl.java new file mode 100644 index 00000000..e4da5182 --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/impl/SceneQuestionServiceImpl.java @@ -0,0 +1,98 @@ +package com.zdxt.knowledge.service.impl; + +import com.zdxt.common.util.Convert; +import com.zdxt.common.util.DateUtils; +import com.zdxt.knowledge.domain.SceneQuestion; +import com.zdxt.knowledge.mapper.SceneQuestionMapper; +import com.zdxt.knowledge.service.ISceneQuestionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 场景题目Service业务层处理 + * + * @author ruoyi + * @date 2023-12-26 + */ +@Service +public class SceneQuestionServiceImpl implements ISceneQuestionService +{ + @Autowired + private SceneQuestionMapper sceneQuestionMapper; + + /** + * 查询场景题目 + * + * @param id 场景题目ID + * @return 场景题目 + */ + @Override + public SceneQuestion selectSceneQuestionById(Long id) + { + return sceneQuestionMapper.selectSceneQuestionById(id); + } + + /** + * 查询场景题目列表 + * + * @param sceneQuestion 场景题目 + * @return 场景题目 + */ + @Override + public List selectSceneQuestionList(SceneQuestion sceneQuestion) + { + return sceneQuestionMapper.selectSceneQuestionList(sceneQuestion); + } + + /** + * 新增场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + @Override + public int insertSceneQuestion(SceneQuestion sceneQuestion) + { + sceneQuestion.setCreateTime(DateUtils.getNowDate()); + return sceneQuestionMapper.insertSceneQuestion(sceneQuestion); + } + + /** + * 修改场景题目 + * + * @param sceneQuestion 场景题目 + * @return 结果 + */ + @Override + public int updateSceneQuestion(SceneQuestion sceneQuestion) + { + sceneQuestion.setUpdateTime(DateUtils.getNowDate()); + return sceneQuestionMapper.updateSceneQuestion(sceneQuestion); + } + + /** + * 删除场景题目对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteSceneQuestionByIds(String ids) + { + return sceneQuestionMapper.deleteSceneQuestionByIds(Convert.toStrArray(ids)); + } + + /** + * 删除场景题目信息 + * + * @param id 场景题目ID + * @return 结果 + */ + @Override + public int deleteSceneQuestionById(Long id) + { + return sceneQuestionMapper.deleteSceneQuestionById(id); + } +} diff --git a/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/resources/mapper/SceneQuestionMapper.xml b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/resources/mapper/SceneQuestionMapper.xml new file mode 100644 index 00000000..f7b050ad --- /dev/null +++ b/lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/resources/mapper/SceneQuestionMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + select id, name, parent_id, role_id, status, creator, create_time, update_time from scene_question + + + + + + + + insert into scene_question + + id, + name, + parent_id, + role_id, + status, + creator, + create_time, + update_time, + + + #{id}, + #{name}, + #{parentId}, + #{roleId}, + #{status}, + #{creator}, + #{createTime}, + #{updateTime}, + + + + + update scene_question + + name = #{name}, + parent_id = #{parentId}, + role_id = #{roleId}, + status = #{status}, + creator = #{creator}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from scene_question where id = #{id} + + + + delete from scene_question where id in + + #{id} + + + + \ No newline at end of file