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 {
@AuthCheck
@SuppressWarnings("resource")
@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) {
Map<String, Object> result = new HashMap<String, Object>();
// 获取当前用户信息 根据用户角色筛选订单
int userId = UserUtils.getUserId(request);
if(oueryOrderReq!=null){
logger.info("订单搜索传递的参数:"+JSONObject.toJSONString(oueryOrderReq));
if (queryOrderReq != null) {
logger.info("订单搜索传递的参数:" + JSONObject.toJSONString(queryOrderReq));
}
oueryOrderReq.setUserId(userId);
queryOrderReq.setUserId(userId);
// 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);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
......
......@@ -3720,20 +3720,12 @@ public class OrderServiceImpl implements IOrderService {
Page page = new Page(1, 1);
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());
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal());
int all = (int) pages.getTotal();
// 服务商已接单
oueryOrderReq
......@@ -3741,7 +3733,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notAssignMechanic", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 服务商已指派
oueryOrderReq
......@@ -3749,7 +3741,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicNotAccept", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 技工已接未约
oueryOrderReq.setOrderStatus(
......@@ -3757,6 +3749,7 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicWithoutAppointment", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 技工已约未装
oueryOrderReq
......@@ -3764,48 +3757,56 @@ public class OrderServiceImpl implements IOrderService {
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notFinish", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 已取消
oueryOrderReq.setOrderStatus((byte) 20);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 完成
oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus());
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal());
all = all + (int) pages.getTotal();
map.put("all", all);
} 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);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
List<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal());
int all = (int) pages.getTotal();
// 待完成
oueryOrderReq.setOrderStatus((byte) 2);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finishing", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 已取消
oueryOrderReq.setOrderStatus((byte) 20);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 完成
oueryOrderReq.setOrderStatus((byte) 1);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal());
all = all + (int) pages.getTotal();
// 全部
map.put("all", all);
}
return map;
}
......
......@@ -1246,7 +1246,7 @@
</when>
<when test="orderStatus != null and orderStatus==20">
and so.canceled = 0
</when>
</when>
</choose>
</when>
<!--运营 -->
......@@ -1271,10 +1271,10 @@
<when test="orderStatus == 20">
and so.canceled = 0
</when>
<otherwise>
<when test="orderStatus != null">
and so.active_status = #{orderStatus}
and so.canceled = 1
</otherwise>
</when>
</choose>
</when>
<!--商户角 -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!