| | |
| | | package org.jeecg.modules.pms.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.pms.entity.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsService; |
| | | 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; |
| | | import java.util.Map; |
| | | 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; |
| | | |
| | | /** |
| | | * @Description: 订单BOM |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-01 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="订单BOM") |
| | | * @Description: 订单BOM |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-01 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "订单BOM") |
| | | @RestController |
| | | @RequestMapping("/pmsprocessbillmaterials/pmsProcessBillMaterials") |
| | | @RequestMapping("/pms/processBillMaterials") |
| | | @Slf4j |
| | | public class PmsProcessBillMaterialsController extends JeecgController<PmsProcessBillMaterials, IPmsProcessBillMaterialsService> { |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsService pmsProcessBillMaterialsService; |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsService pmsProcessBillMaterialsService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param pmsProcessBillMaterials |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "订单BOM-分页列表查询") |
| | | @ApiOperation(value="订单BOM-分页列表查询", notes="订单BOM-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<PmsProcessBillMaterials>> queryPageList(PmsProcessBillMaterials pmsProcessBillMaterials, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<PmsProcessBillMaterials> queryWrapper = QueryGenerator.initQueryWrapper(pmsProcessBillMaterials, req.getParameterMap()); |
| | | Page<PmsProcessBillMaterials> page = new Page<PmsProcessBillMaterials>(pageNo, pageSize); |
| | | IPage<PmsProcessBillMaterials> pageList = pmsProcessBillMaterialsService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param pmsProcessBillMaterials |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "订单BOM-添加") |
| | | @ApiOperation(value="订单BOM-添加", notes="订单BOM-添加") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody PmsProcessBillMaterials pmsProcessBillMaterials) { |
| | | pmsProcessBillMaterialsService.save(pmsProcessBillMaterials); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param pmsProcessBillMaterials |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "订单BOM-编辑") |
| | | @ApiOperation(value="订单BOM-编辑", notes="订单BOM-编辑") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody PmsProcessBillMaterials pmsProcessBillMaterials) { |
| | | pmsProcessBillMaterialsService.updateById(pmsProcessBillMaterials); |
| | | return Result.OK("编辑成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "订单BOM-通过id删除") |
| | | @ApiOperation(value="订单BOM-通过id删除", notes="订单BOM-通过id删除") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | pmsProcessBillMaterialsService.removeById(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "订单BOM-批量删除") |
| | | @ApiOperation(value="订单BOM-批量删除", notes="订单BOM-批量删除") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.pmsProcessBillMaterialsService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("批量删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "订单BOM-通过id查询") |
| | | @ApiOperation(value="订单BOM-通过id查询", notes="订单BOM-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<PmsProcessBillMaterials> queryById(@RequestParam(name="id",required=true) String id) { |
| | | PmsProcessBillMaterials pmsProcessBillMaterials = pmsProcessBillMaterialsService.getById(id); |
| | | if(pmsProcessBillMaterials==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(pmsProcessBillMaterials); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param pmsProcessBillMaterials |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, PmsProcessBillMaterials pmsProcessBillMaterials) { |
| | | return super.exportXls(request, pmsProcessBillMaterials, PmsProcessBillMaterials.class, "订单BOM"); |
| | | } |
| | | |
| | | /** |
| | | * 通过excel导入数据 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("pms_process_bill_materials:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, PmsProcessBillMaterials.class); |
| | | } |
| | | @GetMapping(value = "/searchlikeQuery") |
| | | public Result<?> searchlikeQuery(PmsProcessBillMaterials pmsProcessBillMaterials, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req){ |
| | | IPage<Map<String, Object>> pageList = pmsProcessBillMaterialsService.getpmsProcessBillMaterialsListData(pageNo,pageSize,req); |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param query |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单BOM-分页列表查询", notes = "订单BOM-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<PmsProcessBillMaterials>> queryPageList(PmsProcessBillMaterials query, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | // QueryWrapper<PmsProcessBillMaterials> queryWrapper = QueryGenerator.initQueryWrapper(pmsProcessBillMaterials, req.getParameterMap()); |
| | | Page<PmsProcessBillMaterials> page = new Page<PmsProcessBillMaterials>(pageNo, pageSize); |
| | | IPage<PmsProcessBillMaterials> pageList = pmsProcessBillMaterialsService.queryPageList(page, query); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "订单BOM-通过id查询") |
| | | @ApiOperation(value = "订单BOM-通过id查询", notes = "订单BOM-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<PmsProcessBillMaterials> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | PmsProcessBillMaterials pmsProcessBillMaterials = pmsProcessBillMaterialsService.getById(id); |
| | | if (pmsProcessBillMaterials == null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(pmsProcessBillMaterials); |
| | | } |
| | | } |