| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.StaDesc; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.StaDescService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.utils.RoleUtils; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 工作流接口控制器 |
| | |
| | | private WorkService workService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | |
| | | @RequestMapping("/locMerge/out/start") |
| | | @ManagerAuth(memo = "并板出库") |
| | | public R locMergeOutStart(@RequestBody StockOutParam param) { |
| | | workService.locMergeOut(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | @RequestMapping("/available/put/site") |
| | | @ManagerAuth() |
| | |
| | | @RequestMapping("/available/take/site") |
| | | @ManagerAuth() |
| | | public R availableTakeSite(){ |
| | | Set<Map<String, Object>> result = new HashSet<>(); |
| | | EntityWrapper<StaDesc> wrapper = new EntityWrapper<>(); |
| | | // 不同继承角色显示不同库信息 |
| | | RoleUtils.addRoleWrapperByCrn(getUserId(),wrapper); |
| | | wrapper.eq("type_no",101); |
| | | List<StaDesc> staDescs = staDescService.selectList(wrapper); |
| | | List<Integer> outSite = staDescs.stream().map(StaDesc::getStnNo).distinct().collect(Collectors.toList()); |
| | | // List<Integer> outSite = basDevpService.getAvailableOutSite(101); |
| | | for (Integer siteId : outSite) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", siteId); |
| | | map.put("desc","["+ Utils.getStaName(siteId)+"]"); |
| | | result.add(map); |
| | | } |
| | | |
| | | EntityWrapper<StaDesc> wrapper2 = new EntityWrapper<>(); |
| | | wrapper2.eq("type_no",103); |
| | | List<StaDesc> staDescs2 = staDescService.selectList(wrapper2); |
| | | List<Integer> pickOutSite = staDescs2.stream().map(StaDesc::getStnNo).distinct().collect(Collectors.toList()); |
| | | |
| | | // List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); |
| | | for (Integer siteId : pickOutSite) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", siteId); |
| | | map.put("desc","["+ Utils.getStaName(siteId)+"]"); |
| | | result.add(map); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | @RequestMapping("/crn/available/take/site") |
| | | @ManagerAuth() |
| | | public R crnAvailableTakeSite(){ |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | List<Integer> outSite = basDevpService.getAvailableOutSite(101); |
| | | List<Integer> outSite = basDevpService.getCrnAvailableOutSite(101); |
| | | 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.getCrnAvailableOutSite(103); |
| | | for (Integer siteId : pickOutSite) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", siteId); |
| | |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/merge/site") |
| | | @ManagerAuth() |
| | | public R availableTakeMergeSite(){ |
| | | return R.ok().add(basDevpService.getAvailableOutSite(104)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/crn") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteCrn(){ |
| | | EntityWrapper<StaDesc> staDescEntityWrapper = new EntityWrapper<>(); |
| | | staDescEntityWrapper.eq("type_no",107); |
| | | staDescEntityWrapper.setSqlSelect("DISTINCT stn_no as stnNo"); |
| | | staDescEntityWrapper.in("crn_no",1,2,3,4,5,6,7); |
| | | return R.ok().add(staDescService.selectList(staDescEntityWrapper)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/ctu") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteCtu(){ |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/take/check/site/shuttle") |
| | | @ManagerAuth() |
| | | public R availableTakeCheckSiteShuttle(){ |
| | | return R.ok().add(basDevpService.getAvailableOutSite(107)); |
| | | } |
| | | |
| | | @RequestMapping("/available/crn/empty/take/site") |
| | | @ManagerAuth() |
| | | public R availablecrnEmptyTakeSite(){ |
| | | return R.ok().add(basDevpService.getCrnAvailableEmptyOutSite()); |
| | | } |
| | | |
| | | @RequestMapping("/available/shuttle/empty/take/site") |
| | | @ManagerAuth() |
| | | public R availableshuttleEmptyTakeSite(){ |
| | | return R.ok().add(basDevpService.getShuttleAvailableEmptyOutSite()); |
| | | } |
| | | |
| | | @RequestMapping("/available/ctu/empty/take/site") |
| | | @ManagerAuth() |
| | | public R availablectuEmptyTakeSite(){ |
| | | return R.ok().add(basDevpService.getCtuAvailableEmptyOutSite()); |
| | | } |
| | | |
| | | @RequestMapping("/available/empty/take/site") |
| | | @ManagerAuth() |
| | | public R availableEmptyTakeSite(){ |
| | | return R.ok().add(basDevpService.getAvailableEmptyOutSite()); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | EntityWrapper<StaDesc> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("type_no",110); |
| | | // 不同继承角色显示不同库信息 |
| | | // RoleUtils.addRoleWrapperByCrn(getUserId(),wrapper); |
| | | List<StaDesc> staDescs = staDescService.selectList(wrapper); |
| | | for (StaDesc staDesc : staDescs) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", staDesc.getStnNo()); |
| | | map.put("desc","["+ Utils.getStaName(staDesc.getStnNo())+"]"); |
| | | result.add(map); |
| | | } |
| | | return R.ok().add(result); |
| | | // return R.ok().add(basDevpService.getAvailableEmptyOutSite()); |
| | | } |
| | | |
| | | @RequestMapping("/full/store/put/start") |
| | | @ManagerAuth(memo = "全板入库") |
| | | public R fullStorePutStart(@RequestBody FullStoreParam fullStoreParam) { |
| | | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | try { |
| | | String locNo = workService.startupFullPutStore(fullStoreParam, getUserId()); |
| | | return R.ok("入库启动成功").add(locNo); |
| | | } catch (Exception e){ |
| | | return R.error("入库启动失败==>"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/plate/out/start") |