refactor(qms): 重构物料质检周期相关字段和查询逻辑

- 移除 MaterialInspectionCycleVO 中的 Accessors 注解
- 在 PdiInspectionTaskCallbackQO 中新增物料编号字段
- 修改 QmsController 中的质检任务回调逻辑,按物料编号查询订单项
- 从 QmsQcMaterial 实体中移除有效期字段 validityPeriod
- 从 QmsQcMaterialAddQO 中移除多个字段包括有效性期和质检周期相关字段
- 修改 QmsQcMaterialControllerService 中的实体创建和更新逻辑,移除无效字段设置
- 在 QmsQcMaterialExportDTO 中将有效期字段替换为质检周期1/2/3字段
- 更新 QmsQcMaterialMapper.xml 中的查询语句,移除有效期相关条件和排序
- 从 QmsQcMaterialSearchQO 中移除有效期字段
- 精简 QmsService 中的导入包,移除未使用的工具类和实体服务引用
This commit is contained in:
曹鹏飞 2026-06-10 18:54:00 +08:00
parent 46c429c3a9
commit a84a34374b
10 changed files with 28 additions and 101 deletions

View File

@ -153,7 +153,6 @@ public class QmsQcMaterialControllerService {
QmsQcMaterial entity = new QmsQcMaterial()
.setMaterialNo(request.getMaterialNo())
.setMaterialDesc(request.getMaterialDesc())
.setMaterialDescIsUpgrade(request.getMaterialDescIsUpgrade() != null ? request.getMaterialDescIsUpgrade() : false)
.setMaterialCategoryCode(request.getMaterialCategoryCode())
.setMaterialCategoryCodePathName(categoryPathName)
.setDrawingNo(request.getDrawingNo())
@ -161,11 +160,6 @@ public class QmsQcMaterialControllerService {
.setMaterialName(request.getMaterialName())
.setMaterialTexture(request.getMaterialTexture())
.setMaterialSpecifications(request.getMaterialSpecifications())
.setValidityPeriod(request.getValidityPeriod())
.setIsStandardMaintained(request.getIsStandardMaintained() != null ? request.getIsStandardMaintained() : false)
.setInspectionCycle1(request.getInspectionCycle1())
.setInspectionCycle2(request.getInspectionCycle2())
.setInspectionCycle3(request.getInspectionCycle3())
.setCreatedType(0)
.setCreateBy(userId)
.setCreateByName(operator)
@ -238,9 +232,6 @@ public class QmsQcMaterialControllerService {
if (request.getMaterialSpecifications() != null) {
updateChain.set(QmsQcMaterial::getMaterialSpecifications, request.getMaterialSpecifications());
}
if (request.getValidityPeriod() != null) {
updateChain.set(QmsQcMaterial::getValidityPeriod, request.getValidityPeriod());
}
// 更新规则是否已维护
if (request.getIsStandardMaintained() != null) {
updateChain.set(QmsQcMaterial::getIsStandardMaintained, request.getIsStandardMaintained());
@ -370,7 +361,6 @@ public class QmsQcMaterialControllerService {
.setMaterialName(dto.getMaterialName())
.setMaterialTexture(dto.getMaterialTexture())
.setMaterialSpecifications(dto.getMaterialSpecifications())
.setValidityPeriod(dto.getValidityPeriod())
.setIsStandardMaintained(false)
.setCreatedType(0)
.setCreateBy(userId)
@ -391,7 +381,6 @@ public class QmsQcMaterialControllerService {
.set(QmsQcMaterial::getMaterialName, dto.getMaterialName())
.set(QmsQcMaterial::getMaterialTexture, dto.getMaterialTexture())
.set(QmsQcMaterial::getMaterialSpecifications, dto.getMaterialSpecifications())
.set(QmsQcMaterial::getValidityPeriod, dto.getValidityPeriod())
.set(QmsQcMaterial::getUpdateBy, userId)
.set(QmsQcMaterial::getUpdateByName, operator)
.set(QmsQcMaterial::getUpdateTime, now)

View File

@ -66,10 +66,22 @@ public class QmsQcMaterialExportDTO {
private String materialSpecifications;
/**
* Validity period in months.
* 质检周期1单位为月
*/
@ExcelColumn("有效周期(月)")
private Short validityPeriod;
@ExcelColumn("质检周期1")
private Integer inspectionCycle1;
/**
* 质检周期2单位为月
*/
@ExcelColumn("质检周期2")
private Integer inspectionCycle2;
/**
* 质检周期3单位为月
*/
@ExcelColumn("质检周期3")
private Integer inspectionCycle3;
/**
* 规则是否已维护

View File

@ -11,6 +11,11 @@ public class PdiInspectionTaskCallbackQO {
*/
private String orderNo;
/**
* 物料编号
*/
private String materialNo;
/**
* 质检是否合格
*/

View File

@ -21,11 +21,6 @@ public class QmsQcMaterialAddQO {
*/
private String materialDesc;
/**
* 描述是否变更false=未变更true=已变更
*/
private Boolean materialDescIsUpgrade;
/**
* 物料类别编码
*/
@ -56,32 +51,4 @@ public class QmsQcMaterialAddQO {
* 物料规格
*/
private String materialSpecifications;
/**
* Validity period in months.
*/
private Short validityPeriod;
/**
* 规则是否已维护false=未维护true=已维护
*/
private Boolean isStandardMaintained;
/**
* 质检周期1单位为月
*/
@NotNull(message = "质检周期1不能为空")
private Integer inspectionCycle1;
/**
* 质检周期2单位为月
*/
@NotNull(message = "质检周期2不能为空")
private Integer inspectionCycle2;
/**
* 质检周期3单位为月
*/
@NotNull(message = "质检周期3不能为空")
private Integer inspectionCycle3;
}

View File

@ -66,11 +66,6 @@ public class QmsQcMaterialSearchQO extends PageQO {
*/
private String materialSpecifications;
/**
* Validity period in months.
*/
private Short validityPeriod;
/**
* 规则是否已维护精确匹配false=未维护true=已维护
*/

View File

@ -3,7 +3,6 @@ package com.nflg.wms.common.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@AllArgsConstructor

View File

@ -81,11 +81,6 @@ public class QmsQcMaterial implements Serializable {
*/
private String materialSpecifications;
/**
* Validity period in months.
*/
private Short validityPeriod;
/**
* 规则是否已维护false=未维护true=已维护
*/

View File

@ -11,25 +11,7 @@
、创建时间范围(createTimeStart/createTimeEnd)、修改人模糊(updateByName)、修改时间范围(updateTimeStart/updateTimeEnd)
-->
<select id="searchPage" resultType="com.nflg.wms.common.pojo.vo.QmsQcMaterialVO">
SELECT
id,
material_no,
material_desc,
material_desc_is_upgrade,
material_category_code,
material_category_code_path_name,
drawing_no,
drawing_no_ver,
material_name,
material_texture,
material_specifications,
validity_period,
is_standard_maintained,
created_type,
create_by_name,
create_time,
update_by_name,
update_time
SELECT *
FROM qms_qc_material
<where>
<choose>
@ -70,9 +52,6 @@
<if test="request.materialSpecifications != null and request.materialSpecifications != ''">
AND material_specifications ilike concat('%', #{request.materialSpecifications}, '%')
</if>
<if test="request.validityPeriod != null">
AND validity_period = #{request.validityPeriod}
</if>
<if test="request.isStandardMaintained != null">
AND is_standard_maintained = #{request.isStandardMaintained}
</if>
@ -113,7 +92,6 @@
<when test="request.sortField == 'materialName'">material_name</when>
<when test="request.sortField == 'materialTexture'">material_texture</when>
<when test="request.sortField == 'materialSpecifications'">material_specifications</when>
<when test="request.sortField == 'validityPeriod'">validity_period</when>
<when test="request.sortField == 'isStandardMaintained'">is_standard_maintained</when>
<when test="request.sortField == 'createdType'">created_type</when>
<when test="request.sortField == 'createByName'">create_by_name</when>
@ -150,7 +128,9 @@
material_name,
material_texture,
material_specifications,
validity_period,
inspection_cycle1,
inspection_cycle2,
inspection_cycle3,
CASE WHEN is_standard_maintained THEN '是' ELSE '否' END AS is_standard_maintained,
CASE created_type WHEN 0 THEN '人工操作' WHEN 1 THEN '系统同步' ELSE '未知' END AS created_type,
create_by_name,
@ -195,9 +175,6 @@
<if test="request.materialSpecifications != null and request.materialSpecifications != ''">
AND material_specifications ilike concat('%', #{request.materialSpecifications}, '%')
</if>
<if test="request.validityPeriod != null">
AND validity_period = #{request.validityPeriod}
</if>
<if test="request.isStandardMaintained != null">
AND is_standard_maintained = #{request.isStandardMaintained}
</if>
@ -238,7 +215,6 @@
<when test="request.sortField == 'materialName'">material_name</when>
<when test="request.sortField == 'materialTexture'">material_texture</when>
<when test="request.sortField == 'materialSpecifications'">material_specifications</when>
<when test="request.sortField == 'validityPeriod'">validity_period</when>
<when test="request.sortField == 'isStandardMaintained'">is_standard_maintained</when>
<when test="request.sortField == 'createdType'">created_type</when>
<when test="request.sortField == 'createByName'">create_by_name</when>

View File

@ -1,19 +1,9 @@
package com.nflg.wms.scheduled.service;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.nflg.wms.common.pojo.ApiResult;
import com.nflg.wms.common.pojo.qo.*;
import com.nflg.wms.common.pojo.vo.ExemptMaterialCheckVO;
import com.nflg.wms.common.pojo.vo.MaterialInspectionCycleVO;
import com.nflg.wms.common.util.VUtil;
import com.nflg.wms.repository.entity.WmsInProduceOrderItem;
import com.nflg.wms.repository.entity.WmsInventory;
import com.nflg.wms.repository.entity.WmsOutProduce;
import com.nflg.wms.repository.entity.WmsQrCodeMaster;
import com.nflg.wms.repository.service.IWmsInventoryService;
import com.nflg.wms.repository.service.IWmsOutProduceService;
import com.nflg.wms.repository.service.IWmsQrCodeMasterService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -22,11 +12,7 @@ import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component

View File

@ -242,7 +242,10 @@ public class QmsController extends BaseController {
log.info("质检单解析完成, 单号: {}, 是否合格: {}", qo.getOrderNo(), qo.isPass());
WmsInProduceOrder order = produceOrderService.getByNo(qo.getOrderNo());
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
WmsInProduceOrderItem item = produceOrderItemService.getByOrderId(order.getId()).get(0);
WmsInProduceOrderItem item = produceOrderItemService.lambdaQuery()
.eq(WmsInProduceOrderItem::getOrderId, order.getId())
.eq(WmsInProduceOrderItem::getMaterialNo, qo.getMaterialNo())
.one();
item.setInspectionStatus(qo.isPass() ? 1 : 2);
produceOrderItemService.updateById(item);
return ApiResult.success();