桌面端密炼计划、胶料快检调整
This commit is contained in:
@@ -35,6 +35,7 @@ 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.MesXslRubberQuickTestMethod;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
@@ -50,6 +51,7 @@ 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.IMesXslRubberQuickTestMethodService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestRecordService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWeightRecordService;
|
||||
@@ -100,6 +102,7 @@ public class MesXslDesktopAnonController {
|
||||
private final IMesXslMixingProductionPlanService mixingProductionPlanService;
|
||||
private final IMesXslRubberQuickTestStdService rubberQuickTestStdService;
|
||||
private final IMesXslRubberQuickTestRecordService rubberQuickTestRecordService;
|
||||
private final IMesXslRubberQuickTestMethodService rubberQuickTestMethodService;
|
||||
|
||||
// ═══════════════════════════ 车辆管理 ═══════════════════════════
|
||||
|
||||
@@ -965,6 +968,9 @@ public class MesXslDesktopAnonController {
|
||||
QueryWrapper<MesXslRubberQuickTestStd> qw = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
qw.orderByDesc("create_time");
|
||||
IPage<MesXslRubberQuickTestStd> page = rubberQuickTestStdService.page(new Page<>(pageNo, pageSize), qw);
|
||||
if (page.getRecords() != null) {
|
||||
page.getRecords().forEach(this::fillStdQuickTestTypeFromMethod);
|
||||
}
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@@ -976,6 +982,7 @@ public class MesXslDesktopAnonController {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
entity.setLineList(rubberQuickTestStdService.selectLinesByStdId(id));
|
||||
fillStdQuickTestTypeFromMethod(entity);
|
||||
return Result.OK(entity);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检实验标准】桌面端只读列表与详情-----------
|
||||
@@ -1001,6 +1008,7 @@ public class MesXslDesktopAnonController {
|
||||
return Result.error("未找到胶料「" + name + "」对应的使用中且已批准的快检实验标准");
|
||||
}
|
||||
std.setLineList(rubberQuickTestStdService.selectLinesByStdId(std.getId()));
|
||||
fillStdQuickTestTypeFromMethod(std);
|
||||
return Result.OK(std);
|
||||
}
|
||||
|
||||
@@ -1027,9 +1035,13 @@ public class MesXslDesktopAnonController {
|
||||
return Result.error("请维护检验明细");
|
||||
}
|
||||
try {
|
||||
if (oConvertUtils.isEmpty(record.getRecordNo())) {
|
||||
record.setRecordNo(rubberQuickTestRecordService.generateDesktopRecordNo(record));
|
||||
}
|
||||
rubberQuickTestRecordService.fillQuickTestTypeForRecord(record);
|
||||
rubberQuickTestRecordService.saveMain(record, lineList);
|
||||
stompNotify.publishRubberQuickTestRecordChanged("add", record.getId());
|
||||
return Result.OK("添加成功!");
|
||||
return Result.OK(record.getRecordNo());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error(e.getMessage());
|
||||
@@ -1037,6 +1049,20 @@ public class MesXslDesktopAnonController {
|
||||
}
|
||||
//update-end---author:jiangxh ---date:2026-06-17 for:【快检记录】桌面端胶料快检记录保存-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260618 for:【快检实验标准】桌面端回填实验方法关联实验类型-----------
|
||||
private void fillStdQuickTestTypeFromMethod(MesXslRubberQuickTestStd std) {
|
||||
if (std == null || oConvertUtils.isEmpty(std.getTestMethodId())) {
|
||||
return;
|
||||
}
|
||||
MesXslRubberQuickTestMethod method = rubberQuickTestMethodService.getById(std.getTestMethodId());
|
||||
if (method == null) {
|
||||
return;
|
||||
}
|
||||
std.setQuickTestTypeId(method.getQuickTestTypeId());
|
||||
std.setQuickTestTypeName(method.getQuickTestTypeName());
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260618 for:【快检实验标准】桌面端回填实验方法关联实验类型-----------
|
||||
|
||||
// ─────────────────────────── 车辆私有辅助 ────────────────────────────
|
||||
|
||||
private void applyWeightNetAndBillType(MesXslWeightRecord record) {
|
||||
|
||||
@@ -106,4 +106,12 @@ public class MesXslRubberQuickTestStd implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "标准明细")
|
||||
private List<MesXslRubberQuickTestStdLine> lineList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "实验类型ID(来自实验方法,桌面端展示)")
|
||||
private String quickTestTypeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "实验类型名称(来自实验方法,桌面端展示)")
|
||||
private String quickTestTypeName;
|
||||
}
|
||||
|
||||
@@ -25,5 +25,13 @@ public interface IMesXslRubberQuickTestRecordService extends IService<MesXslRubb
|
||||
|
||||
String generateRecordNo(MesXslRubberQuickTestRecord context);
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260618 for:【快检记录】桌面端快检记录号生成-----------
|
||||
/** 桌面端快检记录号:yyyyMMdd + 4位流水 + 胶料名称,如 202606180001SA889 */
|
||||
String generateDesktopRecordNo(MesXslRubberQuickTestRecord context);
|
||||
|
||||
/** 桌面端保存前:按实验标准关联实验方法回填检验类型 */
|
||||
void fillQuickTestTypeForRecord(MesXslRubberQuickTestRecord record);
|
||||
//update-end---author:jiangxh ---date:20260618 for:【快检记录】桌面端快检记录号生成-----------
|
||||
|
||||
List<String> batchFromMaterial(MesXslRubberQuickTestRecordBatchFromMaterialVO vo);
|
||||
}
|
||||
|
||||
@@ -216,6 +216,66 @@ public class MesXslRubberQuickTestRecordServiceImpl
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260528 for:【MES】胶料快检记录单号JL+日期+4位流水自动生成-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260618 for:【快检记录】桌面端快检记录号 yyyyMMdd+流水+胶料号-----------
|
||||
@Override
|
||||
public String generateDesktopRecordNo(MesXslRubberQuickTestRecord context) {
|
||||
String dateStr = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
if (context == null || oConvertUtils.isEmpty(context.getRubberMaterialName())) {
|
||||
throw new JeecgBootException("胶料名称不能为空,无法生成快检记录号");
|
||||
}
|
||||
String material = context.getRubberMaterialName().trim();
|
||||
int expectedLen = dateStr.length() + 4 + material.length();
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestRecord> qw = new LambdaQueryWrapper<>();
|
||||
qw.likeRight(MesXslRubberQuickTestRecord::getRecordNo, dateStr);
|
||||
qw.and(q -> q.eq(MesXslRubberQuickTestRecord::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslRubberQuickTestRecord::getDelFlag));
|
||||
if (tenantId != null) {
|
||||
qw.eq(MesXslRubberQuickTestRecord::getTenantId, tenantId);
|
||||
}
|
||||
qw.select(MesXslRubberQuickTestRecord::getRecordNo);
|
||||
|
||||
int maxSeq = 0;
|
||||
for (MesXslRubberQuickTestRecord row : this.list(qw)) {
|
||||
String no = row.getRecordNo();
|
||||
if (oConvertUtils.isEmpty(no) || no.length() != expectedLen) {
|
||||
continue;
|
||||
}
|
||||
if (!no.startsWith(dateStr) || !no.endsWith(material)) {
|
||||
continue;
|
||||
}
|
||||
String seqPart = no.substring(dateStr.length(), dateStr.length() + 4);
|
||||
try {
|
||||
maxSeq = Math.max(maxSeq, Integer.parseInt(seqPart));
|
||||
} catch (NumberFormatException ignored) {
|
||||
// ignore malformed historical numbers
|
||||
}
|
||||
}
|
||||
return dateStr + String.format("%04d", maxSeq + 1) + material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillQuickTestTypeForRecord(MesXslRubberQuickTestRecord record) {
|
||||
if (record == null || oConvertUtils.isNotEmpty(record.getQuickTestTypeId())) {
|
||||
return;
|
||||
}
|
||||
String testMethodId = null;
|
||||
if (oConvertUtils.isNotEmpty(record.getStdId())) {
|
||||
MesXslRubberQuickTestStd std = mesXslRubberQuickTestStdService.getById(record.getStdId());
|
||||
if (std != null) {
|
||||
testMethodId = std.getTestMethodId();
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(testMethodId)) {
|
||||
return;
|
||||
}
|
||||
MesXslRubberQuickTestMethod method = mesXslRubberQuickTestMethodService.getById(testMethodId);
|
||||
if (method != null && oConvertUtils.isNotEmpty(method.getQuickTestTypeId())) {
|
||||
fillQuickTestType(record, method.getQuickTestTypeId());
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260618 for:【快检记录】桌面端快检记录号 yyyyMMdd+流水+胶料号-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260525 for:【MES】胶料信息多选按实验标准批量生成快检记录-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
Reference in New Issue
Block a user