一些改动
This commit is contained in:
parent
a330999d47
commit
8ce2bf55a2
|
|
@ -8,15 +8,13 @@ import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTodoSearchQO;
|
|||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskCountVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecord;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检测任务
|
||||
|
|
@ -69,4 +67,11 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
|||
return ApiResult.success(incomingInspectionTaskControllerService.countByCurrentUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检测任务记录
|
||||
*/
|
||||
@GetMapping("pad/records")
|
||||
public ApiResult<List<QmsIncomingInspectionTaskRecord>> getRecords(@RequestParam Long taskId){
|
||||
return ApiResult.success(incomingInspectionTaskControllerService.getRecords(taskId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ public class IncomingInspectionTaskControllerService {
|
|||
@Resource
|
||||
private IQmsSamplingStrictnessTransferRuleService samplingStrictnessTransferRuleService;
|
||||
|
||||
@Resource
|
||||
private IQmsIncomingInspectionTaskRecordService incomingInspectionTaskRecordService;
|
||||
|
||||
/**
|
||||
* 来料检验申请(对外接口)
|
||||
* 业务规则:
|
||||
|
|
@ -566,4 +569,10 @@ public class IncomingInspectionTaskControllerService {
|
|||
.set(QmsIncomingInspectionTask::getUpdateTime, now)
|
||||
.update();
|
||||
}
|
||||
|
||||
public List<QmsIncomingInspectionTaskRecord> getRecords(Long taskId) {
|
||||
return incomingInspectionTaskRecordService.lambdaQuery()
|
||||
.eq(QmsIncomingInspectionTaskRecord::getTaskId, taskId)
|
||||
.list();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,8 +186,10 @@ public class QmsInspectionStandardControllerService {
|
|||
detail.setAqlTypeDictItemId(standard.getAqlTypeDictItemId());
|
||||
// 填充字典项名称
|
||||
Set<Long> standardDictItemIds = new HashSet<>();
|
||||
if (standard.getTestingMethodDictItemId() != null) standardDictItemIds.add(standard.getTestingMethodDictItemId());
|
||||
if (standard.getInspectionLevelDictItemId() != null) standardDictItemIds.add(standard.getInspectionLevelDictItemId());
|
||||
if (standard.getTestingMethodDictItemId() != null)
|
||||
standardDictItemIds.add(standard.getTestingMethodDictItemId());
|
||||
if (standard.getInspectionLevelDictItemId() != null)
|
||||
standardDictItemIds.add(standard.getInspectionLevelDictItemId());
|
||||
if (standard.getAqlTypeDictItemId() != null) standardDictItemIds.add(standard.getAqlTypeDictItemId());
|
||||
if (!standardDictItemIds.isEmpty()) {
|
||||
List<DictionaryItem> standardDictItems = dictionaryItemService.lambdaQuery()
|
||||
|
|
@ -226,7 +228,7 @@ public class QmsInspectionStandardControllerService {
|
|||
List<QmsInspectionStandardItemVO> itemVOs = new ArrayList<>();
|
||||
Set<Long> dictionaryItemIds = new HashSet<>();
|
||||
items.forEach(item -> {
|
||||
dictionaryItemIds.add(item.getSamplingMethodDictItemId());
|
||||
dictionaryItemIds.add(item.getDetectionTypeDictItemId());
|
||||
});
|
||||
List<DictionaryItem> dictionaryItems = CollectionUtil.isEmpty(dictionaryItemIds)
|
||||
? new ArrayList<>()
|
||||
|
|
@ -262,9 +264,9 @@ public class QmsInspectionStandardControllerService {
|
|||
vo.setId(item.getId());
|
||||
vo.setName(item.getName());
|
||||
vo.setSortNo(item.getSortNo());
|
||||
vo.setSamplingMethodDictItemId(item.getSamplingMethodDictItemId());
|
||||
vo.setSamplingMethodDictItemName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getSamplingMethodDictItemId()))
|
||||
vo.setDetectionTypeDictItemId(item.getDetectionTypeDictItemId());
|
||||
vo.setDetectionTypeDictItemName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getDetectionTypeDictItemId()))
|
||||
.findFirst()
|
||||
.map(DictionaryItem::getName)
|
||||
.orElse(null)
|
||||
|
|
@ -289,12 +291,7 @@ public class QmsInspectionStandardControllerService {
|
|||
vo.setTestStandard(content.getTestStandard());
|
||||
vo.setLegend(content.getLegend());
|
||||
vo.setPdfInfo(content.getPdfInfo());
|
||||
vo.setJudgmentTypeDictItemId(content.getJudgmentTypeDictItemId());
|
||||
vo.setJudgmentTypeDictItemName(
|
||||
Optional.ofNullable(dictionaryItemService.getById(content.getJudgmentTypeDictItemId()))
|
||||
.map(DictionaryItem::getName)
|
||||
.orElse(null)
|
||||
);
|
||||
vo.setJudgmentType(content.getJudgmentType());
|
||||
vo.setCreateUserName(content.getCreateUserName());
|
||||
vo.setCreateTime(content.getCreateTime());
|
||||
vo.setUpdateUserName(content.getUpdateUserName());
|
||||
|
|
@ -449,10 +446,10 @@ public class QmsInspectionStandardControllerService {
|
|||
List<Long> newItemIds = new ArrayList<>();
|
||||
for (QmsInspectionStandardSaveQO.InspectionStandardItemQO itemQO : items) {
|
||||
DictionaryItem dictionaryItem = dictionaryItems.stream()
|
||||
.filter(item -> item.getId().equals(itemQO.getSamplingMethodDictItemId()))
|
||||
.filter(item -> item.getId().equals(itemQO.getDetectionTypeDictItemId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(dictionaryItem)).throwMessage("检测项【" + itemQO.getName() + "】设置的抽样方式不存在");
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(dictionaryItem)).throwMessage("检测项【" + itemQO.getName() + "】设置的检测类型不存在");
|
||||
QmsInspectionStandardItem item;
|
||||
|
||||
if (itemQO.getId() != null) {
|
||||
|
|
@ -579,9 +576,7 @@ public class QmsInspectionStandardControllerService {
|
|||
if (qo.getSortNo() != null) {
|
||||
item.setSortNo(qo.getSortNo());
|
||||
}
|
||||
if (qo.getSamplingMethodDictItemId() != null) {
|
||||
item.setSamplingMethodDictItemId(qo.getSamplingMethodDictItemId());
|
||||
}
|
||||
item.setDetectionTypeDictItemId(qo.getDetectionTypeDictItemId());
|
||||
if (qo.getItemType() != null) {
|
||||
item.setItemType(qo.getItemType());
|
||||
}
|
||||
|
|
@ -673,9 +668,6 @@ public class QmsInspectionStandardControllerService {
|
|||
if (qo.getPdfInfo() != null) {
|
||||
content.setPdfInfo(qo.getPdfInfo());
|
||||
}
|
||||
if (qo.getJudgmentTypeDictItemId() != null) {
|
||||
content.setJudgmentTypeDictItemId(qo.getJudgmentTypeDictItemId());
|
||||
}
|
||||
|
||||
content.setUpdateUserId(userId);
|
||||
content.setUpdateUserName(userName);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class QmsInspectionStandardItemControllerService {
|
|||
vo.setTestStandard(content.getTestStandard());
|
||||
vo.setLegend(content.getLegend());
|
||||
vo.setPdfInfo(content.getPdfInfo());
|
||||
vo.setJudgmentTypeDictItemId(content.getJudgmentTypeDictItemId());
|
||||
vo.setJudgmentType(content.getJudgmentType());
|
||||
vo.setCreateUserName(content.getCreateUserName());
|
||||
vo.setCreateTime(content.getCreateTime());
|
||||
vo.setUpdateUserName(content.getUpdateUserName());
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class ExternalIncomingInspectionTaskApiTest {
|
|||
request.setDeliveryOrderLine("10");
|
||||
request.setPurchaseOrderNo("PO20240101001");
|
||||
request.setPurchaseOrderLine("20");
|
||||
request.setType(0);
|
||||
request.setInspectionType(0);
|
||||
|
||||
ApiResult<Void> result = post("/external/incoming-inspection-task/apply", request, new TypeReference<>() {});
|
||||
assertSuccess(result, "完整参数来料检验申请失败");
|
||||
|
|
@ -207,7 +207,6 @@ public class ExternalIncomingInspectionTaskApiTest {
|
|||
ExternalIncomingInspectionApplyQO request = buildValidApplyRequest();
|
||||
request.setMaterialNo(VALID_MATERIAL_NO);
|
||||
request.setInspectionQty(0);
|
||||
request.setType(0);
|
||||
|
||||
ApiResult<Void> result = post("/external/incoming-inspection-task/apply", request, new TypeReference<>() {});
|
||||
// 若业务不允许0数量,则改为 assertFailed
|
||||
|
|
@ -226,7 +225,6 @@ public class ExternalIncomingInspectionTaskApiTest {
|
|||
request.setMaterialNo(VALID_MATERIAL_NO);
|
||||
request.setFactory(VALID_FACTORY);
|
||||
request.setInspectionQty(100);
|
||||
request.setType(0);
|
||||
|
||||
ApiResult<Void> result = post("/external/incoming-inspection-task/apply", request, new TypeReference<>() {});
|
||||
assertSuccess(result, "仅必填字段来料检验申请失败");
|
||||
|
|
@ -243,7 +241,6 @@ public class ExternalIncomingInspectionTaskApiTest {
|
|||
request.setMaterialNo(VALID_MATERIAL_NO);
|
||||
request.setFactory(VALID_FACTORY);
|
||||
request.setInspectionQty(100);
|
||||
request.setType(0);
|
||||
return request;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ import java.time.LocalDate;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsIncomingInspectionTaskSearchQO extends PageQO {
|
||||
|
||||
/**
|
||||
* 类型,0:来料;1:盘库
|
||||
*/
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 物料编码(模糊匹配)
|
||||
*/
|
||||
|
|
@ -57,11 +62,6 @@ public class QmsIncomingInspectionTaskSearchQO extends PageQO {
|
|||
*/
|
||||
private Boolean isOverdue;
|
||||
|
||||
/**
|
||||
* 检测类型,0:来料检测;1:盘库检测
|
||||
*/
|
||||
private Integer inspectionType;
|
||||
|
||||
/**
|
||||
* 送检日期开始
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -108,24 +108,18 @@ public class QmsInspectionStandardSaveQO {
|
|||
*/
|
||||
private Integer sortNo = 0;
|
||||
|
||||
/**
|
||||
* 检测方式,关联字典项id
|
||||
*/
|
||||
@NotNull(message = "检测方式不能为空")
|
||||
private Long testingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 抽样方式,关联字典项id
|
||||
*/
|
||||
@NotNull(message = "抽样方式不能为空")
|
||||
private Long samplingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 检验标准项类型:0-标准检测项,1-尺寸检测项
|
||||
*/
|
||||
@NotNull(message = "检验标准项类型不能为空")
|
||||
private Short itemType;
|
||||
|
||||
/**
|
||||
* 检测类型,关联字典项id(字典编码:InspectionStandardDetectionType)
|
||||
*/
|
||||
@NotNull(message = "检测类型不能为空")
|
||||
private Long detectionTypeDictItemId;
|
||||
|
||||
/**
|
||||
* PDF图纸
|
||||
*/
|
||||
|
|
@ -176,9 +170,9 @@ public class QmsInspectionStandardSaveQO {
|
|||
private String pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型,关联字典项id
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
@NotNull(message = "判定类型不能为空")
|
||||
private Long judgmentTypeDictItemId;
|
||||
private Integer judgmentType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,14 +41,9 @@ public class QmsInspectionStandardItemContentVO {
|
|||
private String pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型字典项ID
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
private Long judgmentTypeDictItemId;
|
||||
|
||||
/**
|
||||
* 判定类型字典项名称
|
||||
*/
|
||||
private String judgmentTypeDictItemName;
|
||||
private Integer judgmentType;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
|
|
|
|||
|
|
@ -26,31 +26,21 @@ public class QmsInspectionStandardItemVO {
|
|||
*/
|
||||
private Integer sortNo;
|
||||
|
||||
/**
|
||||
* 检测方式字典项ID
|
||||
*/
|
||||
private Long testingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 检测方式字典项名称
|
||||
*/
|
||||
private String testingMethodDictItemName;
|
||||
|
||||
/**
|
||||
* 抽样方式字典项ID
|
||||
*/
|
||||
private Long samplingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 抽样方式字典项名称
|
||||
*/
|
||||
private String samplingMethodDictItemName;
|
||||
|
||||
/**
|
||||
* 检验标准项类型:0-标准检测项,1-尺寸检测项
|
||||
*/
|
||||
private Short itemType;
|
||||
|
||||
/**
|
||||
* 检测类型
|
||||
*/
|
||||
private Long detectionTypeDictItemId;
|
||||
|
||||
/**
|
||||
* 检测类型名称
|
||||
*/
|
||||
private String detectionTypeDictItemName;
|
||||
|
||||
/**
|
||||
* PDF图纸
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -60,6 +60,26 @@ public class QmsInspectionStandardVO {
|
|||
*/
|
||||
private String packagingMethodName;
|
||||
|
||||
/**
|
||||
* 检测方式字典项ID
|
||||
*/
|
||||
private Long testingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 检测方式字典项名称
|
||||
*/
|
||||
private String testingMethodDictItemName;
|
||||
|
||||
/**
|
||||
* 抽样方式字典项ID
|
||||
*/
|
||||
private Long samplingMethodDictItemId;
|
||||
|
||||
/**
|
||||
* 抽样方式字典项名称
|
||||
*/
|
||||
private String samplingMethodDictItemName;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,6 +56,16 @@ public class QmsIncomingInspectionTaskRecord implements Serializable {
|
|||
*/
|
||||
private String materialUniqueNo;
|
||||
|
||||
/**
|
||||
* 是否合格
|
||||
*/
|
||||
private Boolean qualified;
|
||||
|
||||
/**
|
||||
* 样本数量
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class QmsInspectionStandardItem implements Serializable {
|
|||
/**
|
||||
* 检测类型,关联字典项id(字典编码:InspectionStandardDetectionType)
|
||||
*/
|
||||
private Long samplingMethodDictItemId;
|
||||
private Long detectionTypeDictItemId;
|
||||
|
||||
/**
|
||||
* 检验标准项类型:0-标准检测项,1-尺寸检测项
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ public class QmsInspectionStandardItemContent implements Serializable {
|
|||
private String pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型,关联字典项id(字典编码:InspectionStandardJudgmentType)
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
private Long judgmentTypeDictItemId;
|
||||
private Integer judgmentType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@
|
|||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
||||
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||
<where>
|
||||
<if test="request.dataType != null">
|
||||
AND t.data_type = #{request.dataType}
|
||||
</if>
|
||||
<if test="request.materialNo != null and request.materialNo != ''">
|
||||
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
</if>
|
||||
|
|
@ -69,9 +72,6 @@
|
|||
<if test="request.isOverdue != null">
|
||||
AND t.is_overdue = #{request.isOverdue}
|
||||
</if>
|
||||
<if test="request.inspectionType != null">
|
||||
AND t.inspection_type = #{request.inspectionType}
|
||||
</if>
|
||||
<if test="request.submitStartDate != null">
|
||||
AND t.submit_time >= #{request.submitStartDate}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue