¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentOvertime; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentOvertimeService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: 设å¤å ç管ç |
| | | * @Author: Lius |
| | | * @Date: 2023-08-25 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "设å¤å ç管ç") |
| | | @RestController |
| | | @RequestMapping("/mdc/mdcEquipmentOvertime") |
| | | public class MdcEquipmentOvertimeController extends JeecgController<MdcEquipmentOvertime, IMdcEquipmentOvertimeService> { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentOvertimeService mdcEquipmentOvertimeService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mdcEquipmentOvertime |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "设å¤å ç管ç-å页å表æ¥è¯¢", notes = "设å¤å ç管ç-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(MdcEquipmentOvertime mdcEquipmentOvertime, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | Page<MdcEquipmentOvertime> page = new Page<MdcEquipmentOvertime>(pageNo, pageSize); |
| | | IPage<MdcEquipmentOvertime> pageList = mdcEquipmentOvertimeService.pageList(userId, page, mdcEquipmentOvertime, req); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param mdcEquipmentOvertime |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-æ·»å ") |
| | | @ApiOperation(value = "设å¤å ç管ç-æ·»å ", notes = "设å¤å ç管ç-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | mdcEquipmentOvertimeService.save(mdcEquipmentOvertime); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param mdcEquipmentOvertime |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-ç¼è¾") |
| | | @ApiOperation(value = "设å¤å ç管ç-ç¼è¾", notes = "设å¤å ç管ç-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | mdcEquipmentOvertimeService.updateById(mdcEquipmentOvertime); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-éè¿idå é¤") |
| | | @ApiOperation(value = "设å¤å ç管ç-éè¿idå é¤", notes = "设å¤å ç管ç-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | mdcEquipmentOvertimeService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-æ¹éå é¤") |
| | | @ApiOperation(value = "设å¤å ç管ç-æ¹éå é¤", notes = "设å¤å ç管ç-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.mdcEquipmentOvertimeService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å ç管ç-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "设å¤å ç管ç-éè¿idæ¥è¯¢", notes = "设å¤å ç管ç-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | MdcEquipmentOvertime mdcEquipmentOvertime = mdcEquipmentOvertimeService.getById(id); |
| | | return Result.OK(mdcEquipmentOvertime); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param mdcEquipmentOvertime |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcEquipmentOvertime mdcEquipmentOvertime) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | return mdcEquipmentOvertimeService.exportXls(userId, mdcEquipmentOvertime); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MdcEquipmentOvertime.class); |
| | | } |
| | | |
| | | } |