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