|
@@ -127,31 +127,34 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
/**根据运输订单号,查询运输订单信息,*/
|
|
/**根据运输订单号,查询运输订单信息,*/
|
|
Map<String, Object> order = wmspOutboundResultService.getOrder(orderNumber);
|
|
Map<String, Object> order = wmspOutboundResultService.getOrder(orderNumber);
|
|
/**拿运输订单信息中的运输订单Id*/
|
|
/**拿运输订单信息中的运输订单Id*/
|
|
- BigDecimal orderId = (BigDecimal) order.get("orderId");
|
|
|
|
- //根据该运输订单Id判断当前订单是否已经完成出厂,若完成直接返回null
|
|
|
|
- if (wmspOutboundResultService.getOutboundStatus(orderId)==0){
|
|
|
|
-
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
- map.put("orderId",orderId);
|
|
|
|
- /**根据运输订单ID和物资id查询出库单(没有逻辑删除)
|
|
|
|
- *若orderNum大于0,则不是第一次扫描,已经新增出库单,返回详情信息
|
|
|
|
- *若orderNum等于0,则是第一次扫描,需要增加出库单,再返回详情信息
|
|
|
|
- * */
|
|
|
|
- int orderNum = wmspOutboundResultService.ExistWmspOutboundResult(map);
|
|
|
|
- if(orderNum == 0){
|
|
|
|
- //创建出货单
|
|
|
|
- WmspOutboundResult wmspOutboundResult=wmspOutboundResultService.createOutboundResult(orderId,new BigDecimal(order.get("orderType").toString()));
|
|
|
|
- if (wmspOutboundResult!=null){
|
|
|
|
- /**根据运输订单号,查询出该订单还没有装货的物资*/
|
|
|
|
- List<Map<String,Object>> orderList = wmspOutboundResultService.getMaterial(orderId.intValue());
|
|
|
|
- int status= wmspOutboundResultMaterialService.insertOutboundMaterial(wmspOutboundResult.getResultId(),orderList);
|
|
|
|
|
|
+ if(order!=null){
|
|
|
|
+ BigDecimal orderId = (BigDecimal) order.get("orderId");
|
|
|
|
+ //根据该运输订单Id判断当前订单是否已经完成出厂,若完成直接返回null
|
|
|
|
+ if (wmspOutboundResultService.getOutboundStatus(orderId)==0){
|
|
|
|
+
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("orderId",orderId);
|
|
|
|
+ /**根据运输订单ID和物资id查询出库单(没有逻辑删除)
|
|
|
|
+ *若orderNum大于0,则不是第一次扫描,已经新增出库单,返回详情信息
|
|
|
|
+ *若orderNum等于0,则是第一次扫描,需要增加出库单,再返回详情信息
|
|
|
|
+ * */
|
|
|
|
+ int orderNum = wmspOutboundResultService.ExistWmspOutboundResult(map);
|
|
|
|
+ if(orderNum == 0){
|
|
|
|
+ //创建出货单
|
|
|
|
+ WmspOutboundResult wmspOutboundResult=wmspOutboundResultService.createOutboundResult(orderId,new BigDecimal(order.get("orderType").toString()));
|
|
|
|
+ if (wmspOutboundResult!=null){
|
|
|
|
+ /**根据运输订单号,查询出该订单还没有装货的物资*/
|
|
|
|
+ List<Map<String,Object>> orderList = wmspOutboundResultService.getMaterial(orderId.intValue());
|
|
|
|
+ int status= wmspOutboundResultMaterialService.insertOutboundMaterial(wmspOutboundResult.getResultId(),orderList);
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //查询运单相关信息
|
|
|
|
|
|
+ //查询运单相关信息
|
|
|
|
|
|
- return wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
|
|
|
|
|
|
+ return wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|