|
|
|
@ -37,6 +37,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
@ -198,6 +199,19 @@ public class BasicdataDriverArteryController extends BladeController {
|
|
|
|
|
boolean save = basicdataDriverArteryService.save(basicdataDriverArtery); |
|
|
|
|
if (save) { |
|
|
|
|
|
|
|
|
|
List<BasicdataDriverWarehouseEntity> driverWarehouseList = getBasicdataDriverWarehouseEntities(basicdataDriverArtery); |
|
|
|
|
basicdataDriverWarehouseService.saveBatch(driverWarehouseList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 加入关联表
|
|
|
|
|
if (null != basicdataDriverArtery.getBindVehicles() && save) { |
|
|
|
|
Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery); |
|
|
|
|
} |
|
|
|
|
return R.status(save); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
|
private static List<BasicdataDriverWarehouseEntity> getBasicdataDriverWarehouseEntities(BasicdataDriverArteryDTO basicdataDriverArtery) { |
|
|
|
|
Long driverId = basicdataDriverArtery.getId(); |
|
|
|
|
List<Long> warehouseIds = basicdataDriverArtery.getWarehouseIds(); |
|
|
|
|
List<BasicdataDriverWarehouseEntity> driverWarehouseList = new ArrayList<>(); |
|
|
|
@ -207,14 +221,7 @@ public class BasicdataDriverArteryController extends BladeController {
|
|
|
|
|
basicdataDriverWarehouseEntity.setDriverId(driverId); |
|
|
|
|
driverWarehouseList.add(basicdataDriverWarehouseEntity); |
|
|
|
|
} |
|
|
|
|
basicdataDriverWarehouseService.saveBatch(driverWarehouseList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 加入关联表
|
|
|
|
|
if (null != basicdataDriverArtery.getBindVehicles() && save) { |
|
|
|
|
Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery); |
|
|
|
|
} |
|
|
|
|
return R.status(save); |
|
|
|
|
return driverWarehouseList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|