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