fix(mes): 质量证明书
This commit is contained in:
@@ -0,0 +1,99 @@
|
|||||||
|
package com.klp.mes.qc.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.klp.common.annotation.RepeatSubmit;
|
||||||
|
import com.klp.common.annotation.Log;
|
||||||
|
import com.klp.common.core.controller.BaseController;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import com.klp.common.enums.BusinessType;
|
||||||
|
import com.klp.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateVo;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateBo;
|
||||||
|
import com.klp.mes.qc.service.IQcCertificateService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qc/certificate")
|
||||||
|
public class QcCertificateController extends BaseController {
|
||||||
|
|
||||||
|
private final IQcCertificateService iQcCertificateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<QcCertificateVo> list(QcCertificateBo bo, PageQuery pageQuery) {
|
||||||
|
return iQcCertificateService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出质量证明书主列表
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书主", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(QcCertificateBo bo, HttpServletResponse response) {
|
||||||
|
List<QcCertificateVo> list = iQcCertificateService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "质量证明书主", QcCertificateVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取质量证明书主详细信息
|
||||||
|
*
|
||||||
|
* @param certificateId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{certificateId}")
|
||||||
|
public R<QcCertificateVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long certificateId) {
|
||||||
|
return R.ok(iQcCertificateService.queryById(certificateId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书主
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书主", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcCertificateBo bo) {
|
||||||
|
return toAjax(iQcCertificateService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书主
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书主", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcCertificateBo bo) {
|
||||||
|
return toAjax(iQcCertificateService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除质量证明书主
|
||||||
|
*
|
||||||
|
* @param certificateIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书主", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{certificateIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] certificateIds) {
|
||||||
|
return toAjax(iQcCertificateService.deleteWithValidByIds(Arrays.asList(certificateIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.klp.mes.qc.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.klp.common.annotation.RepeatSubmit;
|
||||||
|
import com.klp.common.annotation.Log;
|
||||||
|
import com.klp.common.core.controller.BaseController;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import com.klp.common.enums.BusinessType;
|
||||||
|
import com.klp.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
|
||||||
|
import com.klp.mes.qc.service.IQcCertificateItemService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qc/certificateItem")
|
||||||
|
public class QcCertificateItemController extends BaseController {
|
||||||
|
|
||||||
|
private final IQcCertificateItemService iQcCertificateItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<QcCertificateItemVo> list(QcCertificateItemBo bo, PageQuery pageQuery) {
|
||||||
|
return iQcCertificateItemService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出质量证明书明细列表
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书明细", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(QcCertificateItemBo bo, HttpServletResponse response) {
|
||||||
|
List<QcCertificateItemVo> list = iQcCertificateItemService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "质量证明书明细", QcCertificateItemVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取质量证明书明细详细信息
|
||||||
|
*
|
||||||
|
* @param itemId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{itemId}")
|
||||||
|
public R<QcCertificateItemVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long itemId) {
|
||||||
|
return R.ok(iQcCertificateItemService.queryById(itemId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书明细
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书明细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcCertificateItemBo bo) {
|
||||||
|
return toAjax(iQcCertificateItemService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书明细
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书明细", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcCertificateItemBo bo) {
|
||||||
|
return toAjax(iQcCertificateItemService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除质量证明书明细
|
||||||
|
*
|
||||||
|
* @param itemIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "质量证明书明细", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{itemIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] itemIds) {
|
||||||
|
return toAjax(iQcCertificateItemService.deleteWithValidByIds(Arrays.asList(itemIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.klp.mes.qc.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主对象 qc_certificate
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("qc_certificate")
|
||||||
|
public class QcCertificate extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "certificate_id")
|
||||||
|
private Long certificateId;
|
||||||
|
/**
|
||||||
|
* 证明书号
|
||||||
|
*/
|
||||||
|
private String certificateNo;
|
||||||
|
/**
|
||||||
|
* 合同号
|
||||||
|
*/
|
||||||
|
private String contractNo;
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 执行标准
|
||||||
|
*/
|
||||||
|
private String standard;
|
||||||
|
/**
|
||||||
|
* 收货单位
|
||||||
|
*/
|
||||||
|
private String consignee;
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
/**
|
||||||
|
* 签发日期
|
||||||
|
*/
|
||||||
|
private Date issueDate;
|
||||||
|
/**
|
||||||
|
* 质保证明说明(注释)
|
||||||
|
*/
|
||||||
|
private String note;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package com.klp.mes.qc.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细对象 qc_certificate_item
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("qc_certificate_item")
|
||||||
|
public class QcCertificateItem extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "item_id")
|
||||||
|
private Long itemId;
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
private Long certificateId;
|
||||||
|
/**
|
||||||
|
* 钢卷号
|
||||||
|
*/
|
||||||
|
private String coilNo;
|
||||||
|
/**
|
||||||
|
* 炉号
|
||||||
|
*/
|
||||||
|
private String heatNo;
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
private String materialType;
|
||||||
|
/**
|
||||||
|
* 规格(mm)
|
||||||
|
*/
|
||||||
|
private String size;
|
||||||
|
/**
|
||||||
|
* 件数
|
||||||
|
*/
|
||||||
|
private Long pieces;
|
||||||
|
/**
|
||||||
|
* 重量(t)
|
||||||
|
*/
|
||||||
|
private BigDecimal weight;
|
||||||
|
/**
|
||||||
|
* C
|
||||||
|
*/
|
||||||
|
private BigDecimal c;
|
||||||
|
/**
|
||||||
|
* Si
|
||||||
|
*/
|
||||||
|
private BigDecimal si;
|
||||||
|
/**
|
||||||
|
* Mn
|
||||||
|
*/
|
||||||
|
private BigDecimal mn;
|
||||||
|
/**
|
||||||
|
* P
|
||||||
|
*/
|
||||||
|
private BigDecimal p;
|
||||||
|
/**
|
||||||
|
* S
|
||||||
|
*/
|
||||||
|
private BigDecimal s;
|
||||||
|
/**
|
||||||
|
* Als
|
||||||
|
*/
|
||||||
|
private BigDecimal als;
|
||||||
|
/**
|
||||||
|
* 拉伸试验-屈服强度(MPa)
|
||||||
|
*/
|
||||||
|
private BigDecimal yieldStrength;
|
||||||
|
/**
|
||||||
|
* 拉伸试验-抗拉强度(MPa)
|
||||||
|
*/
|
||||||
|
private BigDecimal tensileStrength;
|
||||||
|
/**
|
||||||
|
* 拉伸试验-伸长率(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal elongation;
|
||||||
|
/**
|
||||||
|
* 硬度实验(HRB)
|
||||||
|
*/
|
||||||
|
private BigDecimal hardness;
|
||||||
|
/**
|
||||||
|
* 弯曲试验
|
||||||
|
*/
|
||||||
|
private String bendingTest;
|
||||||
|
/**
|
||||||
|
* 表面质量
|
||||||
|
*/
|
||||||
|
private String surfaceQuality;
|
||||||
|
/**
|
||||||
|
* 表面结构
|
||||||
|
*/
|
||||||
|
private String surfaceStructure;
|
||||||
|
/**
|
||||||
|
* 边缘状态
|
||||||
|
*/
|
||||||
|
private String edgeStatus;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.klp.mes.qc.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主业务对象 qc_certificate
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class QcCertificateBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
private Long certificateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证明书号
|
||||||
|
*/
|
||||||
|
private String certificateNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同号
|
||||||
|
*/
|
||||||
|
private String contractNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行标准
|
||||||
|
*/
|
||||||
|
private String standard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货单位
|
||||||
|
*/
|
||||||
|
private String consignee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签发日期
|
||||||
|
*/
|
||||||
|
private Date issueDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质保证明说明(注释)
|
||||||
|
*/
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package com.klp.mes.qc.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细业务对象 qc_certificate_item
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class QcCertificateItemBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细ID
|
||||||
|
*/
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
private Long certificateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷号
|
||||||
|
*/
|
||||||
|
private String coilNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉号
|
||||||
|
*/
|
||||||
|
private String heatNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格(mm)
|
||||||
|
*/
|
||||||
|
private String size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 件数
|
||||||
|
*/
|
||||||
|
private Long pieces;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量(t)
|
||||||
|
*/
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C
|
||||||
|
*/
|
||||||
|
private BigDecimal c;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Si
|
||||||
|
*/
|
||||||
|
private BigDecimal si;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mn
|
||||||
|
*/
|
||||||
|
private BigDecimal mn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P
|
||||||
|
*/
|
||||||
|
private BigDecimal p;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* S
|
||||||
|
*/
|
||||||
|
private BigDecimal s;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Als
|
||||||
|
*/
|
||||||
|
private BigDecimal als;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-屈服强度(MPa)
|
||||||
|
*/
|
||||||
|
private BigDecimal yieldStrength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-抗拉强度(MPa)
|
||||||
|
*/
|
||||||
|
private BigDecimal tensileStrength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-伸长率(%)
|
||||||
|
*/
|
||||||
|
private BigDecimal elongation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬度实验(HRB)
|
||||||
|
*/
|
||||||
|
private BigDecimal hardness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弯曲试验
|
||||||
|
*/
|
||||||
|
private String bendingTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面质量
|
||||||
|
*/
|
||||||
|
private String surfaceQuality;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面结构
|
||||||
|
*/
|
||||||
|
private String surfaceStructure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘状态
|
||||||
|
*/
|
||||||
|
private String edgeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
package com.klp.mes.qc.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
|
import com.klp.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细视图对象 qc_certificate_item
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class QcCertificateItemVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "明细ID")
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "证书ID")
|
||||||
|
private Long certificateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "钢卷号")
|
||||||
|
private String coilNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 炉号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "炉号")
|
||||||
|
private String heatNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "材质")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格(mm)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "规格(mm)")
|
||||||
|
private String size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 件数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "件数")
|
||||||
|
private Long pieces;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量(t)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "重量(t)")
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "C")
|
||||||
|
private BigDecimal c;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Si
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "Si")
|
||||||
|
private BigDecimal si;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mn
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "Mn")
|
||||||
|
private BigDecimal mn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "P")
|
||||||
|
private BigDecimal p;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* S
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "S")
|
||||||
|
private BigDecimal s;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Als
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "Als")
|
||||||
|
private BigDecimal als;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-屈服强度(MPa)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "拉伸试验-屈服强度(MPa)")
|
||||||
|
private BigDecimal yieldStrength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-抗拉强度(MPa)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "拉伸试验-抗拉强度(MPa)")
|
||||||
|
private BigDecimal tensileStrength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉伸试验-伸长率(%)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "拉伸试验-伸长率(%)")
|
||||||
|
private BigDecimal elongation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬度实验(HRB)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "硬度实验(HRB)")
|
||||||
|
private BigDecimal hardness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弯曲试验
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "弯曲试验")
|
||||||
|
private String bendingTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面质量
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表面质量")
|
||||||
|
private String surfaceQuality;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面结构
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表面结构")
|
||||||
|
private String surfaceStructure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "边缘状态")
|
||||||
|
private String edgeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.klp.mes.qc.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
|
import com.klp.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主视图对象 qc_certificate
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class QcCertificateVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证书ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "证书ID")
|
||||||
|
private Long certificateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证明书号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "证明书号")
|
||||||
|
private String certificateNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "合同号")
|
||||||
|
private String contractNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行标准
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "执行标准")
|
||||||
|
private String standard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货单位
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "收货单位")
|
||||||
|
private String consignee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "生产厂家")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签发日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "签发日期")
|
||||||
|
private Date issueDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质保证明说明(注释)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "质保证明说明", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "注=释")
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.mes.qc.mapper;
|
||||||
|
|
||||||
|
import com.klp.mes.qc.domain.QcCertificateItem;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface QcCertificateItemMapper extends BaseMapperPlus<QcCertificateItemMapper, QcCertificateItem, QcCertificateItemVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.mes.qc.mapper;
|
||||||
|
|
||||||
|
import com.klp.mes.qc.domain.QcCertificate;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface QcCertificateMapper extends BaseMapperPlus<QcCertificateMapper, QcCertificate, QcCertificateVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.mes.qc.service;
|
||||||
|
|
||||||
|
import com.klp.mes.qc.domain.QcCertificateItem;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface IQcCertificateItemService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细
|
||||||
|
*/
|
||||||
|
QcCertificateItemVo queryById(Long itemId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<QcCertificateItemVo> queryPageList(QcCertificateItemBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细列表
|
||||||
|
*/
|
||||||
|
List<QcCertificateItemVo> queryList(QcCertificateItemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书明细
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(QcCertificateItemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书明细
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(QcCertificateItemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除质量证明书明细信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.mes.qc.service;
|
||||||
|
|
||||||
|
import com.klp.mes.qc.domain.QcCertificate;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateVo;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateBo;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface IQcCertificateService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主
|
||||||
|
*/
|
||||||
|
QcCertificateVo queryById(Long certificateId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<QcCertificateVo> queryPageList(QcCertificateBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主列表
|
||||||
|
*/
|
||||||
|
List<QcCertificateVo> queryList(QcCertificateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书主
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(QcCertificateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书主
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(QcCertificateBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除质量证明书主信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.klp.mes.qc.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
|
||||||
|
import com.klp.mes.qc.domain.QcCertificateItem;
|
||||||
|
import com.klp.mes.qc.mapper.QcCertificateItemMapper;
|
||||||
|
import com.klp.mes.qc.service.IQcCertificateItemService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书明细Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class QcCertificateItemServiceImpl implements IQcCertificateItemService {
|
||||||
|
|
||||||
|
private final QcCertificateItemMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QcCertificateItemVo queryById(Long itemId){
|
||||||
|
return baseMapper.selectVoById(itemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<QcCertificateItemVo> queryPageList(QcCertificateItemBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<QcCertificateItem> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<QcCertificateItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<QcCertificateItemVo> queryList(QcCertificateItemBo bo) {
|
||||||
|
LambdaQueryWrapper<QcCertificateItem> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<QcCertificateItem> buildQueryWrapper(QcCertificateItemBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<QcCertificateItem> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getCertificateId() != null, QcCertificateItem::getCertificateId, bo.getCertificateId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCoilNo()), QcCertificateItem::getCoilNo, bo.getCoilNo());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getHeatNo()), QcCertificateItem::getHeatNo, bo.getHeatNo());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMaterialType()), QcCertificateItem::getMaterialType, bo.getMaterialType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSize()), QcCertificateItem::getSize, bo.getSize());
|
||||||
|
lqw.eq(bo.getPieces() != null, QcCertificateItem::getPieces, bo.getPieces());
|
||||||
|
lqw.eq(bo.getWeight() != null, QcCertificateItem::getWeight, bo.getWeight());
|
||||||
|
lqw.eq(bo.getC() != null, QcCertificateItem::getC, bo.getC());
|
||||||
|
lqw.eq(bo.getSi() != null, QcCertificateItem::getSi, bo.getSi());
|
||||||
|
lqw.eq(bo.getMn() != null, QcCertificateItem::getMn, bo.getMn());
|
||||||
|
lqw.eq(bo.getP() != null, QcCertificateItem::getP, bo.getP());
|
||||||
|
lqw.eq(bo.getS() != null, QcCertificateItem::getS, bo.getS());
|
||||||
|
lqw.eq(bo.getAls() != null, QcCertificateItem::getAls, bo.getAls());
|
||||||
|
lqw.eq(bo.getYieldStrength() != null, QcCertificateItem::getYieldStrength, bo.getYieldStrength());
|
||||||
|
lqw.eq(bo.getTensileStrength() != null, QcCertificateItem::getTensileStrength, bo.getTensileStrength());
|
||||||
|
lqw.eq(bo.getElongation() != null, QcCertificateItem::getElongation, bo.getElongation());
|
||||||
|
lqw.eq(bo.getHardness() != null, QcCertificateItem::getHardness, bo.getHardness());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBendingTest()), QcCertificateItem::getBendingTest, bo.getBendingTest());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceQuality()), QcCertificateItem::getSurfaceQuality, bo.getSurfaceQuality());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceStructure()), QcCertificateItem::getSurfaceStructure, bo.getSurfaceStructure());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getEdgeStatus()), QcCertificateItem::getEdgeStatus, bo.getEdgeStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(QcCertificateItemBo bo) {
|
||||||
|
QcCertificateItem add = BeanUtil.toBean(bo, QcCertificateItem.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setItemId(add.getItemId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(QcCertificateItemBo bo) {
|
||||||
|
QcCertificateItem update = BeanUtil.toBean(bo, QcCertificateItem.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(QcCertificateItem entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除质量证明书明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.klp.mes.qc.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.klp.mes.qc.domain.bo.QcCertificateBo;
|
||||||
|
import com.klp.mes.qc.domain.vo.QcCertificateVo;
|
||||||
|
import com.klp.mes.qc.domain.QcCertificate;
|
||||||
|
import com.klp.mes.qc.mapper.QcCertificateMapper;
|
||||||
|
import com.klp.mes.qc.service.IQcCertificateService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质量证明书主Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class QcCertificateServiceImpl implements IQcCertificateService {
|
||||||
|
|
||||||
|
private final QcCertificateMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QcCertificateVo queryById(Long certificateId){
|
||||||
|
return baseMapper.selectVoById(certificateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<QcCertificateVo> queryPageList(QcCertificateBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<QcCertificate> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<QcCertificateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询质量证明书主列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<QcCertificateVo> queryList(QcCertificateBo bo) {
|
||||||
|
LambdaQueryWrapper<QcCertificate> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<QcCertificate> buildQueryWrapper(QcCertificateBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<QcCertificate> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCertificateNo()), QcCertificate::getCertificateNo, bo.getCertificateNo());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContractNo()), QcCertificate::getContractNo, bo.getContractNo());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getProductName()), QcCertificate::getProductName, bo.getProductName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStandard()), QcCertificate::getStandard, bo.getStandard());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getConsignee()), QcCertificate::getConsignee, bo.getConsignee());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getManufacturer()), QcCertificate::getManufacturer, bo.getManufacturer());
|
||||||
|
lqw.eq(bo.getIssueDate() != null, QcCertificate::getIssueDate, bo.getIssueDate());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getNote()), QcCertificate::getNote, bo.getNote());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增质量证明书主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(QcCertificateBo bo) {
|
||||||
|
QcCertificate add = BeanUtil.toBean(bo, QcCertificate.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setCertificateId(add.getCertificateId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改质量证明书主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(QcCertificateBo bo) {
|
||||||
|
QcCertificate update = BeanUtil.toBean(bo, QcCertificate.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(QcCertificate entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除质量证明书主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?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.klp.mes.qc.mapper.QcCertificateItemMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.mes.qc.domain.QcCertificateItem" id="QcCertificateItemResult">
|
||||||
|
<result property="itemId" column="item_id"/>
|
||||||
|
<result property="certificateId" column="certificate_id"/>
|
||||||
|
<result property="coilNo" column="coil_no"/>
|
||||||
|
<result property="heatNo" column="heat_no"/>
|
||||||
|
<result property="materialType" column="material_type"/>
|
||||||
|
<result property="size" column="size"/>
|
||||||
|
<result property="pieces" column="pieces"/>
|
||||||
|
<result property="weight" column="weight"/>
|
||||||
|
<result property="c" column="c"/>
|
||||||
|
<result property="si" column="si"/>
|
||||||
|
<result property="mn" column="mn"/>
|
||||||
|
<result property="p" column="p"/>
|
||||||
|
<result property="s" column="s"/>
|
||||||
|
<result property="als" column="als"/>
|
||||||
|
<result property="yieldStrength" column="yield_strength"/>
|
||||||
|
<result property="tensileStrength" column="tensile_strength"/>
|
||||||
|
<result property="elongation" column="elongation"/>
|
||||||
|
<result property="hardness" column="hardness"/>
|
||||||
|
<result property="bendingTest" column="bending_test"/>
|
||||||
|
<result property="surfaceQuality" column="surface_quality"/>
|
||||||
|
<result property="surfaceStructure" column="surface_structure"/>
|
||||||
|
<result property="edgeStatus" column="edge_status"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
26
klp-mes/src/main/resources/mapper/qc/QcCertificateMapper.xml
Normal file
26
klp-mes/src/main/resources/mapper/qc/QcCertificateMapper.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?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.klp.mes.qc.mapper.QcCertificateMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.mes.qc.domain.QcCertificate" id="QcCertificateResult">
|
||||||
|
<result property="certificateId" column="certificate_id"/>
|
||||||
|
<result property="certificateNo" column="certificate_no"/>
|
||||||
|
<result property="contractNo" column="contract_no"/>
|
||||||
|
<result property="productName" column="product_name"/>
|
||||||
|
<result property="standard" column="standard"/>
|
||||||
|
<result property="consignee" column="consignee"/>
|
||||||
|
<result property="manufacturer" column="manufacturer"/>
|
||||||
|
<result property="issueDate" column="issue_date"/>
|
||||||
|
<result property="note" column="note"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user