Browse Source

调整订单输出格式

master
xyiege 4 years ago
parent
commit
95af5b0f0a
  1. 10
      src/main/java/cn/chjyj/szwh/controller/admin/AdminOrderController.java
  2. 6
      src/main/java/cn/chjyj/szwh/mapper/OrderMapper.java
  3. 5
      src/main/resources/mapper/szwh/OrderMapper.xml
  4. 6
      src/test/java/cn/chjyj/szwh/mapper/OrderMapperTest.java

10
src/main/java/cn/chjyj/szwh/controller/admin/AdminOrderController.java

@ -2,6 +2,7 @@ package cn.chjyj.szwh.controller.admin;
import cn.chjyj.szwh.bean.Order; import cn.chjyj.szwh.bean.Order;
import cn.chjyj.szwh.bean.OrderGoodsDetail; import cn.chjyj.szwh.bean.OrderGoodsDetail;
import cn.chjyj.szwh.constant.ChConstant;
import cn.chjyj.szwh.controller.BaseController; import cn.chjyj.szwh.controller.BaseController;
import cn.chjyj.szwh.service.OrderGoodsDetailService; import cn.chjyj.szwh.service.OrderGoodsDetailService;
import cn.chjyj.szwh.service.OrderService; import cn.chjyj.szwh.service.OrderService;
@ -27,9 +28,12 @@ public class AdminOrderController extends BaseController {
private OrderGoodsDetailService orderGoodsDetailService; private OrderGoodsDetailService orderGoodsDetailService;
@PostMapping("/list") @PostMapping("/list")
public JSONObject olist(@RequestParam(value = "page",defaultValue = "1") String spage){ public JSONObject olist(@RequestParam(value = "current_page",defaultValue = "1") String spage){
int ipage = Integer.valueOf(spage); int ipage = Integer.valueOf(spage);
List<Order> orderList=orderService.getAllOrderList(ipage); List<Order> orderList=orderService.getAllOrderList(ipage);
jsonObject.put("current_page",spage);
jsonObject.put("per_page", ChConstant.PAGESIZE);
jsonObject.put("total",0);
jsonObject.put("code",200); jsonObject.put("code",200);
jsonObject.put("data",orderList); jsonObject.put("data",orderList);
jsonObject.put("msg","成功"); jsonObject.put("msg","成功");
@ -57,7 +61,7 @@ public class AdminOrderController extends BaseController {
@RequestParam(value = "buy_name",defaultValue = "") String buyName, @RequestParam(value = "buy_name",defaultValue = "") String buyName,
@RequestParam(value = "goods_ame",defaultValue = "") String goodsName, @RequestParam(value = "goods_ame",defaultValue = "") String goodsName,
@RequestParam(value = "order_type",defaultValue = "") String orderType, @RequestParam(value = "order_type",defaultValue = "") String orderType,
@RequestParam("transaction_status") String transactionStatus, @RequestParam(value = "transaction_status",defaultValue = "0") String transactionStatus,
@RequestParam(value = "createtime",defaultValue = "") String createtime, @RequestParam(value = "createtime",defaultValue = "") String createtime,
@RequestParam(value = "goods_isli",defaultValue = "")String goodsIsli, @RequestParam(value = "goods_isli",defaultValue = "")String goodsIsli,
@RequestParam(value = "charges_type",defaultValue = "") String chargesType, @RequestParam(value = "charges_type",defaultValue = "") String chargesType,
@ -69,7 +73,7 @@ public class AdminOrderController extends BaseController {
qmap.put("entrust_name",entrustName); qmap.put("entrust_name",entrustName);
qmap.put("goods_name",goodsName); qmap.put("goods_name",goodsName);
qmap.put("order_type",orderType); qmap.put("order_type",orderType);
qmap.put("transaction_status",transactionStatus); // qmap.put("transaction_status",transactionStatus);
qmap.put("createtime",createtime); qmap.put("createtime",createtime);
qmap.put("godos_isli",goodsIsli); qmap.put("godos_isli",goodsIsli);
qmap.put("charges_type",chargesType); qmap.put("charges_type",chargesType);

6
src/main/java/cn/chjyj/szwh/mapper/OrderMapper.java

@ -84,4 +84,10 @@ public interface OrderMapper {
* @return * @return
*/ */
BigDecimal sumOrderByMap(@Param("cmap") Map cmap); BigDecimal sumOrderByMap(@Param("cmap") Map cmap);
/**
* 统计所有的订单数量
* @return
*/
int countAllOrder();
} }

5
src/main/resources/mapper/szwh/OrderMapper.xml

@ -43,6 +43,11 @@
where batchcode=#{batchcode} limit 1; where batchcode=#{batchcode} limit 1;
</select> </select>
<!-- 统计订单总数 -->
<select id="countAllOrder" resultType="java.lang.Integer">
select count(*) from <include refid="tbName"/> ;
</select>
<!--订单条件查询--> <!--订单条件查询-->
<select id="getOrderList" parameterType="java.util.Map" resultType="cn.chjyj.szwh.bean.Order"> <select id="getOrderList" parameterType="java.util.Map" resultType="cn.chjyj.szwh.bean.Order">
select select

6
src/test/java/cn/chjyj/szwh/mapper/OrderMapperTest.java

@ -111,4 +111,10 @@ public class OrderMapperTest {
BigDecimal bd= orderMapper.sumOrderByMap(xmap); BigDecimal bd= orderMapper.sumOrderByMap(xmap);
System.out.println(bd); System.out.println(bd);
} }
@Test
public void countAllOrder(){
int total = orderMapper.countAllOrder();
System.out.println(total);
}
} }
Loading…
Cancel
Save