Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test
This commit is contained in:
@@ -180,7 +180,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_160_000, "试剂耗材不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料分类/大类不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_PARENT_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料分类/大类的父类不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_CODE_EXISTED = new ErrorCode(1_032_160_000, "物料大类编码重复");
|
||||
ErrorCode MATERIAL_PRODUCT_CODE_MODELNO_EXISTED = new ErrorCode(1_032_160_000, "物料大类【编码+型号】重复");
|
||||
ErrorCode MATERIAL_CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_032_160_000, "分类下含有子分类或物料大类,不可删除");
|
||||
ErrorCode MATERIAL_PRODUCT_EXISTS_BATCH = new ErrorCode(1_032_160_000, "物料大类下存在物料批次,不可删除");
|
||||
ErrorCode MATERIAL_PRODUCTS_EXISTS_CATEGORY = new ErrorCode(1_032_160_000, "物料大类列表中存在分类数据");
|
||||
@@ -192,6 +192,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MATERIAL_BATCH_ASSIGN_END = new ErrorCode(1_032_160_000, "物料批次已拆分,不可操作");
|
||||
ErrorCode GONGDUAN_BELONG_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段所属的物料批次不一致");
|
||||
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次数量不一致");
|
||||
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_AVAILABLE_QUANTITY_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次可用数量不一致");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库,出库不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库明细,出库明细等不存在");
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.*;
|
||||
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
@@ -29,6 +28,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -63,6 +63,9 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
@Resource private ReportDocumentMainService reportDocumentMainService;
|
||||
@Resource private ReportDocumentDataService reportDocumentDataService;
|
||||
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
||||
@Resource private ReportDocumentFileService reportDocumentFileService;
|
||||
@Resource private ReportDocumentAssistService reportDocumentAssistService;
|
||||
|
||||
|
||||
@Resource private DataTemplateService dataTemplateService;
|
||||
|
||||
@@ -228,4 +231,16 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/createIWorkflow")
|
||||
@Operation(summary = "创建iwork流程-调试用")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')")
|
||||
public CommonResult<IWorkOperationRespDTO> createIWorkflow(HttpServletRequest request) {
|
||||
String mainId = request.getParameter("mainId");
|
||||
String fileId = request.getParameter("fileId");
|
||||
ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(Long.valueOf(mainId));
|
||||
ReportDocumentFileDO fileDO = reportDocumentFileService.getReportDocumentFile(Long.valueOf(fileId));
|
||||
return reportDocumentAssistService.createIWorkflow(mainDO, fileDO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检测报告明细 Mapper
|
||||
@@ -26,4 +30,6 @@ public interface ReportDocumentDataMapper extends BaseMapperX<ReportDocumentData
|
||||
.orderByDesc(ReportDocumentDataDO::getId));
|
||||
}
|
||||
|
||||
List<Map<String, Object>> queryBaseSampleBySourceId(@Param("sourceId") Long sourceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.module.system.mq.iwork.IWorkBizCallbackMessage;
|
||||
import com.zt.plat.module.system.mq.iwork.IWorkBizCallbackResultMessage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RocketMQMessageListener(
|
||||
topic = IWorkBizCallbackMessage.TOPIC,
|
||||
consumerGroup = IWorkBizCallbackMessage.TOPIC + "_CONSUMER_local",
|
||||
selectorExpression = ReportDocListenerConstant.IWORK_BIZ_CALL_BACK_KEY // 与 bizCallbackKey 一致
|
||||
)
|
||||
public class IWorkBizCallbackListener implements RocketMQListener<IWorkBizCallbackMessage> {
|
||||
private final RocketMQTemplate rocketMQTemplate;
|
||||
@Override
|
||||
public void onMessage(IWorkBizCallbackMessage message) {
|
||||
log.info("收到 iWork 回调: requestId={}", message.getRequestId());
|
||||
log.info("收到 iWork 回调: message={}", JSONObject.toJSONString(message));
|
||||
|
||||
IWorkBizCallbackResultMessage result;
|
||||
try {
|
||||
// 处理业务逻辑
|
||||
processCallback(message);
|
||||
|
||||
result = IWorkBizCallbackResultMessage.builder()
|
||||
.requestId(message.getRequestId())
|
||||
.bizCallbackKey(message.getBizCallbackKey())
|
||||
.success(true)
|
||||
.attempt(message.getAttempt())
|
||||
.maxAttempts(message.getMaxAttempts())
|
||||
.payload(message.getPayload())
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
log.error("处理回调失败", e);
|
||||
result = IWorkBizCallbackResultMessage.builder()
|
||||
.requestId(message.getRequestId())
|
||||
.bizCallbackKey(message.getBizCallbackKey())
|
||||
.success(false)
|
||||
.errorMessage(e.getMessage())
|
||||
.attempt(message.getAttempt())
|
||||
.maxAttempts(message.getMaxAttempts())
|
||||
.payload(message.getPayload())
|
||||
.build();
|
||||
}
|
||||
|
||||
// 发送处理结果
|
||||
rocketMQTemplate.syncSend(IWorkBizCallbackResultMessage.TOPIC, result);
|
||||
}
|
||||
|
||||
private void processCallback(IWorkBizCallbackMessage message) {
|
||||
// 业务处理逻辑
|
||||
// 1. 解析 payload 获取回调数据
|
||||
// 2. 更新业务状态
|
||||
// 3. 保存签章文件等
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.zt.plat.module.qms.business.reportdoc.listener;
|
||||
|
||||
public class ReportDocListenerConstant {
|
||||
|
||||
/**
|
||||
* iwork回调key,用于消息队列接收消息
|
||||
* */
|
||||
public static final String IWORK_BIZ_CALL_BACK_KEY = "qms_report_document_seal_callback";
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFil
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.listener.ReportDocListenerConstant;
|
||||
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
||||
@@ -105,6 +106,7 @@ public class ReportDocumentAssistService {
|
||||
dto.setYysx("检测报告用印");
|
||||
dto.setXyywjUrl(docFile.getUrl());
|
||||
dto.setYwxtdjbh(sequenceUtil.genCode(sequenceKey));
|
||||
dto.setBizCallbackKey(ReportDocListenerConstant.IWORK_BIZ_CALL_BACK_KEY); //业务回调标识,回调分发使用
|
||||
return iWorkIntegrationApi.createWorkflow(dto);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -108,7 +108,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
|
||||
Long productId = pageReqVO.getProductId();
|
||||
if (productId != null) {
|
||||
DeviceConfigBusinessRuleDO ruleDO = deviceConfigBusinessRuleService.getByProductId(productId, DeviceConstant.MAINTAIN_TYPE);
|
||||
DeviceConfigBusinessRuleDO ruleDO = deviceConfigBusinessRuleService.getByProductId(productId, pageReqVO.getBusinessDomain());
|
||||
if(ruleDO != null){
|
||||
pageReqVO.setRuleId(ruleDO.getId());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -103,8 +104,23 @@ public class DeviceMaintainController extends AbstractFileUploadController imple
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备-点检、保养记录")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-maintain:create')")
|
||||
public CommonResult<DeviceMaintainRespVO> createDeviceMaintain(@Valid @RequestBody DeviceMaintainSaveReqVO createReqVO) {
|
||||
return success(deviceMaintainService.createDeviceMaintain(createReqVO));
|
||||
public CommonResult<DeviceMaintainVO> createDeviceMaintain(@RequestBody JSONObject jsonObject) {
|
||||
Long deviceId = jsonObject.getLong("deviceId");
|
||||
String dataType = jsonObject.getString("dataType");
|
||||
String dateStr = jsonObject.getString("date");
|
||||
if (deviceId == null || dataType == null) {
|
||||
return CommonResult.error(DEVICE_MAINTAIN_NOT_EXISTS.getCode(), "参数错误");
|
||||
}
|
||||
//检查设备状态
|
||||
CommonResult<Boolean> checkResult = deviceInfomationService.checkDeviceUsable(deviceId);
|
||||
if(!checkResult.isSuccess()){
|
||||
return checkResult.error(checkResult.getCode(), checkResult.getMsg());
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if(ObjectUtils.isEmpty(dateStr))
|
||||
dateStr = sdf.format(new Date());
|
||||
LocalDate localDate = LocalDate.parse(dateStr);
|
||||
return deviceMaintainService.create(deviceId, localDate, dataType);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
|
||||
@@ -57,4 +57,7 @@ public class DeviceConfigBusinessItemPageReqVO extends PageParam {
|
||||
@Schema(description = "设备大类id")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private String businessDomain;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user