From b865658cb28e83e11b58c34a318e53ba2fec4758 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Tue, 24 Oct 2023 09:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E5=B7=A5=E5=8D=95=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/controller/EquOrderController.java | 2 +- .../op/device/service/IEquOrderService.java | 2 +- .../service/impl/EquOrderServiceImpl.java | 28 ++++++++++++++----- .../mapper/device/EquOrderMapper.xml | 12 ++++---- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquOrderController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquOrderController.java index 1cab8e2e..df48dfd1 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquOrderController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquOrderController.java @@ -83,7 +83,7 @@ public class EquOrderController extends BaseController { @Log(title = "计划工单", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody EquOrder equOrder) { - return toAjax(equOrderService.updateEquOrder(equOrder)); + return equOrderService.updateEquOrder(equOrder); } /** diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquOrderService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquOrderService.java index b64356d3..da19e7c7 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquOrderService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquOrderService.java @@ -42,7 +42,7 @@ public interface IEquOrderService { * @param equOrder 计划工单 * @return 结果 */ - public int updateEquOrder(EquOrder equOrder); + public AjaxResult updateEquOrder(EquOrder equOrder); /** * 批量删除计划工单 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index c9386e81..12e6ca4f 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.device.domain.EquOrderDetail; @@ -98,8 +99,6 @@ public class EquOrderServiceImpl implements IEquOrderService { @DS("#header.poolName") public AjaxResult insertEquOrder(EquOrder equOrder) { equOrder.setCreateTime(DateUtils.getNowDate()); - // TODO 更新标准信息 - // TODO 更新工单信息 return success(); } @@ -111,13 +110,28 @@ public class EquOrderServiceImpl implements IEquOrderService { */ @Override @DS("#header.poolName") - public int updateEquOrder(EquOrder equOrder) { - equOrder.setUpdateTime(DateUtils.getNowDate()); - // TODO 更新标准信息 - // TODO 更新工单信息 + public AjaxResult updateEquOrder(EquOrder equOrder) { + // 更新工单信息 equOrder.setOrderStart(equOrder.getTimeArray().get(0)); equOrder.setOrderEnd(equOrder.getTimeArray().get(1)); - return equOrderMapper.updateEquOrder(equOrder); + equOrder.setUpdateTime(DateUtils.getNowDate()); + equOrder.setUpdateBy(SecurityContextHolder.getUserName()); + equOrderMapper.updateEquOrder(equOrder); + + // 更新标准信息 + List equList = equOrder.getEquList(); + for (EquOrderEqu equ : equList) { + List detailList = equ.getDetailList(); + for (EquOrderDetail detail : detailList) { + List standardList = detail.getStandardList(); + for (EquOrderStandard standard : standardList) { + standard.setUpdateBy(SecurityContextHolder.getUserName()); + standard.setUpdateTime(DateUtils.getNowDate()); + equOrderStandardMapper.updateEquOrderStandard(standard); + } + } + } + return success(); } /** 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 255074a1..cfb3f567 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 @@ -43,10 +43,10 @@ and plan_id = #{planId} - and plan_code = #{planCode} + and plan_code like concat('%', #{planCode}, '%') and plan_type = #{planType} - and order_code = #{orderCode} - and plan_workshop = #{planWorkshop} + and order_code like concat('%', #{orderCode}, '%') + and plan_workshop like concat('%', #{planWorkshop}, '%') and plan_prod_line = #{planProdLine} and plan_loop = #{planLoop} and plan_loop_type = #{planLoopType} @@ -57,7 +57,7 @@ and equipment_code = #{equipmentCode} and order_status = #{orderStatus} and order_cost = #{orderCost} - and plan_person = #{planPerson} + and plan_person like concat('%', #{planPerson}, '%') and order_cost_time = #{orderCostTime} and order_sign_person = #{orderSignPerson} and factory_code = #{factoryCode} @@ -65,9 +65,9 @@ and attr2 = #{attr2} and attr3 = #{attr3} and del_flag = #{delFlag} - and create_by = #{createBy} + and create_by like concat('%', #{createBy}, '%') and create_time = #{createTime} - and update_by = #{updateBy} + and update_by like concat('%', #{updateBy}, '%') and update_time = #{updateTime}