新增pdi任务详情查询接口
This commit is contained in:
parent
fe277f0744
commit
e8a38ae171
|
|
@ -81,4 +81,13 @@ public class QmsPdiTaskRecordController extends BaseController {
|
||||||
@NotNull(message = "检测记录ID不能为空") @RequestParam Long id) {
|
@NotNull(message = "检测记录ID不能为空") @RequestParam Long id) {
|
||||||
return ApiResult.success(taskRecordControllerService.getInspectionImages(id));
|
return ApiResult.success(taskRecordControllerService.getInspectionImages(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务详情
|
||||||
|
*/
|
||||||
|
@GetMapping("detail")
|
||||||
|
public ApiResult<QmsPdiTaskRecordDetailVO.TaskInfoVO> detail(
|
||||||
|
@NotNull(message = "任务记录ID不能为空") @RequestParam Long id) {
|
||||||
|
return ApiResult.success(taskRecordControllerService.detail(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,14 @@ import com.nflg.wms.repository.entity.QmsPdiDetectionRulesStatusItem;
|
||||||
import com.nflg.wms.repository.entity.QmsPdiInspectionResults;
|
import com.nflg.wms.repository.entity.QmsPdiInspectionResults;
|
||||||
import com.nflg.wms.repository.entity.QmsPdiTaskRecord;
|
import com.nflg.wms.repository.entity.QmsPdiTaskRecord;
|
||||||
import com.nflg.wms.repository.entity.FileUploadRecord;
|
import com.nflg.wms.repository.entity.FileUploadRecord;
|
||||||
|
import com.nflg.wms.repository.entity.User;
|
||||||
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesDeliveryItemService;
|
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesDeliveryItemService;
|
||||||
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesService;
|
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesService;
|
||||||
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesStatusItemService;
|
import com.nflg.wms.repository.service.IQmsPdiDetectionRulesStatusItemService;
|
||||||
import com.nflg.wms.repository.service.IQmsPdiInspectionResultsService;
|
import com.nflg.wms.repository.service.IQmsPdiInspectionResultsService;
|
||||||
import com.nflg.wms.repository.service.IQmsPdiTaskRecordService;
|
import com.nflg.wms.repository.service.IQmsPdiTaskRecordService;
|
||||||
import com.nflg.wms.repository.service.IFileUploadRecordService;
|
import com.nflg.wms.repository.service.IFileUploadRecordService;
|
||||||
|
import com.nflg.wms.repository.service.IUserService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -60,6 +62,9 @@ public class QmsPdiTaskRecordControllerService {
|
||||||
@Resource
|
@Resource
|
||||||
private IFileUploadRecordService fileUploadRecordService;
|
private IFileUploadRecordService fileUploadRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IUserService userService;
|
||||||
|
|
||||||
// ========================= 转办 =========================
|
// ========================= 转办 =========================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -377,4 +382,42 @@ public class QmsPdiTaskRecordControllerService {
|
||||||
}
|
}
|
||||||
return convertImageIdsToVO(result.getInspectionItemImage());
|
return convertImageIdsToVO(result.getInspectionItemImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================= 任务详情 =========================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务详情(订单编号、机型编号、机台编号、检查版本、所属工厂、检测类型、检测结果、质检员、检测完成时间)
|
||||||
|
*/
|
||||||
|
public QmsPdiTaskRecordDetailVO.TaskInfoVO detail(Long id) {
|
||||||
|
QmsPdiTaskRecord record = taskRecordService.getById(id);
|
||||||
|
if (Objects.isNull(record)) {
|
||||||
|
throw new NflgException(STATE.BusinessError, "检测任务记录不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
QmsPdiTaskRecordDetailVO.TaskInfoVO vo = new QmsPdiTaskRecordDetailVO.TaskInfoVO();
|
||||||
|
vo.setOrderNo(record.getOrderNo());
|
||||||
|
vo.setDeviceNo(record.getDeviceNo());
|
||||||
|
vo.setFactoryNo(record.getFactoryNo());
|
||||||
|
vo.setInspectionInspection(record.getInspectionInspection());
|
||||||
|
vo.setDetectionCompletionTime(record.getDetectionCompletionTime());
|
||||||
|
|
||||||
|
// 关联检测规则,获取机型编号、检查版本、检测类型、质检员
|
||||||
|
if (record.getDetectionRulesId() != null) {
|
||||||
|
QmsPdiDetectionRules rules = detectionRulesService.getById(record.getDetectionRulesId());
|
||||||
|
if (rules != null) {
|
||||||
|
vo.setMachineNo(rules.getMachineNo());
|
||||||
|
vo.setInspectionVersion(rules.getInspectionVersion());
|
||||||
|
vo.setInspectionType(rules.getInspectionType());
|
||||||
|
// 质检员名称
|
||||||
|
if (rules.getInspectorId() != null) {
|
||||||
|
User inspector = userService.getById(rules.getInspectorId());
|
||||||
|
if (inspector != null) {
|
||||||
|
vo.setInspectorName(inspector.getUserName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,58 @@ public class QmsPdiTaskRecordDetailVO {
|
||||||
private List<FileDetailVO> inspectionItemImage;
|
private List<FileDetailVO> inspectionItemImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务详情信息VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class TaskInfoVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机型编号
|
||||||
|
*/
|
||||||
|
private String machineNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机台编号
|
||||||
|
*/
|
||||||
|
private String deviceNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查版本
|
||||||
|
*/
|
||||||
|
private String inspectionVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工厂
|
||||||
|
*/
|
||||||
|
private String factoryNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测类型
|
||||||
|
*/
|
||||||
|
private Integer inspectionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测结果:true=合格,false=不合格
|
||||||
|
*/
|
||||||
|
private Boolean inspectionInspection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质检员名称
|
||||||
|
*/
|
||||||
|
private String inspectorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测完成时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime detectionCompletionTime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货前检测项明细VO(图片直接返回URL列表)
|
* 发货前检测项明细VO(图片直接返回URL列表)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue