| | |
| | | import com.zy.asrs.entity.param.OrderToLine; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.BasArmRulesService; |
| | | import com.zy.asrs.service.OrderPakinService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @Transactional |
| | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | private OrderPakinService orderPakinService; |
| | | |
| | | @Value("${line.address.URL}") |
| | | //端口 |
| | |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appkey","ea1f0459efc02a79f046f982767939ae"); |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(URL) |
| | | .setPath(Path) |
| | | .setJson(JSON.toJSONString(orderToline)) |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | orderService.updateOrderStatus(orderToline.getOrderNo()); //更新订单状态 0 -> 1 |
| | | orderPakinService.updateOrderStatus(orderToline.getOrderNo()); //更新订单状态 0 -> 1 |
| | | } else { |
| | | log.error("下发单据!!!url:{};request:{};response:{}", URL+Path, JSON.toJSONString(orderToline), response); |
| | | throw new CoolException("下发单据失败"); |