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