设备停机记录、设备报警记录新增
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
-- MES 设备报警记录、设备停机记录:菜单 + 导出按钮 + 租户 admin 授权(无 MySQL 业务表)
|
||||
-- 权限前缀:mes:mes_xsl_equip_alarm_record:* / mes:mes_xsl_equip_downtime_record:*
|
||||
-- 父菜单:设备管理;Flyway:V3.9.2_124__mes_xsl_equip_mcs_alarm_downtime_menu.sql
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_equip_pid = (
|
||||
SELECT `id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000222', @mes_equip_pid, '设备报警记录', '/xslmes/mesXslEquipAlarmRecord', 'xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecordList', 'MesXslEquipAlarmRecordList', 1, NULL, '1', 13, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:alert-outlined' WHERE `id` = '1860000000000000222' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000223', '1860000000000000222', '导出', 2, 'mes:mes_xsl_equip_alarm_record:exportXls', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000224', @mes_equip_pid, '设备停机记录', '/xslmes/mesXslEquipDowntimeRecord', 'xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList', 'MesXslEquipDowntimeRecordList', 1, NULL, '1', 15, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000224' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000225', '1860000000000000224', '导出', 2, 'mes:mes_xsl_equip_downtime_record:exportXls', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000222', '1860000000000000223',
|
||||
'1860000000000000224', '1860000000000000225'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_permission` rp
|
||||
WHERE rp.`role_id` = r.`id` AND rp.`permission_id` = p.`id`
|
||||
);
|
||||
@@ -721,3 +721,45 @@ jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMappingList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMapping.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipPartMapping/MesXslEquipPartMapping.api.ts
|
||||
|
||||
-- author:jiangxh---date:20250603--for: 【MES】设备/质量管理主数据删除前引用校验(统一点检配置等下游阻断) ---
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDeleteReferenceService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDeleteReferenceServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslInspectMaintainItemController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentCategoryController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentPartController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentSubPartController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipmentLedgerController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslManufacturerController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslSparePartsCategoryController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDowntimeMainTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDowntimeTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipInspectConfigController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestTypeController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestDataPointController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestMethodController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberQuickTestStdController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslRubberSmallLockReasonController.java
|
||||
|
||||
-- author:jiangxh---date:20250604--for: 【MES】设备报警记录与设备停机记录(SQL Server MCSToMES_MixAlarm 只读、列表回写 ReadTime/MES_Flag) ---
|
||||
jeecg-boot/db/mes-xsl-equip-mcs-alarm-downtime-menu-permission.sql
|
||||
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_124__mes_xsl_equip_mcs_alarm_downtime_menu.sql
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/vo/MesXslEquipAlarmRecordVO.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/vo/MesXslEquipDowntimeRecordVO.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/util/MesXslMcsMixAlarmConvertUtil.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/IMesXslEquipAlarmRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/IMesXslEquipDowntimeRecordService.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslMcsMixAlarmReadMarker.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslEquipAlarmRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mcs/service/impl/MesXslEquipDowntimeRecordServiceImpl.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipAlarmRecordController.java
|
||||
jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslEquipDowntimeRecordController.java
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipAlarmRecord/components/MesXslEquipAlarmRecordModal.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecord.api.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecord.data.ts
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList.vue
|
||||
jeecgboot-vue3/src/views/xslmes/mesXslEquipDowntimeRecord/components/MesXslEquipDowntimeRecordModal.vue
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeMainTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -53,6 +54,9 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@Autowired
|
||||
private IMesXslProcessOperationService mesXslProcessOperationService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES停机主类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslDowntimeMainType>> queryPageList(
|
||||
@@ -104,6 +108,10 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_main_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeMainTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeMainTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -113,6 +121,10 @@ public class MesXslDowntimeMainTypeController extends JeecgController<MesXslDown
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_main_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeMainTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeMainTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeMainType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeMainTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDowntimeTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
@@ -59,6 +60,9 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@Autowired
|
||||
private IMesXslDowntimeMainTypeService mesXslDowntimeMainTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES停机类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslDowntimeType>> queryPageList(
|
||||
@@ -110,6 +114,10 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -119,6 +127,10 @@ public class MesXslDowntimeTypeController extends JeecgController<MesXslDowntime
|
||||
@RequiresPermissions("mes:mes_xsl_downtime_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateDowntimeTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslDowntimeTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
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 jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipAlarmRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipAlarmRecordVO;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 设备报警记录(只读,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Tag(name = "MES设备报警记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipAlarmRecord")
|
||||
@Slf4j
|
||||
public class MesXslEquipAlarmRecordController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipAlarmRecordService mesXslEquipAlarmRecordService;
|
||||
|
||||
@Operation(summary = "MES设备报警记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipAlarmRecordVO>> queryPageList(
|
||||
McsToMesMixAlarm query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<MesXslEquipAlarmRecordVO> pageList =
|
||||
mesXslEquipAlarmRecordService.queryPage(query, req.getParameterMap(), pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备报警记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipAlarmRecordVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipAlarmRecordVO entity = mesXslEquipAlarmRecordService.queryById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_alarm_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, McsToMesMixAlarm query) {
|
||||
List<MesXslEquipAlarmRecordVO> exportList =
|
||||
mesXslEquipAlarmRecordService.listForExport(query, request.getParameterMap());
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
LoginUser sysUser = subject != null && subject.getPrincipal() instanceof LoginUser
|
||||
? (LoginUser) subject.getPrincipal()
|
||||
: null;
|
||||
String exporter = sysUser == null || oConvertUtils.isEmpty(sysUser.getRealname()) ? "admin" : sysUser.getRealname();
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "设备报警记录");
|
||||
mv.addObject(NormalExcelConstants.CLASS, MesXslEquipAlarmRecordVO.class);
|
||||
mv.addObject(
|
||||
NormalExcelConstants.PARAMS,
|
||||
new ExportParams("设备报警记录", "导出人:" + exporter, "设备报警记录", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
String exportFields = request.getParameter(NormalExcelConstants.EXPORT_FIELDS);
|
||||
if (oConvertUtils.isNotEmpty(exportFields)) {
|
||||
mv.addObject(NormalExcelConstants.EXPORT_FIELDS, exportFields);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
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 jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipDowntimeRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipDowntimeRecordVO;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 设备停机记录(只读,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Tag(name = "MES设备停机记录")
|
||||
@RestController
|
||||
@RequestMapping("/xslmes/mesXslEquipDowntimeRecord")
|
||||
@Slf4j
|
||||
public class MesXslEquipDowntimeRecordController {
|
||||
|
||||
@Autowired
|
||||
private IMesXslEquipDowntimeRecordService mesXslEquipDowntimeRecordService;
|
||||
|
||||
@Operation(summary = "MES设备停机记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipDowntimeRecordVO>> queryPageList(
|
||||
McsToMesMixAlarm query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<MesXslEquipDowntimeRecordVO> pageList =
|
||||
mesXslEquipDowntimeRecordService.queryPage(query, req.getParameterMap(), pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "MES设备停机记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MesXslEquipDowntimeRecordVO> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
MesXslEquipDowntimeRecordVO entity = mesXslEquipDowntimeRecordService.queryById(id);
|
||||
if (entity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(entity);
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_equip_downtime_record:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, McsToMesMixAlarm query) {
|
||||
List<MesXslEquipDowntimeRecordVO> exportList =
|
||||
mesXslEquipDowntimeRecordService.listForExport(query, request.getParameterMap());
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
LoginUser sysUser = subject != null && subject.getPrincipal() instanceof LoginUser
|
||||
? (LoginUser) subject.getPrincipal()
|
||||
: null;
|
||||
String exporter = sysUser == null || oConvertUtils.isEmpty(sysUser.getRealname()) ? "admin" : sysUser.getRealname();
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "设备停机记录");
|
||||
mv.addObject(NormalExcelConstants.CLASS, MesXslEquipDowntimeRecordVO.class);
|
||||
mv.addObject(
|
||||
NormalExcelConstants.PARAMS,
|
||||
new ExportParams("设备停机记录", "导出人:" + exporter, "设备停机记录", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
String exportFields = request.getParameter(NormalExcelConstants.EXPORT_FIELDS);
|
||||
if (oConvertUtils.isNotEmpty(exportFields)) {
|
||||
mv.addObject(NormalExcelConstants.EXPORT_FIELDS, exportFields);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfigLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipInspectConfigService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
@@ -53,6 +54,9 @@ public class MesXslEquipInspectConfigController
|
||||
@Autowired
|
||||
private IMesXslInspectMaintainItemService mesXslInspectMaintainItemService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备点检配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipInspectConfig>> queryPageList(
|
||||
@@ -106,6 +110,10 @@ public class MesXslEquipInspectConfigController
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipInspectConfigDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipInspectConfigService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -115,6 +123,10 @@ public class MesXslEquipInspectConfigController
|
||||
@RequiresPermissions("mes:mes_xsl_equip_inspect_config:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipInspectConfigDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipInspectConfigService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -52,6 +53,9 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@Autowired
|
||||
private IMesXslProcessOperationService mesXslProcessOperationService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备类别-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentCategory>> queryPageList(
|
||||
@@ -100,6 +104,10 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_category:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentCategoryDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentCategoryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -109,6 +117,10 @@ public class MesXslEquipmentCategoryController extends JeecgController<MesXslEqu
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_category:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentCategoryDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentLedgerService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -45,6 +46,9 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@Autowired
|
||||
private IMesXslEquipmentLedgerService mesXslEquipmentLedgerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备台账-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentLedger>> queryPageList(
|
||||
@@ -96,6 +100,10 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_ledger:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentLedgerDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentLedgerService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -105,6 +113,10 @@ public class MesXslEquipmentLedgerController extends JeecgController<MesXslEquip
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_ledger:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentLedgerDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentLedgerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -49,6 +50,9 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@Autowired
|
||||
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备部位-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentPart>> queryPageList(
|
||||
@@ -97,6 +101,10 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_part:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentPartDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentPartService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -106,6 +114,10 @@ public class MesXslEquipmentPartController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_part:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentPartDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentPartService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
|
||||
@@ -54,6 +55,9 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@Autowired
|
||||
private IMesXslEquipmentPartService mesXslEquipmentPartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备小部位-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentSubPart>> queryPageList(
|
||||
@@ -102,6 +106,10 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_sub_part:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentSubPartDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentSubPartService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -111,6 +119,10 @@ public class MesXslEquipmentSubPartController extends JeecgController<MesXslEqui
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_sub_part:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentSubPartDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentSubPartService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentCategory;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslProcessOperation;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslProcessOperationService;
|
||||
@@ -54,6 +55,9 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@Autowired
|
||||
private IMesXslEquipmentCategoryService mesXslEquipmentCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES设备类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslEquipmentType>> queryPageList(
|
||||
@@ -102,6 +106,10 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -111,6 +119,10 @@ public class MesXslEquipmentTypeController extends JeecgController<MesXslEquipme
|
||||
@RequiresPermissions("mes:mes_xsl_equipment_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateEquipmentTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslEquipmentTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -26,6 +27,7 @@ import org.jeecg.modules.xslmes.service.IMesXslEquipmentCategoryService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentSubPartService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslEquipmentTypeService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslInspectMaintainItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -60,6 +62,9 @@ public class MesXslInspectMaintainItemController
|
||||
@Autowired
|
||||
private IMesXslEquipmentSubPartService mesXslEquipmentSubPartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES点检及保养项目-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslInspectMaintainItem>> queryPageList(
|
||||
@@ -109,6 +114,12 @@ public class MesXslInspectMaintainItemController
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
String err = mesXslDeleteReferenceService.validateInspectMaintainItemDelete(List.of(id));
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
mesXslInspectMaintainItemService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -118,6 +129,12 @@ public class MesXslInspectMaintainItemController
|
||||
@RequiresPermissions("mes:mes_xsl_inspect_maintain_item:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
String err = mesXslDeleteReferenceService.validateInspectMaintainItemDelete(Arrays.asList(ids.split(",")));
|
||||
if (err != null) {
|
||||
return Result.error(err);
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】点检及保养项目删除前校验设备点检配置等引用-----------
|
||||
mesXslInspectMaintainItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslManufacturer;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslManufacturerService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -45,6 +46,9 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@Autowired
|
||||
private IMesXslManufacturerService mesXslManufacturerService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES厂家信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslManufacturer>> queryPageList(
|
||||
@@ -93,6 +97,10 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@RequiresPermissions("mes:mes_xsl_manufacturer:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateManufacturerDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslManufacturerService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -102,6 +110,10 @@ public class MesXslManufacturerController extends JeecgController<MesXslManufact
|
||||
@RequiresPermissions("mes:mes_xsl_manufacturer:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateManufacturerDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslManufacturerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
@@ -51,6 +52,9 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检数据点-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestDataPoint>> queryPageList(
|
||||
@@ -120,6 +124,10 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestDataPointDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestDataPointService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -129,6 +137,10 @@ public class MesXslRubberQuickTestDataPointController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_data_point:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestDataPointDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestDataPointService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestDataPointService;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
@@ -102,7 +103,8 @@ public class MesXslRubberQuickTestMethodController
|
||||
|
||||
private IMesXslRubberQuickTestDataPointService mesXslRubberQuickTestDataPointService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-分页列表查询")
|
||||
|
||||
@@ -231,29 +233,25 @@ public class MesXslRubberQuickTestMethodController
|
||||
@DeleteMapping(value = "/delete")
|
||||
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestMethodDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestMethodService.delMain(id);
|
||||
|
||||
return Result.OK("删除成功!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "MES胶料快检实验方法-批量删除")
|
||||
|
||||
@Operation(summary = "MES胶料快检实验方法-批量删除")
|
||||
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_method:deleteBatch")
|
||||
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestMethodDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestMethodService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
|
||||
return Result.OK("批量删除成功!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslMixerPsCompileService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestMethodService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestStdService;
|
||||
import org.jeecg.modules.xslmes.vo.MesXslRubberQuickTestStdPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -69,6 +70,9 @@ public class MesXslRubberQuickTestStdController
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验标准-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestStd>> queryPageList(
|
||||
@@ -133,6 +137,10 @@ public class MesXslRubberQuickTestStdController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestStdDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -142,6 +150,10 @@ public class MesXslRubberQuickTestStdController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_std:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestStdDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestStdService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestType;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberQuickTestTypeService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -44,6 +45,9 @@ public class MesXslRubberQuickTestTypeController
|
||||
@Autowired
|
||||
private IMesXslRubberQuickTestTypeService mesXslRubberQuickTestTypeService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料快检实验类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberQuickTestType>> queryPageList(
|
||||
@@ -116,6 +120,10 @@ public class MesXslRubberQuickTestTypeController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestTypeDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestTypeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -125,6 +133,10 @@ public class MesXslRubberQuickTestTypeController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_quick_test_type:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberQuickTestTypeDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberQuickTestTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberSmallLockReason;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslRubberSmallLockReasonService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -44,6 +45,9 @@ public class MesXslRubberSmallLockReasonController
|
||||
@Autowired
|
||||
private IMesXslRubberSmallLockReasonService mesXslRubberSmallLockReasonService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES胶料小料锁定原因-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslRubberSmallLockReason>> queryPageList(
|
||||
@@ -122,6 +126,10 @@ public class MesXslRubberSmallLockReasonController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberSmallLockReasonDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberSmallLockReasonService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -131,6 +139,10 @@ public class MesXslRubberSmallLockReasonController
|
||||
@RequiresPermissions("mes:mes_xsl_rubber_small_lock_reason:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateRubberSmallLockReasonDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslRubberSmallLockReasonService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSparePartsCategory;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslSparePartsCategoryService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
@@ -42,6 +43,9 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@Autowired
|
||||
private IMesXslSparePartsCategoryService mesXslSparePartsCategoryService;
|
||||
|
||||
@Autowired
|
||||
private IMesXslDeleteReferenceService mesXslDeleteReferenceService;
|
||||
|
||||
@Operation(summary = "MES备品件类别-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MesXslSparePartsCategory>> queryPageList(
|
||||
@@ -90,6 +94,10 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@RequiresPermissions("mes:mes_xsl_spare_parts_category:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
String refErr = mesXslDeleteReferenceService.validateSparePartsCategoryDelete(List.of(id));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslSparePartsCategoryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -99,6 +107,10 @@ public class MesXslSparePartsCategoryController extends JeecgController<MesXslSp
|
||||
@RequiresPermissions("mes:mes_xsl_spare_parts_category:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
String refErr = mesXslDeleteReferenceService.validateSparePartsCategoryDelete(Arrays.asList(ids.split(",")));
|
||||
if (refErr != null) {
|
||||
return Result.error(refErr);
|
||||
}
|
||||
mesXslSparePartsCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.xslmes.mcs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipAlarmRecordVO;
|
||||
|
||||
/**
|
||||
* 设备报警记录(只读,SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
public interface IMesXslEquipAlarmRecordService {
|
||||
|
||||
IPage<MesXslEquipAlarmRecordVO> queryPage(McsToMesMixAlarm query, Map<String, String[]> paramMap, int pageNo, int pageSize);
|
||||
|
||||
MesXslEquipAlarmRecordVO queryById(String id);
|
||||
|
||||
List<MesXslEquipAlarmRecordVO> listForExport(McsToMesMixAlarm query, Map<String, String[]> paramMap);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.xslmes.mcs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipDowntimeRecordVO;
|
||||
|
||||
/**
|
||||
* 设备停机记录(只读,SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
public interface IMesXslEquipDowntimeRecordService {
|
||||
|
||||
IPage<MesXslEquipDowntimeRecordVO> queryPage(McsToMesMixAlarm query, Map<String, String[]> paramMap, int pageNo, int pageSize);
|
||||
|
||||
MesXslEquipDowntimeRecordVO queryById(String id);
|
||||
|
||||
List<MesXslEquipDowntimeRecordVO> listForExport(McsToMesMixAlarm query, Map<String, String[]> paramMap);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.mcs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMcsToMesMixAlarmService;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipAlarmRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.util.McsQueryHelper;
|
||||
import org.jeecg.modules.xslmes.mcs.util.MesXslMcsMixAlarmConvertUtil;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipAlarmRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 设备报警记录
|
||||
*/
|
||||
@Service
|
||||
public class MesXslEquipAlarmRecordServiceImpl implements IMesXslEquipAlarmRecordService {
|
||||
|
||||
@Autowired
|
||||
private IMcsToMesMixAlarmService mcsToMesMixAlarmService;
|
||||
|
||||
@Autowired
|
||||
private MesXslMcsMixAlarmReadMarker mesXslMcsMixAlarmReadMarker;
|
||||
|
||||
@Override
|
||||
public IPage<MesXslEquipAlarmRecordVO> queryPage(McsToMesMixAlarm query, Map<String, String[]> paramMap, int pageNo, int pageSize) {
|
||||
QueryWrapper<McsToMesMixAlarm> queryWrapper = McsQueryHelper.buildWrapper(query, paramMap);
|
||||
Page<McsToMesMixAlarm> page = new Page<>(pageNo, pageSize);
|
||||
IPage<McsToMesMixAlarm> rawPage = mcsToMesMixAlarmService.page(page, queryWrapper);
|
||||
//update-begin---author:jiangxh ---date:20250604 for:【MES】设备报警记录列表查询后回写 MCS 读取时间与标识-----------
|
||||
mesXslMcsMixAlarmReadMarker.markAsRead(rawPage.getRecords());
|
||||
//update-end---author:jiangxh ---date:20250604 for:【MES】设备报警记录列表查询后回写 MCS 读取时间与标识-----------
|
||||
Page<MesXslEquipAlarmRecordVO> voPage = new Page<>(pageNo, pageSize, rawPage.getTotal());
|
||||
voPage.setRecords(rawPage.getRecords().stream().map(MesXslMcsMixAlarmConvertUtil::toAlarmVo).collect(Collectors.toList()));
|
||||
return voPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesXslEquipAlarmRecordVO queryById(String id) {
|
||||
McsToMesMixAlarm row = mcsToMesMixAlarmService.getById(id);
|
||||
if (row == null) {
|
||||
return null;
|
||||
}
|
||||
return MesXslMcsMixAlarmConvertUtil.toAlarmVo(row);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesXslEquipAlarmRecordVO> listForExport(McsToMesMixAlarm query, Map<String, String[]> paramMap) {
|
||||
QueryWrapper<McsToMesMixAlarm> queryWrapper = McsQueryHelper.buildWrapper(query, paramMap);
|
||||
return mcsToMesMixAlarmService.list(queryWrapper).stream()
|
||||
.map(MesXslMcsMixAlarmConvertUtil::toAlarmVo)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.mcs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMcsToMesMixAlarmService;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMesXslEquipDowntimeRecordService;
|
||||
import org.jeecg.modules.xslmes.mcs.util.McsQueryHelper;
|
||||
import org.jeecg.modules.xslmes.mcs.util.MesXslMcsMixAlarmConvertUtil;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipDowntimeRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 设备停机记录
|
||||
*/
|
||||
@Service
|
||||
public class MesXslEquipDowntimeRecordServiceImpl implements IMesXslEquipDowntimeRecordService {
|
||||
|
||||
@Autowired
|
||||
private IMcsToMesMixAlarmService mcsToMesMixAlarmService;
|
||||
|
||||
@Autowired
|
||||
private MesXslMcsMixAlarmReadMarker mesXslMcsMixAlarmReadMarker;
|
||||
|
||||
@Override
|
||||
public IPage<MesXslEquipDowntimeRecordVO> queryPage(McsToMesMixAlarm query, Map<String, String[]> paramMap, int pageNo, int pageSize) {
|
||||
QueryWrapper<McsToMesMixAlarm> queryWrapper = McsQueryHelper.buildWrapper(query, paramMap);
|
||||
Page<McsToMesMixAlarm> page = new Page<>(pageNo, pageSize);
|
||||
IPage<McsToMesMixAlarm> rawPage = mcsToMesMixAlarmService.page(page, queryWrapper);
|
||||
//update-begin---author:jiangxh ---date:20250604 for:【MES】设备停机记录列表查询后回写 MCS 读取时间与标识-----------
|
||||
mesXslMcsMixAlarmReadMarker.markAsRead(rawPage.getRecords());
|
||||
//update-end---author:jiangxh ---date:20250604 for:【MES】设备停机记录列表查询后回写 MCS 读取时间与标识-----------
|
||||
Page<MesXslEquipDowntimeRecordVO> voPage = new Page<>(pageNo, pageSize, rawPage.getTotal());
|
||||
voPage.setRecords(rawPage.getRecords().stream().map(MesXslMcsMixAlarmConvertUtil::toDowntimeVo).collect(Collectors.toList()));
|
||||
return voPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesXslEquipDowntimeRecordVO queryById(String id) {
|
||||
McsToMesMixAlarm row = mcsToMesMixAlarmService.getById(id);
|
||||
if (row == null) {
|
||||
return null;
|
||||
}
|
||||
return MesXslMcsMixAlarmConvertUtil.toDowntimeVo(row);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesXslEquipDowntimeRecordVO> listForExport(McsToMesMixAlarm query, Map<String, String[]> paramMap) {
|
||||
QueryWrapper<McsToMesMixAlarm> queryWrapper = McsQueryHelper.buildWrapper(query, paramMap);
|
||||
return mcsToMesMixAlarmService.list(queryWrapper).stream()
|
||||
.map(MesXslMcsMixAlarmConvertUtil::toDowntimeVo)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.jeecg.modules.xslmes.mcs.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.service.IMcsToMesMixAlarmService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 列表查询后将 MCSToMES_MixAlarm 标记为已读(ReadTime、MES_Flag=1)
|
||||
*/
|
||||
@Component
|
||||
public class MesXslMcsMixAlarmReadMarker {
|
||||
|
||||
@Autowired
|
||||
private IMcsToMesMixAlarmService mcsToMesMixAlarmService;
|
||||
|
||||
public void markAsRead(List<McsToMesMixAlarm> records) {
|
||||
if (records == null || records.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Date now = new Date();
|
||||
for (McsToMesMixAlarm row : records) {
|
||||
if (oConvertUtils.isEmpty(row.getGuid())) {
|
||||
continue;
|
||||
}
|
||||
McsToMesMixAlarm upd = new McsToMesMixAlarm();
|
||||
upd.setGuid(row.getGuid());
|
||||
upd.setReadTime(now);
|
||||
upd.setMesFlag(1);
|
||||
mcsToMesMixAlarmService.updateById(upd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package org.jeecg.modules.xslmes.mcs.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.mcs.entity.McsToMesMixAlarm;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipAlarmRecordVO;
|
||||
import org.jeecg.modules.xslmes.mcs.vo.MesXslEquipDowntimeRecordVO;
|
||||
|
||||
/**
|
||||
* MCSToMES_MixAlarm 与 MES 设备报警/停机展示 VO 转换
|
||||
*/
|
||||
public final class MesXslMcsMixAlarmConvertUtil {
|
||||
|
||||
public static final String RECORD_TYPE_AUTO = "自动";
|
||||
|
||||
private static final String[] DATE_PATTERNS = {
|
||||
"yyyy-MM-dd HH:mm:ss",
|
||||
"yyyy/MM/dd HH:mm:ss",
|
||||
"yyyy-MM-dd HH:mm",
|
||||
"yyyy/MM/dd HH:mm"
|
||||
};
|
||||
|
||||
private MesXslMcsMixAlarmConvertUtil() {}
|
||||
|
||||
public static MesXslEquipAlarmRecordVO toAlarmVo(McsToMesMixAlarm row) {
|
||||
MesXslEquipAlarmRecordVO vo = new MesXslEquipAlarmRecordVO();
|
||||
vo.setId(row.getGuid());
|
||||
vo.setEquipId(row.getEquipId());
|
||||
vo.setEquipName(row.getEquipName());
|
||||
vo.setEquipType(row.getEquipType());
|
||||
vo.setShiftClass(null);
|
||||
vo.setAlarmContent(row.getAlarmInf());
|
||||
vo.setAlarmTime(row.getWriteTime());
|
||||
vo.setRecordType(RECORD_TYPE_AUTO);
|
||||
return vo;
|
||||
}
|
||||
|
||||
public static MesXslEquipDowntimeRecordVO toDowntimeVo(McsToMesMixAlarm row) {
|
||||
MesXslEquipDowntimeRecordVO vo = new MesXslEquipDowntimeRecordVO();
|
||||
vo.setId(row.getGuid());
|
||||
vo.setEquipId(row.getEquipId());
|
||||
vo.setEquipName(row.getEquipName());
|
||||
vo.setEquipType(row.getEquipType());
|
||||
vo.setShiftClass(null);
|
||||
vo.setDowntimeContent(row.getAlarmInf());
|
||||
vo.setDowntimeStartTime(row.getWriteTime());
|
||||
vo.setDowntimeEndTime(row.getEndTime());
|
||||
vo.setDowntimeDuration(formatDowntimeDuration(row.getWriteTime(), row.getEndTime()));
|
||||
vo.setRecordType(RECORD_TYPE_AUTO);
|
||||
return vo;
|
||||
}
|
||||
|
||||
public static String formatDowntimeDuration(Date start, String endStr) {
|
||||
if (start == null || oConvertUtils.isEmpty(endStr)) {
|
||||
return null;
|
||||
}
|
||||
Date end = parseDateTime(endStr);
|
||||
if (end == null) {
|
||||
return null;
|
||||
}
|
||||
long diffMs = end.getTime() - start.getTime();
|
||||
if (diffMs < 0) {
|
||||
return null;
|
||||
}
|
||||
long totalMinutes = diffMs / 60000;
|
||||
long hours = totalMinutes / 60;
|
||||
long minutes = totalMinutes % 60;
|
||||
if (hours > 0) {
|
||||
return minutes > 0 ? hours + "小时" + minutes + "分钟" : hours + "小时";
|
||||
}
|
||||
return minutes + "分钟";
|
||||
}
|
||||
|
||||
public static Date parseDateTime(String text) {
|
||||
if (oConvertUtils.isEmpty(text)) {
|
||||
return null;
|
||||
}
|
||||
String trimmed = text.trim();
|
||||
for (String pattern : DATE_PATTERNS) {
|
||||
try {
|
||||
return new SimpleDateFormat(pattern).parse(trimmed);
|
||||
} catch (ParseException ignored) {
|
||||
// try next pattern
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.jeecg.modules.xslmes.mcs.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.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 设备报警记录(展示 VO,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设备报警记录")
|
||||
public class MesXslEquipAlarmRecordVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "机台编号", width = 15)
|
||||
@Schema(description = "机台编号")
|
||||
private String equipId;
|
||||
|
||||
@Excel(name = "机台名称", width = 15)
|
||||
@Schema(description = "机台名称")
|
||||
private String equipName;
|
||||
|
||||
@Excel(name = "机台类型", width = 15)
|
||||
@Schema(description = "机台类型")
|
||||
private String equipType;
|
||||
|
||||
@Excel(name = "班次", width = 12)
|
||||
@Schema(description = "班次")
|
||||
private String shiftClass;
|
||||
|
||||
@Excel(name = "报警内容", width = 40)
|
||||
@Schema(description = "报警内容")
|
||||
private String alarmContent;
|
||||
|
||||
@Excel(name = "报警时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "报警时间")
|
||||
private Date alarmTime;
|
||||
|
||||
@Excel(name = "类型", width = 12)
|
||||
@Schema(description = "类型(自动/人工)")
|
||||
private String recordType;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.jeecg.modules.xslmes.mcs.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.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 设备停机记录(展示 VO,数据来自 SQL Server MCSToMES_MixAlarm)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设备停机记录")
|
||||
public class MesXslEquipDowntimeRecordVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "机台编号", width = 15)
|
||||
@Schema(description = "机台编号")
|
||||
private String equipId;
|
||||
|
||||
@Excel(name = "机台名称", width = 15)
|
||||
@Schema(description = "机台名称")
|
||||
private String equipName;
|
||||
|
||||
@Excel(name = "机台类型", width = 15)
|
||||
@Schema(description = "机台类型")
|
||||
private String equipType;
|
||||
|
||||
@Excel(name = "班次", width = 12)
|
||||
@Schema(description = "班次")
|
||||
private String shiftClass;
|
||||
|
||||
@Excel(name = "停机内容", width = 40)
|
||||
@Schema(description = "停机内容")
|
||||
private String downtimeContent;
|
||||
|
||||
@Excel(name = "停机开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "停机开始时间")
|
||||
private Date downtimeStartTime;
|
||||
|
||||
@Excel(name = "停机结束时间", width = 20)
|
||||
@Schema(description = "停机结束时间")
|
||||
private String downtimeEndTime;
|
||||
|
||||
@Excel(name = "停机时长", width = 15)
|
||||
@Schema(description = "停机时长")
|
||||
private String downtimeDuration;
|
||||
|
||||
@Excel(name = "类型", width = 12)
|
||||
@Schema(description = "类型(自动/人工)")
|
||||
private String recordType;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.jeecg.modules.xslmes.service;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* MES 设备管理 / 质量管理主数据删除前引用校验。
|
||||
*/
|
||||
public interface IMesXslDeleteReferenceService {
|
||||
|
||||
String validateEquipmentCategoryDelete(Collection<String> ids);
|
||||
|
||||
String validateEquipmentTypeDelete(Collection<String> ids);
|
||||
|
||||
String validateEquipmentPartDelete(Collection<String> ids);
|
||||
|
||||
String validateEquipmentSubPartDelete(Collection<String> ids);
|
||||
|
||||
String validateInspectMaintainItemDelete(Collection<String> ids);
|
||||
|
||||
String validateEquipmentLedgerDelete(Collection<String> ids);
|
||||
|
||||
String validateManufacturerDelete(Collection<String> ids);
|
||||
|
||||
String validateSparePartsCategoryDelete(Collection<String> ids);
|
||||
|
||||
String validateDowntimeMainTypeDelete(Collection<String> ids);
|
||||
|
||||
String validateDowntimeTypeDelete(Collection<String> ids);
|
||||
|
||||
String validateEquipInspectConfigDelete(Collection<String> ids);
|
||||
|
||||
String validateRubberQuickTestTypeDelete(Collection<String> ids);
|
||||
|
||||
String validateRubberQuickTestDataPointDelete(Collection<String> ids);
|
||||
|
||||
String validateRubberQuickTestMethodDelete(Collection<String> ids);
|
||||
|
||||
String validateRubberQuickTestStdDelete(Collection<String> ids);
|
||||
|
||||
String validateRubberSmallLockReasonDelete(Collection<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package org.jeecg.modules.xslmes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslDowntimeType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfig;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectConfigLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipInspectRecordLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipPartMapping;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentPart;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentSubPart;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslEquipmentType;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslInspectMaintainItem;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestDataPoint;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethod;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestMethodLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestRecord;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStd;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberQuickTestStdLine;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslRubberSmallLockLog;
|
||||
import org.jeecg.modules.xslmes.entity.MesXslSparePart;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslDayTankMaterialMapMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslDowntimeRecordMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslDowntimeTypeMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipInspectConfigLineMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipInspectConfigMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipInspectRecordLineMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipInspectRecordMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipPartMappingMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentPartMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentSubPartMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslEquipmentTypeMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslInspectMaintainItemMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestDataPointMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestMethodLineMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestMethodMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestRecordMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestStdLineMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberQuickTestStdMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslRubberSmallLockLogMapper;
|
||||
import org.jeecg.modules.xslmes.mapper.MesXslSparePartMapper;
|
||||
import org.jeecg.modules.xslmes.service.IMesXslDeleteReferenceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Service
|
||||
public class MesXslDeleteReferenceServiceImpl implements IMesXslDeleteReferenceService {
|
||||
|
||||
@Autowired
|
||||
private MesXslEquipInspectConfigLineMapper mesXslEquipInspectConfigLineMapper;
|
||||
@Autowired
|
||||
private MesXslEquipInspectRecordMapper mesXslEquipInspectRecordMapper;
|
||||
@Autowired
|
||||
private MesXslEquipInspectRecordLineMapper mesXslEquipInspectRecordLineMapper;
|
||||
@Autowired
|
||||
private MesXslDowntimeRecordMapper mesXslDowntimeRecordMapper;
|
||||
@Autowired
|
||||
private MesXslEquipmentTypeMapper mesXslEquipmentTypeMapper;
|
||||
@Autowired
|
||||
private MesXslEquipmentPartMapper mesXslEquipmentPartMapper;
|
||||
@Autowired
|
||||
private MesXslEquipmentSubPartMapper mesXslEquipmentSubPartMapper;
|
||||
@Autowired
|
||||
private MesXslInspectMaintainItemMapper mesXslInspectMaintainItemMapper;
|
||||
@Autowired
|
||||
private MesXslEquipmentLedgerMapper mesXslEquipmentLedgerMapper;
|
||||
@Autowired
|
||||
private MesXslEquipInspectConfigMapper mesXslEquipInspectConfigMapper;
|
||||
@Autowired
|
||||
private MesXslEquipPartMappingMapper mesXslEquipPartMappingMapper;
|
||||
@Autowired
|
||||
private MesXslDayTankMaterialMapMapper mesXslDayTankMaterialMapMapper;
|
||||
@Autowired
|
||||
private MesXslSparePartMapper mesXslSparePartMapper;
|
||||
@Autowired
|
||||
private MesXslDowntimeTypeMapper mesXslDowntimeTypeMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestMethodMapper mesXslRubberQuickTestMethodMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestDataPointMapper mesXslRubberQuickTestDataPointMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestRecordMapper mesXslRubberQuickTestRecordMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestStdMapper mesXslRubberQuickTestStdMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestMethodLineMapper mesXslRubberQuickTestMethodLineMapper;
|
||||
@Autowired
|
||||
private MesXslRubberQuickTestStdLineMapper mesXslRubberQuickTestStdLineMapper;
|
||||
@Autowired
|
||||
private MesXslRubberSmallLockLogMapper mesXslRubberSmallLockLogMapper;
|
||||
|
||||
//update-begin---author:jiangxh ---date:20250603 for:【MES】设备/质量管理主数据删除前引用校验-----------
|
||||
@Override
|
||||
public String validateEquipmentCategoryDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("设备类型", MesXslEquipmentType::getEquipmentCategoryId, mesXslEquipmentTypeMapper, true),
|
||||
ref("设备部位", MesXslEquipmentPart::getEquipmentCategoryId, mesXslEquipmentPartMapper, true),
|
||||
ref("点检及保养项目", MesXslInspectMaintainItem::getEquipmentCategoryId, mesXslInspectMaintainItemMapper, true),
|
||||
ref("设备台账", MesXslEquipmentLedger::getEquipmentCategoryId, mesXslEquipmentLedgerMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateEquipmentTypeDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("点检及保养项目", MesXslInspectMaintainItem::getEquipmentTypeId, mesXslInspectMaintainItemMapper, true),
|
||||
ref("设备台账", MesXslEquipmentLedger::getEquipmentTypeId, mesXslEquipmentLedgerMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateEquipmentPartDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("设备小部位", MesXslEquipmentSubPart::getEquipmentPartId, mesXslEquipmentSubPartMapper, true),
|
||||
ref("点检及保养项目", MesXslInspectMaintainItem::getEquipmentPartId, mesXslInspectMaintainItemMapper, true),
|
||||
ref("停机记录", MesXslDowntimeRecord::getEquipmentPartId, mesXslDowntimeRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateEquipmentSubPartDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("点检及保养项目", MesXslInspectMaintainItem::getEquipmentSubPartId, mesXslInspectMaintainItemMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateInspectMaintainItemDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
refPlain("设备点检配置", MesXslEquipInspectConfigLine::getInspectMaintainItemId, mesXslEquipInspectConfigLineMapper),
|
||||
refPlain("点检保养记录", MesXslEquipInspectRecordLine::getInspectMaintainItemId, mesXslEquipInspectRecordLineMapper),
|
||||
ref("停机记录", MesXslDowntimeRecord::getInspectMaintainItemId, mesXslDowntimeRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateEquipmentLedgerDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("设备点检配置", MesXslEquipInspectConfig::getEquipmentLedgerId, mesXslEquipInspectConfigMapper, true),
|
||||
ref("点检保养记录", MesXslEquipInspectRecord::getEquipmentLedgerId, mesXslEquipInspectRecordMapper, true),
|
||||
ref("停机记录", MesXslDowntimeRecord::getEquipmentLedgerId, mesXslDowntimeRecordMapper, true),
|
||||
ref("设备对应部位", MesXslEquipPartMapping::getEquipmentLedgerId, mesXslEquipPartMappingMapper, true),
|
||||
refPlain("日罐物料对应", MesXslDayTankMaterialMap::getEquipmentId, mesXslDayTankMaterialMapMapper),
|
||||
ref("胶料快检记录", MesXslRubberQuickTestRecord::getProdEquipmentLedgerId, mesXslRubberQuickTestRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateManufacturerDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("设备台账", MesXslEquipmentLedger::getManufacturerId, mesXslEquipmentLedgerMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateSparePartsCategoryDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("备品件信息", MesXslSparePart::getSparePartsCategoryId, mesXslSparePartMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateDowntimeMainTypeDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("停机类型", MesXslDowntimeType::getDowntimeMainTypeId, mesXslDowntimeTypeMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateDowntimeTypeDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("停机记录", MesXslDowntimeRecord::getDowntimeTypeId, mesXslDowntimeRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateEquipInspectConfigDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids, ref("点检保养记录", MesXslEquipInspectRecord::getEquipInspectConfigId, mesXslEquipInspectRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateRubberQuickTestTypeDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
ref("胶料快检实验方法", MesXslRubberQuickTestMethod::getQuickTestTypeId, mesXslRubberQuickTestMethodMapper, true),
|
||||
ref("胶料快检数据点", MesXslRubberQuickTestDataPoint::getQuickTestTypeId, mesXslRubberQuickTestDataPointMapper, true),
|
||||
ref("胶料快检记录", MesXslRubberQuickTestRecord::getQuickTestTypeId, mesXslRubberQuickTestRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateRubberQuickTestDataPointDelete(Collection<String> ids) {
|
||||
return firstBlocked(
|
||||
ids,
|
||||
refPlain("胶料快检实验方法", MesXslRubberQuickTestMethodLine::getDataPointId, mesXslRubberQuickTestMethodLineMapper),
|
||||
refPlain("胶料快检实验标准", MesXslRubberQuickTestStdLine::getDataPointId, mesXslRubberQuickTestStdLineMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateRubberQuickTestMethodDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("胶料快检实验标准", MesXslRubberQuickTestStd::getTestMethodId, mesXslRubberQuickTestStdMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateRubberQuickTestStdDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("胶料快检记录", MesXslRubberQuickTestRecord::getStdId, mesXslRubberQuickTestRecordMapper, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateRubberSmallLockReasonDelete(Collection<String> ids) {
|
||||
return firstBlocked(ids, ref("胶料小料锁定日志", MesXslRubberSmallLockLog::getLockReasonId, mesXslRubberSmallLockLogMapper, true));
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private final String firstBlocked(Collection<String> ids, Function<List<String>, String>... checks) {
|
||||
List<String> idList = normalizeIds(ids);
|
||||
if (idList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (Function<List<String>, String> check : checks) {
|
||||
String msg = check.apply(idList);
|
||||
if (msg != null) {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private <T> Function<List<String>, String> ref(
|
||||
String moduleName, SFunction<T, String> column, BaseMapper<T> mapper, boolean aliveOnly) {
|
||||
return idList -> countRef(mapper, column, idList, aliveOnly) > 0 ? blockedMsg(moduleName) : null;
|
||||
}
|
||||
|
||||
private <T> Function<List<String>, String> refPlain(
|
||||
String moduleName, SFunction<T, String> column, BaseMapper<T> mapper) {
|
||||
return idList -> countRef(mapper, column, idList, false) > 0 ? blockedMsg(moduleName) : null;
|
||||
}
|
||||
|
||||
private <T> long countRef(
|
||||
BaseMapper<T> mapper, SFunction<T, String> column, List<String> ids, boolean aliveOnly) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return 0;
|
||||
}
|
||||
LambdaQueryWrapper<T> w = new LambdaQueryWrapper<>();
|
||||
w.in(column, ids);
|
||||
if (aliveOnly) {
|
||||
w.apply("(del_flag = {0} OR del_flag IS NULL)", CommonConstant.DEL_FLAG_0);
|
||||
}
|
||||
return mapper.selectCount(w);
|
||||
}
|
||||
|
||||
private List<String> normalizeIds(Collection<String> ids) {
|
||||
if (ids == null) {
|
||||
return List.of();
|
||||
}
|
||||
return ids.stream().filter(oConvertUtils::isNotEmpty).map(String::trim).distinct().toList();
|
||||
}
|
||||
|
||||
private static String blockedMsg(String moduleName) {
|
||||
return "已在【" + moduleName + "】中使用,请先删除" + moduleName + "后再删除";
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20250603 for:【MES】设备/质量管理主数据删除前引用校验-----------
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
-- MES 设备报警记录、设备停机记录(只读,数据来自 SQL Server MCSToMES_MixAlarm;无 MySQL 业务表)
|
||||
-- 权限前缀:mes:mes_xsl_equip_alarm_record:* / mes:mes_xsl_equip_downtime_record:*
|
||||
-- 父菜单:设备管理
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @mes_tenant_id = 1002;
|
||||
|
||||
SET @mes_equip_pid = (
|
||||
SELECT `id` FROM `sys_permission`
|
||||
WHERE `del_flag` = 0 AND `menu_type` = 0 AND `name` = '设备管理'
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mes_equip_pid = IFNULL(@mes_equip_pid, '1860000000000000133');
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000222', @mes_equip_pid, '设备报警记录', '/xslmes/mesXslEquipAlarmRecord', 'xslmes/mesXslEquipAlarmRecord/MesXslEquipAlarmRecordList', 'MesXslEquipAlarmRecordList', 1, NULL, '1', 13, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:alert-outlined' WHERE `id` = '1860000000000000222' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000223', '1860000000000000222', '导出', 2, 'mes:mes_xsl_equip_alarm_record:exportXls', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `menu_type`, `perms`, `perms_type`, `sort_no`, `is_route`, `is_leaf`, `hidden`, `status`, `del_flag`, `keep_alive`, `internal_or_external`, `create_by`, `create_time`)
|
||||
VALUES ('1860000000000000224', @mes_equip_pid, '设备停机记录', '/xslmes/mesXslEquipDowntimeRecord', 'xslmes/mesXslEquipDowntimeRecord/MesXslEquipDowntimeRecordList', 'MesXslEquipDowntimeRecordList', 1, NULL, '1', 15, 1, 0, 0, '1', 0, 1, 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `url` = VALUES(`url`), `component` = VALUES(`component`), `component_name` = VALUES(`component_name`),
|
||||
`menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`), `sort_no` = VALUES(`sort_no`),
|
||||
`is_route` = VALUES(`is_route`), `is_leaf` = VALUES(`is_leaf`), `hidden` = VALUES(`hidden`), `status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`),
|
||||
`keep_alive` = VALUES(`keep_alive`), `internal_or_external` = VALUES(`internal_or_external`);
|
||||
|
||||
UPDATE `sys_permission` SET `icon` = 'ant-design:pause-circle-outlined' WHERE `id` = '1860000000000000224' AND `del_flag` = 0;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `menu_type`, `perms`, `perms_type`, `status`, `del_flag`, `create_by`, `create_time`) VALUES
|
||||
('1860000000000000225', '1860000000000000224', '导出', 2, 'mes:mes_xsl_equip_downtime_record:exportXls', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`parent_id` = VALUES(`parent_id`), `name` = VALUES(`name`), `menu_type` = VALUES(`menu_type`), `perms` = VALUES(`perms`), `perms_type` = VALUES(`perms_type`),
|
||||
`status` = VALUES(`status`), `del_flag` = VALUES(`del_flag`);
|
||||
|
||||
INSERT INTO `sys_role_permission`(`id`, `role_id`, `permission_id`, `operate_date`, `operate_ip`)
|
||||
SELECT REPLACE(UUID(), '-', ''), r.`id`, p.`id`, NOW(), '127.0.0.1'
|
||||
FROM `sys_role` r
|
||||
CROSS JOIN `sys_permission` p
|
||||
WHERE r.`tenant_id` = @mes_tenant_id
|
||||
AND r.`role_code` = 'admin'
|
||||
AND p.`id` IN (
|
||||
'1860000000000000222', '1860000000000000223',
|
||||
'1860000000000000224', '1860000000000000225'
|
||||
)
|
||||
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,11 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslEquipAlarmRecord/list',
|
||||
queryById = '/xslmes/mesXslEquipAlarmRecord/queryById',
|
||||
exportXls = '/xslmes/mesXslEquipAlarmRecord/exportXls',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
export const getExportUrl = Api.exportXls;
|
||||
@@ -0,0 +1,35 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '机台编号', align: 'center', dataIndex: 'equipId', width: 120 },
|
||||
{ title: '机台名称', align: 'center', dataIndex: 'equipName', width: 140 },
|
||||
{ title: '机台类型', align: 'center', dataIndex: 'equipType', width: 100 },
|
||||
{ title: '班次', align: 'center', dataIndex: 'shiftClass', width: 80 },
|
||||
{ title: '报警内容', align: 'left', dataIndex: 'alarmContent', width: 260 },
|
||||
{ title: '报警时间', align: 'center', dataIndex: 'alarmTime', width: 170 },
|
||||
{ title: '类型', align: 'center', dataIndex: 'recordType', width: 80 },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '机台编号', field: 'equipId', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '机台名称', field: 'equipName', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '报警内容', field: 'alarmInf', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '报警时间',
|
||||
field: 'writeTime',
|
||||
component: 'RangePicker',
|
||||
componentProps: { valueType: 'Date', showTime: true, placeholder: ['开始时间', '结束时间'] },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '机台编号', field: 'equipId', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '机台名称', field: 'equipName', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '机台类型', field: 'equipType', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '班次', field: 'shiftClass', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '报警内容', field: 'alarmContent', component: 'InputTextArea', componentProps: { disabled: true, rows: 3 }, colProps: { span: 24 } },
|
||||
{ label: '报警时间', field: 'alarmTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '类型', field: 'recordType', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
];
|
||||
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'mes:mes_xsl_equip_alarm_record:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslEquipAlarmRecordModal @register="registerModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslEquipAlarmRecord" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesXslEquipAlarmRecordModal from './components/MesXslEquipAlarmRecordModal.vue';
|
||||
import { columns, searchFormSchema } from './MesXslEquipAlarmRecord.data';
|
||||
import { list, getExportUrl } from './MesXslEquipAlarmRecord.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备报警记录',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
showActionColumn: true,
|
||||
actionColumn: { width: 80, fixed: 'right' },
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 100,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToTime: [['writeTime', ['writeTime_begin', 'writeTime_end'], 'YYYY-MM-DD HH:mm:ss']],
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '设备报警记录',
|
||||
url: getExportUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable] = tableContext;
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function getTableAction(record) {
|
||||
return [{ label: '详情', onClick: handleDetail.bind(null, record) }];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="设备报警记录详情" :width="800" :showOkBtn="false" cancelText="关闭">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { formSchema } from '../MesXslEquipAlarmRecord.data';
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerModal] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
await setFieldsValue({ ...data.record });
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslEquipDowntimeRecord/list',
|
||||
queryById = '/xslmes/mesXslEquipDowntimeRecord/queryById',
|
||||
exportXls = '/xslmes/mesXslEquipDowntimeRecord/exportXls',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
export const getExportUrl = Api.exportXls;
|
||||
@@ -0,0 +1,39 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '机台编号', align: 'center', dataIndex: 'equipId', width: 120 },
|
||||
{ title: '机台名称', align: 'center', dataIndex: 'equipName', width: 140 },
|
||||
{ title: '机台类型', align: 'center', dataIndex: 'equipType', width: 100 },
|
||||
{ title: '班次', align: 'center', dataIndex: 'shiftClass', width: 80 },
|
||||
{ title: '停机内容', align: 'left', dataIndex: 'downtimeContent', width: 260 },
|
||||
{ title: '停机开始时间', align: 'center', dataIndex: 'downtimeStartTime', width: 170 },
|
||||
{ title: '停机结束时间', align: 'center', dataIndex: 'downtimeEndTime', width: 170 },
|
||||
{ title: '停机时长', align: 'center', dataIndex: 'downtimeDuration', width: 120 },
|
||||
{ title: '类型', align: 'center', dataIndex: 'recordType', width: 80 },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '机台编号', field: 'equipId', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '机台名称', field: 'equipName', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '停机内容', field: 'alarmInf', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '停机开始时间',
|
||||
field: 'writeTime',
|
||||
component: 'RangePicker',
|
||||
componentProps: { valueType: 'Date', showTime: true, placeholder: ['开始时间', '结束时间'] },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '机台编号', field: 'equipId', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '机台名称', field: 'equipName', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '机台类型', field: 'equipType', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '班次', field: 'shiftClass', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '停机内容', field: 'downtimeContent', component: 'InputTextArea', componentProps: { disabled: true, rows: 3 }, colProps: { span: 24 } },
|
||||
{ label: '停机开始时间', field: 'downtimeStartTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '停机结束时间', field: 'downtimeEndTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '停机时长', field: 'downtimeDuration', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
{ label: '类型', field: 'recordType', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
|
||||
];
|
||||
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'mes:mes_xsl_equip_downtime_record:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslEquipDowntimeRecordModal @register="registerModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslEquipDowntimeRecord" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesXslEquipDowntimeRecordModal from './components/MesXslEquipDowntimeRecordModal.vue';
|
||||
import { columns, searchFormSchema } from './MesXslEquipDowntimeRecord.data';
|
||||
import { list, getExportUrl } from './MesXslEquipDowntimeRecord.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备停机记录',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
showActionColumn: true,
|
||||
actionColumn: { width: 80, fixed: 'right' },
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 110,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToTime: [['writeTime', ['writeTime_begin', 'writeTime_end'], 'YYYY-MM-DD HH:mm:ss']],
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '设备停机记录',
|
||||
url: getExportUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable] = tableContext;
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function getTableAction(record) {
|
||||
return [{ label: '详情', onClick: handleDetail.bind(null, record) }];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="设备停机记录详情" :width="800" :showOkBtn="false" cancelText="关闭">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { formSchema } from '../MesXslEquipDowntimeRecord.data';
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerModal] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
await setFieldsValue({ ...data.record });
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user