Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -261,4 +261,8 @@ public interface ErrorCodeConstants {
|
|||||||
|
|
||||||
// ========== 文件记录分发号,记录文件分发与线下对应的分发号对应,且标记到目标人物 TODO 补充编号 ==========
|
// ========== 文件记录分发号,记录文件分发与线下对应的分发号对应,且标记到目标人物 TODO 补充编号 ==========
|
||||||
ErrorCode RECORD_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_450_000, "文件记录分发号,记录文件分发与线下对应的分发号对应,且标记到目标人物不存在");
|
ErrorCode RECORD_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_450_000, "文件记录分发号,记录文件分发与线下对应的分发号对应,且标记到目标人物不存在");
|
||||||
|
|
||||||
|
|
||||||
|
// ========== 文件记录附件 TODO 补充编号 ==========
|
||||||
|
ErrorCode RECORD_FILE_ATTACHMENT_NOT_EXISTS = new ErrorCode(1_032_450_099, "文件记录附件不存在");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIg
|
|||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.*;
|
import com.zt.plat.module.qms.resource.material.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.listener.MaterialAssayResultListener;
|
||||||
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
||||||
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
||||||
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
|
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
|
||||||
@@ -22,6 +23,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -49,6 +51,8 @@ public class MaterialLifecycleController extends AbstractFileUploadController im
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MaterialLifecycleService materialLifecycleService;
|
private MaterialLifecycleService materialLifecycleService;
|
||||||
|
@Autowired
|
||||||
|
private MaterialAssayResultListener materialAssayResultListener;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新建物料流程")
|
@Operation(summary = "新建物料流程")
|
||||||
@@ -122,6 +126,11 @@ public class MaterialLifecycleController extends AbstractFileUploadController im
|
|||||||
return success(materialLifecycleService.inventoryCheckInfomation(inventoryReqVO));
|
return success(materialLifecycleService.inventoryCheckInfomation(inventoryReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
public void test() {
|
||||||
|
materialAssayResultListener.bpmTest();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出物料通用流程,物料验收、退换货 Excel")
|
@Operation(summary = "导出物料通用流程,物料验收、退换货 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:export')")
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:export')")
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料检化验关联信息 Response VO")
|
@Schema(description = "管理后台 - 物料检化验关联信息 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -36,6 +42,9 @@ public class MaterialCorrelationAssayRespVO {
|
|||||||
@ExcelProperty("样品大类id,检化验业务样品大类")
|
@ExcelProperty("样品大类id,检化验业务样品大类")
|
||||||
private Long sampleId;
|
private Long sampleId;
|
||||||
|
|
||||||
|
@Schema(description = "样品标签模板")
|
||||||
|
private String sampleLabelTemplate;
|
||||||
|
|
||||||
@Schema(description = "批次id", example = "3150")
|
@Schema(description = "批次id", example = "3150")
|
||||||
@ExcelProperty("批次id")
|
@ExcelProperty("批次id")
|
||||||
private Long batchId;
|
private Long batchId;
|
||||||
@@ -48,6 +57,10 @@ public class MaterialCorrelationAssayRespVO {
|
|||||||
@ExcelProperty("检测项")
|
@ExcelProperty("检测项")
|
||||||
private String item;
|
private String item;
|
||||||
|
|
||||||
|
@Schema(description = "检测项列表")
|
||||||
|
@ExcelProperty("检测项列表")
|
||||||
|
private List<Long> items;
|
||||||
|
|
||||||
@Schema(description = "状态,未开始、进行中、已完成", example = "2")
|
@Schema(description = "状态,未开始、进行中、已完成", example = "2")
|
||||||
@ExcelProperty("状态,未开始、进行中、已完成")
|
@ExcelProperty("状态,未开始、进行中、已完成")
|
||||||
private String assayStatus;
|
private String assayStatus;
|
||||||
@@ -76,4 +89,13 @@ public class MaterialCorrelationAssayRespVO {
|
|||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
// 设置检测项列表
|
||||||
|
public List<Long> getItems() {
|
||||||
|
if (StrUtil.isBlank(this.item)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
JSONArray array = JSONUtil.parseArray(this.item);
|
||||||
|
return array.toList(Long.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料检化验关联信息新增/修改 Request VO")
|
@Schema(description = "管理后台 - 物料检化验关联信息新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class MaterialCorrelationAssaySaveReqVO {
|
public class MaterialCorrelationAssaySaveReqVO {
|
||||||
@@ -34,6 +37,9 @@ public class MaterialCorrelationAssaySaveReqVO {
|
|||||||
@Schema(description = "检测项")
|
@Schema(description = "检测项")
|
||||||
private String item;
|
private String item;
|
||||||
|
|
||||||
|
@Schema(description = "检测项列表")
|
||||||
|
private List<Long> items;
|
||||||
|
|
||||||
@Schema(description = "状态,未开始、进行中、已完成", example = "2")
|
@Schema(description = "状态,未开始、进行中、已完成", example = "2")
|
||||||
private String assayStatus;
|
private String assayStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -98,14 +98,17 @@ public class MaterialLifecycleDetailRespVO {
|
|||||||
@ExcelProperty("是否检化验,1-是,0-否")
|
@ExcelProperty("是否检化验,1-是,0-否")
|
||||||
private Integer assayFlag;
|
private Integer assayFlag;
|
||||||
|
|
||||||
|
@Schema(description = "检化验信息")
|
||||||
|
private MaterialCorrelationAssayRespVO assayInfo;
|
||||||
|
|
||||||
@Schema(description = "检化验id")
|
@Schema(description = "检化验id")
|
||||||
private Long assayId;
|
private Long assayId;
|
||||||
|
|
||||||
@Schema(description = "检化验样品大类")
|
/*@Schema(description = "检化验样品大类")
|
||||||
private Long assaySampleId;
|
private Long assaySampleId;
|
||||||
|
|
||||||
@Schema(description = "检化验检测项")
|
@Schema(description = "检化验检测项")
|
||||||
private List<Long> assayItemIds;
|
private List<Long> assayItemIds;*/
|
||||||
|
|
||||||
@Schema(description = "物料实例id", example = "968")
|
@Schema(description = "物料实例id", example = "968")
|
||||||
@ExcelProperty("物料实例id")
|
@ExcelProperty("物料实例id")
|
||||||
|
|||||||
@@ -29,11 +29,14 @@ public class MaterialLifecycleDetailSaveReqVO {
|
|||||||
@Schema(description = "是否检化验,1-是,0-否")
|
@Schema(description = "是否检化验,1-是,0-否")
|
||||||
private Integer assayFlag;
|
private Integer assayFlag;
|
||||||
|
|
||||||
@Schema(description = "检化验样品大类")
|
@Schema(description = "检化验信息")
|
||||||
|
private MaterialCorrelationAssaySaveReqVO assayInfo;
|
||||||
|
|
||||||
|
/*@Schema(description = "检化验样品大类")
|
||||||
private Long assaySampleId;
|
private Long assaySampleId;
|
||||||
|
|
||||||
@Schema(description = "检化验检测项")
|
@Schema(description = "检化验检测项")
|
||||||
private List<Long> assayItemIds;
|
private List<Long> assayItemIds;*/
|
||||||
|
|
||||||
@Schema(description = "物料实例id", example = "968")
|
@Schema(description = "物料实例id", example = "968")
|
||||||
private Long infomationId;
|
private Long infomationId;
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class MaterialLifecycleSaveReqVO {
|
|||||||
@Schema(description = "盘点项")
|
@Schema(description = "盘点项")
|
||||||
private List<MaterialInventoryCheckItemSaveReqVO> checkItems;
|
private List<MaterialInventoryCheckItemSaveReqVO> checkItems;
|
||||||
|
|
||||||
@Schema(description = "工段列表")
|
@Schema(description = "明细列表")
|
||||||
private List<MaterialLifecycleDetailSaveReqVO> detailList;
|
private List<MaterialLifecycleDetailSaveReqVO> detailList;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,15 @@ package com.zt.plat.module.qms.resource.material.dal.mapper;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialCorrelationAssayPageReqVO;
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialCorrelationAssayPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialCorrelationAssayRespVO;
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialCorrelationAssayDO;
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialCorrelationAssayDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料检化验关联信息 Mapper
|
* 物料检化验关联信息 Mapper
|
||||||
*
|
*
|
||||||
@@ -35,4 +40,12 @@ public interface MaterialCorrelationAssayMapper extends BaseMapperX<MaterialCorr
|
|||||||
.orderByDesc(MaterialCorrelationAssayDO::getId));
|
.orderByDesc(MaterialCorrelationAssayDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<MaterialCorrelationAssayRespVO> selectRespListByIds(List<Long> ids) {
|
||||||
|
MPJLambdaWrapperX<MaterialCorrelationAssayDO> wrapper = new MPJLambdaWrapperX<MaterialCorrelationAssayDO>()
|
||||||
|
.selectAll(MaterialCorrelationAssayDO.class)
|
||||||
|
.selectAs(ConfigBaseSampleDO::getPrintTemplate, MaterialCorrelationAssayRespVO::getSampleLabelTemplate)
|
||||||
|
.leftJoin(ConfigBaseSampleDO.class, ConfigBaseSampleDO::getBaseSampleId, MaterialCorrelationAssayDO::getSampleId)
|
||||||
|
.inIfPresent(MaterialCorrelationAssayDO::getId, ids);
|
||||||
|
return selectJoinList(MaterialCorrelationAssayRespVO.class, wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.listener;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||||
|
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
//@RequiredArgsConstructor
|
||||||
|
//@RocketMQMessageListener(
|
||||||
|
// topic = "ASSAY_RESULT_CALLBACK_TOPIC", // 检化验结果主题
|
||||||
|
// consumerGroup = "ASSAY_RESULT_CALLBACK_CONSUMER",
|
||||||
|
// selectorExpression = "material_assay_result_callback" // 标签
|
||||||
|
//)
|
||||||
|
//public class MaterialAssayResultListener implements RocketMQListener<Object> {
|
||||||
|
public class MaterialAssayResultListener {
|
||||||
|
|
||||||
|
/*@Autowired
|
||||||
|
private MaterialLifecycleService materialLifecycleService;*/
|
||||||
|
@Autowired
|
||||||
|
private BpmTaskApi bpmTaskApi;
|
||||||
|
|
||||||
|
public void bpmTest() {
|
||||||
|
log.info("收到检化验结果回调:");
|
||||||
|
CommonResult<List<BpmTaskRespDTO>> taskListRes = bpmTaskApi.getTaskListByProcessInstanceId("2614cd91-2c1c-11f1-8770-005056c00001");
|
||||||
|
log.info("任务数量 {} ,任务详情 {}", taskListRes.getData().size(), taskListRes.getData());
|
||||||
|
|
||||||
|
// 处理当前节点
|
||||||
|
for (BpmTaskRespDTO currentTask : taskListRes.getData()) {
|
||||||
|
log.info("当前节点信息:");
|
||||||
|
log.info(" - 任务名称:{}", currentTask.getName());
|
||||||
|
log.info(" - 处理人:{}", currentTask.getAssignee());
|
||||||
|
log.info(" - 状态:{}", currentTask.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -89,4 +89,12 @@ public interface MaterialCorrelationAssayService {
|
|||||||
* @param needUpdateAssays 检化验关联信息列表
|
* @param needUpdateAssays 检化验关联信息列表
|
||||||
*/
|
*/
|
||||||
void updateBatch(List<MaterialCorrelationAssayDO> needUpdateAssays);
|
void updateBatch(List<MaterialCorrelationAssayDO> needUpdateAssays);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param ids id列表
|
||||||
|
* @return 检化验关联信息列表
|
||||||
|
*/
|
||||||
|
List<MaterialCorrelationAssayRespVO> getRespListByIds(List<Long> ids);
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user