Commit 258c515e by zhengxj

finish 单量统计 on 20191102 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24578 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent e787f714
...@@ -806,7 +806,7 @@ public class OrderController extends BaseController { ...@@ -806,7 +806,7 @@ public class OrderController extends BaseController {
* @return ResultObject 返回类型 * @return ResultObject 返回类型
* *
*/ */
@AuthCheck
@RequestMapping(value = "/getCountByStatus", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/getCountByStatus", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getCountByStatus(HttpServletRequest request, QueryOrderReq oueryOrderReq) { public ResultObject getCountByStatus(HttpServletRequest request, QueryOrderReq oueryOrderReq) {
......
...@@ -3335,7 +3335,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3335,7 +3335,7 @@ public class OrderServiceImpl implements IOrderService {
oueryOrderReq.setReserveInstallTimeEnd(DateUtil.formatDate(endDate)); oueryOrderReq.setReserveInstallTimeEnd(DateUtil.formatDate(endDate));
} }
if( page!=null && pageSize!=null){ if (page != null && pageSize != null) {
PageHelper.startPage(page, pageSize, true); PageHelper.startPage(page, pageSize, true);
} }
orderList = orderDao.getOrderListByExample(oueryOrderReq); orderList = orderDao.getOrderListByExample(oueryOrderReq);
...@@ -3355,7 +3355,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3355,7 +3355,7 @@ public class OrderServiceImpl implements IOrderService {
} }
/* /*
*检查是否有正在进行的售后 * 检查是否有正在进行的售后
*/ */
boolean isAfterSaling = false; boolean isAfterSaling = false;
Integer orderId = order.getId(); Integer orderId = order.getId();
...@@ -3600,7 +3600,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3600,7 +3600,7 @@ public class OrderServiceImpl implements IOrderService {
} }
/** /**
* * 根据订单状态统计单量
*/ */
@Override @Override
public Map<String, Integer> countByOrderStatusAndUserType(QueryOrderReq oueryOrderReq) { public Map<String, Integer> countByOrderStatusAndUserType(QueryOrderReq oueryOrderReq) {
...@@ -3610,59 +3610,85 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3610,59 +3610,85 @@ public class OrderServiceImpl implements IOrderService {
int userType = user.getIntValue("userType"); int userType = user.getIntValue("userType");
int userId = oueryOrderReq.getUserId(); int userId = oueryOrderReq.getUserId();
oueryOrderReq.setUserType(userType); oueryOrderReq.setUserType(userType);
Page page = new Page(1, 1);
if (userType == 0) { if (userType == 0) {
// 运营角色 // 运营角色
// 待指派 // 待指派
int waitAssign = orderDao.countByOrderStatusAndUserType(userId, userType,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus()); oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus());
map.put("waitAssign", waitAssign); 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 notAssignMechanic = orderDao.countByOrderStatusAndUserType(userId, userType,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_NOT_ASSIGN_MECHANIC.getActiveStatus()); oueryOrderReq
map.put("notAssignMechanic", notAssignMechanic); .setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_NOT_ASSIGN_MECHANIC.getActiveStatus());
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notAssignMechanic", (int) pages.getTotal());
// 服务商已指派 // 服务商已指派
int mechanicNotAccept = orderDao.countByOrderStatusAndUserType(userId, userType,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_ACCEPT.getActiveStatus()); oueryOrderReq
map.put("mechanicNotAccept", mechanicNotAccept); .setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_ACCEPT.getActiveStatus());
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicNotAccept", (int) pages.getTotal());
// 技工已接未约 // 技工已接未约
int mechanicWithoutAppointment = orderDao.countByOrderStatusAndUserType(userId, userType,
oueryOrderReq.setOrderStatus(
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_WITHOUT_APPOINTMENT.getActiveStatus()); OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_WITHOUT_APPOINTMENT.getActiveStatus());
map.put("mechanicWithoutAppointment", mechanicWithoutAppointment); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("mechanicWithoutAppointment", (int) pages.getTotal());
// 技工已约未装 // 技工已约未装
int notFinish = orderDao.countByOrderStatusAndUserType(userId, userType, oueryOrderReq
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH.getActiveStatus()); .setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH.getActiveStatus());
map.put("notFinish", notFinish); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("notFinish", (int) pages.getTotal());
// 已取消 // 已取消
int canceled = orderDao.countByOrderStatusAndUserType(userId, userType, 20); oueryOrderReq.setOrderStatus((byte) 20);
map.put("canceled", canceled); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal());
// 完成 // 完成
int finished = orderDao.countByOrderStatusAndUserType(userId, userType, oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus());
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus()); list = getOrderListByExample(1, 1, oueryOrderReq);
map.put("finished", finished); pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal());
} else { } else {
// 服务商角色&商户角色 // 服务商角色&商户角色
// 服务商: 待指派 商户:待接单 // 服务商: 待指派 商户:待接单
int waitAssign = orderDao.countByOrderStatusAndUserType(userId, userType, 0); oueryOrderReq.setOrderStatus((byte) 0);
map.put("waitAssign", waitAssign); 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 finishing = orderDao.countByOrderStatusAndUserType(userId, userType, 2); oueryOrderReq.setOrderStatus((byte) 2);
map.put("finishing", finishing); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finishing", (int) pages.getTotal());
// 已取消 // 已取消
int canceled = orderDao.countByOrderStatusAndUserType(userId, userType, 20); oueryOrderReq.setOrderStatus((byte) 20);
map.put("canceled", canceled); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal());
// 完成 // 完成
int finished = orderDao.countByOrderStatusAndUserType(userId, userType, 1); oueryOrderReq.setOrderStatus((byte) 1);
map.put("finished", finished); list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal());
} }
return map; return map;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!