Commit 17e2e6b1 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 3ff5cd8f c5618a58
...@@ -340,7 +340,11 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -340,7 +340,11 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
IntegralUserTotal integralUserTotal=new IntegralUserTotal(); IntegralUserTotal integralUserTotal=new IntegralUserTotal();
integralUserTotal.setUserId(userId); integralUserTotal.setUserId(userId);
integralUserTotal=integralUserTotalBiz.selectOne(integralUserTotal); integralUserTotal=integralUserTotalBiz.selectOne(integralUserTotal);
BeanUtils.copyProperties(integralUserTotal,userInfoDTO); if (integralUserTotal!=null){
BeanUtils.copyProperties(integralUserTotal,userInfoDTO);
}else {
userInfoDTO.setTotalPoint(0);
}
UserCoupon userCoupon=new UserCoupon(); UserCoupon userCoupon=new UserCoupon();
userCoupon.setUserId(userId); userCoupon.setUserId(userId);
userCoupon.setIsUse(0); userCoupon.setIsUse(0);
......
...@@ -18,7 +18,11 @@ import com.xxfc.platform.order.service.OrderRentVehicleService; ...@@ -18,7 +18,11 @@ import com.xxfc.platform.order.service.OrderRentVehicleService;
import com.xxfc.platform.order.pojo.AddRentVehicleDTO; import com.xxfc.platform.order.pojo.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.order.RentVehicleBO; 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.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.BookVehicleVO; import com.xxfc.platform.vehicle.pojo.BookVehicleVO;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -32,6 +36,7 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -32,6 +36,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.persistence.Column; import javax.persistence.Column;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Controller @Controller
...@@ -52,13 +57,28 @@ public class OrderRentVehicleController extends CommonBaseController { ...@@ -52,13 +57,28 @@ public class OrderRentVehicleController extends CommonBaseController {
@Autowired @Autowired
UserFeign userFeign; UserFeign userFeign;
@Autowired
VehicleFeign vehicleFeign;
@RequestMapping(value = "add",method = RequestMethod.POST) @RequestMapping(value = "add",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "确认租车订单") @ApiOperation(value = "确认租车订单")
public ObjectRestResponse<BaseOrder> add(@RequestBody AddRentVehicleDTO vo){ public ObjectRestResponse<BaseOrder> add(@RequestBody AddRentVehicleDTO vo){
if(null == vo.getBookEndDate() || null == vo.getBookStartDate() if(null == vo.getEndCompanyId() || vo.getEndCompanyId().equals(0)) {
|| vo.getBookStartDate().equals(0) || vo.getBookEndDate().equals(0)) { if(StrUtil.isBlank(vo.getEndAddr())) {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("公司参数不正确")); throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("公司参数不正确"));
}else {
Map<String, Object> map = BeanUtil.beanToMap(new BranchCompany(){{
setName(vo.getEndAddr());
}}, false, true);
List<BranchCompany> data = vehicleFeign.branchCompanyEntityList(map).getData();
if(null == data) {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("公司参数不正确"));
}else {
BranchCompany endCompany = vehicleFeign.branchCompanyEntityList(map).getData().get(0);
vo.setEndCompanyId(endCompany.getId());
}
}
} }
RentVehicleBO bo = BeanUtil.toBean(vo, RentVehicleBO.class); RentVehicleBO bo = BeanUtil.toBean(vo, RentVehicleBO.class);
bo.setBookVehicleVO(new BookVehicleVO(){{ bo.setBookVehicleVO(new BookVehicleVO(){{
......
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