feat(inspection): 优化送检及检测数量管理
- 调整送检数量字段注释和校验信息的描述 - 在入库检验任务服务逻辑中根据检测方法设置检测数量 - 实体及VO中新增检测数量与已检数量属性,并计算未检数量 - Mapper接口及XML新增获取已检数量的数据库查询方法 - 在获取任务详情时设置已检数量以供前端显示使用
This commit is contained in:
parent
66e5407cbf
commit
b17e1fcec8
|
|
@ -224,6 +224,18 @@ public class IncomingInspectionTaskControllerService {
|
||||||
.setTriggerTime(LocalDateTime.now())
|
.setTriggerTime(LocalDateTime.now())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 9. 设置检测数量
|
||||||
|
Integer total;
|
||||||
|
if (Objects.equals(standard.getTestingMethodDictItemId(), dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Full"))) {
|
||||||
|
total = task.getInspectionQty();
|
||||||
|
} else {
|
||||||
|
total = getCountOfSampling(task.getId(), task.getInspectionQty(), standard);
|
||||||
|
}
|
||||||
|
incomingInspectionTaskService.lambdaUpdate()
|
||||||
|
.set(QmsIncomingInspectionTask::getDetectionQty, total)
|
||||||
|
.eq(QmsIncomingInspectionTask::getId, task.getId())
|
||||||
|
.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -333,6 +345,18 @@ public class IncomingInspectionTaskControllerService {
|
||||||
.setTriggerTime(LocalDateTime.now())
|
.setTriggerTime(LocalDateTime.now())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 9. 设置检测数量
|
||||||
|
Integer total;
|
||||||
|
if (Objects.equals(standard.getTestingMethodDictItemId(), dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Full"))) {
|
||||||
|
total = task.getInspectionQty();
|
||||||
|
} else {
|
||||||
|
total = getCountOfSampling(task.getId(), task.getInspectionQty(), standard);
|
||||||
|
}
|
||||||
|
incomingInspectionTaskService.lambdaUpdate()
|
||||||
|
.set(QmsIncomingInspectionTask::getDetectionQty, total)
|
||||||
|
.eq(QmsIncomingInspectionTask::getId, task.getId())
|
||||||
|
.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private DictionaryItem getAql(Long id, List<DictionaryItem> aqls) {
|
private DictionaryItem getAql(Long id, List<DictionaryItem> aqls) {
|
||||||
|
|
@ -521,6 +545,7 @@ public class IncomingInspectionTaskControllerService {
|
||||||
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||||
QmsIncomingInspectionTaskVO detail = incomingInspectionTaskService.getDetail(id);
|
QmsIncomingInspectionTaskVO detail = incomingInspectionTaskService.getDetail(id);
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(detail)).throwMessage("任务不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(detail)).throwMessage("任务不存在");
|
||||||
|
detail.setInspectedQty(incomingInspectionTaskService.getInspectedQty(id));
|
||||||
return detail;
|
return detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,10 @@ public class ExternalIncomingInspectionApplyQO {
|
||||||
private String factory;
|
private String factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验数量(必填),即送检数量
|
* 送检数量(必填)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "检验数量不能为空")
|
@NotNull(message = "送检数量不能为空")
|
||||||
@Min(value = 1, message = "检验数量必须大于0")
|
@Min(value = 1, message = "送检数量必须大于0")
|
||||||
private Integer inspectionQty;
|
private Integer inspectionQty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class QmsIncomingInspectionTaskVO {
|
||||||
private Integer inspectionType;
|
private Integer inspectionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验数量
|
* 送检数量
|
||||||
*/
|
*/
|
||||||
private Integer inspectionQty;
|
private Integer inspectionQty;
|
||||||
|
|
||||||
|
|
@ -117,6 +117,25 @@ public class QmsIncomingInspectionTaskVO {
|
||||||
*/
|
*/
|
||||||
private Integer unqualifiedQty;
|
private Integer unqualifiedQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测数量
|
||||||
|
*/
|
||||||
|
private Integer detectionQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已检数量
|
||||||
|
*/
|
||||||
|
private Integer inspectedQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未检数量
|
||||||
|
*/
|
||||||
|
private Integer uninspectedQty;
|
||||||
|
|
||||||
|
public Integer getUninspectedQty() {
|
||||||
|
return detectionQty - inspectedQty;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验状态:0=待检,1=已检
|
* 检验状态:0=待检,1=已检
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class QmsIncomingInspectionTask implements Serializable {
|
||||||
private Integer inspectionType;
|
private Integer inspectionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验数量,即送检数量
|
* 送检数量
|
||||||
*/
|
*/
|
||||||
private Integer inspectionQty;
|
private Integer inspectionQty;
|
||||||
|
|
||||||
|
|
@ -102,6 +102,11 @@ public class QmsIncomingInspectionTask implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer unqualifiedQty;
|
private Integer unqualifiedQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测数量
|
||||||
|
*/
|
||||||
|
private Integer detectionQty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验状态:0=待检,1=检验中,2=已检
|
* 检验状态:0=待检,1=检验中,2=已检
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,6 @@ public interface QmsIncomingInspectionTaskMapper extends BaseMapper<QmsIncomingI
|
||||||
* 根据id查询任务详情
|
* 根据id查询任务详情
|
||||||
*/
|
*/
|
||||||
QmsIncomingInspectionTaskVO getDetail(Long id);
|
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||||
|
|
||||||
|
Integer getInspectedQty(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,6 @@ public interface IQmsIncomingInspectionTaskService extends IService<QmsIncomingI
|
||||||
* @return 任务详情
|
* @return 任务详情
|
||||||
*/
|
*/
|
||||||
QmsIncomingInspectionTaskVO getDetail(Long id);
|
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||||
|
|
||||||
|
Integer getInspectedQty(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,9 @@ public class QmsIncomingInspectionTaskServiceImpl extends ServiceImpl<QmsIncomin
|
||||||
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||||
return baseMapper.getDetail(id);
|
return baseMapper.getDetail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getInspectedQty(Long id) {
|
||||||
|
return baseMapper.getInspectedQty(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,8 @@
|
||||||
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
|
||||||
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
|
||||||
|
|
@ -223,4 +224,9 @@
|
||||||
WHERE t.id = #{id}
|
WHERE t.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getInspectedQty" resultType="java.lang.Integer">
|
||||||
|
SELECT SUM(inspection_qty)
|
||||||
|
FROM qms_incoming_inspection_task_record
|
||||||
|
WHERE task_id=#{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue