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 {
* @return ResultObject 返回类型
*
*/
@AuthCheck
@RequestMapping(value = "/getCountByStatus", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getCountByStatus(HttpServletRequest request, QueryOrderReq oueryOrderReq) {
......
......@@ -3310,7 +3310,7 @@ public class OrderServiceImpl implements IOrderService {
Date startDate = DateUtil.parseDateYmd(oueryOrderReq.getDateStart());
oueryOrderReq.setDateStart(DateUtil.formatDate(startDate));
}
// 订单结束日
if (com.glsx.common.utils.StringUtils.isNotEmpty(oueryOrderReq.getDateEnd())) {
Date endDate = DateUtil.parseDateYmd(oueryOrderReq.getDateEnd());
......@@ -3335,7 +3335,7 @@ public class OrderServiceImpl implements IOrderService {
oueryOrderReq.setReserveInstallTimeEnd(DateUtil.formatDate(endDate));
}
if( page!=null && pageSize!=null){
if (page != null && pageSize != null) {
PageHelper.startPage(page, pageSize, true);
}
orderList = orderDao.getOrderListByExample(oueryOrderReq);
......@@ -3355,14 +3355,14 @@ public class OrderServiceImpl implements IOrderService {
}
/*
*检查是否有正在进行的售后
* 检查是否有正在进行的售后
*/
boolean isAfterSaling = false;
Integer orderId = order.getId();
SysOrder sysOrder = getAfterSaleDetail(orderId, null);
if (sysOrder != null) {
isAfterSaling = true;
}
}
order.setAfterSaling(isAfterSaling);
}
......@@ -3600,7 +3600,7 @@ public class OrderServiceImpl implements IOrderService {
}
/**
*
* 根据订单状态统计单量
*/
@Override
public Map<String, Integer> countByOrderStatusAndUserType(QueryOrderReq oueryOrderReq) {
......@@ -3610,59 +3610,85 @@ public class OrderServiceImpl implements IOrderService {
int userType = user.getIntValue("userType");
int userId = oueryOrderReq.getUserId();
oueryOrderReq.setUserType(userType);
Page page = new Page(1, 1);
if (userType == 0) {
// 运营角色
// 待指派
int waitAssign = orderDao.countByOrderStatusAndUserType(userId, userType,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus());
map.put("waitAssign", waitAssign);
oueryOrderReq.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT.getActiveStatus());
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());
map.put("notAssignMechanic", notAssignMechanic);
oueryOrderReq
.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());
map.put("mechanicNotAccept", mechanicNotAccept);
oueryOrderReq
.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());
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,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH.getActiveStatus());
map.put("notFinish", notFinish);
oueryOrderReq
.setOrderStatus(OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH.getActiveStatus());
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);
map.put("canceled", canceled);
oueryOrderReq.setOrderStatus((byte) 20);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("canceled", (int) pages.getTotal());
// 完成
int finished = orderDao.countByOrderStatusAndUserType(userId, userType,
OrderActiveStatusEnum.ORDER_ACTIVE_STATUS_FINISH.getActiveStatus());
map.put("finished", finished);
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());
} else {
// 服务商角色&商户角色
// 服务商: 待指派 商户:待接单
int waitAssign = orderDao.countByOrderStatusAndUserType(userId, userType, 0);
map.put("waitAssign", waitAssign);
oueryOrderReq.setOrderStatus((byte) 0);
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);
map.put("finishing", finishing);
oueryOrderReq.setOrderStatus((byte) 2);
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);
map.put("canceled", canceled);
oueryOrderReq.setOrderStatus((byte) 20);
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);
map.put("finished", finished);
oueryOrderReq.setOrderStatus((byte) 1);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("finished", (int) pages.getTotal());
}
return map;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!