feat(qms): 新增质检类型和多级降级匹配策略

- 新增出库检类型(编号8)并统一更新所有质检类型定义
- 实现质检模板多级降级匹配策略,支持物料/工位/工序精确匹配
- 添加通用模板功能和应用级缓存优化性能
- 增加检测方法字段和多值查询支持
- 完善PDA质检任务生成逻辑和异常提示信息
- 新增WMS入库质检任务接口DTO
master
zangch@mesnac.com 3 days ago
parent 871696d50a
commit 566df42b50

@ -24,7 +24,7 @@ public class GenerateInspectionTaskBo implements Serializable {
/**
* qc_inspection_typeqc_inspection_type
* 0 1 2 3 4 5 6 7
* =0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;

@ -0,0 +1,99 @@
package org.dromara.qms.api.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* WMS DTO
* <p>
* WMS QMS
*
* @author zch
* @date 2026-1-14
*/
@Data
@NoArgsConstructor
public class WmsInspectionTaskRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
* <p>
*
*/
private String instockCode;
/**
*
* <p>
* 8=200
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
* <p>
*
*/
private BigDecimal inspectionQty;
/**
*
*/
private String batchCode;
/**
* /
* <p>
* =20
*/
private String stationName;
/**
*
* <p>
* =2
*/
private String processCode;
/**
*
* <p>
* WMS "7"
* =0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String inspectionType;
/**
*
* <p>
*
*/
private String supplierName;
/**
*
* <p>
*
*/
private String productionOrder;
/**
*
* <p>
*
*/
private String workshop;
}

@ -70,7 +70,7 @@ public class QcInspectionItemCategory extends TenantEntity {
private String typeName;//join
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
@TableField(exist = false)
private String qcInspectionType;//join

@ -134,5 +134,9 @@ public class QcInspectionResult extends TenantEntity {
@TableLogic
private String delFlag;
@TableField(exist = false)
private String method;
@TableField(exist = false)
private String methodName;
}

@ -87,6 +87,12 @@ public class QcInspectionTemplate extends TenantEntity {
*/
private String description;
/**
* 0/1
* //
*/
private String isDefault;
/**
* 02
*/
@ -106,7 +112,7 @@ public class QcInspectionTemplate extends TenantEntity {
private String typeName;//JOIN
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
@TableField(exist = false)
private String qcInspectionType;//JOIN

@ -38,7 +38,7 @@ public class QcInspectionType extends TenantEntity {
private String typeName;
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;

@ -63,7 +63,7 @@ public class QcInspectionItemCategoryBo extends BaseEntity {
private String typeName;//join
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;//join

@ -158,10 +158,15 @@ public class QcInspectionMainBo extends BaseEntity {
private String templateName;//join
/**
*
*
*/
private String qcInspectionType;
/**
*
*/
private List<String> qcInspectionTypes;
/**
*
*/

@ -88,6 +88,10 @@ public class QcInspectionTemplateBo extends BaseEntity {
*/
private String description;
/**
* 0/1
*/
private String isDefault;
/**
*
@ -100,7 +104,7 @@ public class QcInspectionTemplateBo extends BaseEntity {
private String typeName;//JOIN
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;//JOIN

@ -39,9 +39,9 @@ public class QcInspectionTypeBo extends BaseEntity {
private String typeName;
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
// @NotNull(message = "检测类型(字典:首检 专检 自检 互检 原材料检 抽检 成品检)不能为空", groups = { AddGroup.class, EditGroup.class })
// @NotNull(message = "检测类型(字典:首检=0, 专检=1, 自检=2, 互检=3, 原材料检=4, 抽检=5, 成品检=6, 入库检=7出库检=8)不能为空", groups = { AddGroup.class, EditGroup.class })
private String qcInspectionType;
/**

@ -33,7 +33,7 @@ public class QcInspectionMainTask {
private String inspectionQty;
/**
* 0 1 2 3 4 5 6 7
* =0, =1, =2, =3, =4, =5, =6, =7=8
* 7
*/
@JsonProperty("InspectionType")

@ -78,7 +78,7 @@ public class QcInspectionItemCategoryVo implements Serializable {
private String typeName;//join
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;//join

@ -1,5 +1,7 @@
package org.dromara.qms.domain.vo;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import java.math.BigDecimal;
import org.dromara.qms.domain.QcInspectionResult;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
@ -107,6 +109,20 @@ public class QcInspectionResultVo implements Serializable {
@ExcelDictFormat(readConverterExp = "快=照")
private Long typeId;
/**
* 0,1
*/
@ExcelProperty(value = "检测方法", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "qc_methond")
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "qc_methond")
private String methodName;
// /**
// * 检测方法名称
// */
// @ExcelProperty(value = "检测方法名称")
// private String methodName;
/**
* 0,1
*/

@ -106,6 +106,12 @@ public class QcInspectionTemplateVo implements Serializable {
@ExcelProperty(value = "模板说明")
private String description;
/**
* 0/1
*/
@ExcelProperty(value = "是否通用模板")
private String isDefault;
/**
*
*/
@ -117,7 +123,7 @@ public class QcInspectionTemplateVo implements Serializable {
private String typeName;//JOIN
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
private String qcInspectionType;//JOIN

@ -47,9 +47,9 @@ public class QcInspectionTypeVo implements Serializable {
private String typeName;
/**
* (
* (=0, =1, =2, =3, =4, =5, =6, =7=8
*/
@ExcelProperty(value = "检测类型(字典:首检 专检 自检 互检 原材料检 抽检 成品检)", converter = ExcelDictConvert.class)
@ExcelProperty(value = "检测类型(字典:首检=0, 专检=1, 自检=2, 互检=3, 原材料检=4, 抽检=5, 成品检=6, 入库检=7出库检=8", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "qc_inspection_type")
private String qcInspectionType;

@ -58,6 +58,19 @@ public interface IQcInspectionTemplateService {
*/
Boolean updateByBo(QcInspectionTemplateBo bo);
/**
*
* () > () >
*
* @param materialCode
* @param stationCode
* @param processCode
* @param qcInspectionType =0, =1, =2, =3, =4, =5, =6, =7=8
* @return
*/
QcInspectionTemplateVo getMatchedTemplate(String materialCode, String stationCode,
String processCode, String qcInspectionType);
/**
*
*

@ -1,31 +1,41 @@
package org.dromara.qms.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.system.api.RemoteCodeRuleService;
import org.dromara.qms.domain.QcInspectionMain;
import org.dromara.qms.domain.QcInspectionResult;
import org.dromara.qms.domain.QcInspectionTemplate;
import org.dromara.qms.domain.QcInspectionType;
import org.dromara.qms.domain.bo.QcInspectionMainBo;
import org.dromara.qms.domain.bo.QcInspectionResultBo;
import org.dromara.qms.domain.bo.QcTemplateItemBo;
import org.dromara.qms.domain.vo.QcInspectionMainVo;
import org.dromara.qms.domain.vo.QcTemplateItemVo;
import org.dromara.qms.domain.vo.QcInspectionTemplateVo;
import org.dromara.qms.mapper.QcInspectionMainMapper;
import org.dromara.qms.mapper.QcInspectionResultMapper;
import org.dromara.qms.service.IQcInspectionMainService;
import org.dromara.qms.service.IQcInspectionResultService;
import org.dromara.qms.service.IQcInspectionTemplateService;
import org.dromara.qms.service.IQcTemplateItemService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
/**
* Service
@ -38,9 +48,10 @@ import java.util.Map;
public class QcInspectionMainServiceImpl implements IQcInspectionMainService {
private final QcInspectionMainMapper baseMapper;
private final IQcInspectionResultService qcInspectionResultService;
private final QcInspectionResultMapper qcInspectionResultMapper;
private final IQcInspectionTemplateService qcInspectionTemplateService;
private final IQcTemplateItemService qcTemplateItemService;
/**
@ -107,7 +118,9 @@ public class QcInspectionMainServiceImpl implements IQcInspectionMainService {
.eq(bo.getInspectionType() != null, QcInspectionMain::getInspectionType, bo.getInspectionType())
// .eq(bo.getStatus() != null, QcInspectionMain::getStatus, bo.getStatus())
.eq(StringUtils.isNotBlank(bo.getQcInspectionType()), QcInspectionType::getQcInspectionType, bo.getQcInspectionType())
// 支持单值和多值查询检测类型字典
.eq(StringUtils.isNotBlank(bo.getQcInspectionType()) && (bo.getQcInspectionTypes() == null || bo.getQcInspectionTypes().isEmpty()), QcInspectionType::getQcInspectionType, bo.getQcInspectionType())
.in(bo.getQcInspectionTypes() != null && !bo.getQcInspectionTypes().isEmpty(), QcInspectionType::getQcInspectionType, bo.getQcInspectionTypes())
.eq(StringUtils.isNotBlank(bo.getStatus()), QcInspectionMain::getStatus, bo.getStatus())
.eq(StringUtils.isNotBlank(bo.getInspector()), QcInspectionMain::getInspector, bo.getInspector())
.eq(StringUtils.isNotBlank(bo.getShift()), QcInspectionMain::getShift, bo.getShift())

@ -1,5 +1,8 @@
package org.dromara.qms.service.impl;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -20,6 +23,7 @@ import org.dromara.qms.service.IQcInspectionTemplateService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* Service
@ -27,12 +31,20 @@ import java.util.Collection;
* @author zch
* @date 2025-07-14
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class QcInspectionTemplateServiceImpl implements IQcInspectionTemplateService {
private final QcInspectionTemplateMapper baseMapper;
// ========== 应用级缓存:所有质检模板 ==========
// 应用启动时一次性加载,避免运行时频繁查询数据库
private volatile List<QcInspectionTemplateVo> templateCache;
// 按检测类型分组的缓存(加速查找)
private volatile Map<String, List<QcInspectionTemplateVo>> templatesByTypeCache;
/**
*
*
@ -93,6 +105,7 @@ public class QcInspectionTemplateServiceImpl implements IQcInspectionTemplateSer
.like(StringUtils.isNotBlank(bo.getSupplierName()), QcInspectionTemplate::getSupplierName, bo.getSupplierName())
.eq(StringUtils.isNotBlank(bo.getDescription()), QcInspectionTemplate::getDescription, bo.getDescription())
.eq(StringUtils.isNotBlank(bo.getQcInspectionType()), QcInspectionType::getQcInspectionType, bo.getQcInspectionType())
.eq(StringUtils.isNotBlank(bo.getIsDefault()), QcInspectionTemplate::getIsDefault, bo.getIsDefault())
.orderByDesc(QcInspectionTemplate::getCreateTime);
return lqw;
}
@ -110,6 +123,7 @@ public class QcInspectionTemplateServiceImpl implements IQcInspectionTemplateSer
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setTemplateId(add.getTemplateId());
refreshCache(); // 刷新应用级缓存
}
return flag;
}
@ -124,14 +138,178 @@ public class QcInspectionTemplateServiceImpl implements IQcInspectionTemplateSer
public Boolean updateByBo(QcInspectionTemplateBo bo) {
QcInspectionTemplate update = MapstructUtils.convert(bo, QcInspectionTemplate.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
boolean flag = baseMapper.updateById(update) > 0;
if (flag) {
refreshCache(); // 刷新应用级缓存
}
return flag;
}
/**
*
*/
private void validEntityBeforeSave(QcInspectionTemplate entity){
//TODO 做一些数据校验,如唯一约束
// 校验1通用模板不能绑定物料/工序/工位
if ("1".equals(entity.getIsDefault())) {
boolean hasBinding = StringUtils.isNotBlank(entity.getMaterialCode())
|| StringUtils.isNotBlank(entity.getStationCode())
|| StringUtils.isNotBlank(entity.getProcessCode());
if (hasBinding) {
throw new ServiceException("通用模板不能绑定具体物料、工序或工位!");
}
}
// 校验2每种检测类型只能有一个通用模板
if ("1".equals(entity.getIsDefault()) && entity.getTypeId() != null) {
QcInspectionTemplateBo checkBo = new QcInspectionTemplateBo();
checkBo.setTypeId(entity.getTypeId());
checkBo.setIsDefault("1");
List<QcInspectionTemplateVo> existingDefaults = queryList(checkBo);
boolean hasOtherDefault = existingDefaults.stream()
.anyMatch(vo -> !vo.getTemplateId().equals(entity.getTemplateId()));
if (hasOtherDefault) {
throw new ServiceException("该检测类型已存在通用模板!");
}
}
}
/**
*
* ++ > + > + > > + > > >
* =200, =20, =2, =0
*
* @param materialCode
* @param stationCode
* @param processCode
* @param qcInspectionType =0, =1, =2, =3, =4, =5, =6, =7=8
* @return
*/
@Override
public QcInspectionTemplateVo getMatchedTemplate(String materialCode, String stationCode,
String processCode, String qcInspectionType) {
if (StringUtils.isBlank(qcInspectionType)) {
throw new ServiceException("检测类型不能为空!");
}
// 确保缓存已初始化
if (templatesByTypeCache == null) {
synchronized (this) {
if (templatesByTypeCache == null) {
refreshCache();
}
}
}
// 从缓存获取该检测类型的所有模板
List<QcInspectionTemplateVo> typeTemplates = templatesByTypeCache.get(qcInspectionType);
if (typeTemplates == null || typeTemplates.isEmpty()) {
throw new ServiceException("检测类型[" + qcInspectionType + "]无可用检测模板!");
}
// 【修复】阶段1在非通用模板中找最佳匹配分数>0
QcInspectionTemplateVo bestMatch = typeTemplates.stream()
.filter(t -> !"1".equals(t.getIsDefault())) // 排除通用模板
.max((t1, t2) -> {
int score1 = calculateMatchScore(t1, materialCode, stationCode, processCode);
int score2 = calculateMatchScore(t2, materialCode, stationCode, processCode);
return Integer.compare(score1, score2);
})
.filter(t -> calculateMatchScore(t, materialCode, stationCode, processCode) > 0)
.orElse(null);
// 【修复】阶段2如果没有非通用模板匹配使用通用模板兜底
if (bestMatch == null) {
bestMatch = typeTemplates.stream()
.filter(t -> "1".equals(t.getIsDefault())) // 只查找通用模板
.findFirst()
.orElse(null);
if (bestMatch != null) {
log.info("使用通用模板兜底:{},检测类型:{}", bestMatch.getTemplateName(), qcInspectionType);
}
}
if (bestMatch == null) {
throw new ServiceException("[" +
(StringUtils.isNotBlank(materialCode) ? "物料=" + materialCode + " " : "") +
(StringUtils.isNotBlank(stationCode) ? "工位=" + stationCode + " " : "") +
(StringUtils.isNotBlank(processCode) ? "工序=" + processCode + " " : "") +
"检测类型=" + qcInspectionType + "]无匹配模板!");
}
int score = calculateMatchScore(bestMatch, materialCode, stationCode, processCode);
log.info("匹配到模板:{},分数:{}", bestMatch.getTemplateName(), score);
return bestMatch;
}
/**
*
* =200, =20, =2, =0
*
*
* - ++ = 200+20+2 = 222
* - + = 200+20 = 220
* - + = 200+2 = 202
* - = 200 = 200
* - + = 20+2 = 22
* - = 20 = 20
* - = 2 = 2
* - = 0 = 0
*/
private int calculateMatchScore(QcInspectionTemplateVo template,
String materialCode, String stationCode, String processCode) {
// 通用模板返回0分不参与分数计算单独作为兜底策略
if ("1".equals(template.getIsDefault())) {
return 0;
}
int score = 0;
// 物料匹配最高权重200分
if (StringUtils.isNotBlank(materialCode) && materialCode.equals(template.getMaterialCode())) {
score += 200;
}
// 工位匹配中等权重20分
if (StringUtils.isNotBlank(stationCode) && stationCode.equals(template.getStationCode())) {
score += 20;
}
// 工序匹配较低权重2分
if (StringUtils.isNotBlank(processCode) && processCode.equals(template.getProcessCode())) {
score += 2;
}
return score;
}
/**
*
*/
@PostConstruct
public synchronized void initCache() {
refreshCache();
}
/**
*
*/
public synchronized void refreshCache() {
log.info("开始加载质检模板缓存...");
// 一次性查询所有模板
QcInspectionTemplateBo bo = new QcInspectionTemplateBo();
templateCache = queryList(bo);
// 按检测类型分组,加速后续查找
templatesByTypeCache = templateCache.stream()
.collect(Collectors.groupingBy(t -> {
String type = t.getQcInspectionType();
return StringUtils.isNotBlank(type) ? type : "";
}));
log.info("质检模板缓存加载完成,共{}条,检测类型数:{}",
templateCache.size(), templatesByTypeCache.size());
}
/**
@ -146,6 +324,10 @@ public class QcInspectionTemplateServiceImpl implements IQcInspectionTemplateSer
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
boolean flag = baseMapper.deleteByIds(ids) > 0;
if (flag) {
refreshCache(); // 刷新应用级缓存
}
return flag;
}
}

@ -60,17 +60,58 @@ public class QcPDAServiceImpl implements IQcPDAService {
private final IQcInspectionMainFileRelationService qcInspectionMainFileRelationService;
@DubboReference
@DubboReference(timeout = 300000)
private final RemotePdaMesApiService remotePdaMesApiService;
@DubboReference
@DubboReference(timeout = 300000)
private final RemoteCodeRuleService remoteCodeRuleService;
//WARM-FLOW工作流
@DubboReference(timeout = 30000)
@DubboReference(timeout = 300000)
private final RemoteWorkflowService remoteWorkflowService;
// 工位信息和工序信息服务(用于通过名称查询编码)
private final IProdBaseStationInfoService prodBaseStationInfoService;
private final IProdBaseProcessInfoService prodBaseProcessInfoService;
private static final String UNQUALIFIED_REVIEW_FLOW_CODE = "unqualified_review";
/**
*
* FIXME: 访
* TODO:
*
* @param stationName ProdQmsPlanDetail.releaseName
* @return null
*/
private String getStationCodeByName(String stationName) {
if (StringUtils.isBlank(stationName)) {
return null;
}
ProdBaseStationInfoBo bo = new ProdBaseStationInfoBo();
bo.setStationName(stationName);
List<ProdBaseStationInfoVo> list = prodBaseStationInfoService.queryList(bo);
return (list != null && !list.isEmpty()) ? list.get(0).getStationCode() : null;
}
/**
*
* FIXME: 访
* TODO:
*
* @param processName ProdQmsPlanDetail.processName
* @return null
*/
private String getProcessCodeByName(String processName) {
if (StringUtils.isBlank(processName)) {
return null;
}
ProdBaseProcessInfoBo bo = new ProdBaseProcessInfoBo();
bo.setProcessName(processName);
List<ProdBaseProcessInfoVo> list = prodBaseProcessInfoService.queryList(bo);
return (list != null && !list.isEmpty()) ? list.get(0).getProcessCode() : null;
}
/**
* planDetailIdprocessId
@ -88,20 +129,28 @@ public class QcPDAServiceImpl implements IQcPDAService {
}
QcInspectionMainBo selectMain = new QcInspectionMainBo();
selectMain.setPlanDetailId(planDetail.getPlanDetailId());
selectMain.setQcInspectionType(bo.getQcInspectionType()); // 按质检类型筛选
selectMain.setStatus("0");//单据状态0未处理/1完成
List<QcInspectionMainVo> mainVoList = qcInspectionMainService.queryList(selectMain);
if (!mainVoList.isEmpty()){
throw new ServiceException("此生产计划已生成质检任务且未处理!");
// 获取已存在的未处理质检任务信息
QcInspectionMainVo existingTask = mainVoList.get(0);
String existingInspectionNo = existingTask.getInspectionNo();
String typeName = StringUtils.isNotBlank(existingTask.getTypeName())
? existingTask.getTypeName()
: getInspectionTypeName(bo.getQcInspectionType());
throw new ServiceException("【" + existingInspectionNo + "】" + typeName + "任务未质检,当前状态为未判定,请先完成该质检任务!");
}
// 使用多级降级匹配策略:物料相关 > 工位相关 > 通用模板
// FIXME: ProdQmsPlanDetail.releaseName 是机台名称(对应工位名称),需要查询工位编码
// FIXME: ProdQmsPlanDetail.processName 是工序名称,需要查询工序编码
// TODO: 后期建议 PDA API 直接返回编码,避免跨模块查询
String materialCode = planDetail.getMaterialCode();
QcInspectionTemplateBo templateBo = new QcInspectionTemplateBo();
templateBo.setMaterialCode(materialCode);
templateBo.setQcInspectionType(bo.getQcInspectionType());
List<QcInspectionTemplateVo> templateVos = qcInspectionTemplateService.queryList(templateBo);
if (templateVos.size() != 1) {
throw new ServiceException("此物料无可用检测模板!");
}
QcInspectionTemplateVo templateVo = templateVos.get(0);
String stationCode = getStationCodeByName(planDetail.getReleaseName()); // 根据机台名称查询工位编码
String processCode = getProcessCodeByName(planDetail.getProcessName()); // 根据工序名称查询工序编码
QcInspectionTemplateVo templateVo = qcInspectionTemplateService.getMatchedTemplate(
materialCode, stationCode, processCode, bo.getQcInspectionType()
);
QcInspectionMainBo inspectionBo = new QcInspectionMainBo();
inspectionBo.setInspectionNo(inspectionNo);
inspectionBo.setPlanDetailId(planDetail.getPlanDetailId());
@ -436,5 +485,37 @@ public class QcPDAServiceImpl implements IQcPDAService {
return true;
}
/**
*
* @param qcInspectionType =0, =1, =2, =3, =4, =5, =6, =7=8
* @return
*/
private String getInspectionTypeName(String qcInspectionType) {
if (StringUtils.isBlank(qcInspectionType)) {
return "质检";
}
switch (qcInspectionType) {
case "0":
return "首检";
case "1":
return "专检";
case "2":
return "自检";
case "3":
return "互检";
case "4":
return "原材料检";
case "5":
return "抽检";
case "6":
return "成品检";
case "7":
return "入库检";
case "8":
return "出库检";
default:
return "质检";
}
}
}

@ -4,4 +4,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.qms.mapper.QcInspectionMainFileRelationMapper">
<resultMap id="QcInspectionMainFileRelationVo" type="org.dromara.qms.domain.vo.QcInspectionMainFileRelationVo">
<id column="relation_id" jdbcType="BIGINT" property="relationId" />
<result column="inspection_id" jdbcType="BIGINT" property="inspectionId" />
<result column="oss_id" jdbcType="BIGINT" property="ossId" />
</resultMap>
<sql id="selctQcInspectionMainFileRelationVo">
select relation_id, tenant_id, inspection_id, tenant_id, oss_id, create_dept, create_by, create_time, update_by, update_time, del_flag
from qc_inspection_main_file_relation
</sql>
<select id="selctQcInspectionMainFileRelation" parameterType="org.dromara.qms.domain.bo.QcInspectionMainFileRelationBo" resultMap="QcInspectionMainFileRelationVo">
<include refid="selctQcInspectionMainFileRelationVo"/>
<where>
<if test="relationId != null">
and relation_id = #{relationId}
</if>
<if test="inspectionId != null">
and inspection_id = #{inspectionId}
</if>
<if test="ossId != null">
and oss_id = #{ossId}
</if>
<if test="tenantId != null">
and tenant_id = #{tenantId}
</if>
</where>
AND del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save