Commit c106a85c by zhengxj

finish 订单统计 20200117 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25895 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 810cf7ad
...@@ -132,19 +132,19 @@ public class OrderController extends BaseController { ...@@ -132,19 +132,19 @@ public class OrderController extends BaseController {
@AuthCheck @AuthCheck
@SuppressWarnings("resource") @SuppressWarnings("resource")
@RequestMapping(value = "/getOrderListByExample", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/getOrderListByExample", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getOrderListByExample(HttpServletRequest request, QueryOrderReq oueryOrderReq, public ResultObject getOrderListByExample(HttpServletRequest request, QueryOrderReq queryOrderReq,
@RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize) { @RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize) {
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
// 获取当前用户信息 根据用户角色筛选订单 // 获取当前用户信息 根据用户角色筛选订单
int userId = UserUtils.getUserId(request); int userId = UserUtils.getUserId(request);
if(oueryOrderReq!=null){ if (queryOrderReq != null) {
logger.info("订单搜索传递的参数:"+JSONObject.toJSONString(oueryOrderReq)); logger.info("订单搜索传递的参数:" + JSONObject.toJSONString(queryOrderReq));
} }
oueryOrderReq.setUserId(userId); queryOrderReq.setUserId(userId);
// oueryOrderReq.setNeedMoreInfo(true); // oueryOrderReq.setNeedMoreInfo(true);
List<SysOrder> list = orderService.getOrderListByExample(pageIndex, pageSize, oueryOrderReq); List<SysOrder> list = orderService.getOrderListByExample(pageIndex, pageSize, queryOrderReq);
Page page = new Page(pageIndex, pageSize); Page page = new Page(pageIndex, pageSize);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list; com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
......
...@@ -3720,20 +3720,12 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3720,20 +3720,12 @@ public class OrderServiceImpl implements IOrderService {
Page page = new Page(1, 1); Page page = new Page(1, 1);
if (userType == 0) { if (userType == 0) {
// 运营角色 // 运营角色
// 全部
List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("all", (int) pages.getTotal());
// 待指派 // 待指派
oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus()); oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus());
list = getOrderListByExample(1, 1, oueryOrderReq); List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal()); map.put("waitAssign", (int) pages.getTotal());
int all = (int) pages.getTotal();
// 服务商已接单 // 服务商已接单
oueryOrderReq oueryOrderReq
...@@ -3741,7 +3733,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3741,7 +3733,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notAssignMechanic", (int) pages.getTotal()); map.put("notAssignMechanic", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 服务商已指派 // 服务商已指派
oueryOrderReq oueryOrderReq
...@@ -3749,7 +3741,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3749,7 +3741,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicNotAccept", (int) pages.getTotal()); map.put("mechanicNotAccept", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 技工已接未约 // 技工已接未约
oueryOrderReq.setOrderStatus( oueryOrderReq.setOrderStatus(
...@@ -3757,6 +3749,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3757,6 +3749,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicWithoutAppointment", (int) pages.getTotal()); map.put("mechanicWithoutAppointment", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 技工已约未装 // 技工已约未装
oueryOrderReq oueryOrderReq
...@@ -3764,48 +3757,56 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3764,48 +3757,56 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notFinish", (int) pages.getTotal()); map.put("notFinish", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 已取消 // 已取消
oueryOrderReq.setOrderStatus((byte) 20); oueryOrderReq.setOrderStatus((byte) 20);
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal()); map.put("canceled", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 完成 // 完成
oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus()); oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus());
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal()); map.put("finished", (int) pages.getTotal());
all = all + (int) pages.getTotal();
map.put("all", all);
} else { } else {
// 服务商角色&商户角色 // 服务商角色&商户角色
// 全部
List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("all", (int) pages.getTotal());
// 服务商: 待指派 商户:待接单 // 服务商: 待指派 商户:待接单
oueryOrderReq.setOrderStatus((byte) 0); oueryOrderReq.setOrderStatus((byte) 0);
list = getOrderListByExample(1, 1, oueryOrderReq); List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal()); map.put("waitAssign", (int) pages.getTotal());
int all = (int) pages.getTotal();
// 待完成 // 待完成
oueryOrderReq.setOrderStatus((byte) 2); oueryOrderReq.setOrderStatus((byte) 2);
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finishing", (int) pages.getTotal()); map.put("finishing", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 已取消 // 已取消
oueryOrderReq.setOrderStatus((byte) 20); oueryOrderReq.setOrderStatus((byte) 20);
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal()); map.put("canceled", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 完成 // 完成
oueryOrderReq.setOrderStatus((byte) 1); oueryOrderReq.setOrderStatus((byte) 1);
list = getOrderListByExample(1, 1, oueryOrderReq); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list; pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal()); map.put("finished", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 全部
map.put("all", all);
} }
return map; return map;
} }
......
...@@ -1246,7 +1246,7 @@ ...@@ -1246,7 +1246,7 @@
</when> </when>
<when test="orderStatus != null and orderStatus==20"> <when test="orderStatus != null and orderStatus==20">
and so.canceled = 0 and so.canceled = 0
</when> </when>
</choose> </choose>
</when> </when>
<!--运营 --> <!--运营 -->
...@@ -1271,10 +1271,10 @@ ...@@ -1271,10 +1271,10 @@
<when test="orderStatus == 20"> <when test="orderStatus == 20">
and so.canceled = 0 and so.canceled = 0
</when> </when>
<otherwise> <when test="orderStatus != null">
and so.active_status = #{orderStatus} and so.active_status = #{orderStatus}
and so.canceled = 1 and so.canceled = 1
</otherwise> </when>
</choose> </choose>
</when> </when>
<!--商户角 --> <!--商户角 -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!