物料模块
This commit is contained in:
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic",
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable"
|
||||
}
|
||||
86
jeecg-boot/db/mes-material-menu.sql
Normal file
86
jeecg-boot/db/mes-material-menu.sql
Normal file
@@ -0,0 +1,86 @@
|
||||
-- MES 物料模块菜单与权限(JeecgBoot)
|
||||
-- 执行前可按需改 ID;默认授权 admin 角色(role_id=f6817f48af4fb3af11b9e8bf182f618b)
|
||||
|
||||
-- 一级菜单:MES管理
|
||||
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, always_show, keep_alive, internal_or_external, create_by, create_time)
|
||||
VALUES ('1860000000000000001', NULL, 'MES管理', '/mes', 'layouts/RouteView', 'MesRoot', 0, NULL, '1', 50, 0, 0, 0, '1', 0, 1, 0, 0, 'admin', NOW());
|
||||
|
||||
-- 二级菜单:物料信息
|
||||
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 ('1860000000000000011', '1860000000000000001', '物料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW());
|
||||
INSERT INTO sys_permission(id,parent_id,name,menu_type,perms,perms_type,status,del_flag,create_by,create_time) VALUES
|
||||
('1860000000000000012','1860000000000000011','新增',2,'mes:mes_material:add','1','1',0,'admin',NOW()),
|
||||
('1860000000000000013','1860000000000000011','编辑',2,'mes:mes_material:edit','1','1',0,'admin',NOW()),
|
||||
('1860000000000000014','1860000000000000011','删除',2,'mes:mes_material:delete','1','1',0,'admin',NOW()),
|
||||
('1860000000000000015','1860000000000000011','批量删除',2,'mes:mes_material:deleteBatch','1','1',0,'admin',NOW()),
|
||||
('1860000000000000016','1860000000000000011','导出',2,'mes:mes_material:exportXls','1','1',0,'admin',NOW()),
|
||||
('1860000000000000017','1860000000000000011','导入',2,'mes:mes_material:importExcel','1','1',0,'admin',NOW());
|
||||
|
||||
-- 二级菜单:单位信息
|
||||
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 ('1860000000000000021', '1860000000000000001', '单位信息', '/mes/materialunit', 'mes/materialunit/index', 'MesUnitList', 1, NULL, '1', 2, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW());
|
||||
INSERT INTO sys_permission(id,parent_id,name,menu_type,perms,perms_type,status,del_flag,create_by,create_time) VALUES
|
||||
('1860000000000000022','1860000000000000021','新增',2,'mes:mes_unit:add','1','1',0,'admin',NOW()),
|
||||
('1860000000000000023','1860000000000000021','编辑',2,'mes:mes_unit:edit','1','1',0,'admin',NOW()),
|
||||
('1860000000000000024','1860000000000000021','删除',2,'mes:mes_unit:delete','1','1',0,'admin',NOW()),
|
||||
('1860000000000000025','1860000000000000021','批量删除',2,'mes:mes_unit:deleteBatch','1','1',0,'admin',NOW()),
|
||||
('1860000000000000026','1860000000000000021','导出',2,'mes:mes_unit:exportXls','1','1',0,'admin',NOW()),
|
||||
('1860000000000000027','1860000000000000021','导入',2,'mes:mes_unit:importExcel','1','1',0,'admin',NOW());
|
||||
|
||||
-- 二级菜单:物料分类
|
||||
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 ('1860000000000000031', '1860000000000000001', '物料分类', '/mes/materialcategory', 'mes/materialcategory/index', 'MesMaterialCategoryList', 1, NULL, '1', 3, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW());
|
||||
INSERT INTO sys_permission(id,parent_id,name,menu_type,perms,perms_type,status,del_flag,create_by,create_time) VALUES
|
||||
('1860000000000000032','1860000000000000031','新增',2,'mes:mes_material_category:add','1','1',0,'admin',NOW()),
|
||||
('1860000000000000033','1860000000000000031','编辑',2,'mes:mes_material_category:edit','1','1',0,'admin',NOW()),
|
||||
('1860000000000000034','1860000000000000031','删除',2,'mes:mes_material_category:delete','1','1',0,'admin',NOW()),
|
||||
('1860000000000000035','1860000000000000031','批量删除',2,'mes:mes_material_category:deleteBatch','1','1',0,'admin',NOW()),
|
||||
('1860000000000000036','1860000000000000031','导出',2,'mes:mes_material_category:exportXls','1','1',0,'admin',NOW()),
|
||||
('1860000000000000037','1860000000000000031','导入',2,'mes:mes_material_category:importExcel','1','1',0,'admin',NOW());
|
||||
|
||||
-- 二级菜单:ERP映射
|
||||
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 ('1860000000000000041', '1860000000000000001', 'ERP映射', '/mes/materialerpmap', 'mes/materialerpmap/index', 'MesMaterialErpMapList', 1, NULL, '1', 4, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW());
|
||||
INSERT INTO sys_permission(id,parent_id,name,menu_type,perms,perms_type,status,del_flag,create_by,create_time) VALUES
|
||||
('1860000000000000042','1860000000000000041','新增',2,'mes:mes_material_erp_map:add','1','1',0,'admin',NOW()),
|
||||
('1860000000000000043','1860000000000000041','编辑',2,'mes:mes_material_erp_map:edit','1','1',0,'admin',NOW()),
|
||||
('1860000000000000044','1860000000000000041','删除',2,'mes:mes_material_erp_map:delete','1','1',0,'admin',NOW()),
|
||||
('1860000000000000045','1860000000000000041','批量删除',2,'mes:mes_material_erp_map:deleteBatch','1','1',0,'admin',NOW()),
|
||||
('1860000000000000046','1860000000000000041','导出',2,'mes:mes_material_erp_map:exportXls','1','1',0,'admin',NOW()),
|
||||
('1860000000000000047','1860000000000000041','导入',2,'mes:mes_material_erp_map:importExcel','1','1',0,'admin',NOW());
|
||||
|
||||
-- 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 (
|
||||
'1860000000000000001',
|
||||
'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'
|
||||
);
|
||||
|
||||
-- ======================================================
|
||||
-- 修复项:菜单组件引用错误导致页面空白
|
||||
-- ======================================================
|
||||
UPDATE sys_permission
|
||||
SET component = 'layouts/RouteView',
|
||||
is_leaf = 0,
|
||||
is_route = 0,
|
||||
redirect = NULL,
|
||||
hidden = 0,
|
||||
menu_type = 0
|
||||
WHERE id = '1860000000000000001';
|
||||
|
||||
UPDATE sys_permission
|
||||
SET is_leaf = 1,
|
||||
is_route = 1,
|
||||
hidden = 0,
|
||||
menu_type = 1
|
||||
WHERE id IN (
|
||||
'1860000000000000011',
|
||||
'1860000000000000021',
|
||||
'1860000000000000031',
|
||||
'1860000000000000041'
|
||||
);
|
||||
@@ -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 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.MesMaterialCategory;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialCategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-物料分类")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/category")
|
||||
public class MesMaterialCategoryController extends JeecgController<MesMaterialCategory, IMesMaterialCategoryService> {
|
||||
@Autowired private IMesMaterialCategoryService mesMaterialCategoryService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesMaterialCategory>> queryPageList(
|
||||
MesMaterialCategory model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesMaterialCategory> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesMaterialCategory> pageList = mesMaterialCategoryService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料分类-添加")
|
||||
@Operation(summary = "MES-物料分类-添加")
|
||||
@RequiresPermissions("mes:mes_material_category:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMaterialCategory model) {
|
||||
mesMaterialCategoryService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料分类-编辑")
|
||||
@Operation(summary = "MES-物料分类-编辑")
|
||||
@RequiresPermissions("mes:mes_material_category:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMaterialCategory model) {
|
||||
mesMaterialCategoryService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料分类-通过id删除")
|
||||
@Operation(summary = "MES-物料分类-通过id删除")
|
||||
@RequiresPermissions("mes:mes_material_category:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
mesMaterialCategoryService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料分类-批量删除")
|
||||
@Operation(summary = "MES-物料分类-批量删除")
|
||||
@RequiresPermissions("mes:mes_material_category:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
mesMaterialCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesMaterialCategory> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(mesMaterialCategoryService.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material_category:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMaterialCategory model) {
|
||||
return super.exportXls(request, model, MesMaterialCategory.class, "MES物料分类");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material_category:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesMaterialCategory.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-物料信息")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/material")
|
||||
public class MesMaterialController extends JeecgController<MesMaterial, IMesMaterialService> {
|
||||
@Autowired private IMesMaterialService mesMaterialService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesMaterial>> queryPageList(
|
||||
MesMaterial model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesMaterial> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesMaterial> pageList = mesMaterialService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-添加")
|
||||
@Operation(summary = "MES-物料信息-添加")
|
||||
@RequiresPermissions("mes:mes_material:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMaterial model) {
|
||||
mesMaterialService.save(model);
|
||||
mesMaterialService.notifyMaterialChanged("material.created", model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-编辑")
|
||||
@Operation(summary = "MES-物料信息-编辑")
|
||||
@RequiresPermissions("mes:mes_material:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMaterial model) {
|
||||
mesMaterialService.updateById(model);
|
||||
mesMaterialService.notifyMaterialChanged("material.updated", model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-通过id删除")
|
||||
@Operation(summary = "MES-物料信息-通过id删除")
|
||||
@RequiresPermissions("mes:mes_material:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
MesMaterial model = mesMaterialService.getById(id);
|
||||
mesMaterialService.removeById(id);
|
||||
if (model != null) {
|
||||
mesMaterialService.notifyMaterialChanged("material.disabled", model);
|
||||
}
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料信息-批量删除")
|
||||
@Operation(summary = "MES-物料信息-批量删除")
|
||||
@RequiresPermissions("mes:mes_material:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
List<MesMaterial> deletedMaterials = mesMaterialService.listByIds(idList);
|
||||
mesMaterialService.removeByIds(idList);
|
||||
for (MesMaterial material : deletedMaterials) {
|
||||
mesMaterialService.notifyMaterialChanged("material.disabled", material);
|
||||
}
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesMaterial> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(mesMaterialService.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMaterial model) {
|
||||
return super.exportXls(request, model, MesMaterial.class, "MES物料信息");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesMaterial.class);
|
||||
}
|
||||
}
|
||||
@@ -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 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.MesMaterialErpMap;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialErpMapService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-物料ERP映射")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/erpMap")
|
||||
public class MesMaterialErpMapController extends JeecgController<MesMaterialErpMap, IMesMaterialErpMapService> {
|
||||
@Autowired private IMesMaterialErpMapService mesMaterialErpMapService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesMaterialErpMap>> queryPageList(
|
||||
MesMaterialErpMap model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesMaterialErpMap> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesMaterialErpMap> pageList = mesMaterialErpMapService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料ERP映射-添加")
|
||||
@Operation(summary = "MES-物料ERP映射-添加")
|
||||
@RequiresPermissions("mes:mes_material_erp_map:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesMaterialErpMap model) {
|
||||
mesMaterialErpMapService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料ERP映射-编辑")
|
||||
@Operation(summary = "MES-物料ERP映射-编辑")
|
||||
@RequiresPermissions("mes:mes_material_erp_map:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesMaterialErpMap model) {
|
||||
mesMaterialErpMapService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料ERP映射-通过id删除")
|
||||
@Operation(summary = "MES-物料ERP映射-通过id删除")
|
||||
@RequiresPermissions("mes:mes_material_erp_map:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
mesMaterialErpMapService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-物料ERP映射-批量删除")
|
||||
@Operation(summary = "MES-物料ERP映射-批量删除")
|
||||
@RequiresPermissions("mes:mes_material_erp_map:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
mesMaterialErpMapService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesMaterialErpMap> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(mesMaterialErpMapService.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material_erp_map:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesMaterialErpMap model) {
|
||||
return super.exportXls(request, model, MesMaterialErpMap.class, "MES物料ERP映射");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_material_erp_map:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesMaterialErpMap.class);
|
||||
}
|
||||
}
|
||||
@@ -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 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.MesUnit;
|
||||
import org.jeecg.modules.mes.material.service.IMesUnitService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "MES-单位信息")
|
||||
@RestController
|
||||
@RequestMapping("/mes/material/unit")
|
||||
public class MesUnitController extends JeecgController<MesUnit, IMesUnitService> {
|
||||
@Autowired private IMesUnitService mesUnitService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<IPage<MesUnit>> queryPageList(
|
||||
MesUnit model,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<MesUnit> queryWrapper = QueryGenerator.initQueryWrapper(model, req.getParameterMap());
|
||||
IPage<MesUnit> pageList = mesUnitService.page(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-单位信息-添加")
|
||||
@Operation(summary = "MES-单位信息-添加")
|
||||
@RequiresPermissions("mes:mes_unit:add")
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody MesUnit model) {
|
||||
mesUnitService.save(model);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-单位信息-编辑")
|
||||
@Operation(summary = "MES-单位信息-编辑")
|
||||
@RequiresPermissions("mes:mes_unit:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MesUnit model) {
|
||||
mesUnitService.updateById(model);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-单位信息-通过id删除")
|
||||
@Operation(summary = "MES-单位信息-通过id删除")
|
||||
@RequiresPermissions("mes:mes_unit:delete")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id") String id) {
|
||||
mesUnitService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "MES-单位信息-批量删除")
|
||||
@Operation(summary = "MES-单位信息-批量删除")
|
||||
@RequiresPermissions("mes:mes_unit:deleteBatch")
|
||||
@DeleteMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
mesUnitService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping("/queryById")
|
||||
public Result<MesUnit> queryById(@RequestParam(name = "id") String id) {
|
||||
return Result.OK(mesUnitService.getById(id));
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_unit:exportXls")
|
||||
@RequestMapping("/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MesUnit model) {
|
||||
return super.exportXls(request, model, MesUnit.class, "MES单位");
|
||||
}
|
||||
|
||||
@RequiresPermissions("mes:mes_unit:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MesUnit.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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 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.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@TableName("mes_material")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES物料主数据")
|
||||
public class MesMaterial 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 = "别名", width = 15)
|
||||
private String aliasName;
|
||||
@Excel(name = "简称", width = 15)
|
||||
private String shortName;
|
||||
|
||||
@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 categoryId;
|
||||
@Excel(name = "等级", width = 12)
|
||||
private String materialGrade;
|
||||
|
||||
@Excel(name = "计划价格", width = 12)
|
||||
private BigDecimal planPrice;
|
||||
@Excel(name = "最小库存", width = 12)
|
||||
private BigDecimal minStock;
|
||||
@Excel(name = "最大库存", width = 12)
|
||||
private BigDecimal maxStock;
|
||||
|
||||
@Excel(name = "基础单位", width = 15, dictTable = "mes_unit", dicText = "unit_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_unit", dicText = "unit_name", dicCode = "id")
|
||||
private String baseUnitId;
|
||||
@Excel(name = "统计单位", width = 15, dictTable = "mes_unit", dicText = "unit_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_unit", dicText = "unit_name", dicCode = "id")
|
||||
private String statUnitId;
|
||||
@Excel(name = "换算系数", width = 12)
|
||||
private BigDecimal unitConvertRate;
|
||||
|
||||
@Excel(name = "标准码", width = 15)
|
||||
private String standardCode;
|
||||
@Excel(name = "产地", width = 15)
|
||||
private String originPlace;
|
||||
@Excel(name = "供应商ID", width = 15)
|
||||
private String supplierId;
|
||||
@Excel(name = "客户ID", width = 15)
|
||||
private String customerId;
|
||||
@Excel(name = "启用状态", width = 10)
|
||||
private Integer enableFlag;
|
||||
@Excel(name = "ERP同步", width = 10)
|
||||
private Integer syncFromErpFlag;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastErpSyncTime;
|
||||
@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,53 @@
|
||||
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 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.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@TableName("mes_material_category")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES物料分类")
|
||||
public class MesMaterialCategory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "分类编码", width = 15)
|
||||
private String categoryCode;
|
||||
@Excel(name = "分类名称", width = 15)
|
||||
private String categoryName;
|
||||
@Excel(name = "父ID", width = 15)
|
||||
private String parentId;
|
||||
@Excel(name = "树路径", width = 20)
|
||||
private String treePath;
|
||||
@Excel(name = "排序", width = 10)
|
||||
private Integer sortNo;
|
||||
@Excel(name = "启用状态", width = 10)
|
||||
private Integer enableFlag;
|
||||
@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,56 @@
|
||||
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 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.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@TableName("mes_material_erp_map")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES物料ERP映射")
|
||||
public class MesMaterialErpMap implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "物料", width = 15, dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
@Dict(dictTable = "mes_material", dicText = "material_name", dicCode = "id")
|
||||
private String materialId;
|
||||
@Excel(name = "ERP系统", width = 12)
|
||||
private String erpSystemCode;
|
||||
@Excel(name = "ERP物料编码", width = 15)
|
||||
private String erpMaterialCode;
|
||||
@Excel(name = "ERP物料名称", width = 20)
|
||||
private String erpMaterialName;
|
||||
@Excel(name = "映射状态", width = 10)
|
||||
private Integer mappingStatus;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastSyncTime;
|
||||
@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,51 @@
|
||||
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 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.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@TableName("mes_unit")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "MES单位")
|
||||
public class MesUnit implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "单位编码", width = 15)
|
||||
private String unitCode;
|
||||
@Excel(name = "单位名称", width = 15)
|
||||
private String unitName;
|
||||
@Excel(name = "单位类型", width = 15)
|
||||
private String unitType;
|
||||
@Excel(name = "精度", width = 10)
|
||||
private Integer precisionScale;
|
||||
@Excel(name = "启用状态", width = 10)
|
||||
private Integer enableFlag;
|
||||
@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.MesMaterialCategory;
|
||||
|
||||
public interface MesMaterialCategoryMapper extends BaseMapper<MesMaterialCategory> {}
|
||||
@@ -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.MesMaterialErpMap;
|
||||
|
||||
public interface MesMaterialErpMapMapper extends BaseMapper<MesMaterialErpMap> {}
|
||||
@@ -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.MesMaterial;
|
||||
|
||||
public interface MesMaterialMapper extends BaseMapper<MesMaterial> {}
|
||||
@@ -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.MesUnit;
|
||||
|
||||
public interface MesUnitMapper extends BaseMapper<MesUnit> {}
|
||||
@@ -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.MesMaterialCategory;
|
||||
|
||||
public interface IMesMaterialCategoryService extends IService<MesMaterialCategory> {}
|
||||
@@ -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.MesMaterialErpMap;
|
||||
|
||||
public interface IMesMaterialErpMapService extends IService<MesMaterialErpMap> {}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.jeecg.modules.mes.material.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
|
||||
public interface IMesMaterialService extends IService<MesMaterial> {
|
||||
void notifyMaterialChanged(String eventType, MesMaterial material);
|
||||
}
|
||||
@@ -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.MesUnit;
|
||||
|
||||
public interface IMesUnitService extends IService<MesUnit> {}
|
||||
@@ -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.MesMaterialCategory;
|
||||
import org.jeecg.modules.mes.material.mapper.MesMaterialCategoryMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialCategoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesMaterialCategoryServiceImpl extends ServiceImpl<MesMaterialCategoryMapper, MesMaterialCategory>
|
||||
implements IMesMaterialCategoryService {}
|
||||
@@ -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.MesMaterialErpMap;
|
||||
import org.jeecg.modules.mes.material.mapper.MesMaterialErpMapMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialErpMapService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesMaterialErpMapServiceImpl extends ServiceImpl<MesMaterialErpMapMapper, MesMaterialErpMap>
|
||||
implements IMesMaterialErpMapService {}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.jeecg.modules.mes.material.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.jeecg.modules.mes.material.entity.MesMaterial;
|
||||
import org.jeecg.modules.mes.material.mapper.MesMaterialMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesMaterialService;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesMaterialServiceImpl extends ServiceImpl<MesMaterialMapper, MesMaterial> implements IMesMaterialService {
|
||||
|
||||
@Autowired private WebSocket webSocket;
|
||||
|
||||
@Override
|
||||
public void notifyMaterialChanged(String eventType, MesMaterial material) {
|
||||
Map<String, Object> event = new HashMap<>();
|
||||
event.put("eventType", eventType);
|
||||
event.put("materialId", material.getId());
|
||||
event.put("materialCode", material.getMaterialCode());
|
||||
event.put("timestamp", System.currentTimeMillis());
|
||||
webSocket.sendMessage(JSON.toJSONString(event));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.jeecg.modules.mes.material.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.mes.material.entity.MesUnit;
|
||||
import org.jeecg.modules.mes.material.mapper.MesUnitMapper;
|
||||
import org.jeecg.modules.mes.material.service.IMesUnitService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MesUnitServiceImpl extends ServiceImpl<MesUnitMapper, MesUnit> implements IMesUnitService {}
|
||||
@@ -2,10 +2,10 @@
|
||||
VITE_PORT = 3100
|
||||
|
||||
# 网站标题
|
||||
VITE_GLOB_APP_TITLE = JeecgBoot 企业级低代码平台
|
||||
VITE_GLOB_APP_TITLE = MES管理平台
|
||||
|
||||
# 简称,此变量只能是字符/下划线
|
||||
VITE_GLOB_APP_SHORT_NAME = JeecgBoot_Pro
|
||||
VITE_GLOB_APP_SHORT_NAME = MES管理平台
|
||||
|
||||
# 单点登录服务端地址
|
||||
VITE_GLOB_APP_CAS_BASE_URL=http://cas.test.com:8443/cas
|
||||
|
||||
2885
jeecgboot-vue3/pnpm-lock.yaml
generated
2885
jeecgboot-vue3/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
32
jeecgboot-vue3/src/views/mes/material/MesMaterial.api.ts
Normal file
32
jeecgboot-vue3/src/views/mes/material/MesMaterial.api.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
list = '/mes/material/material/list',
|
||||
save = '/mes/material/material/add',
|
||||
edit = '/mes/material/material/edit',
|
||||
deleteOne = '/mes/material/material/delete',
|
||||
deleteBatch = '/mes/material/material/deleteBatch',
|
||||
importExcel = '/mes/material/material/importExcel',
|
||||
exportXls = '/mes/material/material/exportXls',
|
||||
}
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
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) => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () =>
|
||||
defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => handleSuccess()),
|
||||
});
|
||||
};
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
|
||||
67
jeecgboot-vue3/src/views/mes/material/MesMaterial.data.ts
Normal file
67
jeecgboot-vue3/src/views/mes/material/MesMaterial.data.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '物料编码', align: 'center', dataIndex: 'materialCode' },
|
||||
{ title: '物料名称', align: 'center', dataIndex: 'materialName' },
|
||||
{ title: '分类', align: 'center', dataIndex: 'categoryId_dictText' },
|
||||
{ title: '基础单位', align: 'center', dataIndex: 'baseUnitId_dictText' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime' },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
|
||||
{
|
||||
label: '分类',
|
||||
field: 'categoryId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '物料编码', field: 'materialCode', component: 'Input', required: true },
|
||||
{ label: '物料名称', field: 'materialName', component: 'Input', required: true },
|
||||
{ label: '别名', field: 'aliasName', component: 'Input' },
|
||||
{ label: '简称', field: 'shortName', component: 'Input' },
|
||||
{
|
||||
label: '分类',
|
||||
field: 'categoryId',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_material_category,category_name,id' },
|
||||
},
|
||||
{
|
||||
label: '基础单位',
|
||||
field: 'baseUnitId',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
},
|
||||
{
|
||||
label: '统计单位',
|
||||
field: 'statUnitId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: { dictCode: 'mes_unit,unit_name,id' },
|
||||
},
|
||||
{ label: '计划价格', field: 'planPrice', component: 'InputNumber' },
|
||||
{ label: '最小库存', field: 'minStock', component: 'InputNumber' },
|
||||
{ label: '最大库存', field: 'maxStock', component: 'InputNumber' },
|
||||
{ label: '换算系数', field: 'unitConvertRate', component: 'InputNumber', defaultValue: 1 },
|
||||
{
|
||||
label: '状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
],
|
||||
},
|
||||
},
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
@@ -0,0 +1,21 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
list = '/mes/material/category/list',
|
||||
save = '/mes/material/category/add',
|
||||
edit = '/mes/material/category/edit',
|
||||
deleteOne = '/mes/material/category/delete',
|
||||
deleteBatch = '/mes/material/category/deleteBatch',
|
||||
}
|
||||
|
||||
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) =>
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
onOk: () => defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => handleSuccess()),
|
||||
});
|
||||
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
|
||||
@@ -0,0 +1,21 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '分类编码', align: 'center', dataIndex: 'categoryCode' },
|
||||
{ title: '分类名称', align: 'center', dataIndex: 'categoryName' },
|
||||
{ title: '父级ID', align: 'center', dataIndex: 'parentId' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '分类编码', field: 'categoryCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '分类名称', field: 'categoryName', component: 'Input', colProps: { span: 6 } },
|
||||
];
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '分类编码', field: 'categoryCode', component: 'Input', required: true },
|
||||
{ label: '分类名称', field: 'categoryName', component: 'Input', required: true },
|
||||
{ label: '父级ID', field: 'parentId', component: 'Input', defaultValue: '0' },
|
||||
{ label: '树路径', field: 'treePath', component: 'Input' },
|
||||
{ label: '排序', field: 'sortNo', component: 'InputNumber', defaultValue: 0 },
|
||||
{ label: '状态', field: 'enableFlag', component: 'Select', defaultValue: 1, componentProps: { options: [{ label: '启用', value: 1 }, { label: '停用', value: 0 }] } },
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'mes:mes_material_category:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="[{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'mes:mes_material_category:edit' }]" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesMaterialCategoryModal @register="registerModal" @success="reload" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesMaterialCategoryModal from './modules/MesMaterialCategoryModal.vue';
|
||||
import { columns, searchFormSchema } from './MesMaterialCategory.data';
|
||||
import { list, deleteOne } from './MesMaterialCategory.api';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: { title: '物料分类', api: list, columns, canResize: true, formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true }, actionColumn: { width: 120 } },
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection }] = tableContext;
|
||||
function handleAdd() { openModal(true, { isUpdate: false, showFooter: true }); }
|
||||
function handleEdit(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: true }); }
|
||||
function handleDetail(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: false }); }
|
||||
async function handleDelete(record) { await deleteOne({ id: record.id }, reload); }
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{ label: '删除', popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) }, auth: 'mes:mes_material_category:delete' },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,21 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
list = '/mes/material/erpMap/list',
|
||||
save = '/mes/material/erpMap/add',
|
||||
edit = '/mes/material/erpMap/edit',
|
||||
deleteOne = '/mes/material/erpMap/delete',
|
||||
deleteBatch = '/mes/material/erpMap/deleteBatch',
|
||||
}
|
||||
|
||||
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) =>
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
onOk: () => defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => handleSuccess()),
|
||||
});
|
||||
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
|
||||
@@ -0,0 +1,21 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '物料', align: 'center', dataIndex: 'materialId_dictText' },
|
||||
{ title: 'ERP系统', align: 'center', dataIndex: 'erpSystemCode' },
|
||||
{ title: 'ERP物料编码', align: 'center', dataIndex: 'erpMaterialCode' },
|
||||
{ title: 'ERP物料名称', align: 'center', dataIndex: 'erpMaterialName' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'mappingStatus' },
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: 'ERP系统', field: 'erpSystemCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: 'ERP物料编码', field: 'erpMaterialCode', component: 'Input', colProps: { span: 6 } },
|
||||
];
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '物料', field: 'materialId', component: 'JDictSelectTag', required: true, componentProps: { dictCode: 'mes_material,material_name,id' } },
|
||||
{ label: 'ERP系统', field: 'erpSystemCode', component: 'Input', required: true },
|
||||
{ label: 'ERP物料编码', field: 'erpMaterialCode', component: 'Input', required: true },
|
||||
{ label: 'ERP物料名称', field: 'erpMaterialName', component: 'Input' },
|
||||
{ label: '映射状态', field: 'mappingStatus', component: 'Select', defaultValue: 1, componentProps: { options: [{ label: '有效', value: 1 }, { label: '失效', value: 0 }] } },
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'mes:mes_material_erp_map:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="[{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'mes:mes_material_erp_map:edit' }]" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesMaterialErpMapModal @register="registerModal" @success="reload" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesMaterialErpMapModal from './modules/MesMaterialErpMapModal.vue';
|
||||
import { columns, searchFormSchema } from './MesMaterialErpMap.data';
|
||||
import { list, deleteOne } from './MesMaterialErpMap.api';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: { title: '物料ERP映射', api: list, columns, canResize: true, formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true }, actionColumn: { width: 120 } },
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection }] = tableContext;
|
||||
function handleAdd() { openModal(true, { isUpdate: false, showFooter: true }); }
|
||||
function handleEdit(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: true }); }
|
||||
function handleDetail(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: false }); }
|
||||
async function handleDelete(record) { await deleteOne({ id: record.id }, reload); }
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{ label: '删除', popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) }, auth: 'mes:mes_material_erp_map:delete' },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
79
jeecgboot-vue3/src/views/mes/material/MesMaterialList.vue
Normal file
79
jeecgboot-vue3/src/views/mes/material/MesMaterialList.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'mes:mes_material:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
||||
<a-button type="primary" v-auth="'mes:mes_material:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'mes:mes_material:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete"><Icon icon="ant-design:delete-outlined" />删除</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作<Icon icon="mdi:chevron-down" /></a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesMaterialModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesMaterialModal from './modules/MesMaterialModal.vue';
|
||||
import { columns, searchFormSchema } from './MesMaterial.data';
|
||||
import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesMaterial.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '物料信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
|
||||
actionColumn: { width: 120 },
|
||||
},
|
||||
exportConfig: { name: '物料信息', url: getExportUrl },
|
||||
importConfig: { url: getImportUrl, success: handleSuccess },
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, reload);
|
||||
}
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, reload);
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function getTableAction(record) {
|
||||
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'mes:mes_material:edit' }];
|
||||
}
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'mes:mes_material:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
25
jeecgboot-vue3/src/views/mes/material/MesUnit.api.ts
Normal file
25
jeecgboot-vue3/src/views/mes/material/MesUnit.api.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
enum Api {
|
||||
list = '/mes/material/unit/list',
|
||||
save = '/mes/material/unit/add',
|
||||
edit = '/mes/material/unit/edit',
|
||||
deleteOne = '/mes/material/unit/delete',
|
||||
deleteBatch = '/mes/material/unit/deleteBatch',
|
||||
importExcel = '/mes/material/unit/importExcel',
|
||||
exportXls = '/mes/material/unit/exportXls',
|
||||
}
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
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) =>
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
onOk: () => defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => handleSuccess()),
|
||||
});
|
||||
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
|
||||
30
jeecgboot-vue3/src/views/mes/material/MesUnit.data.ts
Normal file
30
jeecgboot-vue3/src/views/mes/material/MesUnit.data.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '单位编码', align: 'center', dataIndex: 'unitCode' },
|
||||
{ title: '单位名称', align: 'center', dataIndex: 'unitName' },
|
||||
{ title: '单位类型', align: 'center', dataIndex: 'unitType' },
|
||||
{ title: '精度', align: 'center', dataIndex: 'precisionScale' },
|
||||
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '单位编码', field: 'unitCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '单位名称', field: 'unitName', component: 'Input', colProps: { span: 6 } },
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '单位编码', field: 'unitCode', component: 'Input', required: true },
|
||||
{ label: '单位名称', field: 'unitName', component: 'Input', required: true },
|
||||
{ label: '单位类型', field: 'unitType', component: 'Input', defaultValue: 'BASE' },
|
||||
{ label: '精度', field: 'precisionScale', component: 'InputNumber', defaultValue: 3 },
|
||||
{
|
||||
label: '状态',
|
||||
field: 'enableFlag',
|
||||
component: 'Select',
|
||||
defaultValue: 1,
|
||||
componentProps: { options: [{ label: '启用', value: 1 }, { label: '停用', value: 0 }] },
|
||||
},
|
||||
{ label: '备注', field: 'remark', component: 'InputTextArea' },
|
||||
];
|
||||
36
jeecgboot-vue3/src/views/mes/material/MesUnitList.vue
Normal file
36
jeecgboot-vue3/src/views/mes/material/MesUnitList.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'mes:mes_unit:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="[{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'mes:mes_unit:edit' }]" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesUnitModal @register="registerModal" @success="reload" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import MesUnitModal from './modules/MesUnitModal.vue';
|
||||
import { columns, searchFormSchema } from './MesUnit.data';
|
||||
import { list, deleteOne } from './MesUnit.api';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: { title: '单位信息', api: list, columns, canResize: true, formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true }, actionColumn: { width: 120 } },
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection }] = tableContext;
|
||||
function handleAdd() { openModal(true, { isUpdate: false, showFooter: true }); }
|
||||
function handleEdit(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: true }); }
|
||||
function handleDetail(record: Recordable) { openModal(true, { record, isUpdate: true, showFooter: false }); }
|
||||
async function handleDelete(record) { await deleteOne({ id: record.id }, reload); }
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{ label: '删除', popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) }, auth: 'mes:mes_unit:delete' },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/material/category/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/material/category/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialCategoryList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialCategoryList from '../MesMaterialCategoryList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/material/erp-map/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/material/erp-map/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialErpMapList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialErpMapList from '../MesMaterialErpMapList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/material/info/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/material/info/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialList from '../MesMaterialList.vue';
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" width="50%" v-bind="$attrs" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesMaterialCategory.data';
|
||||
import { saveOrUpdate } from '../MesMaterialCategory.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({ labelWidth: 120, schemas: formSchema, showActionButtonGroup: false });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (unref(isUpdate)) await setFieldsValue({ ...data.record });
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增物料分类' : '编辑物料分类'));
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" width="50%" v-bind="$attrs" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesMaterialErpMap.data';
|
||||
import { saveOrUpdate } from '../MesMaterialErpMap.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({ labelWidth: 120, schemas: formSchema, showActionButtonGroup: false });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (unref(isUpdate)) await setFieldsValue({ ...data.record });
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增ERP映射' : '编辑ERP映射'));
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" width="60%" v-bind="$attrs" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesMaterial.data';
|
||||
import { saveOrUpdate } from '../MesMaterial.api';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增物料' : '编辑物料'));
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" width="50%" v-bind="$attrs" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesUnit.data';
|
||||
import { saveOrUpdate } from '../MesUnit.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({ labelWidth: 120, schemas: formSchema, showActionButtonGroup: false });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (unref(isUpdate)) await setFieldsValue({ ...data.record });
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增单位' : '编辑单位'));
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/material/unit/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/material/unit/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesUnitList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesUnitList from '../MesUnitList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/materialcategory/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/materialcategory/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialCategoryList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialCategoryList from '../material/MesMaterialCategoryList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/materialerpmap/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/materialerpmap/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialErpMapList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialErpMapList from '../material/MesMaterialErpMapList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/materialinfo/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/materialinfo/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesMaterialList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesMaterialList from '../material/MesMaterialList.vue';
|
||||
</script>
|
||||
7
jeecgboot-vue3/src/views/mes/materialunit/index.vue
Normal file
7
jeecgboot-vue3/src/views/mes/materialunit/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<MesUnitList />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MesUnitList from '../material/MesUnitList.vue';
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="app-loading-dots">
|
||||
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
||||
</div>
|
||||
<div class="app-loading-title">JeecgBoot 企业级低代码平台</div>
|
||||
<div class="app-loading-title">MES管理平台</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user