pdi检验管理功能(所属仓库)修改

This commit is contained in:
funny 2026-04-28 11:20:52 +08:00
parent eafe4aeff3
commit a4878dee0b
8 changed files with 46 additions and 0 deletions

View File

@ -65,6 +65,13 @@ public class ExternalPdiTaskRecordControllerService {
throw new NflgException(STATE.BusinessError, "PDI检测规则未发布无法创建检测任务"); throw new NflgException(STATE.BusinessError, "PDI检测规则未发布无法创建检测任务");
} }
// 库存检测inspectionType=1仓库编号必传
if (Objects.equals(rule.getInspectionType(), 1)) {
if (request.getWarehouseNo() == null || request.getWarehouseNo().isBlank()) {
throw new NflgException(STATE.BusinessError, "库存检测时仓库编号不能为空");
}
}
LocalDateTime submissionTime = LocalDateTime.now(); LocalDateTime submissionTime = LocalDateTime.now();
LocalDateTime requiredCompletionTime = submissionTime.plusDays( LocalDateTime requiredCompletionTime = submissionTime.plusDays(
rule.getInspectionCycle() != null ? rule.getInspectionCycle() : 0 rule.getInspectionCycle() != null ? rule.getInspectionCycle() : 0
@ -77,6 +84,7 @@ public class ExternalPdiTaskRecordControllerService {
.setDeviceNo(request.getDeviceNo()) .setDeviceNo(request.getDeviceNo())
.setOrderNo(request.getOrderNo()) .setOrderNo(request.getOrderNo())
.setFactoryNo(request.getFactoryNo()) .setFactoryNo(request.getFactoryNo())
.setWarehouseNo(request.getWarehouseNo())
.setInspectionEnable(0) .setInspectionEnable(0)
.setSubmissionTime(submissionTime) .setSubmissionTime(submissionTime)
.setRequiredCompletionTime(requiredCompletionTime); .setRequiredCompletionTime(requiredCompletionTime);

View File

@ -39,4 +39,9 @@ public class QmsPdiTaskRecordAddQO {
*/ */
@NotBlank(message = "工厂编号不能为空") @NotBlank(message = "工厂编号不能为空")
private String factoryNo; private String factoryNo;
/**
* 仓库编号可选inspectionType=1库存检测时必传
*/
private String warehouseNo;
} }

View File

@ -33,6 +33,11 @@ public class QmsPdiTaskRecordDefectSearchQO {
*/ */
private String factoryNo; private String factoryNo;
/**
* 仓库编号可选
*/
private String warehouseNo;
/** /**
* 检验类型可选0=新机检测1=库存检测 * 检验类型可选0=新机检测1=库存检测
*/ */

View File

@ -39,6 +39,11 @@ public class QmsPdiTaskRecordSearchQO {
*/ */
private String factoryNo; private String factoryNo;
/**
* 仓库编号可选
*/
private String warehouseNo;
/** /**
* 检验类型必传0=静态1=动态2=特殊 * 检验类型必传0=静态1=动态2=特殊
*/ */

View File

@ -35,6 +35,11 @@ public class QmsPdiTaskRecordDefectPageVO {
*/ */
private String factoryNo; private String factoryNo;
/**
* 仓库编号
*/
private String warehouseNo;
/** /**
* 质检类型来自检测规则0=新机检测1=库存检测 * 质检类型来自检测规则0=新机检测1=库存检测
*/ */

View File

@ -35,6 +35,11 @@ public class QmsPdiTaskRecordPageVO {
*/ */
private String factoryNo; private String factoryNo;
/**
* 仓库编号
*/
private String warehouseNo;
/** /**
* 质检类型来自检测规则 * 质检类型来自检测规则
*/ */

View File

@ -86,4 +86,9 @@ public class QmsPdiTaskRecord implements Serializable {
* 订单编号 * 订单编号
*/ */
private String orderNo; private String orderNo;
/**
* 仓库编号
*/
private String warehouseNo;
} }

View File

@ -9,6 +9,7 @@
t.device_no AS deviceNo, t.device_no AS deviceNo,
t.order_no AS orderNo, t.order_no AS orderNo,
t.factory_no AS factoryNo, t.factory_no AS factoryNo,
t.warehouse_no AS warehouseNo,
r.inspection_type AS inspectionType, r.inspection_type AS inspectionType,
r.inspection_version AS inspectionVersion, r.inspection_version AS inspectionVersion,
r.machine_no AS machineNo, r.machine_no AS machineNo,
@ -47,6 +48,9 @@
<if test="request.factoryNo != null and request.factoryNo != ''"> <if test="request.factoryNo != null and request.factoryNo != ''">
AND t.factory_no = #{request.factoryNo} AND t.factory_no = #{request.factoryNo}
</if> </if>
<if test="request.warehouseNo != null and request.warehouseNo != ''">
AND t.warehouse_no = #{request.warehouseNo}
</if>
<!-- 合格物料过滤inspection_enable=0/1不校验inspection_enable=2校验自身结果+检测项结果(type=2除外) --> <!-- 合格物料过滤inspection_enable=0/1不校验inspection_enable=2校验自身结果+检测项结果(type=2除外) -->
AND ( AND (
t.inspection_enable IN (0, 1) t.inspection_enable IN (0, 1)
@ -73,6 +77,7 @@
t.device_no AS deviceNo, t.device_no AS deviceNo,
t.order_no AS orderNo, t.order_no AS orderNo,
t.factory_no AS factoryNo, t.factory_no AS factoryNo,
t.warehouse_no AS warehouseNo,
r.inspection_type AS inspectionType, r.inspection_type AS inspectionType,
r.inspection_version AS inspectionVersion, r.inspection_version AS inspectionVersion,
r.machine_no AS machineNo, r.machine_no AS machineNo,
@ -119,6 +124,9 @@
<if test="request.factoryNo != null and request.factoryNo != ''"> <if test="request.factoryNo != null and request.factoryNo != ''">
AND t.factory_no = #{request.factoryNo} AND t.factory_no = #{request.factoryNo}
</if> </if>
<if test="request.warehouseNo != null and request.warehouseNo != ''">
AND t.warehouse_no = #{request.warehouseNo}
</if>
<if test="request.status != null"> <if test="request.status != null">
AND it.status = #{request.status} AND it.status = #{request.status}
</if> </if>