| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.eam.entity.EamSparePartReceiveDetail; |
| | | import org.jeecg.modules.eam.entity.EamSparePartRequisitionDetail; |
| | | import org.jeecg.modules.eam.entity.EamSpareParts; |
| | | import org.jeecg.modules.eam.service.IEamSparePartReceiveDetailService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | |
| | | import org.jeecg.modules.eam.service.IEamSparePartsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | @Resource |
| | | private IEamSparePartReceiveDetailService eamSparePartReceiveDetailService; |
| | | |
| | | @Resource |
| | | private IEamSparePartsService eamSparePartsService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-分页列表查询") |
| | | @ApiOperation(value = "领用单明细-分页列表查询", notes = "领用单明细-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamSparePartReceiveDetail eamSparePartReceiveDetail, |
| | |
| | | QueryWrapper<EamSparePartReceiveDetail> queryWrapper = QueryGenerator.initQueryWrapper(eamSparePartReceiveDetail, req.getParameterMap()); |
| | | Page<EamSparePartReceiveDetail> page = new Page<EamSparePartReceiveDetail>(pageNo, pageSize); |
| | | IPage<EamSparePartReceiveDetail> pageList = eamSparePartReceiveDetailService.page(page, queryWrapper); |
| | | for (EamSparePartReceiveDetail record : pageList.getRecords()) { |
| | | String partId = record.getPartId(); |
| | | EamSpareParts part = eamSparePartsService.getById(partId); |
| | | record.setPartCode(part.getPartCode()); |
| | | record.setPartName(part.getPartName()); |
| | | record.setPartModel(part.getPartModel()); |
| | | record.setPartSpecification(part.getPartSpecification()); |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | * @param eamSparePartReceiveDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-添加") |
| | | @ApiOperation(value = "领用单明细-添加", notes = "领用单明细-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamSparePartReceiveDetail eamSparePartReceiveDetail) { |
| | |
| | | * @param eamSparePartReceiveDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-编辑") |
| | | @ApiOperation(value = "领用单明细-编辑", notes = "领用单明细-编辑") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamSparePartReceiveDetail eamSparePartReceiveDetail) { |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-通过id删除") |
| | | @ApiOperation(value = "领用单明细-通过id删除", notes = "领用单明细-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-批量删除") |
| | | @ApiOperation(value = "领用单明细-批量删除", notes = "领用单明细-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "领用单明细-通过id查询") |
| | | @ApiOperation(value = "领用单明细-通过id查询", notes = "领用单明细-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |