feat(qms): 实现来料与库存检验任务管理功能
- 新增外部接口支持来料检验申请和库存检测申请 - 创建来料检验任务实体及相关服务接口 - 实现质检物料验证及最新有效检验标准关联校验 - 自动分配质检人员,支持人员转办机制 - 自动生成检测单号并计算任务要求完成时间 - 提供任务列表分页查询、详情查询和当前用户待检验任务查询 - 实现任务转办功能,禁止已检任务转办 - 完善检验任务AQL方案自动生成逻辑 - 增加请求参数校验,确保数据完整性和合法性 - 管理库存检测申请中特殊字段:仓库、储位及存储时长的填写与存储
This commit is contained in:
parent
02358e6f51
commit
a330999d47
|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
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.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,6 +36,14 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
||||||
return ApiResult.success(incomingInspectionTaskControllerService.search(request));
|
return ApiResult.success(incomingInspectionTaskControllerService.search(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询任务详情
|
||||||
|
*/
|
||||||
|
@GetMapping("detail")
|
||||||
|
public ApiResult<QmsIncomingInspectionTaskVO> detail(@RequestParam Long id) {
|
||||||
|
return ApiResult.success(incomingInspectionTaskControllerService.getDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转办
|
* 转办
|
||||||
*/
|
*/
|
||||||
|
|
@ -47,7 +56,7 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询当前登录用户的待检验任务列表
|
* 查询当前登录用户的待检验任务列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("todo-search")
|
@PostMapping("pad/todo-search")
|
||||||
public ApiResult<PageData<QmsIncomingInspectionTaskVO>> todoSearch(@Valid @RequestBody QmsIncomingInspectionTaskTodoSearchQO request) {
|
public ApiResult<PageData<QmsIncomingInspectionTaskVO>> todoSearch(@Valid @RequestBody QmsIncomingInspectionTaskTodoSearchQO request) {
|
||||||
return ApiResult.success(incomingInspectionTaskControllerService.todoSearch(request));
|
return ApiResult.success(incomingInspectionTaskControllerService.todoSearch(request));
|
||||||
}
|
}
|
||||||
|
|
@ -55,8 +64,9 @@ public class QmsIncomingInspectionTaskController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询当前登录用户的任务数量(待检验数量、检验中数量、已延期数量)
|
* 查询当前登录用户的任务数量(待检验数量、检验中数量、已延期数量)
|
||||||
*/
|
*/
|
||||||
@GetMapping("count")
|
@GetMapping("pad/count")
|
||||||
public ApiResult<QmsIncomingInspectionTaskCountVO> count() {
|
public ApiResult<QmsIncomingInspectionTaskCountVO> count() {
|
||||||
return ApiResult.success(incomingInspectionTaskControllerService.countByCurrentUser());
|
return ApiResult.success(incomingInspectionTaskControllerService.countByCurrentUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nflg.qms.admin.controller.external;
|
||||||
import com.nflg.qms.admin.service.IncomingInspectionTaskControllerService;
|
import com.nflg.qms.admin.service.IncomingInspectionTaskControllerService;
|
||||||
import com.nflg.wms.common.pojo.ApiResult;
|
import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.pojo.qo.ExternalIncomingInspectionApplyQO;
|
import com.nflg.wms.common.pojo.qo.ExternalIncomingInspectionApplyQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.ExternalInventoryInspectionApplyQO;
|
||||||
import com.nflg.wms.starter.BaseController;
|
import com.nflg.wms.starter.BaseController;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
@ -29,9 +30,24 @@ public class ExternalIncomingInspectionTaskController extends BaseController {
|
||||||
* - 如果该物料id不存在对应的检验标准,则返回错误
|
* - 如果该物料id不存在对应的检验标准,则返回错误
|
||||||
* - 要求完成时间 = 当前时间 + 检验标准中的检验周期(天)
|
* - 要求完成时间 = 当前时间 + 检验标准中的检验周期(天)
|
||||||
*/
|
*/
|
||||||
@PostMapping("apply")
|
@PostMapping("incoming-apply")
|
||||||
public ApiResult<Void> apply(@Valid @RequestBody ExternalIncomingInspectionApplyQO request) {
|
public ApiResult<Void> IncomingApply(@Valid @RequestBody ExternalIncomingInspectionApplyQO request) {
|
||||||
incomingInspectionTaskControllerService.apply(request);
|
incomingInspectionTaskControllerService.IncomingApply(request);
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存检测申请
|
||||||
|
* - 每次只能申请一个物料
|
||||||
|
* - 物料编号必须在质检物料表存在,物料id取该物料的最新版本
|
||||||
|
* - 如果该物料id不存在对应的检验标准,则返回错误
|
||||||
|
* - 要求完成时间 = 当前时间 + 检验标准中的检验周期(天)
|
||||||
|
* - 无需供应商信息、送货单号、采购单号
|
||||||
|
* - 额外必填所属仓库、所属储位、存储时长
|
||||||
|
*/
|
||||||
|
@PostMapping("inventory-apply")
|
||||||
|
public ApiResult<Void> inventoryApply(@Valid @RequestBody ExternalInventoryInspectionApplyQO request) {
|
||||||
|
incomingInspectionTaskControllerService.inventoryApply(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
|
||||||
import com.nflg.wms.common.constant.STATE;
|
import com.nflg.wms.common.constant.STATE;
|
||||||
import com.nflg.wms.common.exception.NflgException;
|
import com.nflg.wms.common.exception.NflgException;
|
||||||
import com.nflg.wms.common.pojo.qo.ExternalIncomingInspectionApplyQO;
|
import com.nflg.wms.common.pojo.qo.ExternalIncomingInspectionApplyQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.ExternalInventoryInspectionApplyQO;
|
||||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTodoSearchQO;
|
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTodoSearchQO;
|
||||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||||
|
|
@ -89,7 +90,7 @@ public class IncomingInspectionTaskControllerService {
|
||||||
* - 若质检人员设置了转办人,则使用转办人代替
|
* - 若质检人员设置了转办人,则使用转办人代替
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public void apply(ExternalIncomingInspectionApplyQO request) {
|
public void IncomingApply(ExternalIncomingInspectionApplyQO request) {
|
||||||
// 1. 查询质检物料,取该物料编号下 id 最大的记录(最新版本)
|
// 1. 查询质检物料,取该物料编号下 id 最大的记录(最新版本)
|
||||||
QmsQcMaterial material = qcMaterialService.lambdaQuery()
|
QmsQcMaterial material = qcMaterialService.lambdaQuery()
|
||||||
.eq(QmsQcMaterial::getMaterialNo, request.getMaterialNo())
|
.eq(QmsQcMaterial::getMaterialNo, request.getMaterialNo())
|
||||||
|
|
@ -159,7 +160,8 @@ public class IncomingInspectionTaskControllerService {
|
||||||
.setPurchaseOrderNo(request.getPurchaseOrderNo())
|
.setPurchaseOrderNo(request.getPurchaseOrderNo())
|
||||||
.setPurchaseOrderLine(request.getPurchaseOrderLine())
|
.setPurchaseOrderLine(request.getPurchaseOrderLine())
|
||||||
.setFactory(request.getFactory())
|
.setFactory(request.getFactory())
|
||||||
.setInspectionType(request.getType())
|
.setInspectionType(request.getInspectionType())
|
||||||
|
.setDataType(0)
|
||||||
.setInspectionQty(request.getInspectionQty())
|
.setInspectionQty(request.getInspectionQty())
|
||||||
.setInspectionStatus((short) 0)
|
.setInspectionStatus((short) 0)
|
||||||
.setInspectorId(inspectorId)
|
.setInspectorId(inspectorId)
|
||||||
|
|
@ -186,6 +188,115 @@ public class IncomingInspectionTaskControllerService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存检测申请(对外接口)
|
||||||
|
* 业务规则:
|
||||||
|
* 1. 每次只能申请一个物料
|
||||||
|
* 2. 物料编号必须在质检物料表存在,物料id取质检物料表中该物料的最新版本(id最大)
|
||||||
|
* 3. 如果该物料id不存在对应的已发布检验标准,则返回错误
|
||||||
|
* 4. 要求完成时间 = 当前时间 + 检验标准中的检验周期(单位:天)
|
||||||
|
* 5. 检测单号通过序列号服务自动生成
|
||||||
|
* 6. 无需供应商信息、送货单号、采购单号
|
||||||
|
* 7. 额外记录所属仓库、所属储位、存储时长
|
||||||
|
* 8. 检验人从质检人员表获取(质检类型=1,IQE):
|
||||||
|
* - 优先取物料直接绑定的质检人员
|
||||||
|
* - 其次递归向上查物料类别绑定的质检人员
|
||||||
|
* - 若质检人员设置了转办人,则使用转办人代替
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void inventoryApply(ExternalInventoryInspectionApplyQO request) {
|
||||||
|
// 1. 查询质检物料,取该物料编号下 id 最大的记录(最新版本)
|
||||||
|
QmsQcMaterial material = qcMaterialService.lambdaQuery()
|
||||||
|
.eq(QmsQcMaterial::getMaterialNo, request.getMaterialNo())
|
||||||
|
.orderByDesc(QmsQcMaterial::getId)
|
||||||
|
.last("LIMIT 1")
|
||||||
|
.one();
|
||||||
|
VUtil.trueThrowBusinessError(Objects.isNull(material))
|
||||||
|
.throwMessage("物料编号不存在于质检物料表中");
|
||||||
|
|
||||||
|
// 2. 查询该物料对应的已发布检验标准
|
||||||
|
QmsInspectionStandard standard = inspectionStandardService.lambdaQuery()
|
||||||
|
.eq(QmsInspectionStandard::getMaterialId, material.getId())
|
||||||
|
.eq(QmsInspectionStandard::getPublishStatus, 1)
|
||||||
|
.eq(QmsInspectionStandard::getIsEnabled, true)
|
||||||
|
.orderByDesc(QmsInspectionStandard::getId)
|
||||||
|
.last("LIMIT 1")
|
||||||
|
.one();
|
||||||
|
VUtil.trueThrowBusinessError(Objects.isNull(standard))
|
||||||
|
.throwMessage("该物料不存在对应的检验标准");
|
||||||
|
|
||||||
|
// 3. 查找负责该物料的质检人员(IQE,inspectionType=1)
|
||||||
|
QmsQualityInspector inspector = resolveInspector(material);
|
||||||
|
|
||||||
|
// 4. 若质检人员设置了转办人,则使用转办人代替
|
||||||
|
Long inspectorId;
|
||||||
|
String inspectorName;
|
||||||
|
if (Objects.nonNull(inspector.getChangeUserId())) {
|
||||||
|
QmsQualityInspector agentInspector = qualityInspectorService.lambdaQuery()
|
||||||
|
.eq(QmsQualityInspector::getUserId, inspector.getChangeUserId())
|
||||||
|
.eq(QmsQualityInspector::getInspectionType, 1)
|
||||||
|
.eq(QmsQualityInspector::getEnable, true)
|
||||||
|
.last("LIMIT 1")
|
||||||
|
.one();
|
||||||
|
if (Objects.nonNull(agentInspector)) {
|
||||||
|
inspectorId = agentInspector.getId();
|
||||||
|
User agentUser = userService.getById(agentInspector.getUserId());
|
||||||
|
inspectorName = Objects.nonNull(agentUser) ? agentUser.getUserName() : null;
|
||||||
|
} else {
|
||||||
|
inspectorId = inspector.getId();
|
||||||
|
User inspectorUser = userService.getById(inspector.getUserId());
|
||||||
|
inspectorName = Objects.nonNull(inspectorUser) ? inspectorUser.getUserName() : null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
inspectorId = inspector.getId();
|
||||||
|
User inspectorUser = userService.getById(inspector.getUserId());
|
||||||
|
inspectorName = Objects.nonNull(inspectorUser) ? inspectorUser.getUserName() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 生成检测单号
|
||||||
|
String taskNo = basdeSerialNumberControllerService.generateSerialNumber(35);
|
||||||
|
|
||||||
|
// 6. 计算要求完成时间:当前时间 + 检验周期(天)
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
LocalDateTime requiredFinishTime = now.plusDays(standard.getInspectionCycle());
|
||||||
|
|
||||||
|
// 7. 构建并保存库存检测任务(存入来料检测任务表,dataType=1)
|
||||||
|
QmsIncomingInspectionTask task = new QmsIncomingInspectionTask()
|
||||||
|
.setTaskNo(taskNo)
|
||||||
|
.setMaterialId(material.getId())
|
||||||
|
.setInspectionStandardId(standard.getId())
|
||||||
|
.setFactory(request.getFactory())
|
||||||
|
.setInspectionType(1)
|
||||||
|
.setInspectionQty(request.getInspectionQty())
|
||||||
|
.setWarehouse(request.getWarehouse())
|
||||||
|
.setStorageLocation(request.getStorageLocation())
|
||||||
|
.setStorageDays(request.getStorageDays())
|
||||||
|
.setDataType(1)
|
||||||
|
.setInspectionStatus((short) 0)
|
||||||
|
.setInspectorId(inspectorId)
|
||||||
|
.setInspectorName(inspectorName)
|
||||||
|
.setSubmitTime(now)
|
||||||
|
.setRequiredFinishTime(requiredFinishTime);
|
||||||
|
|
||||||
|
incomingInspectionTaskService.save(task);
|
||||||
|
|
||||||
|
// 8. 生成检验任务AQL方案
|
||||||
|
Long inspectionStandardId = dictionaryItemService.getIdByCode("InspectionStandardTestingMethod", "Sampling");
|
||||||
|
VUtil.trueThrowBusinessError(Objects.isNull(inspectionStandardId)).throwMessage("检测方式不存在");
|
||||||
|
if (Objects.equals(standard.getTestingMethodDictItemId(), inspectionStandardId)) {
|
||||||
|
Pair<Long, Short> aqlType = CalculatedAqlType(task, standard
|
||||||
|
, dictionaryItemService.getListByDictionaryCode("InspectionStandardSQLType"));
|
||||||
|
incomingInspectionTaskAqlRuleService.save(new QmsIncomingInspectionTaskAqlRule()
|
||||||
|
.setTaskId(task.getId())
|
||||||
|
.setInspectionStandardId(standard.getId())
|
||||||
|
.setCalculatedAqlType(aqlType.getLeft())
|
||||||
|
.setUsedAqlType(aqlType.getLeft())
|
||||||
|
.setTriggerCategory(aqlType.getRight())
|
||||||
|
.setTriggerTime(LocalDateTime.now())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private DictionaryItem getAql(Long id, List<DictionaryItem> aqls) {
|
private DictionaryItem getAql(Long id, List<DictionaryItem> aqls) {
|
||||||
return aqls.stream().filter(aql -> Objects.equals(aql.getId(), id)).findFirst().get();
|
return aqls.stream().filter(aql -> Objects.equals(aql.getId(), id)).findFirst().get();
|
||||||
}
|
}
|
||||||
|
|
@ -366,6 +477,15 @@ public class IncomingInspectionTaskControllerService {
|
||||||
return incomingInspectionTaskService.search(request);
|
return incomingInspectionTaskService.search(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询任务详情
|
||||||
|
*/
|
||||||
|
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||||
|
QmsIncomingInspectionTaskVO detail = incomingInspectionTaskService.getDetail(id);
|
||||||
|
VUtil.trueThrowBusinessError(Objects.isNull(detail)).throwMessage("任务不存在");
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前登录用户的待检验任务列表
|
* 查询当前登录用户的待检验任务列表
|
||||||
* 只查询待检验(0)和检验中(1)的任务
|
* 只查询待检验(0)和检验中(1)的任务
|
||||||
|
|
|
||||||
|
|
@ -18,39 +18,45 @@ public class ExternalIncomingInspectionApplyQO {
|
||||||
private String materialNo;
|
private String materialNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检验类型,0:来料检测;1:盘库检测
|
* 检验类型,0:来料检测;
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "检验类型不能为空")
|
@NotNull(message = "检验类型不能为空")
|
||||||
private Integer type;
|
private Integer inspectionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商编号(可选)
|
* 供应商编号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "供应商编号不能为空")
|
||||||
private String supplierCode;
|
private String supplierCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商名称(可选)
|
* 供应商名称
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "供应商名称不能为空")
|
||||||
private String supplierName;
|
private String supplierName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 送货单号(可选)
|
* 送货单号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "送货单号不能为空")
|
||||||
private String deliveryOrderNo;
|
private String deliveryOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 送货单行号(可选)
|
* 送货单行号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "送货单行号不能为空")
|
||||||
private String deliveryOrderLine;
|
private String deliveryOrderLine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单号(可选)
|
* 采购单号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "采购单号不能为空")
|
||||||
private String purchaseOrderNo;
|
private String purchaseOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单行号(可选)
|
* 采购单行号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "采购单行号不能为空")
|
||||||
private String purchaseOrderLine;
|
private String purchaseOrderLine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外接口-库存检测申请 QO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ExternalInventoryInspectionApplyQO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编号(必填)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "物料编号不能为空")
|
||||||
|
private String materialNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工厂(必填)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属工厂不能为空")
|
||||||
|
private String factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验数量(必填),即送检数量
|
||||||
|
*/
|
||||||
|
@NotNull(message = "检验数量不能为空")
|
||||||
|
@Min(value = 1, message = "检验数量必须大于0")
|
||||||
|
private Integer inspectionQty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属仓库(必填)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属仓库不能为空")
|
||||||
|
private String warehouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属储位(必填)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属储位不能为空")
|
||||||
|
private String storageLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储时长(必填,单位:天)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "存储时长不能为空")
|
||||||
|
@Min(value = 1, message = "存储时长必须大于0")
|
||||||
|
private Integer storageDays;
|
||||||
|
}
|
||||||
|
|
@ -34,4 +34,14 @@ public class QmsIncomingInspectionTaskTodoSearchQO extends PageQO {
|
||||||
* 供应商名称(模糊匹配)
|
* 供应商名称(模糊匹配)
|
||||||
*/
|
*/
|
||||||
private String supplierName;
|
private String supplierName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验状态:0=待检,1=检验中,2=已检(不传则默认查 0 和 1)
|
||||||
|
*/
|
||||||
|
private Short inspectionStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已延期:true=已延期,false=未延期
|
||||||
|
*/
|
||||||
|
private Boolean isOverdue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class QmsIncomingInspectionTask implements Serializable {
|
||||||
private String factory;
|
private String factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测类型,0:来料检测;1:盘库检测
|
* 检测类型,0:来料检测;1:库存检测
|
||||||
*/
|
*/
|
||||||
private Integer inspectionType;
|
private Integer inspectionType;
|
||||||
|
|
||||||
|
|
@ -161,6 +161,26 @@ public class QmsIncomingInspectionTask implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long relatedTaskId;
|
private Long relatedTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据分类,0:来料;1:库存
|
||||||
|
*/
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属仓库(库存检测申请时填写)
|
||||||
|
*/
|
||||||
|
private String warehouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属储位(库存检测申请时填写)
|
||||||
|
*/
|
||||||
|
private String storageLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储时长(单位:天,库存检测申请时填写)
|
||||||
|
*/
|
||||||
|
private Integer storageDays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最近更新人id
|
* 最近更新人id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 来料检验任务检验记录
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("qms_incoming_inspection_task_record")
|
||||||
|
public class QmsIncomingInspectionTaskRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检测任务id
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验标准id,关联检验标准表
|
||||||
|
*/
|
||||||
|
private Long inspectionStandardId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验标准项ID
|
||||||
|
*/
|
||||||
|
private Long inspectionStandardItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验标准项内容ID
|
||||||
|
*/
|
||||||
|
private Long inspectionStandardItemContentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料唯一码
|
||||||
|
*/
|
||||||
|
private String materialUniqueNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人姓名
|
||||||
|
*/
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人ID
|
||||||
|
*/
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人姓名
|
||||||
|
*/
|
||||||
|
private String updateUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 来料检验任务检验记录子项
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("qms_incoming_inspection_task_record_item")
|
||||||
|
public class QmsIncomingInspectionTaskRecordItem implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检测任务id
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检测任务记录id
|
||||||
|
*/
|
||||||
|
private Long recordId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测量值
|
||||||
|
*/
|
||||||
|
private BigDecimal measuredValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合格
|
||||||
|
*/
|
||||||
|
private Boolean qualified;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片列表,多个逗号分隔
|
||||||
|
*/
|
||||||
|
private String images;
|
||||||
|
}
|
||||||
|
|
@ -16,4 +16,9 @@ public interface QmsIncomingInspectionTaskMapper extends BaseMapper<QmsIncomingI
|
||||||
IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request, Page<Object> page);
|
IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request, Page<Object> page);
|
||||||
|
|
||||||
IPage<QmsIncomingInspectionTaskVO> todoSearch(QmsIncomingInspectionTaskTodoSearchQO request, Page<Object> page, Long inspectorId);
|
IPage<QmsIncomingInspectionTaskVO> todoSearch(QmsIncomingInspectionTaskTodoSearchQO request, Page<Object> page, Long inspectorId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询任务详情
|
||||||
|
*/
|
||||||
|
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecordItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 来料检验任务检验记录子项 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface QmsIncomingInspectionTaskRecordItemMapper extends BaseMapper<QmsIncomingInspectionTaskRecordItem> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检验任务检验记录 Mapper
|
||||||
|
*/
|
||||||
|
public interface QmsIncomingInspectionTaskRecordMapper extends BaseMapper<QmsIncomingInspectionTaskRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecordItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 来料检验任务检验记录子项 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface IQmsIncomingInspectionTaskRecordItemService extends IService<QmsIncomingInspectionTaskRecordItem> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检验任务检验记录 服务类
|
||||||
|
*/
|
||||||
|
public interface IQmsIncomingInspectionTaskRecordService extends IService<QmsIncomingInspectionTaskRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -40,4 +40,12 @@ public interface IQmsIncomingInspectionTaskService extends IService<QmsIncomingI
|
||||||
* @return 任务数量统计
|
* @return 任务数量统计
|
||||||
*/
|
*/
|
||||||
QmsIncomingInspectionTaskCountVO countByCurrentUser(Long inspectorId);
|
QmsIncomingInspectionTaskCountVO countByCurrentUser(Long inspectorId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询任务详情
|
||||||
|
*
|
||||||
|
* @param id 任务id
|
||||||
|
* @return 任务详情
|
||||||
|
*/
|
||||||
|
QmsIncomingInspectionTaskVO getDetail(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecordItem;
|
||||||
|
import com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordItemMapper;
|
||||||
|
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskRecordItemService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 来料检验任务检验记录子项 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class QmsIncomingInspectionTaskRecordItemServiceImpl extends ServiceImpl<QmsIncomingInspectionTaskRecordItemMapper, QmsIncomingInspectionTaskRecordItem>
|
||||||
|
implements IQmsIncomingInspectionTaskRecordItemService {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nflg.wms.repository.entity.QmsIncomingInspectionTaskRecord;
|
||||||
|
import com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordMapper;
|
||||||
|
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来料检验任务检验记录 服务实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class QmsIncomingInspectionTaskRecordServiceImpl extends ServiceImpl<QmsIncomingInspectionTaskRecordMapper, QmsIncomingInspectionTaskRecord> implements IQmsIncomingInspectionTaskRecordService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -59,4 +59,9 @@ public class QmsIncomingInspectionTaskServiceImpl extends ServiceImpl<QmsIncomin
|
||||||
vo.setOverdueCount(overdueCount);
|
vo.setOverdueCount(overdueCount);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QmsIncomingInspectionTaskVO getDetail(Long id) {
|
||||||
|
return baseMapper.getDetail(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,18 @@
|
||||||
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
|
||||||
<where>
|
<where>
|
||||||
|
<choose>
|
||||||
|
<when test="request.inspectionStatus != null">
|
||||||
|
t.inspection_status = #{request.inspectionStatus}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
t.inspection_status IN (0, 1)
|
t.inspection_status IN (0, 1)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
AND (t.inspector_id = #{inspectorId} OR t.agent_id = #{inspectorId})
|
AND (t.inspector_id = #{inspectorId} OR t.agent_id = #{inspectorId})
|
||||||
|
<if test="request.isOverdue != null">
|
||||||
|
AND t.is_overdue = #{request.isOverdue}
|
||||||
|
</if>
|
||||||
<if test="request.materialNo != null and request.materialNo != ''">
|
<if test="request.materialNo != null and request.materialNo != ''">
|
||||||
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -155,4 +165,46 @@
|
||||||
ORDER BY t.required_finish_time ASC
|
ORDER BY t.required_finish_time ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDetail" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
||||||
|
SELECT
|
||||||
|
t.id,
|
||||||
|
t.task_no,
|
||||||
|
t.material_id,
|
||||||
|
m.material_no,
|
||||||
|
m.material_desc,
|
||||||
|
m.drawing_no_ver,
|
||||||
|
t.inspection_standard_id,
|
||||||
|
s.version AS standard_version,
|
||||||
|
t.supplier_code,
|
||||||
|
t.supplier_name,
|
||||||
|
t.delivery_order_no,
|
||||||
|
t.delivery_order_line,
|
||||||
|
t.purchase_order_no,
|
||||||
|
t.purchase_order_line,
|
||||||
|
t.factory,
|
||||||
|
t.inspection_type,
|
||||||
|
t.inspection_qty,
|
||||||
|
t.qualified_qty,
|
||||||
|
t.unqualified_qty,
|
||||||
|
t.inspection_status,
|
||||||
|
t.inspection_result,
|
||||||
|
t.inspector_id,
|
||||||
|
t.inspector_name,
|
||||||
|
t.agent_id,
|
||||||
|
t.agent_name,
|
||||||
|
t.submit_time,
|
||||||
|
t.inspection_start_time,
|
||||||
|
t.inspection_finish_time,
|
||||||
|
t.required_finish_time,
|
||||||
|
t.is_overdue,
|
||||||
|
t.related_task_no,
|
||||||
|
t.update_user_id,
|
||||||
|
t.update_user_name,
|
||||||
|
t.update_time
|
||||||
|
FROM qms_incoming_inspection_task t
|
||||||
|
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 t.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordItemMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue