Browse Source
feat(qms): 添加供应商编号参数支持模板明细查询
feat(qms): 添加供应商编号参数支持模板明细查询
- 在 QcMapper 中为 listDetail 方法添加 supplierNo 参数 - 更新 QcMapper.xml 中的 SQL 查询,添加对供应商的关联查询 - 修改 QcServiceImpl 中的 getTemplateDetail 方法签名以包含供应商编号 - 调整模板明细查询逻辑以支持按供应商过滤数据master
4 changed files with 191 additions and 0 deletions
-
105src/main/java/com/xujie/modules/inspection/entity/QcAttributeTemplate.java
-
26src/main/java/com/xujie/modules/inspection/mapper/QcAttributeTemplateMapper.java
-
31src/main/java/com/xujie/modules/inspection/service/impl/InspectionRequestServiceImpl.java
-
29src/main/resources/mapper/inspection/QcAttributeTemplateMapper.xml
@ -0,0 +1,105 @@ |
|||
package com.xujie.modules.inspection.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* QC检验模板实体类 |
|||
*/ |
|||
@Data |
|||
@TableName("qc_attribute_template") |
|||
public class QcAttributeTemplate { |
|||
|
|||
/** |
|||
* 物料编码 |
|||
*/ |
|||
@TableField("attribute_no") |
|||
private String attributeNo; |
|||
|
|||
/** |
|||
* 模板ID |
|||
*/ |
|||
@TableField("template_id") |
|||
private String templateId; |
|||
|
|||
/** |
|||
* 抽样水平编号 |
|||
*/ |
|||
@TableField("sampling_level_no") |
|||
private String samplingLevelNo; |
|||
|
|||
/** |
|||
* 检验周期 |
|||
*/ |
|||
@TableField("inspection_cycle") |
|||
private BigDecimal inspectionCycle; |
|||
|
|||
/** |
|||
* 抽样方案编号 |
|||
*/ |
|||
@TableField("sampling_programme_no") |
|||
private String samplingProgrammeNo; |
|||
|
|||
/** |
|||
* AQL值 |
|||
*/ |
|||
@TableField("AQL") |
|||
private BigDecimal aql; |
|||
|
|||
/** |
|||
* AC值 |
|||
*/ |
|||
@TableField("AC") |
|||
private BigDecimal ac; |
|||
|
|||
/** |
|||
* RE值 |
|||
*/ |
|||
@TableField("RE") |
|||
private BigDecimal re; |
|||
|
|||
/** |
|||
* 属性类型 |
|||
*/ |
|||
@TableField("attribute_type") |
|||
private String attributeType; |
|||
|
|||
/** |
|||
* 资源ID |
|||
*/ |
|||
@TableField("resource_id") |
|||
private String resourceId; |
|||
|
|||
/** |
|||
* 操作 |
|||
*/ |
|||
@TableField("operation") |
|||
private String operation; |
|||
|
|||
/** |
|||
* 供应商编号 |
|||
*/ |
|||
@TableField("manufacturer_id") |
|||
private String manufacturerId; |
|||
|
|||
/** |
|||
* 站点 |
|||
*/ |
|||
@TableField("site") |
|||
private String site; |
|||
|
|||
/** |
|||
* 业务单元编号 |
|||
*/ |
|||
@TableField("bu_no") |
|||
private String buNo; |
|||
|
|||
/** |
|||
* 检验类型编号 |
|||
*/ |
|||
@TableField("inspection_type_no") |
|||
private String inspectionTypeNo; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.xujie.modules.inspection.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.xujie.modules.inspection.entity.QcAttributeTemplate; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* QC检验模板 Mapper |
|||
*/ |
|||
@Mapper |
|||
public interface QcAttributeTemplateMapper extends BaseMapper<QcAttributeTemplate> { |
|||
|
|||
/** |
|||
* 查询申请单中没有维护检验模板的物料列表 |
|||
* @param site 站点 |
|||
* @param requestNos 申请单号列表 |
|||
* @return 未维护模板的物料和供应商组合列表 |
|||
*/ |
|||
List<java.util.HashMap<String, Object>> findMissingTemplates( |
|||
@Param("site") String site, |
|||
@Param("requestNos") List<String> requestNos |
|||
); |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
<?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.xujie.modules.inspection.mapper.QcAttributeTemplateMapper"> |
|||
|
|||
<!-- 查询申请单中没有维护检验模板的物料列表 --> |
|||
<select id="findMissingTemplates" resultType="java.util.HashMap"> |
|||
SELECT DISTINCT |
|||
d.part_no AS attributeNo, |
|||
h.supplier_no AS manufacturerId |
|||
FROM srm_inspect_request_detail_sub d |
|||
LEFT JOIN srm_inspection_request_header h |
|||
ON d.site = h.site |
|||
AND d.request_no = h.request_no |
|||
WHERE d.site = #{site} |
|||
AND d.request_no IN |
|||
<foreach collection="requestNos" item="requestNo" open="(" separator="," close=")"> |
|||
#{requestNo} |
|||
</foreach> |
|||
AND NOT EXISTS ( |
|||
SELECT 1 |
|||
FROM qc_attribute_template t |
|||
WHERE t.site = d.site |
|||
AND t.attribute_no = d.part_no |
|||
AND t.manufacturer_id = h.supplier_no |
|||
) |
|||
ORDER BY d.part_no, h.supplier_no |
|||
</select> |
|||
|
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue