| | |
| | | package com.ruoyi.management.controller; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.management.domain.SlGoodsShelf; |
| | | import com.ruoyi.management.domain.SlVolumeProductionZy; |
| | | import com.ruoyi.management.domain.dto.*; |
| | | import com.ruoyi.management.domain.dto.ManagementimgVolumeProductionZyVO; |
| | | import com.ruoyi.management.domain.vo.*; |
| | | import com.ruoyi.management.service.SlGoodsShelfService; |
| | | import com.ruoyi.management.service.SlStoreManagementService; |
| | | import com.ruoyi.management.service.SlVolumeProductionZyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sl-volume-production-zy") |
| | | @Api(value = "发起转移接口", tags = "发起转移接口", description = "发起转移接口") |
| | | public class SlVolumeProductionZyController { |
| | | |
| | | @Resource |
| | | private SlVolumeProductionZyService slVolumeProductionZyService; |
| | | @Autowired |
| | | private SlGoodsShelfService slGoodsShelfService; |
| | | @Autowired |
| | | private SlStoreManagementService storeManagementService; |
| | | |
| | | @PostMapping("/getNumberAndShelfByManagementId") |
| | | @ApiOperation(value = "根据仓库id 查询楼层和货架") |
| | | public R<NumberAndShelfVO> getNumberAndShelfByManagementId(@RequestBody QueryDTO dto) { |
| | | return R.ok(slVolumeProductionZyService.getNumberAndShelfByManagementId(dto)); |
| | | } |
| | | @GetMapping("/getNumberAndShelf") |
| | | @ApiOperation(value = "根据仓库Id 获取楼层数量和所有货架数组") |
| | | public R<GetNumberAndShelfVO> getNumberAndShelf(Long managementId) { |
| | | GetNumberAndShelfVO getNumberAndShelfVO = new GetNumberAndShelfVO(); |
| | | getNumberAndShelfVO.setManagementNumber(storeManagementService.getById(managementId).getStoreManagementNumber()); |
| | | List<SlGoodsShelf> list = slGoodsShelfService.list(new QueryWrapper<SlGoodsShelf>() |
| | | .eq("del_flag", 0) |
| | | .eq("store_management_id", managementId)); |
| | | getNumberAndShelfVO.setList(list); |
| | | return R.ok(getNumberAndShelfVO); |
| | | } |
| | | @PostMapping("/getVolumeProductionzyCode") |
| | | @ApiOperation(value = "获取转移管理二维码") |
| | | public R<PageDTO<getVolumeProductionzyCodeVO>> getVolumeProductionzyCode(VolumeProductionZygCodeQuery volumeProductionZygCodeQuery) { |
| | | return R.ok(slVolumeProductionZyService.getVolumeProductionzyCode(volumeProductionZygCodeQuery)); |
| | | } |
| | | |
| | | @PostMapping("/addSlVolumeProductionZy") |
| | | @ApiOperation(value = "添加转移") |
| | | public R addSlVolumeProductionZy(@RequestBody ADDZYDTO addzydto) { |
| | | slVolumeProductionZyService.addSlVolumeProductionZy(addzydto); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/deleteSlVolumeProductionZyUpdate") |
| | | @ApiOperation(value = "编辑时删除转移数据") |
| | | public R addSlVolumeProductionZy(@RequestBody DeleteCKDTO dto) { |
| | | QueryWrapper<SlVolumeProductionZy> slVolumeProductionZyQueryWrapper = new QueryWrapper<>(); |
| | | slVolumeProductionZyQueryWrapper.eq("del_flag","0"); |
| | | slVolumeProductionZyQueryWrapper.eq("rk_id",dto.getRkId()); |
| | | slVolumeProductionZyQueryWrapper.eq("zygl_id",dto.getId()); |
| | | slVolumeProductionZyQueryWrapper.eq("shelf_id",dto.getShelfId()); |
| | | slVolumeProductionZyQueryWrapper.eq("store_management_number",dto.getStoreManagementNumber()); |
| | | SlVolumeProductionZy one = slVolumeProductionZyService.getOne(slVolumeProductionZyQueryWrapper); |
| | | if (one!=null){ |
| | | slVolumeProductionZyService.removeById(one.getId()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/updSlVolumeProductionZy") |
| | | @ApiOperation(value = "修改转移") |
| | | public R updSlVolumeProductionZy(@RequestBody List<UpdaddSlVolumeProductionZyDTO> updaddSlVolumeProductionZyDTO) { |
| | | slVolumeProductionZyService.updSlVolumeProductionZy(updaddSlVolumeProductionZyDTO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/getSlVolumeProductionZyList") |
| | | @ApiOperation(value = "分页获取通过转移管理ID当前出库的物资") |
| | | public R<PageDTO<ManagementimgVolumeProductionZyVO>> getSlVolumeProductionZyList(@RequestBody ManagementimgVolumeProductionZyQuery managementimgVolumeProductionZyQuery) { |
| | | return R.ok(slVolumeProductionZyService.getSlVolumeProductionZyList(managementimgVolumeProductionZyQuery)); |
| | | } |
| | | |
| | | @ApiOperation("删除转移批次") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delStoreManagement( |
| | | @ApiParam(name = "id", value = "转移批次id", required = true) @PathVariable("id") Integer id) { |
| | | SlVolumeProductionZy byId = slVolumeProductionZyService.getById(id); |
| | | byId.setDelFlag("1"); |
| | | slVolumeProductionZyService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |