|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.domain.param.FullStoreParam; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.param.LocDetlAdjustParam; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.param.StockOutParam; | 
|---|
|  |  |  | import com.zy.asrs.common.web.BaseController; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.BasDevpService; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.WorkService; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.framework.annotations.ManagerAuth; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.R; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping("/available/put/site") | 
|---|
|  |  |  | @ManagerAuth() | 
|---|
|  |  |  | public R availablePutSite(){ | 
|---|
|  |  |  | return R.ok().add(basDevpService.getAvailableInSite()); | 
|---|
|  |  |  | return R.ok().add(basDevpService.getAvailableInSite(getHostId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/available/empty/put/site") | 
|---|
|  |  |  | @ManagerAuth() | 
|---|
|  |  |  | public R availableEmptyPutSite(){ | 
|---|
|  |  |  | return R.ok().add(basDevpService.getAvailableEmptyInSite(getHostId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/available/take/site") | 
|---|
|  |  |  | @ManagerAuth() | 
|---|
|  |  |  | public R availableTakeSite(){ | 
|---|
|  |  |  | Long hostId = getHostId(); | 
|---|
|  |  |  | List<Map<String, Object>> result = new ArrayList<>(); | 
|---|
|  |  |  | List<Integer> outSite = basDevpService.getAvailableOutSite(101); | 
|---|
|  |  |  | List<Integer> outSite = basDevpService.getAvailableOutSite(101, hostId); | 
|---|
|  |  |  | for (Integer siteId : outSite) { | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("siteId", siteId); | 
|---|
|  |  |  | map.put("desc", siteId + "(全板出库口)"); | 
|---|
|  |  |  | result.add(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); | 
|---|
|  |  |  | List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103, hostId); | 
|---|
|  |  |  | for (Integer siteId : pickOutSite) { | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("siteId", siteId); | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok().add(result); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/available/take/check/site") | 
|---|
|  |  |  | @ManagerAuth() | 
|---|
|  |  |  | public R availableTakeCheckSite(){ | 
|---|
|  |  |  | return R.ok().add(basDevpService.getAvailableOutSite(107, getHostId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/full/store/put/start") | 
|---|
|  |  |  | @ManagerAuth(memo = "全板入库") | 
|---|
|  |  |  | public R fullStorePutStart(@RequestBody FullStoreParam fullStoreParam) { | 
|---|
|  |  |  | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam, getUserId(), getHostId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/plate/out/start") | 
|---|
|  |  |  | @ManagerAuth(memo = "出库作业") | 
|---|
|  |  |  | public R fullStoreTakeStart(@RequestBody StockOutParam param) { | 
|---|
|  |  |  | workService.startupFullTakeStore(param, getUserId(), getHostId()); | 
|---|
|  |  |  | return R.ok("出库启动成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/hand/control/wrkMast") | 
|---|
|  |  |  | @ManagerAuth(memo = "手动处理工作档") | 
|---|
|  |  |  | public R handControlWrkMast(@RequestParam String workNo, | 
|---|
|  |  |  | @RequestParam Integer type){ | 
|---|
|  |  |  | if (type == 1) { | 
|---|
|  |  |  | workService.completeWrkMast(workNo, getUserId(), getHostId()); | 
|---|
|  |  |  | return R.ok("工作档已完成"); | 
|---|
|  |  |  | } else if (type == 2) { | 
|---|
|  |  |  | workService.cancelWrkMast(workNo, getUserId(), getHostId()); | 
|---|
|  |  |  | return R.ok("工作档已取消"); | 
|---|
|  |  |  | } else if (type == 3) { | 
|---|
|  |  |  | workService.pickWrkMast(workNo, getUserId(), getHostId()); | 
|---|
|  |  |  | return R.ok("工作档已拣料"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping("/locDdetl/adjust/start") | 
|---|
|  |  |  | @ManagerAuth(memo = "库存调整") | 
|---|
|  |  |  | public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) { | 
|---|
|  |  |  | workService.adjustLocDetl(param, getUserId(), getHostId()); | 
|---|
|  |  |  | return R.ok("库存调整成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|