From a916fe242b0e973a3ac3227d69994b2c814c093b Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Tue, 31 Oct 2023 17:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E6=A3=80=E5=B7=A5=E5=8D=95=E3=80=81?= =?UTF-8?q?=E4=BF=9D=E5=85=BB=E5=B7=A5=E5=8D=95init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EquSpotInspectionOrderController.java | 92 ++++++++++++++++++ .../controller/EquUpkeepOrderController.java | 92 ++++++++++++++++++ .../com/op/device/mapper/EquOrderMapper.java | 7 ++ .../IEquSpotInspectionOrderService.java | 61 ++++++++++++ .../service/IEquUpkeepOrderService.java | 61 ++++++++++++ .../EquSpotInspectionOrderServiceImpl.java | 96 ++++++++++++++++++ .../impl/EquUpkeepOrderServiceImpl.java | 97 +++++++++++++++++++ .../mapper/device/EquOrderMapper.xml | 11 ++- 8 files changed, 514 insertions(+), 3 deletions(-) create mode 100644 op-modules/op-device/src/main/java/com/op/device/controller/EquSpotInspectionOrderController.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepOrderController.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/IEquSpotInspectionOrderService.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepOrderService.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpotInspectionOrderServiceImpl.java create mode 100644 op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquSpotInspectionOrderController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquSpotInspectionOrderController.java new file mode 100644 index 00000000..7e691002 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquSpotInspectionOrderController.java @@ -0,0 +1,92 @@ +package com.op.device.controller; + +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.web.page.TableDataInfo; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.device.domain.EquOrder; +import com.op.device.service.IEquSpotInspectionOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 点检工单Controller + * + * @author wws + * @date 2023-10-31 + */ +@RestController +@RequestMapping("/spotInspectionOrder") +public class EquSpotInspectionOrderController extends BaseController { + + @Autowired + private IEquSpotInspectionOrderService equSpotInspectionOrderService; + + /** + * 查询点检工单列表 + */ + @RequiresPermissions("device:spotInspectionOrder:list") + @GetMapping("/list") + public TableDataInfo list(EquOrder equOrder) { + startPage(); + List list = equSpotInspectionOrderService.selectEquOrderList(equOrder); + return getDataTable(list); + } + + /** + * 导出点检工单列表 + */ + @RequiresPermissions("device:spotInspectionOrder:export") + @Log(title = "点检工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquOrder equOrder) { + List list = equSpotInspectionOrderService.selectEquOrderList(equOrder); + ExcelUtil util = new ExcelUtil(EquOrder.class); + util.exportExcel(response, list, "点检工单数据"); + } + + /** + * 获取点检工单详细信息 + */ + @RequiresPermissions("device:spotInspectionOrder:query") + @GetMapping(value = "/{orderId}") + public AjaxResult getInfo(@PathVariable("orderId") String orderId) { + return success(equSpotInspectionOrderService.selectEquOrderByOrderId(orderId)); + } + + /** + * 新增点检工单 + */ + @RequiresPermissions("device:spotInspectionOrder:add") + @Log(title = "点检工单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EquOrder equOrder) { + return toAjax(equSpotInspectionOrderService.insertEquOrder(equOrder)); + } + + /** + * 修改点检工单 + */ + @RequiresPermissions("device:spotInspectionOrder:edit") + @Log(title = "点检工单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EquOrder equOrder) { + return toAjax(equSpotInspectionOrderService.updateEquOrder(equOrder)); + } + + /** + * 删除点检工单 + */ + @RequiresPermissions("device:spotInspectionOrder:remove") + @Log(title = "点检工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{orderIds}") + public AjaxResult remove(@PathVariable String[] orderIds) { + return toAjax(equSpotInspectionOrderService.deleteEquOrderByOrderIds(orderIds)); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepOrderController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepOrderController.java new file mode 100644 index 00000000..7f7344d1 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquUpkeepOrderController.java @@ -0,0 +1,92 @@ +package com.op.device.controller; + +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.web.page.TableDataInfo; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.device.domain.EquOrder; +import com.op.device.service.IEquUpkeepOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 保养工单Controller + * + * @author wws + * @date 2023-10-31 + */ +@RestController +@RequestMapping("/upkeepOrder") +public class EquUpkeepOrderController extends BaseController { + + @Autowired + private IEquUpkeepOrderService equUpkeepOrderService; + + /** + * 查询保养工单列表 + */ + @RequiresPermissions("device:upkeepOrder:list") + @GetMapping("/list") + public TableDataInfo list(EquOrder equOrder) { + startPage(); + List list = equUpkeepOrderService.selectEquOrderList(equOrder); + return getDataTable(list); + } + + /** + * 导出保养工单列表 + */ + @RequiresPermissions("device:upkeepOrder:export") + @Log(title = "保养工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquOrder equOrder) { + List list = equUpkeepOrderService.selectEquOrderList(equOrder); + ExcelUtil util = new ExcelUtil(EquOrder.class); + util.exportExcel(response, list, "保养工单数据"); + } + + /** + * 获取保养工单详细信息 + */ + @RequiresPermissions("device:upkeepOrder:query") + @GetMapping(value = "/{orderId}") + public AjaxResult getInfo(@PathVariable("orderId") String orderId) { + return success(equUpkeepOrderService.selectEquOrderByOrderId(orderId)); + } + + /** + * 新增保养工单 + */ + @RequiresPermissions("device:upkeepOrder:add") + @Log(title = "保养工单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EquOrder equOrder) { + return toAjax(equUpkeepOrderService.insertEquOrder(equOrder)); + } + + /** + * 修改保养工单 + */ + @RequiresPermissions("device:upkeepOrder:edit") + @Log(title = "保养工单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EquOrder equOrder) { + return toAjax(equUpkeepOrderService.updateEquOrder(equOrder)); + } + + /** + * 删除保养工单 + */ + @RequiresPermissions("device:upkeepOrder:remove") + @Log(title = "保养工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{orderIds}") + public AjaxResult remove(@PathVariable String[] orderIds) { + return toAjax(equUpkeepOrderService.deleteEquOrderByOrderIds(orderIds)); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java index ed69a339..a447e04d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java @@ -85,4 +85,11 @@ public interface EquOrderMapper { * @return */ List selectTaskRecord(int userId); + + /** + * 通过id查询工单信息 + * @param orderId + * @return + */ + EquOrder selectEquOrderByOrderId(String orderId); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquSpotInspectionOrderService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquSpotInspectionOrderService.java new file mode 100644 index 00000000..ad471e9c --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquSpotInspectionOrderService.java @@ -0,0 +1,61 @@ +package com.op.device.service; + +import com.op.device.domain.EquOrder; + +import java.util.List; + +/** + * 点检工单Service接口 + * + * @author wws + * @date 2023-10-31 + */ +public interface IEquSpotInspectionOrderService { + /** + * 查询点检工单 + * + * @param orderId 点检工单主键 + * @return 点检工单 + */ + public EquOrder selectEquOrderByOrderId(String orderId); + + /** + * 查询点检工单列表 + * + * @param equOrder 点检工单 + * @return 点检工单集合 + */ + public List selectEquOrderList(EquOrder equOrder); + + /** + * 新增点检工单 + * + * @param equOrder 点检工单 + * @return 结果 + */ + public int insertEquOrder(EquOrder equOrder); + + /** + * 修改点检工单 + * + * @param equOrder 点检工单 + * @return 结果 + */ + public int updateEquOrder(EquOrder equOrder); + + /** + * 批量删除点检工单 + * + * @param orderIds 需要删除的点检工单主键集合 + * @return 结果 + */ + public int deleteEquOrderByOrderIds(String[] orderIds); + + /** + * 删除点检工单信息 + * + * @param orderId 点检工单主键 + * @return 结果 + */ + public int deleteEquOrderByOrderId(String orderId); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepOrderService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepOrderService.java new file mode 100644 index 00000000..0827962b --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquUpkeepOrderService.java @@ -0,0 +1,61 @@ +package com.op.device.service; + +import com.op.device.domain.EquOrder; + +import java.util.List; + +/** + * 保养工单Service接口 + * + * @author wws + * @date 2023-10-31 + */ +public interface IEquUpkeepOrderService { + /** + * 查询保养工单 + * + * @param orderId 保养工单主键 + * @return 保养工单 + */ + public EquOrder selectEquOrderByOrderId(String orderId); + + /** + * 查询保养工单列表 + * + * @param equOrder 保养工单 + * @return 保养工单集合 + */ + public List selectEquOrderList(EquOrder equOrder); + + /** + * 新增保养工单 + * + * @param equOrder 保养工单 + * @return 结果 + */ + public int insertEquOrder(EquOrder equOrder); + + /** + * 修改保养工单 + * + * @param equOrder 保养工单 + * @return 结果 + */ + public int updateEquOrder(EquOrder equOrder); + + /** + * 批量删除保养工单 + * + * @param orderIds 需要删除的保养工单主键集合 + * @return 结果 + */ + public int deleteEquOrderByOrderIds(String[] orderIds); + + /** + * 删除保养工单信息 + * + * @param orderId 保养工单主键 + * @return 结果 + */ + public int deleteEquOrderByOrderId(String orderId); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpotInspectionOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpotInspectionOrderServiceImpl.java new file mode 100644 index 00000000..dd5ea116 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpotInspectionOrderServiceImpl.java @@ -0,0 +1,96 @@ +package com.op.device.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.device.domain.EquOrder; +import com.op.device.mapper.EquOrderMapper; +import com.op.device.service.IEquSpotInspectionOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 点检工单Service业务层处理 + * + * @author wws + * @date 2023-10-31 + */ +@Service +public class EquSpotInspectionOrderServiceImpl implements IEquSpotInspectionOrderService { + @Autowired + private EquOrderMapper equOrderMapper; + + /** + * 查询点检工单 + * + * @param orderId 点检工单主键 + * @return 点检工单 + */ + @Override + @DS("#header.poolName") + public EquOrder selectEquOrderByOrderId(String orderId) { + return equOrderMapper.selectEquOrderByOrderId(orderId); + } + + /** + * 查询点检工单列表 + * + * @param equOrder 点检工单 + * @return 点检工单 + */ + @Override + @DS("#header.poolName") + public List selectEquOrderList(EquOrder equOrder) { + return equOrderMapper.selectEquOrderList(equOrder); + } + + /** + * 新增点检工单 + * + * @param equOrder 点检工单 + * @return 结果 + */ + @Override + public int insertEquOrder(EquOrder equOrder) { + equOrder.setCreateTime(DateUtils.getNowDate()); + return equOrderMapper.insertEquOrder(equOrder); + } + + /** + * 修改点检工单 + * + * @param equOrder 点检工单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateEquOrder(EquOrder equOrder) { + equOrder.setUpdateTime(DateUtils.getNowDate()); + return equOrderMapper.updateEquOrder(equOrder); + } + + /** + * 批量删除点检工单 + * + * @param orderIds 需要删除的点检工单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOrderByOrderIds(String[] orderIds) { + return equOrderMapper.deleteEquOrderByOrderIds(orderIds); + } + + /** + * 删除点检工单信息 + * + * @param orderId 点检工单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOrderByOrderId(String orderId) { + return equOrderMapper.deleteEquOrderByOrderId(orderId); + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java new file mode 100644 index 00000000..7255138b --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepOrderServiceImpl.java @@ -0,0 +1,97 @@ +package com.op.device.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.device.domain.EquOrder; +import com.op.device.mapper.EquOrderMapper; +import com.op.device.service.IEquUpkeepOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 保养工单Service业务层处理 + * + * @author wws + * @date 2023-10-31 + */ +@Service +public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService { + @Autowired + private EquOrderMapper equOrderMapper; + + /** + * 查询保养工单 + * + * @param orderId 保养工单主键 + * @return 保养工单 + */ + @Override + @DS("#header.poolName") + public EquOrder selectEquOrderByOrderId(String orderId) { + return equOrderMapper.selectEquOrderByOrderId(orderId); + } + + /** + * 查询保养工单列表 + * + * @param equOrder 保养工单 + * @return 保养工单 + */ + @Override + @DS("#header.poolName") + public List selectEquOrderList(EquOrder equOrder) { + return equOrderMapper.selectEquOrderList(equOrder); + } + + /** + * 新增保养工单 + * + * @param equOrder 保养工单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertEquOrder(EquOrder equOrder) { + equOrder.setCreateTime(DateUtils.getNowDate()); + return equOrderMapper.insertEquOrder(equOrder); + } + + /** + * 修改保养工单 + * + * @param equOrder 保养工单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateEquOrder(EquOrder equOrder) { + equOrder.setUpdateTime(DateUtils.getNowDate()); + return equOrderMapper.updateEquOrder(equOrder); + } + + /** + * 批量删除保养工单 + * + * @param orderIds 需要删除的保养工单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOrderByOrderIds(String[] orderIds) { + return equOrderMapper.deleteEquOrderByOrderIds(orderIds); + } + + /** + * 删除保养工单信息 + * + * @param orderId 保养工单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteEquOrderByOrderId(String orderId) { + return equOrderMapper.deleteEquOrderByOrderId(orderId); + } +} diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 1fc0ad55..ae0833a9 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -75,8 +75,8 @@ and upkeep = #{upkeep} and calculation_rule = #{calculationRule} and shut_down = #{shutDown} + and del_flag = '0' - and del_flag = '0' - + + + insert into equ_order order_id,