物料模块
This commit is contained in:
@@ -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 {}
|
||||
Reference in New Issue
Block a user