桌面端快检记录新增列表及同步mes

This commit is contained in:
2026-06-22 17:38:49 +08:00
parent 3bce685f3a
commit efcd73a565
37 changed files with 2481 additions and 416 deletions

View File

@@ -57,6 +57,7 @@ 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;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
@@ -1021,6 +1022,30 @@ public class MesXslDesktopAnonController {
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】桌面端胶料快检实验标准查询-----------
//update-begin---author:jiangxh ---date:2026-06-17 for【快检记录】桌面端胶料快检记录保存-----------
@Operation(summary = "胶料快检记录-免密分页列表")
@GetMapping("/xslmes/mesXslRubberQuickTestRecord/anon/list")
public Result<IPage<MesXslRubberQuickTestRecord>> rubberQuickTestRecordAnonList(
MesXslRubberQuickTestRecord model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "20") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslRubberQuickTestRecord> qw = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
qw.orderByDesc("create_time");
IPage<MesXslRubberQuickTestRecord> page = rubberQuickTestRecordService.page(new Page<>(pageNo, pageSize), qw);
return Result.OK(page);
}
@Operation(summary = "胶料快检记录-免密通过id查询含明细")
@GetMapping("/xslmes/mesXslRubberQuickTestRecord/anon/queryById")
public Result<MesXslRubberQuickTestRecord> rubberQuickTestRecordAnonQueryById(@RequestParam(name = "id") String id) {
MesXslRubberQuickTestRecord entity = rubberQuickTestRecordService.getById(id);
if (entity == null) {
return Result.error("未找到对应数据");
}
fillRubberQuickTestRecordDetails(entity);
return Result.OK(entity);
}
@Operation(summary = "胶料快检记录-免密添加")
@PostMapping("/xslmes/mesXslRubberQuickTestRecord/anon/add")
public Result<String> rubberQuickTestRecordAnonAdd(@RequestBody MesXslRubberQuickTestRecord record) {
@@ -1030,16 +1055,23 @@ public class MesXslDesktopAnonController {
if (oConvertUtils.isEmpty(record.getRubberMaterialName())) {
return Result.error("胶料名称不能为空");
}
List<MesXslRubberQuickTestRecordLine> lineList = record.getLineList();
if (lineList == null || lineList.isEmpty()) {
return Result.error("请维护检验明细");
if (CollectionUtils.isEmpty(record.getStdLineList())) {
return Result.error("请维护数据标准明细");
}
if (CollectionUtils.isEmpty(record.getRawLineList())) {
return Result.error("请维护试验结果明细");
}
//update-begin---author:jiangxh ---date:20260617 for【快检记录】桌面端同步须含曲线图数据-----------
if (CollectionUtils.isEmpty(record.getChartPointList())) {
return Result.error("请维护曲线图数据");
}
//update-end---author:jiangxh ---date:20260617 for【快检记录】桌面端同步须含曲线图数据-----------
try {
if (oConvertUtils.isEmpty(record.getRecordNo())) {
record.setRecordNo(rubberQuickTestRecordService.generateDesktopRecordNo(record));
}
rubberQuickTestRecordService.fillQuickTestTypeForRecord(record);
rubberQuickTestRecordService.saveMain(record, lineList);
rubberQuickTestRecordService.fillStdAndTypeForRecord(record);
rubberQuickTestRecordService.saveMain(record, record.getLineList());
stompNotify.publishRubberQuickTestRecordChanged("add", record.getId());
return Result.OK(record.getRecordNo());
} catch (Exception e) {
@@ -1047,6 +1079,17 @@ public class MesXslDesktopAnonController {
return Result.error(e.getMessage());
}
}
private void fillRubberQuickTestRecordDetails(MesXslRubberQuickTestRecord entity) {
if (entity == null || oConvertUtils.isEmpty(entity.getId())) {
return;
}
String id = entity.getId();
entity.setStdLineList(rubberQuickTestRecordService.selectStdLinesByRecordId(id));
entity.setRawLineList(rubberQuickTestRecordService.selectRawLinesByRecordId(id));
entity.setChartPointList(rubberQuickTestRecordService.selectChartPointsByRecordId(id));
entity.setLineList(rubberQuickTestRecordService.selectLinesByRecordId(id));
}
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】桌面端胶料快检记录保存-----------
//update-begin---author:jiangxh ---date:20260618 for【快检实验标准】桌面端回填实验方法关联实验类型-----------

View File

@@ -23,8 +23,10 @@ import org.jeecg.modules.mes.material.service.IMesMaterialService;
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.MesXslRubberQuickTestRecordChartPoint;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordStdLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
@@ -32,6 +34,7 @@ import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordBatchFromMaterialV
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordPage;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -117,16 +120,9 @@ public class MesXslRubberQuickTestRecordController
@RequiresPermissions("mes:mes_material:rubberQuickTestInspect")
@PostMapping(value = "/batchFromMaterial")
public Result<List<String>> batchFromMaterial(@RequestBody MesXslRubberQuickTestRecordBatchFromMaterialVO vo) {
try {
//update-begin---author:jiangxh ---date:20260616 for【MES】胶料快检记录批量生成默认带出当前登录检验人-----------
fillInspectorIfEmpty(vo);
//update-end---author:jiangxh ---date:20260616 for【MES】胶料快检记录批量生成默认带出当前登录检验人-----------
List<String> ids = mesXslRubberQuickTestRecordService.batchFromMaterial(vo);
return Result.OK("成功生成 " + ids.size() + " 条快检记录", ids);
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error(e.getMessage());
}
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】取消胶料列表批量生成改由桌面端同步-----------
return Result.error("该功能已停用,请通过桌面端新增并同步胶料快检记录");
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】取消胶料列表批量生成改由桌面端同步-----------
}
@AutoLog(value = "MES胶料快检记录-删除")
@@ -154,6 +150,12 @@ public class MesXslRubberQuickTestRecordController
if (entity == null) {
return Result.error("未找到对应数据");
}
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】查询含数据标准/试验结果/曲线图明细-----------
entity.setStdLineList(mesXslRubberQuickTestRecordService.selectStdLinesByRecordId(id));
entity.setRawLineList(mesXslRubberQuickTestRecordService.selectRawLinesByRecordId(id));
entity.setChartPointList(mesXslRubberQuickTestRecordService.selectChartPointsByRecordId(id));
entity.setLineList(mesXslRubberQuickTestRecordService.selectLinesByRecordId(id));
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】查询含数据标准/试验结果/曲线图明细-----------
return Result.OK(entity);
}
@@ -173,6 +175,22 @@ public class MesXslRubberQuickTestRecordController
}
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】查询原始数据明细-----------
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】查询数据标准明细与曲线图-----------
@Operation(summary = "MES胶料快检记录-查询数据标准明细")
@GetMapping(value = "/queryStdLineListByRecordId")
public Result<List<MesXslRubberQuickTestRecordStdLine>> queryStdLineListByRecordId(
@RequestParam(name = "id", required = true) String id) {
return Result.OK(mesXslRubberQuickTestRecordService.selectStdLinesByRecordId(id));
}
@Operation(summary = "MES胶料快检记录-查询曲线图数据点")
@GetMapping(value = "/queryChartPointListByRecordId")
public Result<List<MesXslRubberQuickTestRecordChartPoint>> queryChartPointListByRecordId(
@RequestParam(name = "id", required = true) String id) {
return Result.OK(mesXslRubberQuickTestRecordService.selectChartPointsByRecordId(id));
}
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】查询数据标准明细与曲线图-----------
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_record:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesXslRubberQuickTestRecord model) {
@@ -189,14 +207,22 @@ public class MesXslRubberQuickTestRecordController
if (main == null) {
return "参数不能为空";
}
if (oConvertUtils.isEmpty(main.getRubberMaterialId())) {
return "请选择胶料";
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】Web保存校验支持桌面端三类明细-----------
if (oConvertUtils.isNotEmpty(main.getRubberMaterialId())) {
MesMaterial material = mesMaterialService.getById(main.getRubberMaterialId());
if (material == null) {
return "所选胶料不存在";
}
main.setRubberMaterialName(material.getMaterialName());
} else if (oConvertUtils.isEmpty(main.getRubberMaterialName())) {
return "胶料名称不能为空";
}
MesMaterial material = mesMaterialService.getById(main.getRubberMaterialId());
if (material == null) {
return "所选胶料不存在";
if (!CollectionUtils.isEmpty(main.getStdLineList()) && !CollectionUtils.isEmpty(main.getRawLineList())) {
resolveInspector(main);
return null;
}
main.setRubberMaterialName(material.getMaterialName());
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】Web保存校验支持桌面端三类明细-----------
if (oConvertUtils.isNotEmpty(main.getQuickTestTypeId())) {
MesXslRubberQuickTestType type = mesXslRubberQuickTestTypeService.getById(main.getQuickTestTypeId());

View File

@@ -32,8 +32,8 @@ public class MesXslRubberQuickTestRecord implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
private String id;
@Excel(name = "", width = 16)
@Schema(description = "单号JL+yyyyMMdd+4位流水")
@Excel(name = "快检记录", width = 16)
@Schema(description = "快检记录号(yyyyMMdd+4位流水+胶料名称")
private String recordNo;
@Schema(description = "胶料ID mes_material.id")
@@ -46,14 +46,25 @@ public class MesXslRubberQuickTestRecord implements Serializable {
@Schema(description = "引用的实验标准ID")
private String stdId;
@Schema(description = "生产机台ID")
@Excel(name = "实验标准", width = 20)
@Schema(description = "实验标准名称冗余")
private String stdName;
@Schema(description = "实验方法ID")
private String testMethodId;
@Excel(name = "实验方法", width = 20)
@Schema(description = "实验方法名称冗余")
private String testMethodName;
@Schema(description = "炼机台ID")
private String prodEquipmentLedgerId;
@Excel(name = "生产机台", width = 16)
@Schema(description = "生产机台名称冗余")
@Excel(name = "机台", width = 16)
@Schema(description = "机台名称冗余")
private String prodEquipmentName;
@Excel(name = "生产日期", width = 12, format = "yyyy-MM-dd")
@Excel(name = "密炼日期", width = 12, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date productionDate;
@@ -69,7 +80,7 @@ public class MesXslRubberQuickTestRecord implements Serializable {
@Dict(dicCode = "xslmes_rubber_quick_test_work_team")
private String workTeam;
@Excel(name = "验次数", width = 10)
@Excel(name = "验次数", width = 10)
private Integer inspectTimes;
@Excel(name = "检验时间", width = 18, format = "yyyy-MM-dd HH:mm:ss")
@@ -86,17 +97,17 @@ public class MesXslRubberQuickTestRecord implements Serializable {
@Excel(name = "检验人", width = 12)
private String inspectorRealname;
@Schema(description = "验类型ID")
@Schema(description = "验类型ID")
private String quickTestTypeId;
@Excel(name = "验类型", width = 16)
@Excel(name = "验类型", width = 16)
private String quickTestTypeName;
@Excel(name = "检验结果", width = 10, dicCode = "xslmes_rubber_quick_test_record_result")
@Dict(dicCode = "xslmes_rubber_quick_test_record_result")
private String inspectResult;
@Excel(name = "生产计划", width = 16)
@Excel(name = "密炼计划", width = 16)
private String productionPlanNo;
@Schema(description = "检验机台ID")
@@ -134,4 +145,14 @@ public class MesXslRubberQuickTestRecord implements Serializable {
@TableField(exist = false)
@Schema(description = "原始数据明细(试验结果全部检测值)")
private List<MesXslRubberQuickTestRecordRawLine> rawLineList;
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图-----------
@TableField(exist = false)
@Schema(description = "数据标准明细(实验标准快照)")
private List<MesXslRubberQuickTestRecordStdLine> stdLineList;
@TableField(exist = false)
@Schema(description = "曲线图数据点")
private List<MesXslRubberQuickTestRecordChartPoint> chartPointList;
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图-----------
}

View File

@@ -0,0 +1,59 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 胶料快检记录曲线图数据点
*/
@Data
@TableName("mes_xsl_rubber_quick_test_record_chart_point")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES胶料快检记录曲线图数据点")
public class MesXslRubberQuickTestRecordChartPoint 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 = "时间(min)", width = 12, type = 10)
private BigDecimal timeMin;
@Excel(name = "上模温度", width = 12, type = 10)
private BigDecimal upperTemp;
@Excel(name = "下模温度", width = 12, type = 10)
private BigDecimal lowerTemp;
@Excel(name = "S'(dNm)", width = 12, type = 10)
private BigDecimal torqueS;
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;
}

View File

@@ -0,0 +1,68 @@
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.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* MES 胶料快检记录数据标准明细(实验标准快照)
*/
@Data
@TableName("mes_xsl_rubber_quick_test_record_std_line")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES胶料快检记录数据标准明细")
public class MesXslRubberQuickTestRecordStdLine 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;
@Schema(description = "数据点ID")
private String dataPointId;
@Excel(name = "数据点", width = 18)
private String pointName;
@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 lowerWarn;
@Excel(name = "上限预警", width = 12, type = 10)
private BigDecimal upperWarn;
@Excel(name = "目标值", width = 12, type = 10)
private BigDecimal targetValue;
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;
}

View File

@@ -0,0 +1,6 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordChartPoint;
public interface MesXslRubberQuickTestRecordChartPointMapper extends BaseMapper<MesXslRubberQuickTestRecordChartPoint> {}

View File

@@ -0,0 +1,7 @@
package org.jeecg.modules.xslmes.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordStdLine;
public interface MesXslRubberQuickTestRecordStdLineMapper extends BaseMapper<MesXslRubberQuickTestRecordStdLine> {
}

View File

@@ -5,8 +5,10 @@ import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordChartPoint;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordStdLine;
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestRecordBatchFromMaterialVO;
public interface IMesXslRubberQuickTestRecordService extends IService<MesXslRubberQuickTestRecord> {
@@ -23,6 +25,15 @@ public interface IMesXslRubberQuickTestRecordService extends IService<MesXslRubb
List<MesXslRubberQuickTestRecordRawLine> selectRawLinesByRecordId(String recordId);
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图查询-----------
List<MesXslRubberQuickTestRecordStdLine> selectStdLinesByRecordId(String recordId);
List<MesXslRubberQuickTestRecordChartPoint> selectChartPointsByRecordId(String recordId);
/** 桌面端保存前:按实验标准回填标准名、方法名、实验类型 */
void fillStdAndTypeForRecord(MesXslRubberQuickTestRecord record);
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图查询-----------
String generateRecordNo(MesXslRubberQuickTestRecord context);
//update-begin---author:jiangxh ---date:20260618 for【快检记录】桌面端快检记录号生成-----------

View File

@@ -19,14 +19,18 @@ import org.jeecg.modules.mes.material.service.IMesMaterialService;
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.MesXslRubberQuickTestRecordChartPoint;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordRawLine;
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordStdLine;
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.MesXslRubberQuickTestRecordChartPointMapper;
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.mapper.MesXslRubberQuickTestRecordStdLineMapper;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
@@ -50,6 +54,12 @@ public class MesXslRubberQuickTestRecordServiceImpl
@Autowired
private MesXslRubberQuickTestRecordRawLineMapper mesXslRubberQuickTestRecordRawLineMapper;
@Autowired
private MesXslRubberQuickTestRecordStdLineMapper mesXslRubberQuickTestRecordStdLineMapper;
@Autowired
private MesXslRubberQuickTestRecordChartPointMapper mesXslRubberQuickTestRecordChartPointMapper;
@Autowired
private IMesXslRubberQuickTestStdService mesXslRubberQuickTestStdService;
@@ -73,6 +83,10 @@ public class MesXslRubberQuickTestRecordServiceImpl
//update-begin---author:jiangxh ---date:2026-06-17 for【快检记录】保存试验结果原始数据明细-----------
insertRawLines(main.getId(), main.getRawLineList());
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】保存试验结果原始数据明细-----------
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】保存数据标准明细与曲线图-----------
insertStdLines(main.getId(), main.getStdLineList());
insertChartPoints(main.getId(), main.getChartPointList());
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】保存数据标准明细与曲线图-----------
}
@Override
@@ -95,6 +109,16 @@ public class MesXslRubberQuickTestRecordServiceImpl
.eq(MesXslRubberQuickTestRecordRawLine::getRecordId, main.getId()));
insertRawLines(main.getId(), main.getRawLineList());
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】更新时同步原始数据明细-----------
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】更新时同步数据标准与曲线图-----------
mesXslRubberQuickTestRecordStdLineMapper.delete(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordStdLine>()
.eq(MesXslRubberQuickTestRecordStdLine::getRecordId, main.getId()));
insertStdLines(main.getId(), main.getStdLineList());
mesXslRubberQuickTestRecordChartPointMapper.delete(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordChartPoint>()
.eq(MesXslRubberQuickTestRecordChartPoint::getRecordId, main.getId()));
insertChartPoints(main.getId(), main.getChartPointList());
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】更新时同步数据标准与曲线图-----------
}
private void insertLines(String recordId, List<MesXslRubberQuickTestRecordLine> lineList) {
@@ -128,6 +152,40 @@ public class MesXslRubberQuickTestRecordServiceImpl
}
//update-end---author:jiangxh ---date:2026-06-17 for【快检记录】原始数据明细入库-----------
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图入库-----------
private void insertStdLines(String recordId, List<MesXslRubberQuickTestRecordStdLine> stdLineList) {
if (CollectionUtils.isEmpty(stdLineList)) {
return;
}
int sort = 0;
for (MesXslRubberQuickTestRecordStdLine line : stdLineList) {
if (line == null) {
continue;
}
line.setId(null);
line.setRecordId(recordId);
line.setSortNo(sort++);
mesXslRubberQuickTestRecordStdLineMapper.insert(line);
}
}
private void insertChartPoints(String recordId, List<MesXslRubberQuickTestRecordChartPoint> chartPointList) {
if (CollectionUtils.isEmpty(chartPointList)) {
return;
}
int sort = 0;
for (MesXslRubberQuickTestRecordChartPoint point : chartPointList) {
if (point == null) {
continue;
}
point.setId(null);
point.setRecordId(recordId);
point.setSortNo(sort++);
mesXslRubberQuickTestRecordChartPointMapper.insert(point);
}
}
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】数据标准明细与曲线图入库-----------
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
@@ -135,6 +193,10 @@ public class MesXslRubberQuickTestRecordServiceImpl
new LambdaQueryWrapper<MesXslRubberQuickTestRecordLine>().eq(MesXslRubberQuickTestRecordLine::getRecordId, id));
mesXslRubberQuickTestRecordRawLineMapper.delete(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordRawLine>().eq(MesXslRubberQuickTestRecordRawLine::getRecordId, id));
mesXslRubberQuickTestRecordStdLineMapper.delete(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordStdLine>().eq(MesXslRubberQuickTestRecordStdLine::getRecordId, id));
mesXslRubberQuickTestRecordChartPointMapper.delete(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordChartPoint>().eq(MesXslRubberQuickTestRecordChartPoint::getRecordId, id));
this.removeById(id);
}
@@ -162,6 +224,22 @@ public class MesXslRubberQuickTestRecordServiceImpl
.orderByAsc(MesXslRubberQuickTestRecordRawLine::getSortNo));
}
@Override
public List<MesXslRubberQuickTestRecordStdLine> selectStdLinesByRecordId(String recordId) {
return mesXslRubberQuickTestRecordStdLineMapper.selectList(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordStdLine>()
.eq(MesXslRubberQuickTestRecordStdLine::getRecordId, recordId)
.orderByAsc(MesXslRubberQuickTestRecordStdLine::getSortNo));
}
@Override
public List<MesXslRubberQuickTestRecordChartPoint> selectChartPointsByRecordId(String recordId) {
return mesXslRubberQuickTestRecordChartPointMapper.selectList(
new LambdaQueryWrapper<MesXslRubberQuickTestRecordChartPoint>()
.eq(MesXslRubberQuickTestRecordChartPoint::getRecordId, recordId)
.orderByAsc(MesXslRubberQuickTestRecordChartPoint::getSortNo));
}
//update-begin---author:jiangxh ---date:20260528 for【MES】胶料快检记录单号JL+日期+4位流水自动生成-----------
@Override
public String generateRecordNo(MesXslRubberQuickTestRecord context) {
@@ -256,69 +334,52 @@ public class MesXslRubberQuickTestRecordServiceImpl
@Override
public void fillQuickTestTypeForRecord(MesXslRubberQuickTestRecord record) {
if (record == null || oConvertUtils.isNotEmpty(record.getQuickTestTypeId())) {
fillStdAndTypeForRecord(record);
}
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】回填实验标准/方法/类型-----------
@Override
public void fillStdAndTypeForRecord(MesXslRubberQuickTestRecord record) {
if (record == null) {
return;
}
String testMethodId = null;
String testMethodId = record.getTestMethodId();
if (oConvertUtils.isNotEmpty(record.getStdId())) {
MesXslRubberQuickTestStd std = mesXslRubberQuickTestStdService.getById(record.getStdId());
if (std != null) {
testMethodId = std.getTestMethodId();
if (oConvertUtils.isEmpty(record.getStdName())) {
record.setStdName(std.getStdName());
}
if (oConvertUtils.isEmpty(testMethodId)) {
testMethodId = std.getTestMethodId();
record.setTestMethodId(testMethodId);
}
}
}
if (oConvertUtils.isEmpty(testMethodId)) {
return;
if (oConvertUtils.isNotEmpty(testMethodId) && oConvertUtils.isEmpty(record.getTestMethodName())) {
MesXslRubberQuickTestMethod method = mesXslRubberQuickTestMethodService.getById(testMethodId);
if (method != null) {
record.setTestMethodName(method.getMethodName());
if (oConvertUtils.isEmpty(record.getQuickTestTypeId())
&& oConvertUtils.isNotEmpty(method.getQuickTestTypeId())) {
fillQuickTestType(record, method.getQuickTestTypeId());
}
}
}
MesXslRubberQuickTestMethod method = mesXslRubberQuickTestMethodService.getById(testMethodId);
if (method != null && oConvertUtils.isNotEmpty(method.getQuickTestTypeId())) {
fillQuickTestType(record, method.getQuickTestTypeId());
if (oConvertUtils.isNotEmpty(record.getQuickTestTypeId()) && oConvertUtils.isEmpty(record.getQuickTestTypeName())) {
fillQuickTestType(record, record.getQuickTestTypeId());
}
}
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】回填实验标准/方法/类型-----------
//update-end---author:jiangxh ---date:20260618 for【快检记录】桌面端快检记录号 yyyyMMdd+流水+胶料号-----------
//update-begin---author:jiangxh ---date:20260525 for【MES】胶料信息多选按实验标准批量生成快检记录-----------
@Override
@Transactional(rollbackFor = Exception.class)
public List<String> batchFromMaterial(MesXslRubberQuickTestRecordBatchFromMaterialVO vo) {
if (vo == null || CollectionUtils.isEmpty(vo.getMaterialIds())) {
throw new JeecgBootException("请至少选择一条胶料信息");
}
List<String> createdIds = new ArrayList<>();
for (String materialId : vo.getMaterialIds()) {
if (oConvertUtils.isEmpty(materialId)) {
continue;
}
String mid = materialId.trim();
MesMaterial material = mesMaterialService.getById(mid);
if (material == null) {
throw new JeecgBootException("胶料不存在:" + mid);
}
MesXslRubberQuickTestStd std = findApprovedStdForMaterial(mid);
if (std == null) {
throw new JeecgBootException(
"胶料【" + material.getMaterialName() + "】未找到已启用且已批准的实验标准,请先在胶料快检实验标准中维护");
}
List<MesXslRubberQuickTestStdLine> stdLines = mesXslRubberQuickTestStdService.selectLinesByStdId(std.getId());
if (CollectionUtils.isEmpty(stdLines)) {
throw new JeecgBootException("胶料【" + material.getMaterialName() + "】关联的实验标准无明细数据");
}
MesXslRubberQuickTestRecord main = buildMainFromMaterial(material, std, vo);
List<MesXslRubberQuickTestRecordLine> recordLines = new ArrayList<>();
for (MesXslRubberQuickTestStdLine stdLine : stdLines) {
MesXslRubberQuickTestRecordLine rl = new MesXslRubberQuickTestRecordLine();
rl.setDataPointId(stdLine.getDataPointId());
rl.setInspectItem(stdLine.getPointName());
rl.setLowerLimit(stdLine.getLowerLimit());
rl.setUpperLimit(stdLine.getUpperLimit());
recordLines.add(rl);
}
saveMain(main, recordLines);
createdIds.add(main.getId());
}
if (createdIds.isEmpty()) {
throw new JeecgBootException("未生成任何快检记录");
}
return createdIds;
//update-begin---author:jiangxh ---date:2026-06-22 for【快检记录】取消胶料列表批量生成改由桌面端同步-----------
throw new JeecgBootException("胶料快检记录已改为由桌面端同步创建,请使用桌面端「胶料快检记录」功能");
//update-end---author:jiangxh ---date:2026-06-22 for【快检记录】取消胶料列表批量生成改由桌面端同步-----------
}
private MesXslRubberQuickTestStd findApprovedStdForMaterial(String materialId) {