Merge branch 'main' of http://27.223.88.102:33000/chenx/qhmes
This commit is contained in:
@@ -1093,8 +1093,20 @@ jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRec
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/components/MesXslEquipDowntimeRecordModal.vue
|
||||
|
||||
-- author:GHT---date:20260616--for: 【MES上辅机】生产环境 SQL Server 中间库连接池校验 DUAL 报错修复 ---
|
||||
原因:application-prod.yml 全局 druid.validationQuery 为 SELECT 1 FROM DUAL,动态创建的 sqlserver_mcs 数据源继承该配置后在 SQL Server 上报「对象名 DUAL 无效」。
|
||||
修改:prod 全局改为 SELECT 1;McsDataSourceManager 创建/恢复 SQL Server 数据源时显式设置 validationQuery=SELECT 1。
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/datasource/McsDataSourceManager.java
|
||||
|
||||
-- author:GHT---date:20260616--for: 【MES上辅机】重启后中间库配置未自动加载(租户ID硬编码为0)---
|
||||
原因:McsDataSourceInitializer 启动时只查 tenant_id=0,页面保存用当前租户(如1002),重启后查不到配置,连接状态回退为 yml。
|
||||
修改:新增 loadStartupConfig 按最近更新时间加载任意租户配置;isDbConfigActive 同时校验数据源是否已注册。
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/IMesXslMcsDbConfigService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslMcsDbConfigServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/config/McsDataSourceInitializer.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/datasource/McsDataSourceManager.java
|
||||
|
||||
-- author:jiangxh---date:20260617--for: 【快检实验标准】补齐 tenant_id 为空的历史数据并恢复租户过滤 ---
|
||||
原因:一条快检实验标准 tenant_id 为 NULL,桌面端按 tenantId=1002 拉取时漏掉该条。
|
||||
修改:Flyway 将 NULL tenant_id 对齐为 1002;新增保存时自动写入 tenant_id;恢复 anon/list 与桌面端 tenantId 查询参数。
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_152__mes_xsl_rubber_quick_test_std_tenant_backfill.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDesktopAnonController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestStdServiceImpl.java
|
||||
yy-admin-master/YY.Admin.Services/Service/RubberQuickTestStd/RubberQuickTestStdService.cs
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.jeecg.modules.xslmes.approval.callback.IApprovalBizCallback;
|
||||
import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.service.MesXslStompNotifyService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -25,9 +26,13 @@ import org.springframework.stereotype.Component;
|
||||
public class RubberQuickTestStdApprovalCallback implements IApprovalBizCallback {
|
||||
|
||||
private final IMesXslRubberQuickTestStdService stdService;
|
||||
private final MesXslStompNotifyService stompNotify;
|
||||
|
||||
public RubberQuickTestStdApprovalCallback(IMesXslRubberQuickTestStdService stdService) {
|
||||
public RubberQuickTestStdApprovalCallback(
|
||||
IMesXslRubberQuickTestStdService stdService,
|
||||
MesXslStompNotifyService stompNotify) {
|
||||
this.stdService = stdService;
|
||||
this.stompNotify = stompNotify;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,5 +60,8 @@ public class RubberQuickTestStdApprovalCallback implements IApprovalBizCallback
|
||||
.eq(MesXslRubberQuickTestStd::getId, bizDataId)
|
||||
.set(MesXslRubberQuickTestStd::getAuditStatus, auditStatus)
|
||||
.update();
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】审批联动 STOMP 同步桌面端-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("audit", bizDataId);
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】审批联动 STOMP 同步桌面端-----------
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -21,6 +22,7 @@ import org.jeecg.modules.print.entity.PrintTemplate;
|
||||
import org.jeecg.modules.print.service.IPrintBizTemplateBindService;
|
||||
import org.jeecg.modules.print.service.IPrintTemplateService;
|
||||
import org.jeecg.modules.print.util.PrintBizDataMappingUtil;
|
||||
import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.constant.MesXslCustomerBizStatus;
|
||||
import org.jeecg.modules.xslmes.constant.MesXslPrintConstants;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslCustomer;
|
||||
@@ -32,6 +34,11 @@ import org.jeecg.modules.xslmes.entity.MesXslUnit;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslVehicle;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouse;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouseArea;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingProductionPlan;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWeightRecord;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslCustomerService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRawMaterialCardService;
|
||||
@@ -42,6 +49,9 @@ import org.jeecg.modules.xslmes.service.IMesXslUnitService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslVehicleService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseAreaService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixingProductionPlanService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWeightRecordService;
|
||||
import org.jeecg.modules.xslmes.service.MesXslStompNotifyService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRawMaterialCardBriefVO;
|
||||
@@ -87,6 +97,9 @@ public class MesXslDesktopAnonController {
|
||||
private final IPrintBizTemplateBindService printBizTemplateBindService;
|
||||
private final IPrintTemplateService printTemplateService;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final IMesXslMixingProductionPlanService mixingProductionPlanService;
|
||||
private final IMesXslRubberQuickTestStdService rubberQuickTestStdService;
|
||||
private final IMesXslRubberQuickTestRecordService rubberQuickTestRecordService;
|
||||
|
||||
// ═══════════════════════════ 车辆管理 ═══════════════════════════
|
||||
|
||||
@@ -925,6 +938,105 @@ public class MesXslDesktopAnonController {
|
||||
}
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端单位下拉只读-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端密炼生产计划只读-----------
|
||||
@Operation(summary = "密炼生产计划维护-免密分页列表查询(供桌面端快检记录筛选)")
|
||||
@GetMapping("/xslmes/mesXslMixingProductionPlan/anon/list")
|
||||
public Result<IPage<MesXslMixingProductionPlan>> mixingProductionPlanAnonList(
|
||||
MesXslMixingProductionPlan model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "500") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslMixingProductionPlan> qw = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
qw.orderByAsc("sort_no").orderByAsc("create_time");
|
||||
IPage<MesXslMixingProductionPlan> page =
|
||||
mixingProductionPlanService.page(new Page<>(pageNo, pageSize), qw);
|
||||
return Result.OK(page);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端密炼生产计划只读-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检实验标准】桌面端只读列表与详情-----------
|
||||
@Operation(summary = "胶料快检实验标准-免密分页列表")
|
||||
@GetMapping("/xslmes/mesXslRubberQuickTestStd/anon/list")
|
||||
public Result<IPage<MesXslRubberQuickTestStd>> rubberQuickTestStdAnonList(
|
||||
MesXslRubberQuickTestStd model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesXslRubberQuickTestStd> qw = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
qw.orderByDesc("create_time");
|
||||
IPage<MesXslRubberQuickTestStd> page = rubberQuickTestStdService.page(new Page<>(pageNo, pageSize), qw);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@Operation(summary = "胶料快检实验标准-免密通过id查询(含明细)")
|
||||
@GetMapping("/xslmes/mesXslRubberQuickTestStd/anon/queryById")
|
||||
public Result<MesXslRubberQuickTestStd> rubberQuickTestStdAnonQueryById(@RequestParam(name = "id") String id) {
|
||||
MesXslRubberQuickTestStd entity = rubberQuickTestStdService.getById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
entity.setLineList(rubberQuickTestStdService.selectLinesByStdId(id));
|
||||
return Result.OK(entity);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检实验标准】桌面端只读列表与详情-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检实验标准查询-----------
|
||||
private static final String RUBBER_QUICK_TEST_STD_ENABLE_IN_USE = "1";
|
||||
|
||||
@Operation(summary = "胶料快检实验标准-免密按胶料名称查询使用中标准及明细")
|
||||
@GetMapping("/xslmes/mesXslRubberQuickTestStd/anon/queryByRubberMaterialName")
|
||||
public Result<MesXslRubberQuickTestStd> rubberQuickTestStdAnonQueryByRubberMaterialName(
|
||||
@RequestParam(name = "rubberMaterialName") String rubberMaterialName) {
|
||||
if (oConvertUtils.isEmpty(rubberMaterialName)) {
|
||||
return Result.error("胶料名称不能为空");
|
||||
}
|
||||
String name = rubberMaterialName.trim();
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestStd> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(MesXslRubberQuickTestStd::getRubberMaterialName, name);
|
||||
qw.eq(MesXslRubberQuickTestStd::getEnableStatus, RUBBER_QUICK_TEST_STD_ENABLE_IN_USE);
|
||||
qw.eq(MesXslRubberQuickTestStd::getAuditStatus, XslMesBizConstants.RUBBER_QUICK_TEST_STD_AUDIT_APPROVED);
|
||||
qw.orderByDesc(MesXslRubberQuickTestStd::getCreateTime);
|
||||
MesXslRubberQuickTestStd std = rubberQuickTestStdService.getOne(qw, false);
|
||||
if (std == null) {
|
||||
return Result.error("未找到胶料「" + name + "」对应的使用中且已批准的快检实验标准");
|
||||
}
|
||||
std.setLineList(rubberQuickTestStdService.selectLinesByStdId(std.getId()));
|
||||
return Result.OK(std);
|
||||
}
|
||||
|
||||
@Operation(summary = "胶料快检实验标准-免密查询明细")
|
||||
@GetMapping("/xslmes/mesXslRubberQuickTestStd/anon/queryLineListByStdId")
|
||||
public Result<List<MesXslRubberQuickTestStdLine>> rubberQuickTestStdAnonQueryLineListByStdId(
|
||||
@RequestParam(name = "id") String id) {
|
||||
return Result.OK(rubberQuickTestStdService.selectLinesByStdId(id));
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检实验标准查询-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检记录保存-----------
|
||||
@Operation(summary = "胶料快检记录-免密添加")
|
||||
@PostMapping("/xslmes/mesXslRubberQuickTestRecord/anon/add")
|
||||
public Result<String> rubberQuickTestRecordAnonAdd(@RequestBody MesXslRubberQuickTestRecord record) {
|
||||
if (record == null) {
|
||||
return Result.error("参数不能为空");
|
||||
}
|
||||
if (oConvertUtils.isEmpty(record.getRubberMaterialName())) {
|
||||
return Result.error("胶料名称不能为空");
|
||||
}
|
||||
List<MesXslRubberQuickTestRecordLine> lineList = record.getLineList();
|
||||
if (lineList == null || lineList.isEmpty()) {
|
||||
return Result.error("请维护检验明细");
|
||||
}
|
||||
try {
|
||||
rubberQuickTestRecordService.saveMain(record, lineList);
|
||||
stompNotify.publishRubberQuickTestRecordChanged("add", record.getId());
|
||||
return Result.OK("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检记录保存-----------
|
||||
|
||||
// ─────────────────────────── 车辆私有辅助 ────────────────────────────
|
||||
|
||||
private void applyWeightNetAndBillType(MesXslWeightRecord record) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
@@ -163,6 +164,15 @@ public class MesXslRubberQuickTestRecordController
|
||||
return Result.OK(mesXslRubberQuickTestRecordService.selectLinesByRecordId(id));
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】查询原始数据明细-----------
|
||||
@Operation(summary = "MES胶料快检记录-查询原始数据明细")
|
||||
@GetMapping(value = "/queryRawLineListByRecordId")
|
||||
public Result<List<MesXslRubberQuickTestRecordRawLine>> queryRawLineListByRecordId(
|
||||
@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.OK(mesXslRubberQuickTestRecordService.selectRawLinesByRecordId(id));
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】查询原始数据明细-----------
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestRecord model) {
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.service.MesXslStompNotifyService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestStdPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -73,6 +74,9 @@ public class MesXslRubberQuickTestStdController
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Autowired
|
||||
private MesXslStompNotifyService stompNotify;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestStd>> queryPageList(
|
||||
@@ -107,6 +111,9 @@ public class MesXslRubberQuickTestStdController
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("add", main.getId());
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@@ -129,6 +136,9 @@ public class MesXslRubberQuickTestStdController
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("edit", main.getId());
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@@ -142,6 +152,9 @@ public class MesXslRubberQuickTestStdController
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delMain(id);
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("delete", id);
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@@ -155,6 +168,9 @@ public class MesXslRubberQuickTestStdController
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("batchDelete", ids);
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -196,6 +212,9 @@ public class MesXslRubberQuickTestStdController
|
||||
.set(MesXslRubberQuickTestStd::getEnableStatus, enableStatus)
|
||||
.update();
|
||||
if (updated) {
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
stompNotify.publishRubberQuickTestStdChanged("status", id);
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端 STOMP 同步-----------
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
MesXslRubberQuickTestStd cur = mesXslRubberQuickTestStdService.getById(id);
|
||||
@@ -272,6 +291,18 @@ public class MesXslRubberQuickTestStdController
|
||||
if (!XslMesBizConstants.PS_TYPE_RAW_INSPECT_STD.equals(ps.getPsType())) {
|
||||
return "发行编号须选择类型为原材料检验标准的密炼PS";
|
||||
}
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】发行编号仅允许选择编制状态密炼PS-----------
|
||||
boolean psCompileIdChanged = true;
|
||||
if (oConvertUtils.isNotEmpty(excludeId)) {
|
||||
MesXslRubberQuickTestStd existingStd = mesXslRubberQuickTestStdService.getById(excludeId);
|
||||
if (existingStd != null && oConvertUtils.isNotEmpty(existingStd.getPsCompileId())) {
|
||||
psCompileIdChanged = !existingStd.getPsCompileId().equals(main.getPsCompileId());
|
||||
}
|
||||
}
|
||||
if (psCompileIdChanged && !"compile".equals(ps.getStatus())) {
|
||||
return "发行编号须选择编制状态的密炼PS";
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】发行编号仅允许选择编制状态密炼PS-----------
|
||||
main.setIssueNumber(ps.getPsCode());
|
||||
if (main.getIssueDate() == null && ps.getIssueDate() != null) {
|
||||
main.setIssueDate(ps.getIssueDate());
|
||||
|
||||
@@ -130,4 +130,8 @@ public class MesXslRubberQuickTestRecord implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<MesXslRubberQuickTestRecordLine> lineList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "原始数据明细(试验结果全部检测值)")
|
||||
private List<MesXslRubberQuickTestRecordRawLine> rawLineList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.jeecg.modules.xslmes.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* MES 胶料快检记录原始数据明细(试验结果全部检测值)
|
||||
*/
|
||||
@Data
|
||||
@TableName("mes_xsl_rubber_quick_test_record_raw_line")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES胶料快检记录原始数据明细")
|
||||
public class MesXslRubberQuickTestRecordRawLine implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Schema(description = "主表ID mes_xsl_rubber_quick_test_record.id")
|
||||
private String recordId;
|
||||
|
||||
@Excel(name = "编号", width = 14)
|
||||
@Schema(description = "试验结果编号(如1_1)")
|
||||
private String rowNo;
|
||||
|
||||
@Schema(description = "数据点ID")
|
||||
private String dataPointId;
|
||||
|
||||
@Excel(name = "数据点", width = 18)
|
||||
private String inspectItem;
|
||||
|
||||
@Excel(name = "下限值", width = 12, type = 10)
|
||||
private BigDecimal lowerLimit;
|
||||
|
||||
@Excel(name = "上限值", width = 12, type = 10)
|
||||
private BigDecimal upperLimit;
|
||||
|
||||
@Excel(name = "检测值", width = 12, type = 10)
|
||||
private BigDecimal inspectValue;
|
||||
|
||||
@Excel(name = "行检验结果", width = 10, dicCode = "xslmes_rubber_quick_test_record_result")
|
||||
@Dict(dicCode = "xslmes_rubber_quick_test_record_result")
|
||||
@Schema(description = "行检验结果(1合格0不合格)")
|
||||
private String rowInspectResult;
|
||||
|
||||
private Integer sortNo;
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.xslmes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
|
||||
|
||||
public interface MesXslRubberQuickTestRecordRawLineMapper extends BaseMapper<MesXslRubberQuickTestRecordRawLine> {}
|
||||
@@ -28,20 +28,16 @@ public class McsDataSourceInitializer implements ApplicationRunner {
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
try {
|
||||
MesXslMcsDbConfig config = mcsDbConfigService.getOne(
|
||||
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<MesXslMcsDbConfig>()
|
||||
.eq(MesXslMcsDbConfig::getTenantId, 0)
|
||||
.orderByDesc(MesXslMcsDbConfig::getUpdateTime)
|
||||
.last("LIMIT 1"),
|
||||
false);
|
||||
MesXslMcsDbConfig config = mcsDbConfigService.loadStartupConfig();
|
||||
if (config != null) {
|
||||
mcsDataSourceManager.applyConfig(config);
|
||||
log.info("[MCS中间库] 已加载数据库中的中间库配置(含读写开关)");
|
||||
log.info("[MCS中间库] 已加载数据库中的中间库配置 tenantId={}, status={}, host={}:{}",
|
||||
config.getTenantId(), config.getStatus(), config.getServerHost(), config.getServerPort());
|
||||
} else {
|
||||
log.info("[MCS中间库] 未找到已启用的数据库配置,继续使用 application.yml 中的 sqlserver_mcs");
|
||||
log.info("[MCS中间库] 数据库中无中间库配置,继续使用 application.yml 中的 sqlserver_mcs");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("[MCS中间库] 启动加载配置失败,将使用 yml 默认连接: {}", e.getMessage());
|
||||
log.error("[MCS中间库] 启动加载配置失败,将使用 yml 默认连接", e);
|
||||
}
|
||||
}
|
||||
//update-end---author:GHT ---date:20260616 for:【MES上辅机】启动时加载中间库可视化配置-----------
|
||||
|
||||
@@ -59,7 +59,11 @@ public class McsDataSourceManager {
|
||||
|
||||
public boolean isDbConfigActive() {
|
||||
MesXslMcsDbConfig cfg = cachedConfig.get();
|
||||
return cfg != null && Integer.valueOf(1).equals(cfg.getStatus());
|
||||
if (cfg == null || !Integer.valueOf(1).equals(cfg.getStatus())) {
|
||||
return false;
|
||||
}
|
||||
DynamicRoutingDataSource routing = (DynamicRoutingDataSource) dataSource;
|
||||
return routing.getDataSources().containsKey(DS_KEY);
|
||||
}
|
||||
|
||||
public boolean isReadEnabled() {
|
||||
@@ -83,11 +87,11 @@ public class McsDataSourceManager {
|
||||
* 将配置应用到动态数据源(启用时注册/更新,禁用时移除)
|
||||
*/
|
||||
public void applyConfig(MesXslMcsDbConfig config) {
|
||||
cachedConfig.set(config);
|
||||
DynamicRoutingDataSource routing = (DynamicRoutingDataSource) dataSource;
|
||||
closeAndRemoveDataSource(routing);
|
||||
DataSourceCachePool.removeCache(DS_KEY);
|
||||
if (config == null) {
|
||||
cachedConfig.set(null);
|
||||
restoreYmlDataSource(routing);
|
||||
log.info("[MCS中间库] 已清除页面配置");
|
||||
return;
|
||||
@@ -98,6 +102,7 @@ public class McsDataSourceManager {
|
||||
DataSourceProperty property = buildDataSourceProperty(config, plainPassword);
|
||||
DataSource mcsDs = dataSourceCreator.createDataSource(property);
|
||||
routing.addDataSource(DS_KEY, mcsDs);
|
||||
cachedConfig.set(config);
|
||||
log.info("[MCS中间库] 动态数据源 {} 已热刷新(无需重启): {}:{}/{}", DS_KEY,
|
||||
config.getServerHost(), config.getServerPort(), config.getDbName());
|
||||
} catch (Exception e) {
|
||||
@@ -107,6 +112,7 @@ public class McsDataSourceManager {
|
||||
}
|
||||
return;
|
||||
}
|
||||
cachedConfig.set(config);
|
||||
restoreYmlDataSource(routing);
|
||||
log.info("[MCS中间库] 连接未启用,读写开关仍按页面配置生效");
|
||||
}
|
||||
|
||||
@@ -28,4 +28,9 @@ public interface IMesXslMcsDbConfigService extends IService<MesXslMcsDbConfig> {
|
||||
* 删除配置并移除动态数据源
|
||||
*/
|
||||
Result<String> deleteConfig(String id);
|
||||
|
||||
/**
|
||||
* 启动时加载中间库配置(不限定租户,取最近更新的一条)
|
||||
*/
|
||||
MesXslMcsDbConfig loadStartupConfig();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,16 @@ public class MesXslMcsDbConfigServiceImpl extends ServiceImpl<MesXslMcsDbConfigM
|
||||
return config;
|
||||
}
|
||||
|
||||
//update-begin---author:GHT ---date:20260616 for:【MES上辅机】启动时加载中间库配置(不限定租户)-----------
|
||||
@Override
|
||||
public MesXslMcsDbConfig loadStartupConfig() {
|
||||
LambdaQueryWrapper<MesXslMcsDbConfig> qw = new LambdaQueryWrapper<>();
|
||||
qw.orderByDesc(MesXslMcsDbConfig::getUpdateTime);
|
||||
qw.last("LIMIT 1");
|
||||
return getOne(qw, false);
|
||||
}
|
||||
//update-end---author:GHT ---date:20260616 for:【MES上辅机】启动时加载中间库配置(不限定租户)-----------
|
||||
|
||||
//update-begin---author:GHT ---date:20260616 for:【MES上辅机】SQL Server中间库可视化配置-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordBatchFromMaterialVO;
|
||||
|
||||
public interface IMesXslRubberQuickTestRecordService extends IService<MesXslRubberQuickTestRecord> {
|
||||
@@ -20,6 +21,8 @@ public interface IMesXslRubberQuickTestRecordService extends IService<MesXslRubb
|
||||
|
||||
List<MesXslRubberQuickTestRecordLine> selectLinesByRecordId(String recordId);
|
||||
|
||||
List<MesXslRubberQuickTestRecordRawLine> selectRawLinesByRecordId(String recordId);
|
||||
|
||||
String generateRecordNo(MesXslRubberQuickTestRecord context);
|
||||
|
||||
List<String> batchFromMaterial(MesXslRubberQuickTestRecordBatchFromMaterialVO vo);
|
||||
|
||||
@@ -83,6 +83,22 @@ public class MesXslStompNotifyService {
|
||||
}
|
||||
//update-end---author:cursor ---date:20250602 for:【密炼物料皮重策略】桌面端同步-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检记录同步-----------
|
||||
/** 广播胶料快检记录变更事件到 /topic/sync/mes-rubber-quick-test-records */
|
||||
public void publishRubberQuickTestRecordChanged(String action, String recordId) {
|
||||
publish("/topic/sync/mes-rubber-quick-test-records", "MES_RUBBER_QUICK_TEST_RECORD_CHANGED",
|
||||
"recordId", recordId, action);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】原材料检验标准密炼PS批准时关联实验标准置已批准-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端只读同步 STOMP-----------
|
||||
/** 广播胶料快检实验标准变更事件到 /topic/sync/mes-rubber-quick-test-stds */
|
||||
public void publishRubberQuickTestStdChanged(String action, String stdId) {
|
||||
publish("/topic/sync/mes-rubber-quick-test-stds", "MES_RUBBER_QUICK_TEST_STD_CHANGED",
|
||||
"stdId", stdId, action);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】桌面端只读同步 STOMP-----------
|
||||
|
||||
// ─────────────────────────── 私有辅助 ────────────────────────────
|
||||
|
||||
private void publish(String topic, String cmd, String idKey, String idValue, String action) {
|
||||
|
||||
@@ -20,11 +20,13 @@ import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestRecordLineMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestRecordMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestRecordRawLineMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
@@ -45,6 +47,9 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestRecordLineMapper mesXslRubberQuickTestRecordLineMapper;
|
||||
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestRecordRawLineMapper mesXslRubberQuickTestRecordRawLineMapper;
|
||||
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestStdService mesXslRubberQuickTestStdService;
|
||||
|
||||
@@ -65,6 +70,9 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
}
|
||||
this.save(main);
|
||||
insertLines(main.getId(), lineList);
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】保存试验结果原始数据明细-----------
|
||||
insertRawLines(main.getId(), main.getRawLineList());
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】保存试验结果原始数据明细-----------
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,6 +89,12 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
new LambdaQueryWrapper<MesXslRubberQuickTestRecordLine>()
|
||||
.eq(MesXslRubberQuickTestRecordLine::getRecordId, main.getId()));
|
||||
insertLines(main.getId(), lineList);
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】更新时同步原始数据明细-----------
|
||||
mesXslRubberQuickTestRecordRawLineMapper.delete(
|
||||
new LambdaQueryWrapper<MesXslRubberQuickTestRecordRawLine>()
|
||||
.eq(MesXslRubberQuickTestRecordRawLine::getRecordId, main.getId()));
|
||||
insertRawLines(main.getId(), main.getRawLineList());
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】更新时同步原始数据明细-----------
|
||||
}
|
||||
|
||||
private void insertLines(String recordId, List<MesXslRubberQuickTestRecordLine> lineList) {
|
||||
@@ -96,11 +110,31 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:2026-06-17 for:【快检记录】原始数据明细入库-----------
|
||||
private void insertRawLines(String recordId, List<MesXslRubberQuickTestRecordRawLine> rawLineList) {
|
||||
if (CollectionUtils.isEmpty(rawLineList)) {
|
||||
return;
|
||||
}
|
||||
int sort = 0;
|
||||
for (MesXslRubberQuickTestRecordRawLine line : rawLineList) {
|
||||
if (line == null) {
|
||||
continue;
|
||||
}
|
||||
line.setId(null);
|
||||
line.setRecordId(recordId);
|
||||
line.setSortNo(sort++);
|
||||
mesXslRubberQuickTestRecordRawLineMapper.insert(line);
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】原始数据明细入库-----------
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delMain(String id) {
|
||||
mesXslRubberQuickTestRecordLineMapper.delete(
|
||||
new LambdaQueryWrapper<MesXslRubberQuickTestRecordLine>().eq(MesXslRubberQuickTestRecordLine::getRecordId, id));
|
||||
mesXslRubberQuickTestRecordRawLineMapper.delete(
|
||||
new LambdaQueryWrapper<MesXslRubberQuickTestRecordRawLine>().eq(MesXslRubberQuickTestRecordRawLine::getRecordId, id));
|
||||
this.removeById(id);
|
||||
}
|
||||
|
||||
@@ -120,6 +154,14 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
.orderByAsc(MesXslRubberQuickTestRecordLine::getSortNo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesXslRubberQuickTestRecordRawLine> selectRawLinesByRecordId(String recordId) {
|
||||
return mesXslRubberQuickTestRecordRawLineMapper.selectList(
|
||||
new LambdaQueryWrapper<MesXslRubberQuickTestRecordRawLine>()
|
||||
.eq(MesXslRubberQuickTestRecordRawLine::getRecordId, recordId)
|
||||
.orderByAsc(MesXslRubberQuickTestRecordRawLine::getSortNo));
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260528 for:【MES】胶料快检记录单号JL+日期+4位流水自动生成-----------
|
||||
@Override
|
||||
public String generateRecordNo(MesXslRubberQuickTestRecord context) {
|
||||
|
||||
@@ -87,6 +87,11 @@ public class MesXslRubberQuickTestStdServiceImpl
|
||||
if (oConvertUtils.isEmpty(main.getAuditStatus())) {
|
||||
main.setAuditStatus("0");
|
||||
}
|
||||
//update-begin---author:jiangxh ---date:20260617 for:【快检实验标准】新增时补齐 tenant_id-----------
|
||||
if (main.getTenantId() == null) {
|
||||
main.setTenantId(MesXslTenantUtils.resolveTenantId(null));
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260617 for:【快检实验标准】新增时补齐 tenant_id-----------
|
||||
}
|
||||
|
||||
private void insertLines(String stdId, List<MesXslRubberQuickTestStdLine> lineList) {
|
||||
|
||||
Reference in New Issue
Block a user