|
|
@ -104,21 +104,11 @@ public class StationController extends BladeController { |
|
|
|
return R.status(stationService.instanceProject(req)); |
|
|
|
return R.status(stationService.instanceProject(req)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/updateBatch") |
|
|
|
@PostMapping("/updateBatchSort") |
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
@ApiOperation(value = "批量修改", notes = "传入站点列表") |
|
|
|
@ApiOperation(value = "批量修改排序", notes = "传入站点列表") |
|
|
|
public R updateBatch(@RequestBody List<StationEntity> req) { |
|
|
|
public R updateBatchSort(@RequestBody List<StationEntity> req) { |
|
|
|
for (StationEntity stationEntity : req) { |
|
|
|
return R.status(stationService.updateBatchSort(req)); |
|
|
|
if (StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) { |
|
|
|
|
|
|
|
List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ |
|
|
|
|
|
|
|
eq(StationEntity::getCode, stationEntity.getCode()).or().eq(StationEntity::getName, stationEntity.getName()); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(list), () -> { |
|
|
|
|
|
|
|
throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.status(stationService.updateBatchById(req)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|