|
|
|
@ -117,10 +117,10 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
@Operation(summary = "新增", description = "传入bsEpciuInspectionPoint") |
|
|
|
@Operation(summary = "新增", description = "传入bsEpciuInspectionPoint") |
|
|
|
public R save(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
public R save(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
// 校验巡检点编号是否重复
|
|
|
|
// 校验巡检点编号和类型是否重复
|
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), null)) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), bsEpciuInspectionPoint.getInsType(), null)) { |
|
|
|
throw new RuntimeException("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】已存在,不能重复添加"); |
|
|
|
throw new RuntimeException("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】和巡检点类型的组合已存在,不能重复添加"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return R.status(bsEpciuInspectionPointService.save(bsEpciuInspectionPoint)); |
|
|
|
return R.status(bsEpciuInspectionPointService.save(bsEpciuInspectionPoint)); |
|
|
|
@ -133,10 +133,10 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
@Operation(summary = "修改", description = "传入bsEpciuInspectionPoint") |
|
|
|
@Operation(summary = "修改", description = "传入bsEpciuInspectionPoint") |
|
|
|
public R update(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
public R update(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
// 校验巡检点编号是否重复(排除当前记录)
|
|
|
|
// 校验巡检点编号和类型是否重复(排除当前记录)
|
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), bsEpciuInspectionPoint.getId())) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), bsEpciuInspectionPoint.getInsType(), bsEpciuInspectionPoint.getId())) { |
|
|
|
return R.fail("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】已存在,不能重复"); |
|
|
|
return R.fail("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】和巡检点类型的组合已存在,不能重复"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return R.status(bsEpciuInspectionPointService.updateById(bsEpciuInspectionPoint)); |
|
|
|
return R.status(bsEpciuInspectionPointService.updateById(bsEpciuInspectionPoint)); |
|
|
|
@ -149,10 +149,10 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@Operation(summary = "新增或修改", description = "传入bsEpciuInspectionPoint") |
|
|
|
@Operation(summary = "新增或修改", description = "传入bsEpciuInspectionPoint") |
|
|
|
public R submit(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
public R submit(@Valid @RequestBody BsEpciuInspectionPointEntity bsEpciuInspectionPoint) { |
|
|
|
// 校验巡检点编号是否重复
|
|
|
|
// 校验巡检点编号和类型是否重复
|
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPoint.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), bsEpciuInspectionPoint.getId())) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(bsEpciuInspectionPoint.getInsNum(), bsEpciuInspectionPoint.getInsType(), bsEpciuInspectionPoint.getId())) { |
|
|
|
return R.fail("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】已存在,不能重复"); |
|
|
|
return R.fail("巡检点编号【" + bsEpciuInspectionPoint.getInsNum() + "】和巡检点类型的组合已存在,不能重复"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return R.status(bsEpciuInspectionPointService.saveOrUpdate(bsEpciuInspectionPoint)); |
|
|
|
return R.status(bsEpciuInspectionPointService.saveOrUpdate(bsEpciuInspectionPoint)); |
|
|
|
@ -225,11 +225,11 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
noticeList.add(notice); |
|
|
|
noticeList.add(notice); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 校验导入数据中是否有重复的巡检点编号
|
|
|
|
// 校验导入数据中是否有重复的巡检点编号和类型组合
|
|
|
|
for (BsEpciuInspectionPointEntity entity : noticeList) { |
|
|
|
for (BsEpciuInspectionPointEntity entity : noticeList) { |
|
|
|
if (entity.getInsNum() != null) { |
|
|
|
if (entity.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(entity.getInsNum(), null)) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(entity.getInsNum(), entity.getInsType(), null)) { |
|
|
|
return R.fail("巡检点编号【" + entity.getInsNum() + "】已存在,不能重复导入"); |
|
|
|
return R.fail("巡检点编号【" + entity.getInsNum() + "】和巡检点类型【" + entity.getInsType() + "】的组合已存在,不能重复导入"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -250,11 +250,11 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 12) |
|
|
|
@ApiOperationSupport(order = 12) |
|
|
|
@Operation(summary = "批量新增", description = "传入bsEpciuInspectionPointList") |
|
|
|
@Operation(summary = "批量新增", description = "传入bsEpciuInspectionPointList") |
|
|
|
public R saveList(@Valid @RequestBody List<BsEpciuInspectionPointEntity> bsEpciuInspectionPointList) { |
|
|
|
public R saveList(@Valid @RequestBody List<BsEpciuInspectionPointEntity> bsEpciuInspectionPointList) { |
|
|
|
// 校验批量数据中是否有重复的巡检点编号
|
|
|
|
// 校验批量数据中是否有重复的巡检点编号和类型组合
|
|
|
|
for (BsEpciuInspectionPointEntity entity : bsEpciuInspectionPointList) { |
|
|
|
for (BsEpciuInspectionPointEntity entity : bsEpciuInspectionPointList) { |
|
|
|
if (entity.getInsNum() != null) { |
|
|
|
if (entity.getInsNum() != null) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(entity.getInsNum(), entity.getId())) { |
|
|
|
if (bsEpciuInspectionPointService.checkDuplicate(entity.getInsNum(), entity.getInsType(), entity.getId())) { |
|
|
|
return R.fail("巡检点编号【" + entity.getInsNum() + "】已存在,不能重复添加"); |
|
|
|
return R.fail("巡检点编号【" + entity.getInsNum() + "】和巡检点类型【" + entity.getInsType() + "】的组合已存在,不能重复添加"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|