refactor(qms-pdi): 重构PDI检测项及部件管理相关功能
- 将检测项中的部件描述字段改为部件ID,关联部件表数据 - 新增部件管理功能,支持部件的增删改查及排序 - 在PDI检测项新增接口自动处理部件注册及排序 - 批量删除支持区分部件ID和检测项ID,实现联动删除 - 导入检测项时自动识别导入部件,动态创建部件及排序 - 查询检测项时按部件分组返回,提升数据结构清晰度 - 巡检工单及检测结果展示时通过部件ID获取部件名称显示 - 新增API支持根据部件ID查询检测项及现场记录 - QmsPdiReportVO 和 QmsIqcReportVO新增环比统计字段,完善报表数据 - 修改导出模板及分页查询逻辑,统一部件相关字段处理 - 优化图片ID收集及批量查询,提升接口性能和稳定性
This commit is contained in:
parent
acdd965b3c
commit
5bf56b6126
|
|
@ -328,14 +328,14 @@ public class QmsIssueTicketControllerService {
|
|||
String ticketTitle;
|
||||
if (Objects.equals(rules.getInspectionType(), 0)) {
|
||||
// 新机检测:机型编号-机台号-订单编号-出厂检验-检测版本号
|
||||
String machineNo = rules.getMachineNo() != null ? rules.getMachineNo() : "";
|
||||
String machineNo = rules.getModelNo() != null ? rules.getModelNo() : "";
|
||||
String deviceNo = taskRecord.getDeviceNo() != null ? taskRecord.getDeviceNo() : "";
|
||||
String orderNo = taskRecord.getOrderNo() != null ? taskRecord.getOrderNo() : "";
|
||||
String version = rules.getInspectionVersion() != null ? rules.getInspectionVersion() : "";
|
||||
ticketTitle = machineNo + "-" + deviceNo + "-" + orderNo + "-出厂检验-" + version;
|
||||
} else {
|
||||
// 库存检测:机型编号-订单编号-库存检验-检测版本号
|
||||
String machineNo = rules.getMachineNo() != null ? rules.getMachineNo() : "";
|
||||
String machineNo = rules.getModelNo() != null ? rules.getModelNo() : "";
|
||||
String orderNo = taskRecord.getOrderNo() != null ? taskRecord.getOrderNo() : "";
|
||||
String version = rules.getInspectionVersion() != null ? rules.getInspectionVersion() : "";
|
||||
ticketTitle = machineNo + "-" + orderNo + "-库存检验-" + version;
|
||||
|
|
@ -600,6 +600,14 @@ public class QmsIssueTicketControllerService {
|
|||
|
||||
issueTicketToDoService.processed(entity.getId());
|
||||
|
||||
// 推送消息给工单创建人
|
||||
if (entity.getCreateUserId() != null) {
|
||||
QmsIssueTicketToDo todoItem = new QmsIssueTicketToDo()
|
||||
.setTicketId(entity.getId())
|
||||
.setHandlerUserId(entity.getCreateUserId());
|
||||
issueTicketToDoService.save(todoItem);
|
||||
}
|
||||
|
||||
if (request.getApprovalStatus() != 5) {
|
||||
wmsIncomingInspectionTaskCallbackService.processAsync(entity.getSourceId(), request.getApprovalStatus());
|
||||
}
|
||||
|
|
@ -866,6 +874,8 @@ public class QmsIssueTicketControllerService {
|
|||
vo.setCreateUserName(ticket.getCreateUserName());
|
||||
vo.setCreateTime(ticket.getCreateTime());
|
||||
vo.setStatus(ticket.getStatus());
|
||||
vo.setCreateApproval(ticket.getCreateApproval());
|
||||
vo.setCreateApprovalOpinion(ticket.getCreateApprovalOpinion());
|
||||
return vo;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
|
@ -896,14 +906,21 @@ public class QmsIssueTicketControllerService {
|
|||
.eq(QmsIssueTicket::getStatus, (short) 2)
|
||||
.count();
|
||||
|
||||
// 工单总数 = 待处理 + 处理中 + 已完成
|
||||
long totalCount = pendingCount + processingCount + completedCount;
|
||||
Long closedCount = issueTicketService.lambdaQuery()
|
||||
.eq(QmsIssueTicket::getSourceType, (short) 2)
|
||||
.eq(QmsIssueTicket::getCreateUserId, currentUserId)
|
||||
.eq(QmsIssueTicket::getStatus, (short) 3)
|
||||
.count();
|
||||
|
||||
// 工单总数 = 待处理 + 处理中 + 已完成 + 已关闭
|
||||
long totalCount = pendingCount + processingCount + completedCount + closedCount;
|
||||
|
||||
// 设置统计字段
|
||||
pageData.setTotalCount(totalCount);
|
||||
pageData.setPendingCount(pendingCount);
|
||||
pageData.setProcessingCount(processingCount);
|
||||
pageData.setCompletedCount(completedCount);
|
||||
pageData.setClosedCount(closedCount);
|
||||
|
||||
return pageData;
|
||||
}
|
||||
|
|
@ -958,11 +975,11 @@ public class QmsIssueTicketControllerService {
|
|||
String ticketTitle;
|
||||
if (Objects.equals(rules.getInspectionType(), 0)) {
|
||||
// 新品:机型编号-机台号-订单编号-出厂检验-检测版本号
|
||||
ticketTitle = StrUtil.join("-", rules.getMachineNo(), taskRecord.getDeviceNo(),
|
||||
ticketTitle = StrUtil.join("-", rules.getModelNo(), taskRecord.getDeviceNo(),
|
||||
taskRecord.getOrderNo(), "出厂检验", rules.getInspectionVersion());
|
||||
} else {
|
||||
// 库存:机型编号-订单编号-库存检验-检测版本号
|
||||
ticketTitle = StrUtil.join("-", rules.getMachineNo(),
|
||||
ticketTitle = StrUtil.join("-", rules.getModelNo(),
|
||||
taskRecord.getOrderNo(), "库存检验", rules.getInspectionVersion());
|
||||
}
|
||||
|
||||
|
|
@ -1504,6 +1521,8 @@ public class QmsIssueTicketControllerService {
|
|||
vo.setImages(parseImageList(ticket.getImageIds()));
|
||||
vo.setRemark(ticket.getRemark());
|
||||
vo.setStatus(ticket.getStatus());
|
||||
vo.setCreateApproval(ticket.getCreateApproval());
|
||||
vo.setCreateApprovalOpinion(ticket.getCreateApprovalOpinion());
|
||||
vo.setCompleteTime(ticket.getCompleteTime());
|
||||
vo.setApprovalStatus(ticket.getApprovalStatus());
|
||||
vo.setApprovalOpinion(ticket.getApprovalOpinion());
|
||||
|
|
@ -1539,7 +1558,7 @@ public class QmsIssueTicketControllerService {
|
|||
QmsPdiDetectionRules detectionRules = pdiDetectionRulesService.getById(taskRecord.getDetectionRulesId());
|
||||
if (detectionRules != null) {
|
||||
String inspectionTypeStr = detectionRules.getInspectionType() != null && detectionRules.getInspectionType() == 0 ? "新机检测" : "库存检测";
|
||||
vo.setTicketTitle(detectionRules.getMachineNo() + "-" + detectionRules.getOrderNo() + "-" + inspectionTypeStr + "-" + detectionRules.getInspectionVersion());
|
||||
vo.setTicketTitle(detectionRules.getModelNo() + "-" + detectionRules.getOrderNo() + "-" + inspectionTypeStr + "-" + detectionRules.getInspectionVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,15 @@ public class QmsIssueTicketProcessControllerService {
|
|||
.set(QmsIssueTicket::getUpdateUserName, currentUserName)
|
||||
.set(QmsIssueTicket::getUpdateTime, now)
|
||||
.update();
|
||||
|
||||
// 推送消息给工单创建人
|
||||
QmsIssueTicket ticket = issueTicketService.getById(issueTicketId);
|
||||
if (ticket != null && ticket.getCreateUserId() != null) {
|
||||
QmsIssueTicketToDo todoItem = new QmsIssueTicketToDo()
|
||||
.setTicketId(issueTicketId)
|
||||
.setHandlerUserId(ticket.getCreateUserId());
|
||||
issueTicketToDoService.save(todoItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -341,6 +350,14 @@ public class QmsIssueTicketProcessControllerService {
|
|||
issueTicketToDoService.save(todoItem);
|
||||
}
|
||||
}
|
||||
|
||||
// 推送消息给工单创建人
|
||||
if (ticket.getCreateUserId() != null) {
|
||||
QmsIssueTicketToDo todoItem = new QmsIssueTicketToDo()
|
||||
.setTicketId(ticket.getId())
|
||||
.setHandlerUserId(ticket.getCreateUserId());
|
||||
issueTicketToDoService.save(todoItem);
|
||||
}
|
||||
}
|
||||
|
||||
issueTicketToDoService.processed(ticket.getId());
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
|
||||
/**
|
||||
* 计算下一个版本号
|
||||
* 查询相同 machineNo + inspectionType + orderNo 的最大版本号,取最大值(不+1)
|
||||
* 查询相同 modelNo + inspectionType + orderNo 的最大版本号,取最大值(不+1)
|
||||
* 若无匹配记录则返回 v1
|
||||
*/
|
||||
private String calcVersion(String machineNo, Integer inspectionType, String orderNo, Long excludeId) {
|
||||
private String calcVersion(String modelNo, Integer inspectionType, String orderNo, Long excludeId) {
|
||||
var query = pdiDetectionRulesService.lambdaQuery()
|
||||
.eq(QmsPdiDetectionRules::getMachineNo, machineNo)
|
||||
.eq(QmsPdiDetectionRules::getModelNo, modelNo)
|
||||
.eq(QmsPdiDetectionRules::getInspectionType, inspectionType)
|
||||
.eq(QmsPdiDetectionRules::getOrderNo, orderNo);
|
||||
if (excludeId != null) {
|
||||
|
|
@ -109,12 +109,12 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
String operator = UserUtil.getUserName();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 计算版本号(取已有相同 machineNo+inspectionType+orderNo 中的最大版本,若无则 v1)
|
||||
String version = calcVersion(request.getMachineNo(), request.getInspectionType(), request.getOrderNo(), null);
|
||||
// 计算版本号(取已有相同 modelNo+inspectionType+orderNo 中的最大版本,若无则 v1)
|
||||
String version = calcVersion(request.getModelNo(), request.getInspectionType(), request.getOrderNo(), null);
|
||||
|
||||
QmsPdiDetectionRules entity = new QmsPdiDetectionRules()
|
||||
.setRuleNo(basdeSerialNumberControllerService.generateSerialNumber(33))
|
||||
.setMachineNo(request.getMachineNo())
|
||||
.setModelNo(request.getModelNo())
|
||||
.setOrderNo(request.getOrderNo())
|
||||
.setInspectorId(request.getInspectorId())
|
||||
.setInspectionCycle(request.getInspectionCycle())
|
||||
|
|
@ -144,18 +144,18 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
}
|
||||
|
||||
// 用修改后的值(有则用新值,无则用原值)计算版本号
|
||||
String machineNo = StrUtil.isNotBlank(request.getMachineNo()) ? request.getMachineNo() : existing.getMachineNo();
|
||||
String modelNo = StrUtil.isNotBlank(request.getModelNo()) ? request.getModelNo() : existing.getModelNo();
|
||||
Integer inspectionType = request.getInspectionType() != null ? request.getInspectionType() : existing.getInspectionType();
|
||||
String orderNo = StrUtil.isNotBlank(request.getOrderNo()) ? request.getOrderNo() : existing.getOrderNo();
|
||||
|
||||
String version = calcVersion(machineNo, inspectionType, orderNo, request.getId());
|
||||
String version = calcVersion(modelNo, inspectionType, orderNo, request.getId());
|
||||
|
||||
String operator = UserUtil.getUserName();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
pdiDetectionRulesService.lambdaUpdate()
|
||||
.eq(QmsPdiDetectionRules::getId, request.getId())
|
||||
.set(StrUtil.isNotBlank(request.getMachineNo()), QmsPdiDetectionRules::getMachineNo, request.getMachineNo())
|
||||
.set(StrUtil.isNotBlank(request.getModelNo()), QmsPdiDetectionRules::getModelNo, request.getModelNo())
|
||||
.set(request.getInspectorId() != null, QmsPdiDetectionRules::getInspectorId, request.getInspectorId())
|
||||
.set(request.getInspectionCycle() != null, QmsPdiDetectionRules::getInspectionCycle, request.getInspectionCycle())
|
||||
.set(request.getInspectionType() != null, QmsPdiDetectionRules::getInspectionType, request.getInspectionType())
|
||||
|
|
@ -178,7 +178,7 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
public void copy(QmsPdiDetectionRulesCopyQO request) {
|
||||
// 1. 唯一性校验
|
||||
boolean exists = pdiDetectionRulesService.lambdaQuery()
|
||||
.eq(QmsPdiDetectionRules::getMachineNo, request.getMachineNo())
|
||||
.eq(QmsPdiDetectionRules::getModelNo, request.getModelNo())
|
||||
.eq(QmsPdiDetectionRules::getOrderNo, request.getOrderNo())
|
||||
.eq(QmsPdiDetectionRules::getInspectionType, request.getInspectionType())
|
||||
.exists();
|
||||
|
|
@ -193,13 +193,13 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
}
|
||||
|
||||
// 3. 计算版本号并新增主表
|
||||
String version = calcVersion(request.getMachineNo(), request.getInspectionType(), request.getOrderNo(), null);
|
||||
String version = calcVersion(request.getModelNo(), request.getInspectionType(), request.getOrderNo(), null);
|
||||
String operator = UserUtil.getUserName();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
QmsPdiDetectionRules newRule = new QmsPdiDetectionRules()
|
||||
.setRuleNo(basdeSerialNumberControllerService.generateSerialNumber(33))
|
||||
.setMachineNo(request.getMachineNo())
|
||||
.setModelNo(request.getModelNo())
|
||||
.setOrderNo(request.getOrderNo())
|
||||
.setInspectionType(request.getInspectionType())
|
||||
.setInspectorId(source.getInspectorId())
|
||||
|
|
@ -324,7 +324,7 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
if (Boolean.TRUE.equals(enable)) {
|
||||
// 启用:校验同机型编号+销售订单号+检测类型+版本号是否已存在启用记录
|
||||
boolean duplicate = pdiDetectionRulesService.lambdaQuery()
|
||||
.eq(QmsPdiDetectionRules::getMachineNo, existing.getMachineNo())
|
||||
.eq(QmsPdiDetectionRules::getModelNo, existing.getModelNo())
|
||||
.eq(QmsPdiDetectionRules::getOrderNo, existing.getOrderNo())
|
||||
.eq(QmsPdiDetectionRules::getInspectionType, existing.getInspectionType())
|
||||
.eq(QmsPdiDetectionRules::getInspectionVersion, existing.getInspectionVersion())
|
||||
|
|
@ -379,7 +379,7 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
// 逐条更新,重新查同组最大版本号,有则 +1,无则保持 v1
|
||||
for (QmsPdiDetectionRules rule : list) {
|
||||
List<QmsPdiDetectionRules> sameGroup = pdiDetectionRulesService.lambdaQuery()
|
||||
.eq(QmsPdiDetectionRules::getMachineNo, rule.getMachineNo())
|
||||
.eq(QmsPdiDetectionRules::getModelNo, rule.getModelNo())
|
||||
.eq(QmsPdiDetectionRules::getInspectionType, rule.getInspectionType())
|
||||
.eq(QmsPdiDetectionRules::getOrderNo, rule.getOrderNo())
|
||||
.ne(QmsPdiDetectionRules::getId, rule.getId())
|
||||
|
|
@ -446,16 +446,16 @@ public class QmsPdiDetectionRulesControllerService {
|
|||
LocalDateTime now = LocalDateTime.now();
|
||||
for (QmsPdiMachineImportDTO dto : data) {
|
||||
// 校验必填字段
|
||||
if (StrUtil.isBlank(dto.getMachineNo()) || StrUtil.isBlank(dto.getOrderNo())
|
||||
if (StrUtil.isBlank(dto.getModelNo()) || StrUtil.isBlank(dto.getOrderNo())
|
||||
|| dto.getInspectionType() == null || dto.getInspectionCycle() == null
|
||||
|| dto.getInspectorId() == null) {
|
||||
throw new NflgException(STATE.BusinessError,
|
||||
"导入数据存在必填字段为空(机型编号、销售订单号、检测类型、检测周期、质检员ID),请检查文件");
|
||||
}
|
||||
String version = calcVersion(dto.getMachineNo(), dto.getInspectionType(), dto.getOrderNo(), null);
|
||||
String version = calcVersion(dto.getModelNo(), dto.getInspectionType(), dto.getOrderNo(), null);
|
||||
QmsPdiDetectionRules entity = new QmsPdiDetectionRules()
|
||||
.setRuleNo(basdeSerialNumberControllerService.generateSerialNumber(33))
|
||||
.setMachineNo(dto.getMachineNo())
|
||||
.setModelNo(dto.getModelNo())
|
||||
.setOrderNo(dto.getOrderNo())
|
||||
.setInspectorId(dto.getInspectorId())
|
||||
.setInspectionCycle(dto.getInspectionCycle())
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ public class QmsPdiInspectionResultsControllerService {
|
|||
if (task.getDetectionRulesId() != null) {
|
||||
QmsPdiDetectionRules rules = detectionRulesService.getById(task.getDetectionRulesId());
|
||||
if (rules != null) {
|
||||
vo.setMachineNo(rules.getMachineNo());
|
||||
vo.setModelNo(rules.getModelNo());
|
||||
vo.setInspectionVersion(rules.getInspectionVersion());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ public class QmsPdiTaskRecordControllerService {
|
|||
if (record.getDetectionRulesId() != null) {
|
||||
QmsPdiDetectionRules rules = detectionRulesService.getById(record.getDetectionRulesId());
|
||||
if (rules != null) {
|
||||
vo.setMachineNo(rules.getMachineNo());
|
||||
vo.setModelNo(rules.getModelNo());
|
||||
vo.setInspectionVersion(rules.getInspectionVersion());
|
||||
vo.setInspectionType(rules.getInspectionType());
|
||||
// 质检员名称
|
||||
|
|
|
|||
|
|
@ -808,7 +808,7 @@ public class QmsReportControllerService {
|
|||
List<QmsPdiReportVO.MainDefect> defects = new ArrayList<>();
|
||||
for (Map<String, Object> row : top4) {
|
||||
QmsPdiReportVO.MainDefect defect = new QmsPdiReportVO.MainDefect();
|
||||
defect.setMachineNo((String) row.get("machineNo"));
|
||||
defect.setModelNo((String) row.get("machineNo"));
|
||||
long defectCount = ((Number) row.get("defectCount")).longValue();
|
||||
double percentage = top4Total > 0 ? ((double) defectCount / top4Total) * 100 : 0;
|
||||
defect.setPercentage(percentage);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class QmsPdiDetectionRulesExportDTO {
|
|||
private String ruleNo;
|
||||
|
||||
@ExcelColumn("机型编号")
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
@ExcelColumn("销售订单号")
|
||||
private String orderNo;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import lombok.Data;
|
|||
public class QmsPdiMachineExportDTO {
|
||||
|
||||
@ExcelColumn("机型编号")
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
@ExcelColumn("销售订单号")
|
||||
private String orderNo;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class QmsPdiMachineImportDTO {
|
|||
* 机型编号
|
||||
*/
|
||||
@ExcelColumn("*机型编号")
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 销售订单号
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class QmsPdiDetectionRulesAddQO {
|
|||
* 机型编号(必传)
|
||||
*/
|
||||
@NotBlank(message = "机型编号不能为空")
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检负责人id(user.id,必传)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class QmsPdiDetectionRulesCopyQO {
|
|||
* 新机型编号(必传)
|
||||
*/
|
||||
@NotBlank(message = "机型编号不能为空")
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 新销售订单号(必传)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class QmsPdiDetectionRulesSearchQO {
|
|||
/**
|
||||
* 机型编号(可选)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 销售订单号(可选)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class QmsPdiDetectionRulesUpdateQO {
|
|||
/**
|
||||
* 机型编号(可选)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检负责人id(user.id,可选)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public class QmsPdiTaskRecordDefectSearchQO {
|
|||
/**
|
||||
* 机型编号(可选)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 订单编号(可选)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class QmsPdiTaskRecordSearchQO {
|
|||
/**
|
||||
* 机型编号(可选)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 订单编号(可选)
|
||||
|
|
|
|||
|
|
@ -84,10 +84,20 @@ public class QmsIssueTicketDetailVO {
|
|||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0=待流转,1=处理中,2=已完成
|
||||
* 状态:0=待流转,1=处理中,2=已完成,3=已关闭
|
||||
*/
|
||||
private Short status;
|
||||
|
||||
/**
|
||||
* 创建审批状态:0=关闭,1=驳回
|
||||
*/
|
||||
private Short createApproval;
|
||||
|
||||
/**
|
||||
* 创建审批意见
|
||||
*/
|
||||
private String createApprovalOpinion;
|
||||
|
||||
/**
|
||||
* 审批状态:0=通过,1=驳回,2=退货,3=报废,4=维修,5=挑选使用,6=让渡使用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -30,4 +30,9 @@ public class QmsIssueTicketTabletPageData extends PageData<QmsIssueTicketVO> {
|
|||
* 已完成数(status=2)
|
||||
*/
|
||||
private Long completedCount;
|
||||
|
||||
/**
|
||||
* 已关闭数(status=3)
|
||||
*/
|
||||
private Long closedCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class QmsIssueTicketToDoVO {
|
|||
private LocalDateTime completeTime;
|
||||
|
||||
/**
|
||||
* 状态:0=待流转,1=处理中,2=已完成
|
||||
* 状态:0=待流转,1=处理中,2=已完成,3=已关闭
|
||||
*/
|
||||
private Short status;
|
||||
|
||||
|
|
|
|||
|
|
@ -79,10 +79,20 @@ public class QmsIssueTicketVO {
|
|||
private String incidentLocation;
|
||||
|
||||
/**
|
||||
* 状态:0=待流转,1=处理中,2=已完成
|
||||
* 状态:0=待流转,1=处理中,2=已完成,3=已关闭
|
||||
*/
|
||||
private Short status;
|
||||
|
||||
/**
|
||||
* 创建审批状态:0=关闭,1=驳回
|
||||
*/
|
||||
private Short createApproval;
|
||||
|
||||
/**
|
||||
* 创建审批意见
|
||||
*/
|
||||
private String createApprovalOpinion;
|
||||
|
||||
/**
|
||||
* 审批状态:0=通过,1=驳回,2=退货,3=报废,4=维修,5=挑选使用,6=让渡使用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class QmsPdiDetectionRulesVO {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 销售订单号
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class QmsPdiInspectionResultsPageVO {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class QmsPdiReportVO {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 占比(百分比)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class QmsPdiTaskRecordDefectPageVO {
|
|||
/**
|
||||
* 机型编号(来自检测规则)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检状态(固定为2=已完成)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class QmsPdiTaskRecordDetailVO {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 机台编号
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class QmsPdiTaskRecordPageVO {
|
|||
/**
|
||||
* 机型编号(来自检测规则)
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 质检状态:0待检查,1检验中,2已完成
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class QmsPdiTaskRecordSummaryVO {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 机台编号
|
||||
|
|
|
|||
|
|
@ -105,10 +105,20 @@ public class QmsIssueTicket implements Serializable {
|
|||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0=待流转,1=处理中,2=已完成
|
||||
* 状态:0=待流转,1=处理中,2=已完成,3=已关闭
|
||||
*/
|
||||
private Short status;
|
||||
|
||||
/**
|
||||
* 创建审批状态:0=关闭,1=驳回
|
||||
*/
|
||||
private Short createApproval;
|
||||
|
||||
/**
|
||||
* 创建审批意见
|
||||
*/
|
||||
private String createApprovalOpinion;
|
||||
|
||||
/**
|
||||
* 超时状态:0=未超时,1=已超时,2=严重超时
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class QmsPdiDetectionRules implements Serializable {
|
|||
/**
|
||||
* 机型编号
|
||||
*/
|
||||
private String machineNo;
|
||||
private String modelNo;
|
||||
|
||||
/**
|
||||
* 销售订单号
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
SELECT
|
||||
r.id,
|
||||
r.rule_no,
|
||||
r.machine_no,
|
||||
r.model_no,
|
||||
r.order_no,
|
||||
r.inspector_id,
|
||||
u.user_name AS inspector_name,
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
FROM qms_pdi_detection_rules r
|
||||
LEFT JOIN "user" u ON u.id = r.inspector_id
|
||||
<where>
|
||||
<if test="qo.machineNo != null and qo.machineNo != ''">
|
||||
AND r.machine_no = #{qo.machineNo}
|
||||
<if test="qo.modelNo != null and qo.modelNo != ''">
|
||||
AND r.model_no = #{qo.modelNo}
|
||||
</if>
|
||||
<if test="qo.orderNo != null and qo.orderNo != ''">
|
||||
AND r.order_no = #{qo.orderNo}
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<select id="listForExport" resultType="com.nflg.wms.common.pojo.dto.QmsPdiDetectionRulesExportDTO">
|
||||
SELECT
|
||||
r.rule_no,
|
||||
r.machine_no,
|
||||
r.model_no,
|
||||
r.order_no,
|
||||
u.user_name AS inspector_name,
|
||||
r.inspection_cycle,
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<!-- 导出机型 -->
|
||||
<select id="listMachineForExport" resultType="com.nflg.wms.common.pojo.dto.QmsPdiMachineExportDTO">
|
||||
SELECT
|
||||
r.machine_no,
|
||||
r.model_no,
|
||||
r.order_no,
|
||||
CASE r.inspection_type WHEN 0 THEN '新机检测' WHEN 1 THEN '库存检测' ELSE '' END AS inspection_type_name,
|
||||
r.inspection_version,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.QmsPdiInspectionResultsPageVO">
|
||||
SELECT DISTINCT
|
||||
t.id AS taskId,
|
||||
r.machine_no AS machineNo,
|
||||
r.model_no AS machineNo,
|
||||
t.order_no AS orderNo,
|
||||
t.device_no AS deviceNo,
|
||||
t.task_no AS taskNo,
|
||||
|
|
@ -25,17 +25,17 @@
|
|||
<!-- 关键字模糊匹配:机型编号、订单编号、机台编号、任务单号 -->
|
||||
<if test="request.key != null and request.key != ''">
|
||||
AND (
|
||||
r.machine_no ILIKE CONCAT('%', #{request.key}, '%')
|
||||
r.model_no ILIKE CONCAT('%', #{request.key}, '%')
|
||||
OR t.order_no ILIKE CONCAT('%', #{request.key}, '%')
|
||||
OR t.device_no ILIKE CONCAT('%', #{request.key}, '%')
|
||||
OR t.task_no ILIKE CONCAT('%', #{request.key}, '%')
|
||||
)
|
||||
</if>
|
||||
<!-- 任务状态筛选 -->
|
||||
<if test="request.inspectionEnable != null and request.inspectionEnable != 4">
|
||||
<if test="request.inspectionEnable != null and request.inspectionEnable != 9">
|
||||
AND t.inspection_enable = #{request.inspectionEnable}
|
||||
</if>
|
||||
<if test="request.inspectionEnable != null and request.inspectionEnable == 4">
|
||||
<if test="request.inspectionEnable != null and request.inspectionEnable == 9">
|
||||
AND t.overdue = true
|
||||
</if>
|
||||
</where>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<select id="searchTaskList" resultType="com.nflg.wms.common.pojo.vo.QmsPdiInspectionResultsPageVO">
|
||||
SELECT DISTINCT
|
||||
t.id AS taskId,
|
||||
r.machine_no AS machineNo,
|
||||
r.model_no AS machineNo,
|
||||
t.order_no AS orderNo,
|
||||
t.device_no AS deviceNo,
|
||||
t.task_no AS taskNo,
|
||||
|
|
@ -61,10 +61,10 @@
|
|||
<if test="request.userId != null">
|
||||
AND (t.assistant_id = #{request.userId} OR r.inspector_id = #{request.userId})
|
||||
</if>
|
||||
<if test="request.taskStatus != null and request.taskStatus != 3">
|
||||
<if test="request.taskStatus != null and request.taskStatus != 9">
|
||||
AND t.inspection_enable = #{request.taskStatus}
|
||||
</if>
|
||||
<if test="request.taskStatus != null and request.taskStatus == 3">
|
||||
<if test="request.taskStatus != null and request.taskStatus == 9">
|
||||
AND t.overdue = true
|
||||
</if>
|
||||
</where>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
t.warehouse_no AS warehouseNo,
|
||||
r.inspection_type AS inspectionType,
|
||||
r.inspection_version AS inspectionVersion,
|
||||
r.machine_no AS machineNo,
|
||||
r.model_no AS machineNo,
|
||||
t.inspection_enable AS inspectionEnable,
|
||||
t.inspection_inspection AS inspectionInspection,
|
||||
ui.user_name AS inspectorName,
|
||||
|
|
@ -30,8 +30,8 @@
|
|||
<if test="request.inspectionType != null">
|
||||
AND r.inspection_type = #{request.inspectionType}
|
||||
</if>
|
||||
<if test="request.machineNo != null and request.machineNo != ''">
|
||||
AND r.machine_no = #{request.machineNo}
|
||||
<if test="request.modelNo != null and request.modelNo != ''">
|
||||
AND r.model_no = #{request.modelNo}
|
||||
</if>
|
||||
<if test="request.orderNo != null and request.orderNo != ''">
|
||||
AND t.order_no = #{request.orderNo}
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
t.warehouse_no AS warehouseNo,
|
||||
r.inspection_type AS inspectionType,
|
||||
r.inspection_version AS inspectionVersion,
|
||||
r.machine_no AS machineNo,
|
||||
r.model_no AS machineNo,
|
||||
t.inspection_enable AS inspectionEnable,
|
||||
t.inspection_inspection AS inspectionInspection,
|
||||
ui.user_name AS inspectorName,
|
||||
|
|
@ -150,8 +150,8 @@
|
|||
<if test="request.inspectionType != null">
|
||||
AND r.inspection_type = #{request.inspectionType}
|
||||
</if>
|
||||
<if test="request.machineNo != null and request.machineNo != ''">
|
||||
AND r.machine_no = #{request.machineNo}
|
||||
<if test="request.modelNo != null and request.modelNo != ''">
|
||||
AND r.model_no = #{request.modelNo}
|
||||
</if>
|
||||
<if test="request.orderNo != null and request.orderNo != ''">
|
||||
AND t.order_no = #{request.orderNo}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@
|
|||
<!-- 查询PDI主要缺陷(按机型编号统计数量) -->
|
||||
<select id="getPdiMainDefects" resultType="map">
|
||||
SELECT
|
||||
dr.machine_no AS "machineNo",
|
||||
dr.model_no AS "machineNo",
|
||||
COUNT(*) AS "defectCount"
|
||||
FROM qms_pdi_task_record t
|
||||
INNER JOIN qms_pdi_detection_rules dr ON dr.id = t.detection_rules_id
|
||||
WHERE t.submission_time >= #{startTime}
|
||||
AND t.submission_time <= #{endTime}
|
||||
GROUP BY dr.machine_no
|
||||
GROUP BY dr.model_no
|
||||
ORDER BY COUNT(*) DESC
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue