密炼机动作维护、日罐物料对应关系

This commit is contained in:
2026-05-21 10:04:06 +08:00
parent 09c58f80eb
commit e678276aba
24 changed files with 1443 additions and 0 deletions

View File

@@ -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';

View File

@@ -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';

View File

@@ -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<MesXslDayTankMaterialMap, IMesXslDayTankMaterialMapService> {
@Autowired private IMesXslDayTankMaterialMapService dayTankMaterialMapService;
@Operation(summary = "日罐物料对应信息-分页列表查询")
@GetMapping("/list")
public Result<IPage<MesXslDayTankMaterialMap>> queryPageList(
MesXslDayTankMaterialMap model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslDayTankMaterialMap> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
IPage<MesXslDayTankMaterialMap> 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<String> 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<String> 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<String> 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<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
dayTankMaterialMapService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "日罐物料对应信息-通过id查询")
@GetMapping("/queryById")
public Result<MesXslDayTankMaterialMap> 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;
}
}

View File

@@ -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<MesXslMixerAction, IMesXslMixerActionService> {
@Autowired private IMesXslMixerActionService mesXslMixerActionService;
@Operation(summary = "密炼机动作维护-分页列表查询")
@GetMapping("/list")
public Result<IPage<MesXslMixerAction>> queryPageList(
MesXslMixerAction model,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MesXslMixerAction> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
IPage<MesXslMixerAction> 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<String> 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<String> 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<String> 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<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
mesXslMixerActionService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@Operation(summary = "密炼机动作维护-通过id查询")
@GetMapping("/queryById")
public Result<MesXslMixerAction> 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<String> 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<String> 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;
}
}

View File

@@ -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;
}

View File

@@ -0,0 +1,68 @@
package org.jeecg.modules.xslmes.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.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;
}

View File

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

View File

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

View File

@@ -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<MesXslDayTankMaterialMap> {
/**
* 由选择类字段ID回填冗余展示信息机台代码/机台名称/物料名称)
*/
void fillReferenceFields(MesXslDayTankMaterialMap model);
}

View File

@@ -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<MesXslMixerAction> {
boolean isActionNameDuplicated(String actionName, String excludeId);
boolean isActionCodeDuplicated(String actionCode, String excludeId);
void fillEquipmentName(MesXslMixerAction model);
}

View File

@@ -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<MesXslDayTankMaterialMapMapper, MesXslDayTankMaterialMap>
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());
}
}

View File

@@ -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<MesXslMixerActionMapper, MesXslMixerAction>
implements IMesXslMixerActionService {
@Autowired private MesXslEquipmentLedgerMapper equipmentLedgerMapper;
@Override
public boolean isActionNameDuplicated(String actionName, String excludeId) {
if (StringUtils.isBlank(actionName)) {
return false;
}
LambdaQueryWrapper<MesXslMixerAction> wrapper =
new LambdaQueryWrapper<MesXslMixerAction>().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<MesXslMixerAction> wrapper =
new LambdaQueryWrapper<MesXslMixerAction>().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());
}
}

View File

@@ -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 '设备台账IDmes_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密炼机动作维护';

View File

@@ -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 '设备台账IDmes_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 '料仓分类IDsys_category.id',
`station` varchar(500) DEFAULT NULL COMMENT '工位',
`silo_no` varchar(500) DEFAULT NULL COMMENT '料仓号',
`material_id` varchar(32) NOT NULL COMMENT '物料IDmes_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日罐物料对应信息';