| | |
| | | package com.vincent.rsf.server.api.controller.pda; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.api.entity.params.CallForEmptyContainersParam; |
| | | import com.vincent.rsf.server.api.entity.params.ContainerWaveParam; |
| | | import com.vincent.rsf.server.api.entity.params.OrderOutGeneralParam; |
| | | import com.vincent.rsf.server.api.service.PdaOutStockService; |
| | | import com.vincent.rsf.server.manager.entity.WkOrder; |
| | | import com.vincent.rsf.server.manager.entity.WkOrderItem; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.service.OutStockItemService; |
| | | import com.vincent.rsf.server.manager.service.OutStockService; |
| | | import com.vincent.rsf.server.system.constant.DictTypeCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.entity.DictData; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = "PDA出库操作接口") |
| | | @RequestMapping("/pda") |
| | | @RestController |
| | | public class PdaOutStockController { |
| | | public class PdaOutStockController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PdaOutStockService pdaOutStockService; |
| | | @Resource |
| | | private OutStockService outStockService; |
| | | @Resource |
| | | private OutStockItemService outStockItemService; |
| | | @Autowired |
| | | private DictDataService dictDataService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @GetMapping("/outStockTaskItem/{barcode}") |
| | |
| | | public R getOutStockTaskItem(@PathVariable String barcode) { |
| | | |
| | | return pdaOutStockService.getOutStockTaskItem(barcode); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @GetMapping("/saveOutTaskSts/{barcode}") |
| | | @ApiOperation("快速拣货") |
| | | public R saveOutTaskSts(@PathVariable String barcode) { |
| | | |
| | | return pdaOutStockService.saveOutTaskSts(barcode); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | |
| | | |
| | | return pdaOutStockService.getContainerWaveList(map); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @PostMapping("/saveWavePick") |
| | | @ApiOperation("根据容器码查询波次及出库单") |
| | | public R saveWavePick(@RequestBody ContainerWaveParam containerWaveParam) { |
| | | |
| | | return pdaOutStockService.saveWavePick(containerWaveParam,getLoginUserId()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @PostMapping("/callForEmptyContainers") |
| | | @ApiOperation("呼叫空容器") |
| | | public R callForEmptyContainers(@RequestBody CallForEmptyContainersParam containerWaveParam) { |
| | | |
| | | return pdaOutStockService.callForEmptyContainers(containerWaveParam,getLoginUserId()); |
| | | } |
| | | |
| | | // @PreAuthorize("hasAuthority('manager:outStock:list')") |
| | | @PostMapping("/outStockItem/page") |
| | | public R page(@RequestBody JSONObject param) { |
| | | |
| | | return R.ok().add(outStockItemService.list(new LambdaQueryWrapper<>(WkOrderItem.class).eq(WkOrderItem::getDeleted, 0) |
| | | .eq(WkOrderItem::getOrderCode, param.getString("orderId")))); |
| | | } |
| | | |
| | | @PostMapping("/orderOut/getType") |
| | | public R orderOutGetType(@RequestBody OrderOutGeneralParam param) { |
| | | if (Cools.isEmpty(param)){ |
| | | return R.ok(); |
| | | } |
| | | |
| | | List<DictData> dictData = dictDataService.list(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_BUSINESS_TYPE) |
| | | .in(DictData::getValue, param.getType()) |
| | | ); |
| | | return R.ok(dictData); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderOut/list") |
| | | public R pdaPageList(@RequestParam(required = true)String orderNo, |
| | | @RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "5")Integer limit){ |
| | | |
| | | Page<WkOrder> page = new Page<>(curr, limit); |
| | | LambdaQueryWrapper<WkOrder> wkOrderLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | wkOrderLambdaQueryWrapper.eq(WkOrder::getType, OrderType.ORDER_OUT.type); |
| | | wkOrderLambdaQueryWrapper.eq(!Cools.isEmpty(orderNo),WkOrder::getCode, orderNo); |
| | | Page<WkOrder> wkOrderPage = outStockService.page(page, wkOrderLambdaQueryWrapper); |
| | | return R.ok(wkOrderPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderOut/detlList") |
| | | public R orderOutDetlList(@RequestParam(required = true)String orderNo){ |
| | | |
| | | if (Cools.isEmpty(orderNo)){ |
| | | return R.error("订单号为空"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<WkOrderItem> wkOrderLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // wkOrderLambdaQueryWrapper.eq(WkOrderItem::getType, OrderType.ORDER_OUT.type); |
| | | wkOrderLambdaQueryWrapper.eq(!Cools.isEmpty(orderNo),WkOrderItem::getOrderCode, orderNo); |
| | | List<WkOrderItem> list = outStockItemService.list(wkOrderLambdaQueryWrapper); |
| | | return R.ok(list); |
| | | |
| | | } |
| | | |
| | | @PostMapping("/orderOut/getOutLocView") |
| | | public R orderOutGetOutLocView(@RequestBody OrderOutGeneralParam param) { |
| | | //参数 param.getOrderItemId() |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |