package com.ruoyi.web.controller.pill; import com.ruoyi.common.annotation.Log; import…
- User
package com.ruoyi.web.controller.pill;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.pill.domain.PillExpiryWarning; import com.ruoyi.pill.service.IPillExpiryWarningService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import java.util.List;
/**
-
药品有效期预警,用于监控药品保质期Controller
-
@author wuweiqiang
-
@date 2025-05-20 */ @RestController @RequestMapping("/pill/warning") public class PillExpiryWarningController extends BaseController { @Autowired private IPillExpiryWarningService pillExpiryWarningService;
@PreAuthorize("@ss.hasPermi('pill:warning:list')") @GetMapping("/list") public TableDataInfo list(PillExpiryWarning pillExpiryWarning) { startPage(); // 确保onlyExpire会映射到实体,并传给service和mapper List list = pillExpiryWarningService.selectPillExpiryWarningList(pillExpiryWarning); return getDataTable(list); }
@PreAuthorize("@ss.hasPermi('pill:warning:export')") @Log(title = "药品有效期预警,用于监控药品保质期", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, PillExpiryWarning pillExpiryWarning) { List list = pillExpiryWarningService.selectPillExpiryWarningList(pillExpiryWarning); ExcelUtil util = new ExcelUtil(PillExpiryWarning.class); util.exportExcel(response, list, "药品有效期预警,用于监控药品保质期数据"); }
/**
- 获取药品有效期预警,用于监控药品保质期详细信息 */ @PreAuthorize("@ss.hasPermi('pill:warning:query')") @GetMapping(value = "/{warningId}") public AjaxResult getInfo(@PathVariable("warningId") Long warningId) { return success(pillExpiryWarningService.selectPillExpiryWarningByWarningId(warningId)); }
/**
- 新增药品有效期预警,用于监控药品保质期 */ @PreAuthorize("@ss.hasPermi('pill:warning:add')") @Log(title = "药品有效期预警,用于监控药品保质期", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody PillExpiryWarning pillExpiryWarning) { return toAjax(pillExpiryWarningService.insertPillExpiryWarning(pillExpiryWarning)); }
/**
- 修改药品有效期预警,用于监控药品保质期 */ @PreAuthorize("@ss.hasPermi('pill:warning:edit')") @Log(title = "药品有效期预警,用于监控药品保质期", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody PillExpiryWarning pillExpiryWarning) { return toAjax(pillExpiryWarningService.updatePillExpiryWarning(pillExpiryWarning)); }
/**
- 删除药品有效期预警,用于监控药品保质期 */ @PreAuthorize("@ss.hasPermi('pill:warning:remove')") @Log(title = "药品有效期预警,用于监控药品保质期", businessType = BusinessType.DELETE) @DeleteMapping("/{warningIds}") public AjaxResult remove(@PathVariable Long[] warningIds) { return toAjax(pillExpiryWarningService.deletePillExpiryWarningByWarningIds(warningIds)); } }
-
- Assistant
- User
- Assistant
- User
给我完整的修改后的代码PillExpiryWarningController
- Assistant
- User
'com.ruoyi.pill.service.IPillDrugService' 中的 'selectPillDrugList(com.ruoyi.pill.domain.PillDrug)' 无法应用于 '()
- Assistant
错误信息:
code'com.ruoyi.pill.service.IPillDrugService' 中的 'selectPillDrugList(com.ruoyi.pill.domain.PillDrug)' 无法应用于 '()'意思是:
你调用了
pillDrugService.selectPillDrugList(),但是接口IPillDrugService中定义的方法是带有参数的,例如: - User
- Assistant