|
@@ -1,6 +1,6 @@
|
|
|
package com.ruoyi.web.controller.warewms.pda;
|
|
|
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
|
|
@@ -14,6 +14,7 @@ import com.ruoyi.ams.asn.service.IWmsDocAsnDetailsService;
|
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
|
|
|
import com.ruoyi.ams.asn.vo.SearchStockVO;
|
|
|
import com.ruoyi.ams.box.domain.WmsBoxInfo;
|
|
|
+import com.ruoyi.ams.box.domain.WmsBoxReqDTO;
|
|
|
import com.ruoyi.ams.box.form.AddBoxForm;
|
|
|
import com.ruoyi.ams.box.form.UpdateBoxForm;
|
|
|
import com.ruoyi.ams.box.service.IWmsBoxInfoService;
|
|
@@ -58,16 +59,20 @@ import com.ruoyi.common.utils.PageUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
import com.ruoyi.system.service.ISysDictDataService;
|
|
|
+import io.jsonwebtoken.lang.Assert;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.assertj.core.util.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* Created by IntelliJ IDEA.
|
|
@@ -867,13 +872,14 @@ public class PdaController {
|
|
|
* 根据库位获取托盘信息
|
|
|
*/
|
|
|
@PostMapping("/boxInfo/queryBoxInfo")
|
|
|
- public AjaxResult queryBoxInfo(@RequestBody WmsBoxInfo wmsBoxInfo) {
|
|
|
- wmsBoxInfo.setLocationId(Constant.LOC_SORTATION_CACHE);
|
|
|
- WmsBoxInfo boxInfo = wmsBoxInfoService.selectWmsBoxInfoByModel(wmsBoxInfo);
|
|
|
- if (ObjectUtil.isNull(boxInfo) || StringUtils.isBlank(boxInfo.getBoxNo())) {
|
|
|
- return AjaxResult.error(wmsBoxInfo.getLocationId()+"库位不存在存在该托盘");
|
|
|
- }
|
|
|
- return AjaxResult.success(wmsBoxInfo.getLocationId()+"库位存在存在该托盘");
|
|
|
+ public AjaxResult queryBoxInfo(@RequestBody @Valid WmsBoxReqDTO wmsBoxReqDTO) {
|
|
|
+ List<Long> sortLocationList = Lists.newArrayList(Constant.LOC_SORTATION_CACHE, Constant.LOC_SORTATION02_CACHE);
|
|
|
+ if (StringUtils.isBlank(wmsBoxReqDTO.getFlag()))
|
|
|
+ sortLocationList.addAll(Lists.newArrayList(Constant.LOC_STAGE_CACHE, Constant.LOC_MIDDLE_CACHE));
|
|
|
+ List<WmsBoxInfo> wmsBoxInfoList = wmsBoxInfoService.queryWmsBoxInfoByLocationIdList(sortLocationList);
|
|
|
+ List<WmsBoxInfo> boxInfoFilterList = wmsBoxInfoList.stream().filter(item -> wmsBoxReqDTO.getBoxNo().equals(item.getBoxNo())).collect(Collectors.toList());
|
|
|
+ Assert.isTrue(CollectionUtil.isNotEmpty(boxInfoFilterList), StringUtils.isBlank(wmsBoxReqDTO.getFlag()) ? "只能在虚拟区进行操作!" : "不在分拣区的托盘不可扫描");
|
|
|
+ return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
/**
|