|
@@ -182,4 +182,48 @@ public class BackgroundProcessingController extends BaseRESTfulController {
|
|
backgroundProcessingMapper.updateOaRelevancy(map);
|
|
backgroundProcessingMapper.updateOaRelevancy(map);
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "手动放行接口")
|
|
|
|
+ @PostMapping("passThroughOrder")
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public RESTfulResult passThroughOrder(@RequestBody(required = false) Map<String,Object> map) throws Exception{
|
|
|
|
+ if (map.get("orderNumber") != null) {
|
|
|
|
+ try {
|
|
|
|
+ int i = backgroundProcessingMapper.updatePassthrough(map);
|
|
|
|
+ if(i != 1){
|
|
|
|
+ throw new Exception("数据不准确,请去数据库手动修改订单状态!");
|
|
|
|
+ }
|
|
|
|
+ return success(i);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return failed("修改失败:" + e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return failed("orderNumber为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "钢材同车同物资接错单交换接口")
|
|
|
|
+ @PostMapping("interchangeOrder")
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public RESTfulResult interchangeOrder(@RequestBody(required = false) Map<String,Object> map) throws Exception{
|
|
|
|
+ if (map.get("orderNumber1") != null && map.get("orderNumber2") != null) {
|
|
|
|
+ Map<String, Object> map1= backgroundProcessingMapper.getOrderInfoByOrderNumber(map.get("orderNumber1").toString());
|
|
|
|
+ Map<String, Object> map2= backgroundProcessingMapper.getOrderInfoByOrderNumber(map.get("orderNumber2").toString());
|
|
|
|
+ if(map1 == null || map2 == null
|
|
|
|
+ || map1.get("orderId") == null || map2.get("orderId") == null
|
|
|
|
+ || map1.get("orderPlanId") == null || map2.get("orderPlanId") == null
|
|
|
|
+ || map1.get("capacityId") == null || map2.get("capacityId") == null
|
|
|
|
+ || !map1.get("capacityId").equals(map2.get("capacityId"))
|
|
|
|
+ ){
|
|
|
|
+ return failed("数据不准确,请去数据库手动修改!");
|
|
|
|
+ }
|
|
|
|
+ map1.put("newOrderPlanId", map2.get("orderPlanId"));
|
|
|
|
+ map1.put("remark", "交换订单:"+map.get("orderNumber2")+";原车序号:"+map1.get("orderPlanId")+";新车序号:"+map2.get("orderPlanId"));
|
|
|
|
+ map2.put("newOrderPlanId", map1.get("orderPlanId"));
|
|
|
|
+ map2.put("remark", "交换订单:"+map.get("orderNumber1")+";原车序号:"+map2.get("orderPlanId")+";新车序号:"+map1.get("orderPlanId"));
|
|
|
|
+ backgroundProcessingMapper.updateInterchangeOrder(map1);
|
|
|
|
+ backgroundProcessingMapper.updateInterchangeOrder(map2);
|
|
|
|
+ }
|
|
|
|
+ return success(1);
|
|
|
|
+ }
|
|
}
|
|
}
|