新增架子车数设定
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -14,6 +14,10 @@
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"java.maven.downloadSources": true,
|
||||
"java.eclipse.downloadSources": true,
|
||||
"java.project.importOnFirstTimeStartup": "automatic",
|
||||
"java.configuration.checkProjectSettingsExclusions": false,
|
||||
"java.import.exclusions": [
|
||||
"**/jeecg-server-cloud/**",
|
||||
"**/jeecg-boot-platform/**",
|
||||
|
||||
4
jeecg-boot/.vscode/settings.json
vendored
4
jeecg-boot/.vscode/settings.json
vendored
@@ -14,6 +14,10 @@
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"java.maven.downloadSources": true,
|
||||
"java.eclipse.downloadSources": true,
|
||||
"java.project.importOnFirstTimeStartup": "automatic",
|
||||
"java.configuration.checkProjectSettingsExclusions": false,
|
||||
"java.import.exclusions": [
|
||||
"**/jeecg-server-cloud/**",
|
||||
"**/jeecg-boot-platform/**",
|
||||
|
||||
@@ -437,3 +437,40 @@ jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/components/MesXslFormul
|
||||
-- author:cursor---date:20260526--for: 【配方日志查询】明细对比展示逐行逐字段变更内容 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/common/MesXslFormulaSpecEditLogDiffUtil.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslFormulaSpecEditLog/MesXslFormulaSpecEditLog.data.ts
|
||||
|
||||
-- author:cursor---date:20260528--for: 【XSLMES-20260528-A01】架子车数设定(基于混炼示方查询,不建业务表) -----------
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_108__mes_xsl_rack_train_count_setting_menu.sql
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/vo/MesXslRackTrainCountSettingVO.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslRackTrainCountSettingService.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRackTrainCountSettingServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRackTrainCountSettingController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRackTrainCountSetting/MesXslRackTrainCountSetting.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRackTrainCountSetting/MesXslRackTrainCountSetting.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRackTrainCountSetting/MesXslRackTrainCountSettingList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslRackTrainCountSetting/components/MesXslRackTrainCountSettingModal.vue
|
||||
|
||||
-- author:cursor---date:20260528--for: 【XSLMES-20260528-A03】架子车数设定保存写入配方日志 -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRackTrainCountSettingServiceImpl.java
|
||||
|
||||
-- author:cursor---date:20260528--for: 【XSLMES-20260528-A02】xslmes模块TokenUtils解析报错统一抽取MesXslTenantUtils -----------
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/common/MesXslTenantUtils.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDowntimeMainTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDowntimeTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipInspectConfigServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipInspectRecordServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentCategoryServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentLedgerServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentPartServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentSubPartServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslEquipmentTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslInspectMaintainItemServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslManufacturerServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialKindCfgServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslProcessOperationServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestDataPointServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestMethodServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestStdServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslRubberQuickTestTypeServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslSparePartsCategoryServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslSparePartServiceImpl.java
|
||||
jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslWarehouseAreaCapacityCfgServiceImpl.java
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.jeecg.modules.xslmes.common;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.TenantConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
|
||||
/**
|
||||
* MES 租户解析工具(xslmes 模块内统一入口,避免各 Service 重复依赖 TokenUtils)
|
||||
*/
|
||||
public final class MesXslTenantUtils {
|
||||
|
||||
private MesXslTenantUtils() {}
|
||||
|
||||
/**
|
||||
* 解析租户 ID:优先实体上下文,其次 TenantContext,最后从当前请求头/参数读取
|
||||
*/
|
||||
public static Integer resolveTenantId(Integer contextTenantId) {
|
||||
if (contextTenantId != null) {
|
||||
return contextTenantId;
|
||||
}
|
||||
String tenantId = getTenantIdString();
|
||||
if (oConvertUtils.isEmpty(tenantId)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(tenantId.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 尽力解析租户 ID,无法解析时返回 0 */
|
||||
public static int resolveTenantIdBestEffort() {
|
||||
return oConvertUtils.getInt(getTenantIdString(), 0);
|
||||
}
|
||||
|
||||
private static String getTenantIdString() {
|
||||
String tenantId = TenantContext.getTenant();
|
||||
if (oConvertUtils.isNotEmpty(tenantId)) {
|
||||
return tenantId;
|
||||
}
|
||||
try {
|
||||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
if (request != null) {
|
||||
tenantId = getTenantIdByRequest(request);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
// 非 Web 请求上下文时忽略
|
||||
}
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
/** 与 TokenUtils.getTenantIdByRequest 行为一致 */
|
||||
private static String getTenantIdByRequest(HttpServletRequest request) {
|
||||
String tenantId = request.getParameter(TenantConstant.TENANT_ID);
|
||||
if (tenantId == null) {
|
||||
tenantId = oConvertUtils.getString(request.getHeader(CommonConstant.TENANT_ID));
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(tenantId) && "undefined".equals(tenantId)) {
|
||||
return null;
|
||||
}
|
||||
return tenantId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.jeecg.modules.xslmes.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRackTrainCountSettingService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRackTrainCountSettingVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 架子车数设定(数据来源于混炼示方,不建独立业务表)
|
||||
*/
|
||||
@Tag(name = "架子车数设定")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslRackTrainCountSetting")
|
||||
@Slf4j
|
||||
public class MesXslRackTrainCountSettingController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslRackTrainCountSettingService rackTrainCountSettingService;
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页列表-----------
|
||||
@Operation(summary = "架子车数设定-分页列表查询")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:list")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRackTrainCountSettingVO>> queryPageList(
|
||||
MesXslRackTrainCountSettingVO query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "keyword", required = false) String keyword) {
|
||||
return Result.OK(rackTrainCountSettingService.queryPage(pageNo, pageSize, query, keyword));
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页列表-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定详情查询-----------
|
||||
@Operation(summary = "架子车数设定-通过id查询")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:list")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslRackTrainCountSettingVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslRackTrainCountSettingVO detail = rackTrainCountSettingService.queryById(id);
|
||||
if (detail == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(detail);
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定详情查询-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存-----------
|
||||
@AutoLog(value = "架子车数设定-保存")
|
||||
@Operation(summary = "架子车数设定-保存设定车数")
|
||||
@RequiresPermissions("xslmes:mes_xsl_rack_train_count_setting:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesXslRackTrainCountSettingVO setting) {
|
||||
try {
|
||||
rackTrainCountSettingService.saveSetting(setting);
|
||||
return Result.OK("保存成功!");
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return Result.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存-----------
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRackTrainCountSettingVO;
|
||||
|
||||
/**
|
||||
* 架子车数设定(基于混炼示方查询,不建独立业务表)
|
||||
*/
|
||||
public interface IMesXslRackTrainCountSettingService {
|
||||
|
||||
/**
|
||||
* 分页查询架子车数设定列表
|
||||
*/
|
||||
IPage<MesXslRackTrainCountSettingVO> queryPage(
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
MesXslRackTrainCountSettingVO query,
|
||||
String keyword);
|
||||
|
||||
/**
|
||||
* 按混炼示方ID查询详情
|
||||
*/
|
||||
MesXslRackTrainCountSettingVO queryById(String id);
|
||||
|
||||
/**
|
||||
* 保存设定车数(回写混炼示方 set_train_count 字段)
|
||||
*/
|
||||
void saveSetting(MesXslRackTrainCountSettingVO setting);
|
||||
}
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslDowntimeMainTypeMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeMainTypeService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslDowntimeMainTypeServiceImpl extends ServiceImpl<MesXslDowntim
|
||||
if (oConvertUtils.isEmpty(downtimeType)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslDowntimeMainType> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslDowntimeMainType::getDowntimeType, downtimeType.trim());
|
||||
w.and(
|
||||
@@ -39,25 +37,5 @@ public class MesXslDowntimeMainTypeServiceImpl extends ServiceImpl<MesXslDowntim
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslDowntimeMainType context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260518 for:【MES】停机类型同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeType;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslDowntimeTypeMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeTypeService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslDowntimeTypeServiceImpl extends ServiceImpl<MesXslDowntimeTyp
|
||||
if (oConvertUtils.isEmpty(downtimeType)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslDowntimeType> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslDowntimeType::getDowntimeType, downtimeType.trim());
|
||||
w.and(
|
||||
@@ -39,25 +37,5 @@ public class MesXslDowntimeTypeServiceImpl extends ServiceImpl<MesXslDowntimeTyp
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslDowntimeType context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260518 for:【MES】停机类型名称同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfigLine;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipInspectConfigLineMapper;
|
||||
@@ -89,7 +87,7 @@ public class MesXslEquipInspectConfigServiceImpl
|
||||
if (oConvertUtils.isEmpty(equipmentLedgerId) || oConvertUtils.isEmpty(configType)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipInspectConfig> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslEquipInspectConfig::getEquipmentLedgerId, equipmentLedgerId.trim());
|
||||
w.eq(MesXslEquipInspectConfig::getConfigType, configType.trim());
|
||||
@@ -107,26 +105,5 @@ public class MesXslEquipInspectConfigServiceImpl
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipInspectConfig context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】设备点检配置:同设备同类型(点检/保养)仅允许一条主数据-----------
|
||||
}
|
||||
|
||||
@@ -8,11 +8,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfigLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectRecord;
|
||||
@@ -104,7 +102,7 @@ public class MesXslEquipInspectRecordServiceImpl
|
||||
public String generateRecordNo(MesXslEquipInspectRecord context) {
|
||||
String dateStr = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
String prefix = "EC" + dateStr;
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
|
||||
LambdaQueryWrapper<MesXslEquipInspectRecord> qw = new LambdaQueryWrapper<>();
|
||||
qw.likeRight(MesXslEquipInspectRecord::getRecordNo, prefix);
|
||||
@@ -288,25 +286,4 @@ public class MesXslEquipInspectRecordServiceImpl
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260521 for:【MES】不合格点检记录登记处理人及处理时间-----------
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipInspectRecord context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentCategoryMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslEquipmentCategoryServiceImpl extends ServiceImpl<MesXslEquipm
|
||||
if (oConvertUtils.isEmpty(categoryName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipmentCategory> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslEquipmentCategory::getCategoryName, categoryName.trim());
|
||||
w.and(
|
||||
@@ -60,25 +58,5 @@ public class MesXslEquipmentCategoryServiceImpl extends ServiceImpl<MesXslEquipm
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260514 for:【MES】设备类型按类别名称解析关联,提供未删除单条查询-----------
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipmentCategory context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260514 for:【MES】设备类别名称同租户唯一;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
@@ -35,7 +33,7 @@ public class MesXslEquipmentLedgerServiceImpl extends ServiceImpl<MesXslEquipmen
|
||||
if (oConvertUtils.isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipmentLedger> w = new LambdaQueryWrapper<>();
|
||||
w.eq(column, value.trim());
|
||||
w.and(q -> q.eq(MesXslEquipmentLedger::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslEquipmentLedger::getDelFlag));
|
||||
@@ -48,25 +46,5 @@ public class MesXslEquipmentLedgerServiceImpl extends ServiceImpl<MesXslEquipmen
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipmentLedger context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260518 for:【MES】设备台账编号、名称同租户不可重复-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentPartMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslEquipmentPartServiceImpl extends ServiceImpl<MesXslEquipmentP
|
||||
if (oConvertUtils.isEmpty(partCode)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipmentPart> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslEquipmentPart::getPartCode, partCode.trim());
|
||||
w.and(
|
||||
@@ -39,26 +37,6 @@ public class MesXslEquipmentPartServiceImpl extends ServiceImpl<MesXslEquipmentP
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipmentPart context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】设备部位代码同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260515 for:【MES】设备部位按代码+租户查询单条,供设备小部位导入解析大部位-----------
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentSubPartMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslEquipmentSubPartServiceImpl extends ServiceImpl<MesXslEquipme
|
||||
if (oConvertUtils.isEmpty(subPartCode)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipmentSubPart> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslEquipmentSubPart::getSubPartCode, subPartCode.trim());
|
||||
w.and(
|
||||
@@ -39,25 +37,5 @@ public class MesXslEquipmentSubPartServiceImpl extends ServiceImpl<MesXslEquipme
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipmentSubPart context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】设备小部位代码同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentTypeMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslEquipmentTypeServiceImpl extends ServiceImpl<MesXslEquipmentT
|
||||
if (oConvertUtils.isEmpty(typeName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslEquipmentType> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslEquipmentType::getTypeName, typeName.trim());
|
||||
w.and(
|
||||
@@ -39,25 +37,5 @@ public class MesXslEquipmentTypeServiceImpl extends ServiceImpl<MesXslEquipmentT
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslEquipmentType context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260514 for:【MES】设备类型名称同租户唯一;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslInspectMaintainItemMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
@@ -36,7 +34,7 @@ public class MesXslInspectMaintainItemServiceImpl
|
||||
if (oConvertUtils.isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslInspectMaintainItem> w = new LambdaQueryWrapper<>();
|
||||
w.eq(column, value.trim());
|
||||
w.and(
|
||||
@@ -53,26 +51,5 @@ public class MesXslInspectMaintainItemServiceImpl
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslInspectMaintainItem context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260519 for:【MES】点检及保养项目:项目名称/编号同租户不可重复-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslManufacturer;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslManufacturerMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslManufacturerService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslManufacturerServiceImpl extends ServiceImpl<MesXslManufacture
|
||||
if (oConvertUtils.isEmpty(manufacturerName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslManufacturer> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslManufacturer::getManufacturerName, manufacturerName.trim());
|
||||
w.and(
|
||||
@@ -39,25 +37,5 @@ public class MesXslManufacturerServiceImpl extends ServiceImpl<MesXslManufacture
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslManufacturer context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】厂家名称同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
@@ -13,10 +12,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||
import org.jeecg.modules.system.entity.SysCategory;
|
||||
import org.jeecg.modules.system.entity.SysDict;
|
||||
@@ -24,6 +20,7 @@ import org.jeecg.modules.system.entity.SysDictItem;
|
||||
import org.jeecg.modules.system.service.ISysCategoryService;
|
||||
import org.jeecg.modules.system.service.ISysDictItemService;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixerMaterialKindCfg;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslMixerMaterialKindCfgMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerMaterialKindCfgService;
|
||||
@@ -73,7 +70,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
if (lines == null || lines.isEmpty()) {
|
||||
throw new JeecgBootException("请至少维护一条种类配置明细");
|
||||
}
|
||||
Integer resolvedTenantId = resolveTenantId(tenantId);
|
||||
Integer resolvedTenantId = MesXslTenantUtils.resolveTenantId(tenantId);
|
||||
Set<String> kindKeys = new HashSet<>();
|
||||
Set<String> categoryRefIds = new HashSet<>();
|
||||
for (MesXslMixerMaterialKindCfg line : lines) {
|
||||
@@ -124,7 +121,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
cfg.setKindKey(item.getItemValue());
|
||||
cfg.setKindName(item.getItemText());
|
||||
cfg.setPriority(item.getSortOrder() != null ? item.getSortOrder() : priorityBase + index * 10);
|
||||
cfg.setTenantId(resolveTenantId(tenantId));
|
||||
cfg.setTenantId(MesXslTenantUtils.resolveTenantId(tenantId));
|
||||
result.add(cfg);
|
||||
index++;
|
||||
}
|
||||
@@ -183,7 +180,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
cfg.setKindKey(refCode);
|
||||
cfg.setKindName(category.getName());
|
||||
cfg.setPriority(priorityBase + i * 10);
|
||||
cfg.setTenantId(resolveTenantId(tenantId));
|
||||
cfg.setTenantId(MesXslTenantUtils.resolveTenantId(tenantId));
|
||||
result.add(cfg);
|
||||
}
|
||||
if (result.isEmpty()) {
|
||||
@@ -197,7 +194,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
qw.eq(MesXslMixerMaterialKindCfg::getSourceType, sourceType);
|
||||
qw.eq(MesXslMixerMaterialKindCfg::getSourceRootCode, sourceRootCode);
|
||||
qw.and(q -> q.eq(MesXslMixerMaterialKindCfg::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslMixerMaterialKindCfg::getDelFlag));
|
||||
Integer resolvedTenantId = resolveTenantId(tenantId);
|
||||
Integer resolvedTenantId = MesXslTenantUtils.resolveTenantId(tenantId);
|
||||
if (resolvedTenantId != null && MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
qw.eq(MesXslMixerMaterialKindCfg::getTenantId, resolvedTenantId);
|
||||
}
|
||||
@@ -246,7 +243,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
|
||||
@Override
|
||||
public void checkDuplicate(MesXslMixerMaterialKindCfg line, String excludeId) {
|
||||
Integer tenantId = resolveTenantId(line.getTenantId());
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(line.getTenantId());
|
||||
LambdaQueryWrapper<MesXslMixerMaterialKindCfg> kindQw = new LambdaQueryWrapper<>();
|
||||
kindQw.eq(MesXslMixerMaterialKindCfg::getKindKey, line.getKindKey().trim());
|
||||
kindQw.and(q -> q.eq(MesXslMixerMaterialKindCfg::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslMixerMaterialKindCfg::getDelFlag));
|
||||
@@ -274,30 +271,6 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(Integer tenantId) {
|
||||
if (tenantId != null) {
|
||||
return tenantId;
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
if (request != null) {
|
||||
ts = TokenUtils.getTenantIdByRequest(request);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A51】密炼物料种类配置展开与批量保存-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A52】密炼物料种类配置关联解析-----------
|
||||
@@ -307,7 +280,7 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
||||
public MesXslMixerMaterialKindLookupVO loadKindLookup(Integer tenantId) {
|
||||
LambdaQueryWrapper<MesXslMixerMaterialKindCfg> qw = new LambdaQueryWrapper<>();
|
||||
qw.and(q -> q.eq(MesXslMixerMaterialKindCfg::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslMixerMaterialKindCfg::getDelFlag));
|
||||
Integer resolvedTenantId = resolveTenantId(tenantId);
|
||||
Integer resolvedTenantId = MesXslTenantUtils.resolveTenantId(tenantId);
|
||||
if (resolvedTenantId != null && MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
qw.eq(MesXslMixerMaterialKindCfg::getTenantId, resolvedTenantId);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslProcessOperationMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslProcessOperationServiceImpl extends ServiceImpl<MesXslProcess
|
||||
if (oConvertUtils.isEmpty(operationCode)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslProcessOperation> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslProcessOperation::getOperationCode, operationCode.trim());
|
||||
// 仅与「未删除」数据判重:del_flag=0 或历史空值视为正常行,排除已删除(del_flag=1)
|
||||
@@ -41,25 +39,5 @@ public class MesXslProcessOperationServiceImpl extends ServiceImpl<MesXslProcess
|
||||
}
|
||||
|
||||
/** 与 MybatisInterceptor 注入 tenant_id 的取值顺序尽量一致,避免前端未传 tenantId 时查不到已存在数据 */
|
||||
private static Integer resolveTenantId(MesXslProcessOperation context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260514 for:【MES】工序编码同租户唯一;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslMixingSpec;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslFormulaSpecEditLogService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixingSpecService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRackTrainCountSettingService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslMixingSpecPage;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRackTrainCountSettingVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
public class MesXslRackTrainCountSettingServiceImpl implements IMesXslRackTrainCountSettingService {
|
||||
|
||||
private static final String STATUS_SET = "1";
|
||||
private static final String STATUS_UNSET = "0";
|
||||
|
||||
private final IMesXslMixingSpecService mixingSpecService;
|
||||
private final IMesXslFormulaSpecEditLogService mesXslFormulaSpecEditLogService;
|
||||
|
||||
public MesXslRackTrainCountSettingServiceImpl(
|
||||
IMesXslMixingSpecService mixingSpecService,
|
||||
IMesXslFormulaSpecEditLogService mesXslFormulaSpecEditLogService) {
|
||||
this.mixingSpecService = mixingSpecService;
|
||||
this.mesXslFormulaSpecEditLogService = mesXslFormulaSpecEditLogService;
|
||||
}
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页查询混炼示方-----------
|
||||
@Override
|
||||
public IPage<MesXslRackTrainCountSettingVO> queryPage(
|
||||
Integer pageNo, Integer pageSize, MesXslRackTrainCountSettingVO query, String keyword) {
|
||||
LambdaQueryWrapper<MesXslMixingSpec> wrapper = buildQueryWrapper(query, keyword);
|
||||
wrapper.orderByDesc(MesXslMixingSpec::getUpdateTime).orderByDesc(MesXslMixingSpec::getCreateTime);
|
||||
Page<MesXslMixingSpec> page = mixingSpecService.page(new Page<>(pageNo, pageSize), wrapper);
|
||||
return page.convert(this::toVo);
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定分页查询混炼示方-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定按ID查询-----------
|
||||
@Override
|
||||
public MesXslRackTrainCountSettingVO queryById(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return null;
|
||||
}
|
||||
MesXslMixingSpec spec = mixingSpecService.getById(id);
|
||||
if (spec == null || isDeleted(spec)) {
|
||||
return null;
|
||||
}
|
||||
return toVo(spec);
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定按ID查询-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存回写混炼示方-----------
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveSetting(MesXslRackTrainCountSettingVO setting) {
|
||||
if (setting == null) {
|
||||
throw new IllegalArgumentException("参数不能为空");
|
||||
}
|
||||
String mixingSpecId = StringUtils.isNotBlank(setting.getMixingSpecId()) ? setting.getMixingSpecId() : setting.getId();
|
||||
if (StringUtils.isBlank(mixingSpecId)) {
|
||||
throw new IllegalArgumentException("混炼示方ID不能为空");
|
||||
}
|
||||
MesXslMixingSpec existing = mixingSpecService.getById(mixingSpecId);
|
||||
if (existing == null || isDeleted(existing)) {
|
||||
throw new IllegalArgumentException("混炼示方不存在或已删除");
|
||||
}
|
||||
if (setting.getSetTrainCount() != null && setting.getSetTrainCount() < 0) {
|
||||
throw new IllegalArgumentException("设定车数不能小于0");
|
||||
}
|
||||
//update-begin---author:cursor ---date:20260528 for:【XSLMES-20260528-A03】架子车数设定保存写入配方日志-----------
|
||||
MesXslMixingSpecPage before = mixingSpecService.queryPageById(mixingSpecId);
|
||||
if (before == null) {
|
||||
throw new IllegalArgumentException("混炼示方不存在或已删除");
|
||||
}
|
||||
Integer newSetTrainCount = setting.getSetTrainCount();
|
||||
if (Objects.equals(before.getSetTrainCount(), newSetTrainCount)) {
|
||||
return;
|
||||
}
|
||||
MesXslMixingSpec update = new MesXslMixingSpec();
|
||||
update.setId(mixingSpecId);
|
||||
update.setSetTrainCount(newSetTrainCount);
|
||||
mixingSpecService.updateById(update);
|
||||
MesXslMixingSpecPage after = copyMixingPageWithSetTrainCount(before, newSetTrainCount);
|
||||
mesXslFormulaSpecEditLogService.recordMixingUpdate(before, after);
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A03】架子车数设定保存写入配方日志-----------
|
||||
}
|
||||
//update-end---author:cursor ---date:20260528 for:【XSLMES-20260528-A01】架子车数设定保存回写混炼示方-----------
|
||||
|
||||
private LambdaQueryWrapper<MesXslMixingSpec> buildQueryWrapper(MesXslRackTrainCountSettingVO query, String keyword) {
|
||||
LambdaQueryWrapper<MesXslMixingSpec> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MesXslMixingSpec::getDelFlag, 0);
|
||||
if (query != null) {
|
||||
if (query.getTenantId() != null) {
|
||||
wrapper.eq(MesXslMixingSpec::getTenantId, query.getTenantId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getSpecCode())) {
|
||||
wrapper.like(MesXslMixingSpec::getSpecName, query.getSpecCode().trim());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getMixingSpecId())) {
|
||||
wrapper.eq(MesXslMixingSpec::getId, query.getMixingSpecId().trim());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getMachineId())) {
|
||||
wrapper.eq(MesXslMixingSpec::getMachineId, query.getMachineId().trim());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getMachineName())) {
|
||||
wrapper.like(MesXslMixingSpec::getMachineName, query.getMachineName().trim());
|
||||
}
|
||||
if (STATUS_SET.equals(query.getStatus())) {
|
||||
wrapper.isNotNull(MesXslMixingSpec::getSetTrainCount);
|
||||
} else if (STATUS_UNSET.equals(query.getStatus())) {
|
||||
wrapper.isNull(MesXslMixingSpec::getSetTrainCount);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
String kw = keyword.trim();
|
||||
wrapper.and(w -> w.like(MesXslMixingSpec::getSpecName, kw)
|
||||
.or()
|
||||
.like(MesXslMixingSpec::getMachineName, kw)
|
||||
.or()
|
||||
.like(MesXslMixingSpec::getIssueNumber, kw));
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
private MesXslRackTrainCountSettingVO toVo(MesXslMixingSpec spec) {
|
||||
MesXslRackTrainCountSettingVO vo = new MesXslRackTrainCountSettingVO();
|
||||
vo.setId(spec.getId());
|
||||
vo.setMixingSpecId(spec.getId());
|
||||
vo.setTenantId(spec.getTenantId());
|
||||
vo.setSpecCode(spec.getSpecName());
|
||||
vo.setMachineId(spec.getMachineId());
|
||||
vo.setMachineName(spec.getMachineName());
|
||||
vo.setSetTrainCount(spec.getSetTrainCount());
|
||||
vo.setStatus(resolveStatus(spec.getSetTrainCount()));
|
||||
vo.setCreateBy(spec.getCreateBy());
|
||||
vo.setCreateTime(spec.getCreateTime());
|
||||
vo.setUpdateBy(spec.getUpdateBy());
|
||||
vo.setUpdateTime(spec.getUpdateTime());
|
||||
return vo;
|
||||
}
|
||||
|
||||
private String resolveStatus(Integer setTrainCount) {
|
||||
return setTrainCount != null ? STATUS_SET : STATUS_UNSET;
|
||||
}
|
||||
|
||||
private boolean isDeleted(MesXslMixingSpec spec) {
|
||||
return spec.getDelFlag() != null && spec.getDelFlag() != 0;
|
||||
}
|
||||
|
||||
/** 基于变更前快照复制 after,仅更新设定车数,避免二次全量查子表 */
|
||||
private static MesXslMixingSpecPage copyMixingPageWithSetTrainCount(MesXslMixingSpecPage before, Integer setTrainCount) {
|
||||
MesXslMixingSpecPage after = new MesXslMixingSpecPage();
|
||||
BeanUtils.copyProperties(before, after);
|
||||
after.setMaterialList(before.getMaterialList());
|
||||
after.setStepList(before.getStepList());
|
||||
after.setDownStepList(before.getDownStepList());
|
||||
after.setTcuList(before.getTcuList());
|
||||
after.setSetTrainCount(setTrainCount);
|
||||
return after;
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,10 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestDataPointMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService;
|
||||
@@ -25,7 +23,7 @@ public class MesXslRubberQuickTestDataPointServiceImpl
|
||||
if (oConvertUtils.isEmpty(pointName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestDataPoint> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslRubberQuickTestDataPoint::getPointName, pointName.trim());
|
||||
w.and(
|
||||
@@ -70,25 +68,5 @@ public class MesXslRubberQuickTestDataPointServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslRubberQuickTestDataPoint context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检数据点名称同租户唯一-----------
|
||||
}
|
||||
|
||||
@@ -12,18 +12,16 @@ import java.util.Collection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod;
|
||||
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine;
|
||||
@@ -66,7 +64,7 @@ public class MesXslRubberQuickTestMethodServiceImpl
|
||||
|
||||
public String generateNextMethodCode(MesXslRubberQuickTestMethod context) {
|
||||
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
|
||||
Integer max = baseMapper.selectMaxNumericMethodCode(tenantId);
|
||||
|
||||
@@ -94,7 +92,7 @@ public class MesXslRubberQuickTestMethodServiceImpl
|
||||
|
||||
}
|
||||
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestMethod> w = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -286,45 +284,6 @@ public class MesXslRubberQuickTestMethodServiceImpl
|
||||
|
||||
|
||||
|
||||
private static Integer resolveTenantId(MesXslRubberQuickTestMethod context) {
|
||||
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
|
||||
return context.getTenantId();
|
||||
|
||||
}
|
||||
|
||||
String ts = TenantContext.getTenant();
|
||||
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
|
||||
try {
|
||||
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
return Integer.parseInt(ts.trim());
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验方法编号001递增、名称同租户唯一、主子保存-----------
|
||||
|
||||
|
||||
@@ -6,13 +6,11 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.XslMesBizConstants;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestStdLineMapper;
|
||||
@@ -37,7 +35,7 @@ public class MesXslRubberQuickTestStdServiceImpl
|
||||
if (oConvertUtils.isEmpty(stdName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestStd> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslRubberQuickTestStd::getStdName, stdName.trim());
|
||||
w.and(q -> q.eq(MesXslRubberQuickTestStd::getDelFlag, CommonConstant.DEL_FLAG_0).or().isNull(MesXslRubberQuickTestStd::getDelFlag));
|
||||
@@ -158,25 +156,5 @@ public class MesXslRubberQuickTestStdServiceImpl
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】原材料检验标准密炼PS批准时关联实验标准置已批准-----------
|
||||
|
||||
private static Integer resolveTenantId(MesXslRubberQuickTestStd context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260525 for:【MES】胶料快检实验标准名称同租户唯一、主子保存-----------
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestTypeMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslRubberQuickTestTypeServiceImpl
|
||||
//update-begin---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编号001递增、名称同租户唯一-----------
|
||||
@Override
|
||||
public String generateNextTypeCode(MesXslRubberQuickTestType context) {
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
Integer max = baseMapper.selectMaxNumericTypeCode(tenantId);
|
||||
int next = (max == null ? 0 : max) + 1;
|
||||
if (next > 999) {
|
||||
@@ -36,7 +34,7 @@ public class MesXslRubberQuickTestTypeServiceImpl
|
||||
if (oConvertUtils.isEmpty(typeName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslRubberQuickTestType> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslRubberQuickTestType::getTypeName, typeName.trim());
|
||||
w.and(
|
||||
@@ -84,25 +82,5 @@ public class MesXslRubberQuickTestTypeServiceImpl
|
||||
}
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslRubberQuickTestType context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260522 for:【MES】胶料快检实验类型编号001递增、名称同租户唯一-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSparePart;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslSparePartMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSparePartService;
|
||||
@@ -21,7 +19,7 @@ public class MesXslSparePartServiceImpl extends ServiceImpl<MesXslSparePartMappe
|
||||
if (oConvertUtils.isEmpty(sparePartName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslSparePart> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslSparePart::getSparePartName, sparePartName.trim());
|
||||
w.and(
|
||||
@@ -38,25 +36,5 @@ public class MesXslSparePartServiceImpl extends ServiceImpl<MesXslSparePartMappe
|
||||
return this.count(w) > 0;
|
||||
}
|
||||
|
||||
private static Integer resolveTenantId(MesXslSparePart context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】备品件名称同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslSparePartsCategoryMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSparePartsCategoryService;
|
||||
@@ -22,7 +20,7 @@ public class MesXslSparePartsCategoryServiceImpl extends ServiceImpl<MesXslSpare
|
||||
if (oConvertUtils.isEmpty(categoryName)) {
|
||||
return false;
|
||||
}
|
||||
Integer tenantId = resolveTenantId(context);
|
||||
Integer tenantId = MesXslTenantUtils.resolveTenantId(context != null ? context.getTenantId() : null);
|
||||
LambdaQueryWrapper<MesXslSparePartsCategory> w = new LambdaQueryWrapper<>();
|
||||
w.eq(MesXslSparePartsCategory::getCategoryName, categoryName.trim());
|
||||
w.and(
|
||||
@@ -60,25 +58,5 @@ public class MesXslSparePartsCategoryServiceImpl extends ServiceImpl<MesXslSpare
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】备品件类别按名称+租户查询单条,供备品件信息导入解析-----------
|
||||
|
||||
private static Integer resolveTenantId(MesXslSparePartsCategory context) {
|
||||
if (context != null && context.getTenantId() != null) {
|
||||
return context.getTenantId();
|
||||
}
|
||||
String ts = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
try {
|
||||
ts = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isEmpty(ts)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(ts.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260515 for:【MES】备品件类别名称同租户不可重复;仅统计未删除(del_flag=0 或 null)-----------
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.service.ISysCategoryService;
|
||||
import org.jeecg.modules.xslmes.config.XslMesWarehouseAreaCapacityProperties;
|
||||
import org.jeecg.modules.xslmes.common.MesXslTenantUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslWarehouseAreaCapacityCfg;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslWarehouseAreaCapacityCfgMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslWarehouseAreaCapacityCfgService;
|
||||
@@ -51,14 +49,7 @@ public class MesXslWarehouseAreaCapacityCfgServiceImpl extends ServiceImpl<MesXs
|
||||
}
|
||||
|
||||
private int resolveTenantIdBestEffort() {
|
||||
String t = TenantContext.getTenant();
|
||||
if (oConvertUtils.isEmpty(t)) {
|
||||
try {
|
||||
t = TokenUtils.getTenantIdByRequest(SpringContextUtils.getHttpServletRequest());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return oConvertUtils.getInt(t, 0);
|
||||
return MesXslTenantUtils.resolveTenantIdBestEffort();
|
||||
}
|
||||
|
||||
/** 页面保存必须用有效租户 */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.jeecg.modules.xslmes.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 架子车数设定(数据来源:混炼示方,不落独立业务表)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "架子车数设定")
|
||||
public class MesXslRackTrainCountSettingVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键(同混炼示方ID)")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "示方编号")
|
||||
private String specCode;
|
||||
|
||||
@Schema(description = "混炼示方ID")
|
||||
private String mixingSpecId;
|
||||
|
||||
@Schema(description = "机台ID")
|
||||
private String machineId;
|
||||
|
||||
@Schema(description = "机台名称")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "设定车数")
|
||||
private Integer setTrainCount;
|
||||
|
||||
@Schema(description = "状态:1已设定 0未设定")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
-- 架子车数设定:菜单与字典(数据来源于混炼示方,不建业务表)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `type`, `tenant_id`)
|
||||
VALUES ('1995000000000000109', '架子车数设定状态', 'xslmes_rack_train_count_setting_status', '架子车数设定-是否已设定车数', 0, 'admin', NOW(), 0, 1002);
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000001091', '1995000000000000109', '已设定', '1', 1, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `sort_order`, `status`, `create_by`, `create_time`)
|
||||
VALUES ('1995000000000001092', '1995000000000000109', '未设定', '0', 2, 1, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (
|
||||
`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`,
|
||||
`menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`,
|
||||
`hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`,
|
||||
`del_flag`, `rule_flag`, `status`, `internal_or_external`
|
||||
) VALUES (
|
||||
'177925970995570', '1900000000000000810', '架子车数设定', '/xslmes/mesXslRackTrainCountSetting',
|
||||
'xslmes/mesXslRackTrainCountSetting/MesXslRackTrainCountSettingList', 1, 'MesXslRackTrainCountSettingList', NULL,
|
||||
1, NULL, '0', 2.50, 0, 'ant-design:car-outlined', 0, 1,
|
||||
0, 0, '基于混炼示方查询与维护设定车数', 'admin', NOW(), 'admin', NOW(),
|
||||
0, 0, '1', 0
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995571', '177925970995570', '查询', 2, 'xslmes:mes_xsl_rack_train_count_setting:list', '1', 1.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO `sys_permission` (`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `create_by`, `create_time`)
|
||||
VALUES ('177925970995572', '177925970995570', '编辑', 2, 'xslmes:mes_xsl_rack_train_count_setting:edit', '1', 2.00, 0, 1, 0, '1', 0, 'admin', NOW());
|
||||
|
||||
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `data_rule_ids`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.id, p.id, NULL, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`role_code` = 'admin'
|
||||
AND p.`id` IN ('177925970995570', '177925970995571', '177925970995572')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslRackTrainCountSetting/list',
|
||||
edit = '/xslmes/mesXslRackTrainCountSetting/edit',
|
||||
queryById = '/xslmes/mesXslRackTrainCountSetting/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params: { id: string }) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const saveSetting = (params) => defHttp.post({ url: Api.edit, params });
|
||||
@@ -0,0 +1,75 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const STATUS_DICT = 'xslmes_rack_train_count_setting_status';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '示方编号', align: 'center', dataIndex: 'specCode', width: 180, ellipsis: true },
|
||||
{ title: '机台名称', align: 'center', dataIndex: 'machineName', width: 160, ellipsis: true },
|
||||
{ title: '设定车数', align: 'center', dataIndex: 'setTrainCount', width: 100 },
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
width: 100,
|
||||
customRender: ({ text }) => {
|
||||
if (text === '1' || text === 1) return '已设定';
|
||||
if (text === '0' || text === 0) return '未设定';
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 110 },
|
||||
{ title: '修改时间', align: 'center', dataIndex: 'updateTime', width: 165 },
|
||||
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 110 },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '示方编号', field: 'specCode', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '机台名称',
|
||||
field: 'machineId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_xsl_equipment_ledger,equipment_name,id',
|
||||
placeholder: '请选择机台',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: STATUS_DICT, placeholder: '全部' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '关键字', field: 'keyword', component: 'Input', colProps: { span: 6 }, componentProps: { placeholder: '示方编号/机台名称' } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '', field: 'mixingSpecId', component: 'Input', show: false },
|
||||
{ label: '示方编号', field: 'specCode', component: 'Input', componentProps: { disabled: true } },
|
||||
{ label: '机台名称', field: 'machineName', component: 'Input', componentProps: { disabled: true } },
|
||||
{
|
||||
label: '设定车数',
|
||||
field: 'setTrainCount',
|
||||
component: 'InputNumber',
|
||||
required: true,
|
||||
componentProps: {
|
||||
min: 0,
|
||||
precision: 0,
|
||||
style: { width: '100%' },
|
||||
placeholder: '请输入设定车数',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: STATUS_DICT, disabled: true },
|
||||
},
|
||||
{ label: '修改人', field: 'updateBy', component: 'Input', componentProps: { disabled: true } },
|
||||
{ label: '修改时间', field: 'updateTime', component: 'Input', componentProps: { disabled: true } },
|
||||
{ label: '创建人', field: 'createBy', component: 'Input', componentProps: { disabled: true } },
|
||||
{ label: '创建时间', field: 'createTime', component: 'Input', componentProps: { disabled: true } },
|
||||
];
|
||||
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslRackTrainCountSettingModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="MesXslRackTrainCountSettingList" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesXslRackTrainCountSettingModal from './components/MesXslRackTrainCountSettingModal.vue';
|
||||
import { columns, searchFormSchema } from './MesXslRackTrainCountSetting.data';
|
||||
import { list } from './MesXslRackTrainCountSetting.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '架子车数设定',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
showIndexColumn: true,
|
||||
tableSetting: { cacheKey: 'mesXslRackTrainCountSetting_v20260528' },
|
||||
formConfig: {
|
||||
labelWidth: 90,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 140,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
defSort: {
|
||||
column: 'updateTime',
|
||||
order: 'desc',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }] = tableContext;
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '设定',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_rack_train_count_setting:edit',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_rack_train_count_setting:list',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="640px" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesXslRackTrainCountSetting.data';
|
||||
import { queryById, saveSetting } from '../MesXslRackTrainCountSetting.api';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isDetail = ref(false);
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
labelWidth: 100,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isDetail.value = !data?.showFooter;
|
||||
const record = data?.record || {};
|
||||
if (record.id) {
|
||||
try {
|
||||
const detail = await queryById({ id: record.id });
|
||||
await setFieldsValue({
|
||||
...detail,
|
||||
mixingSpecId: detail.mixingSpecId || detail.id,
|
||||
});
|
||||
} catch {
|
||||
await setFieldsValue({
|
||||
...record,
|
||||
mixingSpecId: record.mixingSpecId || record.id,
|
||||
});
|
||||
}
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (unref(isDetail) ? '架子车数设定详情' : '架子车数设定'));
|
||||
|
||||
async function handleSubmit() {
|
||||
if (unref(isDetail)) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveSetting({
|
||||
id: values.id,
|
||||
mixingSpecId: values.mixingSpecId || values.id,
|
||||
setTrainCount: values.setTrainCount,
|
||||
});
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user