From a6acdae5c926363759e867846092ae5aef4162a1 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 2 Aug 2023 11:25:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=BF=E6=96=99=E8=AE=A1=E5=88=92=E6=A8=A1?= =?UTF-8?q?=E5=9D=97(=E8=AE=A1=E5=88=92=E4=BF=AE=E6=94=B9=E9=80=BB?= =?UTF-8?q?=E8=BE=91-=E6=9C=89=E8=AE=A1=E5=88=92=E5=B7=B2=E6=8E=A5?= =?UTF-8?q?=E6=96=99=E5=88=99=E4=B8=BB=E8=AE=A1=E5=88=92=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9)=E3=80=81=E8=AE=A2=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97(=E5=B7=A5=E5=8D=95=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=B1=BB=E5=9E=8B=E6=9C=AA=E5=8A=A0=E5=85=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E8=A7=A3=E5=86=B3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProWetMaterialPlanController.java | 10 +++++++ .../ProWetMaterialPlanDetailMapper.java | 7 +++++ .../service/IProWetMaterialPlanService.java | 8 ++++++ .../service/impl/ProOrderServiceImpl.java | 2 ++ .../impl/ProWetMaterialPlanServiceImpl.java | 26 ++++++++++++++----- .../plan/ProWetMaterialPlanDetailMapper.xml | 6 +++++ 6 files changed, 53 insertions(+), 6 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWetMaterialPlanController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWetMaterialPlanController.java index 2d41f880..46d7adc2 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWetMaterialPlanController.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWetMaterialPlanController.java @@ -30,6 +30,16 @@ public class ProWetMaterialPlanController extends BaseController { @Autowired private IProWetMaterialPlanService proWetMaterialPlanService; + /** + * 通过主计划id检验是否可以修改(所有都未接料) + * @param id + * @return + */ + @GetMapping("/checkChangePlan/{id}") + public AjaxResult checkChangePlan(@PathVariable("id") String id){ + return proWetMaterialPlanService.checkChangePlan(id); + } + /** * 修改湿料计划-提交接口 * diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java index 2b3c463e..7162a7dd 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWetMaterialPlanDetailMapper.java @@ -76,4 +76,11 @@ public interface ProWetMaterialPlanDetailMapper { * @return */ ProWetMaterialPlanDetail selectProWetMaterialPlanDetailByWorkId(String id); + + /** + * 通过主计划id查询已接料的湿料详情list + * @param id + * @return + */ + List selectProWetMaterialPlanDetailByOrderId(String id); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/IProWetMaterialPlanService.java b/op-modules/op-plan/src/main/java/com/op/plan/service/IProWetMaterialPlanService.java index 622f0c37..bc87d02a 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/IProWetMaterialPlanService.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/IProWetMaterialPlanService.java @@ -116,4 +116,12 @@ public interface IProWetMaterialPlanService { * @return */ AjaxResult updateWetMaterialPlanDetail(List detailList); + + /** + * 通过主计划id检验是否可以修改(所有都未接料) + * + * @param id + * @return + */ + AjaxResult checkChangePlan(String id); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 74dbf7d0..c06f4c4e 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -411,6 +411,8 @@ public class ProOrderServiceImpl implements IProOrderService { proOrderWorkorder.setUnit(proOrder.getUnit()); // 已拆分数量 proOrderWorkorder.setQuantitySplit(Long.valueOf(proOrder.getAtrr1())); + // 设置工单产品类型 + proOrderWorkorder.setProdType(proOrder.getOrderType()); return proOrderWorkorder; } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWetMaterialPlanServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWetMaterialPlanServiceImpl.java index 1cd58c0e..fb8a351d 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWetMaterialPlanServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWetMaterialPlanServiceImpl.java @@ -6,10 +6,8 @@ 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.utils.uuid.IdUtils; -import com.op.common.core.utils.uuid.UUID; import com.op.common.core.web.domain.AjaxResult; import com.op.plan.domain.*; -import com.op.plan.mapper.ProOrderMapper; import com.op.plan.mapper.ProOrderWorkorderMapper; import com.op.plan.mapper.ProWetMaterialPlanDetailMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -251,6 +249,22 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService return success(); } + /** + * 通过主计划id检验是否可以修改(所有都未接料) + * + * @param id + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult checkChangePlan(String id) { + List list = proWetMaterialPlanDetailMapper.selectProWetMaterialPlanDetailByOrderId(id); + if (list.size()>0){ + return error(500,"计划已接料!不可修改!"); + } + return success(); + } + /** * 创建湿料(主)计划 * @@ -275,8 +289,8 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService //proWetMaterialPlan.setFactoryCode(proOrderWorkorder.getFactoryCode()); // 计划日期 proWetMaterialPlan.setPlanTime(proOrderWorkorder.getPlanTime()); - // 同步状态(1已同步0未同步) - proWetMaterialPlan.setSyncFlag("0"); + // 同步状态(Y已同步N未同步) + proWetMaterialPlan.setSyncFlag("N"); // 计划编码 proWetMaterialPlan.setProdCode("PC" + DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSSsss, DateUtils.getNowDate())); // 创建主键id @@ -303,8 +317,8 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService detail.setWetMaterialPlanId(id); // 工单id detail.setWorkorderId(workorder.getWorkorderId()); - // 接料状态(1已接料0未接料) - detail.setStatus("0"); + // 接料状态(Y已接料N未接料) + detail.setStatus("N"); // 料罐id detail.setBucketId(String.valueOf(workorder.getBucketId())); // 料罐编码 diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanDetailMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanDetailMapper.xml index 9dd732de..0a3deed7 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanDetailMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProWetMaterialPlanDetailMapper.xml @@ -77,6 +77,12 @@ where workorder_id = #{id} + + insert into pro_wet_material_plan_detail