zhangherong
2025-06-30 39363e9edaf0b6961e9ed6777a19aa929a4fba7d
Merge remote-tracking branch 'origin/master'
已添加25个文件
1502 ■■■■■ 文件已修改
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialController.java 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInventoryController.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialOutboundController.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/entity/LswMaterial.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialInbound.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialInventory.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialOutbound.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialInboundMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialInventoryMapper.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialOutboundMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialInboundMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialInventoryMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialOutboundMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialInboundService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialInventoryService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialOutboundService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialService.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialInboundServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialInventoryServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialOutboundServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialServiceImpl.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/vo/LswMaterialPage.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,260 @@
package org.jeecg.modules.lsw.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.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.lsw.entity.LswMaterial;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import org.jeecg.modules.lsw.service.ILswMaterialInventoryService;
import org.jeecg.modules.lsw.service.ILswMaterialService;
import org.jeecg.modules.lsw.vo.LswMaterialPage;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Description: çº¿è¾¹åº“物料信息
* @Author: jeecg-boot
* @Date:   2025-06-30
* @Version: V1.0
*/
@Api(tags="线边库物料信息")
@RestController
@RequestMapping("/lswmaterial/lswMaterial")
@Slf4j
public class LswMaterialController {
   @Autowired
   private ILswMaterialService lswMaterialService;
   @Autowired
   private ILswMaterialInventoryService lswMaterialInventoryService;
   /**
    * åˆ†é¡µåˆ—表查询
    *
    * @param lswMaterial
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   //@AutoLog(value = "线边库物料信息-分页列表查询")
   @ApiOperation(value="线边库物料信息-分页列表查询", notes="线边库物料信息-分页列表查询")
   @GetMapping(value = "/list")
   public Result<IPage<LswMaterial>> queryPageList(LswMaterial lswMaterial,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<LswMaterial> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterial, req.getParameterMap());
       Page<LswMaterial> page = new Page<LswMaterial>(pageNo, pageSize);
       IPage<LswMaterial> pageList = lswMaterialService.page(page, queryWrapper);
       return Result.OK(pageList);
   }
   /**
    *   æ·»åŠ 
    *
    * @param lswMaterialPage
    * @return
    */
   @AutoLog(value = "线边库物料信息-添加")
   @ApiOperation(value="线边库物料信息-添加", notes="线边库物料信息-添加")
   //@RequiresPermissions("org.jeecg.modules:lsw_material:add")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody LswMaterialPage lswMaterialPage) {
       LswMaterial lswMaterial = new LswMaterial();
       BeanUtils.copyProperties(lswMaterialPage, lswMaterial);
       lswMaterialService.saveMain(lswMaterial, lswMaterialPage.getLswMaterialInventoryList());
       return Result.OK("添加成功!");
   }
   /**
    *  ç¼–辑
    *
    * @param lswMaterialPage
    * @return
    */
   @AutoLog(value = "线边库物料信息-编辑")
   @ApiOperation(value="线边库物料信息-编辑", notes="线边库物料信息-编辑")
   //@RequiresPermissions("org.jeecg.modules:lsw_material:edit")
   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
   public Result<String> edit(@RequestBody LswMaterialPage lswMaterialPage) {
       LswMaterial lswMaterial = new LswMaterial();
       BeanUtils.copyProperties(lswMaterialPage, lswMaterial);
       LswMaterial lswMaterialEntity = lswMaterialService.getById(lswMaterial.getId());
       if(lswMaterialEntity==null) {
           return Result.error("未找到对应数据");
       }
       lswMaterialService.updateMain(lswMaterial, lswMaterialPage.getLswMaterialInventoryList());
       return Result.OK("编辑成功!");
   }
   /**
    *   é€šè¿‡id删除
    *
    * @param id
    * @return
    */
   @AutoLog(value = "线边库物料信息-通过id删除")
   @ApiOperation(value="线边库物料信息-通过id删除", notes="线边库物料信息-通过id删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material:delete")
   @DeleteMapping(value = "/delete")
   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
       lswMaterialService.delMain(id);
       return Result.OK("删除成功!");
   }
   /**
    *  æ‰¹é‡åˆ é™¤
    *
    * @param ids
    * @return
    */
   @AutoLog(value = "线边库物料信息-批量删除")
   @ApiOperation(value="线边库物料信息-批量删除", notes="线边库物料信息-批量删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material:deleteBatch")
   @DeleteMapping(value = "/deleteBatch")
   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
       this.lswMaterialService.delBatchMain(Arrays.asList(ids.split(",")));
       return Result.OK("批量删除成功!");
   }
   /**
    * é€šè¿‡id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "线边库物料信息-通过id查询")
   @ApiOperation(value="线边库物料信息-通过id查询", notes="线边库物料信息-通过id查询")
   @GetMapping(value = "/queryById")
   public Result<LswMaterial> queryById(@RequestParam(name="id",required=true) String id) {
       LswMaterial lswMaterial = lswMaterialService.getById(id);
       if(lswMaterial==null) {
           return Result.error("未找到对应数据");
       }
       return Result.OK(lswMaterial);
   }
   /**
    * é€šè¿‡id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "物料库存信息通过主表ID查询")
   @ApiOperation(value="物料库存信息主表ID查询", notes="物料库存信息-通主表ID查询")
   @GetMapping(value = "/queryLswMaterialInventoryByMainId")
   public Result<List<LswMaterialInventory>> queryLswMaterialInventoryListByMainId(@RequestParam(name="id",required=true) String id) {
       List<LswMaterialInventory> lswMaterialInventoryList = lswMaterialInventoryService.selectByMainId(id);
       return Result.OK(lswMaterialInventoryList);
   }
   /**
   * å¯¼å‡ºexcel
   *
   * @param request
   * @param lswMaterial
   */
   //@RequiresPermissions("org.jeecg.modules:lsw_material:exportXls")
   @RequestMapping(value = "/exportXls")
   public ModelAndView exportXls(HttpServletRequest request, LswMaterial lswMaterial) {
     // Step.1 ç»„装查询条件查询数据
     QueryWrapper<LswMaterial> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterial, request.getParameterMap());
     LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
     //配置选中数据查询条件
     String selections = request.getParameter("selections");
     if(oConvertUtils.isNotEmpty(selections)) {
        List<String> selectionList = Arrays.asList(selections.split(","));
        queryWrapper.in("id",selectionList);
     }
     //Step.2 èŽ·å–å¯¼å‡ºæ•°æ®
     List<LswMaterial> lswMaterialList = lswMaterialService.list(queryWrapper);
     // Step.3 ç»„装pageList
     List<LswMaterialPage> pageList = new ArrayList<LswMaterialPage>();
     for (LswMaterial main : lswMaterialList) {
         LswMaterialPage vo = new LswMaterialPage();
         BeanUtils.copyProperties(main, vo);
         List<LswMaterialInventory> lswMaterialInventoryList = lswMaterialInventoryService.selectByMainId(main.getId());
         vo.setLswMaterialInventoryList(lswMaterialInventoryList);
         pageList.add(vo);
     }
     // Step.4 AutoPoi å¯¼å‡ºExcel
     ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
     mv.addObject(NormalExcelConstants.FILE_NAME, "线边库物料信息列表");
     mv.addObject(NormalExcelConstants.CLASS, LswMaterialPage.class);
     mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("线边库物料信息数据", "导出人:"+sysUser.getRealname(), "线边库物料信息"));
     mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
     return mv;
   }
   /**
   * é€šè¿‡excel导入数据
   *
   * @param request
   * @param response
   * @return
   */
   //@RequiresPermissions("org.jeecg.modules:lsw_material:importExcel")
   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
     MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
     Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
     for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
         // èŽ·å–ä¸Šä¼ æ–‡ä»¶å¯¹è±¡
         MultipartFile file = entity.getValue();
         ImportParams params = new ImportParams();
         params.setTitleRows(2);
         params.setHeadRows(1);
         params.setNeedSave(true);
         try {
             List<LswMaterialPage> list = ExcelImportUtil.importExcel(file.getInputStream(), LswMaterialPage.class, params);
             for (LswMaterialPage page : list) {
                 LswMaterial po = new LswMaterial();
                 BeanUtils.copyProperties(page, po);
                 lswMaterialService.saveMain(po, page.getLswMaterialInventoryList());
             }
             return Result.OK("文件导入成功!数据行数:" + list.size());
         } catch (Exception e) {
             log.error(e.getMessage(),e);
             return Result.error("文件导入失败:"+e.getMessage());
         } finally {
             try {
                 file.getInputStream().close();
             } catch (IOException e) {
                 e.printStackTrace();
             }
         }
     }
     return Result.OK("文件导入失败!");
   }
}
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,161 @@
package org.jeecg.modules.lsw.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.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.lsw.entity.LswMaterialInbound;
import org.jeecg.modules.lsw.service.ILswMaterialInboundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: ç‰©æ–™å…¥åº“单
* @Author: jeecg-boot
* @Date:   2025-06-30
* @Version: V1.0
*/
@Api(tags="物料入库单")
@RestController
@RequestMapping("/lswmaterialinbound/lswMaterialInbound")
@Slf4j
public class LswMaterialInboundController extends JeecgController<LswMaterialInbound, ILswMaterialInboundService> {
   @Autowired
   private ILswMaterialInboundService lswMaterialInboundService;
   /**
    * åˆ†é¡µåˆ—表查询
    *
    * @param lswMaterialInbound
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   //@AutoLog(value = "物料入库单-分页列表查询")
   @ApiOperation(value="物料入库单-分页列表查询", notes="物料入库单-分页列表查询")
   @GetMapping(value = "/list")
   public Result<IPage<LswMaterialInbound>> queryPageList(LswMaterialInbound lswMaterialInbound,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<LswMaterialInbound> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterialInbound, req.getParameterMap());
       Page<LswMaterialInbound> page = new Page<LswMaterialInbound>(pageNo, pageSize);
       IPage<LswMaterialInbound> pageList = lswMaterialInboundService.page(page, queryWrapper);
       return Result.OK(pageList);
   }
   /**
    *   æ·»åŠ 
    *
    * @param lswMaterialInbound
    * @return
    */
   @AutoLog(value = "物料入库单-添加")
   @ApiOperation(value="物料入库单-添加", notes="物料入库单-添加")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:add")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody LswMaterialInbound lswMaterialInbound) {
       lswMaterialInboundService.save(lswMaterialInbound);
       return Result.OK("添加成功!");
   }
   /**
    *  ç¼–辑
    *
    * @param lswMaterialInbound
    * @return
    */
   @AutoLog(value = "物料入库单-编辑")
   @ApiOperation(value="物料入库单-编辑", notes="物料入库单-编辑")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:edit")
   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
   public Result<String> edit(@RequestBody LswMaterialInbound lswMaterialInbound) {
       lswMaterialInboundService.updateById(lswMaterialInbound);
       return Result.OK("编辑成功!");
   }
   /**
    *   é€šè¿‡id删除
    *
    * @param id
    * @return
    */
   @AutoLog(value = "物料入库单-通过id删除")
   @ApiOperation(value="物料入库单-通过id删除", notes="物料入库单-通过id删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:delete")
   @DeleteMapping(value = "/delete")
   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
       lswMaterialInboundService.removeById(id);
       return Result.OK("删除成功!");
   }
   /**
    *  æ‰¹é‡åˆ é™¤
    *
    * @param ids
    * @return
    */
   @AutoLog(value = "物料入库单-批量删除")
   @ApiOperation(value="物料入库单-批量删除", notes="物料入库单-批量删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:deleteBatch")
   @DeleteMapping(value = "/deleteBatch")
   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
       this.lswMaterialInboundService.removeByIds(Arrays.asList(ids.split(",")));
       return Result.OK("批量删除成功!");
   }
   /**
    * é€šè¿‡id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "物料入库单-通过id查询")
   @ApiOperation(value="物料入库单-通过id查询", notes="物料入库单-通过id查询")
   @GetMapping(value = "/queryById")
   public Result<LswMaterialInbound> queryById(@RequestParam(name="id",required=true) String id) {
       LswMaterialInbound lswMaterialInbound = lswMaterialInboundService.getById(id);
       if(lswMaterialInbound==null) {
           return Result.error("未找到对应数据");
       }
       return Result.OK(lswMaterialInbound);
   }
   /**
   * å¯¼å‡ºexcel
   *
   * @param request
   * @param lswMaterialInbound
   */
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:exportXls")
   @RequestMapping(value = "/exportXls")
   public ModelAndView exportXls(HttpServletRequest request, LswMaterialInbound lswMaterialInbound) {
       return super.exportXls(request, lswMaterialInbound, LswMaterialInbound.class, "物料入库单");
   }
   /**
     * é€šè¿‡excel导入数据
   *
   * @param request
   * @param response
   * @return
   */
   //@RequiresPermissions("lsw_material_inbound:importExcel")
   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
       return super.importExcel(request, response, LswMaterialInbound.class);
   }
}
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInventoryController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,161 @@
package org.jeecg.modules.lsw.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.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.lsw.entity.LswMaterialInventory;
import org.jeecg.modules.lsw.service.ILswMaterialInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: ç‰©æ–™åº“存信息
* @Author: jeecg-boot
* @Date:   2025-06-30
* @Version: V1.0
*/
@Api(tags="物料库存信息")
@RestController
@RequestMapping("/lswmaterialinventory/lswMaterialInventory")
@Slf4j
public class LswMaterialInventoryController extends JeecgController<LswMaterialInventory, ILswMaterialInventoryService> {
   @Autowired
   private ILswMaterialInventoryService lswMaterialInventoryService;
   /**
    * åˆ†é¡µåˆ—表查询
    *
    * @param lswMaterialInventory
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   //@AutoLog(value = "物料库存信息-分页列表查询")
   @ApiOperation(value="物料库存信息-分页列表查询", notes="物料库存信息-分页列表查询")
   @GetMapping(value = "/list")
   public Result<IPage<LswMaterialInventory>> queryPageList(LswMaterialInventory lswMaterialInventory,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<LswMaterialInventory> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterialInventory, req.getParameterMap());
       Page<LswMaterialInventory> page = new Page<LswMaterialInventory>(pageNo, pageSize);
       IPage<LswMaterialInventory> pageList = lswMaterialInventoryService.page(page, queryWrapper);
       return Result.OK(pageList);
   }
   /**
    *   æ·»åŠ 
    *
    * @param lswMaterialInventory
    * @return
    */
   @AutoLog(value = "物料库存信息-添加")
   @ApiOperation(value="物料库存信息-添加", notes="物料库存信息-添加")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inventory:add")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody LswMaterialInventory lswMaterialInventory) {
       lswMaterialInventoryService.save(lswMaterialInventory);
       return Result.OK("添加成功!");
   }
   /**
    *  ç¼–辑
    *
    * @param lswMaterialInventory
    * @return
    */
   @AutoLog(value = "物料库存信息-编辑")
   @ApiOperation(value="物料库存信息-编辑", notes="物料库存信息-编辑")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inventory:edit")
   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
   public Result<String> edit(@RequestBody LswMaterialInventory lswMaterialInventory) {
       lswMaterialInventoryService.updateById(lswMaterialInventory);
       return Result.OK("编辑成功!");
   }
   /**
    *   é€šè¿‡id删除
    *
    * @param id
    * @return
    */
   @AutoLog(value = "物料库存信息-通过id删除")
   @ApiOperation(value="物料库存信息-通过id删除", notes="物料库存信息-通过id删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inventory:delete")
   @DeleteMapping(value = "/delete")
   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
       lswMaterialInventoryService.removeById(id);
       return Result.OK("删除成功!");
   }
   /**
    *  æ‰¹é‡åˆ é™¤
    *
    * @param ids
    * @return
    */
   @AutoLog(value = "物料库存信息-批量删除")
   @ApiOperation(value="物料库存信息-批量删除", notes="物料库存信息-批量删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inventory:deleteBatch")
   @DeleteMapping(value = "/deleteBatch")
   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
       this.lswMaterialInventoryService.removeByIds(Arrays.asList(ids.split(",")));
       return Result.OK("批量删除成功!");
   }
   /**
    * é€šè¿‡id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "物料库存信息-通过id查询")
   @ApiOperation(value="物料库存信息-通过id查询", notes="物料库存信息-通过id查询")
   @GetMapping(value = "/queryById")
   public Result<LswMaterialInventory> queryById(@RequestParam(name="id",required=true) String id) {
       LswMaterialInventory lswMaterialInventory = lswMaterialInventoryService.getById(id);
       if(lswMaterialInventory==null) {
           return Result.error("未找到对应数据");
       }
       return Result.OK(lswMaterialInventory);
   }
   /**
   * å¯¼å‡ºexcel
   *
   * @param request
   * @param lswMaterialInventory
   */
   //@RequiresPermissions("org.jeecg.modules:lsw_material_inventory:exportXls")
   @RequestMapping(value = "/exportXls")
   public ModelAndView exportXls(HttpServletRequest request, LswMaterialInventory lswMaterialInventory) {
       return super.exportXls(request, lswMaterialInventory, LswMaterialInventory.class, "物料库存信息");
   }
   /**
     * é€šè¿‡excel导入数据
   *
   * @param request
   * @param response
   * @return
   */
   //@RequiresPermissions("lsw_material_inventory:importExcel")
   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
       return super.importExcel(request, response, LswMaterialInventory.class);
   }
}
src/main/java/org/jeecg/modules/lsw/controller/LswMaterialOutboundController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,161 @@
package org.jeecg.modules.lsw.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.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.lsw.entity.LswMaterialOutbound;
import org.jeecg.modules.lsw.service.ILswMaterialOutboundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: ç‰©æ–™å‡ºåº“单
* @Author: jeecg-boot
* @Date:   2025-06-30
* @Version: V1.0
*/
@Api(tags="物料出库单")
@RestController
@RequestMapping("/lswmaterialoutbound/lswMaterialOutbound")
@Slf4j
public class LswMaterialOutboundController extends JeecgController<LswMaterialOutbound, ILswMaterialOutboundService> {
   @Autowired
   private ILswMaterialOutboundService lswMaterialOutboundService;
   /**
    * åˆ†é¡µåˆ—表查询
    *
    * @param lswMaterialOutbound
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   //@AutoLog(value = "物料出库单-分页列表查询")
   @ApiOperation(value="物料出库单-分页列表查询", notes="物料出库单-分页列表查询")
   @GetMapping(value = "/list")
   public Result<IPage<LswMaterialOutbound>> queryPageList(LswMaterialOutbound lswMaterialOutbound,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<LswMaterialOutbound> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterialOutbound, req.getParameterMap());
       Page<LswMaterialOutbound> page = new Page<LswMaterialOutbound>(pageNo, pageSize);
       IPage<LswMaterialOutbound> pageList = lswMaterialOutboundService.page(page, queryWrapper);
       return Result.OK(pageList);
   }
   /**
    *   æ·»åŠ 
    *
    * @param lswMaterialOutbound
    * @return
    */
   @AutoLog(value = "物料出库单-添加")
   @ApiOperation(value="物料出库单-添加", notes="物料出库单-添加")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:add")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody LswMaterialOutbound lswMaterialOutbound) {
       lswMaterialOutboundService.save(lswMaterialOutbound);
       return Result.OK("添加成功!");
   }
   /**
    *  ç¼–辑
    *
    * @param lswMaterialOutbound
    * @return
    */
   @AutoLog(value = "物料出库单-编辑")
   @ApiOperation(value="物料出库单-编辑", notes="物料出库单-编辑")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:edit")
   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
   public Result<String> edit(@RequestBody LswMaterialOutbound lswMaterialOutbound) {
       lswMaterialOutboundService.updateById(lswMaterialOutbound);
       return Result.OK("编辑成功!");
   }
   /**
    *   é€šè¿‡id删除
    *
    * @param id
    * @return
    */
   @AutoLog(value = "物料出库单-通过id删除")
   @ApiOperation(value="物料出库单-通过id删除", notes="物料出库单-通过id删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:delete")
   @DeleteMapping(value = "/delete")
   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
       lswMaterialOutboundService.removeById(id);
       return Result.OK("删除成功!");
   }
   /**
    *  æ‰¹é‡åˆ é™¤
    *
    * @param ids
    * @return
    */
   @AutoLog(value = "物料出库单-批量删除")
   @ApiOperation(value="物料出库单-批量删除", notes="物料出库单-批量删除")
   //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:deleteBatch")
   @DeleteMapping(value = "/deleteBatch")
   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
       this.lswMaterialOutboundService.removeByIds(Arrays.asList(ids.split(",")));
       return Result.OK("批量删除成功!");
   }
   /**
    * é€šè¿‡id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "物料出库单-通过id查询")
   @ApiOperation(value="物料出库单-通过id查询", notes="物料出库单-通过id查询")
   @GetMapping(value = "/queryById")
   public Result<LswMaterialOutbound> queryById(@RequestParam(name="id",required=true) String id) {
       LswMaterialOutbound lswMaterialOutbound = lswMaterialOutboundService.getById(id);
       if(lswMaterialOutbound==null) {
           return Result.error("未找到对应数据");
       }
       return Result.OK(lswMaterialOutbound);
   }
   /**
   * å¯¼å‡ºexcel
   *
   * @param request
   * @param lswMaterialOutbound
   */
   //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:exportXls")
   @RequestMapping(value = "/exportXls")
   public ModelAndView exportXls(HttpServletRequest request, LswMaterialOutbound lswMaterialOutbound) {
       return super.exportXls(request, lswMaterialOutbound, LswMaterialOutbound.class, "物料出库单");
   }
   /**
     * é€šè¿‡excel导入数据
   *
   * @param request
   * @param response
   * @return
   */
   //@RequiresPermissions("lsw_material_outbound:importExcel")
   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
       return super.importExcel(request, response, LswMaterialOutbound.class);
   }
}
src/main/java/org/jeecg/modules/lsw/entity/LswMaterial.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
package org.jeecg.modules.lsw.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * @Description: çº¿è¾¹åº“物料信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@ApiModel(value="lsw_material对象", description="线边库物料信息")
@Data
@TableName("lsw_material")
public class LswMaterial implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
    /**删除标记*/
    @Excel(name = "删除标记", width = 15)
    @ApiModelProperty(value = "删除标记")
    @TableLogic
    private Integer delFlag;
    /**物料编码*/
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialNumber;
    /**物料名称*/
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;
    /**物料型号*/
    @Excel(name = "物料型号", width = 15)
    @ApiModelProperty(value = "物料型号")
    private String materialModel;
    /**物料类型*/
    @Excel(name = "物料类型", width = 15, dicCode = "material_category")
    @Dict(dicCode = "material_category")
    @ApiModelProperty(value = "物料类型")
    private String materialCategory;
    /**单位*/
    @Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    private String materialUnit;
}
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialInbound.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
package org.jeecg.modules.lsw.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * @Description: ç‰©æ–™å…¥åº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Data
@TableName("lsw_material_inbound")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="lsw_material_inbound对象", description="物料入库单")
public class LswMaterialInbound implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**删除标记*/
    @Excel(name = "删除标记", width = 15)
    @ApiModelProperty(value = "删除标记")
    @TableLogic
    private Integer delFlag;
    /**产线ID*/
    @Excel(name = "产线ID", width = 15)
    @ApiModelProperty(value = "产线ID")
    private String factoryId;
    /**库存地ID*/
    @Excel(name = "库存地ID", width = 15)
    @ApiModelProperty(value = "库存地ID")
    private String warehouseId;
    /**物料编码*/
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialNumber;
    /**物料名称*/
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;
    /**批次号*/
    @Excel(name = "批次号", width = 15)
    @ApiModelProperty(value = "批次号")
    private String batchNumber;
    /**入库数量*/
    @Excel(name = "入库数量", width = 15)
    @ApiModelProperty(value = "入库数量")
    private Integer quantity;
    /**接收人*/
    @Excel(name = "接收人", width = 15)
    @ApiModelProperty(value = "接收人")
    private String receiver;
    /**接收时间*/
    @Excel(name = "接收时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "接收时间")
    private Date receiveTime;
}
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialInventory.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package org.jeecg.modules.lsw.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * @Description: ç‰©æ–™åº“存信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@ApiModel(value="lsw_material_inventory对象", description="物料库存信息")
@Data
@TableName("lsw_material_inventory")
public class LswMaterialInventory implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**物料ID*/
    @ApiModelProperty(value = "物料ID")
    private String materialId;
    /**批次号*/
    @Excel(name = "批次号", width = 15)
    @ApiModelProperty(value = "批次号")
    private String batchNumber;
    /**库存类型*/
    @Excel(name = "库存类型", width = 15)
    @ApiModelProperty(value = "库存类型")
    private String inventoryCategory;
    /**数量*/
    @Excel(name = "数量", width = 15)
    @ApiModelProperty(value = "数量")
    private String quantity;
    /**库存地ID*/
    @Excel(name = "库存地ID", width = 15)
    @ApiModelProperty(value = "库存地ID")
    private String warehouseId;
    /**库存状态*/
    @Excel(name = "库存状态", width = 15)
    @ApiModelProperty(value = "库存状态")
    private String inventoryStatus;
}
src/main/java/org/jeecg/modules/lsw/entity/LswMaterialOutbound.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
package org.jeecg.modules.lsw.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * @Description: ç‰©æ–™å‡ºåº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Data
@TableName("lsw_material_outbound")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="lsw_material_outbound对象", description="物料出库单")
public class LswMaterialOutbound implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**删除标记*/
    @Excel(name = "删除标记", width = 15)
    @ApiModelProperty(value = "删除标记")
    @TableLogic
    private Integer delFlag;
    /**物料编码*/
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialNumber;
    /**物料名称*/
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;
    /**产线ID*/
    @Excel(name = "产线ID", width = 15)
    @ApiModelProperty(value = "产线ID")
    private String factoryId;
    /**批次号*/
    @Excel(name = "批次号", width = 15)
    @ApiModelProperty(value = "批次号")
    private String batchNumber;
    /**出库人*/
    @Excel(name = "出库人", width = 15)
    @ApiModelProperty(value = "出库人")
    private String outboundStaff;
    /**出库时间*/
    @Excel(name = "出库时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "出库时间")
    private Date outboundTime;
    /**出库数量*/
    @Excel(name = "出库数量", width = 15)
    @ApiModelProperty(value = "出库数量")
    private String quantity;
    /**工单ID*/
    @Excel(name = "工单ID", width = 15)
    @ApiModelProperty(value = "工单ID")
    private String workOrderId;
}
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialInboundMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.lsw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.lsw.entity.LswMaterialInbound;
/**
 * @Description: ç‰©æ–™å…¥åº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface LswMaterialInboundMapper extends BaseMapper<LswMaterialInbound> {
}
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialInventoryMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
package org.jeecg.modules.lsw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import java.util.List;
/**
 * @Description: ç‰©æ–™åº“存信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface LswMaterialInventoryMapper extends BaseMapper<LswMaterialInventory> {
    /**
     * é€šè¿‡ä¸»è¡¨id删除子表数据
     *
     * @param mainId ä¸»è¡¨id
     * @return boolean
     */
    public boolean deleteByMainId(@Param("mainId") String mainId);
  /**
   * é€šè¿‡ä¸»è¡¨id查询子表数据
   *
   * @param mainId ä¸»è¡¨id
   * @return List<LswMaterialInventory>
   */
    public List<LswMaterialInventory> selectByMainId(@Param("mainId") String mainId);
}
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.lsw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.lsw.entity.LswMaterial;
/**
 * @Description: çº¿è¾¹åº“物料信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface LswMaterialMapper extends BaseMapper<LswMaterial> {
}
src/main/java/org/jeecg/modules/lsw/mapper/LswMaterialOutboundMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.lsw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.lsw.entity.LswMaterialOutbound;
/**
 * @Description: ç‰©æ–™å‡ºåº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface LswMaterialOutboundMapper extends BaseMapper<LswMaterialOutbound> {
}
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialInboundMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.lsw.mapper.LswMaterialInboundMapper">
</mapper>
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialInventoryMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper">
    <delete id="deleteByMainId" parameterType="java.lang.String">
        DELETE
        FROM  lsw_material_inventory
        WHERE
             material_id = #{mainId}     </delete>
    <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.lsw.entity.LswMaterialInventory">
        SELECT *
        FROM  lsw_material_inventory
        WHERE
             material_id = #{mainId}     </select>
</mapper>
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.lsw.mapper.LswMaterialMapper">
</mapper>
src/main/java/org/jeecg/modules/lsw/mapper/xml/LswMaterialOutboundMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.lsw.mapper.LswMaterialOutboundMapper">
</mapper>
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialInboundService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.lsw.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.lsw.entity.LswMaterialInbound;
/**
 * @Description: ç‰©æ–™å…¥åº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface ILswMaterialInboundService extends IService<LswMaterialInbound> {
}
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialInventoryService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package org.jeecg.modules.lsw.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import java.util.List;
/**
 * @Description: ç‰©æ–™åº“存信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface ILswMaterialInventoryService extends IService<LswMaterialInventory> {
    /**
     * é€šè¿‡ä¸»è¡¨id查询子表数据
     *
     * @param mainId ä¸»è¡¨id
     * @return List<LswMaterialInventory>
     */
    public List<LswMaterialInventory> selectByMainId(String mainId);
}
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialOutboundService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.lsw.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.lsw.entity.LswMaterialOutbound;
/**
 * @Description: ç‰©æ–™å‡ºåº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface ILswMaterialOutboundService extends IService<LswMaterialOutbound> {
}
src/main/java/org/jeecg/modules/lsw/service/ILswMaterialService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
package org.jeecg.modules.lsw.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.lsw.entity.LswMaterial;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
 * @Description: çº¿è¾¹åº“物料信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
public interface ILswMaterialService extends IService<LswMaterial> {
    /**
     * æ·»åŠ ä¸€å¯¹å¤š
     *
     * @param lswMaterial
     * @param lswMaterialInventoryList
     */
    public void saveMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList) ;
    /**
     * ä¿®æ”¹ä¸€å¯¹å¤š
     *
   * @param lswMaterial
   * @param lswMaterialInventoryList
     */
    public void updateMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList);
    /**
     * åˆ é™¤ä¸€å¯¹å¤š
     *
     * @param id
     */
    public void delMain (String id);
    /**
     * æ‰¹é‡åˆ é™¤ä¸€å¯¹å¤š
     *
     * @param idList
     */
    public void delBatchMain (Collection<? extends Serializable> idList);
}
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialInboundServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package org.jeecg.modules.lsw.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.lsw.entity.LswMaterialInbound;
import org.jeecg.modules.lsw.mapper.LswMaterialInboundMapper;
import org.jeecg.modules.lsw.service.ILswMaterialInboundService;
import org.springframework.stereotype.Service;
/**
 * @Description: ç‰©æ–™å…¥åº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Service
public class LswMaterialInboundServiceImpl extends ServiceImpl<LswMaterialInboundMapper, LswMaterialInbound> implements ILswMaterialInboundService {
}
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialInventoryServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package org.jeecg.modules.lsw.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper;
import org.jeecg.modules.lsw.service.ILswMaterialInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @Description: ç‰©æ–™åº“存信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Service
public class LswMaterialInventoryServiceImpl extends ServiceImpl<LswMaterialInventoryMapper, LswMaterialInventory> implements ILswMaterialInventoryService {
    @Autowired
    private LswMaterialInventoryMapper lswMaterialInventoryMapper;
    @Override
    public List<LswMaterialInventory> selectByMainId(String mainId) {
        return lswMaterialInventoryMapper.selectByMainId(mainId);
    }
}
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialOutboundServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package org.jeecg.modules.lsw.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.lsw.entity.LswMaterialOutbound;
import org.jeecg.modules.lsw.mapper.LswMaterialOutboundMapper;
import org.jeecg.modules.lsw.service.ILswMaterialOutboundService;
import org.springframework.stereotype.Service;
/**
 * @Description: ç‰©æ–™å‡ºåº“单
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Service
public class LswMaterialOutboundServiceImpl extends ServiceImpl<LswMaterialOutboundMapper, LswMaterialOutbound> implements ILswMaterialOutboundService {
}
src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package org.jeecg.modules.lsw.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.lsw.entity.LswMaterial;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper;
import org.jeecg.modules.lsw.mapper.LswMaterialMapper;
import org.jeecg.modules.lsw.service.ILswMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
 * @Description: çº¿è¾¹åº“物料信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Service
public class LswMaterialServiceImpl extends ServiceImpl<LswMaterialMapper, LswMaterial> implements ILswMaterialService {
    @Autowired
    private LswMaterialMapper lswMaterialMapper;
    @Autowired
    private LswMaterialInventoryMapper lswMaterialInventoryMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveMain(LswMaterial lswMaterial, List<LswMaterialInventory> lswMaterialInventoryList) {
        lswMaterialMapper.insert(lswMaterial);
        if(lswMaterialInventoryList!=null && lswMaterialInventoryList.size()>0) {
            for(LswMaterialInventory entity:lswMaterialInventoryList) {
                //外键设置
                entity.setMaterialId(lswMaterial.getId());
                lswMaterialInventoryMapper.insert(entity);
            }
        }
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList) {
        lswMaterialMapper.updateById(lswMaterial);
        //1.先删除子表数据
        lswMaterialInventoryMapper.deleteByMainId(lswMaterial.getId());
        //2.子表数据重新插入
        if(lswMaterialInventoryList!=null && lswMaterialInventoryList.size()>0) {
            for(LswMaterialInventory entity:lswMaterialInventoryList) {
                //外键设置
                entity.setMaterialId(lswMaterial.getId());
                lswMaterialInventoryMapper.insert(entity);
            }
        }
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delMain(String id) {
        lswMaterialInventoryMapper.deleteByMainId(id);
        lswMaterialMapper.deleteById(id);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delBatchMain(Collection<? extends Serializable> idList) {
        for(Serializable id:idList) {
            lswMaterialInventoryMapper.deleteByMainId(id.toString());
            lswMaterialMapper.deleteById(id);
        }
    }
}
src/main/java/org/jeecg/modules/lsw/vo/LswMaterialPage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package org.jeecg.modules.lsw.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.lsw.entity.LswMaterialInventory;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
 * @Description: çº¿è¾¹åº“物料信息
 * @Author: jeecg-boot
 * @Date:   2025-06-30
 * @Version: V1.0
 */
@Data
@ApiModel(value="lsw_materialPage对象", description="线边库物料信息")
public class LswMaterialPage {
    /**主键*/
    @ApiModelProperty(value = "主键")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
    /**删除标记*/
    @Excel(name = "删除标记", width = 15)
    @ApiModelProperty(value = "删除标记")
    private Integer delFlag;
    /**物料编码*/
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialNumber;
    /**物料名称*/
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;
    /**物料型号*/
    @Excel(name = "物料型号", width = 15)
    @ApiModelProperty(value = "物料型号")
    private String materialModel;
    /**物料类型*/
    @Excel(name = "物料类型", width = 15, dicCode = "material_category")
    @Dict(dicCode = "material_category")
    @ApiModelProperty(value = "物料类型")
    private String materialCategory;
    /**单位*/
    @Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    private String materialUnit;
    @ExcelCollection(name="物料库存信息")
    @ApiModelProperty(value = "物料库存信息")
    private List<LswMaterialInventory> lswMaterialInventoryList;
}