From 0a5877ec4a5c5afbe12732802e90c74f75eb4a33 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Wed, 25 Aug 2021 21:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/CustomFieldConstant.java | 3 +++ .../service/impl/PodTemplateServiceImpl.java | 4 ++++ .../service/impl/SfcCrossServiceImpl.java | 19 +++++++++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/constant/CustomFieldConstant.java b/common/src/main/java/com/foreverwin/mesnac/common/constant/CustomFieldConstant.java index 3023328d..8d1fe3e4 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/constant/CustomFieldConstant.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/constant/CustomFieldConstant.java @@ -16,6 +16,9 @@ public class CustomFieldConstant { public static final String RESRCE_CUSTOM_FIELD_PRINT_NAME = "PRINT_NAME";//打印机名称 + public static final String RESRCE_CUSTOM_FIELD_IS_SPOT = "IS_SPOT";//打印机名称 + + /** * 工作中心 */ diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index 23dea0a8..b24ba775 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -250,6 +250,10 @@ public class PodTemplateServiceImpl implements PodTemplateService { String dispatchNo = sfcDto.getDispatchNo(); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc)); + String status = StringUtil.trimHandle(sfcServiceById.getStatusBo()); + if (status.equals("404")) { + throw new BaseException("产品条码" + sfc + "已暂停"); + } BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString()); //是否有自检检验项目 List inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java index 97e4c234..fe0699f1 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SfcCrossServiceImpl.java @@ -1,7 +1,11 @@ package com.foreverwin.mesnac.production.service.impl; +import com.foreverwin.mesnac.common.constant.CustomFieldConstant; +import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.dto.SfcDto; +import com.foreverwin.mesnac.meapi.service.CustomFieldsService; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.service.SfcCrossService; import com.foreverwin.modular.core.exception.BaseException; @@ -28,6 +32,8 @@ import java.util.List; public class SfcCrossServiceImpl implements SfcCrossService { @Autowired private SfcCrossMapper sfcCrossMapper; + @Autowired + private CustomFieldsService customFieldsService; @Override public void startAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception { @@ -80,10 +86,15 @@ public class SfcCrossServiceImpl implements SfcCrossService { public void resourceCheck(String resrce) { LocalDateTime now = LocalDateTime.now(); String site = CommonMethods.getSite(); - LocalDateTime dateTime = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 0, 0, 0); - Integer integer = sfcCrossMapper.resourceCheck(site,resrce, dateTime); - if (integer<1){ - throw new BaseException("当前设备点检未完成"); + String handle = HandleEnum.RESOURCE.getHandle(site, resrce); + String isSpot = customFieldsService.getCustomFieldsValue(handle, CustomFieldConstant.RESRCE_CUSTOM_FIELD_IS_SPOT); + if (StringUtil.isBlank(isSpot)||!isSpot.equals("N")){ + LocalDateTime dateTime = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 0, 0, 0); + Integer integer = sfcCrossMapper.resourceCheck(site,resrce, dateTime); + if (integer<1){ + throw new BaseException("当前设备点检未完成"); + } } + } }