From 62a84bc9711eeaddb3b231f2c849c17bb35e03c1 Mon Sep 17 00:00:00 2001 From: ll <1079863556@qq.com> Date: Fri, 18 Jul 2025 13:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=B2=9C=E5=A5=B6=E6=A3=80=E9=AA=8C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/NpFreshMilkInspController.java | 104 +++++++ .../freshMilkTest/domain/NpFreshMilkInsp.java | 267 ++++++++++++++++++ .../mapper/NpFreshMilkInspMapper.java | 61 ++++ .../service/INpFreshMilkInspService.java | 61 ++++ .../impl/NpFreshMilkInspServiceImpl.java | 95 +++++++ .../freshMilkTest/NpFreshMilkInspMapper.xml | 134 +++++++++ 6 files changed, 722 insertions(+) create mode 100644 zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/controller/NpFreshMilkInspController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/domain/NpFreshMilkInsp.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/mapper/NpFreshMilkInspMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/INpFreshMilkInspService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/impl/NpFreshMilkInspServiceImpl.java create mode 100644 zhyc-module/src/main/resources/mapper/dairyProducts/freshMilkTest/NpFreshMilkInspMapper.xml diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/controller/NpFreshMilkInspController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/controller/NpFreshMilkInspController.java new file mode 100644 index 0000000..d91901c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/controller/NpFreshMilkInspController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.freshMilkTest.controller; + +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.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.dairyProducts.freshMilkTest.domain.NpFreshMilkInsp; +import com.zhyc.module.dairyProducts.freshMilkTest.service.INpFreshMilkInspService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 鲜奶生产,成品检验记录Controller + * + * @author ruoyi + * @date 2025-07-18 + */ +@RestController +@RequestMapping("/freshMilkTest/freshMilkTest") +public class NpFreshMilkInspController extends BaseController +{ + @Autowired + private INpFreshMilkInspService npFreshMilkInspService; + + /** + * 查询鲜奶生产,成品检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:list')") + @GetMapping("/list") + public TableDataInfo list(NpFreshMilkInsp npFreshMilkInsp) + { + startPage(); + List list = npFreshMilkInspService.selectNpFreshMilkInspList(npFreshMilkInsp); + return getDataTable(list); + } + + /** + * 导出鲜奶生产,成品检验记录列表 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:export')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, NpFreshMilkInsp npFreshMilkInsp) + { + List list = npFreshMilkInspService.selectNpFreshMilkInspList(npFreshMilkInsp); + ExcelUtil util = new ExcelUtil(NpFreshMilkInsp.class); + util.exportExcel(response, list, "鲜奶生产,成品检验记录数据"); + } + + /** + * 获取鲜奶生产,成品检验记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(npFreshMilkInspService.selectNpFreshMilkInspById(id)); + } + + /** + * 新增鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:add')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpFreshMilkInsp npFreshMilkInsp) + { + return toAjax(npFreshMilkInspService.insertNpFreshMilkInsp(npFreshMilkInsp)); + } + + /** + * 修改鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:edit')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpFreshMilkInsp npFreshMilkInsp) + { + return toAjax(npFreshMilkInspService.updateNpFreshMilkInsp(npFreshMilkInsp)); + } + + /** + * 删除鲜奶生产,成品检验记录 + */ + @PreAuthorize("@ss.hasPermi('freshMilkTest:freshMilkTest:remove')") + @Log(title = "鲜奶生产,成品检验记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(npFreshMilkInspService.deleteNpFreshMilkInspByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/domain/NpFreshMilkInsp.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/domain/NpFreshMilkInsp.java new file mode 100644 index 0000000..a1c7fad --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/domain/NpFreshMilkInsp.java @@ -0,0 +1,267 @@ +package com.zhyc.module.dairyProducts.freshMilkTest.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 鲜奶生产,成品检验记录对象 np_fresh_milk_insp + * + * @author ruoyi + * @date 2025-07-18 + */ +public class NpFreshMilkInsp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 来源 */ + @Excel(name = "来源") + private String source; + + /** 检测日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检测日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 脂肪g/100g */ + @Excel(name = "脂肪g/100g") + private Double fat; + + /** 蛋白质g/100g */ + @Excel(name = "蛋白质g/100g") + private Double protein; + + /** 非脂g/100g */ + @Excel(name = "非脂g/100g") + private Double nonFat; + + /** 酸度oT */ + @Excel(name = "酸度oT") + private Double acidity; + + /** 菌落总数CFU/ml_1 */ + @Excel(name = "菌落总数CFU/ml_1") + private Double bacterialColony1; + + /** 菌落总数CFU/ml_2 */ + @Excel(name = "菌落总数CFU/ml_2") + private Double bacterialColony2; + + /** 菌落总数CFU/ml_3 */ + @Excel(name = "菌落总数CFU/ml_3") + private Double bacterialColony3; + + /** 菌落总数CFU/ml_4 */ + @Excel(name = "菌落总数CFU/ml_4") + private Double bacterialColony4; + + /** 菌落总数CFU/ml_5 */ + @Excel(name = "菌落总数CFU/ml_5") + private Double bacterialColony5; + + /** 大肠菌群CFU/ml */ + @Excel(name = "大肠菌群CFU/ml") + private Double coli; + + /** 乳铁蛋白(mg/L) */ + @Excel(name = "乳铁蛋白", readConverterExp = "m=g/L") + private Double lactoferrin; + + /** 免疫球蛋白(mg/l) */ + @Excel(name = "免疫球蛋白", readConverterExp = "m=g/l") + private Double ig; + + /** 备注 */ + @Excel(name = "备注") + private String commnet; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setSource(String source) + { + this.source = source; + } + + public String getSource() + { + return source; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setFat(Double fat) + { + this.fat = fat; + } + + public Double getFat() + { + return fat; + } + + public void setProtein(Double protein) + { + this.protein = protein; + } + + public Double getProtein() + { + return protein; + } + + public void setNonFat(Double nonFat) + { + this.nonFat = nonFat; + } + + public Double getNonFat() + { + return nonFat; + } + + public void setAcidity(Double acidity) + { + this.acidity = acidity; + } + + public Double getAcidity() + { + return acidity; + } + + public void setBacterialColony1(Double bacterialColony1) + { + this.bacterialColony1 = bacterialColony1; + } + + public Double getBacterialColony1() + { + return bacterialColony1; + } + + public void setBacterialColony2(Double bacterialColony2) + { + this.bacterialColony2 = bacterialColony2; + } + + public Double getBacterialColony2() + { + return bacterialColony2; + } + + public void setBacterialColony3(Double bacterialColony3) + { + this.bacterialColony3 = bacterialColony3; + } + + public Double getBacterialColony3() + { + return bacterialColony3; + } + + public void setBacterialColony4(Double bacterialColony4) + { + this.bacterialColony4 = bacterialColony4; + } + + public Double getBacterialColony4() + { + return bacterialColony4; + } + + public void setBacterialColony5(Double bacterialColony5) + { + this.bacterialColony5 = bacterialColony5; + } + + public Double getBacterialColony5() + { + return bacterialColony5; + } + + public void setColi(Double coli) + { + this.coli = coli; + } + + public Double getColi() + { + return coli; + } + + public void setLactoferrin(Double lactoferrin) + { + this.lactoferrin = lactoferrin; + } + + public Double getLactoferrin() + { + return lactoferrin; + } + + public void setIg(Double ig) + { + this.ig = ig; + } + + public Double getIg() + { + return ig; + } + + public void setCommnet(String commnet) + { + this.commnet = commnet; + } + + public String getCommnet() + { + return commnet; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("source", getSource()) + .append("datetime", getDatetime()) + .append("fat", getFat()) + .append("protein", getProtein()) + .append("nonFat", getNonFat()) + .append("acidity", getAcidity()) + .append("bacterialColony1", getBacterialColony1()) + .append("bacterialColony2", getBacterialColony2()) + .append("bacterialColony3", getBacterialColony3()) + .append("bacterialColony4", getBacterialColony4()) + .append("bacterialColony5", getBacterialColony5()) + .append("coli", getColi()) + .append("lactoferrin", getLactoferrin()) + .append("ig", getIg()) + .append("commnet", getCommnet()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/mapper/NpFreshMilkInspMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/mapper/NpFreshMilkInspMapper.java new file mode 100644 index 0000000..e0671e5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/mapper/NpFreshMilkInspMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.freshMilkTest.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.freshMilkTest.domain.NpFreshMilkInsp; + +/** + * 鲜奶生产,成品检验记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-18 + */ +public interface NpFreshMilkInspMapper +{ + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id); + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录集合 + */ + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 删除鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + public int deleteNpFreshMilkInspById(Long id); + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNpFreshMilkInspByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/INpFreshMilkInspService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/INpFreshMilkInspService.java new file mode 100644 index 0000000..6c709e4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/INpFreshMilkInspService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.freshMilkTest.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.freshMilkTest.domain.NpFreshMilkInsp; + +/** + * 鲜奶生产,成品检验记录Service接口 + * + * @author ruoyi + * @date 2025-07-18 + */ +public interface INpFreshMilkInspService +{ + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id); + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录集合 + */ + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp); + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的鲜奶生产,成品检验记录主键集合 + * @return 结果 + */ + public int deleteNpFreshMilkInspByIds(Long[] ids); + + /** + * 删除鲜奶生产,成品检验记录信息 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + public int deleteNpFreshMilkInspById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/impl/NpFreshMilkInspServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/impl/NpFreshMilkInspServiceImpl.java new file mode 100644 index 0000000..c990280 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/freshMilkTest/service/impl/NpFreshMilkInspServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.dairyProducts.freshMilkTest.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.dairyProducts.freshMilkTest.mapper.NpFreshMilkInspMapper; +import com.zhyc.module.dairyProducts.freshMilkTest.domain.NpFreshMilkInsp; +import com.zhyc.module.dairyProducts.freshMilkTest.service.INpFreshMilkInspService; + +/** + * 鲜奶生产,成品检验记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-18 + */ +@Service +public class NpFreshMilkInspServiceImpl implements INpFreshMilkInspService +{ + @Autowired + private NpFreshMilkInspMapper npFreshMilkInspMapper; + + /** + * 查询鲜奶生产,成品检验记录 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 鲜奶生产,成品检验记录 + */ + @Override + public NpFreshMilkInsp selectNpFreshMilkInspById(Long id) + { + return npFreshMilkInspMapper.selectNpFreshMilkInspById(id); + } + + /** + * 查询鲜奶生产,成品检验记录列表 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 鲜奶生产,成品检验记录 + */ + @Override + public List selectNpFreshMilkInspList(NpFreshMilkInsp npFreshMilkInsp) + { + return npFreshMilkInspMapper.selectNpFreshMilkInspList(npFreshMilkInsp); + } + + /** + * 新增鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + @Override + public int insertNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp) + { + npFreshMilkInsp.setCreateTime(DateUtils.getNowDate()); + return npFreshMilkInspMapper.insertNpFreshMilkInsp(npFreshMilkInsp); + } + + /** + * 修改鲜奶生产,成品检验记录 + * + * @param npFreshMilkInsp 鲜奶生产,成品检验记录 + * @return 结果 + */ + @Override + public int updateNpFreshMilkInsp(NpFreshMilkInsp npFreshMilkInsp) + { + return npFreshMilkInspMapper.updateNpFreshMilkInsp(npFreshMilkInsp); + } + + /** + * 批量删除鲜奶生产,成品检验记录 + * + * @param ids 需要删除的鲜奶生产,成品检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpFreshMilkInspByIds(Long[] ids) + { + return npFreshMilkInspMapper.deleteNpFreshMilkInspByIds(ids); + } + + /** + * 删除鲜奶生产,成品检验记录信息 + * + * @param id 鲜奶生产,成品检验记录主键 + * @return 结果 + */ + @Override + public int deleteNpFreshMilkInspById(Long id) + { + return npFreshMilkInspMapper.deleteNpFreshMilkInspById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/freshMilkTest/NpFreshMilkInspMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/freshMilkTest/NpFreshMilkInspMapper.xml new file mode 100644 index 0000000..399c1cd --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/freshMilkTest/NpFreshMilkInspMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, source, datetime, fat, protein, non_fat, acidity, bacterial_colony_1, bacterial_colony_2, bacterial_colony_3, bacterial_colony_4, bacterial_colony_5, coli, lactoferrin, ig, commnet, create_by, create_time from np_fresh_milk_insp + + + + + + + + insert into np_fresh_milk_insp + + source, + datetime, + fat, + protein, + non_fat, + acidity, + bacterial_colony_1, + bacterial_colony_2, + bacterial_colony_3, + bacterial_colony_4, + bacterial_colony_5, + coli, + lactoferrin, + ig, + commnet, + create_by, + create_time, + + + #{source}, + #{datetime}, + #{fat}, + #{protein}, + #{nonFat}, + #{acidity}, + #{bacterialColony1}, + #{bacterialColony2}, + #{bacterialColony3}, + #{bacterialColony4}, + #{bacterialColony5}, + #{coli}, + #{lactoferrin}, + #{ig}, + #{commnet}, + #{createBy}, + #{createTime}, + + + + + update np_fresh_milk_insp + + source = #{source}, + datetime = #{datetime}, + fat = #{fat}, + protein = #{protein}, + non_fat = #{nonFat}, + acidity = #{acidity}, + bacterial_colony_1 = #{bacterialColony1}, + bacterial_colony_2 = #{bacterialColony2}, + bacterial_colony_3 = #{bacterialColony3}, + bacterial_colony_4 = #{bacterialColony4}, + bacterial_colony_5 = #{bacterialColony5}, + coli = #{coli}, + lactoferrin = #{lactoferrin}, + ig = #{ig}, + commnet = #{commnet}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from np_fresh_milk_insp where id = #{id} + + + + delete from np_fresh_milk_insp where id in + + #{id} + + + \ No newline at end of file