|
|
|
@ -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,15 +199,7 @@ public class BasicdataDriverArteryController extends BladeController {
|
|
|
|
|
boolean save = basicdataDriverArteryService.save(basicdataDriverArtery); |
|
|
|
|
if (save) { |
|
|
|
|
|
|
|
|
|
Long driverId = basicdataDriverArtery.getId(); |
|
|
|
|
List<Long> warehouseIds = basicdataDriverArtery.getWarehouseIds(); |
|
|
|
|
List<BasicdataDriverWarehouseEntity> driverWarehouseList = new ArrayList<>(); |
|
|
|
|
for (Long warehouseId : warehouseIds) { |
|
|
|
|
BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); |
|
|
|
|
basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); |
|
|
|
|
basicdataDriverWarehouseEntity.setDriverId(driverId); |
|
|
|
|
driverWarehouseList.add(basicdataDriverWarehouseEntity); |
|
|
|
|
} |
|
|
|
|
List<BasicdataDriverWarehouseEntity> driverWarehouseList = getBasicdataDriverWarehouseEntities(basicdataDriverArtery); |
|
|
|
|
basicdataDriverWarehouseService.saveBatch(driverWarehouseList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -217,6 +210,20 @@ public class BasicdataDriverArteryController extends BladeController {
|
|
|
|
|
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<>(); |
|
|
|
|
for (Long warehouseId : warehouseIds) { |
|
|
|
|
BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); |
|
|
|
|
basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); |
|
|
|
|
basicdataDriverWarehouseEntity.setDriverId(driverId); |
|
|
|
|
driverWarehouseList.add(basicdataDriverWarehouseEntity); |
|
|
|
|
} |
|
|
|
|
return driverWarehouseList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 司机信息表 修改 |
|
|
|
|
*/ |
|
|
|
|