Commit d7eafaf6 by zhengxj

finish 汽车品牌车型 on 20190306 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18167 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a2ea60bb
...@@ -31,6 +31,7 @@ import java.util.Date; ...@@ -31,6 +31,7 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -44,6 +45,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -44,6 +45,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.common.constants.Constants; import com.glsx.common.constants.Constants;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.feign.client.CarBrandClient;
import com.glsx.common.feign.client.UserClient; import com.glsx.common.feign.client.UserClient;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
...@@ -53,6 +55,7 @@ import com.glsx.ordercenter.constants.OrderActiveStatusEnum; ...@@ -53,6 +55,7 @@ import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.constants.OrderTypeEnum; import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum; import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.BizAmountResp; import com.glsx.ordercenter.dto.BizAmountResp;
import com.glsx.ordercenter.dto.CarInfo;
import com.glsx.ordercenter.dto.FinishedOrders; import com.glsx.ordercenter.dto.FinishedOrders;
import com.glsx.ordercenter.dto.MachanicInfo; import com.glsx.ordercenter.dto.MachanicInfo;
import com.glsx.ordercenter.dto.MechanicBusiness; import com.glsx.ordercenter.dto.MechanicBusiness;
...@@ -129,6 +132,9 @@ public class OrderServiceImpl implements IOrderService { ...@@ -129,6 +132,9 @@ public class OrderServiceImpl implements IOrderService {
@Autowired @Autowired
private IResourceMatchingService resourceMatchingService; private IResourceMatchingService resourceMatchingService;
@Autowired
private CarBrandClient carBrandClient;
/** /**
* *
*/ */
...@@ -1020,7 +1026,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1020,7 +1026,7 @@ public class OrderServiceImpl implements IOrderService {
} }
SysOrder order = orderDao.selectByExample(sysOrderExample).get(0); SysOrder order = orderDao.selectByExample(sysOrderExample).get(0);
SysOrderRepairExample exam = new SysOrderRepairExample(); SysOrderRepairExample exam = new SysOrderRepairExample();
exam.createCriteria().andOrderIdEqualTo(id); exam.createCriteria().andOrderIdEqualTo(order.getId());
List<SysOrderRepair> subOrders = orderRepairDao.selectByExample(exam); List<SysOrderRepair> subOrders = orderRepairDao.selectByExample(exam);
int subOrderNumber = 0; int subOrderNumber = 0;
if (subOrders != null) { if (subOrders != null) {
...@@ -1034,14 +1040,14 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1034,14 +1040,14 @@ public class OrderServiceImpl implements IOrderService {
order.setArea(areaService.getAllChargeItems(order.getDistrict())); order.setArea(areaService.getAllChargeItems(order.getDistrict()));
// 渠道名称 // 渠道名称
if (order.getMerchantId() != null) { if (order.getMerchantId() != null) {
SysMerchantExample example=new SysMerchantExample(); SysMerchantExample example = new SysMerchantExample();
example.createCriteria().andUserIdEqualTo(order.getMerchantId()); example.createCriteria().andUserIdEqualTo(order.getMerchantId());
order.setOrderChannel(sysMerchantDao.selectByExample(example).get(0).getShopName()); order.setOrderChannel(sysMerchantDao.selectByExample(example).get(0).getShopName());
} }
// 门店名称 // 门店名称
if (order.getShopId() != null) { if (order.getShopId() != null) {
MerchantInfo merchantInfo = new MerchantInfo(); MerchantInfo merchantInfo = new MerchantInfo();
SysMerchantExample example=new SysMerchantExample(); SysMerchantExample example = new SysMerchantExample();
example.createCriteria().andUserIdEqualTo(order.getMerchantId()); example.createCriteria().andUserIdEqualTo(order.getMerchantId());
merchantInfo.setName(sysMerchantDao.selectByExample(example).get(0).getShopName()); merchantInfo.setName(sysMerchantDao.selectByExample(example).get(0).getShopName());
order.setMerchantInfo(merchantInfo); order.setMerchantInfo(merchantInfo);
...@@ -1050,7 +1056,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1050,7 +1056,8 @@ public class OrderServiceImpl implements IOrderService {
if (order.getMechanicId() != null) { if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo(); MachanicInfo machanicInfo = new MachanicInfo();
// SysMechanic sysMechanic = sysMechanicDao.selectByPrimaryKey(order.getMechanicId()); // SysMechanic sysMechanic =
// sysMechanicDao.selectByPrimaryKey(order.getMechanicId());
SysUser sysUser = sysUserDao.selectByPrimaryKey(order.getMechanicId()); SysUser sysUser = sysUserDao.selectByPrimaryKey(order.getMechanicId());
machanicInfo.setId(order.getMechanicId()); machanicInfo.setId(order.getMechanicId());
// 有可能是username // 有可能是username
...@@ -1058,7 +1065,31 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1058,7 +1065,31 @@ public class OrderServiceImpl implements IOrderService {
machanicInfo.setPhone(sysUser.getPhoneNumber()); machanicInfo.setPhone(sysUser.getPhoneNumber());
order.setMachanicInfo(machanicInfo); order.setMachanicInfo(machanicInfo);
} }
// 车辆信息信息
if (order.getCarSeries() != null) {
int serId=order.getCarSeries();
int brandId=order.getCarBrand();
JSONObject series = carBrandClient.getSeriesById(serId);
JSONObject brand = carBrandClient.getBrandById(brandId);
CarInfo carInfo = new CarInfo();
carInfo.setBrand(brand.getString("data"));
carInfo.setSeries(series.getString("data"));
// 车辆信息信息
if (order.getCarType() != null) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
String carType = order.getCarType();
if (pattern.matcher(carType).matches()) {
int typeId=Integer.parseInt(order.getCarType());
JSONObject type = carBrandClient.getCarTypeById(typeId);
if (!com.glsx.common.utils.StringUtils.isEmpty(type.getString("data"))) {
carInfo.setType(type.getString("data"));
}
}
}
order.setCarInfo(carInfo);
}
return order; return order;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!