|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONArray; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.entity.Parameter; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.framework.common.DateUtils; | 
|---|
|  |  |  | import com.zy.asrs.common.web.BaseController; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | 
|---|
|  |  |  | private LocMastService locMastService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private LocDetlService locDetlService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${wcs.url}") | 
|---|
|  |  |  | private String WCS_URL; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/{id}/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(param.get("loc_no"))) { | 
|---|
|  |  |  | wrapper.eq(LocMast::getLocNo, param.get("loc_no")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(param.get("loc_sts"))) { | 
|---|
|  |  |  | wrapper.eq(LocMast::getLocSts, param.get("loc_sts")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(locMastService.page(new Page<>(curr, limit), wrapper)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/group/empty/stock") | 
|---|
|  |  |  | @ManagerAuth(memo = "获取同组货架的空库位") | 
|---|
|  |  |  | public R getGroupEmptyStock(@RequestParam(required = false) String sourceLocNo) { | 
|---|
|  |  |  | return R.ok().add(locMastService.queryGroupEmptyStock(sourceLocNo, getHostId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok("初始化成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/locMast/picUrl") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R getPicUrl(@RequestParam String locNo) { | 
|---|
|  |  |  | LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>() | 
|---|
|  |  |  | .eq(LocMast::getLocNo, locNo) | 
|---|
|  |  |  | .eq(LocMast::getHostId, getHostId())); | 
|---|
|  |  |  | if (locMast == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ArrayList<String> list = new ArrayList<>(); | 
|---|
|  |  |  | String picStr = locMast.getPic(); | 
|---|
|  |  |  | if (Cools.isEmpty(picStr)) { | 
|---|
|  |  |  | return R.ok().add(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<String> pics = JSON.parseArray(picStr, String.class); | 
|---|
|  |  |  | for (String pic : pics) { | 
|---|
|  |  |  | list.add("http://" + WCS_URL + "/image/" + pic + "-1.jpg"); | 
|---|
|  |  |  | list.add("http://" + WCS_URL + "/image/" + pic + "-2.jpg"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|