| | |
| | | import com.zy.acs.manager.common.domain.PageParam; |
| | | import com.zy.acs.manager.common.utils.ExcelUtil; |
| | | import com.zy.acs.manager.manager.entity.Sta; |
| | | import com.zy.acs.manager.manager.entity.StaReserve; |
| | | import com.zy.acs.manager.manager.service.StaReserveService; |
| | | import com.zy.acs.manager.manager.service.StaService; |
| | | import com.zy.acs.manager.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | @Autowired |
| | | private StaService staService; |
| | | @Autowired |
| | | private StaReserveService staReserveService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:sta:list')") |
| | | @PostMapping("/sta/page") |
| | |
| | | @PreAuthorize("hasAuthority('manager:sta:remove')") |
| | | @OperationLog("Delete Sta") |
| | | @PostMapping("/sta/remove/{ids}") |
| | | @Transactional |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!staService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | for (Long id : ids) { |
| | | staReserveService.remove(new LambdaQueryWrapper<StaReserve>().eq(StaReserve::getStaId, id)); |
| | | if (!staService.removeById(id)) { |
| | | throw new CoolException("remove Fail"); |
| | | } |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |