Compare commits
6 Commits
e212cbbc60
...
80d77a79fe
| Author | SHA1 | Date |
|---|---|---|
|
|
80d77a79fe | |
|
|
904371dd49 | |
|
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -43,14 +43,14 @@ public class QmsQualityInspectorController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除质检人员(传入 userId,删除该用户所有关联记录,启用状态下不允许删除)
|
* 删除质检人员(传入 id,删除该用户所有关联记录,启用状态下不允许删除)
|
||||||
*
|
*
|
||||||
* @param userId 员工ID
|
* @param id 质检人员主表ID
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("delete")
|
@PostMapping("delete")
|
||||||
public ApiResult<Void> delete(@NotNull Long userId) {
|
public ApiResult<Void> delete(@NotNull Long id) {
|
||||||
qualityInspectorService.delete(userId);
|
qualityInspectorService.delete(id);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,13 +73,13 @@ public class QmsQualityInspectorController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按员工ID查询质检人员详情(物料和物料类别分开返回,不分页)
|
* 按ID查询质检人员详情(物料和物料类别分开返回,不分页)
|
||||||
*
|
*
|
||||||
* @param userId 员工ID(user.id)
|
* @param id 质检人员主表ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("detail")
|
@GetMapping("detail")
|
||||||
public ApiResult<QmsQualityInspectorDetailVO> detail(@NotNull Long userId) {
|
public ApiResult<QmsQualityInspectorDetailVO> detail(@NotNull Long id) {
|
||||||
return ApiResult.success(qualityInspectorService.getDetailByUserId(userId));
|
return ApiResult.success(qualityInspectorService.getDetailByUserId(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -88,7 +88,7 @@ public class QmsQualityInspectorController extends BaseController {
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("updateStatus")
|
@PostMapping("updateStatus")
|
||||||
public ApiResult<Void> updateStatus(@Valid @RequestBody QmsQualityInspectorStatusQO request) {
|
public ApiResult<Void> updateStatus(@Valid @RequestBody QmsQualityInspectorStatusQO request) {
|
||||||
qualityInspectorService.updateStatus(request.getUserId(), request.getEnable());
|
qualityInspectorService.updateStatus(request.getId(), request.getEnable());
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,12 +105,12 @@ public class QmsQualityInspectorController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 取消转办(将该质检人所有记录的转办人清空)
|
* 取消转办(将该质检人所有记录的转办人清空)
|
||||||
*
|
*
|
||||||
* @param userId 员工ID
|
* @param id 质检人员主表ID
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("cancelTransfer")
|
@PostMapping("cancelTransfer")
|
||||||
public ApiResult<Void> cancelTransfer(@NotNull Long userId) {
|
public ApiResult<Void> cancelTransfer(@NotNull Long id) {
|
||||||
qualityInspectorService.cancelTransfer(userId);
|
qualityInspectorService.cancelTransfer(id);
|
||||||
return ApiResult.success();
|
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;
|
package com.nflg.qms.admin.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
@ -53,6 +54,12 @@ public class QmsInspectionStandardControllerService {
|
||||||
@Resource
|
@Resource
|
||||||
private IDictionaryItemService dictionaryItemService;
|
private IDictionaryItemService dictionaryItemService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IQmsSamplingPlanService samplingPlanService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IQmsAqlPriorityValueService aqlPriorityValueService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询检验标准
|
* 分页查询检验标准
|
||||||
*/
|
*/
|
||||||
|
|
@ -156,7 +163,7 @@ public class QmsInspectionStandardControllerService {
|
||||||
detail.setId(standard.getId());
|
detail.setId(standard.getId());
|
||||||
detail.setMaterialId(standard.getMaterialId());
|
detail.setMaterialId(standard.getMaterialId());
|
||||||
detail.setDrawingUrl(standard.getDrawingUrl());
|
detail.setDrawingUrl(standard.getDrawingUrl());
|
||||||
detail.setVersionNo(standard.getVersion() != null ? standard.getVersion().toString() : null);
|
detail.setVersion(standard.getVersion());
|
||||||
detail.setIsEnabled(standard.getIsEnabled());
|
detail.setIsEnabled(standard.getIsEnabled());
|
||||||
detail.setPackagingMethodId(standard.getPackagingMethodId());
|
detail.setPackagingMethodId(standard.getPackagingMethodId());
|
||||||
detail.setInspectionCycle(standard.getInspectionCycle());
|
detail.setInspectionCycle(standard.getInspectionCycle());
|
||||||
|
|
@ -185,12 +192,12 @@ public class QmsInspectionStandardControllerService {
|
||||||
dictionaryItemIds.add(item.getSamplingMethodDictItemId());
|
dictionaryItemIds.add(item.getSamplingMethodDictItemId());
|
||||||
dictionaryItemIds.add(item.getInspectionLevelDictItemId());
|
dictionaryItemIds.add(item.getInspectionLevelDictItemId());
|
||||||
dictionaryItemIds.add(item.getAqlTypeDictItemId());
|
dictionaryItemIds.add(item.getAqlTypeDictItemId());
|
||||||
dictionaryItemIds.add(item.getAqlPriorityValueId());
|
|
||||||
dictionaryItemIds.add(item.getInspectionStandardId());
|
|
||||||
});
|
});
|
||||||
List<DictionaryItem> dictionaryItems = dictionaryItemService.lambdaQuery()
|
List<DictionaryItem> dictionaryItems = CollectionUtil.isEmpty(dictionaryItemIds)
|
||||||
.in(DictionaryItem::getId, dictionaryItemIds)
|
? new ArrayList<>()
|
||||||
.list();
|
: dictionaryItemService.lambdaQuery()
|
||||||
|
.in(DictionaryItem::getId, dictionaryItemIds)
|
||||||
|
.list();
|
||||||
for (QmsInspectionStandardItem item : items) {
|
for (QmsInspectionStandardItem item : items) {
|
||||||
QmsInspectionStandardItemVO itemVO = convertToItemVO(item, dictionaryItems);
|
QmsInspectionStandardItemVO itemVO = convertToItemVO(item, dictionaryItems);
|
||||||
|
|
||||||
|
|
@ -235,12 +242,7 @@ public class QmsInspectionStandardControllerService {
|
||||||
.orElse(null)
|
.orElse(null)
|
||||||
);
|
);
|
||||||
vo.setSamplingPlanId(item.getSamplingPlanId());
|
vo.setSamplingPlanId(item.getSamplingPlanId());
|
||||||
vo.setSamplingPlanName(dictionaryItems.stream()
|
vo.setSamplingPlanName(samplingPlanService.getById(item.getSamplingPlanId()).getPlanName());
|
||||||
.filter(it -> it.getId().equals(item.getSamplingPlanId()))
|
|
||||||
.findFirst()
|
|
||||||
.map(DictionaryItem::getName)
|
|
||||||
.orElse(null)
|
|
||||||
);
|
|
||||||
vo.setInspectionLevelDictItemId(item.getInspectionLevelDictItemId());
|
vo.setInspectionLevelDictItemId(item.getInspectionLevelDictItemId());
|
||||||
vo.setInspectionLevelDictItemName(dictionaryItems.stream()
|
vo.setInspectionLevelDictItemName(dictionaryItems.stream()
|
||||||
.filter(it -> it.getId().equals(item.getInspectionLevelDictItemId()))
|
.filter(it -> it.getId().equals(item.getInspectionLevelDictItemId()))
|
||||||
|
|
@ -249,12 +251,7 @@ public class QmsInspectionStandardControllerService {
|
||||||
.orElse(null)
|
.orElse(null)
|
||||||
);
|
);
|
||||||
vo.setAqlPriorityValueId(item.getAqlPriorityValueId());
|
vo.setAqlPriorityValueId(item.getAqlPriorityValueId());
|
||||||
vo.setAqlPriorityValueName(dictionaryItems.stream()
|
vo.setAqlPriorityValueName(aqlPriorityValueService.getById(item.getAqlPriorityValueId()).getPriorityValue());
|
||||||
.filter(it -> it.getId().equals(item.getAqlPriorityValueId()))
|
|
||||||
.findFirst()
|
|
||||||
.map(DictionaryItem::getName)
|
|
||||||
.orElse(null)
|
|
||||||
);
|
|
||||||
vo.setAqlTypeDictItemId(item.getAqlTypeDictItemId());
|
vo.setAqlTypeDictItemId(item.getAqlTypeDictItemId());
|
||||||
vo.setAqlTypeDictItemName(dictionaryItems.stream()
|
vo.setAqlTypeDictItemName(dictionaryItems.stream()
|
||||||
.filter(it -> it.getId().equals(item.getAqlTypeDictItemId()))
|
.filter(it -> it.getId().equals(item.getAqlTypeDictItemId()))
|
||||||
|
|
@ -283,6 +280,11 @@ public class QmsInspectionStandardControllerService {
|
||||||
vo.setLegend(content.getLegend());
|
vo.setLegend(content.getLegend());
|
||||||
vo.setPdfInfo(content.getPdfInfo());
|
vo.setPdfInfo(content.getPdfInfo());
|
||||||
vo.setJudgmentTypeDictItemId(content.getJudgmentTypeDictItemId());
|
vo.setJudgmentTypeDictItemId(content.getJudgmentTypeDictItemId());
|
||||||
|
vo.setJudgmentTypeDictItemName(
|
||||||
|
Optional.ofNullable(dictionaryItemService.getById(content.getJudgmentTypeDictItemId()))
|
||||||
|
.map(DictionaryItem::getName)
|
||||||
|
.orElse(null)
|
||||||
|
);
|
||||||
vo.setCreateUserName(content.getCreateUserName());
|
vo.setCreateUserName(content.getCreateUserName());
|
||||||
vo.setCreateTime(content.getCreateTime());
|
vo.setCreateTime(content.getCreateTime());
|
||||||
vo.setUpdateUserName(content.getUpdateUserName());
|
vo.setUpdateUserName(content.getUpdateUserName());
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,35 @@ public class QualityNotificationControllerService {
|
||||||
// 通知对象类型名称
|
// 通知对象类型名称
|
||||||
if (vo.getTargetType() != null) {
|
if (vo.getTargetType() != null) {
|
||||||
vo.setTargetTypeName(vo.getTargetType() == 1 ? "全部" : "手动选择");
|
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) {
|
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;
|
||||||
|
}
|
||||||
|
|
@ -10,10 +10,10 @@ import lombok.Data;
|
||||||
public class QmsQualityInspectorStatusQO {
|
public class QmsQualityInspectorStatusQO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检人ID,必传
|
* 质检人员主表ID,必传
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "质检人ID不能为空")
|
@NotNull(message = "ID不能为空")
|
||||||
private Long userId;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:true=启用,false=禁用
|
* 状态:true=启用,false=禁用
|
||||||
|
|
|
||||||
|
|
@ -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 Long judgmentTypeDictItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判定类型字典项名称
|
||||||
|
*/
|
||||||
|
private String judgmentTypeDictItemName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人姓名
|
* 创建人姓名
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -72,9 +73,9 @@ public class QmsInspectionStandardItemVO {
|
||||||
private Long aqlPriorityValueId;
|
private Long aqlPriorityValueId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AQL值名称
|
* AQL值
|
||||||
*/
|
*/
|
||||||
private String aqlPriorityValueName;
|
private BigDecimal aqlPriorityValueName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AQL类型字典项ID
|
* AQL类型字典项ID
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class QmsInspectionStandardVO {
|
||||||
/**
|
/**
|
||||||
* 检测版本号
|
* 检测版本号
|
||||||
*/
|
*/
|
||||||
private String versionNo;
|
private String version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属IQE
|
* 所属IQE
|
||||||
|
|
@ -55,6 +55,11 @@ public class QmsInspectionStandardVO {
|
||||||
*/
|
*/
|
||||||
private Long packagingMethodId;
|
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);
|
||||||
|
}
|
||||||
|
|
@ -31,9 +31,9 @@ public interface IQmsQualityInspectorService extends IService<QmsQualityInspecto
|
||||||
void add(QmsQualityInspectorAddQO request);
|
void add(QmsQualityInspectorAddQO request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除质检人员(传入 userId,删除该用户所有关联记录,启用状态不允许删除)
|
* 删除质检人员(传入主表 id,删除该用户所有关联记录,启用状态不允许删除)
|
||||||
*/
|
*/
|
||||||
void delete(Long userId);
|
void delete(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改质检人员的物料/物料类别(追加或删除)
|
* 修改质检人员的物料/物料类别(追加或删除)
|
||||||
|
|
@ -46,14 +46,14 @@ public interface IQmsQualityInspectorService extends IService<QmsQualityInspecto
|
||||||
IPage<QmsQualityInspectorVO> search(QmsQualityInspectorSearchQO request);
|
IPage<QmsQualityInspectorVO> search(QmsQualityInspectorSearchQO request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按员工ID(user_id)查询质检人员详情,物料和物料类别分开返回(不分页)
|
* 按主表 id 查询质检人员详情,物料和物料类别分开返回(不分页)
|
||||||
*/
|
*/
|
||||||
QmsQualityInspectorDetailVO getDetailByUserId(Long userId);
|
QmsQualityInspectorDetailVO getDetailByUserId(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改状态(将该质检人的所有记录状态全改)
|
* 修改状态(将该质检人的所有记录状态全改)
|
||||||
*/
|
*/
|
||||||
void updateStatus(Long userId, Boolean enable);
|
void updateStatus(Long id, Boolean enable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转办(将该质检人所有记录设置转办人)
|
* 转办(将该质检人所有记录设置转办人)
|
||||||
|
|
@ -63,7 +63,7 @@ public interface IQmsQualityInspectorService extends IService<QmsQualityInspecto
|
||||||
/**
|
/**
|
||||||
* 取消转办(将该质检人所有记录的转办人清空)
|
* 取消转办(将该质检人所有记录的转办人清空)
|
||||||
*/
|
*/
|
||||||
void cancelTransfer(Long userId);
|
void cancelTransfer(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
||||||
|
|
|
||||||
|
|
@ -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 处理,此处留空
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -181,11 +181,9 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void delete(Long userId) {
|
public void delete(Long id) {
|
||||||
// 查询主表记录
|
// 按主表 id 查主表记录
|
||||||
QmsQualityInspector inspector = lambdaQuery()
|
QmsQualityInspector inspector = getById(id);
|
||||||
.eq(QmsQualityInspector::getUserId, userId)
|
|
||||||
.one();
|
|
||||||
if (Objects.isNull(inspector)) {
|
if (Objects.isNull(inspector)) {
|
||||||
throw new NflgException(STATE.BusinessError, "该质检人员不存在");
|
throw new NflgException(STATE.BusinessError, "该质检人员不存在");
|
||||||
}
|
}
|
||||||
|
|
@ -193,16 +191,15 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
if (Boolean.TRUE.equals(inspector.getEnable())) {
|
if (Boolean.TRUE.equals(inspector.getEnable())) {
|
||||||
throw new NflgException(STATE.BusinessError, "该质检人员处于启用状态,不允许删除,请先禁用后再删除");
|
throw new NflgException(STATE.BusinessError, "该质检人员处于启用状态,不允许删除,请先禁用后再删除");
|
||||||
}
|
}
|
||||||
Long inspectorId = inspector.getId();
|
|
||||||
// 删除两张明细表
|
// 删除两张明细表
|
||||||
materialItemService.lambdaUpdate()
|
materialItemService.lambdaUpdate()
|
||||||
.eq(QmsInspectorMaterialItem::getInspectorId, inspectorId)
|
.eq(QmsInspectorMaterialItem::getInspectorId, id)
|
||||||
.remove();
|
.remove();
|
||||||
materialCategoryItemService.lambdaUpdate()
|
materialCategoryItemService.lambdaUpdate()
|
||||||
.eq(QmsInspectorMaterialCategoryItem::getInspectorId, inspectorId)
|
.eq(QmsInspectorMaterialCategoryItem::getInspectorId, id)
|
||||||
.remove();
|
.remove();
|
||||||
// 删除主表
|
// 删除主表
|
||||||
removeById(inspectorId);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================= 修改物料/物料类别 =========================
|
// ========================= 修改物料/物料类别 =========================
|
||||||
|
|
@ -326,15 +323,15 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QmsQualityInspectorDetailVO getDetailByUserId(Long userId) {
|
public QmsQualityInspectorDetailVO getDetailByUserId(Long id) {
|
||||||
// 按 user_id 查主表,取到 inspector.id 后再查两张明细表
|
// 按主表 id 查主表
|
||||||
QmsQualityInspector inspector = lambdaQuery()
|
QmsQualityInspector inspector = getById(id);
|
||||||
.eq(QmsQualityInspector::getUserId, userId)
|
|
||||||
.one();
|
|
||||||
if (Objects.isNull(inspector)) {
|
if (Objects.isNull(inspector)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Long userId = inspector.getUserId();
|
||||||
|
|
||||||
// 查 user 信息
|
// 查 user 信息
|
||||||
User user = userService.getById(userId);
|
User user = userService.getById(userId);
|
||||||
|
|
||||||
|
|
@ -373,10 +370,9 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
detail.setDeptLeaderName(null);
|
detail.setDeptLeaderName(null);
|
||||||
detail.setPositionName(positionName);
|
detail.setPositionName(positionName);
|
||||||
|
|
||||||
// 用主表 id(inspectorId)查明细表(明细表 inspector_id = qms_quality_inspector.id)
|
// 用主表 id 查明细表
|
||||||
Long inspectorId = inspector.getId();
|
detail.setMaterials(baseMapper.getMaterialsByInspectorId(id));
|
||||||
detail.setMaterials(baseMapper.getMaterialsByInspectorId(inspectorId));
|
detail.setCategories(baseMapper.getCategoriesByInspectorId(id));
|
||||||
detail.setCategories(baseMapper.getCategoriesByInspectorId(inspectorId));
|
|
||||||
|
|
||||||
return detail;
|
return detail;
|
||||||
}
|
}
|
||||||
|
|
@ -385,25 +381,22 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void updateStatus(Long userId, Boolean enable) {
|
public void updateStatus(Long id, Boolean enable) {
|
||||||
// 仅在改为启用时做校验
|
// 仅在改为启用时做校验
|
||||||
if (Boolean.TRUE.equals(enable)) {
|
if (Boolean.TRUE.equals(enable)) {
|
||||||
QmsQualityInspector inspector = lambdaQuery()
|
QmsQualityInspector inspector = getById(id);
|
||||||
.eq(QmsQualityInspector::getUserId, userId)
|
|
||||||
.one();
|
|
||||||
if (Objects.isNull(inspector)) {
|
if (Objects.isNull(inspector)) {
|
||||||
throw new NflgException(STATE.BusinessError, "该质检人员不存在");
|
throw new NflgException(STATE.BusinessError, "该质检人员不存在");
|
||||||
}
|
}
|
||||||
Long inspectorId = inspector.getId();
|
|
||||||
|
|
||||||
// 查当前人员绑定的物料ID列表
|
// 查当前人员绑定的物料ID列表
|
||||||
List<QmsInspectorMaterialItem> myMaterials = materialItemService.lambdaQuery()
|
List<QmsInspectorMaterialItem> myMaterials = materialItemService.lambdaQuery()
|
||||||
.eq(QmsInspectorMaterialItem::getInspectorId, inspectorId)
|
.eq(QmsInspectorMaterialItem::getInspectorId, id)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
// 查当前人员绑定的物料类别ID列表
|
// 查当前人员绑定的物料类别ID列表
|
||||||
List<QmsInspectorMaterialCategoryItem> myCategories = materialCategoryItemService.lambdaQuery()
|
List<QmsInspectorMaterialCategoryItem> myCategories = materialCategoryItemService.lambdaQuery()
|
||||||
.eq(QmsInspectorMaterialCategoryItem::getInspectorId, inspectorId)
|
.eq(QmsInspectorMaterialCategoryItem::getInspectorId, id)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
// 校验物料是否已被其他启用的质检员接管
|
// 校验物料是否已被其他启用的质检员接管
|
||||||
|
|
@ -414,7 +407,7 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
// 查其他人员中是否有相同物料绑定(排除自己)
|
// 查其他人员中是否有相同物料绑定(排除自己)
|
||||||
List<QmsInspectorMaterialItem> conflictItems = materialItemService.lambdaQuery()
|
List<QmsInspectorMaterialItem> conflictItems = materialItemService.lambdaQuery()
|
||||||
.in(QmsInspectorMaterialItem::getMaterialId, myMaterialIds)
|
.in(QmsInspectorMaterialItem::getMaterialId, myMaterialIds)
|
||||||
.ne(QmsInspectorMaterialItem::getInspectorId, inspectorId)
|
.ne(QmsInspectorMaterialItem::getInspectorId, id)
|
||||||
.list();
|
.list();
|
||||||
if (!conflictItems.isEmpty()) {
|
if (!conflictItems.isEmpty()) {
|
||||||
// 进一步判断接管人员是否处于启用状态
|
// 进一步判断接管人员是否处于启用状态
|
||||||
|
|
@ -439,7 +432,7 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<QmsInspectorMaterialCategoryItem> conflictItems = materialCategoryItemService.lambdaQuery()
|
List<QmsInspectorMaterialCategoryItem> conflictItems = materialCategoryItemService.lambdaQuery()
|
||||||
.in(QmsInspectorMaterialCategoryItem::getMaterialCategoryId, myCategoryIds)
|
.in(QmsInspectorMaterialCategoryItem::getMaterialCategoryId, myCategoryIds)
|
||||||
.ne(QmsInspectorMaterialCategoryItem::getInspectorId, inspectorId)
|
.ne(QmsInspectorMaterialCategoryItem::getInspectorId, id)
|
||||||
.list();
|
.list();
|
||||||
if (!conflictItems.isEmpty()) {
|
if (!conflictItems.isEmpty()) {
|
||||||
List<Long> conflictInspectorIds = conflictItems.stream()
|
List<Long> conflictInspectorIds = conflictItems.stream()
|
||||||
|
|
@ -458,7 +451,7 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
}
|
}
|
||||||
|
|
||||||
lambdaUpdate()
|
lambdaUpdate()
|
||||||
.eq(QmsQualityInspector::getUserId, userId)
|
.eq(QmsQualityInspector::getId, id)
|
||||||
.set(QmsQualityInspector::getEnable, enable)
|
.set(QmsQualityInspector::getEnable, enable)
|
||||||
.set(QmsQualityInspector::getUpdateBy, UserUtil.getUserName())
|
.set(QmsQualityInspector::getUpdateBy, UserUtil.getUserName())
|
||||||
.set(QmsQualityInspector::getUpdateTime, LocalDateTime.now())
|
.set(QmsQualityInspector::getUpdateTime, LocalDateTime.now())
|
||||||
|
|
@ -482,9 +475,9 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public void cancelTransfer(Long userId) {
|
public void cancelTransfer(Long id) {
|
||||||
lambdaUpdate()
|
lambdaUpdate()
|
||||||
.eq(QmsQualityInspector::getUserId, userId)
|
.eq(QmsQualityInspector::getId, id)
|
||||||
.set(QmsQualityInspector::getChangeUserId, null)
|
.set(QmsQualityInspector::getChangeUserId, null)
|
||||||
.set(QmsQualityInspector::getUpdateBy, UserUtil.getUserName())
|
.set(QmsQualityInspector::getUpdateBy, UserUtil.getUserName())
|
||||||
.set(QmsQualityInspector::getUpdateTime, LocalDateTime.now())
|
.set(QmsQualityInspector::getUpdateTime, LocalDateTime.now())
|
||||||
|
|
|
||||||
|
|
@ -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_category_code_path_name AS materialCategoryCodePathName,
|
||||||
m.material_desc AS materialDesc,
|
m.material_desc AS materialDesc,
|
||||||
m.drawing_no_ver AS drawingNoVer,
|
m.drawing_no_ver AS drawingNoVer,
|
||||||
s.version AS versionNo,
|
s.version,
|
||||||
STRING_AGG(DISTINCT iqe_user.user_name, ',') AS iqeName,
|
STRING_AGG(DISTINCT iqe_user.user_name, ',') AS iqeName,
|
||||||
s.inspection_cycle AS inspectionCycle,
|
s.inspection_cycle AS inspectionCycle,
|
||||||
s.packaging_method_id AS packagingMethodId,
|
s.packaging_method_id AS packagingMethodId,
|
||||||
|
di.name AS packagingMethodName,
|
||||||
s.is_enabled AS isEnabled,
|
s.is_enabled AS isEnabled,
|
||||||
s.publish_status AS publishStatus,
|
s.publish_status AS publishStatus,
|
||||||
s.publish_user_name AS publishUserName,
|
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_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 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 "user" iqe_user ON iqe.user_id = iqe_user.id
|
||||||
|
LEFT JOIN dictionary_item di ON s.packaging_method_id=di.id
|
||||||
<where>
|
<where>
|
||||||
<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}, '%')
|
||||||
|
|
@ -43,9 +45,9 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY s.id, m.material_no, m.material_category_code_path_name, m.material_desc, m.drawing_no_ver,
|
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
|
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>
|
</select>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -60,7 +62,7 @@
|
||||||
m.material_desc AS materialDesc,
|
m.material_desc AS materialDesc,
|
||||||
m.drawing_no_ver AS drawingNoVer,
|
m.drawing_no_ver AS drawingNoVer,
|
||||||
s.drawing_url AS drawingUrl,
|
s.drawing_url AS drawingUrl,
|
||||||
s.version AS versionNo,
|
s.version,
|
||||||
s.is_enabled AS isEnabled,
|
s.is_enabled AS isEnabled,
|
||||||
s.packaging_method_id AS packagingMethodId,
|
s.packaging_method_id AS packagingMethodId,
|
||||||
s.inspection_cycle AS inspectionCycle,
|
s.inspection_cycle AS inspectionCycle,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue