密炼物料信息
This commit is contained in:
@@ -87,6 +87,25 @@ 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 ('1860000000000000051', '1860000000000000001', '密炼物料信息', '/mes/mixermaterialinfo', 'mes/mixermaterialinfo/index', 'MesMixerMaterialList', 1, NULL, '1', 5, 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
|
||||
('1860000000000000052','1860000000000000051','新增',2,'mes:mes_mixer_material:add','1','1',0,'admin',NOW()),
|
||||
('1860000000000000053','1860000000000000051','编辑',2,'mes:mes_mixer_material:edit','1','1',0,'admin',NOW()),
|
||||
('1860000000000000054','1860000000000000051','删除',2,'mes:mes_mixer_material:delete','1','1',0,'admin',NOW()),
|
||||
('1860000000000000055','1860000000000000051','批量删除',2,'mes:mes_mixer_material:deleteBatch','1','1',0,'admin',NOW()),
|
||||
('1860000000000000056','1860000000000000051','导出',2,'mes:mes_mixer_material:exportXls','1','1',0,'admin',NOW()),
|
||||
('1860000000000000057','1860000000000000051','导入',2,'mes:mes_mixer_material:importExcel','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'
|
||||
@@ -96,7 +115,8 @@ WHERE p.id IN (
|
||||
'1860000000000000011','1860000000000000012','1860000000000000013','1860000000000000014','1860000000000000015','1860000000000000016','1860000000000000017',
|
||||
'1860000000000000021','1860000000000000022','1860000000000000023','1860000000000000024','1860000000000000025','1860000000000000026','1860000000000000027',
|
||||
'1860000000000000031','1860000000000000032','1860000000000000033','1860000000000000034','1860000000000000035','1860000000000000036','1860000000000000037',
|
||||
'1860000000000000041','1860000000000000042','1860000000000000043','1860000000000000044','1860000000000000045','1860000000000000046','1860000000000000047'
|
||||
'1860000000000000041','1860000000000000042','1860000000000000043','1860000000000000044','1860000000000000045','1860000000000000046','1860000000000000047',
|
||||
'1860000000000000051','1860000000000000052','1860000000000000053','1860000000000000054','1860000000000000055','1860000000000000056','1860000000000000057'
|
||||
) AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_role_permission rp
|
||||
@@ -125,5 +145,6 @@ WHERE id IN (
|
||||
'1860000000000000011',
|
||||
'1860000000000000021',
|
||||
'1860000000000000031',
|
||||
'1860000000000000041'
|
||||
'1860000000000000041',
|
||||
'1860000000000000051'
|
||||
);
|
||||
|
||||
30
jeecg-boot/db/mes-mixer-material.sql
Normal file
30
jeecg-boot/db/mes-mixer-material.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- 密炼物料信息表(菜单与权限已合并进 db/mes-material-menu.sql)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mes_mixer_material` (
|
||||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||||
`material_code` varchar(64) DEFAULT NULL COMMENT '物料编码',
|
||||
`material_name` varchar(200) DEFAULT NULL COMMENT '物料名称',
|
||||
`erp_code` varchar(64) DEFAULT NULL COMMENT 'ERP编号',
|
||||
`major_category_id` varchar(32) DEFAULT NULL COMMENT '物料大类',
|
||||
`minor_category_id` varchar(32) DEFAULT NULL COMMENT '物料小类',
|
||||
`material_desc` varchar(500) DEFAULT NULL COMMENT '物料描述',
|
||||
`alias_name` varchar(200) DEFAULT NULL COMMENT '物料别名',
|
||||
`feed_manage_status` int DEFAULT NULL COMMENT '投管状态:1在投管 0未投管',
|
||||
`use_status` int DEFAULT NULL COMMENT '使用状态:1使用中 0停用',
|
||||
`specific_gravity` decimal(18,6) DEFAULT NULL COMMENT '比重',
|
||||
`shelf_life_days` int DEFAULT NULL COMMENT '保质期(天)',
|
||||
`min_bake_minutes` int DEFAULT NULL COMMENT '最短烘胶时间(分钟)',
|
||||
`total_safety_stock_kg` decimal(18,4) DEFAULT NULL COMMENT '总安全库存KG',
|
||||
`qualified_safety_stock_kg` decimal(18,4) DEFAULT NULL COMMENT '合格品安全库存KG',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`tenant_id` int DEFAULT NULL COMMENT '租户',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '部门',
|
||||
`create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` int DEFAULT '0' COMMENT '删除标记',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_mixer_material_code` (`material_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='MES密炼物料信息';
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.jeecg.modules.mes.material.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 jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-密炼物料信息")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/mixerMaterial")
|
||||
public class MesMixerMaterialController extends JeecgController<MesMixerMaterial, IMesMixerMaterialService> {
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesMixerMaterial>> queryPageList(
|
||||
MesMixerMaterial model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesMixerMaterial> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesMixerMaterial> pageList = service.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-添加")
|
||||
@Operation(summary = "MES-密炼物料信息-添加")
|
||||
@RequiresPermissions("mes:mes_mixer_material:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMixerMaterial model) {
|
||||
service.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-编辑")
|
||||
@Operation(summary = "MES-密炼物料信息-编辑")
|
||||
@RequiresPermissions("mes:mes_mixer_material:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMixerMaterial model) {
|
||||
service.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-通过id删除")
|
||||
@Operation(summary = "MES-密炼物料信息-通过id删除")
|
||||
@RequiresPermissions("mes:mes_mixer_material:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
service.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-密炼物料信息-批量删除")
|
||||
@Operation(summary = "MES-密炼物料信息-批量删除")
|
||||
@RequiresPermissions("mes:mes_mixer_material:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
service.removeByIds(idList);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesMixerMaterial> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(service.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_mixer_material:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMixerMaterial model) {
|
||||
return super.exportXls(request, model, MesMixerMaterial.class, "MES密炼物料信息");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_mixer_material:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesMixerMaterial.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.jeecg.modules.mes.material.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.math.BigDecimal;
|
||||
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;
|
||||
|
||||
@Data
|
||||
@TableName("mes_mixer_material")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES密炼物料信息")
|
||||
public class MesMixerMaterial implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "物料编码", width = 15)
|
||||
private String materialCode;
|
||||
@Excel(name = "物料名称", width = 20)
|
||||
private String materialName;
|
||||
@Excel(name = "ERP编号", width = 15)
|
||||
private String erpCode;
|
||||
|
||||
@Excel(name = "物料大类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
private String majorCategoryId;
|
||||
|
||||
@Excel(name = "物料小类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
|
||||
private String minorCategoryId;
|
||||
|
||||
@Excel(name = "物料描述", width = 25)
|
||||
private String materialDesc;
|
||||
@Excel(name = "物料别名", width = 15)
|
||||
private String aliasName;
|
||||
|
||||
@Excel(name = "投管状态", width = 12, replace = {"在投管_1", "未投管_0"})
|
||||
private Integer feedManageStatus;
|
||||
@Excel(name = "使用状态", width = 12, replace = {"使用中_1", "停用_0"})
|
||||
private Integer useStatus;
|
||||
|
||||
@Excel(name = "比重", width = 10)
|
||||
private BigDecimal specificGravity;
|
||||
@Excel(name = "保质期(天)", width = 12)
|
||||
private Integer shelfLifeDays;
|
||||
@Excel(name = "最短烘胶时间(分钟)", width = 18)
|
||||
private Integer minBakeMinutes;
|
||||
@Excel(name = "总安全库存KG", width = 14)
|
||||
private BigDecimal totalSafetyStockKg;
|
||||
@Excel(name = "合格品安全库存KG", width = 16)
|
||||
private BigDecimal qualifiedSafetyStockKg;
|
||||
|
||||
@Excel(name = "备注", width = 20)
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.mes.material.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
|
||||
public interface MesMixerMaterialMapper extends BaseMapper<MesMixerMaterial> {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.jeecg.modules.mes.material.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
|
||||
public interface IMesMixerMaterialService extends IService<MesMixerMaterial> {}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.jeecg.modules.mes.material.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.mes.material.entity.MesMixerMaterial;
|
||||
import org.jeecg.modules.mes.material.mapper.MesMixerMaterialMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesMixerMaterialService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesMixerMaterialServiceImpl extends ServiceImpl<MesMixerMaterialMapper, MesMixerMaterial>
|
||||
implements IMesMixerMaterialService {}
|
||||
Reference in New Issue
Block a user