Commit f25affa0 by zhangjing

竞价单管理宣布独立

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@23376 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 70b4c5b7
...@@ -13,5 +13,13 @@ import java.util.List; ...@@ -13,5 +13,13 @@ import java.util.List;
*/ */
public interface IBiddingOrderService { public interface IBiddingOrderService {
/**
* PC端竞价单列表展示
*
* @param page
* @param pageSize
* @param oueryOrderReq
* @return
*/
List<SysOrder> getBiddingOrderListByExample(Integer page, Integer pageSize, QueryOrderReq oueryOrderReq); List<SysOrder> getBiddingOrderListByExample(Integer page, Integer pageSize, QueryOrderReq oueryOrderReq);
} }
package com.glsx.ordercenter.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.glsx.common.feign.client.CarBrandClient;
import com.glsx.common.feign.client.UserClient;
import com.glsx.common.utils.RedisCacheUtil;
import com.glsx.common.utils.wehcat.WechatUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.MachanicInfo;
import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.mapper.*;
import com.glsx.ordercenter.mapper.biddingorder.SysBiddingOrderMapper;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Created by jin on 8/15 0015.
*
* @author jin
* @version 1.0
*/
@Service
public class BiddingOrderServiceImpl implements IBiddingOrderService {
@Autowired
private IOrderService orderService;
@Autowired
private SysOrderMapper orderDao;
@Autowired
private SysOrderRepairMapper orderRepairDao;
@Autowired
private SysMerchantMapper sysMerchantDao;
@Autowired
private SysMechanicMapper sysMechanicDao;
@Autowired
private SysUserMapper sysUserDao;
@Autowired
private IAreaService areaService;
@Autowired
private SysOrderStatusMapper orderStatusMapper;
@Autowired
private UserClient userClient;
@Autowired
private DictionaryDataMapper dictionaryDataMapper;
@Autowired
private IResourceMatchingService resourceMatchingService;
@Autowired
private CarBrandClient carBrandClient;
@Autowired
private SysOrganizationMapper orderChannelDao;
@Autowired
private IOrderChannelService orderChannelService;
@Autowired
private StandardOrderServiceImpl standardOrderService;
@Autowired
private WechatUtils wechatUtils;
@Autowired
private SysOrderWechatMsgMapper sysOrderWechatMsgMapper;
@Autowired
private SysChannelOrgMapper sysChannelOrgDao;
@Autowired
private SysDeviceMapper sysDeviceMapper;
@Autowired
private SysDeviceRepertoryMapper sysDeviceRepertoryMapper;
@Autowired
private SysDeviceConsumeLogMapper sysDeviceConsumeLogMapper;
@Autowired
private DeviceService deviceService;
@Autowired
private DeviceRepertoryService deviceRepertoryService;
@Autowired
private SysIndentMapper sysIndentMapper;
@Autowired
private RedisCacheUtil redisCacheUtil;
@Autowired
private ReserveInstallLogService reserveInstallLogService;
@Autowired
private SysOrderServiceTypeMapper sysOrderServiceTypeDao;
@Autowired
private SysOrderFileMapper sysOrderFileDao;
@Autowired
private SysOrderLabelMapper sysOrderLabelDao;
private JSONObject getUserInfo(Integer userId) {
JSONObject obj = userClient.getUserById(userId);
if (obj != null && obj.getIntValue("code") == ResultCodeEnum.SUCCESS.getCode()) {
JSONObject data = obj.getJSONObject("data");
return data;
}
return null;
}
@Autowired
private SysBiddingOrderMapper biddingOrderMapper;
@Override
public List<SysOrder> getBiddingOrderListByExample(Integer page, Integer pageSize, QueryOrderReq oueryOrderReq) {
List<SysOrder> orderList = new ArrayList<>();
//确定当前登录用户的用户类型
JSONObject user = getUserInfo(oueryOrderReq.getUserId());
if (Objects.isNull(user)) {
throw BusinessException.create(ResultCodeEnum.NOT_LOGIN.getCode(), ResultCodeEnum.NOT_LOGIN.getMsg());
}
int userType = user.getIntValue("userType");
oueryOrderReq.setUserType(userType);
PageHelper.startPage(page, pageSize, true);
orderList = biddingOrderMapper.getBiddingOrderList(oueryOrderReq);
for (SysOrder order : orderList) {
// 渠道名称
if (order.getShopId() != null) {
SysUser sysuser = sysUserDao.selectByPrimaryKey(order.getShopId());
SysOrganization organization = null;
if (Objects.nonNull(sysuser) &&
Objects.nonNull(organization = orderChannelDao.selectByPrimaryKey(sysuser.getGroupId()))) {
order.setOrderChannel(organization.getName());
}
}
// 技工信息
if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo();
SysUser sysUser = sysUserDao.selectByPrimaryKey(order.getMechanicId());
if (sysUser != null) {
machanicInfo.setId(order.getMechanicId());
// 有可能是username
machanicInfo.setName(sysUser.getName());
machanicInfo.setPhone(sysUser.getPhoneNumber());
order.setMachanicInfo(machanicInfo);
}
}
}
return orderList;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!