Commit 1c36a69c authored by 周健威's avatar 周健威

Merge branch 'master-vehicle-price' into dev-tiande

parents 4739ab6f fcc50f11
......@@ -64,6 +64,8 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
@Service
@Slf4j
public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserRestInterface {
......@@ -98,6 +100,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
@Autowired
private VehicleJobHandler vehicleJobHandler;
@Autowired
VehicleCommonPriceInfoBiz vehicleCommonPriceInfoBiz;
@Autowired
private ThirdFeign thirdFeign;
@Override
......@@ -310,9 +315,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
if (CollectionUtils.isNotEmpty(exitsVehicles)) {
for (Vehicle exitsVehicle : exitsVehicles) {
if (exitsVehicle.getId().equals(addOrUpdateVehicleVo.getId())) {
//如果修改的有停靠分公司,需要添加一条调度记录
Vehicle vehicle1 = selectById(exitsVehicle.getId());
if (vehicle1 != null) {
//如果修改的有停靠分公司,需要添加一条调度记录
if (!vehicle1.getParkBranchCompanyId() .equals(addOrUpdateVehicleVo.getParkBranchCompanyId())) {
VehicleBookRecord vehicleBookRecord = new VehicleBookRecord();
vehicleBookRecord.setRetCompany(addOrUpdateVehicleVo.getParkBranchCompanyId());
......@@ -330,15 +335,24 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
vehicleBookRecord.setVehicleUsername(userDTO.getUsername());
vehicleBookRecord.setVehicleUserPhone(userDTO.getUsername());
ObjectRestResponse objectRestResponse = addVehicleBookRecord(vehicleBookRecord);
if(objectRestResponse.isRel()) {
continue;
} else {
if(!objectRestResponse.isRel()) {
return RestResponse.codeAndMessage(objectRestResponse.getStatus(), objectRestResponse.getMessage());
}
}
} else {
continue;
//修改价格记录的公司标识
if (!vehicle1.getSubordinateBranch().equals(addOrUpdateVehicleVo.getSubordinateBranch())) {
vehicleCommonPriceInfoBiz.updateByWeekendSelective(new VehicleCommonPriceInfo(){{
setCompanyId(addOrUpdateVehicleVo.getSubordinateBranch());
setIsDel(SYS_FALSE);
}}, w->{
w.andEqualTo(VehicleCommonPriceInfo::getVehicleId, vehicle1.getId());
w.andEqualTo(VehicleCommonPriceInfo::getIsDel, SYS_FALSE);
return w;
});
}
continue;
}
} else {
......
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