From e678276aba57ecf1e63766dfcad8f41a42cdad56 Mon Sep 17 00:00:00 2001 From: chenx <1366659369@qq.com> Date: Thu, 21 May 2026 10:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=82=BC=E6=9C=BA=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E3=80=81=E6=97=A5=E7=BD=90=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/mes-xsl-day-tank-material-map-menu.sql | 92 ++++++++++ jeecg-boot/db/mes-xsl-mixer-action-menu.sql | 92 ++++++++++ .../MesXslDayTankMaterialMapController.java | 151 ++++++++++++++++ .../MesXslMixerActionController.java | 167 ++++++++++++++++++ .../entity/MesXslDayTankMaterialMap.java | 90 ++++++++++ .../xslmes/entity/MesXslMixerAction.java | 68 +++++++ .../MesXslDayTankMaterialMapMapper.java | 6 + .../mapper/MesXslMixerActionMapper.java | 6 + .../IMesXslDayTankMaterialMapService.java | 12 ++ .../service/IMesXslMixerActionService.java | 13 ++ .../MesXslDayTankMaterialMapServiceImpl.java | 56 ++++++ .../impl/MesXslMixerActionServiceImpl.java | 58 ++++++ .../mysql/V3.9.2_77__mes_xsl_mixer_action.sql | 20 +++ ....9.2_78__mes_xsl_day_tank_material_map.sql | 24 +++ .../mes/daytankmaterialmapinfo/index.vue | 7 + .../src/views/mes/mixeractioninfo/index.vue | 7 + .../MesXslDayTankMaterialMap.api.ts | 28 +++ .../MesXslDayTankMaterialMap.data.ts | 154 ++++++++++++++++ .../MesXslDayTankMaterialMapList.vue | 84 +++++++++ .../modules/MesXslDayTankMaterialMapModal.vue | 67 +++++++ .../MesXslMixerAction.api.ts | 33 ++++ .../MesXslMixerAction.data.ts | 76 ++++++++ .../MesXslMixerActionList.vue | 84 +++++++++ .../modules/MesXslMixerActionModal.vue | 48 +++++ 24 files changed, 1443 insertions(+) create mode 100644 jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql create mode 100644 jeecg-boot/db/mes-xsl-mixer-action-menu.sql create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDayTankMaterialMapController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerActionController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslDayTankMaterialMap.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerAction.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslDayTankMaterialMapMapper.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixerActionMapper.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDayTankMaterialMapService.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerActionService.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDayTankMaterialMapServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerActionServiceImpl.java create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_mixer_action.sql create mode 100644 jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_78__mes_xsl_day_tank_material_map.sql create mode 100644 jeecgboot-vue3/src/views/mes/daytankmaterialmapinfo/index.vue create mode 100644 jeecgboot-vue3/src/views/mes/mixeractioninfo/index.vue create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.api.ts create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.data.ts create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMapList.vue create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/modules/MesXslDayTankMaterialMapModal.vue create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.api.ts create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.data.ts create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerActionList.vue create mode 100644 jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/modules/MesXslMixerActionModal.vue diff --git a/jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql b/jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql new file mode 100644 index 0000000..cbd67c6 --- /dev/null +++ b/jeecg-boot/db/mes-xsl-day-tank-material-map-menu.sql @@ -0,0 +1,92 @@ +-- 日罐物料对应信息菜单与权限(挂到「MES密炼工程」目录) +SET NAMES utf8mb4; + +SET @mixer_parent_id = ( + SELECT id + FROM sys_permission + WHERE name = 'MES密炼工程' AND menu_type = 0 AND del_flag = 0 + ORDER BY create_time ASC + LIMIT 1 +); +SET @mixer_parent_id = IFNULL(@mixer_parent_id, ( + SELECT id + FROM sys_permission + WHERE url = '/mes' AND menu_type = 0 AND del_flag = 0 + ORDER BY create_time ASC + LIMIT 1 +)); +SET @mixer_parent_id = IFNULL(@mixer_parent_id, '1860000000000000001'); + +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 ( + '1860000000000099311', @mixer_parent_id, '日罐物料对应信息', + '/mes/daytankmaterialmapinfo', + 'mes/daytankmaterialmapinfo/index', + 'MesXslDayTankMaterialMapList', 1, NULL, '1', 31, + 1, 1, 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); + +INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time) VALUES +('1860000000000099312', '1860000000000099311', '新增', 2, 'xslmes:mes_xsl_day_tank_material_map:add', '1', '1', 0, 'admin', NOW()), +('1860000000000099313', '1860000000000099311', '编辑', 2, 'xslmes:mes_xsl_day_tank_material_map:edit', '1', '1', 0, 'admin', NOW()), +('1860000000000099314', '1860000000000099311', '删除', 2, 'xslmes:mes_xsl_day_tank_material_map:delete', '1', '1', 0, 'admin', NOW()), +('1860000000000099315', '1860000000000099311', '批量删除', 2, 'xslmes:mes_xsl_day_tank_material_map:deleteBatch', '1', '1', 0, 'admin', NOW()), +('1860000000000099316', '1860000000000099311', '导出', 2, 'xslmes:mes_xsl_day_tank_material_map: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); + +-- admin 角色授权 +INSERT INTO sys_role_permission(id, role_id, permission_id, operate_date, operate_ip) +SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW(), '127.0.0.1' +FROM sys_permission p +WHERE p.id IN ( + '1860000000000099311', + '1860000000000099312', '1860000000000099313', '1860000000000099314', '1860000000000099315', '1860000000000099316' +) + AND NOT EXISTS ( + SELECT 1 + FROM sys_role_permission rp + WHERE rp.role_id = 'f6817f48af4fb3af11b9e8bf182f618b' + AND rp.permission_id = p.id + ); + +-- 强制修复:确保菜单路由与组件路径正确(避免历史错误路径导致“查看组件引用是否正确”) +UPDATE sys_permission +SET + parent_id = @mixer_parent_id, + url = '/mes/daytankmaterialmapinfo', + component = 'mes/daytankmaterialmapinfo/index', + component_name = 'MesXslDayTankMaterialMapList', + menu_type = 1, + is_route = 1, + is_leaf = 1, + hidden = 0, + status = '1', + del_flag = 0 +WHERE id = '1860000000000099311'; diff --git a/jeecg-boot/db/mes-xsl-mixer-action-menu.sql b/jeecg-boot/db/mes-xsl-mixer-action-menu.sql new file mode 100644 index 0000000..370be14 --- /dev/null +++ b/jeecg-boot/db/mes-xsl-mixer-action-menu.sql @@ -0,0 +1,92 @@ +-- 密炼机动作维护菜单与权限(挂到「MES密炼工程」目录) +SET NAMES utf8mb4; + +SET @mixer_parent_id = ( + SELECT id + FROM sys_permission + WHERE name = 'MES密炼工程' AND menu_type = 0 AND del_flag = 0 + ORDER BY create_time ASC + LIMIT 1 +); +SET @mixer_parent_id = IFNULL(@mixer_parent_id, ( + SELECT id + FROM sys_permission + WHERE url = '/mes' AND menu_type = 0 AND del_flag = 0 + ORDER BY create_time ASC + LIMIT 1 +)); +SET @mixer_parent_id = IFNULL(@mixer_parent_id, '1860000000000000001'); + +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 ( + '1860000000000099211', @mixer_parent_id, '密炼机动作维护', + '/mes/mixeractioninfo', + 'mes/mixeractioninfo/index', + 'MesXslMixerActionList', 1, NULL, '1', 30, + 1, 1, 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); + +INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time) VALUES +('1860000000000099212', '1860000000000099211', '新增', 2, 'xslmes:mes_xsl_mixer_action:add', '1', '1', 0, 'admin', NOW()), +('1860000000000099213', '1860000000000099211', '编辑', 2, 'xslmes:mes_xsl_mixer_action:edit', '1', '1', 0, 'admin', NOW()), +('1860000000000099214', '1860000000000099211', '删除', 2, 'xslmes:mes_xsl_mixer_action:delete', '1', '1', 0, 'admin', NOW()), +('1860000000000099215', '1860000000000099211', '批量删除', 2, 'xslmes:mes_xsl_mixer_action:deleteBatch', '1', '1', 0, 'admin', NOW()), +('1860000000000099216', '1860000000000099211', '导出', 2, 'xslmes:mes_xsl_mixer_action: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); + +-- admin 角色授权 +INSERT INTO sys_role_permission(id, role_id, permission_id, operate_date, operate_ip) +SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW(), '127.0.0.1' +FROM sys_permission p +WHERE p.id IN ( + '1860000000000099211', + '1860000000000099212', '1860000000000099213', '1860000000000099214', '1860000000000099215', '1860000000000099216' +) + AND NOT EXISTS ( + SELECT 1 + FROM sys_role_permission rp + WHERE rp.role_id = 'f6817f48af4fb3af11b9e8bf182f618b' + AND rp.permission_id = p.id + ); + +-- 强制修复:确保菜单路由与组件路径正确(避免历史错误路径导致“查看组件引用是否正确”) +UPDATE sys_permission +SET + parent_id = @mixer_parent_id, + url = '/mes/mixeractioninfo', + component = 'mes/mixeractioninfo/index', + component_name = 'MesXslMixerActionList', + menu_type = 1, + is_route = 1, + is_leaf = 1, + hidden = 0, + status = '1', + del_flag = 0 +WHERE id = '1860000000000099211'; diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDayTankMaterialMapController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDayTankMaterialMapController.java new file mode 100644 index 0000000..6f5753b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslDayTankMaterialMapController.java @@ -0,0 +1,151 @@ +package org.jeecg.modules.xslmes.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Arrays; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +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.MesXslDayTankMaterialMap; +import org.jeecg.modules.xslmes.service.IMesXslDayTankMaterialMapService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +@Tag(name = "日罐物料对应信息") +@RestController +@RequestMapping("/xslmes/mesXslDayTankMaterialMap") +public class MesXslDayTankMaterialMapController + extends JeecgController { + + @Autowired private IMesXslDayTankMaterialMapService dayTankMaterialMapService; + + @Operation(summary = "日罐物料对应信息-分页列表查询") + @GetMapping("/list") + public Result> queryPageList( + MesXslDayTankMaterialMap model, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + IPage pageList = dayTankMaterialMapService.page(new Page<>(pageNo, pageSize), queryWrapper); + return Result.OK(pageList); + } + + @AutoLog(value = "日罐物料对应信息-添加") + @Operation(summary = "日罐物料对应信息-添加") + @RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:add") + @PostMapping("/add") + public Result add(@RequestBody MesXslDayTankMaterialMap model) { + String err = validateForSave(model); + if (err != null) { + return Result.error(err); + } + dayTankMaterialMapService.fillReferenceFields(model); + if (StringUtils.isBlank(model.getMachineCode()) || StringUtils.isBlank(model.getMachineName())) { + return Result.error("请选择有效的机台名称"); + } + if (StringUtils.isBlank(model.getMaterialName())) { + return Result.error("请选择有效的物料名称"); + } + dayTankMaterialMapService.save(model); + return Result.OK("添加成功!"); + } + + @AutoLog(value = "日罐物料对应信息-编辑") + @Operation(summary = "日罐物料对应信息-编辑") + @RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody MesXslDayTankMaterialMap model) { + String err = validateForSave(model); + if (err != null) { + return Result.error(err); + } + dayTankMaterialMapService.fillReferenceFields(model); + if (StringUtils.isBlank(model.getMachineCode()) || StringUtils.isBlank(model.getMachineName())) { + return Result.error("请选择有效的机台名称"); + } + if (StringUtils.isBlank(model.getMaterialName())) { + return Result.error("请选择有效的物料名称"); + } + dayTankMaterialMapService.updateById(model); + return Result.OK("编辑成功!"); + } + + @AutoLog(value = "日罐物料对应信息-通过id删除") + @Operation(summary = "日罐物料对应信息-通过id删除") + @RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:delete") + @DeleteMapping("/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + dayTankMaterialMapService.removeById(id); + return Result.OK("删除成功!"); + } + + @AutoLog(value = "日罐物料对应信息-批量删除") + @Operation(summary = "日罐物料对应信息-批量删除") + @RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:deleteBatch") + @DeleteMapping("/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + dayTankMaterialMapService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + @Operation(summary = "日罐物料对应信息-通过id查询") + @GetMapping("/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + MesXslDayTankMaterialMap entity = dayTankMaterialMapService.getById(id); + if (entity == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(entity); + } + + @RequiresPermissions("xslmes:mes_xsl_day_tank_material_map:exportXls") + @RequestMapping("/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MesXslDayTankMaterialMap model) { + return super.exportXls(request, model, MesXslDayTankMaterialMap.class, "日罐物料对应信息"); + } + + private String validateForSave(MesXslDayTankMaterialMap model) { + if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) { + return "机台名称不能为空"; + } + model.setEquipmentId(model.getEquipmentId().trim()); + if (oConvertUtils.isEmpty(model.getMaterialId()) || StringUtils.isBlank(model.getMaterialId())) { + return "物料名称不能为空"; + } + model.setMaterialId(model.getMaterialId().trim()); + if (model.getUseStatus() == null) { + model.setUseStatus(1); + } + if (model.getAllowSync() == null) { + model.setAllowSync(1); + } + if (model.getSiloCategoryId() != null) { + model.setSiloCategoryId(model.getSiloCategoryId().trim()); + } + if (model.getStation() != null) { + model.setStation(model.getStation().trim()); + } + if (model.getSiloNo() != null) { + model.setSiloNo(model.getSiloNo().trim()); + } + return null; + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerActionController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerActionController.java new file mode 100644 index 0000000..050af50 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/controller/MesXslMixerActionController.java @@ -0,0 +1,167 @@ +package org.jeecg.modules.xslmes.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Arrays; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +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.MesXslMixerAction; +import org.jeecg.modules.xslmes.service.IMesXslMixerActionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +@Tag(name = "密炼机动作维护") +@RestController +@RequestMapping("/xslmes/mesXslMixerAction") +public class MesXslMixerActionController extends JeecgController { + + @Autowired private IMesXslMixerActionService mesXslMixerActionService; + + @Operation(summary = "密炼机动作维护-分页列表查询") + @GetMapping("/list") + public Result> queryPageList( + MesXslMixerAction model, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + IPage pageList = mesXslMixerActionService.page(new Page<>(pageNo, pageSize), queryWrapper); + return Result.OK(pageList); + } + + @AutoLog(value = "密炼机动作维护-添加") + @Operation(summary = "密炼机动作维护-添加") + @RequiresPermissions("xslmes:mes_xsl_mixer_action:add") + @PostMapping("/add") + public Result add(@RequestBody MesXslMixerAction model) { + String err = validateForSave(model, null); + if (err != null) { + return Result.error(err); + } + mesXslMixerActionService.fillEquipmentName(model); + if (StringUtils.isBlank(model.getEquipmentName())) { + return Result.error("请选择有效的设备名称"); + } + mesXslMixerActionService.save(model); + return Result.OK("添加成功!"); + } + + @AutoLog(value = "密炼机动作维护-编辑") + @Operation(summary = "密炼机动作维护-编辑") + @RequiresPermissions("xslmes:mes_xsl_mixer_action:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody MesXslMixerAction model) { + String err = validateForSave(model, model.getId()); + if (err != null) { + return Result.error(err); + } + mesXslMixerActionService.fillEquipmentName(model); + if (StringUtils.isBlank(model.getEquipmentName())) { + return Result.error("请选择有效的设备名称"); + } + mesXslMixerActionService.updateById(model); + return Result.OK("编辑成功!"); + } + + @AutoLog(value = "密炼机动作维护-通过id删除") + @Operation(summary = "密炼机动作维护-通过id删除") + @RequiresPermissions("xslmes:mes_xsl_mixer_action:delete") + @DeleteMapping("/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + mesXslMixerActionService.removeById(id); + return Result.OK("删除成功!"); + } + + @AutoLog(value = "密炼机动作维护-批量删除") + @Operation(summary = "密炼机动作维护-批量删除") + @RequiresPermissions("xslmes:mes_xsl_mixer_action:deleteBatch") + @DeleteMapping("/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + mesXslMixerActionService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + @Operation(summary = "密炼机动作维护-通过id查询") + @GetMapping("/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + MesXslMixerAction entity = mesXslMixerActionService.getById(id); + if (entity == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(entity); + } + + @Operation(summary = "校验动作名称是否重复") + @GetMapping("/checkActionName") + public Result checkActionName( + @RequestParam(name = "actionName", required = true) String actionName, + @RequestParam(name = "dataId", required = false) String dataId) { + if (oConvertUtils.isEmpty(actionName) || actionName.trim().isEmpty()) { + return Result.OK("该值可用!"); + } + if (mesXslMixerActionService.isActionNameDuplicated(actionName, dataId)) { + return Result.error("动作名称不能重复"); + } + return Result.OK("该值可用!"); + } + + @Operation(summary = "校验动作代号是否重复") + @GetMapping("/checkActionCode") + public Result checkActionCode( + @RequestParam(name = "actionCode", required = true) String actionCode, + @RequestParam(name = "dataId", required = false) String dataId) { + if (oConvertUtils.isEmpty(actionCode) || actionCode.trim().isEmpty()) { + return Result.OK("该值可用!"); + } + if (mesXslMixerActionService.isActionCodeDuplicated(actionCode, dataId)) { + return Result.error("动作代号不能重复"); + } + return Result.OK("该值可用!"); + } + + @RequiresPermissions("xslmes:mes_xsl_mixer_action:exportXls") + @RequestMapping("/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MesXslMixerAction model) { + return super.exportXls(request, model, MesXslMixerAction.class, "密炼机动作维护"); + } + + private String validateForSave(MesXslMixerAction model, String excludeId) { + if (oConvertUtils.isEmpty(model.getEquipmentId()) || StringUtils.isBlank(model.getEquipmentId())) { + return "设备名称不能为空"; + } + model.setEquipmentId(model.getEquipmentId().trim()); + if (oConvertUtils.isEmpty(model.getActionName()) || StringUtils.isBlank(model.getActionName())) { + return "动作名称不能为空"; + } + model.setActionName(model.getActionName().trim()); + if (mesXslMixerActionService.isActionNameDuplicated(model.getActionName(), excludeId)) { + return "动作名称不能重复"; + } + if (oConvertUtils.isEmpty(model.getActionCode()) || StringUtils.isBlank(model.getActionCode())) { + return "动作代号不能为空"; + } + model.setActionCode(model.getActionCode().trim()); + if (mesXslMixerActionService.isActionCodeDuplicated(model.getActionCode(), excludeId)) { + return "动作代号不能重复"; + } + return null; + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslDayTankMaterialMap.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslDayTankMaterialMap.java new file mode 100644 index 0000000..0da344e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslDayTankMaterialMap.java @@ -0,0 +1,90 @@ +package org.jeecg.modules.xslmes.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * MES 日罐物料对应信息 + */ +@Data +@TableName("mes_xsl_day_tank_material_map") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description = "MES日罐物料对应信息") +public class MesXslDayTankMaterialMap implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_ID) + private String id; + + @Excel(name = "机台名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id") + @Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id") + @Schema(description = "设备台账ID") + private String equipmentId; + + @Excel(name = "机台代码", width = 20) + @Schema(description = "机台代码(设备编号冗余)") + private String machineCode; + + @Excel(name = "机台名称", width = 20) + @Schema(description = "机台名称冗余") + private String machineName; + + @Excel(name = "料仓分类", width = 20, dictTable = "sys_category", dicText = "name", dicCode = "id") + @Dict(dictTable = "sys_category", dicText = "name", dicCode = "id") + @Schema(description = "料仓分类ID(分类字典)") + private String siloCategoryId; + + @Excel(name = "工位", width = 20) + @Schema(description = "工位") + private String station; + + @Excel(name = "料仓号", width = 20) + @Schema(description = "料仓号") + private String siloNo; + + @Excel(name = "物料名称", width = 20, dictTable = "mes_material", dicText = "material_name", dicCode = "id") + @Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id") + @Schema(description = "胶料信息ID") + private String materialId; + + @Excel(name = "物料名称", width = 20) + @Schema(description = "物料名称冗余") + private String materialName; + + @Excel(name = "使用状态", width = 12, replace = {"使用中_1", "停用_0"}) + @Schema(description = "使用状态:1使用中 0停用") + private Integer useStatus; + + @Excel(name = "是否允许同步", width = 12, replace = {"允许_1", "不允许_0"}) + @Schema(description = "是否允许同步:1允许 0不允许") + private Integer allowSync; + + private Integer tenantId; + private String sysOrgCode; + private String createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + private String updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + private Integer delFlag; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerAction.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerAction.java new file mode 100644 index 0000000..4cf6707 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/entity/MesXslMixerAction.java @@ -0,0 +1,68 @@ +package org.jeecg.modules.xslmes.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * MES 密炼机动作维护 + */ +@Data +@TableName("mes_xsl_mixer_action") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description = "MES密炼机动作维护") +public class MesXslMixerAction implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_ID) + private String id; + + @Excel(name = "设备名称", width = 20, dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id") + @Dict(dictTable = "mes_xsl_equipment_ledger", dicText = "equipment_name", dicCode = "id") + @Schema(description = "设备台账ID") + private String equipmentId; + + @Excel(name = "设备名称", width = 20) + @Schema(description = "设备名称冗余") + private String equipmentName; + + @Excel(name = "动作名称", width = 20) + @Schema(description = "动作名称") + private String actionName; + + @Excel(name = "动作代号", width = 20) + @Schema(description = "动作代号") + private String actionCode; + + @Excel(name = "备注", width = 30) + @Schema(description = "备注") + private String remark; + + private Integer tenantId; + private String sysOrgCode; + private String createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + private String updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + private Integer delFlag; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslDayTankMaterialMapMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslDayTankMaterialMapMapper.java new file mode 100644 index 0000000..d9e0beb --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslDayTankMaterialMapMapper.java @@ -0,0 +1,6 @@ +package org.jeecg.modules.xslmes.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap; + +public interface MesXslDayTankMaterialMapMapper extends BaseMapper {} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixerActionMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixerActionMapper.java new file mode 100644 index 0000000..4902443 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/mapper/MesXslMixerActionMapper.java @@ -0,0 +1,6 @@ +package org.jeecg.modules.xslmes.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.xslmes.entity.MesXslMixerAction; + +public interface MesXslMixerActionMapper extends BaseMapper {} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDayTankMaterialMapService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDayTankMaterialMapService.java new file mode 100644 index 0000000..ccd6d76 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslDayTankMaterialMapService.java @@ -0,0 +1,12 @@ +package org.jeecg.modules.xslmes.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap; + +public interface IMesXslDayTankMaterialMapService extends IService { + + /** + * 由选择类字段ID回填冗余展示信息(机台代码/机台名称/物料名称) + */ + void fillReferenceFields(MesXslDayTankMaterialMap model); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerActionService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerActionService.java new file mode 100644 index 0000000..10b4785 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerActionService.java @@ -0,0 +1,13 @@ +package org.jeecg.modules.xslmes.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.xslmes.entity.MesXslMixerAction; + +public interface IMesXslMixerActionService extends IService { + + boolean isActionNameDuplicated(String actionName, String excludeId); + + boolean isActionCodeDuplicated(String actionCode, String excludeId); + + void fillEquipmentName(MesXslMixerAction model); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDayTankMaterialMapServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDayTankMaterialMapServiceImpl.java new file mode 100644 index 0000000..fad764e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslDayTankMaterialMapServiceImpl.java @@ -0,0 +1,56 @@ +package org.jeecg.modules.xslmes.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.jeecg.modules.mes.material.entity.MesMaterial; +import org.jeecg.modules.mes.material.mapper.MesMaterialMapper; +import org.jeecg.modules.xslmes.entity.MesXslDayTankMaterialMap; +import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger; +import org.jeecg.modules.xslmes.mapper.MesXslDayTankMaterialMapMapper; +import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper; +import org.jeecg.modules.xslmes.service.IMesXslDayTankMaterialMapService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class MesXslDayTankMaterialMapServiceImpl + extends ServiceImpl + implements IMesXslDayTankMaterialMapService { + + @Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper; + @Autowired private MesMaterialMapper mesMaterialMapper; + + @Override + public void fillReferenceFields(MesXslDayTankMaterialMap model) { + if (model == null) { + return; + } + fillEquipmentFields(model); + fillMaterialFields(model); + } + + private void fillEquipmentFields(MesXslDayTankMaterialMap model) { + if (StringUtils.isBlank(model.getEquipmentId())) { + model.setMachineCode(null); + model.setMachineName(null); + return; + } + MesXslEquipmentLedger equipment = equipmentLedgerMapper.selectById(model.getEquipmentId().trim()); + if (equipment == null) { + model.setMachineCode(null); + model.setMachineName(null); + return; + } + model.setMachineCode(equipment.getEquipmentCode()); + model.setMachineName(equipment.getEquipmentName()); + } + + private void fillMaterialFields(MesXslDayTankMaterialMap model) { + if (StringUtils.isBlank(model.getMaterialId())) { + model.setMaterialName(null); + return; + } + MesMaterial material = mesMaterialMapper.selectById(model.getMaterialId().trim()); + model.setMaterialName(material == null ? null : material.getMaterialName()); + } +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerActionServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerActionServiceImpl.java new file mode 100644 index 0000000..5287902 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerActionServiceImpl.java @@ -0,0 +1,58 @@ +package org.jeecg.modules.xslmes.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; +import org.jeecg.modules.xslmes.entity.MesXslEquipmentLedger; +import org.jeecg.modules.xslmes.entity.MesXslMixerAction; +import org.jeecg.modules.xslmes.mapper.MesXslEquipmentLedgerMapper; +import org.jeecg.modules.xslmes.mapper.MesXslMixerActionMapper; +import org.jeecg.modules.xslmes.service.IMesXslMixerActionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class MesXslMixerActionServiceImpl extends ServiceImpl + implements IMesXslMixerActionService { + + @Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper; + + @Override + public boolean isActionNameDuplicated(String actionName, String excludeId) { + if (StringUtils.isBlank(actionName)) { + return false; + } + LambdaQueryWrapper wrapper = + new LambdaQueryWrapper().eq(MesXslMixerAction::getActionName, actionName.trim()); + if (StringUtils.isNotBlank(excludeId)) { + wrapper.ne(MesXslMixerAction::getId, excludeId.trim()); + } + return this.count(wrapper) > 0; + } + + @Override + public boolean isActionCodeDuplicated(String actionCode, String excludeId) { + if (StringUtils.isBlank(actionCode)) { + return false; + } + LambdaQueryWrapper wrapper = + new LambdaQueryWrapper().eq(MesXslMixerAction::getActionCode, actionCode.trim()); + if (StringUtils.isNotBlank(excludeId)) { + wrapper.ne(MesXslMixerAction::getId, excludeId.trim()); + } + return this.count(wrapper) > 0; + } + + @Override + public void fillEquipmentName(MesXslMixerAction model) { + if (model == null) { + return; + } + if (StringUtils.isBlank(model.getEquipmentId())) { + model.setEquipmentName(null); + return; + } + MesXslEquipmentLedger ledger = equipmentLedgerMapper.selectById(model.getEquipmentId().trim()); + model.setEquipmentName(ledger == null ? null : ledger.getEquipmentName()); + } +} diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_mixer_action.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_mixer_action.sql new file mode 100644 index 0000000..636d38d --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_77__mes_xsl_mixer_action.sql @@ -0,0 +1,20 @@ +-- MES 密炼机动作维护 +CREATE TABLE IF NOT EXISTS `mes_xsl_mixer_action` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `equipment_id` varchar(32) NOT NULL COMMENT '设备台账ID(mes_xsl_equipment_ledger.id)', + `equipment_name` varchar(500) NOT NULL COMMENT '设备名称冗余', + `action_name` varchar(500) NOT NULL COMMENT '动作名称(同租户未删除数据中唯一)', + `action_code` varchar(500) NOT NULL COMMENT '动作代号(同租户未删除数据中唯一)', + `remark` varchar(1000) DEFAULT NULL COMMENT '备注', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门', + `create_by` varchar(500) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(500) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mxma_equipment` (`equipment_id`), + KEY `idx_mxma_tenant_action_name` (`tenant_id`, `action_name`, `del_flag`), + KEY `idx_mxma_tenant_action_code` (`tenant_id`, `action_code`, `del_flag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼机动作维护'; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_78__mes_xsl_day_tank_material_map.sql b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_78__mes_xsl_day_tank_material_map.sql new file mode 100644 index 0000000..98755eb --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/flyway/sql/mysql/V3.9.2_78__mes_xsl_day_tank_material_map.sql @@ -0,0 +1,24 @@ +-- MES 日罐物料对应信息 +CREATE TABLE IF NOT EXISTS `mes_xsl_day_tank_material_map` ( + `id` varchar(32) NOT NULL COMMENT '主键', + `equipment_id` varchar(32) NOT NULL COMMENT '设备台账ID(mes_xsl_equipment_ledger.id)', + `machine_code` varchar(500) DEFAULT NULL COMMENT '机台代码(设备编号冗余)', + `machine_name` varchar(500) DEFAULT NULL COMMENT '机台名称冗余', + `silo_category_id` varchar(32) DEFAULT NULL COMMENT '料仓分类ID(sys_category.id)', + `station` varchar(500) DEFAULT NULL COMMENT '工位', + `silo_no` varchar(500) DEFAULT NULL COMMENT '料仓号', + `material_id` varchar(32) NOT NULL COMMENT '物料ID(mes_material.id)', + `material_name` varchar(500) DEFAULT NULL COMMENT '物料名称冗余', + `use_status` int DEFAULT 1 COMMENT '使用状态:1使用中 0停用', + `allow_sync` int DEFAULT 1 COMMENT '是否允许同步:1允许 0不允许', + `tenant_id` int DEFAULT NULL COMMENT '租户', + `sys_org_code` varchar(500) DEFAULT NULL COMMENT '部门', + `create_by` varchar(500) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(500) DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `del_flag` int DEFAULT '0' COMMENT '删除标记(0正常1删除)', + PRIMARY KEY (`id`), + KEY `idx_mxdtm_equipment` (`equipment_id`), + KEY `idx_mxdtm_material` (`material_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES日罐物料对应信息'; diff --git a/jeecgboot-vue3/src/views/mes/daytankmaterialmapinfo/index.vue b/jeecgboot-vue3/src/views/mes/daytankmaterialmapinfo/index.vue new file mode 100644 index 0000000..28080f7 --- /dev/null +++ b/jeecgboot-vue3/src/views/mes/daytankmaterialmapinfo/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/jeecgboot-vue3/src/views/mes/mixeractioninfo/index.vue b/jeecgboot-vue3/src/views/mes/mixeractioninfo/index.vue new file mode 100644 index 0000000..1f95594 --- /dev/null +++ b/jeecgboot-vue3/src/views/mes/mixeractioninfo/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.api.ts b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.api.ts new file mode 100644 index 0000000..378a6f2 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.api.ts @@ -0,0 +1,28 @@ +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/xslmes/mesXslDayTankMaterialMap/list', + save = '/xslmes/mesXslDayTankMaterialMap/add', + edit = '/xslmes/mesXslDayTankMaterialMap/edit', + deleteOne = '/xslmes/mesXslDayTankMaterialMap/delete', + deleteBatch = '/xslmes/mesXslDayTankMaterialMap/deleteBatch', + queryById = '/xslmes/mesXslDayTankMaterialMap/queryById', + exportXls = '/xslmes/mesXslDayTankMaterialMap/exportXls', + equipmentQueryById = '/xslmes/mesXslEquipmentLedger/queryById', +} + +export const list = (params) => defHttp.get({ url: Api.list, params }); + +export const deleteOne = (params, handleSuccess) => + defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess()); + +export const batchDelete = (params, handleSuccess) => + defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess()); + +export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params }); + +export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); + +export const queryEquipmentById = (params: { id: string }) => defHttp.get({ url: Api.equipmentQueryById, params }); + +export const getExportUrl = Api.exportXls; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.data.ts new file mode 100644 index 0000000..a4e7f03 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMap.data.ts @@ -0,0 +1,154 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { loadTreeData } from '/@/api/common/api'; +import { queryEquipmentById } from './MesXslDayTankMaterialMap.api'; + +function useStatusText(v: unknown) { + if (v === 1) return '使用中'; + if (v === 0) return '停用'; + return '-'; +} + +function allowSyncText(v: unknown) { + if (v === 1) return '允许'; + if (v === 0) return '不允许'; + return '-'; +} + +const useStatusOptions = [ + { label: '使用中', value: 1 }, + { label: '停用', value: 0 }, +]; + +const allowSyncOptions = [ + { label: '允许', value: 1 }, + { label: '不允许', value: 0 }, +]; + +export const columns: BasicColumn[] = [ + { title: '机台代码', align: 'center', dataIndex: 'machineCode', width: 140 }, + { title: '机台名称', align: 'center', dataIndex: 'equipmentId_dictText', width: 160 }, + { title: '料仓分类', align: 'center', dataIndex: 'siloCategoryId_dictText', width: 140 }, + { title: '工位', align: 'center', dataIndex: 'station', width: 120 }, + { title: '料仓号', align: 'center', dataIndex: 'siloNo', width: 120 }, + { title: '物料名称', align: 'center', dataIndex: 'materialId_dictText', width: 160 }, + { + title: '使用状态', + align: 'center', + dataIndex: 'useStatus', + width: 120, + customRender: ({ text }) => useStatusText(text), + }, + { + title: '是否允许同步', + align: 'center', + dataIndex: 'allowSync', + width: 120, + customRender: ({ text }) => allowSyncText(text), + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + label: '机台名称', + field: 'equipmentId', + component: 'JDictSelectTag', + componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id' }, + colProps: { span: 6 }, + }, + { + label: '物料名称', + field: 'materialId', + component: 'JDictSelectTag', + componentProps: { dictCode: 'mes_material,material_name,id' }, + colProps: { span: 6 }, + }, + { + label: '料仓分类', + field: 'siloCategoryId', + component: 'ApiSelect', + componentProps: { + api: loadTreeData, + params: { pcode: 'XSLMES_LCTYPE' }, + resultField: '', + labelField: 'title', + valueField: 'key', + placeholder: '请选择料仓分类', + }, + colProps: { span: 6 }, + }, + { + label: '使用状态', + field: 'useStatus', + component: 'Select', + componentProps: { options: useStatusOptions }, + colProps: { span: 6 }, + }, +]; + +export const formSchema: FormSchema[] = [ + { label: '', field: 'id', component: 'Input', show: false }, + { + label: '机台名称', + field: 'equipmentId', + component: 'JDictSelectTag', + required: true, + componentProps: ({ formModel }) => ({ + dictCode: 'mes_xsl_equipment_ledger,equipment_name,id', + placeholder: '请选择设备台账中的机台名称', + onChange: async (value: string) => { + if (!value) { + formModel.machineCode = ''; + return; + } + try { + const equipment = await queryEquipmentById({ id: value }); + formModel.machineCode = equipment?.equipmentCode || ''; + } catch { + formModel.machineCode = ''; + } + }, + }), + }, + { + label: '机台代码', + field: 'machineCode', + component: 'Input', + componentProps: { disabled: true, placeholder: '选择机台名称后自动带出设备编号' }, + }, + { + label: '料仓分类', + field: 'siloCategoryId', + component: 'ApiSelect', + componentProps: { + api: loadTreeData, + params: { pcode: 'XSLMES_LCTYPE' }, + resultField: '', + labelField: 'title', + valueField: 'key', + placeholder: '请选择料仓分类', + }, + }, + { label: '工位', field: 'station', component: 'Input' }, + { label: '料仓号', field: 'siloNo', component: 'Input' }, + { + label: '物料名称', + field: 'materialId', + component: 'JDictSelectTag', + required: true, + componentProps: { dictCode: 'mes_material,material_name,id', placeholder: '请选择胶料信息中的物料名称' }, + }, + { + label: '使用状态', + field: 'useStatus', + component: 'Select', + defaultValue: 1, + componentProps: { options: useStatusOptions }, + }, + { + label: '是否允许同步', + field: 'allowSync', + component: 'Select', + defaultValue: 1, + componentProps: { options: allowSyncOptions }, + }, +]; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMapList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMapList.vue new file mode 100644 index 0000000..288c4d0 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/MesXslDayTankMaterialMapList.vue @@ -0,0 +1,84 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/modules/MesXslDayTankMaterialMapModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/modules/MesXslDayTankMaterialMapModal.vue new file mode 100644 index 0000000..11a2196 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslDayTankMaterialMap/modules/MesXslDayTankMaterialMapModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.api.ts b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.api.ts new file mode 100644 index 0000000..a9f342b --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.api.ts @@ -0,0 +1,33 @@ +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/xslmes/mesXslMixerAction/list', + checkActionName = '/xslmes/mesXslMixerAction/checkActionName', + checkActionCode = '/xslmes/mesXslMixerAction/checkActionCode', + save = '/xslmes/mesXslMixerAction/add', + edit = '/xslmes/mesXslMixerAction/edit', + deleteOne = '/xslmes/mesXslMixerAction/delete', + deleteBatch = '/xslmes/mesXslMixerAction/deleteBatch', + queryById = '/xslmes/mesXslMixerAction/queryById', + exportXls = '/xslmes/mesXslMixerAction/exportXls', +} + +export const list = (params) => defHttp.get({ url: Api.list, params }); + +export const checkActionName = (params: { actionName: string; dataId?: string }) => + defHttp.get({ url: Api.checkActionName, params }, { successMessageMode: 'none', errorMessageMode: 'none' }); + +export const checkActionCode = (params: { actionCode: string; dataId?: string }) => + defHttp.get({ url: Api.checkActionCode, params }, { successMessageMode: 'none', errorMessageMode: 'none' }); + +export const deleteOne = (params, handleSuccess) => + defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess()); + +export const batchDelete = (params, handleSuccess) => + defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess()); + +export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params }); + +export const queryById = (params) => defHttp.get({ url: Api.queryById, params }); + +export const getExportUrl = Api.exportXls; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.data.ts new file mode 100644 index 0000000..816f0cd --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerAction.data.ts @@ -0,0 +1,76 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { checkActionCode, checkActionName } from './MesXslMixerAction.api'; + +export const columns: BasicColumn[] = [ + { title: '设备名称', align: 'center', dataIndex: 'equipmentId_dictText', width: 180 }, + { title: '动作名称', align: 'center', dataIndex: 'actionName', width: 180 }, + { title: '动作代号', align: 'center', dataIndex: 'actionCode', width: 160 }, + { title: '创建时间', align: 'center', dataIndex: 'createTime', width: 170 }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + label: '设备名称', + field: 'equipmentId', + component: 'JDictSelectTag', + componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id' }, + colProps: { span: 6 }, + }, + { label: '动作名称', field: 'actionName', component: 'Input', colProps: { span: 6 } }, + { label: '动作代号', field: 'actionCode', component: 'Input', colProps: { span: 6 } }, +]; + +export const formSchema: FormSchema[] = [ + { label: '', field: 'id', component: 'Input', show: false }, + { + label: '设备名称', + field: 'equipmentId', + component: 'JDictSelectTag', + required: true, + componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id', placeholder: '请选择设备台账中的设备' }, + }, + { + label: '动作名称', + field: 'actionName', + component: 'Input', + required: true, + dynamicRules: ({ model }) => [ + { required: true, message: '请输入动作名称' }, + { + validator: async (_rule, value) => { + const v = value == null ? '' : String(value).trim(); + if (!v) return Promise.resolve(); + try { + await checkActionName({ actionName: v, dataId: model?.id }); + return Promise.resolve(); + } catch (e: any) { + return Promise.reject(e?.response?.data?.message || e?.message || '动作名称不能重复'); + } + }, + trigger: 'blur', + }, + ], + }, + { + label: '动作代号', + field: 'actionCode', + component: 'Input', + required: true, + dynamicRules: ({ model }) => [ + { required: true, message: '请输入动作代号' }, + { + validator: async (_rule, value) => { + const v = value == null ? '' : String(value).trim(); + if (!v) return Promise.resolve(); + try { + await checkActionCode({ actionCode: v, dataId: model?.id }); + return Promise.resolve(); + } catch (e: any) { + return Promise.reject(e?.response?.data?.message || e?.message || '动作代号不能重复'); + } + }, + trigger: 'blur', + }, + ], + }, +]; diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerActionList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerActionList.vue new file mode 100644 index 0000000..e67c0b2 --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/MesXslMixerActionList.vue @@ -0,0 +1,84 @@ + + + diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/modules/MesXslMixerActionModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/modules/MesXslMixerActionModal.vue new file mode 100644 index 0000000..fc5ebac --- /dev/null +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixerAction/modules/MesXslMixerActionModal.vue @@ -0,0 +1,48 @@ + + +