diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/controller/NpYogurtInspController.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/controller/NpYogurtInspController.java new file mode 100644 index 0000000..bcb7ed1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/controller/NpYogurtInspController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.dairyProducts.yogurtTest.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.yogurtTest.domain.NpYogurtInsp; +import com.zhyc.module.dairyProducts.yogurtTest.service.INpYogurtInspService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 酸奶生产,成品检疫记录Controller + * + * @author ruoyi + * @date 2025-07-17 + */ +@RestController +@RequestMapping("/yogurtTest/yogurtTest") +public class NpYogurtInspController extends BaseController +{ + @Autowired + private INpYogurtInspService npYogurtInspService; + + /** + * 查询酸奶生产,成品检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:list')") + @GetMapping("/list") + public TableDataInfo list(NpYogurtInsp npYogurtInsp) + { + startPage(); + List list = npYogurtInspService.selectNpYogurtInspList(npYogurtInsp); + return getDataTable(list); + } + + /** + * 导出酸奶生产,成品检疫记录列表 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:export')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, NpYogurtInsp npYogurtInsp) + { + List list = npYogurtInspService.selectNpYogurtInspList(npYogurtInsp); + ExcelUtil util = new ExcelUtil(NpYogurtInsp.class); + util.exportExcel(response, list, "酸奶生产,成品检疫记录数据"); + } + + /** + * 获取酸奶生产,成品检疫记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(npYogurtInspService.selectNpYogurtInspById(id)); + } + + /** + * 新增酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:add')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody NpYogurtInsp npYogurtInsp) + { + return toAjax(npYogurtInspService.insertNpYogurtInsp(npYogurtInsp)); + } + + /** + * 修改酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:edit')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody NpYogurtInsp npYogurtInsp) + { + return toAjax(npYogurtInspService.updateNpYogurtInsp(npYogurtInsp)); + } + + /** + * 删除酸奶生产,成品检疫记录 + */ + @PreAuthorize("@ss.hasPermi('yogurtTest:yogurtTest:remove')") + @Log(title = "酸奶生产,成品检疫记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(npYogurtInspService.deleteNpYogurtInspByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/domain/NpYogurtInsp.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/domain/NpYogurtInsp.java new file mode 100644 index 0000000..d3e6110 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/domain/NpYogurtInsp.java @@ -0,0 +1,268 @@ +package com.zhyc.module.dairyProducts.yogurtTest.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_yogurt_insp + * + * @author ruoyi + * @date 2025-07-17 + */ +public class NpYogurtInsp 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/g)_1 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialColony1; + + /** 菌落总数(CFU/g)_2 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony2; + + /** 菌落总数(CFU/g)_3 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony3; + + /** 菌落总数(CFU/g)_4 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony4; + + /** 菌落总数(CFU/g)_5 */ + @Excel(name = "菌落总数", readConverterExp = "C=FU/g") + private Double bacterialClony5; + + /** 酵母菌(CFU/g) */ + @Excel(name = "酵母菌(CFU/g)") + private Double yeast; + + /** 霉菌(CFU/g) */ + @Excel(name = "霉菌", readConverterExp = "C=FU/g") + private Double mould; + + /** 乳酸菌数(CFU/g) */ + @Excel(name = "乳酸菌数", readConverterExp = "C=FU/g") + private Double lacto; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + 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 setBacterialClony2(Double bacterialClony2) + { + this.bacterialClony2 = bacterialClony2; + } + + public Double getBacterialClony2() + { + return bacterialClony2; + } + + public void setBacterialClony3(Double bacterialClony3) + { + this.bacterialClony3 = bacterialClony3; + } + + public Double getBacterialClony3() + { + return bacterialClony3; + } + + public void setBacterialClony4(Double bacterialClony4) + { + this.bacterialClony4 = bacterialClony4; + } + + public Double getBacterialClony4() + { + return bacterialClony4; + } + + public void setBacterialClony5(Double bacterialClony5) + { + this.bacterialClony5 = bacterialClony5; + } + + public Double getBacterialClony5() + { + return bacterialClony5; + } + + public void setYeast(Double yeast) + { + this.yeast = yeast; + } + + public Double getYeast() + { + return yeast; + } + + public void setMould(Double mould) + { + this.mould = mould; + } + + public Double getMould() + { + return mould; + } + + public void setLacto(Double lacto) + { + this.lacto = lacto; + } + + public Double getLacto() + { + return lacto; + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return comment; + } + + @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("bacterialClony2", getBacterialClony2()) + .append("bacterialClony3", getBacterialClony3()) + .append("bacterialClony4", getBacterialClony4()) + .append("bacterialClony5", getBacterialClony5()) + .append("yeast", getYeast()) + .append("mould", getMould()) + .append("lacto", getLacto()) + .append("comment", getComment()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/mapper/NpYogurtInspMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/mapper/NpYogurtInspMapper.java new file mode 100644 index 0000000..6d0d8dd --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/mapper/NpYogurtInspMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.yogurtTest.mapper; + +import java.util.List; +import com.zhyc.module.dairyProducts.yogurtTest.domain.NpYogurtInsp; + +/** + * 酸奶生产,成品检疫记录Mapper接口 + * + * @author ruoyi + * @date 2025-07-17 + */ +public interface NpYogurtInspMapper +{ + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + public NpYogurtInsp selectNpYogurtInspById(Long id); + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录集合 + */ + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp); + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 删除酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + public int deleteNpYogurtInspById(Long id); + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNpYogurtInspByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/INpYogurtInspService.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/INpYogurtInspService.java new file mode 100644 index 0000000..b2f8201 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/INpYogurtInspService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.dairyProducts.yogurtTest.service; + +import java.util.List; +import com.zhyc.module.dairyProducts.yogurtTest.domain.NpYogurtInsp; + +/** + * 酸奶生产,成品检疫记录Service接口 + * + * @author ruoyi + * @date 2025-07-17 + */ +public interface INpYogurtInspService +{ + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + public NpYogurtInsp selectNpYogurtInspById(Long id); + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录集合 + */ + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp); + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp); + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的酸奶生产,成品检疫记录主键集合 + * @return 结果 + */ + public int deleteNpYogurtInspByIds(Long[] ids); + + /** + * 删除酸奶生产,成品检疫记录信息 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + public int deleteNpYogurtInspById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/impl/NpYogurtInspServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/impl/NpYogurtInspServiceImpl.java new file mode 100644 index 0000000..e9096cc --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/dairyProducts/yogurtTest/service/impl/NpYogurtInspServiceImpl.java @@ -0,0 +1,95 @@ +package com.zhyc.module.dairyProducts.yogurtTest.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.yogurtTest.mapper.NpYogurtInspMapper; +import com.zhyc.module.dairyProducts.yogurtTest.domain.NpYogurtInsp; +import com.zhyc.module.dairyProducts.yogurtTest.service.INpYogurtInspService; + +/** + * 酸奶生产,成品检疫记录Service业务层处理 + * + * @author ruoyi + * @date 2025-07-17 + */ +@Service +public class NpYogurtInspServiceImpl implements INpYogurtInspService +{ + @Autowired + private NpYogurtInspMapper npYogurtInspMapper; + + /** + * 查询酸奶生产,成品检疫记录 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 酸奶生产,成品检疫记录 + */ + @Override + public NpYogurtInsp selectNpYogurtInspById(Long id) + { + return npYogurtInspMapper.selectNpYogurtInspById(id); + } + + /** + * 查询酸奶生产,成品检疫记录列表 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 酸奶生产,成品检疫记录 + */ + @Override + public List selectNpYogurtInspList(NpYogurtInsp npYogurtInsp) + { + return npYogurtInspMapper.selectNpYogurtInspList(npYogurtInsp); + } + + /** + * 新增酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + @Override + public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp) + { + npYogurtInsp.setCreateTime(DateUtils.getNowDate()); + return npYogurtInspMapper.insertNpYogurtInsp(npYogurtInsp); + } + + /** + * 修改酸奶生产,成品检疫记录 + * + * @param npYogurtInsp 酸奶生产,成品检疫记录 + * @return 结果 + */ + @Override + public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp) + { + return npYogurtInspMapper.updateNpYogurtInsp(npYogurtInsp); + } + + /** + * 批量删除酸奶生产,成品检疫记录 + * + * @param ids 需要删除的酸奶生产,成品检疫记录主键 + * @return 结果 + */ + @Override + public int deleteNpYogurtInspByIds(Long[] ids) + { + return npYogurtInspMapper.deleteNpYogurtInspByIds(ids); + } + + /** + * 删除酸奶生产,成品检疫记录信息 + * + * @param id 酸奶生产,成品检疫记录主键 + * @return 结果 + */ + @Override + public int deleteNpYogurtInspById(Long id) + { + return npYogurtInspMapper.deleteNpYogurtInspById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/dairyProducts/yogurtTest/NpYogurtInspMapper.xml b/zhyc-module/src/main/resources/mapper/dairyProducts/yogurtTest/NpYogurtInspMapper.xml new file mode 100644 index 0000000..f1aa3c7 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/dairyProducts/yogurtTest/NpYogurtInspMapper.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, source, datetime, fat, protein, non_fat, acidity, bacterial_colony_1, bacterial_clony_2, bacterial_clony_3, bacterial_clony_4, bacterial_clony_5, yeast, mould, lacto, comment, create_by, create_time from np_yogurt_insp + + + + + + + + insert into np_yogurt_insp + + source, + datetime, + fat, + protein, + non_fat, + acidity, + bacterial_colony_1, + bacterial_clony_2, + bacterial_clony_3, + bacterial_clony_4, + bacterial_clony_5, + yeast, + mould, + lacto, + comment, + create_by, + create_time, + + + #{source}, + #{datetime}, + #{fat}, + #{protein}, + #{nonFat}, + #{acidity}, + #{bacterialColony1}, + #{bacterialClony2}, + #{bacterialClony3}, + #{bacterialClony4}, + #{bacterialClony5}, + #{yeast}, + #{mould}, + #{lacto}, + #{comment}, + #{createBy}, + #{createTime}, + + + + + update np_yogurt_insp + + source = #{source}, + datetime = #{datetime}, + fat = #{fat}, + protein = #{protein}, + non_fat = #{nonFat}, + acidity = #{acidity}, + bacterial_colony_1 = #{bacterialColony1}, + bacterial_clony_2 = #{bacterialClony2}, + bacterial_clony_3 = #{bacterialClony3}, + bacterial_clony_4 = #{bacterialClony4}, + bacterial_clony_5 = #{bacterialClony5}, + yeast = #{yeast}, + mould = #{mould}, + lacto = #{lacto}, + comment = #{comment}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from np_yogurt_insp where id = #{id} + + + + delete from np_yogurt_insp where id in + + #{id} + + + \ No newline at end of file