pod
parent
ce0b98d283
commit
eaf7ea4156
@ -0,0 +1,44 @@
|
||||
package com.foreverwin.mesnac.production.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 描述: 工序开始
|
||||
* 作者: philip
|
||||
* 时间: 2021-6-30
|
||||
*/
|
||||
public interface SfcCrossService {
|
||||
/**
|
||||
* 开始
|
||||
* @param site
|
||||
* @param operationRef
|
||||
* @param resource
|
||||
* @param sfcRef
|
||||
* @param qty
|
||||
* @throws Exception
|
||||
*/
|
||||
void startAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
|
||||
|
||||
/**
|
||||
* 完成
|
||||
* @param site
|
||||
* @param operationRef
|
||||
* @param resource
|
||||
* @param sfcRef
|
||||
* @param qty
|
||||
* @throws Exception
|
||||
*/
|
||||
void completeAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
|
||||
|
||||
/**
|
||||
* 开始完成单个SFC
|
||||
* @param site
|
||||
* @param operationRef
|
||||
* @param resource
|
||||
* @param sfcRef
|
||||
* @param qty
|
||||
* @throws Exception
|
||||
*/
|
||||
void passAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.foreverwin.mesnac.production.service.impl;
|
||||
|
||||
|
||||
import com.foreverwin.mesnac.production.service.SfcCrossService;
|
||||
import com.foreverwin.modular.core.meext.MEServices;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.sap.me.plant.ResourceBOHandle;
|
||||
import com.sap.me.production.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 描述: 工序开始
|
||||
* 作者: philip
|
||||
* 时间: 2021-06-30
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SfcCrossServiceImpl implements SfcCrossService {
|
||||
|
||||
@Override
|
||||
public void startAction(String site, String operationRef,
|
||||
String resource, String sfcRef, BigDecimal qty) throws Exception {
|
||||
SfcStartServiceInterface sfcStartService = MEServices.create("com.sap.me.production", "SfcStartService", site);
|
||||
StartSfcRequest paramStartSfcRequest = new StartSfcRequest();
|
||||
paramStartSfcRequest.setQty(qty);
|
||||
paramStartSfcRequest.setOperationRef(operationRef);
|
||||
paramStartSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
|
||||
paramStartSfcRequest.setSfcRef(sfcRef);
|
||||
paramStartSfcRequest.setUserRef(CommonMethods.getUserBo());
|
||||
sfcStartService.startSfc(paramStartSfcRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completeAction(String site, String operationRef,
|
||||
String resource, String sfcRef, BigDecimal qty) throws Exception {
|
||||
SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
|
||||
CompleteSfcRequest paramCompleteSfcRequest = new CompleteSfcRequest();
|
||||
paramCompleteSfcRequest.setOperationRef(operationRef);
|
||||
paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
|
||||
paramCompleteSfcRequest.setSfcRef(sfcRef);
|
||||
if(qty != null) {
|
||||
paramCompleteSfcRequest.setQuantity(qty);
|
||||
}
|
||||
paramCompleteSfcRequest.setLocation("");
|
||||
sfcCompleteService.completeSfc(paramCompleteSfcRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void passAction(String site, String operationRef,
|
||||
String resource, String sfcRef, BigDecimal qty) throws Exception {
|
||||
SfcCompleteServiceInterface sfcCompleteService = MEServices.create("com.sap.me.production", "SfcCompleteService", site);
|
||||
CompleteSfcQuickRequest paramCompleteSfcRequest = new CompleteSfcQuickRequest();
|
||||
paramCompleteSfcRequest.setOperationRef(operationRef);
|
||||
paramCompleteSfcRequest.setResourceRef(new ResourceBOHandle(site, resource).getValue());
|
||||
paramCompleteSfcRequest.setSfcRef(sfcRef);
|
||||
if(qty != null) {
|
||||
paramCompleteSfcRequest.setQuantity(qty);
|
||||
}
|
||||
sfcCompleteService.completeSfcQuick(paramCompleteSfcRequest);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue