Commit 724ec4b2 by zhengxj

finish 订单状态栏-- 新增“全部” on 20191223 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25680 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 7b3d039d
......@@ -141,6 +141,7 @@ public class OrderController extends BaseController {
}
oueryOrderReq.setUserId(userId);
oueryOrderReq.setNeedMoreInfo(true);
List<SysOrder> list = orderService.getOrderListByExample(pageIndex, pageSize, oueryOrderReq);
Page page = new Page(pageIndex, pageSize);
......@@ -153,14 +154,14 @@ public class OrderController extends BaseController {
}
/**
* @param request
* @param sysOrder
* @param bindingResult
* @return ResultObject
* @author zhanghj
* @Title: add
* @Description: 商户端或服务商端发起订单
*/
* @param request
* @param sysOrder
* @param bindingResult
* @return ResultObject
* @author zhanghj
* @Title: add
* @Description: 商户端或服务商端发起订单
*/
@AuthCheck
@RequestMapping(value = "/save", method = {RequestMethod.POST})
public ResultObject add(HttpServletRequest request, @Validated(value = {Default.class}) SysOrder sysOrder, BindingResult bindingResult) {
......@@ -832,6 +833,7 @@ public class OrderController extends BaseController {
public ResultObject getCountByStatus(HttpServletRequest request, QueryOrderReq oueryOrderReq) {
oueryOrderReq.setUserId(UserUtils.getUserId(request));
oueryOrderReq.setNeedMoreInfo(false);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(),
orderService.countByOrderStatusAndUserType(oueryOrderReq));
}
......
......@@ -70,6 +70,16 @@ public class QueryOrderReq implements Serializable {
private String keyWord;
private boolean needMoreInfo;
public boolean getNeedMoreInfo() {
return needMoreInfo;
}
public void setNeedMoreInfo(boolean needMoreInfo) {
this.needMoreInfo = needMoreInfo;
}
public String getKeyWord() {
return keyWord;
}
......
......@@ -3358,57 +3358,58 @@ public class OrderServiceImpl implements IOrderService {
PageHelper.startPage(page, pageSize, true);
}
orderList = orderDao.getOrderListByExample(oueryOrderReq);
for (SysOrder order : orderList) {
// 渠道名称
if (order.getShopId() != null) {
SysUser sysuser = sysUserDao.selectByPrimaryKey(order.getShopId());
if (sysuser != null) {
SysOrganization org = orderChannelDao.selectByPrimaryKey(sysuser.getGroupId());
order.setOrderChannel(org.getName());
order.setOrderChannelOrgId(org.getId());
}
List<SysOrderStatus> list = orderStatusDao.getOrderProgress(order.getId());
if (!list.isEmpty()) {
order.setSysOrderProgress(list.get(0));
}
} else {
// 未知订单渠道名称
if (org.apache.commons.lang3.StringUtils.isNotEmpty(order.getChannel())) {
SysChannelOrg channelOrg = new SysChannelOrg();
channelOrg.setChannel(order.getChannel());
channelOrg = sysChannelOrgDao.getChannelOrg(channelOrg);
if (null != channelOrg.getId()) {
SysOrganization org = orderChannelDao.selectByPrimaryKey(channelOrg.getOrgid());
if (oueryOrderReq.getNeedMoreInfo()) {
for (SysOrder order : orderList) {
// 渠道名称
if (order.getShopId() != null) {
SysUser sysuser = sysUserDao.selectByPrimaryKey(order.getShopId());
if (sysuser != null) {
SysOrganization org = orderChannelDao.selectByPrimaryKey(sysuser.getGroupId());
order.setOrderChannel(org.getName());
order.setOrderChannelOrgId(org.getId());
}
List<SysOrderStatus> list = orderStatusDao.getOrderProgress(order.getId());
if (!list.isEmpty()) {
order.setSysOrderProgress(list.get(0));
}
} else {
// 未知订单渠道名称
if (org.apache.commons.lang3.StringUtils.isNotEmpty(order.getChannel())) {
SysChannelOrg channelOrg = new SysChannelOrg();
channelOrg.setChannel(order.getChannel());
channelOrg = sysChannelOrgDao.getChannelOrg(channelOrg);
if (null != channelOrg.getId()) {
SysOrganization org = orderChannelDao.selectByPrimaryKey(channelOrg.getOrgid());
order.setOrderChannel(org.getName());
order.setOrderChannelOrgId(org.getId());
}
}
}
}
// 技工信息
if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo();
// 技工信息
if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo();
SysUser sysUser = sysUserDao.selectByPrimaryKey(order.getMechanicId());
machanicInfo.setId(order.getMechanicId());
// 有可能是username
machanicInfo.setName(sysUser.getName());
machanicInfo.setPhone(sysUser.getPhoneNumber());
order.setMachanicInfo(machanicInfo);
}
SysUser sysUser = sysUserDao.selectByPrimaryKey(order.getMechanicId());
machanicInfo.setId(order.getMechanicId());
// 有可能是username
machanicInfo.setName(sysUser.getName());
machanicInfo.setPhone(sysUser.getPhoneNumber());
order.setMachanicInfo(machanicInfo);
}
/*
* 检查是否有正在进行的售后
*/
boolean isAfterSaling = false;
Integer orderId = order.getId();
SysOrder sysOrder = getAfterSaleDetail(orderId, null);
if (sysOrder != null) {
isAfterSaling = true;
}
order.setAfterSaling(isAfterSaling);
/*
* 检查是否有正在进行的售后
*/
boolean isAfterSaling = false;
Integer orderId = order.getId();
SysOrder sysOrder = getAfterSaleDetail(orderId, null);
if (sysOrder != null) {
isAfterSaling = true;
}
order.setAfterSaling(isAfterSaling);
}
return orderList;
}
......@@ -3677,11 +3678,16 @@ public class OrderServiceImpl implements IOrderService {
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<SysOrder> list = getOrderListByExample(1, 1, oueryOrderReq);
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal());
......@@ -3729,10 +3735,15 @@ public class OrderServiceImpl implements IOrderService {
map.put("finished", (int) pages.getTotal());
} else {
// 服务商角色&商户角色
// 服务商: 待指派 商户:待接单
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("all", (int) pages.getTotal());
// 服务商: 待指派 商户:待接单
oueryOrderReq.setOrderStatus((byte) 0);
list = getOrderListByExample(1, 1, oueryOrderReq);
pages = (com.github.pagehelper.Page<SysOrder>) list;
map.put("waitAssign", (int) pages.getTotal());
// 待完成
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!