123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- package com.slibra.web.controller.business;
- import java.util.List;
- import javax.servlet.http.HttpServletResponse;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.slibra.common.annotation.Log;
- import com.slibra.common.core.controller.BaseController;
- import com.slibra.common.core.domain.AjaxResult;
- import com.slibra.common.enums.BusinessType;
- import com.slibra.business.domain.TXinyiMedicineParam;
- import com.slibra.business.service.ITXinyiMedicineParamService;
- import com.slibra.common.utils.poi.ExcelUtil;
- import com.slibra.common.core.page.TableDataInfo;
- /**
- * 智能投药参数设置Controller
- *
- * @author slibra
- * @date 2024-09-09
- */
- @RestController
- @RequestMapping("/business/medicineParamSetting")
- public class TXinyiMedicineParamController extends BaseController
- {
- @Autowired
- private ITXinyiMedicineParamService tXinyiMedicineParamService;
- // 前端需要的接口
- /**
- * 修改智能投药参数设置
- *
- */
- // @PreAuthorize("@ss.hasPermi('business:param:edit')")
- // @Log(title = "智能投药参数设置", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
- {
- tXinyiMedicineParam.setUpdateBy(getUsername());
- return toAjax(tXinyiMedicineParamService.updateTXinyiMedicineParam(tXinyiMedicineParam));
- }
- /**
- * 获取智能投药参数设置详细信息最新的一条数据
- */
- // @PreAuthorize("@ss.hasPermi('business:param:query')")
- @GetMapping(value = "/getLatestRecord")
- public AjaxResult getLatestRecord()
- {
- return success(tXinyiMedicineParamService.getLatestRecord());
- }
- /**
- * 获取智能投药参数设置详细信息的历史记录-统计使用
- */
- @GetMapping(value = "/getList")
- public AjaxResult getList(TXinyiMedicineParam tXinyiMedicineParam)
- {
- return success(tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam));
- }
- /**
- * 新增智能投药参数设置
- */
- // @PreAuthorize("@ss.hasPermi('business:param:add')")
- // @Log(title = "智能投药参数设置", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
- {
- tXinyiMedicineParam.setCreateBy(getUsername());
- return toAjax(tXinyiMedicineParamService.insertTXinyiMedicineParam(tXinyiMedicineParam));
- }
- //下面的前端暂时用不到
- /**
- * 查询智能投药参数设置列表
- */
- // @PreAuthorize("@ss.hasPermi('business:param:list')")
- @GetMapping("/list")
- public TableDataInfo list(TXinyiMedicineParam tXinyiMedicineParam)
- {
- startPage();
- List<TXinyiMedicineParam> list = tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam);
- return getDataTable(list);
- }
- /**
- * 导出智能投药参数设置列表
- */
- // @PreAuthorize("@ss.hasPermi('business:param:export')")
- // @Log(title = "智能投药参数设置", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, TXinyiMedicineParam tXinyiMedicineParam)
- {
- List<TXinyiMedicineParam> list = tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam);
- ExcelUtil<TXinyiMedicineParam> util = new ExcelUtil<TXinyiMedicineParam>(TXinyiMedicineParam.class);
- util.exportExcel(response, list, "智能投药参数设置数据");
- }
- /**
- * 获取智能投药参数设置详细信息
- */
- // @PreAuthorize("@ss.hasPermi('business:param:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
- return success(tXinyiMedicineParamService.selectTXinyiMedicineParamById(id));
- }
- /**
- * 删除智能投药参数设置
- */
- // @PreAuthorize("@ss.hasPermi('business:param:remove')")
- // @Log(title = "智能投药参数设置", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(tXinyiMedicineParamService.deleteTXinyiMedicineParamByIds(ids));
- }
- }
|