|
@@ -132,7 +132,7 @@ public class ShiftController extends JeecgController<Shift, IShiftService> {
|
|
|
@ApiOperation(value="班次档案-通过id删除", notes="班次档案-通过id删除")
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- List<UserShift> userShifts = userShiftService.listByShiftId(id);
|
|
|
+ List<UserShift> userShifts = userShiftService.listByShiftId(Arrays.asList(id.split(",")));
|
|
|
if (userShifts!=null&&userShifts.size()>0){
|
|
|
return Result.error("删除失败,该班次已使用!");
|
|
|
}else {
|
|
@@ -151,8 +151,13 @@ public class ShiftController extends JeecgController<Shift, IShiftService> {
|
|
|
@ApiOperation(value="班次档案-批量删除", notes="班次档案-批量删除")
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.shiftService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
+ List<UserShift> userShifts = userShiftService.listByShiftId(Arrays.asList(ids.split(",")));
|
|
|
+ if (userShifts!=null&&userShifts.size()>0){
|
|
|
+ return Result.error("删除失败,勾选数据中存在已使用的班次!");
|
|
|
+ }else {
|
|
|
+ this.shiftService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|