art: 订单BOM、物料工序 后端代码修改、优化
| | |
| | | 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 |
| | | */ |
| | | /** |
| | | * 编辑 |
| | | * 根据ID更新物料工序信息 |
| | | * |
| | | * @param pmsMaterialProcess 物料工序实体对象(包含需要更新的ID和修改后的字段值) |
| | | * - 必须包含有效的物料工序ID |
| | | * - 仅更新实体中非空的字段 |
| | | * @return 返回统一格式的响应结果,包含操作状态和提示信息 |
| | | * @apiNote 该操作需要实体中包含有效ID,执行基于主键的字段级更新 |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @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/pmsProcessBillMaterialsDetail") |
| | | @RequestMapping("/pms/processBillMaterialsDetail") |
| | | @Slf4j |
| | | public class PmsProcessBillMaterialsDetailController extends JeecgController<PmsProcessBillMaterialsDetail, IPmsProcessBillMaterialsDetailService> { |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsDetailService pmsProcessBillMaterialsDetailService; |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsDetailService pmsProcessBillMaterialsDetailService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param pmsProcessBillMaterialsDetail |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "物料清单-分页列表查询") |
| | | @ApiOperation(value="物料清单-分页列表查询", notes="物料清单-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<PmsProcessBillMaterialsDetail>> queryPageList(PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<PmsProcessBillMaterialsDetail> queryWrapper = QueryGenerator.initQueryWrapper(pmsProcessBillMaterialsDetail, req.getParameterMap()); |
| | | Page<PmsProcessBillMaterialsDetail> page = new Page<PmsProcessBillMaterialsDetail>(pageNo, pageSize); |
| | | IPage<PmsProcessBillMaterialsDetail> pageList = pmsProcessBillMaterialsDetailService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param pmsProcessBillMaterialsDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "物料清单-添加") |
| | | @ApiOperation(value="物料清单-添加", notes="物料清单-添加") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials_detail:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail) { |
| | | pmsProcessBillMaterialsDetailService.save(pmsProcessBillMaterialsDetail); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param pmsProcessBillMaterialsDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "物料清单-编辑") |
| | | @ApiOperation(value="物料清单-编辑", notes="物料清单-编辑") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials_detail:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail) { |
| | | pmsProcessBillMaterialsDetailService.updateById(pmsProcessBillMaterialsDetail); |
| | | return Result.OK("编辑成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "物料清单-通过id删除") |
| | | @ApiOperation(value="物料清单-通过id删除", notes="物料清单-通过id删除") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials_detail:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | pmsProcessBillMaterialsDetailService.removeById(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "物料清单-批量删除") |
| | | @ApiOperation(value="物料清单-批量删除", notes="物料清单-批量删除") |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials_detail:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.pmsProcessBillMaterialsDetailService.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<PmsProcessBillMaterialsDetail> queryById(@RequestParam(name="id",required=true) String id) { |
| | | PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail = pmsProcessBillMaterialsDetailService.getById(id); |
| | | if(pmsProcessBillMaterialsDetail==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(pmsProcessBillMaterialsDetail); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param pmsProcessBillMaterialsDetail |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:pms_process_bill_materials_detail:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail) { |
| | | return super.exportXls(request, pmsProcessBillMaterialsDetail, PmsProcessBillMaterialsDetail.class, "物料清单"); |
| | | } |
| | | |
| | | /** |
| | | * 通过excel导入数据 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("pms_process_bill_materials_detail:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, PmsProcessBillMaterialsDetail.class); |
| | | } |
| | | @ApiOperation(value="物料清单-通过生产物料ID查询", notes="物料清单-通过id查询") |
| | | @ApiOperation(value = "物料清单-通过生产物料ID查询", notes = "物料清单-通过id查询") |
| | | @GetMapping(value = "/queryByMaterialId") |
| | | public Result<PmsProcessBillMaterialsDetail> queryByMaterialId(@RequestParam(name="materialId",required=true) String materialId) { |
| | | PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail = pmsProcessBillMaterialsDetailService.queryByMaterialId(materialId); |
| | | if(pmsProcessBillMaterialsDetail==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | return Result.OK(pmsProcessBillMaterialsDetail); |
| | | } |
| | | |
| | | @GetMapping(value = "/searchlikeQuery") |
| | | public Result<?> searchlikeQuery(PmsProcessBillMaterialsDetail pmsProcessBillMaterialsDetail, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req){ |
| | | IPage<Map<String, Object>> pageList = pmsProcessBillMaterialsDetailService.getpmsProcessBillMaterialsDetailListData(pageNo,pageSize,req); |
| | | |
| | | return Result.OK(pageList); |
| | | public Result<?> queryByMaterialId(@RequestParam(name = "materialId", required = true) String materialId) { |
| | | List<PmsProcessBillMaterialsDetail> list = pmsProcessBillMaterialsDetailService.queryByMaterialId(materialId); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.pms.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | /**控制码*/ |
| | | @ApiModelProperty(value = "控制码") |
| | | private String controlCode; |
| | | /** 订单号 */ |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableField(exist = false) |
| | | private String orderCode; |
| | | |
| | | public PmsMaterialProcess(){} |
| | | |
| | |
| | | package org.jeecg.modules.pms.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | /**订单数量*/ |
| | | @ApiModelProperty(value = "订单数量") |
| | | private BigDecimal productionQuantity; |
| | | /** 订单号 */ |
| | | @ApiModelProperty(value = "订单号") |
| | | @TableField(exist = false) |
| | | private String orderCode; |
| | | } |
| | |
| | | package org.jeecg.modules.pms.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.pms.entity.PmsMaterialProcess; |
| | | |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface PmsMaterialProcessMapper extends BaseMapper<PmsMaterialProcess> { |
| | | IPage<Map<String, Object>> getpmsMaterialProcessListData(IPage<Map> pageData, @Param("params")Map<String, String> paramMap); |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | IPage<PmsMaterialProcess> queryPageList(Page<PmsMaterialProcess> page, @Param("ew") QueryWrapper<PmsMaterialProcess> queryWrapper); |
| | | } |
| | |
| | | package org.jeecg.modules.pms.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 订单BOM |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-01 |
| | | * @Date: 2025-07-01 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface PmsProcessBillMaterialsMapper extends BaseMapper<PmsProcessBillMaterials> { |
| | | IPage<Map<String, Object>> getpmsProcessBillMaterialsListData(IPage<Map> pageData, @Param("params")Map<String, String> paramMap); |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | IPage<PmsProcessBillMaterials> queryPageList(Page<PmsProcessBillMaterials> page, @Param("ew") QueryWrapper<PmsProcessBillMaterials> queryWrapper); |
| | | } |
| | |
| | | <?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.pms.mapper.PmsMaterialProcessMapper"> |
| | | <select id="getpmsMaterialProcessListData" parameterType="Map" resultType="Map"> |
| | | select * from pms_material_process WHERE 1=1 |
| | | <if test="params.materialNumber != null and params.materialNumber != ''"> |
| | | AND material_number LIKE CONCAT('%', #{params.materialNumber}, '%') |
| | | </if> |
| | | <if test="params.materialName != null and params.materialName != ''"> |
| | | AND material_name LIKE CONCAT('%', #{params.materialName}, '%') |
| | | </if> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.pms.entity.PmsMaterialProcess"> |
| | | select pbm.*, po.order_code |
| | | from pms_material_process pbm |
| | | left join mes_production_order po on pbm.order_id = po.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.pms.mapper.PmsProcessBillMaterialsMapper"> |
| | | <select id="getpmsProcessBillMaterialsListData" parameterType="Map" resultType="Map"> |
| | | select * from pms_process_bill_materials WHERE 1=1 |
| | | <if test="params.materialNumber != null and params.materialNumber != ''"> |
| | | AND material_number LIKE CONCAT('%', #{params.materialNumber}, '%') |
| | | </if> |
| | | <if test="params.materialName != null and params.materialName != ''"> |
| | | AND material_name LIKE CONCAT('%', #{params.materialName}, '%') |
| | | </if> |
| | | <select id="queryPageList" resultType="org.jeecg.modules.pms.entity.PmsProcessBillMaterials"> |
| | | select pbm.*, po.order_code |
| | | from pms_process_bill_materials pbm |
| | | left join mes_production_order po on pbm.order_id = po.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.pms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.pms.entity.PmsMaterialProcess; |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IPmsMaterialProcessService extends IService<PmsMaterialProcess> { |
| | | IPage<Map<String, Object>> getpmsMaterialProcessListData(Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | |
| | | /** |
| | | * |
| | | * @param orderMap |
| | |
| | | * @param orderId |
| | | */ |
| | | void removeByOrderId(String orderId); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<PmsMaterialProcess> queryPageList(Page<PmsMaterialProcess> page, PmsMaterialProcess query); |
| | | } |
| | |
| | | package org.jeecg.modules.pms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.sap.dto.OrderBomDTO; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 物料清单 |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IPmsProcessBillMaterialsDetailService extends IService<PmsProcessBillMaterialsDetail> { |
| | | PmsProcessBillMaterialsDetail queryByMaterialId(String materialId); |
| | | IPage<Map<String, Object>> getpmsProcessBillMaterialsDetailListData(Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | List<PmsProcessBillMaterialsDetail> queryByMaterialId(String materialId); |
| | | |
| | | /** |
| | | * 删除原有的数据 |
| | |
| | | package org.jeecg.modules.pms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.sap.dto.OrderBomDTO; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IPmsProcessBillMaterialsService extends IService<PmsProcessBillMaterials> { |
| | | IPage<Map<String, Object>> getpmsProcessBillMaterialsListData(Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | |
| | | /** |
| | | * 批量保存或更新订单BOM数据 |
| | | * @param orderMap |
| | |
| | | * @return |
| | | */ |
| | | PmsProcessBillMaterials getByOrderId(String orderId); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<PmsProcessBillMaterials> queryPageList(Page<PmsProcessBillMaterials> page, PmsProcessBillMaterials query); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.pms.entity.PmsMaterialProcess; |
| | | import org.jeecg.modules.pms.mapper.PmsMaterialProcessMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | */ |
| | | @Service |
| | | public class PmsMaterialProcessServiceImpl extends ServiceImpl<PmsMaterialProcessMapper, PmsMaterialProcess> implements IPmsMaterialProcessService { |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getpmsMaterialProcessListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | Map<String, String> paramMap = new HashMap<String, String>(); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | if (null != parameterMap) { |
| | | if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { |
| | | paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); |
| | | } |
| | | if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { |
| | | paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); |
| | | } |
| | | if (parameterMap.containsKey("batchNumber") && StringUtils.isNotBlank(parameterMap.get("batchNumber")[0])) { |
| | | paramMap.put("batchNumber", parameterMap.get("batchNumber")[0].trim()); |
| | | } |
| | | } |
| | | return super.getBaseMapper().getpmsMaterialProcessListData(pageData, paramMap); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | queryWrapper.eq(PmsMaterialProcess::getOrderId, orderId); |
| | | super.remove(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PmsMaterialProcess> queryPageList(Page<PmsMaterialProcess> page, PmsMaterialProcess query) { |
| | | QueryWrapper<PmsMaterialProcess> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.orderByDesc("pbm.create_time"); |
| | | if (query != null) { |
| | | //物料编码 模糊查询 |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getMaterialNumber())) { |
| | | queryWrapper.like("pbm.material_number", query.getMaterialNumber()); |
| | | } |
| | | //物料名称 模糊查询 |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getMaterialName())) { |
| | | queryWrapper.like("pbm.material_name", query.getMaterialName()); |
| | | } |
| | | //工序号 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getProcessCode())) { |
| | | queryWrapper.like("pbm.process_code", query.getProcessCode()); |
| | | } |
| | | //订单号 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getOrderCode())) { |
| | | queryWrapper.like("po.order_code", query.getOrderCode()); |
| | | } |
| | | } |
| | | return this.getBaseMapper().queryPageList(page, queryWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.mapper.PmsProcessBillMaterialsDetailMapper; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public class PmsProcessBillMaterialsDetailServiceImpl extends ServiceImpl<PmsProcessBillMaterialsDetailMapper, PmsProcessBillMaterialsDetail> implements IPmsProcessBillMaterialsDetailService { |
| | | |
| | | @Override |
| | | public PmsProcessBillMaterialsDetail queryByMaterialId(String materialId) { |
| | | return baseMapper.queryByMaterialId(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getpmsProcessBillMaterialsDetailListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | Map<String, String> paramMap = new HashMap<String, String>(); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | if (null != parameterMap) { |
| | | if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { |
| | | paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); |
| | | } |
| | | if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { |
| | | paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); |
| | | } |
| | | if (parameterMap.containsKey("batchNumber") && StringUtils.isNotBlank(parameterMap.get("batchNumber")[0])) { |
| | | paramMap.put("batchNumber", parameterMap.get("batchNumber")[0].trim()); |
| | | } |
| | | } |
| | | return super.getBaseMapper().getpmsProcessBillMaterialsDetailListData(pageData, paramMap); |
| | | public List<PmsProcessBillMaterialsDetail> queryByMaterialId(String materialId) { |
| | | LambdaQueryWrapper<PmsProcessBillMaterialsDetail> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PmsProcessBillMaterialsDetail::getMaterialId, materialId); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.pms.mapper.PmsProcessBillMaterialsMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | private IPmsProcessBillMaterialsDetailService processBillMaterialsDetailService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getpmsProcessBillMaterialsListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | Map<String, String> paramMap = new HashMap<String, String>(); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | if (null != parameterMap) { |
| | | if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { |
| | | paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); |
| | | } |
| | | if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { |
| | | paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); |
| | | } |
| | | if (parameterMap.containsKey("batchNumber") && StringUtils.isNotBlank(parameterMap.get("batchNumber")[0])) { |
| | | paramMap.put("batchNumber", parameterMap.get("batchNumber")[0].trim()); |
| | | } |
| | | } |
| | | return super.getBaseMapper().getpmsProcessBillMaterialsListData(pageData, paramMap); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdateOrderBom(Map<String, MesProductionOrder> orderMap, List<OrderBomDTO> orderBomDTOList) { |
| | | for (Map.Entry<String, MesProductionOrder> entry : orderMap.entrySet()) { |
| | | for (Map.Entry<String, MesProductionOrder> entry : orderMap.entrySet()) { |
| | | MesProductionOrder order = entry.getValue(); |
| | | PmsProcessBillMaterials materials = getByOrderId(order.getId()); |
| | | if(materials != null) { |
| | | if (materials != null) { |
| | | //更新物料数据 |
| | | materials.setOrderId(order.getId()); |
| | | materials.setMaterialNumber(order.getMaterialNumber()); |
| | |
| | | //过滤出此订单的物料信息 |
| | | List<OrderBomDTO> collect = orderBomDTOList.stream().filter(orderBomDTO -> entry.getKey().equals(orderBomDTO.getAUFNR())).collect(Collectors.toList()); |
| | | processBillMaterialsDetailService.saveBatchDetail(materials.getId(), collect); |
| | | }else { |
| | | } else { |
| | | materials = new PmsProcessBillMaterials(); |
| | | materials.setOrderId(order.getId()); |
| | | materials.setMaterialNumber(order.getMaterialNumber()); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PmsProcessBillMaterials> queryPageList(Page<PmsProcessBillMaterials> page, PmsProcessBillMaterials query) { |
| | | QueryWrapper<PmsProcessBillMaterials> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.orderByDesc("pbm.create_time"); |
| | | if (query != null) { |
| | | //物料编码 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getMaterialNumber())) { |
| | | queryWrapper.like("pbm.material_number", query.getMaterialNumber()); |
| | | } |
| | | //物料名称 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getMaterialName())) { |
| | | queryWrapper.like("pbm.material_name", query.getMaterialName()); |
| | | } |
| | | //订单号 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getOrderCode())) { |
| | | queryWrapper.like("po.order_code", query.getOrderCode()); |
| | | } |
| | | } |
| | | return this.getBaseMapper().queryPageList(page, queryWrapper); |
| | | } |
| | | } |