| | |
| | | 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.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 org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 物料出库单 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="物料出库单") |
| | | * @Description: 物料出库单 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "物料出库单") |
| | | @RestController |
| | | @RequestMapping("/lswmaterialoutbound/lswMaterialOutbound") |
| | | @RequestMapping("/lsw/materialOutbound") |
| | | @Slf4j |
| | | public class LswMaterialOutboundController extends JeecgController<LswMaterialOutbound, ILswMaterialOutboundService> { |
| | | @Autowired |
| | | private ILswMaterialOutboundService lswMaterialOutboundService; |
| | | @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); |
| | | } |
| | | @GetMapping(value = "/searchlikeQuery") |
| | | public Result<?> searchlikeQuery(LswMaterialOutbound lswMaterialOutbound, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req){ |
| | | IPage<Map<String, Object>> pageList = lswMaterialOutboundService.getlswMaterialOutboundListData(pageNo,pageSize,req); |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param lswMaterialOutbound |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @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); |
| | | } |
| | | |