pqc修改
This commit is contained in:
parent
39534370ec
commit
b53bac78a0
|
|
@ -18,11 +18,6 @@ public class PqcInspectionRuleAddQO {
|
|||
@NotBlank(message = "机型编号不能为空")
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 规则编号(可选,后端自动生成)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,11 +25,6 @@ public class PqcInspectionRuleEditQO {
|
|||
@NotBlank(message = "机型编号不能为空")
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 检查点列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@ public class PqcInspectionRuleSearchQO extends PageQO {
|
|||
*/
|
||||
private String pqcRuleCode;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 启用状态:true=启用,false=禁用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@ public class PqcInspectionRuleDetailVO {
|
|||
*/
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 规则编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,11 +22,6 @@ public class PqcInspectionRuleVO {
|
|||
*/
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 规则编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -85,10 +85,6 @@ public class QmsPqcTaskRecordControllerService {
|
|||
|
||||
VUtil.trueThrowBusinessError(latestRule == null)
|
||||
.throwMessage("未找到机型[" + modelNo + "]的检验规则");
|
||||
|
||||
User inspector = latestRule.getInspectorId() == null ? null : userService.getById(latestRule.getInspectorId());
|
||||
String inspectorName = inspector == null ? null : inspector.getUserName();
|
||||
|
||||
// 2. 生成任务编号(单号生成ID=42)
|
||||
String taskNo = basdeSerialNumberControllerService.generateSerialNumber(42);
|
||||
|
||||
|
|
@ -99,8 +95,6 @@ public class QmsPqcTaskRecordControllerService {
|
|||
.setModelNo(modelNo)
|
||||
.setNo(no)
|
||||
.setInspectionPointId(inspectionPointId)
|
||||
.setReviewerId(latestRule.getInspectorId())
|
||||
.setReviewerName(inspectorName)
|
||||
.setStatus((short) 0) // 0=自检中
|
||||
.setEnable(true)
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
|
|
@ -1037,13 +1031,6 @@ public class QmsPqcTaskRecordControllerService {
|
|||
}
|
||||
|
||||
pqcTaskRecordService.updateById(taskRecord);
|
||||
|
||||
// 5. 自检提交后推送给所有QC人员
|
||||
if (!hasReviewContent) {
|
||||
// 推送给所有QC人员(推送编码:PQCReviewTask)
|
||||
sendTodoMessageToAllQC(taskRecord.getId(), currentUserId, currentUserName, now);
|
||||
}
|
||||
|
||||
// 6. 同步生成工单;仅当任务总体不合格时才额外生成重检任务
|
||||
Map<Long, Long> detailIdMap = getTaskDetailIdMap(taskRecord.getId());
|
||||
List<QmsPqcUnqualifiedItemVO> unqualifiedItems = buildUnqualifiedItems(request, detailIdMap);
|
||||
|
|
@ -1647,29 +1634,6 @@ public class QmsPqcTaskRecordControllerService {
|
|||
sendMessageServices.forEach(service -> service.sendSystemMessage(todoItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送给所有QC人员
|
||||
*/
|
||||
private void sendTodoMessageToAllQC(Long taskId, Long createUserId, String createUserName, LocalDateTime now) {
|
||||
// 查询消息类型ID
|
||||
Long reviewTypeId = dictionaryItemService.getIdByCode("MessageType", "PQCReviewTask");
|
||||
VUtil.trueThrowBusinessError(reviewTypeId == null).throwMessage("消息类型PQCReviewTask不存在");
|
||||
|
||||
// TODO: 根据实际业务获取所有QC人员列表
|
||||
// 这里需要根据角色或用户组查询所有QC人员
|
||||
// 示例:List<User> qcUsers = userService.getUsersByRole("QC");
|
||||
|
||||
// 临时实现:推送给任务的复核人(如果有)
|
||||
QmsPqcTaskRecord taskRecord = pqcTaskRecordService.getById(taskId);
|
||||
if (taskRecord != null && taskRecord.getReviewerId() != null) {
|
||||
sendTodoMessage(taskRecord.getTaskNo(),taskRecord.getReviewerId(), taskRecord.getReviewerName(),
|
||||
taskId, reviewTypeId, createUserId, createUserName, now);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成检查点合并键
|
||||
*/
|
||||
private String buildStepKey(QmsPqcInspectionPoint point) {
|
||||
String stepName = StrUtil.blankToDefault(point.getStepName(), "");
|
||||
String stepDicItemId = point.getStepDicItemId() == null ? "" : point.getStepDicItemId().toString();
|
||||
|
|
|
|||
|
|
@ -192,7 +192,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
// 查询条件
|
||||
queryWrapper.like(StrUtil.isNotBlank(qo.getModelNo()), QmsPqcInspectionRule::getModelNo, qo.getModelNo())
|
||||
.like(StrUtil.isNotBlank(qo.getPqcRuleCode()), QmsPqcInspectionRule::getPqcRuleCode, qo.getPqcRuleCode())
|
||||
.eq(Objects.nonNull(qo.getInspectorId()), QmsPqcInspectionRule::getInspectorId, qo.getInspectorId())
|
||||
.eq(Objects.nonNull(qo.getIsDisabled()), QmsPqcInspectionRule::getIsDisabled, qo.getIsDisabled())
|
||||
.eq(Objects.nonNull(qo.getAuditStatus()), QmsPqcInspectionRule::getAuditStatus, qo.getAuditStatus())
|
||||
.ge(Objects.nonNull(qo.getCreateTimeStart()), QmsPqcInspectionRule::getCreateTime, qo.getCreateTimeStart() == null ? null : qo.getCreateTimeStart().atStartOfDay())
|
||||
|
|
@ -276,7 +275,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
// 创建规则主表
|
||||
QmsPqcInspectionRule rule = new QmsPqcInspectionRule();
|
||||
rule.setModelNo(qo.getModelNo());
|
||||
rule.setInspectorId(qo.getInspectorId());
|
||||
|
||||
// 规则编号为空时自动生成
|
||||
rule.setPqcRuleCode(StrUtil.isNotBlank(qo.getPqcRuleCode())
|
||||
|
|
@ -319,7 +317,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
}
|
||||
|
||||
existRule.setModelNo(qo.getModelNo());
|
||||
existRule.setInspectorId(qo.getInspectorId());
|
||||
existRule.setUpdateBy(operatorId);
|
||||
existRule.setUpdateName(operator);
|
||||
existRule.setUpdateTime(now);
|
||||
|
|
@ -376,7 +373,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
// 创建新规则
|
||||
QmsPqcInspectionRule newRule = new QmsPqcInspectionRule();
|
||||
newRule.setModelNo(existRule.getModelNo());
|
||||
newRule.setInspectorId(existRule.getInspectorId());
|
||||
newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40));
|
||||
newRule.setRuleVersion(getNextRuleVersion(existRule.getModelNo()));
|
||||
newRule.setIsDisabled(true);
|
||||
|
|
@ -549,7 +545,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
|
||||
QmsPqcInspectionRule newRule = new QmsPqcInspectionRule();
|
||||
newRule.setModelNo(existRule.getModelNo());
|
||||
newRule.setInspectorId(existRule.getInspectorId());
|
||||
newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40));
|
||||
newRule.setRuleVersion(existRule.getRuleVersion() == null ? 1 : existRule.getRuleVersion() + 1);
|
||||
newRule.setIsDisabled(existRule.getIsDisabled());
|
||||
|
|
@ -749,22 +744,8 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
StrUtil.isBlank(dto.getInspectionMethodsText()) &&
|
||||
StrUtil.isBlank(dto.getInspectionLevelText()) &&
|
||||
StrUtil.isBlank(dto.getInspectionImage()) &&
|
||||
Objects.isNull(dto.getInspectorId()) &&
|
||||
Objects.isNull(dto.getSort()));
|
||||
}
|
||||
|
||||
private Long resolveImportInspectorId(List<PqcInspectionRuleImportDTO> rows) {
|
||||
List<Long> inspectorIds = rows.stream()
|
||||
.map(PqcInspectionRuleImportDTO::getInspectorId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (inspectorIds.size() > 1) {
|
||||
throw new NflgException(STATE.BusinessError, "同一机型编号只能填写一个质检员ID");
|
||||
}
|
||||
return inspectorIds.isEmpty() ? null : inspectorIds.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void importFromExcel(MultipartFile file, String importMode) throws Exception {
|
||||
|
|
@ -846,7 +827,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
for (Map.Entry<String, List<PqcInspectionRuleImportDTO>> entry : modelNoGroups.entrySet()) {
|
||||
String modelNo = entry.getKey();
|
||||
List<PqcInspectionRuleImportDTO> modelRows = entry.getValue();
|
||||
Long importInspectorId = resolveImportInspectorId(modelRows);
|
||||
|
||||
// 查找该机型编号的最高版本规则
|
||||
QmsPqcInspectionRule highestRule = ruleService.lambdaQuery()
|
||||
|
|
@ -861,7 +841,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
// 该机型无规则,新建
|
||||
QmsPqcInspectionRule newRule = new QmsPqcInspectionRule();
|
||||
newRule.setModelNo(modelNo);
|
||||
newRule.setInspectorId(importInspectorId);
|
||||
newRule.setPqcRuleCode(serialNumberControllerService.generateSerialNumber(40));
|
||||
newRule.setRuleVersion(1);
|
||||
newRule.setIsDisabled(true);
|
||||
|
|
@ -882,16 +861,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
targetRuleId = highestRule.getId();
|
||||
}
|
||||
|
||||
if (importInspectorId != null) {
|
||||
ruleService.lambdaUpdate()
|
||||
.eq(QmsPqcInspectionRule::getId, targetRuleId)
|
||||
.set(QmsPqcInspectionRule::getInspectorId, importInspectorId)
|
||||
.set(QmsPqcInspectionRule::getUpdateBy, operatorId)
|
||||
.set(QmsPqcInspectionRule::getUpdateName, operator)
|
||||
.set(QmsPqcInspectionRule::getUpdateTime, now)
|
||||
.update();
|
||||
}
|
||||
|
||||
// 按 (步装名称 + 检查点编号) 分组,构建检查点和检查项的层级结构
|
||||
// 使用 "stepName|inspectionPointCode" 作为分组key
|
||||
Map<String, List<PqcInspectionRuleImportDTO>> pointGroups = modelRows.stream()
|
||||
|
|
@ -1180,7 +1149,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
LambdaQueryWrapper<QmsPqcInspectionRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(qo.getModelNo()), QmsPqcInspectionRule::getModelNo, qo.getModelNo())
|
||||
.like(StrUtil.isNotBlank(qo.getPqcRuleCode()), QmsPqcInspectionRule::getPqcRuleCode, qo.getPqcRuleCode())
|
||||
.eq(Objects.nonNull(qo.getInspectorId()), QmsPqcInspectionRule::getInspectorId, qo.getInspectorId())
|
||||
.eq(Objects.nonNull(qo.getIsDisabled()), QmsPqcInspectionRule::getIsDisabled, qo.getIsDisabled())
|
||||
.eq(Objects.nonNull(qo.getAuditStatus()), QmsPqcInspectionRule::getAuditStatus, qo.getAuditStatus())
|
||||
.ge(StrUtil.isNotBlank(qo.getCreateTimeStart()), QmsPqcInspectionRule::getCreateTime, qo.getCreateTimeStart())
|
||||
|
|
@ -1207,7 +1175,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
for (QmsPqcInspectionPointItems item : items) {
|
||||
PqcInspectionRuleExportDTO dto = new PqcInspectionRuleExportDTO();
|
||||
dto.setModelNo(rule.getModelNo());
|
||||
dto.setInspectorId(rule.getInspectorId());
|
||||
dto.setStepName(point.getStepName());
|
||||
dto.setInspectionPointCode(point.getInspectionPointCode());
|
||||
dto.setInspectionPointName(point.getInspectionPointName());
|
||||
|
|
@ -1256,7 +1223,6 @@ public class QmsPqcInspectionRuleControllerServiceImpl implements QmsPqcInspecti
|
|||
public void downloadTemplate(HttpServletResponse response) throws IOException {
|
||||
PqcInspectionRuleImportTemplateDTO example = new PqcInspectionRuleImportTemplateDTO()
|
||||
.setModelNo("示例机型编号")
|
||||
.setInspectorId(1L)
|
||||
.setStepName("示例步装名称")
|
||||
.setInspectionPointCode("示例检查点编号")
|
||||
.setInspectionPointName("示例检查点名称")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ public class PqcInspectionRuleExportDTO {
|
|||
* 质检员ID
|
||||
*/
|
||||
@ExcelColumn("质检员ID")
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 步装名称
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ public class PqcInspectionRuleImportDTO {
|
|||
* 质检员ID
|
||||
*/
|
||||
@ExcelColumn("质检员ID")
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 步装名称(必填)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ public class PqcInspectionRuleImportTemplateDTO {
|
|||
private String modelNo;
|
||||
|
||||
@ExcelColumn("质检员ID")
|
||||
private Long inspectorId;
|
||||
|
||||
@ExcelColumn("步装名称*")
|
||||
private String stepName;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ public class PqcInspectionRuleExportQO {
|
|||
|
||||
private String pqcRuleCode;
|
||||
|
||||
private Long inspectorId;
|
||||
|
||||
private Boolean isDisabled;
|
||||
|
||||
private Integer auditStatus;
|
||||
|
|
|
|||
|
|
@ -35,12 +35,6 @@ public class QmsPqcInspectionRule implements Serializable {
|
|||
* 机型编号
|
||||
*/
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检员id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 规则编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.nflg.wms.common.pojo.vo.*;
|
|||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.repository.entity.QmsInspectorMaterialCategoryItem;
|
||||
import com.nflg.wms.repository.entity.QmsInspectorMaterialItem;
|
||||
import com.nflg.wms.repository.entity.QmsPqcInspectionRule;
|
||||
import com.nflg.wms.repository.entity.QmsQcMaterialCategory;
|
||||
import com.nflg.wms.repository.entity.QmsQualityInspector;
|
||||
import com.nflg.wms.repository.entity.User;
|
||||
|
|
@ -32,7 +31,6 @@ import com.nflg.wms.repository.service.IPositionService;
|
|||
import com.nflg.wms.repository.service.IUserInteriorService;
|
||||
import com.nflg.wms.repository.service.IQmsQcMaterialCategoryService;
|
||||
import com.nflg.wms.repository.service.IQmsQualityInspectorService;
|
||||
import com.nflg.wms.repository.service.IQmsPqcInspectionRuleService;
|
||||
import com.nflg.wms.repository.service.IUserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -75,10 +73,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
|
||||
@Resource
|
||||
private IPositionService positionService;
|
||||
|
||||
@Resource
|
||||
private IQmsPqcInspectionRuleService pqcInspectionRuleService;
|
||||
|
||||
// ========================= 工具方法 =========================
|
||||
|
||||
/**
|
||||
|
|
@ -94,108 +88,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
return categories.stream()
|
||||
.collect(Collectors.toMap(QmsQcMaterialCategory::getCategoryCode, QmsQcMaterialCategory::getId));
|
||||
}
|
||||
|
||||
private List<String> normalizeModelNos(List<String> modelNos) {
|
||||
if (CollectionUtils.isEmpty(modelNos)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return modelNos.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim)
|
||||
.filter(modelNo -> !modelNo.isEmpty())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void savePqcModelBindings(Long inspectorId, List<String> modelNos) {
|
||||
List<String> normalizedModelNos = normalizeModelNos(modelNos);
|
||||
if (!normalizedModelNos.isEmpty()) {
|
||||
List<String> existingModelNos = pqcInspectionRuleService.lambdaQuery()
|
||||
.in(QmsPqcInspectionRule::getModelNo, normalizedModelNos)
|
||||
.list()
|
||||
.stream()
|
||||
.map(QmsPqcInspectionRule::getModelNo)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (existingModelNos.size() != normalizedModelNos.size()) {
|
||||
List<String> missingModelNos = normalizedModelNos.stream()
|
||||
.filter(modelNo -> !existingModelNos.contains(modelNo))
|
||||
.collect(Collectors.toList());
|
||||
throw new NflgException(STATE.BusinessError, "PQC机型规则不存在:" + String.join(",", missingModelNos));
|
||||
}
|
||||
}
|
||||
|
||||
pqcInspectionRuleService.lambdaUpdate()
|
||||
.eq(QmsPqcInspectionRule::getInspectorId, inspectorId)
|
||||
.set(QmsPqcInspectionRule::getInspectorId, null)
|
||||
.update();
|
||||
|
||||
if (normalizedModelNos.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
pqcInspectionRuleService.lambdaUpdate()
|
||||
.in(QmsPqcInspectionRule::getModelNo, normalizedModelNos)
|
||||
.set(QmsPqcInspectionRule::getInspectorId, inspectorId)
|
||||
.set(QmsPqcInspectionRule::getUpdateBy, UserUtil.getUserId())
|
||||
.set(QmsPqcInspectionRule::getUpdateName, UserUtil.getUserName())
|
||||
.set(QmsPqcInspectionRule::getUpdateTime, LocalDateTime.now())
|
||||
.update();
|
||||
}
|
||||
|
||||
private List<QmsQualityInspectorPqcModelVO> getPqcModelsByInspectorId(Long inspectorId) {
|
||||
if (inspectorId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return pqcInspectionRuleService.lambdaQuery()
|
||||
.eq(QmsPqcInspectionRule::getInspectorId, inspectorId)
|
||||
.orderByAsc(QmsPqcInspectionRule::getModelNo)
|
||||
.list()
|
||||
.stream()
|
||||
.map(rule -> {
|
||||
QmsQualityInspectorPqcModelVO vo = new QmsQualityInspectorPqcModelVO();
|
||||
vo.setPqcRuleId(rule.getId());
|
||||
vo.setModelNo(rule.getModelNo());
|
||||
vo.setPqcRuleCode(rule.getPqcRuleCode());
|
||||
vo.setRuleVersion(rule.getRuleVersion());
|
||||
return vo;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void fillPqcModelNos(List<QmsQualityInspectorVO> records) {
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
return;
|
||||
}
|
||||
List<Long> inspectorIds = records.stream()
|
||||
.filter(vo -> Objects.equals(vo.getInspectionType(), 2))
|
||||
.map(QmsQualityInspectorVO::getId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (inspectorIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<Long, List<String>> modelNoMap = pqcInspectionRuleService.lambdaQuery()
|
||||
.in(QmsPqcInspectionRule::getInspectorId, inspectorIds)
|
||||
.list()
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
QmsPqcInspectionRule::getInspectorId,
|
||||
Collectors.mapping(QmsPqcInspectionRule::getModelNo,
|
||||
Collectors.collectingAndThen(Collectors.toList(), modelNos -> modelNos.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList())))
|
||||
));
|
||||
records.forEach(vo -> {
|
||||
if (Objects.equals(vo.getInspectionType(), 2)) {
|
||||
vo.setPqcModelNos(modelNoMap.getOrDefault(vo.getId(), Collections.emptyList()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private QmsQualityInspector getPqcInspector(Long id) {
|
||||
QmsQualityInspector inspector = getById(id);
|
||||
if (Objects.isNull(inspector)) {
|
||||
|
|
@ -339,8 +231,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
.setUpdateBy(operator)
|
||||
.setUpdateTime(now);
|
||||
save(inspector);
|
||||
|
||||
savePqcModelBindings(inspector.getId(), request.getModelNos());
|
||||
}
|
||||
|
||||
// ========================= 删除 =========================
|
||||
|
|
@ -364,12 +254,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
materialCategoryItemService.lambdaUpdate()
|
||||
.eq(QmsInspectorMaterialCategoryItem::getInspectorId, id)
|
||||
.remove();
|
||||
if (Objects.equals(inspector.getInspectionType(), 2)) {
|
||||
pqcInspectionRuleService.lambdaUpdate()
|
||||
.eq(QmsPqcInspectionRule::getInspectorId, inspector.getId())
|
||||
.set(QmsPqcInspectionRule::getInspectorId, null)
|
||||
.update();
|
||||
}
|
||||
// 删除主表
|
||||
removeById(id);
|
||||
}
|
||||
|
|
@ -488,7 +372,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
@Override
|
||||
public void updatePqc(QmsQualityInspectorPqcUpdateQO request) {
|
||||
QmsQualityInspector inspector = getPqcInspector(request.getId());
|
||||
savePqcModelBindings(inspector.getId(), request.getModelNos());
|
||||
lambdaUpdate()
|
||||
.eq(QmsQualityInspector::getId, request.getId())
|
||||
.set(QmsQualityInspector::getUpdateBy, UserUtil.getUserName())
|
||||
|
|
@ -501,7 +384,6 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
@Override
|
||||
public IPage<QmsQualityInspectorVO> search(QmsQualityInspectorSearchQO request) {
|
||||
IPage<QmsQualityInspectorVO> page = baseMapper.searchPage(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
fillPqcModelNos(page.getRecords());
|
||||
return page;
|
||||
}
|
||||
|
||||
|
|
@ -571,7 +453,7 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
}
|
||||
detail.setMaterials(Collections.emptyList());
|
||||
detail.setCategories(Collections.emptyList());
|
||||
detail.setPqcModels(getPqcModelsByInspectorId(inspector.getId()));
|
||||
detail.setPqcModels(Collections.emptyList());
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,14 +48,6 @@
|
|||
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="request.pqcModelNo != null and request.pqcModelNo != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM qms_pqc_inspection_rule pir
|
||||
WHERE pir.inspector_id = qi.id
|
||||
AND pir.model_no ilike concat('%', #{request.pqcModelNo}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="request.inspectionType != null">
|
||||
AND qi.inspection_type = #{request.inspectionType}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue