update ERP同步采购订单状态

master
yinq 2 weeks ago
parent f1f492ef6c
commit 8a6be901d1

@ -126,5 +126,16 @@ public class WmsPurchaseOrderController extends BaseController {
return R.ok(wmsPurchaseOrderService.erpSyncPurchaseOrder(bos));
}
/**
* ERP
* @param bos
* @return
*/
@RepeatSubmit()
@PostMapping("/erpSyncUpdatePurchaseOrder")
public R<Boolean> erpSyncUpdatePurchaseOrder(@RequestBody List<WmsPurchaseOrderBo> bos) {
return R.ok(wmsPurchaseOrderService.erpSyncUpdatePurchaseOrder(bos));
}
}

@ -74,4 +74,10 @@ public interface IWmsPurchaseOrderService {
*/
Boolean erpSyncPurchaseOrder(List<WmsPurchaseOrderBo> bos);
/**
* ERP
* @param bos
* @return
*/
Boolean erpSyncUpdatePurchaseOrder(List<WmsPurchaseOrderBo> bos);
}

@ -230,5 +230,33 @@ public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService {
return true;
}
/**
* ERP
* @param bos
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean erpSyncUpdatePurchaseOrder(List<WmsPurchaseOrderBo> bos) {
for (WmsPurchaseOrderBo bo : bos) {
if (StringUtils.isNull(bo.getErpId())) {
throw new ServiceException("erpId为空");
}
WmsPurchaseOrderBo selectBo = new WmsPurchaseOrderBo();
selectBo.setErpId(bo.getErpId());
List<WmsPurchaseOrderVo> orderVoList = this.queryList(selectBo);
if (orderVoList.isEmpty()){
throw new ServiceException("无此采购订单号");
}
for (WmsPurchaseOrderVo orderVo : orderVoList) {
WmsPurchaseOrder update = new WmsPurchaseOrder();
update.setPoId(orderVo.getPoId());
update.setPoStatus(bo.getPoStatus());
baseMapper.updateById(update);
}
}
return true;
}
}

Loading…
Cancel
Save