|
|
@@ -498,19 +498,20 @@ public class SaleController {
|
|
|
/**
|
|
|
* 作为卖家,回复收到的采购订单
|
|
|
*
|
|
|
- * @param json
|
|
|
- * @param orderItemId
|
|
|
+ * @param json 采购单回复实体json串
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/items/{orderItemId}/reply", method = RequestMethod.POST)
|
|
|
- public ModelMap replyOrderItem(@RequestParam String json, @PathVariable("orderItemId") Long orderItemId) throws UnsupportedEncodingException {
|
|
|
- PurchaseOrderReply reply = FlexJsonUtils.fromJson(URLDecoder.decode(json, "utf-8"), PurchaseOrderReply.class);
|
|
|
- PurchaseOrderItem orderItem = new PurchaseOrderItem();
|
|
|
- orderItem.setId(orderItemId);
|
|
|
- reply.setOrderItem(orderItem);
|
|
|
- reply = purchaseOrderService.reply(reply);
|
|
|
- logger.log("客户采购单", "App单个回复客户采购明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(),
|
|
|
- orderItemId);
|
|
|
+ @RequestMapping(value = "/reply", method = RequestMethod.POST)
|
|
|
+ public ModelMap replyOrderItem(String json) throws UnsupportedEncodingException {
|
|
|
+ List<PurchaseOrderReply> replies = FlexJsonUtils.fromJsonArray(URLDecoder.decode(json, "utf-8"), PurchaseOrderReply.class);
|
|
|
+ for (PurchaseOrderReply reply : replies) {
|
|
|
+ PurchaseOrderItem item = new PurchaseOrderItem();
|
|
|
+ item.setId(reply.getPdId());
|
|
|
+ reply.setOrderItem(item);
|
|
|
+ reply = purchaseOrderService.reply(reply);
|
|
|
+ logger.log("客户采购单", "App回复单个客户采购单明细", reply.replyDescription(), reply.getOrderItem().getOrder().getCode(),
|
|
|
+ item.getId());
|
|
|
+ }
|
|
|
return new ModelMap("success", "true");
|
|
|
}
|
|
|
|