Compare commits
3 Commits
e3ff8ca9ff
...
a5d04d067d
| Author | SHA1 | Date |
|---|---|---|
|
|
a5d04d067d | |
|
|
c636e24ae3 | |
|
|
769b2fa2df |
|
|
@ -26,10 +26,7 @@ import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -1103,7 +1100,7 @@ public class IncomingInspectionTaskControllerService {
|
||||||
if (StrUtil.isNotBlank(data.getImageIds())) {
|
if (StrUtil.isNotBlank(data.getImageIds())) {
|
||||||
dataVO.setImages(
|
dataVO.setImages(
|
||||||
fileUploadRecordService.lambdaQuery()
|
fileUploadRecordService.lambdaQuery()
|
||||||
.in(FileUploadRecord::getId, StrUtil.split(data.getImageIds(), ","))
|
.in(FileUploadRecord::getId, Arrays.stream(StrUtil.splitToLong(data.getImageIds(), ",")).boxed().toList())
|
||||||
.list()
|
.list()
|
||||||
.stream()
|
.stream()
|
||||||
.map(file -> new FileUploadVO()
|
.map(file -> new FileUploadVO()
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,11 @@ public class QmsSamplingPlanControllerService {
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void add(@Valid QmsSamplingPlanAddQO request) {
|
public void add(@Valid QmsSamplingPlanAddQO request) {
|
||||||
|
VUtil.trueThrowBusinessError(samplingPlanService.lambdaQuery()
|
||||||
|
.eq(QmsSamplingPlan::getPlanName, request.getPlanName())
|
||||||
|
.exists()
|
||||||
|
).throwMessage("方案名称已存在");
|
||||||
|
|
||||||
String operator = UserUtil.getUserName();
|
String operator = UserUtil.getUserName();
|
||||||
Long operatorId = UserUtil.getUserId();
|
Long operatorId = UserUtil.getUserId();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
@ -188,6 +193,12 @@ public class QmsSamplingPlanControllerService {
|
||||||
public void edit(@Valid QmsSamplingPlanEditQO request) {
|
public void edit(@Valid QmsSamplingPlanEditQO request) {
|
||||||
Long planId = request.getId();
|
Long planId = request.getId();
|
||||||
|
|
||||||
|
VUtil.trueThrowBusinessError(samplingPlanService.lambdaQuery()
|
||||||
|
.eq(QmsSamplingPlan::getPlanName, request.getPlanName())
|
||||||
|
.ne(QmsSamplingPlan::getId, planId)
|
||||||
|
.exists()
|
||||||
|
).throwMessage("方案名称已存在");
|
||||||
|
|
||||||
// 0. 验证抽样方案是否存在
|
// 0. 验证抽样方案是否存在
|
||||||
QmsSamplingPlan existPlan = samplingPlanService.getById(planId);
|
QmsSamplingPlan existPlan = samplingPlanService.getById(planId);
|
||||||
VUtil.trueThrowBusinessError(ObjectUtil.isNull(existPlan)).throwMessage("抽样方案不存在");
|
VUtil.trueThrowBusinessError(ObjectUtil.isNull(existPlan)).throwMessage("抽样方案不存在");
|
||||||
|
|
@ -392,10 +403,11 @@ public class QmsSamplingPlanControllerService {
|
||||||
Page<QmsSamplingPlan> page = new Page<>(request.getPage(), request.getPageSize());
|
Page<QmsSamplingPlan> page = new Page<>(request.getPage(), request.getPageSize());
|
||||||
|
|
||||||
var query = samplingPlanService.lambdaQuery()
|
var query = samplingPlanService.lambdaQuery()
|
||||||
.like(StrUtil.isNotBlank(request.getPlanCode()), QmsSamplingPlan::getPlanCode, request.getPlanCode())
|
.eq(request.getPublishStatus() != null, QmsSamplingPlan::getPublishStatus, request.getPublishStatus())
|
||||||
.like(StrUtil.isNotBlank(request.getPlanName()), QmsSamplingPlan::getPlanName, request.getPlanName())
|
|
||||||
.ge(request.getStartDate() != null, QmsSamplingPlan::getCreateTime, request.getStartDate())
|
.ge(request.getStartDate() != null, QmsSamplingPlan::getCreateTime, request.getStartDate())
|
||||||
.le(request.getEndDate() != null, QmsSamplingPlan::getCreateTime, request.getEndDate())
|
.le(request.getEndDate() != null, QmsSamplingPlan::getCreateTime, request.getEndDate())
|
||||||
|
.like(StrUtil.isNotBlank(request.getPlanCode()), QmsSamplingPlan::getPlanCode, request.getPlanCode())
|
||||||
|
.like(StrUtil.isNotBlank(request.getPlanName()), QmsSamplingPlan::getPlanName, request.getPlanName())
|
||||||
.orderByAsc(QmsSamplingPlan::getPublishStatus)
|
.orderByAsc(QmsSamplingPlan::getPublishStatus)
|
||||||
.orderByDesc(QmsSamplingPlan::getId);
|
.orderByDesc(QmsSamplingPlan::getId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.wms.common.pojo.qo;
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
import com.nflg.wms.common.pojo.vo.FileUploadVO;
|
import com.nflg.wms.common.pojo.vo.FileUploadVO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -26,5 +27,6 @@ public class QmsIncomingInspectionTaskTodoCheckSubmitItemDataQO {
|
||||||
/**
|
/**
|
||||||
* 图片列表
|
* 图片列表
|
||||||
*/
|
*/
|
||||||
|
@Valid
|
||||||
private List<FileUploadVO> images;
|
private List<FileUploadVO> images;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,9 @@ public class QmsSamplingPlanSearchQO extends SearchBaseQO {
|
||||||
* 方案名称
|
* 方案名称
|
||||||
*/
|
*/
|
||||||
private String planName;
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布状态:0-未发布,1-已发布,2-已撤回
|
||||||
|
*/
|
||||||
|
private Short publishStatus;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue