|
@@ -2,25 +2,28 @@ package com.java110.goods.api;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.java110.dto.storeCart.StoreCartDto;
|
|
import com.java110.dto.storeCart.StoreCartDto;
|
|
|
|
|
+import com.java110.dto.storeOrder.StoreOrderDto;
|
|
|
import com.java110.goods.bmo.storeCart.IDeleteStoreCartBMO;
|
|
import com.java110.goods.bmo.storeCart.IDeleteStoreCartBMO;
|
|
|
import com.java110.goods.bmo.storeCart.IGetStoreCartBMO;
|
|
import com.java110.goods.bmo.storeCart.IGetStoreCartBMO;
|
|
|
import com.java110.goods.bmo.storeCart.ISaveStoreCartBMO;
|
|
import com.java110.goods.bmo.storeCart.ISaveStoreCartBMO;
|
|
|
import com.java110.goods.bmo.storeCart.IUpdateStoreCartBMO;
|
|
import com.java110.goods.bmo.storeCart.IUpdateStoreCartBMO;
|
|
|
|
|
+import com.java110.goods.bmo.storeOrder.IDeleteStoreOrderBMO;
|
|
|
|
|
+import com.java110.goods.bmo.storeOrder.IGetStoreOrderBMO;
|
|
|
|
|
+import com.java110.goods.bmo.storeOrder.ISaveStoreOrderBMO;
|
|
|
|
|
+import com.java110.goods.bmo.storeOrder.IUpdateStoreOrderBMO;
|
|
|
import com.java110.po.storeCart.StoreCartPo;
|
|
import com.java110.po.storeCart.StoreCartPo;
|
|
|
|
|
+import com.java110.po.storeOrder.StoreOrderPo;
|
|
|
import com.java110.utils.util.Assert;
|
|
import com.java110.utils.util.Assert;
|
|
|
import com.java110.utils.util.BeanConvertUtil;
|
|
import com.java110.utils.util.BeanConvertUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
-@RequestMapping(value = "/storeCart")
|
|
|
|
|
-public class StoreCartApi {
|
|
|
|
|
|
|
+@RequestMapping(value = "/storeOrder")
|
|
|
|
|
+public class StoreOrderApi {
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISaveStoreCartBMO saveStoreCartBMOImpl;
|
|
private ISaveStoreCartBMO saveStoreCartBMOImpl;
|
|
@@ -32,6 +35,96 @@ public class StoreCartApi {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IGetStoreCartBMO getStoreCartBMOImpl;
|
|
private IGetStoreCartBMO getStoreCartBMOImpl;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISaveStoreOrderBMO saveStoreOrderBMOImpl;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IUpdateStoreOrderBMO updateStoreOrderBMOImpl;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IDeleteStoreOrderBMO deleteStoreOrderBMOImpl;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IGetStoreOrderBMO getStoreOrderBMOImpl;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 微信保存消息模板
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param reqJson
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @serviceCode /storeOrder/saveStoreOrder
|
|
|
|
|
+ * @path /app/storeOrder/saveStoreOrder
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/saveStoreOrder", method = RequestMethod.POST)
|
|
|
|
|
+ public ResponseEntity<String> saveStoreOrder(@RequestBody JSONObject reqJson) {
|
|
|
|
|
+
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "personId", "请求报文中未包含personId");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "personName", "请求报文中未包含personName");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "totalPrice", "请求报文中未包含totalPrice");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "payPrice", "请求报文中未包含payPrice");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ StoreOrderPo storeOrderPo = BeanConvertUtil.covertBean(reqJson, StoreOrderPo.class);
|
|
|
|
|
+ return saveStoreOrderBMOImpl.save(storeOrderPo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 微信修改消息模板
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param reqJson
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @serviceCode /storeOrder/updateStoreOrder
|
|
|
|
|
+ * @path /app/storeOrder/updateStoreOrder
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/updateStoreOrder", method = RequestMethod.POST)
|
|
|
|
|
+ public ResponseEntity<String> updateStoreOrder(@RequestBody JSONObject reqJson) {
|
|
|
|
|
+
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "personId", "请求报文中未包含personId");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "personName", "请求报文中未包含personName");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "totalPrice", "请求报文中未包含totalPrice");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "payPrice", "请求报文中未包含payPrice");
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "orderId", "orderId不能为空");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ StoreOrderPo storeOrderPo = BeanConvertUtil.covertBean(reqJson, StoreOrderPo.class);
|
|
|
|
|
+ return updateStoreOrderBMOImpl.update(storeOrderPo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 微信删除消息模板
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param reqJson
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @serviceCode /storeOrder/deleteStoreOrder
|
|
|
|
|
+ * @path /app/storeOrder/deleteStoreOrder
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/deleteStoreOrder", method = RequestMethod.POST)
|
|
|
|
|
+ public ResponseEntity<String> deleteStoreOrder(@RequestBody JSONObject reqJson) {
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
|
|
|
|
|
+
|
|
|
|
|
+ Assert.hasKeyAndValue(reqJson, "orderId", "orderId不能为空");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ StoreOrderPo storeOrderPo = BeanConvertUtil.covertBean(reqJson, StoreOrderPo.class);
|
|
|
|
|
+ return deleteStoreOrderBMOImpl.delete(storeOrderPo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 微信删除消息模板
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @serviceCode /storeOrder/queryStoreOrder
|
|
|
|
|
+ * @path /app/storeOrder/queryStoreOrder
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/queryStoreOrder", method = RequestMethod.GET)
|
|
|
|
|
+ public ResponseEntity<String> queryStoreOrder(
|
|
|
|
|
+ @RequestParam(value = "page") int page,
|
|
|
|
|
+ @RequestParam(value = "row") int row) {
|
|
|
|
|
+ StoreOrderDto storeOrderDto = new StoreOrderDto();
|
|
|
|
|
+ storeOrderDto.setPage(page);
|
|
|
|
|
+ storeOrderDto.setRow(row);
|
|
|
|
|
+ return getStoreOrderBMOImpl.get(storeOrderDto);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 微信保存消息模板
|
|
* 微信保存消息模板
|
|
|
*
|
|
*
|