Commit 604807fb authored by hezhen's avatar hezhen

添加上下架设置

parent 9e982ec9
......@@ -20,6 +20,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.xxfc.platform.order.feign.OrderFeign;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.dto.SendMsgDTO;
import com.xxfc.platform.universal.entity.Dictionary;
......@@ -122,6 +123,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
@Autowired
VehicleManageApplyBiz vehicleManageApplyBiz;
@Autowired
OrderFeign orderFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
......@@ -1793,6 +1797,22 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public ObjectRestResponse updState(Vehicle vehicle){
ObjectRestResponse<Boolean> restResponse = orderFeign.checkHasSpecialRentFegin(vehicle.getId());
if (restResponse.getData() == null ){
return restResponse;
}
Boolean flag = restResponse.getData();
if (flag){
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"已存在特惠租车无法上架");
}
updateSelectiveById(vehicle);
return ObjectRestResponse.succ();
}
......
......@@ -44,8 +44,7 @@ public class AppVehicleController extends BaseController<VehicleBiz> {
@PostMapping("updVehicle")
@ApiModelProperty("更新商品信息")
public ObjectRestResponse updVehicle(@RequestBody Vehicle vehicle) {
baseBiz.updateSelectiveById(vehicle);
return ObjectRestResponse.succ();
return baseBiz.updState(vehicle);
}
......
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