no message
parent
7c7eac0587
commit
c67118cd5e
|
|
@ -20,9 +20,11 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.youchain.RequestData.TransTask;
|
||||
import com.youchain.appupdate.ReturnJson.ReturnTaskVo;
|
||||
import com.youchain.basicdata.domain.Area;
|
||||
import com.youchain.basicdata.domain.Item;
|
||||
import com.youchain.basicdata.domain.Point;
|
||||
import com.youchain.basicdata.domain.Stock;
|
||||
import com.youchain.basicdata.repository.AreaRepository;
|
||||
import com.youchain.basicdata.repository.PointRepository;
|
||||
import com.youchain.basicdata.service.ItemService;
|
||||
import com.youchain.basicdata.vo.BarCodeVo;
|
||||
|
|
@ -47,6 +49,8 @@ import java.sql.Timestamp;
|
|||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
|
@ -69,6 +73,7 @@ public class StockServiceImpl implements StockService {
|
|||
private final TaskRepository taskRepository;
|
||||
private final AgvTaskRepository agvTaskRepository;
|
||||
private final InventoryRepository inventoryRepository;
|
||||
private final AreaRepository areaRepository;
|
||||
private final AgvTaskService agvTaskService;
|
||||
private final ItemService itemService;
|
||||
private final ItemKeyService itemKeyService;
|
||||
|
|
@ -321,7 +326,7 @@ public class StockServiceImpl implements StockService {
|
|||
barCodeVo.setBoxNumber(map.get("S"));
|
||||
barCodeVo.setPropC3(map.get("P"));
|
||||
barCodeVo.setPropD1(map.get("D"));
|
||||
barCodeVo.setOrderQty(Double.parseDouble(getStringCode(map.get("Q"))));
|
||||
barCodeVo.setOrderQty(parseQuantityString(map.get("Q")));
|
||||
barCodeVos.add(barCodeVo);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("箱号格式错误!", e);
|
||||
|
|
@ -461,6 +466,19 @@ public class StockServiceImpl implements StockService {
|
|||
return str.substring(0, index);
|
||||
}
|
||||
|
||||
public static int parseQuantityString(String str) {
|
||||
// 定义一个正则表达式来匹配第一个数字
|
||||
Pattern pattern = Pattern.compile("\\d+");
|
||||
Matcher matcher = pattern.matcher(str);
|
||||
|
||||
// 查找第一个匹配的数字
|
||||
if (matcher.find()) {
|
||||
return Integer.parseInt(matcher.group());
|
||||
} else {
|
||||
throw new RuntimeException("数量格式错误!");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidMCArea(String areaName) {
|
||||
return AreaNameDic.DXJRKQ.equals(areaName);
|
||||
}
|
||||
|
|
@ -793,20 +811,12 @@ public class StockServiceImpl implements StockService {
|
|||
private Point validateEndPoint(String areaCode) {
|
||||
List<Point> endPointList = pointRepository.findByCode(null, BaseStatus.FREE, BaseStatus.STORAGE, areaCode, null, null);
|
||||
if (endPointList.isEmpty()) {
|
||||
throw new RuntimeException(areaCode + "没有空闲点位!");
|
||||
Area area = areaRepository.findByCode(areaCode);
|
||||
throw new RuntimeException(area.getName() + "没有空闲点位!");
|
||||
}
|
||||
return endPointList.get(0);
|
||||
}
|
||||
|
||||
private Point validateEndPoint(String code, String status, String type, String areaCode) {
|
||||
List<Point> endPointList = pointRepository.findByCode(code, status, type, areaCode, null, null);
|
||||
if (endPointList.isEmpty()) {
|
||||
throw new RuntimeException(areaCode + "没有空闲点位!");
|
||||
}
|
||||
return endPointList.get(0);
|
||||
}
|
||||
|
||||
|
||||
private void checkPointStatus(Point srcPoint) {
|
||||
if (BaseStatus.USED.equals(srcPoint.getStatus())) {
|
||||
throw new RuntimeException(srcPoint.getCode() + "点位已有任务,请勿重复操作!");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
|
|
@ -20,7 +22,6 @@ public class EladminSystemApplicationTests {
|
|||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
static Set bb(Set set1, Set set2) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue