diff --git a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskConf.java b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskConf.java index 7e51b84..8ea969a 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskConf.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskConf.java @@ -5,6 +5,7 @@ import java.io.Serializable; import org.apache.ibatis.type.Alias; import com.baomidou.mybatisplus.annotations.TableField; +import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; /** @@ -24,7 +25,7 @@ public class HighriskConf implements Serializable { /** * */ - @TableField(value = "ID") + @TableId(value = "ID") private String id; /** * 高危项定义资源表ID diff --git a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskSource.java b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskSource.java index 2311b19..75540a7 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskSource.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskSource.java @@ -3,6 +3,7 @@ package com.lyms.base.common.entity.conf; import java.io.Serializable; import com.baomidou.mybatisplus.annotations.TableField; +import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.lyms.base.common.enums.StatusEnum; @@ -22,7 +23,7 @@ public class HighriskSource implements Serializable { /** * */ - @TableField(value = "ID") + @TableId(value = "ID") private String id; /** * 高危项名称 @@ -34,6 +35,9 @@ public class HighriskSource implements Serializable { */ @TableField(value = "TYPE") private String type; + + @TableField(value = "ITEMORDER") + private String itemorder; /** * 是否启用,默认1启用 */ @@ -72,4 +76,12 @@ public class HighriskSource implements Serializable { this.enable = enable; } + public String getItemorder() { + return itemorder; + } + + public void setItemorder(String itemorder) { + this.itemorder = itemorder; + } + } diff --git a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskVersion.java b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskVersion.java index bc9a6d6..d2bc601 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskVersion.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskVersion.java @@ -5,6 +5,7 @@ import java.io.Serializable; import org.apache.ibatis.type.Alias; import com.baomidou.mybatisplus.annotations.TableField; +import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; /** @@ -24,7 +25,7 @@ public class HighriskVersion implements Serializable { /** * */ - @TableField(value = "ID") + @TableId(value = "ID") private String id; /** * 高危版本名称 @@ -36,6 +37,11 @@ public class HighriskVersion implements Serializable { */ @TableField(value = "ENABLE") private Integer enable; + /** + * 是否删除 + */ + @TableField(value = "IFDEL") + private Integer ifdel; public String getId() { return id; @@ -61,4 +67,12 @@ public class HighriskVersion implements Serializable { this.enable = enable; } + public Integer getIfdel() { + return ifdel; + } + + public void setIfdel(Integer ifdel) { + this.ifdel = ifdel; + } + } diff --git a/parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java b/parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java index 971624d..42ce3c0 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java @@ -58,5 +58,16 @@ public interface HighriskVersionService extends BaseService { *
  • 修改时间: */ public String createVersion(HighriskVersion version) throws SystemException; + + /** + *
  • @Description:复制一个版本 + *
  • @param id + *
  • @return + *
  • 创建人:方承 + *
  • 创建时间:2017年4月6日 + *
  • 修改人: + *
  • 修改时间: + */ + public Integer copy(Serializable id); } diff --git a/parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java b/parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java index b1dad6d..e8b2c14 100644 --- a/parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java +++ b/parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java @@ -9,11 +9,14 @@ import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.lyms.base.common.dao.conf.HighriskConfMapper; import com.lyms.base.common.dao.conf.HighriskVersionMapper; +import com.lyms.base.common.entity.conf.HighriskConf; import com.lyms.base.common.entity.conf.HighriskVersion; import com.lyms.base.common.enums.StatusEnum; import com.lyms.base.common.service.conf.HighriskVersionService; import com.lyms.exception.SystemException; +import com.lyms.util.DateTimeUtils; import com.lyms.util.StrUtils; /** @@ -30,6 +33,8 @@ public class HighriskVersionServiceImpl extends ServiceImpl= 1 ? id : null; } + @Override + @Transactional + public Integer copy(Serializable id) { + HighriskVersion version = baseMapper.selectById(id); + HighriskVersion newVersion = new HighriskVersion(); + String time = DateTimeUtils.getDateTime("yyyy_MM_dd_HH_mm_ss"); + String versionId = time; + newVersion.setId(versionId); + newVersion.setName(version.getName()+time); + Integer tag = baseMapper.insert(newVersion); + List confList = confMapper.selectList(new EntityWrapper().where("version_id={0}", version.getId())); + for(HighriskConf conf : confList){ + conf.setId(StrUtils.uuid()); + conf.setVersionId(versionId); + confMapper.insert(conf); + } + return tag; + } + } diff --git a/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskConfController.java b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskConfController.java new file mode 100644 index 0000000..189f5c9 --- /dev/null +++ b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskConfController.java @@ -0,0 +1,126 @@ +package com.lyms.cm.controller.conf; + +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.plugins.Page; +import com.lyms.base.common.entity.conf.HighriskConf; +import com.lyms.base.common.service.conf.HighriskConfService; +import com.lyms.constants.OperationName; +import com.lyms.util.StrUtils; +import com.lyms.web.bean.AjaxResult; +import com.lyms.web.controller.BaseController; + +/** + *

    + * 前端控制器 + *

    + * + * @author fangcheng + * @since 2017-04-06 + */ +@Controller +@RequestMapping("/highriskConf") +public class HighriskConfController extends BaseController { + + @Autowired + private HighriskConfService highriskConfService; + + + /** + * 跳转到列表页面 + * + * @return + */ + @RequestMapping(value = "/toList", method = { RequestMethod.GET }) + public String toList() { + return "/conf/highrisk/conf_list"; + } + + /** + * 列表 + * + * @param page + * @param model + * @return + */ + @RequestMapping(value = "/list", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public Map list(Model model) { + Page page = getPage(); + EntityWrapper ew = new EntityWrapper(); + + String versionId = getParameter("versionId"); + String searchName = getParameter("name"); + if (StrUtils.isNotEmpty(searchName)) { + ew.and("name like {0}", searchName.trim() + "%"); + } + if (StrUtils.isNotEmpty(versionId)) { + ew.and("version_id like {0}", versionId.trim() + "%"); + } + ew.orderBy("grouporder,itemorder"); + page = highriskConfService.selectPage(page,ew); + return toGridData(page); + } + + /** + * 跳转到编辑页面 + * + * @return + */ + @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET) + public String toEdit(@PathVariable String id, Model model) { + if (!StringUtils.isBlank(id) && !"0".equals(id)) { + HighriskConf entity = highriskConfService.selectById(id); + model.addAttribute("conf", entity); + } + return "/conf/highrisk/conf_edit"; + } + + /** + * 创建 + *

    + * TODO + * + * @param user + * @return + */ + @RequestMapping(value = "/create", method = RequestMethod.POST) + @ResponseBody + public AjaxResult create(HighriskConf HighriskConf, AjaxResult ajaxResult) { + boolean tag = highriskConfService.insert(HighriskConf); + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); + } + + /** + * 修改信息 + */ + @RequestMapping(value = "/update", method = { RequestMethod.POST }) + @ResponseBody + public AjaxResult update(HighriskConf HighriskConf, AjaxResult ajaxResult) { + boolean tag = highriskConfService.updateById(HighriskConf); + return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE); + } + + /** + * 删除 + * + * @return + */ + @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST }) + @ResponseBody + public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) { + int tag = highriskConfService.deleteLogicById(id); + return handleAjaxResult(ajaxResult, tag, OperationName.DELETE); + } + +} diff --git a/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskSourceController.java b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskSourceController.java new file mode 100644 index 0000000..59bc501 --- /dev/null +++ b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskSourceController.java @@ -0,0 +1,123 @@ +package com.lyms.cm.controller.conf; + +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.plugins.Page; +import com.lyms.base.common.entity.conf.HighriskSource; +import com.lyms.base.common.entity.conf.HighriskVersion; +import com.lyms.base.common.service.conf.HighriskSourceService; +import com.lyms.base.common.service.conf.HighriskVersionService; +import com.lyms.constants.OperationName; +import com.lyms.util.StrUtils; +import com.lyms.web.bean.AjaxResult; +import com.lyms.web.controller.BaseController; + +/** + *

    + * 前端控制器 + *

    + * + * @author fangcheng + * @since 2017-04-06 + */ +@Controller +@RequestMapping("/highriskSource") +public class HighriskSourceController extends BaseController { + + @Autowired + private HighriskSourceService highriskSourceService; + + + /** + * 跳转到列表页面 + * + * @return + */ + @RequestMapping(value = "/toList", method = { RequestMethod.GET }) + public String toList() { + return "/conf/highrisk/source_list"; + } + + /** + * 列表 + * + * @param page + * @param model + * @return + */ + @RequestMapping(value = "/list", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public Map list(Model model) { + Page page = getPage(); + EntityWrapper ew = new EntityWrapper(); + String searchName = getParameter("name"); + if (StrUtils.isNotEmpty(searchName)) { + ew.and("name like {0}", searchName.trim() + "%"); + } + ew.orderBy("itemorder"); + page = highriskSourceService.selectPage(page,ew); + return toGridData(page); + } + + /** + * 跳转到编辑页面 + * + * @return + */ + @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET) + public String toEdit(@PathVariable String id, Model model) { + if (!StringUtils.isBlank(id)&&!"0".equals(id)) { + HighriskSource entity = highriskSourceService.selectById(id); + model.addAttribute("source", entity); + } + return "/conf/highrisk/source_edit"; + } + + /** + * 创建用户 + *

    + * TODO + * + * @param user + * @return + */ + @RequestMapping(value = "/create", method = RequestMethod.POST) + @ResponseBody + public AjaxResult create(HighriskSource HighriskSource, AjaxResult ajaxResult) { + boolean tag = highriskSourceService.insert(HighriskSource); + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); + } + + /** + * 修改信息 + */ + @RequestMapping(value = "/update", method = { RequestMethod.POST }) + @ResponseBody + public AjaxResult update(HighriskSource HighriskSource, AjaxResult ajaxResult) { + boolean tag = highriskSourceService.updateById(HighriskSource); + return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE); + } + + /** + * 删除 + * + * @return + */ + @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST }) + @ResponseBody + public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) { + int tag = highriskSourceService.deleteLogicById(id); + return handleAjaxResult(ajaxResult, tag, OperationName.DELETE); + } + +} diff --git a/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskVersionController.java b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskVersionController.java new file mode 100644 index 0000000..f957e73 --- /dev/null +++ b/parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskVersionController.java @@ -0,0 +1,133 @@ +package com.lyms.cm.controller.conf; + +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.plugins.Page; +import com.lyms.base.common.entity.conf.HighriskVersion; +import com.lyms.base.common.service.conf.HighriskVersionService; +import com.lyms.constants.OperationName; +import com.lyms.util.StrUtils; +import com.lyms.web.bean.AjaxResult; +import com.lyms.web.controller.BaseController; + +/** + *

    + * 前端控制器 + *

    + * + * @author fangcheng + * @since 2017-04-06 + */ +@Controller +@RequestMapping("/highriskVersion") +public class HighriskVersionController extends BaseController { + + @Autowired + private HighriskVersionService highriskVersionService; + + + /** + * 跳转到用户列表页面 + * + * @return + */ + @RequestMapping(value = "/toList", method = { RequestMethod.GET }) + public String toList() { + return "/conf/highrisk/version_list"; + } + + /** + * 列表 + * + * @param page + * @param model + * @return + */ + @RequestMapping(value = "/list", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public Map list(Model model) { + Page page = getPage(); + EntityWrapper ew = new EntityWrapper(); + ew.where("ifDel=0"); + String searchName = getParameter("name"); + if (StrUtils.isNotEmpty(searchName)) { + ew.and("name like {0}", searchName.trim() + "%"); + } + page = highriskVersionService.selectPage(page,ew); + return toGridData(page); + } + + /** + * 跳转到编辑页面 + * + * @return + */ + @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET) + public String toEdit(@PathVariable String id, Model model) { + if (!StringUtils.isBlank(id)&&!"0".equals(id)) { + HighriskVersion entity = highriskVersionService.selectById(id); + model.addAttribute("version", entity); + } + return "/conf/highrisk/version_edit"; + } + + /** + * 创建用户 + *

    + * TODO + * + * @param user + * @return + */ + @RequestMapping(value = "/create", method = RequestMethod.POST) + @ResponseBody + public AjaxResult create(HighriskVersion highriskVersion, AjaxResult ajaxResult) { + boolean tag = highriskVersionService.insert(highriskVersion); + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); + } + + /** + * 修改信息 + */ + @RequestMapping(value = "/update", method = { RequestMethod.POST }) + @ResponseBody + public AjaxResult update(HighriskVersion highriskVersion, AjaxResult ajaxResult) { + boolean tag = highriskVersionService.updateById(highriskVersion); + return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE); + } + + /** + * 删除 + * + * @return + */ + @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST }) + @ResponseBody + public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) { + int tag = highriskVersionService.deleteLogicById(id); + return handleAjaxResult(ajaxResult, tag, OperationName.DELETE); + } + + /** + * 复制 + * + * @return + */ + @RequestMapping(value = "/{id}/copy", method = { RequestMethod.GET, RequestMethod.POST }) + @ResponseBody + public AjaxResult copy(@PathVariable String id, AjaxResult ajaxResult){ + int tag = highriskVersionService.copy(id); + return handleAjaxResult(ajaxResult, tag, "复制"); + } + +} diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_edit.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_edit.html new file mode 100644 index 0000000..dff97fc --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_edit.html @@ -0,0 +1,97 @@ +#override("body") +

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +#end +#extends("/common/base_list.html") \ No newline at end of file diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_list.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_list.html new file mode 100644 index 0000000..120e59e --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/conf_list.html @@ -0,0 +1,106 @@ +#override("body") +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + 查询 +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +#end +#override("js") + +#end +#extends("/common/base_list.html") + diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_edit.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_edit.html new file mode 100644 index 0000000..d2d9c59 --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_edit.html @@ -0,0 +1,65 @@ +#override("body") +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +#end +#extends("/common/base_list.html") \ No newline at end of file diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_list.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_list.html new file mode 100644 index 0000000..ce53cfe --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/source_list.html @@ -0,0 +1,93 @@ +#override("body") +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + 查询 +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +#end +#override("js") + +#end +#extends("/common/base_list.html") + diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_edit.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_edit.html new file mode 100644 index 0000000..495e352 --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_edit.html @@ -0,0 +1,55 @@ +#override("body") +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +#end +#extends("/common/base_list.html") \ No newline at end of file diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_list.html b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_list.html new file mode 100644 index 0000000..83ba1f5 --- /dev/null +++ b/parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_list.html @@ -0,0 +1,102 @@ +#override("body") +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + 查询 +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    +#end +#override("js") + +#end +#extends("/common/base_list.html") +