点巡检管理添加点检项

This commit is contained in:
zhanghan11 2024-07-23 11:20:59 +08:00
parent 87afb058c5
commit 72c204bad0
18 changed files with 1351 additions and 2 deletions

View File

@ -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<IpcPatrolItem> 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<IpcPatrolItem> list = ipcPatrolItemService.selectIpcPatrolItemList(ipcPatrolItem);
ExcelUtil<IpcPatrolItem> util = new ExcelUtil<IpcPatrolItem>(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));
}
}

View File

@ -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<IpcPatrolTaskItem> 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<IpcPatrolTaskItem> list = ipcPatrolTaskItemService.selectIpcPatrolTaskItemList(ipcPatrolTaskItem);
ExcelUtil<IpcPatrolTaskItem> util = new ExcelUtil<IpcPatrolTaskItem>(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));
}
}

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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<IpcPatrolTaskItem> itemList;
public List<IpcPatrolTaskItem> getItemList() {
return itemList;
}
public void setItemList(List<IpcPatrolTaskItem> itemList) {
this.itemList = itemList;
}
public void setId(String id)
{
this.id = id;

View File

@ -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;

View File

@ -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();
}
}

View File

@ -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<IpcPatrolItem> 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);
}

View File

@ -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<IpcPatrolTaskItem> 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<IpcPatrolTask> ipcPatrolTaskList);
/**
* 批量更新巡检任务项目
*
* @param ipcPatrolTaskItemList 巡检任务项目列表
* @return 结果
*/
public int batchUpdateIpcPatrolTaskItem(List<IpcPatrolTaskItem> ipcPatrolTaskItemList);
/**
* 通过巡检任务主键删除巡检任务项目信息
*
* @param id 巡检任务ID
* @return 结果
*/
public int deleteIpcPatrolTaskItemByTaskId(String id);
}

View File

@ -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<IpcPatrolItem> 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);
}

View File

@ -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<IpcPatrolTaskItem> 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);
}

View File

@ -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<IpcPatrolItem> 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);
}
}

View File

@ -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());

View File

@ -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<IpcPatrolTaskItem> 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);
}
}

View File

@ -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<IpcPatrolTask> ipcPatrolTaskList) {
ipcPatrolTaskItemMapper.batchInsertIpcPatrolTaskItems(ipcPatrolTaskList);
return ipcPatrolTaskMapper.batchInsertIpcPatrolTask(ipcPatrolTaskList);
}

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.inspur.patrol.mapper.IpcPatrolItemMapper">
<resultMap type="IpcPatrolItem" id="IpcPatrolItemResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="name" column="name" />
<result property="code" column="code" />
<result property="type" column="type" />
<result property="maxValue" column="max_value" />
<result property="minValue" column="min_value" />
<result property="referenceValue" column="reference_value" />
<result property="normalOption" column="normal_option" />
<result property="remark" column="remark" />
<result property="isParent" column="is_parent" />
</resultMap>
<sql id="selectIpcPatrolItemVo">
select id, parent_id, name, code, type, max_value, min_value, reference_value, normal_option, remark, is_parent from ipc_patrol_item
</sql>
<select id="selectIpcPatrolItemList" parameterType="IpcPatrolItem" resultMap="IpcPatrolItemResult">
<include refid="selectIpcPatrolItemVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="type != null "> and type = #{type}</if>
<if test="maxValue != null "> and max_value = #{maxValue}</if>
<if test="minValue != null "> and min_value = #{minValue}</if>
<if test="referenceValue != null and referenceValue != ''"> and reference_value = #{referenceValue}</if>
<if test="normalOption != null and normalOption != ''"> and normal_option = #{normalOption}</if>
<if test="isParent != null "> and is_parent = #{isParent}</if>
<if test="ids != null "> and FIND_IN_SET(id,#{ids})</if>
</where>
order by code
</select>
<select id="selectIpcPatrolItemById" parameterType="Long" resultMap="IpcPatrolItemResult">
<include refid="selectIpcPatrolItemVo"/>
where id = #{id}
</select>
<insert id="insertIpcPatrolItem" parameterType="IpcPatrolItem">
insert into ipc_patrol_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="parentId != null">parent_id,</if>
<if test="name != null">name,</if>
<if test="code != null">code,</if>
<if test="type != null">type,</if>
<if test="maxValue != null">max_value,</if>
<if test="minValue != null">min_value,</if>
<if test="referenceValue != null">reference_value,</if>
<if test="normalOption != null">normal_option,</if>
<if test="remark != null">remark,</if>
<if test="isParent != null">is_parent,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="parentId != null">#{parentId},</if>
<if test="name != null">#{name},</if>
<if test="code != null">#{code},</if>
<if test="type != null">#{type},</if>
<if test="maxValue != null">#{maxValue},</if>
<if test="minValue != null">#{minValue},</if>
<if test="referenceValue != null">#{referenceValue},</if>
<if test="normalOption != null">#{normalOption},</if>
<if test="remark != null">#{remark},</if>
<if test="isParent != null">#{isParent},</if>
</trim>
</insert>
<update id="updateIpcPatrolItem" parameterType="IpcPatrolItem">
update ipc_patrol_item
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="name != null">name = #{name},</if>
<if test="code != null">code = #{code},</if>
<if test="type != null">type = #{type},</if>
max_value = #{maxValue},
min_value = #{minValue},
<if test="referenceValue != null">reference_value = #{referenceValue},</if>
normal_option = #{normalOption},
<if test="remark != null">remark = #{remark},</if>
<if test="isParent != null">is_parent = #{isParent},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteIpcPatrolItemById" parameterType="Long">
delete from ipc_patrol_item where id = #{id}
</delete>
<delete id="deleteIpcPatrolItemByIds" parameterType="String">
delete from ipc_patrol_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -23,6 +23,7 @@
<result property="endtime" column="endtime"/>
<result property="deptId" column="dept_id"/>
<result property="dept" column="dept"/>
<result property="itemId" column="item_id"/>
</resultMap>
<sql id="selectIpcPatrolPlanVo">
@ -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 @@
<if test="starttime != null">starttime,</if>
<if test="endtime != null">endtime,</if>
<if test="deptId != null">dept_id,</if>
<if test="itemId != null">item_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -107,6 +110,7 @@
<if test="starttime != null">#{starttime},</if>
<if test="endtime != null">#{endtime},</if>
<if test="deptId != null">#{deptId},</if>
<if test="itemId != null">#{itemId},</if>
</trim>
</insert>
@ -126,6 +130,7 @@
<if test="starttime != null">starttime = #{starttime},</if>
<if test="endtime != null">endtime = #{endtime},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="itemId != null">item_id = #{itemId},</if>
</trim>
where id = #{id}
</update>

View File

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.inspur.patrol.mapper.IpcPatrolTaskItemMapper">
<resultMap type="IpcPatrolTaskItem" id="IpcPatrolTaskItemResult">
<result property="id" column="id"/>
<result property="taskId" column="task_id"/>
<result property="name" column="name"/>
<result property="code" column="code"/>
<result property="type" column="type"/>
<result property="maxValue" column="max_value"/>
<result property="minValue" column="min_value"/>
<result property="referenceValue" column="reference_value"/>
<result property="normalOption" column="normal_option"/>
<result property="remark" column="remark"/>
<result property="actualValue" column="actual_value"/>
<result property="isAbnormal" column="is_abnormal"/>
</resultMap>
<sql id="selectIpcPatrolTaskItemVo">
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
</sql>
<select id="selectIpcPatrolTaskItemList" parameterType="IpcPatrolTaskItem" resultMap="IpcPatrolTaskItemResult">
<include refid="selectIpcPatrolTaskItemVo"/>
<where>
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="type != null ">and type = #{type}</if>
<if test="maxValue != null ">and max_value = #{maxValue}</if>
<if test="minValue != null ">and min_value = #{minValue}</if>
<if test="referenceValue != null and referenceValue != ''">and reference_value = #{referenceValue}</if>
<if test="normalOption != null and normalOption != ''">and normal_option = #{normalOption}</if>
<if test="actualValue != null and actualValue != ''">and actual_value = #{actualValue}</if>
<if test="isAbnormal != null ">and is_abnormal = #{isAbnormal}</if>
</where>
</select>
<select id="selectIpcPatrolTaskItemById" parameterType="Long" resultMap="IpcPatrolTaskItemResult">
<include refid="selectIpcPatrolTaskItemVo"/>
where id = #{id}
</select>
<insert id="insertIpcPatrolTaskItem" parameterType="IpcPatrolTaskItem">
insert into ipc_patrol_task_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="taskId != null">task_id,</if>
<if test="name != null">name,</if>
<if test="code != null">code,</if>
<if test="type != null">type,</if>
<if test="maxValue != null">max_value,</if>
<if test="minValue != null">min_value,</if>
<if test="referenceValue != null">reference_value,</if>
<if test="normalOption != null">normal_option,</if>
<if test="remark != null">remark,</if>
<if test="actualValue != null">actual_value,</if>
<if test="isAbnormal != null">is_abnormal,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="taskId != null">#{taskId},</if>
<if test="name != null">#{name},</if>
<if test="code != null">#{code},</if>
<if test="type != null">#{type},</if>
<if test="maxValue != null">#{maxValue},</if>
<if test="minValue != null">#{minValue},</if>
<if test="referenceValue != null">#{referenceValue},</if>
<if test="normalOption != null">#{normalOption},</if>
<if test="remark != null">#{remark},</if>
<if test="actualValue != null">#{actualValue},</if>
<if test="isAbnormal != null">#{isAbnormal},</if>
</trim>
</insert>
<update id="updateIpcPatrolTaskItem" parameterType="IpcPatrolTaskItem">
update ipc_patrol_task_item
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="name != null">name = #{name},</if>
<if test="code != null">code = #{code},</if>
<if test="type != null">type = #{type},</if>
<if test="maxValue != null">max_value = #{maxValue},</if>
<if test="minValue != null">min_value = #{minValue},</if>
<if test="referenceValue != null">reference_value = #{referenceValue},</if>
<if test="normalOption != null">normal_option = #{normalOption},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="actualValue != null">actual_value = #{actualValue},</if>
<if test="isAbnormal != null">is_abnormal = #{isAbnormal},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteIpcPatrolTaskItemById" parameterType="Long">
delete
from ipc_patrol_task_item
where id = #{id}
</delete>
<delete id="deleteIpcPatrolTaskItemByIds" parameterType="String">
delete from ipc_patrol_task_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteIpcPatrolTaskItemByTaskId" parameterType="String">
delete
from ipc_patrol_task_item
where task_id = #{taskId}
</delete>
<insert id="batchInsertIpcPatrolTaskItem">
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>
<insert id="batchInsertIpcPatrolTaskItems">
insert into ipc_patrol_task_item(task_id, name, code, type, max_value, min_value, reference_value,
normal_option, remark)
<foreach collection="list" index="index" item="item" separator="union">
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})
</foreach>
</insert>
<update id="batchUpdateIpcPatrolTaskItem">
update ipc_patrol_task_item
<trim prefix="set" suffixOverrides=",">
<trim prefix="actual_value = case id" suffix="end,">
<foreach collection="list" item="item">
when #{item.id} then #{item.actualValue}
</foreach>
</trim>
<trim prefix="is_abnormal = case id" suffix="end">
<foreach collection="list" item="item">
when #{item.id} then #{item.isAbnormal}
</foreach>
</trim>
</trim>
where id in (
<foreach collection="list" item="item" separator=",">
#{item.id}
</foreach>
);
</update>
</mapper>