From 72c204bad0566bbbd8ef13f7510710dafeb7c646 Mon Sep 17 00:00:00 2001 From: zhanghan11 Date: Tue, 23 Jul 2024 11:20:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=B7=A1=E6=A3=80=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=82=B9=E6=A3=80=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patrol/IpcPatrolItemController.java | 103 ++++++++++ .../patrol/IpcPatrolTaskItemController.java | 103 ++++++++++ .../inspur/patrol/domain/IpcPatrolItem.java | 174 +++++++++++++++++ .../inspur/patrol/domain/IpcPatrolPlan.java | 10 + .../inspur/patrol/domain/IpcPatrolReport.java | 12 ++ .../inspur/patrol/domain/IpcPatrolTask.java | 1 + .../patrol/domain/IpcPatrolTaskItem.java | 179 +++++++++++++++++ .../patrol/mapper/IpcPatrolItemMapper.java | 61 ++++++ .../mapper/IpcPatrolTaskItemMapper.java | 96 +++++++++ .../patrol/service/IIpcPatrolItemService.java | 61 ++++++ .../service/IIpcPatrolTaskItemService.java | 61 ++++++ .../impl/IpcPatrolItemServiceImpl.java | 93 +++++++++ .../impl/IpcPatrolReportServiceImpl.java | 7 + .../impl/IpcPatrolTaskItemServiceImpl.java | 93 +++++++++ .../impl/IpcPatrolTaskServiceImpl.java | 7 +- .../mapper/patrol/IpcPatrolItemMapper.xml | 103 ++++++++++ .../mapper/patrol/IpcPatrolPlanMapper.xml | 7 +- .../mapper/patrol/IpcPatrolTaskItemMapper.xml | 182 ++++++++++++++++++ 18 files changed, 1351 insertions(+), 2 deletions(-) create mode 100644 zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolItemController.java create mode 100644 zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolTaskItemController.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolItem.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTaskItem.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolItemMapper.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolTaskItemMapper.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolItemService.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolTaskItemService.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolItemServiceImpl.java create mode 100644 zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskItemServiceImpl.java create mode 100644 zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolItemMapper.xml create mode 100644 zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolTaskItemMapper.xml diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolItemController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolItemController.java new file mode 100644 index 0000000..aca9550 --- /dev/null +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolItemController.java @@ -0,0 +1,103 @@ +package com.inspur.web.controller.patrol; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.enums.BusinessType; +import com.inspur.patrol.domain.IpcPatrolItem; +import com.inspur.patrol.service.IIpcPatrolItemService; +import com.inspur.common.utils.poi.ExcelUtil; +import com.inspur.common.core.page.TableDataInfo; + +/** + * 巡检项目Controller + * + * @author zhanghan11 + * @date 2024-07-22 + */ +@RestController +@RequestMapping("/patrol/item") +public class IpcPatrolItemController extends BaseController +{ + @Autowired + private IIpcPatrolItemService ipcPatrolItemService; + + /** + * 查询巡检项目列表 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:list')") + @GetMapping("/list") + public AjaxResult list(IpcPatrolItem ipcPatrolItem) + { + List list = ipcPatrolItemService.selectIpcPatrolItemList(ipcPatrolItem); + return AjaxResult.success(list); + } + + /** + * 导出巡检项目列表 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:export')") + @Log(title = "巡检项目", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IpcPatrolItem ipcPatrolItem) + { + List list = ipcPatrolItemService.selectIpcPatrolItemList(ipcPatrolItem); + ExcelUtil util = new ExcelUtil(IpcPatrolItem.class); + util.exportExcel(response, list, "巡检项目数据"); + } + + /** + * 获取巡检项目详细信息 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(ipcPatrolItemService.selectIpcPatrolItemById(id)); + } + + /** + * 新增巡检项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:add')") + @Log(title = "巡检项目", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IpcPatrolItem ipcPatrolItem) + { + return toAjax(ipcPatrolItemService.insertIpcPatrolItem(ipcPatrolItem)); + } + + /** + * 修改巡检项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:edit')") + @Log(title = "巡检项目", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IpcPatrolItem ipcPatrolItem) + { + return toAjax(ipcPatrolItemService.updateIpcPatrolItem(ipcPatrolItem)); + } + + /** + * 删除巡检项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:item:remove')") + @Log(title = "巡检项目", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ipcPatrolItemService.deleteIpcPatrolItemByIds(ids)); + } +} diff --git a/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolTaskItemController.java b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolTaskItemController.java new file mode 100644 index 0000000..0d34412 --- /dev/null +++ b/zfipc-server/zfipc-admin/src/main/java/com/inspur/web/controller/patrol/IpcPatrolTaskItemController.java @@ -0,0 +1,103 @@ +package com.inspur.web.controller.patrol; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.enums.BusinessType; +import com.inspur.patrol.domain.IpcPatrolTaskItem; +import com.inspur.patrol.service.IIpcPatrolTaskItemService; +import com.inspur.common.utils.poi.ExcelUtil; +import com.inspur.common.core.page.TableDataInfo; + +/** + * 巡检任务项目Controller + * + * @author zhanghan11 + * @date 2024-07-22 + */ +@RestController +@RequestMapping("/patrol/taskItem") +public class IpcPatrolTaskItemController extends BaseController +{ + @Autowired + private IIpcPatrolTaskItemService ipcPatrolTaskItemService; + + /** + * 查询巡检任务项目列表 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:list')") + @GetMapping("/list") + public AjaxResult list(IpcPatrolTaskItem ipcPatrolTaskItem) + { + List list = ipcPatrolTaskItemService.selectIpcPatrolTaskItemList(ipcPatrolTaskItem); + return AjaxResult.success(list); + } + + /** + * 导出巡检任务项目列表 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:export')") + @Log(title = "巡检任务项目", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IpcPatrolTaskItem ipcPatrolTaskItem) + { + List list = ipcPatrolTaskItemService.selectIpcPatrolTaskItemList(ipcPatrolTaskItem); + ExcelUtil util = new ExcelUtil(IpcPatrolTaskItem.class); + util.exportExcel(response, list, "巡检任务项目数据"); + } + + /** + * 获取巡检任务项目详细信息 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(ipcPatrolTaskItemService.selectIpcPatrolTaskItemById(id)); + } + + /** + * 新增巡检任务项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:add')") + @Log(title = "巡检任务项目", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IpcPatrolTaskItem ipcPatrolTaskItem) + { + return toAjax(ipcPatrolTaskItemService.insertIpcPatrolTaskItem(ipcPatrolTaskItem)); + } + + /** + * 修改巡检任务项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:edit')") + @Log(title = "巡检任务项目", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IpcPatrolTaskItem ipcPatrolTaskItem) + { + return toAjax(ipcPatrolTaskItemService.updateIpcPatrolTaskItem(ipcPatrolTaskItem)); + } + + /** + * 删除巡检任务项目 + */ + @PreAuthorize("@ss.hasPermi('patrol:taskItem:remove')") + @Log(title = "巡检任务项目", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ipcPatrolTaskItemService.deleteIpcPatrolTaskItemByIds(ids)); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolItem.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolItem.java new file mode 100644 index 0000000..882f290 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolItem.java @@ -0,0 +1,174 @@ +package com.inspur.patrol.domain; + +import java.math.BigDecimal; +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 巡检项目对象 ipc_patrol_item + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public class IpcPatrolItem extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 父项目ID */ + private Long parentId; + + /** 巡检项名称 */ + @Excel(name = "巡检项名称") + private String name; + + /** 巡检项编码 */ + @Excel(name = "巡检项编码") + private String code; + + /** 巡检项类型 */ + @Excel(name = "巡检项类型",dictType = "patrol_item_type") + private Integer type; + + /** 上限值 */ + @Excel(name = "上限值") + private BigDecimal maxValue; + + /** 下限值 */ + @Excel(name = "下限值") + private BigDecimal minValue; + + /** 参考值 */ + @Excel(name = "参考值") + private String referenceValue; + + /** 正常选项 */ + @Excel(name = "正常选项",dictType = "is_or_not") + private String normalOption; + + /** 是否父项目 */ + @Excel(name = "是否父项目",dictType = "is_or_not") + private Integer isParent; + + private String ids; + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + public void setMaxValue(BigDecimal maxValue) + { + this.maxValue = maxValue; + } + + public BigDecimal getMaxValue() + { + return maxValue; + } + public void setMinValue(BigDecimal minValue) + { + this.minValue = minValue; + } + + public BigDecimal getMinValue() + { + return minValue; + } + public void setReferenceValue(String referenceValue) + { + this.referenceValue = referenceValue; + } + + public String getReferenceValue() + { + return referenceValue; + } + public void setNormalOption(String normalOption) + { + this.normalOption = normalOption; + } + + public String getNormalOption() + { + return normalOption; + } + public void setIsParent(Integer isParent) + { + this.isParent = isParent; + } + + public Integer getIsParent() + { + return isParent; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parentId", getParentId()) + .append("name", getName()) + .append("code", getCode()) + .append("type", getType()) + .append("maxValue", getMaxValue()) + .append("minValue", getMinValue()) + .append("referenceValue", getReferenceValue()) + .append("normalOption", getNormalOption()) + .append("remark", getRemark()) + .append("isParent", getIsParent()) + .toString(); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java index 25716c0..f9f35ab 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java @@ -1,6 +1,7 @@ package com.inspur.patrol.domain; import java.util.Date; +import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.inspur.common.annotation.Excel; @@ -122,6 +123,15 @@ public class IpcPatrolPlan extends BaseEntity implements DeptId { @Excel(name = "备注") private String remark; + private Long itemId; + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } public void setId(String id) { this.id = id; diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolReport.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolReport.java index 3a7b51f..b2f3a68 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolReport.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolReport.java @@ -5,6 +5,8 @@ import com.inspur.common.core.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import java.util.List; + /** * 巡检报告对象 ipc_patrol_report * @@ -41,6 +43,16 @@ public class IpcPatrolReport extends BaseEntity @Excel(name = "巡检结果") private String reportResult; + private List itemList; + + public List getItemList() { + return itemList; + } + + public void setItemList(List itemList) { + this.itemList = itemList; + } + public void setId(String id) { this.id = id; diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java index 0888930..718df80 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java @@ -1,6 +1,7 @@ package com.inspur.patrol.domain; import java.util.Date; +import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.inspur.common.annotation.Excel; diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTaskItem.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTaskItem.java new file mode 100644 index 0000000..f6555f6 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTaskItem.java @@ -0,0 +1,179 @@ +package com.inspur.patrol.domain; + +import java.math.BigDecimal; +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 巡检任务项目对象 ipc_patrol_task_item + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public class IpcPatrolTaskItem extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 巡检任务ID */ + @Excel(name = "巡检任务ID") + private String taskId; + + /** 巡检项名称 */ + @Excel(name = "巡检项名称") + private String name; + + /** 巡检项编码 */ + @Excel(name = "巡检项编码") + private String code; + + /** 巡检项类型 */ + @Excel(name = "巡检项类型") + private Integer type; + + /** 上限值 */ + @Excel(name = "上限值") + private BigDecimal maxValue; + + /** 下限值 */ + @Excel(name = "下限值") + private BigDecimal minValue; + + /** 参考值 */ + @Excel(name = "参考值") + private String referenceValue; + + /** 正常选项 */ + @Excel(name = "正常选项") + private String normalOption; + + /** 实际值 */ + @Excel(name = "实际值") + private String actualValue; + + /** 是否异常:0 否,1 是 */ + @Excel(name = "是否异常:0 否,1 是") + private Integer isAbnormal; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTaskId(String taskId) + { + this.taskId = taskId; + } + + public String getTaskId() + { + return taskId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + public void setMaxValue(BigDecimal maxValue) + { + this.maxValue = maxValue; + } + + public BigDecimal getMaxValue() + { + return maxValue; + } + public void setMinValue(BigDecimal minValue) + { + this.minValue = minValue; + } + + public BigDecimal getMinValue() + { + return minValue; + } + public void setReferenceValue(String referenceValue) + { + this.referenceValue = referenceValue; + } + + public String getReferenceValue() + { + return referenceValue; + } + public void setNormalOption(String normalOption) + { + this.normalOption = normalOption; + } + + public String getNormalOption() + { + return normalOption; + } + public void setActualValue(String actualValue) + { + this.actualValue = actualValue; + } + + public String getActualValue() + { + return actualValue; + } + public void setIsAbnormal(Integer isAbnormal) + { + this.isAbnormal = isAbnormal; + } + + public Integer getIsAbnormal() + { + return isAbnormal; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskId", getTaskId()) + .append("name", getName()) + .append("code", getCode()) + .append("type", getType()) + .append("maxValue", getMaxValue()) + .append("minValue", getMinValue()) + .append("referenceValue", getReferenceValue()) + .append("normalOption", getNormalOption()) + .append("remark", getRemark()) + .append("actualValue", getActualValue()) + .append("isAbnormal", getIsAbnormal()) + .toString(); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolItemMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolItemMapper.java new file mode 100644 index 0000000..95132d8 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolItemMapper.java @@ -0,0 +1,61 @@ +package com.inspur.patrol.mapper; + +import java.util.List; +import com.inspur.patrol.domain.IpcPatrolItem; + +/** + * 巡检项目Mapper接口 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public interface IpcPatrolItemMapper +{ + /** + * 查询巡检项目 + * + * @param id 巡检项目主键 + * @return 巡检项目 + */ + public IpcPatrolItem selectIpcPatrolItemById(Long id); + + /** + * 查询巡检项目列表 + * + * @param ipcPatrolItem 巡检项目 + * @return 巡检项目集合 + */ + public List selectIpcPatrolItemList(IpcPatrolItem ipcPatrolItem); + + /** + * 新增巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + public int insertIpcPatrolItem(IpcPatrolItem ipcPatrolItem); + + /** + * 修改巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + public int updateIpcPatrolItem(IpcPatrolItem ipcPatrolItem); + + /** + * 删除巡检项目 + * + * @param id 巡检项目主键 + * @return 结果 + */ + public int deleteIpcPatrolItemById(Long id); + + /** + * 批量删除巡检项目 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIpcPatrolItemByIds(Long[] ids); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolTaskItemMapper.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolTaskItemMapper.java new file mode 100644 index 0000000..95330f1 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/mapper/IpcPatrolTaskItemMapper.java @@ -0,0 +1,96 @@ +package com.inspur.patrol.mapper; + +import java.util.List; + +import com.inspur.patrol.domain.IpcPatrolTask; +import com.inspur.patrol.domain.IpcPatrolTaskItem; + +/** + * 巡检任务项目Mapper接口 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public interface IpcPatrolTaskItemMapper +{ + /** + * 查询巡检任务项目 + * + * @param id 巡检任务项目主键 + * @return 巡检任务项目 + */ + public IpcPatrolTaskItem selectIpcPatrolTaskItemById(Long id); + + /** + * 查询巡检任务项目列表 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 巡检任务项目集合 + */ + public List selectIpcPatrolTaskItemList(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 新增巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + public int insertIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 修改巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + public int updateIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 删除巡检任务项目 + * + * @param id 巡检任务项目主键 + * @return 结果 + */ + public int deleteIpcPatrolTaskItemById(Long id); + + /** + * 批量删除巡检任务项目 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIpcPatrolTaskItemByIds(Long[] ids); + + /** + * 批量新增巡检任务项目 + * + * @param ipcPatrolTask 巡检任务 + * @return 结果 + */ + public int batchInsertIpcPatrolTaskItem(IpcPatrolTask ipcPatrolTask); + + /** + * 批量新增巡检任务项目 + * + * @param ipcPatrolTaskList 巡检任务 + * @return 结果 + */ + public int batchInsertIpcPatrolTaskItems(List ipcPatrolTaskList); + + /** + * 批量更新巡检任务项目 + * + * @param ipcPatrolTaskItemList 巡检任务项目列表 + * @return 结果 + */ + public int batchUpdateIpcPatrolTaskItem(List ipcPatrolTaskItemList); + + /** + * 通过巡检任务主键删除巡检任务项目信息 + * + * @param id 巡检任务ID + * @return 结果 + */ + public int deleteIpcPatrolTaskItemByTaskId(String id); + +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolItemService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolItemService.java new file mode 100644 index 0000000..ce8fc04 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolItemService.java @@ -0,0 +1,61 @@ +package com.inspur.patrol.service; + +import java.util.List; +import com.inspur.patrol.domain.IpcPatrolItem; + +/** + * 巡检项目Service接口 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public interface IIpcPatrolItemService +{ + /** + * 查询巡检项目 + * + * @param id 巡检项目主键 + * @return 巡检项目 + */ + public IpcPatrolItem selectIpcPatrolItemById(Long id); + + /** + * 查询巡检项目列表 + * + * @param ipcPatrolItem 巡检项目 + * @return 巡检项目集合 + */ + public List selectIpcPatrolItemList(IpcPatrolItem ipcPatrolItem); + + /** + * 新增巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + public int insertIpcPatrolItem(IpcPatrolItem ipcPatrolItem); + + /** + * 修改巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + public int updateIpcPatrolItem(IpcPatrolItem ipcPatrolItem); + + /** + * 批量删除巡检项目 + * + * @param ids 需要删除的巡检项目主键集合 + * @return 结果 + */ + public int deleteIpcPatrolItemByIds(Long[] ids); + + /** + * 删除巡检项目信息 + * + * @param id 巡检项目主键 + * @return 结果 + */ + public int deleteIpcPatrolItemById(Long id); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolTaskItemService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolTaskItemService.java new file mode 100644 index 0000000..8435429 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/IIpcPatrolTaskItemService.java @@ -0,0 +1,61 @@ +package com.inspur.patrol.service; + +import java.util.List; +import com.inspur.patrol.domain.IpcPatrolTaskItem; + +/** + * 巡检任务项目Service接口 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +public interface IIpcPatrolTaskItemService +{ + /** + * 查询巡检任务项目 + * + * @param id 巡检任务项目主键 + * @return 巡检任务项目 + */ + public IpcPatrolTaskItem selectIpcPatrolTaskItemById(Long id); + + /** + * 查询巡检任务项目列表 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 巡检任务项目集合 + */ + public List selectIpcPatrolTaskItemList(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 新增巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + public int insertIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 修改巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + public int updateIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem); + + /** + * 批量删除巡检任务项目 + * + * @param ids 需要删除的巡检任务项目主键集合 + * @return 结果 + */ + public int deleteIpcPatrolTaskItemByIds(Long[] ids); + + /** + * 删除巡检任务项目信息 + * + * @param id 巡检任务项目主键 + * @return 结果 + */ + public int deleteIpcPatrolTaskItemById(Long id); +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolItemServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolItemServiceImpl.java new file mode 100644 index 0000000..b31cd60 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolItemServiceImpl.java @@ -0,0 +1,93 @@ +package com.inspur.patrol.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.inspur.patrol.mapper.IpcPatrolItemMapper; +import com.inspur.patrol.domain.IpcPatrolItem; +import com.inspur.patrol.service.IIpcPatrolItemService; + +/** + * 巡检项目Service业务层处理 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +@Service +public class IpcPatrolItemServiceImpl implements IIpcPatrolItemService +{ + @Autowired + private IpcPatrolItemMapper ipcPatrolItemMapper; + + /** + * 查询巡检项目 + * + * @param id 巡检项目主键 + * @return 巡检项目 + */ + @Override + public IpcPatrolItem selectIpcPatrolItemById(Long id) + { + return ipcPatrolItemMapper.selectIpcPatrolItemById(id); + } + + /** + * 查询巡检项目列表 + * + * @param ipcPatrolItem 巡检项目 + * @return 巡检项目 + */ + @Override + public List selectIpcPatrolItemList(IpcPatrolItem ipcPatrolItem) + { + return ipcPatrolItemMapper.selectIpcPatrolItemList(ipcPatrolItem); + } + + /** + * 新增巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + @Override + public int insertIpcPatrolItem(IpcPatrolItem ipcPatrolItem) + { + return ipcPatrolItemMapper.insertIpcPatrolItem(ipcPatrolItem); + } + + /** + * 修改巡检项目 + * + * @param ipcPatrolItem 巡检项目 + * @return 结果 + */ + @Override + public int updateIpcPatrolItem(IpcPatrolItem ipcPatrolItem) + { + return ipcPatrolItemMapper.updateIpcPatrolItem(ipcPatrolItem); + } + + /** + * 批量删除巡检项目 + * + * @param ids 需要删除的巡检项目主键 + * @return 结果 + */ + @Override + public int deleteIpcPatrolItemByIds(Long[] ids) + { + return ipcPatrolItemMapper.deleteIpcPatrolItemByIds(ids); + } + + /** + * 删除巡检项目信息 + * + * @param id 巡检项目主键 + * @return 结果 + */ + @Override + public int deleteIpcPatrolItemById(Long id) + { + return ipcPatrolItemMapper.deleteIpcPatrolItemById(id); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolReportServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolReportServiceImpl.java index 1e4f14b..1c911e8 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolReportServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolReportServiceImpl.java @@ -7,6 +7,7 @@ import com.inspur.common.constant.Constants; import com.inspur.common.utils.DateUtils; import com.inspur.common.utils.uuid.IdUtils; import com.inspur.patrol.domain.IpcPatrolTask; +import com.inspur.patrol.mapper.IpcPatrolTaskItemMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.inspur.patrol.mapper.IpcPatrolReportMapper; @@ -26,6 +27,8 @@ public class IpcPatrolReportServiceImpl implements IIpcPatrolReportService private IpcPatrolReportMapper ipcPatrolReportMapper; @Autowired private IpcPatrolTaskServiceImpl ipcPatrolTaskService; + @Autowired + private IpcPatrolTaskItemMapper ipcPatrolTaskItemMapper; /** * 查询巡检报告 * @@ -75,6 +78,10 @@ public class IpcPatrolReportServiceImpl implements IIpcPatrolReportService ipcPatrolTask.setStatus(Constants.PATROL_TASK_STATUS_COMPLETE); ipcPatrolTask.setActualTime(new Date()); ipcPatrolTaskService.updateIpcPatrolTask(ipcPatrolTask); + // 更新巡检项 + if(!ipcPatrolReport.getItemList().isEmpty()) { + ipcPatrolTaskItemMapper.batchUpdateIpcPatrolTaskItem(ipcPatrolReport.getItemList()); + } // 新增报告 ipcPatrolReport.setId(IdUtils.fastSimpleUUID()); ipcPatrolReport.setCreateTime(DateUtils.getNowDate()); diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskItemServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskItemServiceImpl.java new file mode 100644 index 0000000..b4974fc --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskItemServiceImpl.java @@ -0,0 +1,93 @@ +package com.inspur.patrol.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.inspur.patrol.mapper.IpcPatrolTaskItemMapper; +import com.inspur.patrol.domain.IpcPatrolTaskItem; +import com.inspur.patrol.service.IIpcPatrolTaskItemService; + +/** + * 巡检任务项目Service业务层处理 + * + * @author zhanghan11 + * @date 2024-07-22 + */ +@Service +public class IpcPatrolTaskItemServiceImpl implements IIpcPatrolTaskItemService +{ + @Autowired + private IpcPatrolTaskItemMapper ipcPatrolTaskItemMapper; + + /** + * 查询巡检任务项目 + * + * @param id 巡检任务项目主键 + * @return 巡检任务项目 + */ + @Override + public IpcPatrolTaskItem selectIpcPatrolTaskItemById(Long id) + { + return ipcPatrolTaskItemMapper.selectIpcPatrolTaskItemById(id); + } + + /** + * 查询巡检任务项目列表 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 巡检任务项目 + */ + @Override + public List selectIpcPatrolTaskItemList(IpcPatrolTaskItem ipcPatrolTaskItem) + { + return ipcPatrolTaskItemMapper.selectIpcPatrolTaskItemList(ipcPatrolTaskItem); + } + + /** + * 新增巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + @Override + public int insertIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem) + { + return ipcPatrolTaskItemMapper.insertIpcPatrolTaskItem(ipcPatrolTaskItem); + } + + /** + * 修改巡检任务项目 + * + * @param ipcPatrolTaskItem 巡检任务项目 + * @return 结果 + */ + @Override + public int updateIpcPatrolTaskItem(IpcPatrolTaskItem ipcPatrolTaskItem) + { + return ipcPatrolTaskItemMapper.updateIpcPatrolTaskItem(ipcPatrolTaskItem); + } + + /** + * 批量删除巡检任务项目 + * + * @param ids 需要删除的巡检任务项目主键 + * @return 结果 + */ + @Override + public int deleteIpcPatrolTaskItemByIds(Long[] ids) + { + return ipcPatrolTaskItemMapper.deleteIpcPatrolTaskItemByIds(ids); + } + + /** + * 删除巡检任务项目信息 + * + * @param id 巡检任务项目主键 + * @return 结果 + */ + @Override + public int deleteIpcPatrolTaskItemById(Long id) + { + return ipcPatrolTaskItemMapper.deleteIpcPatrolTaskItemById(id); + } +} diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskServiceImpl.java index 15a6901..3332b23 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/service/impl/IpcPatrolTaskServiceImpl.java @@ -6,11 +6,13 @@ import java.util.List; import com.inspur.common.utils.DateUtils; import com.inspur.common.utils.SecurityUtils; import com.inspur.common.utils.uuid.IdUtils; +import com.inspur.patrol.mapper.IpcPatrolTaskItemMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.inspur.patrol.mapper.IpcPatrolTaskMapper; import com.inspur.patrol.domain.IpcPatrolTask; import com.inspur.patrol.service.IIpcPatrolTaskService; +import org.springframework.transaction.annotation.Transactional; /** * 巡检任务Service业务层处理 @@ -22,7 +24,8 @@ import com.inspur.patrol.service.IIpcPatrolTaskService; public class IpcPatrolTaskServiceImpl implements IIpcPatrolTaskService { @Autowired private IpcPatrolTaskMapper ipcPatrolTaskMapper; - + @Autowired + private IpcPatrolTaskItemMapper ipcPatrolTaskItemMapper; /** * 查询巡检任务 * @@ -122,7 +125,9 @@ public class IpcPatrolTaskServiceImpl implements IIpcPatrolTaskService { * @return 结果 */ @Override + @Transactional public int batchInsertIpcPatrolTask(List ipcPatrolTaskList) { + ipcPatrolTaskItemMapper.batchInsertIpcPatrolTaskItems(ipcPatrolTaskList); return ipcPatrolTaskMapper.batchInsertIpcPatrolTask(ipcPatrolTaskList); } diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolItemMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolItemMapper.xml new file mode 100644 index 0000000..8d0664e --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolItemMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + select id, parent_id, name, code, type, max_value, min_value, reference_value, normal_option, remark, is_parent from ipc_patrol_item + + + + + + + insert into ipc_patrol_item + + id, + parent_id, + name, + code, + type, + max_value, + min_value, + reference_value, + normal_option, + remark, + is_parent, + + + #{id}, + #{parentId}, + #{name}, + #{code}, + #{type}, + #{maxValue}, + #{minValue}, + #{referenceValue}, + #{normalOption}, + #{remark}, + #{isParent}, + + + + + update ipc_patrol_item + + parent_id = #{parentId}, + name = #{name}, + code = #{code}, + type = #{type}, + max_value = #{maxValue}, + min_value = #{minValue}, + reference_value = #{referenceValue}, + normal_option = #{normalOption}, + remark = #{remark}, + is_parent = #{isParent}, + + where id = #{id} + + + + delete from ipc_patrol_item where id = #{id} + + + + delete from ipc_patrol_item where id in + + #{id} + + + diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolPlanMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolPlanMapper.xml index c621dd6..60dcbe9 100644 --- a/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolPlanMapper.xml +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolPlanMapper.xml @@ -23,6 +23,7 @@ + @@ -43,7 +44,8 @@ p.starttime, p.endtime, p.dept_id, - d.dept_name dept + d.dept_name dept, + p.item_id from ipc_patrol_plan p left join sys_user c on p.creater_id = c.user_id left join sys_user e on p.executor_id = e.user_id @@ -91,6 +93,7 @@ starttime, endtime, dept_id, + item_id, #{id}, @@ -107,6 +110,7 @@ #{starttime}, #{endtime}, #{deptId}, + #{itemId}, @@ -126,6 +130,7 @@ starttime = #{starttime}, endtime = #{endtime}, dept_id = #{deptId}, + item_id = #{itemId}, where id = #{id} diff --git a/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolTaskItemMapper.xml b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolTaskItemMapper.xml new file mode 100644 index 0000000..221c1c7 --- /dev/null +++ b/zfipc-server/zfipc-system/src/main/resources/mapper/patrol/IpcPatrolTaskItemMapper.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + select id, + task_id, + name, + code, + type, + max_value, + min_value, + reference_value, + normal_option, + remark, + actual_value, + is_abnormal + from ipc_patrol_task_item + + + + + + + + insert into ipc_patrol_task_item + + id, + task_id, + name, + code, + type, + max_value, + min_value, + reference_value, + normal_option, + remark, + actual_value, + is_abnormal, + + + #{id}, + #{taskId}, + #{name}, + #{code}, + #{type}, + #{maxValue}, + #{minValue}, + #{referenceValue}, + #{normalOption}, + #{remark}, + #{actualValue}, + #{isAbnormal}, + + + + + update ipc_patrol_task_item + + task_id = #{taskId}, + name = #{name}, + code = #{code}, + type = #{type}, + max_value = #{maxValue}, + min_value = #{minValue}, + reference_value = #{referenceValue}, + normal_option = #{normalOption}, + remark = #{remark}, + actual_value = #{actualValue}, + is_abnormal = #{isAbnormal}, + + where id = #{id} + + + + delete + from ipc_patrol_task_item + where id = #{id} + + + + delete from ipc_patrol_task_item where id in + + #{id} + + + + + delete + from ipc_patrol_task_item + where task_id = #{taskId} + + + + insert into ipc_patrol_task_item(task_id, name, code, type, max_value, min_value, reference_value, + normal_option, remark) + select #{id}, + name, + code, + type, + max_value, + min_value, + reference_value, + normal_option, + remark + from ipc_patrol_item + where parent_id = (SELECT item_id FROM `ipc_patrol_plan` WHERE id = #{planId}) + + + + insert into ipc_patrol_task_item(task_id, name, code, type, max_value, min_value, reference_value, + normal_option, remark) + + select #{item.id}, + name, + code, + type, + max_value, + min_value, + reference_value, + normal_option, + remark + from ipc_patrol_item + where parent_id = (SELECT item_id FROM `ipc_patrol_plan` WHERE id = #{item.planId}) + + + + + update ipc_patrol_task_item + + + + when #{item.id} then #{item.actualValue} + + + + + when #{item.id} then #{item.isAbnormal} + + + + where id in ( + + #{item.id} + + ); + +