Compare commits
4 Commits
54a6056231
...
19934273ab
| Author | SHA1 | Date |
|---|---|---|
|
|
19934273ab | |
|
|
187929a838 | |
|
|
756bfae8d9 | |
|
|
c4f618ad9a |
|
|
@ -0,0 +1,43 @@
|
|||
package com.nflg.qms.admin.controller;
|
||||
|
||||
import com.nflg.qms.admin.service.IncomingInspectionTaskControllerService;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
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.RestController;
|
||||
|
||||
/**
|
||||
* 来料检测任务
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/incoming-inspection-task")
|
||||
public class QmsIncomingInspectionTaskController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IncomingInspectionTaskControllerService incomingInspectionTaskControllerService;
|
||||
|
||||
/**
|
||||
* 分页查询来料检测任务列表
|
||||
*/
|
||||
@PostMapping("search")
|
||||
public ApiResult<PageData<QmsIncomingInspectionTaskVO>> search(@Valid @RequestBody QmsIncomingInspectionTaskSearchQO request) {
|
||||
return ApiResult.success(incomingInspectionTaskControllerService.search(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
@PostMapping("transfer")
|
||||
public ApiResult<Void> transfer(@Valid @RequestBody QmsIncomingInspectionTaskTransferQO request) {
|
||||
incomingInspectionTaskControllerService.transfer(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.nflg.qms.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTask;
|
||||
import com.nflg.wms.repository.entity.QmsQualityInspector;
|
||||
import com.nflg.wms.repository.entity.User;
|
||||
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskService;
|
||||
import com.nflg.wms.repository.service.IQmsQualityInspectorService;
|
||||
import com.nflg.wms.repository.service.IUserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 来料检测任务 Controller 服务
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class IncomingInspectionTaskControllerService {
|
||||
|
||||
@Resource
|
||||
private IQmsIncomingInspectionTaskService incomingInspectionTaskService;
|
||||
|
||||
@Resource
|
||||
private IQmsQualityInspectorService qualityInspectorService;
|
||||
|
||||
@Resource
|
||||
private IUserService userService;
|
||||
|
||||
/**
|
||||
* 分页查询来料检测任务列表
|
||||
*/
|
||||
public IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request) {
|
||||
return incomingInspectionTaskService.search(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转办
|
||||
* - 已检状态的任务不允许转办
|
||||
* - 代办人必须在质检人员表中存在
|
||||
* - 更新代办人id、代办人姓名、更新人id、更新人姓名、更新时间
|
||||
*/
|
||||
@Transactional
|
||||
public void transfer(QmsIncomingInspectionTaskTransferQO request) {
|
||||
// 校验代办人是否在质检人员表中存在
|
||||
QmsQualityInspector inspector = qualityInspectorService.lambdaQuery()
|
||||
.eq(QmsQualityInspector::getId, request.getAgentId())
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(inspector))
|
||||
.throwMessage("代办人不存在于质检人员表中");
|
||||
|
||||
// 查询所有目标任务
|
||||
List<QmsIncomingInspectionTask> tasks = incomingInspectionTaskService.listByIds(request.getIds());
|
||||
VUtil.trueThrowBusinessError(tasks.isEmpty())
|
||||
.throwMessage("未找到对应的检测任务");
|
||||
|
||||
// 校验是否存在已检任务
|
||||
boolean hasFinished = tasks.stream()
|
||||
.anyMatch(t -> t.getInspectionStatus() != null && t.getInspectionStatus() == 1);
|
||||
VUtil.trueThrowBusinessError(hasFinished)
|
||||
.throwMessage("已检状态的任务不允许转办");
|
||||
|
||||
String operator = UserUtil.getUserName();
|
||||
Long operatorId = UserUtil.getUserId();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 查询代办人姓名
|
||||
User agentUser = userService.getById(inspector.getUserId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(agentUser))
|
||||
.throwMessage("代办人用户信息不存在");
|
||||
|
||||
// 批量更新代办人信息
|
||||
incomingInspectionTaskService.lambdaUpdate()
|
||||
.eq(QmsIncomingInspectionTask::getInspectionStatus, 0)
|
||||
.in(QmsIncomingInspectionTask::getId, request.getIds())
|
||||
.set(QmsIncomingInspectionTask::getAgentId, inspector.getId())
|
||||
.set(QmsIncomingInspectionTask::getAgentName, agentUser.getUserName())
|
||||
.set(QmsIncomingInspectionTask::getUpdateUserId, operatorId)
|
||||
.set(QmsIncomingInspectionTask::getUpdateUserName, operator)
|
||||
.set(QmsIncomingInspectionTask::getUpdateTime, now)
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.qms.admin.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -53,6 +54,12 @@ public class QmsInspectionStandardControllerService {
|
|||
@Resource
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
|
||||
@Resource
|
||||
private IQmsSamplingPlanService samplingPlanService;
|
||||
|
||||
@Resource
|
||||
private IQmsAqlPriorityValueService aqlPriorityValueService;
|
||||
|
||||
/**
|
||||
* 分页查询检验标准
|
||||
*/
|
||||
|
|
@ -156,7 +163,7 @@ public class QmsInspectionStandardControllerService {
|
|||
detail.setId(standard.getId());
|
||||
detail.setMaterialId(standard.getMaterialId());
|
||||
detail.setDrawingUrl(standard.getDrawingUrl());
|
||||
detail.setVersionNo(standard.getVersion() != null ? standard.getVersion().toString() : null);
|
||||
detail.setVersion(standard.getVersion());
|
||||
detail.setIsEnabled(standard.getIsEnabled());
|
||||
detail.setPackagingMethodId(standard.getPackagingMethodId());
|
||||
detail.setInspectionCycle(standard.getInspectionCycle());
|
||||
|
|
@ -185,12 +192,12 @@ public class QmsInspectionStandardControllerService {
|
|||
dictionaryItemIds.add(item.getSamplingMethodDictItemId());
|
||||
dictionaryItemIds.add(item.getInspectionLevelDictItemId());
|
||||
dictionaryItemIds.add(item.getAqlTypeDictItemId());
|
||||
dictionaryItemIds.add(item.getAqlPriorityValueId());
|
||||
dictionaryItemIds.add(item.getInspectionStandardId());
|
||||
});
|
||||
List<DictionaryItem> dictionaryItems = dictionaryItemService.lambdaQuery()
|
||||
.in(DictionaryItem::getId, dictionaryItemIds)
|
||||
.list();
|
||||
List<DictionaryItem> dictionaryItems = CollectionUtil.isEmpty(dictionaryItemIds)
|
||||
? new ArrayList<>()
|
||||
: dictionaryItemService.lambdaQuery()
|
||||
.in(DictionaryItem::getId, dictionaryItemIds)
|
||||
.list();
|
||||
for (QmsInspectionStandardItem item : items) {
|
||||
QmsInspectionStandardItemVO itemVO = convertToItemVO(item, dictionaryItems);
|
||||
|
||||
|
|
@ -235,12 +242,7 @@ public class QmsInspectionStandardControllerService {
|
|||
.orElse(null)
|
||||
);
|
||||
vo.setSamplingPlanId(item.getSamplingPlanId());
|
||||
vo.setSamplingPlanName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getSamplingPlanId()))
|
||||
.findFirst()
|
||||
.map(DictionaryItem::getName)
|
||||
.orElse(null)
|
||||
);
|
||||
vo.setSamplingPlanName(samplingPlanService.getById(item.getSamplingPlanId()).getPlanName());
|
||||
vo.setInspectionLevelDictItemId(item.getInspectionLevelDictItemId());
|
||||
vo.setInspectionLevelDictItemName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getInspectionLevelDictItemId()))
|
||||
|
|
@ -249,12 +251,7 @@ public class QmsInspectionStandardControllerService {
|
|||
.orElse(null)
|
||||
);
|
||||
vo.setAqlPriorityValueId(item.getAqlPriorityValueId());
|
||||
vo.setAqlPriorityValueName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getAqlPriorityValueId()))
|
||||
.findFirst()
|
||||
.map(DictionaryItem::getName)
|
||||
.orElse(null)
|
||||
);
|
||||
vo.setAqlPriorityValueName(aqlPriorityValueService.getById(item.getAqlPriorityValueId()).getPriorityValue());
|
||||
vo.setAqlTypeDictItemId(item.getAqlTypeDictItemId());
|
||||
vo.setAqlTypeDictItemName(dictionaryItems.stream()
|
||||
.filter(it -> it.getId().equals(item.getAqlTypeDictItemId()))
|
||||
|
|
@ -283,6 +280,11 @@ public class QmsInspectionStandardControllerService {
|
|||
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.setCreateUserName(content.getCreateUserName());
|
||||
vo.setCreateTime(content.getCreateTime());
|
||||
vo.setUpdateUserName(content.getUpdateUserName());
|
||||
|
|
|
|||
|
|
@ -275,6 +275,35 @@ public class QualityNotificationControllerService {
|
|||
// 通知对象类型名称
|
||||
if (vo.getTargetType() != null) {
|
||||
vo.setTargetTypeName(vo.getTargetType() == 1 ? "全部" : "手动选择");
|
||||
if (vo.getTargetType() == 2) {
|
||||
List<QmsQualityNotificationUser> users = notificationUserService.lambdaQuery()
|
||||
.eq(QmsQualityNotificationUser::getNotificationId, vo.getId())
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(users)) {
|
||||
List<Long> userIds = users.stream()
|
||||
.map(QmsQualityNotificationUser::getUserId)
|
||||
.collect(Collectors.toList());
|
||||
List<User> userList = userService.listByIds(userIds);
|
||||
|
||||
List<QmsQualityNotificationUserVO> userVOs = new ArrayList<>();
|
||||
for (QmsQualityNotificationUser nu : users) {
|
||||
User user = userList.stream()
|
||||
.filter(u -> u.getId().equals(nu.getUserId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (user != null) {
|
||||
QmsQualityNotificationUserVO userVO = new QmsQualityNotificationUserVO();
|
||||
userVO.setId(nu.getId());
|
||||
userVO.setNotificationId(nu.getNotificationId());
|
||||
userVO.setUserId(nu.getUserId());
|
||||
userVO.setUserName(user.getUserName());
|
||||
userVO.setUserCode(user.getUserCode());
|
||||
userVOs.add(userVO);
|
||||
}
|
||||
}
|
||||
vo.setUsers(userVOs);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 启用状态名称
|
||||
if (vo.getEnable() != null) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 来料检测任务 - 分页查询QO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsIncomingInspectionTaskSearchQO extends PageQO {
|
||||
|
||||
/**
|
||||
* 物料编码(模糊匹配)
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 采购单号(模糊匹配)
|
||||
*/
|
||||
private String purchaseOrderNo;
|
||||
|
||||
/**
|
||||
* 供应商名称(模糊匹配)
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 检验人姓名(模糊匹配)
|
||||
*/
|
||||
private String inspectorName;
|
||||
|
||||
/**
|
||||
* 检验状态:0=待检,1=已检
|
||||
*/
|
||||
private Short inspectionStatus;
|
||||
|
||||
/**
|
||||
* 所属工厂
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 送货单号(模糊匹配)
|
||||
*/
|
||||
private String deliveryOrderNo;
|
||||
|
||||
/**
|
||||
* 检验结果:true=合格,false=不合格
|
||||
*/
|
||||
private Boolean inspectionResult;
|
||||
|
||||
/**
|
||||
* 是否超期:true=超期,false=未超期
|
||||
*/
|
||||
private Boolean isOverdue;
|
||||
|
||||
/**
|
||||
* 检测类型(字典项id)
|
||||
*/
|
||||
private Long inspectionType;
|
||||
|
||||
/**
|
||||
* 送检日期开始
|
||||
*/
|
||||
private LocalDate submitStartDate;
|
||||
|
||||
/**
|
||||
* 送检日期结束
|
||||
*/
|
||||
private LocalDate submitEndDate;
|
||||
|
||||
/**
|
||||
* 检测日期开始(检验完成时间)
|
||||
*/
|
||||
private LocalDate inspectionStartDate;
|
||||
|
||||
/**
|
||||
* 检测日期结束(检验完成时间)
|
||||
*/
|
||||
private LocalDate inspectionEndDate;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 来料检测任务 - 转办QO
|
||||
*/
|
||||
@Data
|
||||
public class QmsIncomingInspectionTaskTransferQO {
|
||||
|
||||
/**
|
||||
* 任务ID列表(支持多选)
|
||||
*/
|
||||
@NotEmpty(message = "任务ID列表不能为空")
|
||||
private List<Long> ids;
|
||||
|
||||
/**
|
||||
* 代办人id(质检人员表id)
|
||||
*/
|
||||
@NotNull(message = "代办人不能为空")
|
||||
private Long agentId;
|
||||
}
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 来料检测任务 - 查询返回VO
|
||||
*/
|
||||
@Data
|
||||
public class QmsIncomingInspectionTaskVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 检测单号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 图号版本号
|
||||
*/
|
||||
private String drawingNoVer;
|
||||
|
||||
/**
|
||||
* 检验标准id
|
||||
*/
|
||||
private Long inspectionStandardId;
|
||||
|
||||
/**
|
||||
* 检测标准版本号
|
||||
*/
|
||||
private String standardVersion;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierCode;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
private String deliveryOrderNo;
|
||||
|
||||
/**
|
||||
* 送货单行号
|
||||
*/
|
||||
private String deliveryOrderLine;
|
||||
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
private String purchaseOrderNo;
|
||||
|
||||
/**
|
||||
* 采购单行号
|
||||
*/
|
||||
private String purchaseOrderLine;
|
||||
|
||||
/**
|
||||
* 所属工厂
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 检测类型(字典项id)
|
||||
*/
|
||||
private Long inspectionType;
|
||||
|
||||
/**
|
||||
* 检验数量
|
||||
*/
|
||||
private BigDecimal inspectionQty;
|
||||
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private BigDecimal qualifiedQty;
|
||||
|
||||
/**
|
||||
* 不合格数量
|
||||
*/
|
||||
private BigDecimal unqualifiedQty;
|
||||
|
||||
/**
|
||||
* 检验状态:0=待检,1=已检
|
||||
*/
|
||||
private Short inspectionStatus;
|
||||
|
||||
/**
|
||||
* 检验结果:true=合格,false=不合格
|
||||
*/
|
||||
private Boolean inspectionResult;
|
||||
|
||||
/**
|
||||
* 检验人id
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 检验人姓名
|
||||
*/
|
||||
private String inspectorName;
|
||||
|
||||
/**
|
||||
* 代办人id
|
||||
*/
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代办人姓名
|
||||
*/
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 送检时间
|
||||
*/
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
/**
|
||||
* 检验开始时间
|
||||
*/
|
||||
private LocalDateTime inspectionStartTime;
|
||||
|
||||
/**
|
||||
* 检验完成时间
|
||||
*/
|
||||
private LocalDateTime inspectionFinishTime;
|
||||
|
||||
/**
|
||||
* 要求完成时间
|
||||
*/
|
||||
private LocalDateTime requiredFinishTime;
|
||||
|
||||
/**
|
||||
* 是否超期:true=超期,false=未超期
|
||||
*/
|
||||
private Boolean isOverdue;
|
||||
|
||||
/**
|
||||
* 关联检测任务单号
|
||||
*/
|
||||
private Long relatedTaskNo;
|
||||
|
||||
/**
|
||||
* 最近更新人id
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 最近更新人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ public class QmsInspectionStandardDetailVO {
|
|||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String versionNo;
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public class QmsInspectionStandardItemContentVO {
|
|||
*/
|
||||
private Long judgmentTypeDictItemId;
|
||||
|
||||
/**
|
||||
* 判定类型字典项名称
|
||||
*/
|
||||
private String judgmentTypeDictItemName;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nflg.wms.common.pojo.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -72,9 +73,9 @@ public class QmsInspectionStandardItemVO {
|
|||
private Long aqlPriorityValueId;
|
||||
|
||||
/**
|
||||
* AQL值名称
|
||||
* AQL值
|
||||
*/
|
||||
private String aqlPriorityValueName;
|
||||
private BigDecimal aqlPriorityValueName;
|
||||
|
||||
/**
|
||||
* AQL类型字典项ID
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class QmsInspectionStandardVO {
|
|||
/**
|
||||
* 检测版本号
|
||||
*/
|
||||
private String versionNo;
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 所属IQE
|
||||
|
|
@ -55,6 +55,11 @@ public class QmsInspectionStandardVO {
|
|||
*/
|
||||
private Long packagingMethodId;
|
||||
|
||||
/**
|
||||
* 包装类型名称
|
||||
*/
|
||||
private String packagingMethodName;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,179 @@
|
|||
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;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 来料检测任务表
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("qms_incoming_inspection_task")
|
||||
public class QmsIncomingInspectionTask implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 检测单号,自动生成
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 物料id,关联质检物料表
|
||||
*/
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 检验标准id,关联检验标准表
|
||||
*/
|
||||
private Long inspectionStandardId;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierCode;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
private String deliveryOrderNo;
|
||||
|
||||
/**
|
||||
* 送货单行号
|
||||
*/
|
||||
private String deliveryOrderLine;
|
||||
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
private String purchaseOrderNo;
|
||||
|
||||
/**
|
||||
* 采购单行号
|
||||
*/
|
||||
private String purchaseOrderLine;
|
||||
|
||||
/**
|
||||
* 所属工厂
|
||||
*/
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 检测类型,字典项id
|
||||
*/
|
||||
private Long inspectionType;
|
||||
|
||||
/**
|
||||
* 检验数量,即送检数量
|
||||
*/
|
||||
private BigDecimal inspectionQty;
|
||||
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private BigDecimal qualifiedQty;
|
||||
|
||||
/**
|
||||
* 不合格数量
|
||||
*/
|
||||
private BigDecimal unqualifiedQty;
|
||||
|
||||
/**
|
||||
* 检验状态:0=待检,1=已检
|
||||
*/
|
||||
private Short inspectionStatus;
|
||||
|
||||
/**
|
||||
* 检验结果:true=合格,false=不合格
|
||||
*/
|
||||
private Boolean inspectionResult;
|
||||
|
||||
/**
|
||||
* 检验人id,关联质检人员表
|
||||
*/
|
||||
private Long inspectorId;
|
||||
|
||||
/**
|
||||
* 检验人姓名
|
||||
*/
|
||||
private String inspectorName;
|
||||
|
||||
/**
|
||||
* 代办人id,转办后的质检人员id
|
||||
*/
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代办人姓名
|
||||
*/
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 送检时间
|
||||
*/
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
/**
|
||||
* 检验开始时间
|
||||
*/
|
||||
private LocalDateTime inspectionStartTime;
|
||||
|
||||
/**
|
||||
* 检验完成时间
|
||||
*/
|
||||
private LocalDateTime inspectionFinishTime;
|
||||
|
||||
/**
|
||||
* 要求完成时间,送检时间加检验标准中的检测周期
|
||||
*/
|
||||
private LocalDateTime requiredFinishTime;
|
||||
|
||||
/**
|
||||
* 是否超期:true=超期,false=未超期
|
||||
*/
|
||||
private Boolean isOverdue;
|
||||
|
||||
/**
|
||||
* 关联检测任务单号
|
||||
*/
|
||||
private Long relatedTaskNo;
|
||||
|
||||
/**
|
||||
* 最近更新人id
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 最近更新人姓名
|
||||
*/
|
||||
private String updateUserName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTask;
|
||||
|
||||
/**
|
||||
* 来料检测任务 Mapper
|
||||
*/
|
||||
public interface QmsIncomingInspectionTaskMapper extends BaseMapper<QmsIncomingInspectionTask> {
|
||||
|
||||
IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request, Page<Object> page);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTask;
|
||||
|
||||
/**
|
||||
* 来料检测任务 服务类
|
||||
*/
|
||||
public interface IQmsIncomingInspectionTaskService extends IService<QmsIncomingInspectionTask> {
|
||||
|
||||
/**
|
||||
* 分页查询来料检测任务列表
|
||||
*/
|
||||
IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request);
|
||||
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
void transfer(QmsIncomingInspectionTaskTransferQO request);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.nflg.wms.repository.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsIncomingInspectionTaskTransferQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO;
|
||||
import com.nflg.wms.repository.entity.QmsIncomingInspectionTask;
|
||||
import com.nflg.wms.repository.mapper.QmsIncomingInspectionTaskMapper;
|
||||
import com.nflg.wms.repository.service.IQmsIncomingInspectionTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 来料检测任务 服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class QmsIncomingInspectionTaskServiceImpl extends ServiceImpl<QmsIncomingInspectionTaskMapper, QmsIncomingInspectionTask> implements IQmsIncomingInspectionTaskService {
|
||||
|
||||
@Override
|
||||
public IPage<QmsIncomingInspectionTaskVO> search(QmsIncomingInspectionTaskSearchQO request) {
|
||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transfer(QmsIncomingInspectionTaskTransferQO request) {
|
||||
// 转办逻辑由 ControllerService 处理,此处留空
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<?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.QmsIncomingInspectionTaskMapper">
|
||||
|
||||
<select id="search" 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>
|
||||
<if test="request.materialNo != null and request.materialNo != ''">
|
||||
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
</if>
|
||||
<if test="request.purchaseOrderNo != null and request.purchaseOrderNo != ''">
|
||||
AND t.purchase_order_no ilike concat('%', #{request.purchaseOrderNo}, '%')
|
||||
</if>
|
||||
<if test="request.supplierName != null and request.supplierName != ''">
|
||||
AND t.supplier_name ilike concat('%', #{request.supplierName}, '%')
|
||||
</if>
|
||||
<if test="request.inspectorName != null and request.inspectorName != ''">
|
||||
AND t.inspector_name ilike concat('%', #{request.inspectorName}, '%')
|
||||
</if>
|
||||
<if test="request.inspectionStatus != null">
|
||||
AND t.inspection_status = #{request.inspectionStatus}
|
||||
</if>
|
||||
<if test="request.factory != null and request.factory != ''">
|
||||
AND t.factory = #{request.factory}
|
||||
</if>
|
||||
<if test="request.deliveryOrderNo != null and request.deliveryOrderNo != ''">
|
||||
AND t.delivery_order_no ilike concat('%', #{request.deliveryOrderNo}, '%')
|
||||
</if>
|
||||
<if test="request.inspectionResult != null">
|
||||
AND t.inspection_result = #{request.inspectionResult}
|
||||
</if>
|
||||
<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>
|
||||
<if test="request.submitEndDate != null">
|
||||
AND t.submit_time < #{request.submitEndDate} + INTERVAL '1 day'
|
||||
</if>
|
||||
<if test="request.inspectionStartDate != null">
|
||||
AND t.inspection_finish_time >= #{request.inspectionStartDate}
|
||||
</if>
|
||||
<if test="request.inspectionEndDate != null">
|
||||
AND t.inspection_finish_time < #{request.inspectionEndDate} + INTERVAL '1 day'
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -14,10 +14,11 @@
|
|||
m.material_category_code_path_name AS materialCategoryCodePathName,
|
||||
m.material_desc AS materialDesc,
|
||||
m.drawing_no_ver AS drawingNoVer,
|
||||
s.version AS versionNo,
|
||||
s.version,
|
||||
STRING_AGG(DISTINCT iqe_user.user_name, ',') AS iqeName,
|
||||
s.inspection_cycle AS inspectionCycle,
|
||||
s.packaging_method_id AS packagingMethodId,
|
||||
di.name AS packagingMethodName,
|
||||
s.is_enabled AS isEnabled,
|
||||
s.publish_status AS publishStatus,
|
||||
s.publish_user_name AS publishUserName,
|
||||
|
|
@ -31,6 +32,7 @@
|
|||
LEFT JOIN qms_inspector_material_item imi ON imi.material_id = m.id
|
||||
LEFT JOIN qms_quality_inspector iqe ON imi.inspector_id = iqe.id AND iqe.inspection_type = 1 AND iqe.enable = true
|
||||
LEFT JOIN "user" iqe_user ON iqe.user_id = iqe_user.id
|
||||
LEFT JOIN dictionary_item di ON s.packaging_method_id=di.id
|
||||
<where>
|
||||
<if test="request.materialNo != null and request.materialNo != ''">
|
||||
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
|
|
@ -43,9 +45,9 @@
|
|||
</if>
|
||||
</where>
|
||||
GROUP BY s.id, m.material_no, m.material_category_code_path_name, m.material_desc, m.drawing_no_ver,
|
||||
s.version, s.inspection_cycle, s.packaging_method_id, s.is_enabled, s.publish_status,
|
||||
s.version, s.inspection_cycle, s.packaging_method_id, s.is_enabled, s.publish_status,di.name,
|
||||
s.publish_user_name, s.publish_time, s.create_user_name, s.create_time, s.update_user_name, s.update_time
|
||||
ORDER BY s.id DESC
|
||||
ORDER BY s.is_enabled DESC,s.id DESC
|
||||
</select>
|
||||
|
||||
<!--
|
||||
|
|
@ -60,7 +62,7 @@
|
|||
m.material_desc AS materialDesc,
|
||||
m.drawing_no_ver AS drawingNoVer,
|
||||
s.drawing_url AS drawingUrl,
|
||||
s.version AS versionNo,
|
||||
s.version,
|
||||
s.is_enabled AS isEnabled,
|
||||
s.packaging_method_id AS packagingMethodId,
|
||||
s.inspection_cycle AS inspectionCycle,
|
||||
|
|
|
|||
Loading…
Reference in New Issue