fix(incoming-inspection): 优化样本数量校验和添加物料规格字段
- 修改样本数量校验逻辑,去除测试方法判断,使用检测数量限制样本数量 - 修正剩余样本数量计算,避免超出请求数量 - 在查询中增加检测数量字段,丰富任务详情信息 - 修正样本记录数量统计SQL,计算总检验数量而非计数 - 在检验任务VO中新增物料规格属性,完善物料信息展示
This commit is contained in:
parent
3fd457cdb6
commit
1a933353a3
|
|
@ -756,16 +756,10 @@ public class IncomingInspectionTaskControllerService {
|
||||||
List<QmsIncomingInspectionTaskCheckItemVO> datas = inspectionStandardService.getItemsForCheck(standard.getId());
|
List<QmsIncomingInspectionTaskCheckItemVO> datas = inspectionStandardService.getItemsForCheck(standard.getId());
|
||||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(datas)).throwMessage("未设置检验项目");
|
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(datas)).throwMessage("未设置检验项目");
|
||||||
Integer count = incomingInspectionTaskRecordService.getCount(task.getId());
|
Integer count = incomingInspectionTaskRecordService.getCount(task.getId());
|
||||||
Integer total;
|
VUtil.trueThrowBusinessError(count > task.getDetectionQty()).throwMessage("样本数量不能大于总数量");
|
||||||
if (Objects.equals(standard.getTestingMethodDictItemId(), dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Full"))) {
|
|
||||||
total = task.getInspectionQty();
|
|
||||||
} else {
|
|
||||||
total = getCountOfSampling(task.getId(), task.getInspectionQty(), standard);
|
|
||||||
}
|
|
||||||
VUtil.trueThrowBusinessError(count > total).throwMessage("样本数量不能大于总数量");
|
|
||||||
return new QmsIncomingInspectionTaskCheckDetailVO()
|
return new QmsIncomingInspectionTaskCheckDetailVO()
|
||||||
.setItems(datas)
|
.setItems(datas)
|
||||||
.setCount(total - count)
|
.setCount(Math.min(task.getDetectionQty() - count,request.getNum()))
|
||||||
.setPdfDrawings(
|
.setPdfDrawings(
|
||||||
inspectionStandardItemService.lambdaQuery()
|
inspectionStandardItemService.lambdaQuery()
|
||||||
.select(QmsInspectionStandardItem::getPdfDrawing)
|
.select(QmsInspectionStandardItem::getPdfDrawing)
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,11 @@ public class QmsIncomingInspectionTaskVO {
|
||||||
*/
|
*/
|
||||||
private String drawingNoVer;
|
private String drawingNoVer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料规格
|
||||||
|
*/
|
||||||
|
private String materialSpecifications;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验标准id
|
* 检验标准id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@
|
||||||
t.callback_result,
|
t.callback_result,
|
||||||
t.warehouse,
|
t.warehouse,
|
||||||
t.storage_days,
|
t.storage_days,
|
||||||
t.storage_location
|
t.storage_location,
|
||||||
|
t.detection_qty
|
||||||
FROM qms_incoming_inspection_task t
|
FROM qms_incoming_inspection_task t
|
||||||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
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
|
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||||
|
|
@ -177,51 +178,51 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDetail" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
<select id="getDetail" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
||||||
SELECT
|
SELECT t.id,
|
||||||
t.id,
|
t.task_no,
|
||||||
t.task_no,
|
t.material_id,
|
||||||
t.material_id,
|
m.material_no,
|
||||||
m.material_no,
|
m.material_desc,
|
||||||
m.material_desc,
|
m.drawing_no_ver,
|
||||||
m.drawing_no_ver,
|
m.material_specifications,
|
||||||
t.inspection_standard_id,
|
t.inspection_standard_id,
|
||||||
s.version AS standard_version,
|
s.version AS standard_version,
|
||||||
t.supplier_code,
|
t.supplier_code,
|
||||||
t.supplier_name,
|
t.supplier_name,
|
||||||
t.delivery_order_no,
|
t.delivery_order_no,
|
||||||
t.delivery_order_line,
|
t.delivery_order_line,
|
||||||
t.purchase_order_no,
|
t.purchase_order_no,
|
||||||
t.purchase_order_line,
|
t.purchase_order_line,
|
||||||
t.factory,
|
t.factory,
|
||||||
t.inspection_type,
|
t.inspection_type,
|
||||||
t.inspection_qty,
|
t.inspection_qty,
|
||||||
t.qualified_qty,
|
t.qualified_qty,
|
||||||
t.unqualified_qty,
|
t.unqualified_qty,
|
||||||
t.inspection_status,
|
t.inspection_status,
|
||||||
t.inspection_result,
|
t.inspection_result,
|
||||||
t.inspector_id,
|
t.inspector_id,
|
||||||
t.inspector_name,
|
t.inspector_name,
|
||||||
t.agent_id,
|
t.agent_id,
|
||||||
t.agent_name,
|
t.agent_name,
|
||||||
t.submit_time,
|
t.submit_time,
|
||||||
t.inspection_start_time,
|
t.inspection_start_time,
|
||||||
t.inspection_finish_time,
|
t.inspection_finish_time,
|
||||||
t.required_finish_time,
|
t.required_finish_time,
|
||||||
t.is_overdue,
|
t.is_overdue,
|
||||||
t2.task_no as related_task_no,
|
t2.task_no as related_task_no,
|
||||||
t.update_user_id,
|
t.update_user_id,
|
||||||
t.update_user_name,
|
t.update_user_name,
|
||||||
t.update_time,
|
t.update_time,
|
||||||
t.purchase_group,
|
t.purchase_group,
|
||||||
t.warehouse,
|
t.warehouse,
|
||||||
t.storage_location,
|
t.storage_location,
|
||||||
t.storage_days,
|
t.storage_days,
|
||||||
t.callback_result,
|
t.callback_result,
|
||||||
t.detection_qty
|
t.detection_qty
|
||||||
FROM qms_incoming_inspection_task t
|
FROM qms_incoming_inspection_task t
|
||||||
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
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
|
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
||||||
LEFT JOIN qms_incoming_inspection_task t2 ON t.related_task_id = t2.id
|
LEFT JOIN qms_incoming_inspection_task t2 ON t.related_task_id = t2.id
|
||||||
WHERE t.id = #{id}
|
WHERE t.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@
|
||||||
<mapper namespace="com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordMapper">
|
<mapper namespace="com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordMapper">
|
||||||
|
|
||||||
<select id="getCount" resultType="java.lang.Integer">
|
<select id="getCount" resultType="java.lang.Integer">
|
||||||
SELECT SUM(count) FROM qms_incoming_inspection_task_record WHERE task_id=#{taskId}
|
SELECT COALESCE(SUM(inspection_qty),0) FROM qms_incoming_inspection_task_record WHERE task_id=#{taskId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue