Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
9671eeabc3
@ -21,6 +21,12 @@ import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService
|
|||||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||||
import com.zhyc.common.core.page.TableDataInfo;
|
import com.zhyc.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干物质校正Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-12
|
||||||
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/dryMatterCorrection/dryMatterCorrection")
|
@RequestMapping("/dryMatterCorrection/dryMatterCorrection")
|
||||||
public class XzDryMatterCorrectionController extends BaseController
|
public class XzDryMatterCorrectionController extends BaseController
|
||||||
@ -28,33 +34,34 @@ public class XzDryMatterCorrectionController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IXzDryMatterCorrectionService xzDryMatterCorrectionService;
|
private IXzDryMatterCorrectionService xzDryMatterCorrectionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询干物质校正列表
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection)
|
public TableDataInfo list(XzDryMatterCorrection xzDryMatterCorrection)
|
||||||
{
|
{
|
||||||
// 只保留年月查询条件,清空其他查询条件
|
|
||||||
XzDryMatterCorrection query = new XzDryMatterCorrection();
|
|
||||||
query.setDatetime(xzDryMatterCorrection.getDatetime());
|
|
||||||
|
|
||||||
startPage();
|
startPage();
|
||||||
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query);
|
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出干物质校正列表
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:export')")
|
||||||
@Log(title = "干物质校正", businessType = BusinessType.EXPORT)
|
@Log(title = "干物质校正", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection)
|
public void export(HttpServletResponse response, XzDryMatterCorrection xzDryMatterCorrection)
|
||||||
{
|
{
|
||||||
// 只保留年月查询条件,清空其他查询条件
|
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
|
||||||
XzDryMatterCorrection query = new XzDryMatterCorrection();
|
|
||||||
query.setDatetime(xzDryMatterCorrection.getDatetime());
|
|
||||||
|
|
||||||
List<XzDryMatterCorrection> list = xzDryMatterCorrectionService.selectXzDryMatterCorrectionList(query);
|
|
||||||
ExcelUtil<XzDryMatterCorrection> util = new ExcelUtil<XzDryMatterCorrection>(XzDryMatterCorrection.class);
|
ExcelUtil<XzDryMatterCorrection> util = new ExcelUtil<XzDryMatterCorrection>(XzDryMatterCorrection.class);
|
||||||
util.exportExcel(response, list, "干物质校正数据");
|
util.exportExcel(response, list, "干物质校正数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取干物质校正详细信息
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:query')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
@ -62,6 +69,9 @@ public class XzDryMatterCorrectionController extends BaseController
|
|||||||
return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id));
|
return success(xzDryMatterCorrectionService.selectXzDryMatterCorrectionById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增干物质校正
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:add')")
|
||||||
@Log(title = "干物质校正", businessType = BusinessType.INSERT)
|
@Log(title = "干物质校正", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ -70,6 +80,9 @@ public class XzDryMatterCorrectionController extends BaseController
|
|||||||
return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection));
|
return toAjax(xzDryMatterCorrectionService.insertXzDryMatterCorrection(xzDryMatterCorrection));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改干物质校正
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:edit')")
|
||||||
@Log(title = "干物质校正", businessType = BusinessType.UPDATE)
|
@Log(title = "干物质校正", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ -78,9 +91,12 @@ public class XzDryMatterCorrectionController extends BaseController
|
|||||||
return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection));
|
return toAjax(xzDryMatterCorrectionService.updateXzDryMatterCorrection(xzDryMatterCorrection));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除干物质校正
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')")
|
@PreAuthorize("@ss.hasPermi('dryMatterCorrection:dryMatterCorrection:remove')")
|
||||||
@Log(title = "干物质校正", businessType = BusinessType.DELETE)
|
@Log(title = "干物质校正", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids));
|
return toAjax(xzDryMatterCorrectionService.deleteXzDryMatterCorrectionByIds(ids));
|
||||||
|
@ -7,84 +7,40 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||||||
import com.zhyc.common.annotation.Excel;
|
import com.zhyc.common.annotation.Excel;
|
||||||
import com.zhyc.common.core.domain.BaseEntity;
|
import com.zhyc.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
|
||||||
* 干物质校正对象 xz_dry_matter_correction
|
|
||||||
*/
|
|
||||||
public class XzDryMatterCorrection extends BaseEntity {
|
public class XzDryMatterCorrection extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 主键ID */
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 年月 */
|
@JsonFormat(pattern = "yyyy-MM")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@Excel(name = "年月", width = 30, dateFormat = "yyyy-MM")
|
||||||
@Excel(name = "年月", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date datetime;
|
private Date datetime;
|
||||||
|
|
||||||
/** 厂区 */
|
|
||||||
@Excel(name = "厂区")
|
@Excel(name = "厂区")
|
||||||
private String factory;
|
private String factory;
|
||||||
|
|
||||||
/** 干物质含量 */
|
|
||||||
@Excel(name = "干物质含量")
|
@Excel(name = "干物质含量")
|
||||||
private String content;
|
private Double content;
|
||||||
|
|
||||||
/** 干物质标准 */
|
|
||||||
@Excel(name = "干物质标准")
|
@Excel(name = "干物质标准")
|
||||||
private String standard;
|
private Double standard;
|
||||||
|
|
||||||
/** 干物质系数 */
|
@Excel(name = "干物质系数")
|
||||||
@Excel(name = "干物质系数") // 移除了numFormat
|
|
||||||
private Double coefficient;
|
private Double coefficient;
|
||||||
|
|
||||||
// Getter和Setter
|
// getters and setters...
|
||||||
public Long getId() {
|
public Long getId() { return id; }
|
||||||
return id;
|
public void setId(Long id) { this.id = id; }
|
||||||
}
|
public Date getDatetime() { return datetime; }
|
||||||
|
public void setDatetime(Date datetime) { this.datetime = datetime; }
|
||||||
public void setId(Long id) {
|
public String getFactory() { return factory; }
|
||||||
this.id = id;
|
public void setFactory(String factory) { this.factory = factory; }
|
||||||
}
|
public Double getContent() { return content; }
|
||||||
|
public void setContent(Double content) { this.content = content; }
|
||||||
public Date getDatetime() {
|
public Double getStandard() { return standard; }
|
||||||
return datetime;
|
public void setStandard(Double standard) { this.standard = standard; }
|
||||||
}
|
public Double getCoefficient() { return coefficient; }
|
||||||
|
public void setCoefficient(Double coefficient) { this.coefficient = coefficient; }
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -7,7 +7,7 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
|
|||||||
* 干物质校正Mapper接口
|
* 干物质校正Mapper接口
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-07-11
|
* @date 2025-07-12
|
||||||
*/
|
*/
|
||||||
public interface XzDryMatterCorrectionMapper
|
public interface XzDryMatterCorrectionMapper
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
|
|||||||
* 干物质校正Service接口
|
* 干物质校正Service接口
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-07-11
|
* @date 2025-07-12
|
||||||
*/
|
*/
|
||||||
public interface IXzDryMatterCorrectionService
|
public interface IXzDryMatterCorrectionService
|
||||||
{
|
{
|
||||||
|
@ -7,68 +7,87 @@ import com.zhyc.module.dryMatterCorrection.mapper.XzDryMatterCorrectionMapper;
|
|||||||
import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
|
import com.zhyc.module.dryMatterCorrection.domain.XzDryMatterCorrection;
|
||||||
import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService;
|
import com.zhyc.module.dryMatterCorrection.service.IXzDryMatterCorrectionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干物质校正Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-12
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService {
|
public class XzDryMatterCorrectionServiceImpl implements IXzDryMatterCorrectionService
|
||||||
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper;
|
private XzDryMatterCorrectionMapper xzDryMatterCorrectionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询干物质校正
|
||||||
|
*
|
||||||
|
* @param id 干物质校正主键
|
||||||
|
* @return 干物质校正
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id) {
|
public XzDryMatterCorrection selectXzDryMatterCorrectionById(Long id)
|
||||||
|
{
|
||||||
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id);
|
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询干物质校正列表
|
||||||
|
*
|
||||||
|
* @param xzDryMatterCorrection 干物质校正
|
||||||
|
* @return 干物质校正
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<XzDryMatterCorrection> selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection) {
|
public List<XzDryMatterCorrection> selectXzDryMatterCorrectionList(XzDryMatterCorrection xzDryMatterCorrection)
|
||||||
|
{
|
||||||
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
|
return xzDryMatterCorrectionMapper.selectXzDryMatterCorrectionList(xzDryMatterCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增干物质校正
|
||||||
|
*
|
||||||
|
* @param xzDryMatterCorrection 干物质校正
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) {
|
public int insertXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection)
|
||||||
calculateCoefficient(xzDryMatterCorrection);
|
{
|
||||||
return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection);
|
return xzDryMatterCorrectionMapper.insertXzDryMatterCorrection(xzDryMatterCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改干物质校正
|
||||||
|
*
|
||||||
|
* @param xzDryMatterCorrection 干物质校正
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection) {
|
public int updateXzDryMatterCorrection(XzDryMatterCorrection xzDryMatterCorrection)
|
||||||
calculateCoefficient(xzDryMatterCorrection);
|
{
|
||||||
return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection);
|
return xzDryMatterCorrectionMapper.updateXzDryMatterCorrection(xzDryMatterCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除干物质校正
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的干物质校正主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteXzDryMatterCorrectionByIds(Long[] ids) {
|
public int deleteXzDryMatterCorrectionByIds(Long[] ids)
|
||||||
|
{
|
||||||
return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids);
|
return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除干物质校正信息
|
||||||
|
*
|
||||||
|
* @param id 干物质校正主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteXzDryMatterCorrectionById(Long id) {
|
public int deleteXzDryMatterCorrectionById(Long id)
|
||||||
|
{
|
||||||
return xzDryMatterCorrectionMapper.deleteXzDryMatterCorrectionById(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -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<XzParityCorrection> 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<XzParityCorrection> list = xzParityCorrectionService.selectXzParityCorrectionList(xzParityCorrection);
|
||||||
|
ExcelUtil<XzParityCorrection> util = new ExcelUtil<XzParityCorrection>(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));
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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<XzParityCorrection> 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);
|
||||||
|
}
|
@ -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<XzParityCorrection> 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);
|
||||||
|
}
|
@ -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<XzParityCorrection> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -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<XzWegihCorrection> 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<XzWegihCorrection> list = xzWegihCorrectionService.selectXzWegihCorrectionList(xzWegihCorrection);
|
||||||
|
ExcelUtil<XzWegihCorrection> util = new ExcelUtil<XzWegihCorrection>(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));
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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<XzWegihCorrection> 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);
|
||||||
|
}
|
@ -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<XzWegihCorrection> 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);
|
||||||
|
}
|
@ -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<XzWegihCorrection> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -14,57 +14,65 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectXzDryMatterCorrectionVo">
|
<sql id="selectXzDryMatterCorrectionVo">
|
||||||
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
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectXzDryMatterCorrectionList" parameterType="XzDryMatterCorrection" resultMap="XzDryMatterCorrectionResult">
|
<select id="selectXzDryMatterCorrectionList" parameterType="XzDryMatterCorrection" resultMap="XzDryMatterCorrectionResult">
|
||||||
<include refid="selectXzDryMatterCorrectionVo"/>
|
<include refid="selectXzDryMatterCorrectionVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="datetime != null "> and datetime = #{datetime}</if>
|
<if test="datetime != null">
|
||||||
|
AND DATE_FORMAT(datetime, '%Y-%m') = DATE_FORMAT(#{datetime}, '%Y-%m')
|
||||||
|
</if>
|
||||||
|
<if test="factory != null and factory != ''">
|
||||||
|
AND factory = #{factory}
|
||||||
|
</if>
|
||||||
|
AND (standard IS NULL OR standard != 0)
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY datetime DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectXzDryMatterCorrectionById" parameterType="Long" resultMap="XzDryMatterCorrectionResult">
|
<select id="selectXzDryMatterCorrectionById" parameterType="Long" resultMap="XzDryMatterCorrectionResult">
|
||||||
<include refid="selectXzDryMatterCorrectionVo"/>
|
<include refid="selectXzDryMatterCorrectionVo"/>
|
||||||
where id = #{id}
|
WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertXzDryMatterCorrection" parameterType="XzDryMatterCorrection" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertXzDryMatterCorrection" parameterType="XzDryMatterCorrection" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into xz_dry_matter_correction
|
INSERT INTO xz_dry_matter_correction
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="datetime != null">datetime,</if>
|
datetime, factory, content, standard
|
||||||
<if test="factory != null">factory,</if>
|
|
||||||
<if test="content != null">content,</if>
|
|
||||||
<if test="standard != null">standard,</if>
|
|
||||||
<if test="coefficient != null">coefficient,</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
<if test="datetime != null">#{datetime},</if>
|
#{datetime}, #{factory}, #{content}, #{standard}
|
||||||
<if test="factory != null">#{factory},</if>
|
|
||||||
<if test="content != null">#{content},</if>
|
|
||||||
<if test="standard != null">#{standard},</if>
|
|
||||||
<if test="coefficient != null">#{coefficient},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateXzDryMatterCorrection" parameterType="XzDryMatterCorrection">
|
<update id="updateXzDryMatterCorrection" parameterType="XzDryMatterCorrection">
|
||||||
update xz_dry_matter_correction
|
UPDATE xz_dry_matter_correction
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<set>
|
||||||
<if test="datetime != null">datetime = #{datetime},</if>
|
<if test="datetime != null">datetime = #{datetime},</if>
|
||||||
<if test="factory != null">factory = #{factory},</if>
|
<if test="factory != null">factory = #{factory},</if>
|
||||||
<if test="content != null">content = #{content},</if>
|
<if test="content != null">content = #{content},</if>
|
||||||
<if test="standard != null">standard = #{standard},</if>
|
<if test="standard != null">standard = #{standard},</if>
|
||||||
<if test="coefficient != null">coefficient = #{coefficient},</if>
|
</set>
|
||||||
</trim>
|
WHERE id = #{id}
|
||||||
where id = #{id}
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteXzDryMatterCorrectionById" parameterType="Long">
|
<delete id="deleteXzDryMatterCorrectionById" parameterType="Long">
|
||||||
delete from xz_dry_matter_correction where id = #{id}
|
DELETE FROM xz_dry_matter_correction WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteXzDryMatterCorrectionByIds" parameterType="String">
|
<delete id="deleteXzDryMatterCorrectionByIds" parameterType="Long[]">
|
||||||
delete from xz_dry_matter_correction where id in
|
DELETE FROM xz_dry_matter_correction WHERE id IN
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zhyc.module.parityCorrection.mapper.XzParityCorrectionMapper">
|
||||||
|
|
||||||
|
<resultMap type="XzParityCorrection" id="XzParityCorrectionResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="parity" column="parity" />
|
||||||
|
<result property="coef" column="coef" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectXzParityCorrectionVo">
|
||||||
|
select id, parity, coef from xz_parity_correction
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectXzParityCorrectionList" parameterType="XzParityCorrection" resultMap="XzParityCorrectionResult">
|
||||||
|
<include refid="selectXzParityCorrectionVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="parity != null "> and parity = #{parity}</if>
|
||||||
|
<if test="coef != null "> and coef = #{coef}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectXzParityCorrectionById" parameterType="Long" resultMap="XzParityCorrectionResult">
|
||||||
|
<include refid="selectXzParityCorrectionVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertXzParityCorrection" parameterType="XzParityCorrection" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into xz_parity_correction
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parity != null">parity,</if>
|
||||||
|
<if test="coef != null">coef,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parity != null">#{parity},</if>
|
||||||
|
<if test="coef != null">#{coef},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateXzParityCorrection" parameterType="XzParityCorrection">
|
||||||
|
update xz_parity_correction
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="parity != null">parity = #{parity},</if>
|
||||||
|
<if test="coef != null">coef = #{coef},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteXzParityCorrectionById" parameterType="Long">
|
||||||
|
delete from xz_parity_correction where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteXzParityCorrectionByIds" parameterType="String">
|
||||||
|
delete from xz_parity_correction where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zhyc.module.weightCorrection.mapper.XzWegihCorrectionMapper">
|
||||||
|
|
||||||
|
<resultMap type="XzWegihCorrection" id="XzWegihCorrectionResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="datetime" column="datetime" />
|
||||||
|
<result property="factory" column="factory" />
|
||||||
|
<result property="actual" column="actual" />
|
||||||
|
<result property="systemMilk" column="system_milk" />
|
||||||
|
<result property="coefficient" column="coefficient" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectXzWegihCorrectionVo">
|
||||||
|
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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectXzWegihCorrectionList" parameterType="XzWegihCorrection" resultMap="XzWegihCorrectionResult">
|
||||||
|
<include refid="selectXzWegihCorrectionVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="datetime != null "> and datetime = #{datetime}</if>
|
||||||
|
<if test="factory != null and factory != ''"> and factory = #{factory}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectXzWegihCorrectionById" parameterType="Long" resultMap="XzWegihCorrectionResult">
|
||||||
|
<include refid="selectXzWegihCorrectionVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertXzWegihCorrection" parameterType="XzWegihCorrection" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into xz_wegih_correction
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="datetime != null">datetime,</if>
|
||||||
|
<if test="factory != null">factory,</if>
|
||||||
|
<if test="actual != null">actual,</if>
|
||||||
|
<if test="systemMilk != null">system_milk,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="datetime != null">#{datetime},</if>
|
||||||
|
<if test="factory != null">#{factory},</if>
|
||||||
|
<if test="actual != null">#{actual},</if>
|
||||||
|
<if test="systemMilk != null">#{systemMilk},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateXzWegihCorrection" parameterType="XzWegihCorrection">
|
||||||
|
update xz_wegih_correction
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="datetime != null">datetime = #{datetime},</if>
|
||||||
|
<if test="factory != null">factory = #{factory},</if>
|
||||||
|
<if test="actual != null">actual = #{actual},</if>
|
||||||
|
<if test="systemMilk != null">system_milk = #{systemMilk},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteXzWegihCorrectionById" parameterType="Long">
|
||||||
|
delete from xz_wegih_correction where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteXzWegihCorrectionByIds" parameterType="String">
|
||||||
|
delete from xz_wegih_correction where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user