Commit 6054aafa authored by libin's avatar libin

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents 034ed65a 606ae041
...@@ -22,9 +22,11 @@ import com.xxfc.platform.order.pojo.order.RentVehicleBO; ...@@ -22,9 +22,11 @@ import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO; import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.universal.constant.DictionaryKey; import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord; import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.entity.VehicleModel; import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO; import com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO;
import lombok.extern.log4j.Log4j; import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -35,8 +37,10 @@ import javax.annotation.PostConstruct; ...@@ -35,8 +37,10 @@ import javax.annotation.PostConstruct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.*; import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER; import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
...@@ -84,6 +88,24 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -84,6 +88,24 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
initDictionary(); initDictionary();
VehicleModel vehicleModel = vehicleFeign.get(bo.getModelId()).getData(); VehicleModel vehicleModel = vehicleFeign.get(bo.getModelId()).getData();
bo.setVehicleModel(vehicleModel); bo.setVehicleModel(vehicleModel);
//根据还车城市设置还车公司id
if(SYS_FALSE.equals(bo.getEndCompanyId())) {
if(null != bo.getEndCity() && null != bo.getStartCity()) {
if(bo.getEndCity().equals(bo.getStartCity())) {
bo.setEndCompanyId(bo.getStartCompanyId());
}else {
//查询结束城市分公司
List<BranchCompany> companyDetails = vehicleFeign.branchCompanyEntityList(
BeanUtil.beanToMap(new BranchCompany(){{
setAddrCity(bo.getEndCity());
}}, false, true)).getData();
if(null != companyDetails && companyDetails.size() > 0) {
bo.setEndCompanyId(companyDetails.get(0).getId());
}
}
}
}
} }
public void initDictionary() { public void initDictionary() {
......
...@@ -10,6 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -10,6 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by ace on 2017/9/15. * Created by ace on 2017/9/15.
...@@ -55,9 +56,11 @@ public interface VehicleFeign { ...@@ -55,9 +56,11 @@ public interface VehicleFeign {
public List<BranchCompany> companyAll( public List<BranchCompany> companyAll(
@RequestParam(value = "dataAll")Integer dataAll, @RequestParam(value = "dataAll")Integer dataAll,
@RequestParam(value = "dataCompany")String dataCompany, @RequestParam(value = "dataCompany")String dataCompany,
@RequestParam(value = "dataZone")String dataZone); @RequestParam(value = "dataZone")String dataZone);
@GetMapping("/branchCompany/entityList")
public ObjectRestResponse<List<BranchCompany>> branchCompanyEntityList(@RequestParam("entity") Map<String, Object> entity);
@RequestMapping(value = "/user/license/one", method = RequestMethod.GET) @RequestMapping(value = "/user/license/one", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> one(@RequestParam(value="id",defaultValue="0")Integer id) throws Exception; public RestResponse<VehicleUserLicense> one(@RequestParam(value="id",defaultValue="0")Integer id) throws Exception;
......
package com.xxfc.platform.vehicle.common; package com.xxfc.platform.vehicle.common;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Slf4j @Slf4j
public class BaseController<Biz extends BaseBiz> { public class BaseController<Biz extends BaseBiz> {
...@@ -12,5 +18,4 @@ public class BaseController<Biz extends BaseBiz> { ...@@ -12,5 +18,4 @@ public class BaseController<Biz extends BaseBiz> {
protected HttpServletRequest request; protected HttpServletRequest request;
@Autowired @Autowired
protected Biz baseBiz; protected Biz baseBiz;
} }
...@@ -151,4 +151,12 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -151,4 +151,12 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
} }
return baseBiz.getListByUser(userDTO); return baseBiz.getListByUser(userDTO);
} }
@ApiOperation("根据参数查询,等于")
@RequestMapping(value = "/entityList",method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<List<BranchCompany>> entityList(BranchCompany entity){
//查询列表数据
return ObjectRestResponse.succ(baseBiz.selectList(entity));
}
} }
...@@ -3,13 +3,19 @@ package com.xxfc.platform.vehicle; ...@@ -3,13 +3,19 @@ package com.xxfc.platform.vehicle;
import org.junit.Test; import org.junit.Test;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class ListTest { public class ListTest {
@Test //@Test
public void ListTest(){ public void ListTest(){
List<Object> objects = Arrays.asList(); List<Object> objects = Arrays.asList();
System.out.println("objects.size()"+objects.get(0)); System.out.println("objects.size()"+objects.get(0));
} }
public static void main(String[] args) {
List<Object> objects = new ArrayList<Object>();
System.out.println("objects.size()"+objects.get(0));
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment