转工单出库添加冲销
This commit is contained in:
parent
b5d1c27ae5
commit
8290916c8d
@ -53,6 +53,8 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
|
||||
@Autowired
|
||||
private MesToWmsDao mesToWmsDao;
|
||||
@Autowired
|
||||
private InvoiceServiceImpl invoiceService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@ -666,7 +668,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult workOrder_Request(JSONArray in) {
|
||||
public AjaxResult workOrder_Request(JSONArray in) throws Exception {
|
||||
//转工单,按照批次先传MDC消耗请求SAP出库,再生成入库信息传SAP入库
|
||||
log.info("Received work order request: {}", in.toJSONString());
|
||||
//转换前工单formOrder,转换后工单toOrder,料号 materialSpecname,批次 charge
|
||||
@ -707,7 +709,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
* 出库方法
|
||||
*/
|
||||
@Transactional
|
||||
public String materialOutByMES(List<String> materialSpecnameList, List<String> chargeList) {
|
||||
public String materialOutByMES(List<String> materialSpecnameList, List<String> chargeList) throws Exception {
|
||||
String result = "";
|
||||
//调用Mybatis方法查询当前可出库存
|
||||
List<changeOrderDto> materialPackingList = mesToWmsDao.getMaterialPackingList(materialSpecnameList, chargeList);
|
||||
@ -716,6 +718,15 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
materialPackingList,
|
||||
"MES"
|
||||
);
|
||||
if (undoid != null) {
|
||||
// 冲销
|
||||
String undo = invoiceService.cancelShipInter(undoid, "MES");
|
||||
if (undo == null || undo.isEmpty()) {
|
||||
throw new GlobalException("下发mes失败后冲销失败!");
|
||||
} else {
|
||||
throw new GlobalException("发送到mes失败!");
|
||||
}
|
||||
}
|
||||
//更新MDC表状态
|
||||
mesToWmsDao.updateMDCFlag(materialSpecnameList, chargeList, "T");
|
||||
return undoid;
|
||||
|
@ -40,7 +40,7 @@ public interface MESToWMSService {
|
||||
* @param in
|
||||
* @return
|
||||
*/
|
||||
AjaxResult workOrder_Request(JSONArray in);
|
||||
AjaxResult workOrder_Request(JSONArray in) throws Exception;
|
||||
|
||||
@Transactional
|
||||
AjaxResult materialConsumeRequestSapcprkUndo(String undoId, String user, String payMentDate) throws Exception;
|
||||
|
Loading…
x
Reference in New Issue
Block a user