Compare commits
3 Commits
aea418d78c
...
fc325af3b1
| Author | SHA1 | Date |
|---|---|---|
|
|
fc325af3b1 | |
|
|
6a8af1f362 | |
|
|
8f07dbca40 |
|
|
@ -51,7 +51,7 @@ public class QmsCoaTaskController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改COA通知任务(仅状态为0时可修改)
|
||||
* 修改COA通知任务(只允许修改报告要求和报告模板,修改后状态改为0)
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("update")
|
||||
|
|
@ -60,6 +60,16 @@ public class QmsCoaTaskController extends BaseController {
|
|||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接发布COA通知任务(状态直接变为1,并填入发送时间)
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("publish")
|
||||
public ApiResult<Void> publish(@Valid @RequestBody QmsCoaTaskAddQO qo) {
|
||||
coaTaskService.publish(qo);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量发送(状态改为1,填入发送时间)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -96,12 +96,12 @@ public class QmsInspectionItemController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 按检测项ID查明细列表(不分页)
|
||||
* 按检测项ID查询详情(包含主表信息和明细列表)
|
||||
*
|
||||
* @param id 检测项ID
|
||||
*/
|
||||
@GetMapping("details")
|
||||
public ApiResult<List<QmsInspectionItemDetailsVO>> details(@NotNull(message = "ID不能为空") Long id) {
|
||||
public ApiResult<QmsInspectionItemVO> details(@NotNull(message = "ID不能为空") Long id) {
|
||||
return ApiResult.success(inspectionItemService.getDetails(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,12 +115,12 @@ public class QmsQualityInspectorController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 按当前登录用户查询绑定的物料列表(支持物料编号/类别/描述过滤)
|
||||
* 按当前登录用户查询绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
||||
*
|
||||
* @param qo 查询参数(materialNo/materialCategoryCode/materialDesc可选)
|
||||
* @param qo 查询参数(materialNo/materialCategoryCode/materialDesc/pageNum/pageSize)
|
||||
*/
|
||||
@PostMapping("materialsByUser")
|
||||
public ApiResult<List<QmsQualityInspectorMaterialVO>> materialsByUser(@RequestBody QmsMaterialsByUserQO qo) {
|
||||
return ApiResult.success(qualityInspectorService.getMaterialsByUserId(qo.getMaterialNo(), qo.getMaterialCategoryCode(), qo.getMaterialDesc()));
|
||||
public ApiResult<PageData<QmsQualityInspectorMaterialVO>> materialsByUser(@RequestBody QmsMaterialsByUserQO qo) {
|
||||
return ApiResult.success(qualityInspectorService.getMaterialsByUserId(qo.getMaterialNo(), qo.getMaterialCategoryCode(), qo.getMaterialDesc(), qo.getPageNum(), qo.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,12 +81,12 @@ public class QmsSupplierSqeController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 按当前登录用户查询关联的供应商列表(支持供应商过滤)
|
||||
* 按当前登录用户查询关联的供应商列表(支持供应商过滤,分页)
|
||||
*
|
||||
* @param qo 查询参数(supplierCode/supplierName可选)
|
||||
* @param qo 查询参数(supplierCode/supplierName/pageNum/pageSize)
|
||||
*/
|
||||
@PostMapping("supplierByUser")
|
||||
public ApiResult<List<QmsUserSupplierVO>> supplierByUser(@RequestBody QmsUserMaterialsQO qo) {
|
||||
return ApiResult.success(supplierSqeMapService.getSuppliersByUserId(qo.getSupplierCode(), qo.getSupplierName()));
|
||||
public ApiResult<PageData<QmsUserSupplierVO>> supplierByUser(@RequestBody QmsUserMaterialsQO qo) {
|
||||
return ApiResult.success(supplierSqeMapService.getSuppliersByUserId(qo.getSupplierCode(), qo.getSupplierName(), qo.getPageNum(), qo.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ public class QmsCoaTaskAddQO {
|
|||
private String requirement;
|
||||
|
||||
/**
|
||||
* 最晚提交时间(必传)
|
||||
* 最晚提交时间
|
||||
*/
|
||||
@NotNull(message = "最晚提交时间不能为空")
|
||||
private LocalDate lastSubTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ package com.nflg.wms.common.pojo.qo;
|
|||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 修改COA通知任务参数(id必传,其余可选)
|
||||
* 修改COA通知任务参数(id必传,只允许修改报告要求和报告模板)
|
||||
*/
|
||||
@Data
|
||||
public class QmsCoaTaskUpdateQO {
|
||||
|
|
@ -17,26 +15,11 @@ public class QmsCoaTaskUpdateQO {
|
|||
@NotNull(message = "ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 供应商编号(可选)
|
||||
*/
|
||||
private String supplierCode;
|
||||
|
||||
/**
|
||||
* 物料编号(可选)
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 报告要求(可选)
|
||||
*/
|
||||
private String requirement;
|
||||
|
||||
/**
|
||||
* 最晚提交时间(可选)
|
||||
*/
|
||||
private LocalDate lastSubTime;
|
||||
|
||||
/**
|
||||
* 报告模板(可选)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,4 +22,14 @@ public class QmsMaterialsByUserQO {
|
|||
* 物料描述(模糊,可选)
|
||||
*/
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNum = 1;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,14 @@ public class QmsUserMaterialsQO {
|
|||
* 供应商名称(模糊,可选)
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNum = 1;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@ public class QmsQualityInspectorMaterialVO {
|
|||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料图号
|
||||
*/
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 图纸版本号
|
||||
*/
|
||||
private String drawingNoVer;
|
||||
|
||||
/**
|
||||
* 物料类别编码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -41,9 +41,10 @@ public interface QmsQualityInspectorMapper extends BaseMapper<QmsQualityInspecto
|
|||
@Param("supplierName") String supplierName);
|
||||
|
||||
/**
|
||||
* 按 userId 查询绑定物料列表(支持物料编号/类别/描述过滤)
|
||||
* 按 userId 查询绑定物料列表(支持物料编号/类别/描述过滤,分页)
|
||||
*/
|
||||
List<QmsQualityInspectorMaterialVO> getMaterialsByUserIdWithFilter(
|
||||
IPage<QmsQualityInspectorMaterialVO> getMaterialsByUserIdWithFilter(
|
||||
Page<QmsQualityInspectorMaterialVO> page,
|
||||
@Param("userId") Long userId,
|
||||
@Param("materialNo") String materialNo,
|
||||
@Param("materialCategoryCode") String materialCategoryCode,
|
||||
|
|
|
|||
|
|
@ -28,9 +28,10 @@ public interface QmsSupplierSqeMapMapper extends BaseMapper<QmsSupplierSqeMap> {
|
|||
IPage<QmsSupplierSqeMapVO> searchMap(@Param("request") QmsSupplierSqeSearchQO request, Page<QmsSupplierSqeMapVO> page);
|
||||
|
||||
/**
|
||||
* 按 userId 查询关联的供应商列表(支持供应商过滤)
|
||||
* 按 userId 查询关联的供应商列表(支持供应商过滤,分页)
|
||||
*/
|
||||
List<QmsUserSupplierVO> getSuppliersByUserId(
|
||||
IPage<QmsUserSupplierVO> getSuppliersByUserId(
|
||||
Page<QmsUserSupplierVO> page,
|
||||
@Param("userId") Long userId,
|
||||
@Param("supplierCode") String supplierCode,
|
||||
@Param("supplierName") String supplierName);
|
||||
|
|
|
|||
|
|
@ -27,10 +27,15 @@ public interface IQmsCoaTaskService extends IService<QmsCoaTask> {
|
|||
void delete(Long id);
|
||||
|
||||
/**
|
||||
* 修改COA通知任务(状态不为0时不可修改)
|
||||
* 修改COA通知任务(只允许修改报告要求和报告模板,修改后状态改为0)
|
||||
*/
|
||||
void update(QmsCoaTaskUpdateQO qo);
|
||||
|
||||
/**
|
||||
* 直接发布COA通知任务(状态改为1,填入发送时间)
|
||||
*/
|
||||
void publish(QmsCoaTaskAddQO qo);
|
||||
|
||||
/**
|
||||
* 批量发送(状态改为1,填入发送时间)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ public interface IQmsInspectionItemService extends IService<QmsInspectionItem> {
|
|||
PageData<QmsInspectionItemVO> search(QmsInspectionItemSearchQO qo);
|
||||
|
||||
/**
|
||||
* 按检测项ID查询明细列表
|
||||
* 按检测项ID查询详情(包含主表信息和明细列表)
|
||||
*/
|
||||
List<QmsInspectionItemDetailsVO> getDetails(Long id);
|
||||
QmsInspectionItemVO getDetails(Long id);
|
||||
|
||||
/**
|
||||
* 查询导出数据
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ 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.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.QmsMaterialsByUserQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorSearchQO;
|
||||
|
|
@ -65,7 +66,7 @@ public interface IQmsQualityInspectorService extends IService<QmsQualityInspecto
|
|||
void cancelTransfer(Long userId);
|
||||
|
||||
/**
|
||||
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤)
|
||||
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
||||
*/
|
||||
List<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode, String materialDesc);
|
||||
PageData<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode, String materialDesc, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ 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.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.QmsSupplierSqeSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsUserMaterialsQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsSupplierSqeMapVO;
|
||||
|
|
@ -46,7 +47,7 @@ public interface IQmsSupplierSqeMapService extends IService<QmsSupplierSqeMap> {
|
|||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 按 userId 查询该用户关联的供应商列表(支持供应商过滤)
|
||||
* 按 userId 查询该用户关联的供应商列表(支持供应商过滤,分页)
|
||||
*/
|
||||
List<QmsUserSupplierVO> getSuppliersByUserId(String supplierCode, String supplierName);
|
||||
PageData<QmsUserSupplierVO> getSuppliersByUserId(String supplierCode, String supplierName, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,48 +111,67 @@ public class QmsCoaTaskServiceImpl extends ServiceImpl<QmsCoaTaskMapper, QmsCoaT
|
|||
if (Objects.isNull(task)) {
|
||||
throw new NflgException(STATE.BusinessError, "任务不存在");
|
||||
}
|
||||
if (!Objects.equals(task.getStatus(), 0)) {
|
||||
throw new NflgException(STATE.BusinessError, "当前状态不允许修改,只有待发送(状态0)的任务才能修改");
|
||||
}
|
||||
|
||||
String operator = UserUtil.getUserName();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
var updater = lambdaUpdate().eq(QmsCoaTask::getId, qo.getId());
|
||||
|
||||
// 按供应商编号更新
|
||||
if (Objects.nonNull(qo.getSupplierCode()) && !qo.getSupplierCode().isEmpty()) {
|
||||
UserSupplier supplier = userSupplierService.getByCode(qo.getSupplierCode());
|
||||
if (Objects.isNull(supplier)) {
|
||||
throw new NflgException(STATE.BusinessError, "供应商编号不存在:" + qo.getSupplierCode());
|
||||
}
|
||||
updater.set(QmsCoaTask::getSupplierId, supplier.getId());
|
||||
}
|
||||
// 按物料编号更新
|
||||
if (Objects.nonNull(qo.getMaterialNo()) && !qo.getMaterialNo().isEmpty()) {
|
||||
QmsQcMaterial material = qcMaterialService.lambdaQuery()
|
||||
.eq(QmsQcMaterial::getMaterialNo, qo.getMaterialNo())
|
||||
.last("LIMIT 1")
|
||||
.one();
|
||||
if (Objects.isNull(material)) {
|
||||
throw new NflgException(STATE.BusinessError, "物料编号不存在:" + qo.getMaterialNo());
|
||||
}
|
||||
updater.set(QmsCoaTask::getMaterialId, material.getId());
|
||||
}
|
||||
// 只允许修改报告要求和报告模板
|
||||
if (Objects.nonNull(qo.getRequirement()) && !qo.getRequirement().isEmpty()) {
|
||||
updater.set(QmsCoaTask::getRequirement, qo.getRequirement());
|
||||
}
|
||||
if (Objects.nonNull(qo.getLastSubTime())) {
|
||||
updater.set(QmsCoaTask::getLastSubTime, qo.getLastSubTime());
|
||||
}
|
||||
if (Objects.nonNull(qo.getReportTemplate())) {
|
||||
updater.set(QmsCoaTask::getReportTemplate, qo.getReportTemplate());
|
||||
}
|
||||
updater.set(QmsCoaTask::getUpdateBy, operator)
|
||||
|
||||
// 修改后状态改为0(待发送)
|
||||
updater.set(QmsCoaTask::getStatus, 0)
|
||||
.set(QmsCoaTask::getUpdateBy, operator)
|
||||
.set(QmsCoaTask::getUpdateTime, now)
|
||||
.update();
|
||||
}
|
||||
|
||||
// ==================== 直接发布 ====================
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void publish(QmsCoaTaskAddQO qo) {
|
||||
// 按供应商编号查供应商
|
||||
UserSupplier supplier = userSupplierService.getByCode(qo.getSupplierCode());
|
||||
if (Objects.isNull(supplier)) {
|
||||
throw new NflgException(STATE.BusinessError, "供应商编号不存在:" + qo.getSupplierCode());
|
||||
}
|
||||
// 按物料编号查物料
|
||||
QmsQcMaterial material = qcMaterialService.lambdaQuery()
|
||||
.eq(QmsQcMaterial::getMaterialNo, qo.getMaterialNo())
|
||||
.last("LIMIT 1")
|
||||
.one();
|
||||
if (Objects.isNull(material)) {
|
||||
throw new NflgException(STATE.BusinessError, "物料编号不存在:" + qo.getMaterialNo());
|
||||
}
|
||||
|
||||
String operator = UserUtil.getUserName();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 直接创建状态为1(已发送)的任务,并填入发送时间
|
||||
QmsCoaTask task = new QmsCoaTask()
|
||||
.setSupplierId(supplier.getId())
|
||||
.setMaterialId(material.getId())
|
||||
.setUserId(UserUtil.getUserId())
|
||||
.setStatus(1)
|
||||
.setNoticeTime(now)
|
||||
.setRequirement(qo.getRequirement())
|
||||
.setReportTemplate(qo.getReportTemplate())
|
||||
.setLastSubTime(qo.getLastSubTime())
|
||||
.setDeleted(false)
|
||||
.setCreateBy(operator)
|
||||
.setCreateTime(now)
|
||||
.setUpdateBy(operator)
|
||||
.setUpdateTime(now);
|
||||
save(task);
|
||||
}
|
||||
|
||||
// ==================== 发送 ====================
|
||||
|
||||
@Transactional
|
||||
|
|
|
|||
|
|
@ -185,13 +185,28 @@ public class QmsInspectionItemServiceImpl extends ServiceImpl<QmsInspectionItemM
|
|||
// ==================== 明细查询 ====================
|
||||
|
||||
@Override
|
||||
public List<QmsInspectionItemDetailsVO> getDetails(Long id) {
|
||||
return detailsService.lambdaQuery()
|
||||
public QmsInspectionItemVO getDetails(Long id) {
|
||||
// 查询主表信息
|
||||
QmsInspectionItem item = getById(id);
|
||||
if (Objects.isNull(item)) {
|
||||
throw new NflgException(STATE.BusinessError, "检测项不存在");
|
||||
}
|
||||
|
||||
// 转换为主表VO
|
||||
QmsInspectionItemVO vo = toVO(item);
|
||||
|
||||
// 查询明细列表
|
||||
List<QmsInspectionItemDetailsVO> detailsList = detailsService.lambdaQuery()
|
||||
.eq(QmsInspectionItemDetails::getInspectionItemId, id)
|
||||
.list()
|
||||
.stream()
|
||||
.map(this::toDetailsVO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 设置明细列表
|
||||
vo.setDetails(detailsList);
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
// ==================== 导出 ====================
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
import com.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.QmsMaterialsByUserQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorSearchQO;
|
||||
|
|
@ -307,8 +308,15 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode, String materialDesc) {
|
||||
public PageData<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode, String materialDesc, Integer pageNum, Integer pageSize) {
|
||||
Long userId = UserUtil.getUserId();
|
||||
return baseMapper.getMaterialsByUserIdWithFilter(userId, materialNo, materialCategoryCode, materialDesc);
|
||||
Page<QmsQualityInspectorMaterialVO> page = new Page<>(pageNum, pageSize);
|
||||
IPage<QmsQualityInspectorMaterialVO> result = baseMapper.getMaterialsByUserIdWithFilter(page, userId, materialNo, materialCategoryCode, materialDesc);
|
||||
|
||||
return new PageData<QmsQualityInspectorMaterialVO>()
|
||||
.setPage((int) result.getCurrent())
|
||||
.setPageSize((int) result.getSize())
|
||||
.setTotal((int) result.getTotal())
|
||||
.setItems(result.getRecords());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
import com.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.QmsSupplierSqeSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsSupplierSqeMapVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsUserSupplierVO;
|
||||
|
|
@ -125,8 +126,15 @@ public class QmsSupplierSqeMapServiceImpl extends ServiceImpl<QmsSupplierSqeMapM
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<QmsUserSupplierVO> getSuppliersByUserId(String supplierCode, String supplierName) {
|
||||
public PageData<QmsUserSupplierVO> getSuppliersByUserId(String supplierCode, String supplierName, Integer pageNum, Integer pageSize) {
|
||||
Long userId = UserUtil.getUserId();
|
||||
return baseMapper.getSuppliersByUserId(userId, supplierCode, supplierName);
|
||||
Page<QmsUserSupplierVO> page = new Page<>(pageNum, pageSize);
|
||||
IPage<QmsUserSupplierVO> result = baseMapper.getSuppliersByUserId(page, userId, supplierCode, supplierName);
|
||||
|
||||
return new PageData<QmsUserSupplierVO>()
|
||||
.setPage((int) result.getCurrent())
|
||||
.setPageSize((int) result.getSize())
|
||||
.setTotal((int) result.getTotal())
|
||||
.setItems(result.getRecords());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@
|
|||
qi.id,
|
||||
qi.material_id,
|
||||
m.material_no,
|
||||
m.drawing_no,
|
||||
m.drawing_no_ver,
|
||||
m.material_category_code,
|
||||
m.material_category_code_path_name AS material_category_name,
|
||||
m.material_desc AS material_name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue