Leon 3 years ago
commit 405ca7284f

@ -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";//打印机名称
/**
*
*/

@ -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<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);

@ -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("当前设备点检未完成");
}
}
}
}

Loading…
Cancel
Save