diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java index fdb90f6..8efc78e 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/controller/XzDryMatterCorrectionController.java @@ -21,6 +21,12 @@ import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService import com.zhyc.common.utils.poi.ExcelUtil; import com.zhyc.common.core.page.TableDataInfo; +/** + * 干物质校正Controller + * + * @author ruoyi + * @date 2025-07-12 + */ @RestController @RequestMapping("/dryMatterCorrection/dryMatterCorrection") public class XzDryMatterCorrectionController extends BaseController @@ -28,33 +34,34 @@ public class XzDryMatterCorrectionController extends BaseController @Autowired private IXzDryMatterCorrectionService xzDryMatterCorrectionService; + /** + * 查询干物质校正列表 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')") @GetMapping("/list") public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection) { - // 只保留年月查询条件,清空其他查询条件 - XzDryMatterCorrection query = new XzDryMatterCorrection(); - query.setDatetime(xzDryMatterCorrection.getDatetime()); - startPage(); - List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection); return getDataTable(list); } + /** + * 导出干物质校正列表 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')") @Log(title = "干物质校正", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection) { - // 只保留年月查询条件,清空其他查询条件 - XzDryMatterCorrection query = new XzDryMatterCorrection(); - query.setDatetime(xzDryMatterCorrection.getDatetime()); - - List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query); + List list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection); ExcelUtil util = new ExcelUtil(XzDryMatterCorrection.class); util.exportExcel(response, list, "干物质校正数据"); } + /** + * 获取干物质校正详细信息 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) @@ -62,6 +69,9 @@ public class XzDryMatterCorrectionController extends BaseController return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id)); } + /** + * 新增干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')") @Log(title = "干物质校正", businessType = BusinessType.INSERT) @PostMapping @@ -70,6 +80,9 @@ public class XzDryMatterCorrectionController extends BaseController return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection)); } + /** + * 修改干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')") @Log(title = "干物质校正", businessType = BusinessType.UPDATE) @PutMapping @@ -78,11 +91,14 @@ public class XzDryMatterCorrectionController extends BaseController return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection)); } + /** + * 删除干物质校正 + */ @PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')") @Log(title = "干物质校正", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids)); } -} \ No newline at end of file +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java index 15045a8..2bbb0d2 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/domain/XzDryMatterCorrection.java @@ -7,84 +7,40 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.zhyc.common.annotation.Excel; import com.zhyc.common.core.domain.BaseEntity; -/** - * 干物质校正对象 xz_dry_matter_correction - */ public class XzDryMatterCorrection extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键ID */ private Long id; - /** 年月 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "年月", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM") + @Excel(name = "年月", width = 30, dateFormat = "yyyy-MM") private Date datetime; - /** 厂区 */ @Excel(name = "厂区") private String factory; - /** 干物质含量 */ @Excel(name = "干物质含量") - private String content; + private Double content; - /** 干物质标准 */ @Excel(name = "干物质标准") - private String standard; + private Double standard; - /** 干物质系数 */ - @Excel(name = "干物质系数") // 移除了numFormat + @Excel(name = "干物质系数") private Double coefficient; - // Getter和Setter - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getDatetime() { - return datetime; - } - - public void setDatetime(Date datetime) { - this.datetime = datetime; - } - - public String getFactory() { - return factory; - } - - public void setFactory(String factory) { - this.factory = factory; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getStandard() { - return standard; - } - - public void setStandard(String standard) { - this.standard = standard; - } - - public Double getCoefficient() { - return coefficient; - } - - public void setCoefficient(Double coefficient) { - this.coefficient = coefficient; - } + // getters and setters... + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + public Date getDatetime() { return datetime; } + public void setDatetime(Date datetime) { this.datetime = datetime; } + public String getFactory() { return factory; } + public void setFactory(String factory) { this.factory = factory; } + public Double getContent() { return content; } + public void setContent(Double content) { this.content = content; } + public Double getStandard() { return standard; } + public void setStandard(Double standard) { this.standard = standard; } + public Double getCoefficient() { return coefficient; } + public void setCoefficient(Double coefficient) { this.coefficient = coefficient; } @Override public String toString() { diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java index 912eaab..123db3c 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/mapper/XzDryMatterCorrectionMapper.java @@ -7,7 +7,7 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; * 干物质校正Mapper接口 * * @author ruoyi - * @date 2025-07-11 + * @date 2025-07-12 */ public interface XzDryMatterCorrectionMapper { diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java index 90721f6..06359a9 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/IXzDryMatterCorrectionService.java @@ -5,15 +5,15 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; /** * 干物质校正Service接口 - * + * * @author ruoyi - * @date 2025-07-11 + * @date 2025-07-12 */ -public interface IXzDryMatterCorrectionService +public interface IXzDryMatterCorrectionService { /** * 查询干物质校正 - * + * * @param id 干物质校正主键 * @return 干物质校正 */ @@ -21,7 +21,7 @@ public interface IXzDryMatterCorrectionService /** * 查询干物质校正列表 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 干物质校正集合 */ @@ -29,7 +29,7 @@ public interface IXzDryMatterCorrectionService /** * 新增干物质校正 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IXzDryMatterCorrectionService /** * 修改干物质校正 - * + * * @param xzDryMatterCorrection 干物质校正 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IXzDryMatterCorrectionService /** * 批量删除干物质校正 - * + * * @param ids 需要删除的干物质校正主键集合 * @return 结果 */ @@ -53,7 +53,7 @@ public interface IXzDryMatterCorrectionService /** * 删除干物质校正信息 - * + * * @param id 干物质校正主键 * @return 结果 */ diff --git a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java index cb52506..948a2b6 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/dryMatterCorrection/service/impl/XzDryMatterCorrectionServiceImpl.java @@ -7,68 +7,87 @@ import com.zhyc.module.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper; import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection; import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService; +/** + * 干物质校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-12 + */ @Service -public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService { - +public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService +{ @Autowired private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper; + /** + * 查询干物质校正 + * + * @param id 干物质校正主键 + * @return 干物质校正 + */ @Override - public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) { + public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) + { return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id); } + /** + * 查询干物质校正列表 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 干物质校正 + */ @Override - public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) { + public List selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) + { return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection); } + /** + * 新增干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ @Override - public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { - calculateCoefficient(xzDryMatterCorrection); + public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) + { return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection); } + /** + * 修改干物质校正 + * + * @param xzDryMatterCorrection 干物质校正 + * @return 结果 + */ @Override - public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) { - calculateCoefficient(xzDryMatterCorrection); + public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) + { return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection); } + /** + * 批量删除干物质校正 + * + * @param ids 需要删除的干物质校正主键 + * @return 结果 + */ @Override - public int deleteXzDryMatterCorrectionByIds(Long[] ids) { + public int deleteXzDryMatterCorrectionByIds(Long[] ids) + { return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids); } + /** + * 删除干物质校正信息 + * + * @param id 干物质校正主键 + * @return 结果 + */ @Override - public int deleteXzDryMatterCorrectionById(Long id) { + public int deleteXzDryMatterCorrectionById(Long id) + { return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(id); } - - /** - * 计算干物质系数(含格式控制) - */ - private void calculateCoefficient(XzDryMatterCorrection xzDryMatterCorrection) { - if (xzDryMatterCorrection.getContent() != null && - xzDryMatterCorrection.getStandard() != null) { - try { - double content = Double.parseDouble(xzDryMatterCorrection.getContent()); - double standard = Double.parseDouble(xzDryMatterCorrection.getStandard()); - - if (standard != 0) { - double coefficient = content / standard; - // 手动控制4位小数(替代numFormat功能) - xzDryMatterCorrection.setCoefficient( - Double.parseDouble(String.format("%.4f", coefficient)) - ); - } else { - xzDryMatterCorrection.setCoefficient(null); - } - } catch (NumberFormatException e) { - xzDryMatterCorrection.setCoefficient(null); - } - } else { - xzDryMatterCorrection.setCoefficient(null); - } - } -} \ No newline at end of file +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/group_management/controller/BasSheepGroupController.java b/zhyc-module/src/main/java/com/zhyc/module/group_management/controller/BasSheepGroupController.java new file mode 100644 index 0000000..167dd65 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/group_management/controller/BasSheepGroupController.java @@ -0,0 +1,102 @@ +package com.zhyc.module.group_management.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.group_management.domain.BasSheepGroup; +import com.zhyc.module.group_management.service.IBasSheepGroupService; +import com.zhyc.common.utils.poi.ExcelUtil; + +/** + * 分组管理Controller + * + * @author wyt + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/group_management/group_management") +public class BasSheepGroupController extends BaseController +{ + @Autowired + private IBasSheepGroupService basSheepGroupService; + + /** + * 查询分组管理列表 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:list')") + @GetMapping("/list") + public AjaxResult list(BasSheepGroup basSheepGroup) + { + List list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup); + return success(list); + } + + /** + * 导出分组管理列表 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:export')") + @Log(title = "分组管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasSheepGroup basSheepGroup) + { + List list = basSheepGroupService.selectBasSheepGroupList(basSheepGroup); + ExcelUtil util = new ExcelUtil(BasSheepGroup.class); + util.exportExcel(response, list, "分组管理数据"); + } + + /** + * 获取分组管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:query')") + @GetMapping(value = "/{groupId}") + public AjaxResult getInfo(@PathVariable("groupId") Long groupId) + { + return success(basSheepGroupService.selectBasSheepGroupByGroupId(groupId)); + } + + /** + * 新增分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:add')") + @Log(title = "分组管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasSheepGroup basSheepGroup) + { + return toAjax(basSheepGroupService.insertBasSheepGroup(basSheepGroup)); + } + + /** + * 修改分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:edit')") + @Log(title = "分组管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasSheepGroup basSheepGroup) + { + return toAjax(basSheepGroupService.updateBasSheepGroup(basSheepGroup)); + } + + /** + * 删除分组管理 + */ + @PreAuthorize("@ss.hasPermi('group_management:group_management:remove')") + @Log(title = "分组管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{groupIds}") + public AjaxResult remove(@PathVariable Long[] groupIds) + { + return toAjax(basSheepGroupService.deleteBasSheepGroupByGroupIds(groupIds)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/group_management/domain/BasSheepGroup.java b/zhyc-module/src/main/java/com/zhyc/module/group_management/domain/BasSheepGroup.java new file mode 100644 index 0000000..09ac54e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/group_management/domain/BasSheepGroup.java @@ -0,0 +1,74 @@ +package com.zhyc.module.group_management.domain; + +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.TreeEntity; + +/** + * 分组管理对象 bas_sheep_group + * + * @author wyt + * @date 2025-07-14 + */ +public class BasSheepGroup extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** 分组ID */ + @Excel(name = "分组ID") + private Long groupId; + + /** 分组名称 */ + @Excel(name = "分组名称") + private String groupName; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + public void setGroupId(Long groupId) + { + this.groupId = groupId; + } + + public Long getGroupId() + { + return groupId; + } + + public void setGroupName(String groupName) + { + this.groupName = groupName; + } + + public String getGroupName() + { + return groupName; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("groupId", getGroupId()) + .append("parentId", getParentId()) + .append("groupName", getGroupName()) + .append("ancestors", getAncestors()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/group_management/mapper/BasSheepGroupMapper.java b/zhyc-module/src/main/java/com/zhyc/module/group_management/mapper/BasSheepGroupMapper.java new file mode 100644 index 0000000..d3b2bf0 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/group_management/mapper/BasSheepGroupMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.group_management.mapper; + +import java.util.List; +import com.zhyc.module.group_management.domain.BasSheepGroup; + +/** + * 分组管理Mapper接口 + * + * @author wyt + * @date 2025-07-14 + */ +public interface BasSheepGroupMapper +{ + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId); + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理集合 + */ + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup); + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int insertBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int updateBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 删除分组管理 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupId(Long groupId); + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupIds(Long[] groupIds); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/group_management/service/IBasSheepGroupService.java b/zhyc-module/src/main/java/com/zhyc/module/group_management/service/IBasSheepGroupService.java new file mode 100644 index 0000000..ec68f13 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/group_management/service/IBasSheepGroupService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.group_management.service; + +import java.util.List; +import com.zhyc.module.group_management.domain.BasSheepGroup; + +/** + * 分组管理Service接口 + * + * @author wyt + * @date 2025-07-14 + */ +public interface IBasSheepGroupService +{ + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId); + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理集合 + */ + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup); + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int insertBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + public int updateBasSheepGroup(BasSheepGroup basSheepGroup); + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的分组管理主键集合 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupIds(Long[] groupIds); + + /** + * 删除分组管理信息 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + public int deleteBasSheepGroupByGroupId(Long groupId); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/group_management/service/impl/BasSheepGroupServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/group_management/service/impl/BasSheepGroupServiceImpl.java new file mode 100644 index 0000000..9543e9e --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/group_management/service/impl/BasSheepGroupServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.group_management.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.group_management.mapper.BasSheepGroupMapper; +import com.zhyc.module.group_management.domain.BasSheepGroup; +import com.zhyc.module.group_management.service.IBasSheepGroupService; + +/** + * 分组管理Service业务层处理 + * + * @author wyt + * @date 2025-07-14 + */ +@Service +public class BasSheepGroupServiceImpl implements IBasSheepGroupService +{ + @Autowired + private BasSheepGroupMapper basSheepGroupMapper; + + /** + * 查询分组管理 + * + * @param groupId 分组管理主键 + * @return 分组管理 + */ + @Override + public BasSheepGroup selectBasSheepGroupByGroupId(Long groupId) + { + return basSheepGroupMapper.selectBasSheepGroupByGroupId(groupId); + } + + /** + * 查询分组管理列表 + * + * @param basSheepGroup 分组管理 + * @return 分组管理 + */ + @Override + public List selectBasSheepGroupList(BasSheepGroup basSheepGroup) + { + return basSheepGroupMapper.selectBasSheepGroupList(basSheepGroup); + } + + /** + * 新增分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + @Override + public int insertBasSheepGroup(BasSheepGroup basSheepGroup) + { + basSheepGroup.setCreateTime(DateUtils.getNowDate()); + return basSheepGroupMapper.insertBasSheepGroup(basSheepGroup); + } + + /** + * 修改分组管理 + * + * @param basSheepGroup 分组管理 + * @return 结果 + */ + @Override + public int updateBasSheepGroup(BasSheepGroup basSheepGroup) + { + basSheepGroup.setUpdateTime(DateUtils.getNowDate()); + return basSheepGroupMapper.updateBasSheepGroup(basSheepGroup); + } + + /** + * 批量删除分组管理 + * + * @param groupIds 需要删除的分组管理主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupByGroupIds(Long[] groupIds) + { + return basSheepGroupMapper.deleteBasSheepGroupByGroupIds(groupIds); + } + + /** + * 删除分组管理信息 + * + * @param groupId 分组管理主键 + * @return 结果 + */ + @Override + public int deleteBasSheepGroupByGroupId(Long groupId) + { + return basSheepGroupMapper.deleteBasSheepGroupByGroupId(groupId); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/controller/XzParityCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/controller/XzParityCorrectionController.java new file mode 100644 index 0000000..fbecfc9 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/controller/XzParityCorrectionController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.parityCorrection.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.parityCorrection.domain.XzParityCorrection; +import com.zhyc.module.parityCorrection.service.IXzParityCorrectionService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 胎次校正Controller + * + * @author ruoyi + * @date 2025-07-14 + */ +@RestController +@RequestMapping("/parityCorrection/parityCorrection") +public class XzParityCorrectionController extends BaseController +{ + @Autowired + private IXzParityCorrectionService xzParityCorrectionService; + + /** + * 查询胎次校正列表 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:list')") + @GetMapping("/list") + public TableDataInfo list(XzParityCorrection xzParityCorrection) + { + startPage(); + List list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection); + return getDataTable(list); + } + + /** + * 导出胎次校正列表 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:export')") + @Log(title = "胎次校正", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XzParityCorrection xzParityCorrection) + { + List list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection); + ExcelUtil util = new ExcelUtil(XzParityCorrection.class); + util.exportExcel(response, list, "胎次校正数据"); + } + + /** + * 获取胎次校正详细信息 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(xzParityCorrectionService.selectXzParityCorrectionById(id)); + } + + /** + * 新增胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:add')") + @Log(title = "胎次校正", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XzParityCorrection xzParityCorrection) + { + return toAjax(xzParityCorrectionService.insertXzParityCorrection(xzParityCorrection)); + } + + /** + * 修改胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:edit')") + @Log(title = "胎次校正", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XzParityCorrection xzParityCorrection) + { + return toAjax(xzParityCorrectionService.updateXzParityCorrection(xzParityCorrection)); + } + + /** + * 删除胎次校正 + */ + @PreAuthorize("@ss.hasPermi('parityCorrection:parityCorrection:remove')") + @Log(title = "胎次校正", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(xzParityCorrectionService.deleteXzParityCorrectionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/domain/XzParityCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/domain/XzParityCorrection.java new file mode 100644 index 0000000..107b070 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/domain/XzParityCorrection.java @@ -0,0 +1,67 @@ +package com.zhyc.module.parityCorrection.domain; + +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; + +/** + * 胎次校正对象 xz_parity_correction + * + * @author ruoyi + * @date 2025-07-14 + */ +public class XzParityCorrection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 胎次 */ + @Excel(name = "胎次") + private Integer parity; + + /** 系数 */ + @Excel(name = "系数") + private Double coef; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setParity(Integer parity) + { + this.parity = parity; + } + + public Integer getParity() + { + return parity; + } + + public void setCoef(Double coef) + { + this.coef = coef; + } + + public Double getCoef() + { + return coef; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parity", getParity()) + .append("coef", getCoef()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/mapper/XzParityCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/mapper/XzParityCorrectionMapper.java new file mode 100644 index 0000000..ff6a1b4 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/mapper/XzParityCorrectionMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.parityCorrection.mapper; + +import java.util.List; +import com.zhyc.module.parityCorrection.domain.XzParityCorrection; + +/** + * 胎次校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface XzParityCorrectionMapper +{ + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + public XzParityCorrection selectXzParityCorrectionById(Long id); + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正集合 + */ + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection); + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 删除胎次校正 + * + * @param id 胎次校正主键 + * @return 结果 + */ + public int deleteXzParityCorrectionById(Long id); + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXzParityCorrectionByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/IXzParityCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/IXzParityCorrectionService.java new file mode 100644 index 0000000..7845899 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/IXzParityCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.parityCorrection.service; + +import java.util.List; +import com.zhyc.module.parityCorrection.domain.XzParityCorrection; + +/** + * 胎次校正Service接口 + * + * @author ruoyi + * @date 2025-07-14 + */ +public interface IXzParityCorrectionService +{ + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + public XzParityCorrection selectXzParityCorrectionById(Long id); + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正集合 + */ + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection); + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection); + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的胎次校正主键集合 + * @return 结果 + */ + public int deleteXzParityCorrectionByIds(Long[] ids); + + /** + * 删除胎次校正信息 + * + * @param id 胎次校正主键 + * @return 结果 + */ + public int deleteXzParityCorrectionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java new file mode 100644 index 0000000..7f97f3f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/parityCorrection/service/impl/XzParityCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.parityCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.parityCorrection.mapper.XzParityCorrectionMapper; +import com.zhyc.module.parityCorrection.domain.XzParityCorrection; +import com.zhyc.module.parityCorrection.service.IXzParityCorrectionService; + +/** + * 胎次校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-14 + */ +@Service +public class XzParityCorrectionServiceImpl implements IXzParityCorrectionService +{ + @Autowired + private XzParityCorrectionMapper xzParityCorrectionMapper; + + /** + * 查询胎次校正 + * + * @param id 胎次校正主键 + * @return 胎次校正 + */ + @Override + public XzParityCorrection selectXzParityCorrectionById(Long id) + { + return xzParityCorrectionMapper.selectXzParityCorrectionById(id); + } + + /** + * 查询胎次校正列表 + * + * @param xzParityCorrection 胎次校正 + * @return 胎次校正 + */ + @Override + public List selectXzParityCorrectionList(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.selectXzParityCorrectionList(xzParityCorrection); + } + + /** + * 新增胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + @Override + public int insertXzParityCorrection(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.insertXzParityCorrection(xzParityCorrection); + } + + /** + * 修改胎次校正 + * + * @param xzParityCorrection 胎次校正 + * @return 结果 + */ + @Override + public int updateXzParityCorrection(XzParityCorrection xzParityCorrection) + { + return xzParityCorrectionMapper.updateXzParityCorrection(xzParityCorrection); + } + + /** + * 批量删除胎次校正 + * + * @param ids 需要删除的胎次校正主键 + * @return 结果 + */ + @Override + public int deleteXzParityCorrectionByIds(Long[] ids) + { + return xzParityCorrectionMapper.deleteXzParityCorrectionByIds(ids); + } + + /** + * 删除胎次校正信息 + * + * @param id 胎次校正主键 + * @return 结果 + */ + @Override + public int deleteXzParityCorrectionById(Long id) + { + return xzParityCorrectionMapper.deleteXzParityCorrectionById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/controller/XzWegihCorrectionController.java b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/controller/XzWegihCorrectionController.java new file mode 100644 index 0000000..ea692ab --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/controller/XzWegihCorrectionController.java @@ -0,0 +1,104 @@ +package com.zhyc.module.weightCorrection.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.weightCorrection.domain.XzWegihCorrection; +import com.zhyc.module.weightCorrection.service.IXzWegihCorrectionService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 称重校正Controller + * + * @author ruoyi + * @date 2025-07-12 + */ +@RestController +@RequestMapping("/weightCorrection/weightCorrection") +public class XzWegihCorrectionController extends BaseController +{ + @Autowired + private IXzWegihCorrectionService xzWegihCorrectionService; + + /** + * 查询称重校正列表 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:list')") + @GetMapping("/list") + public TableDataInfo list(XzWegihCorrection xzWegihCorrection) + { + startPage(); + List list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection); + return getDataTable(list); + } + + /** + * 导出称重校正列表 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:export')") + @Log(title = "称重校正", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XzWegihCorrection xzWegihCorrection) + { + List list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection); + ExcelUtil util = new ExcelUtil(XzWegihCorrection.class); + util.exportExcel(response, list, "称重校正数据"); + } + + /** + * 获取称重校正详细信息 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(xzWegihCorrectionService.selectXzWegihCorrectionById(id)); + } + + /** + * 新增称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:add')") + @Log(title = "称重校正", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XzWegihCorrection xzWegihCorrection) + { + return toAjax(xzWegihCorrectionService.insertXzWegihCorrection(xzWegihCorrection)); + } + + /** + * 修改称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:edit')") + @Log(title = "称重校正", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XzWegihCorrection xzWegihCorrection) + { + return toAjax(xzWegihCorrectionService.updateXzWegihCorrection(xzWegihCorrection)); + } + + /** + * 删除称重校正 + */ + @PreAuthorize("@ss.hasPermi('weightCorrection:weightCorrection:remove')") + @Log(title = "称重校正", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(xzWegihCorrectionService.deleteXzWegihCorrectionByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/domain/XzWegihCorrection.java b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/domain/XzWegihCorrection.java new file mode 100644 index 0000000..f3c3d6b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/domain/XzWegihCorrection.java @@ -0,0 +1,113 @@ +package com.zhyc.module.weightCorrection.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; + +/** + * 称重校正对象 xz_wegih_correction + * + * @author ruoyi + * @date 2025-07-12 + */ +public class XzWegihCorrection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date datetime; + + /** 厂区 */ + @Excel(name = "厂区") + private String factory; + + /** 实际奶量 */ + @Excel(name = "实际奶量") + private Double actual; + + /** 系统奶量 */ + @Excel(name = "系统奶量") + private Double systemMilk; // 修改字段名 + + /** 称重系数(计算字段) */ + @Excel(name = "称重系数") + private Double coefficient; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setDatetime(Date datetime) + { + this.datetime = datetime; + } + + public Date getDatetime() + { + return datetime; + } + + public void setFactory(String factory) + { + this.factory = factory; + } + + public String getFactory() + { + return factory; + } + + public void setActual(Double actual) + { + this.actual = actual; + } + + public Double getActual() + { + return actual; + } + + public void setSystemMilk(Double systemMilk) + { + this.systemMilk = systemMilk; + } + + public Double getSystemMilk() + { + return systemMilk; + } + + public Double getCoefficient() { + return coefficient; + } + + public void setCoefficient(Double coefficient) { + this.coefficient = coefficient; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("datetime", getDatetime()) + .append("factory", getFactory()) + .append("actual", getActual()) + .append("systemMilk", getSystemMilk()) + .append("coefficient", getCoefficient()) + .toString(); + } +} \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/mapper/XzWegihCorrectionMapper.java b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/mapper/XzWegihCorrectionMapper.java new file mode 100644 index 0000000..1b92971 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/mapper/XzWegihCorrectionMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.weightCorrection.mapper; + +import java.util.List; +import com.zhyc.module.weightCorrection.domain.XzWegihCorrection; + +/** + * 称重校正Mapper接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface XzWegihCorrectionMapper +{ + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + public XzWegihCorrection selectXzWegihCorrectionById(Long id); + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正集合 + */ + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection); + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 删除称重校正 + * + * @param id 称重校正主键 + * @return 结果 + */ + public int deleteXzWegihCorrectionById(Long id); + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXzWegihCorrectionByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/IXzWegihCorrectionService.java b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/IXzWegihCorrectionService.java new file mode 100644 index 0000000..57c2144 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/IXzWegihCorrectionService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.weightCorrection.service; + +import java.util.List; +import com.zhyc.module.weightCorrection.domain.XzWegihCorrection; + +/** + * 称重校正Service接口 + * + * @author ruoyi + * @date 2025-07-12 + */ +public interface IXzWegihCorrectionService +{ + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + public XzWegihCorrection selectXzWegihCorrectionById(Long id); + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正集合 + */ + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection); + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection); + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的称重校正主键集合 + * @return 结果 + */ + public int deleteXzWegihCorrectionByIds(Long[] ids); + + /** + * 删除称重校正信息 + * + * @param id 称重校正主键 + * @return 结果 + */ + public int deleteXzWegihCorrectionById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java new file mode 100644 index 0000000..b69187a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/weightCorrection/service/impl/XzWegihCorrectionServiceImpl.java @@ -0,0 +1,93 @@ +package com.zhyc.module.weightCorrection.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.weightCorrection.mapper.XzWegihCorrectionMapper; +import com.zhyc.module.weightCorrection.domain.XzWegihCorrection; +import com.zhyc.module.weightCorrection.service.IXzWegihCorrectionService; + +/** + * 称重校正Service业务层处理 + * + * @author ruoyi + * @date 2025-07-12 + */ +@Service +public class XzWegihCorrectionServiceImpl implements IXzWegihCorrectionService +{ + @Autowired + private XzWegihCorrectionMapper xzWegihCorrectionMapper; + + /** + * 查询称重校正 + * + * @param id 称重校正主键 + * @return 称重校正 + */ + @Override + public XzWegihCorrection selectXzWegihCorrectionById(Long id) + { + return xzWegihCorrectionMapper.selectXzWegihCorrectionById(id); + } + + /** + * 查询称重校正列表 + * + * @param xzWegihCorrection 称重校正 + * @return 称重校正 + */ + @Override + public List selectXzWegihCorrectionList(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.selectXzWegihCorrectionList(xzWegihCorrection); + } + + /** + * 新增称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + @Override + public int insertXzWegihCorrection(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.insertXzWegihCorrection(xzWegihCorrection); + } + + /** + * 修改称重校正 + * + * @param xzWegihCorrection 称重校正 + * @return 结果 + */ + @Override + public int updateXzWegihCorrection(XzWegihCorrection xzWegihCorrection) + { + return xzWegihCorrectionMapper.updateXzWegihCorrection(xzWegihCorrection); + } + + /** + * 批量删除称重校正 + * + * @param ids 需要删除的称重校正主键 + * @return 结果 + */ + @Override + public int deleteXzWegihCorrectionByIds(Long[] ids) + { + return xzWegihCorrectionMapper.deleteXzWegihCorrectionByIds(ids); + } + + /** + * 删除称重校正信息 + * + * @param id 称重校正主键 + * @return 结果 + */ + @Override + public int deleteXzWegihCorrectionById(Long id) + { + return xzWegihCorrectionMapper.deleteXzWegihCorrectionById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml index 6d36991..0e4e33c 100644 --- a/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml +++ b/zhyc-module/src/main/resources/mapper/dryMatterCorrection/XzDryMatterCorrectionMapper.xml @@ -14,57 +14,65 @@ - select id, datetime, factory, content, standard, coefficient from xz_dry_matter_correction + SELECT + id, + datetime, + factory, + content, + standard, + CASE + WHEN standard = 0 OR standard IS NULL THEN NULL + ELSE content / standard + END AS coefficient + FROM xz_dry_matter_correction - insert into xz_dry_matter_correction + INSERT INTO xz_dry_matter_correction - datetime, - factory, - content, - standard, - coefficient, + datetime, factory, content, standard - - #{datetime}, - #{factory}, - #{content}, - #{standard}, - #{coefficient}, + + #{datetime}, #{factory}, #{content}, #{standard} - update xz_dry_matter_correction - + UPDATE xz_dry_matter_correction + datetime = #{datetime}, factory = #{factory}, content = #{content}, standard = #{standard}, - coefficient = #{coefficient}, - - where id = #{id} + + WHERE id = #{id} - delete from xz_dry_matter_correction where id = #{id} + DELETE FROM xz_dry_matter_correction WHERE id = #{id} - - delete from xz_dry_matter_correction where id in + + DELETE FROM xz_dry_matter_correction WHERE id IN #{id} diff --git a/zhyc-module/src/main/resources/mapper/group_management/BasSheepGroupMapper.xml b/zhyc-module/src/main/resources/mapper/group_management/BasSheepGroupMapper.xml new file mode 100644 index 0000000..cf8ba5e --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/group_management/BasSheepGroupMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + select group_id, parent_id, group_name, ancestors, status, create_by, create_time, update_by, update_time from bas_sheep_group + + + + + + + + insert into bas_sheep_group + + parent_id, + group_name, + ancestors, + status, + create_by, + create_time, + update_by, + update_time, + + + #{parentId}, + #{groupName}, + #{ancestors}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update bas_sheep_group + + parent_id = #{parentId}, + group_name = #{groupName}, + ancestors = #{ancestors}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where group_id = #{groupId} + + + + delete from bas_sheep_group where group_id = #{groupId} + + + + delete from bas_sheep_group where group_id in + + #{groupId} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/parityCorrection/XzParityCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/parityCorrection/XzParityCorrectionMapper.xml new file mode 100644 index 0000000..217cd7d --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/parityCorrection/XzParityCorrectionMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + select id, parity, coef from xz_parity_correction + + + + + + + + insert into xz_parity_correction + + parity, + coef, + + + #{parity}, + #{coef}, + + + + + update xz_parity_correction + + parity = #{parity}, + coef = #{coef}, + + where id = #{id} + + + + delete from xz_parity_correction where id = #{id} + + + + delete from xz_parity_correction where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/weightCorrection/XzWegihCorrectionMapper.xml b/zhyc-module/src/main/resources/mapper/weightCorrection/XzWegihCorrectionMapper.xml new file mode 100644 index 0000000..6c19408 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/weightCorrection/XzWegihCorrectionMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + select + id, + datetime, + factory, + actual, + system_milk, + CASE + WHEN system_milk = 0 THEN 0 + ELSE ROUND(actual / system_milk, 4) + END as coefficient + from xz_wegih_correction + + + + + + + + insert into xz_wegih_correction + + datetime, + factory, + actual, + system_milk, + + + #{datetime}, + #{factory}, + #{actual}, + #{systemMilk}, + + + + + update xz_wegih_correction + + datetime = #{datetime}, + factory = #{factory}, + actual = #{actual}, + system_milk = #{systemMilk}, + + where id = #{id} + + + + delete from xz_wegih_correction where id = #{id} + + + + delete from xz_wegih_correction where id in + + #{id} + + + \ No newline at end of file