|
@@ -7,18 +7,18 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.ruoyi.RuoYiApplication;
|
|
|
+import com.ruoyi.ams.inv.domain.InvLotAtt;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotLocId;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotAttService;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
|
-import com.ruoyi.ams.xuankuang.service.WmsDocOrderSubService;
|
|
|
import com.ruoyi.base.domain.BaseLocationInfo;
|
|
|
import com.ruoyi.base.domain.BaseSku;
|
|
|
import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
|
import com.ruoyi.base.service.IBaseSkuService;
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
-import io.netty.util.internal.SocketUtils;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.junit.Test;
|
|
@@ -132,8 +132,7 @@ public class ProcessLocationTest {
|
|
|
//查出原先的库存情况,如果当前库存SKU不符合,则生成新的批次记录
|
|
|
List<InvLotLocId> invLotLocList = invLotLocIdService.getInvLotLocList(baseLocationInfo.getId());
|
|
|
//此时数据是错的都要重新生成库存
|
|
|
- List<String> skuList = CollectionUtil.isNotEmpty(invLotLocList)
|
|
|
- ? invLotLocList.stream().map(item -> item.getSku()).collect(Collectors.toList()) : Lists.newArrayList();
|
|
|
+ List<String> skuList = CollectionUtil.isNotEmpty(invLotLocList) ? invLotLocList.stream().map(item -> item.getSku()).collect(Collectors.toList()) : Lists.newArrayList();
|
|
|
if(CollectionUtil.isEmpty(skuList) || skuList.size() > 1 || !StringUtils.equals(skuList.get(0), bindSku)){
|
|
|
//生成新的批次记录
|
|
|
String lotnum = invLotAttService.insertInvLotAtt(bindSku, palletNo);
|
|
@@ -144,13 +143,20 @@ public class ProcessLocationTest {
|
|
|
reSetLocationInfo(baseLocationInfo, bindSku, Constants.NO, skuTypeMapping);
|
|
|
return;
|
|
|
}
|
|
|
- if(CompareUtil.compare(invLotLocList.get(0).getQty(), quantity) != 0){
|
|
|
+ InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(invLotLocList.get(0).getLotnum());
|
|
|
+ if(CompareUtil.compare(invLotLocList.get(0).getQty(), quantity) != 0 || CompareUtil.compare(invLotAtt.getLotatt07(), palletNo) != 0){
|
|
|
//此时只有数量是错的,那么update一下数量就好
|
|
|
InvLotLocId invLotLocId = invLotLocList.get(0);
|
|
|
invLotLocId.setQty(quantity);
|
|
|
//TODO 其他关于数量的字段要改嘛
|
|
|
invLotLocId.setQtyEach(quantity);
|
|
|
+ invLotLocId.setUpdateTime(DateUtils.getNowDate());
|
|
|
invLotLocIdService.updateInvLotLocId(invLotLocId);
|
|
|
+ InvLotAtt iotLotAtt = new InvLotAtt();
|
|
|
+ iotLotAtt.setLotnum(invLotLocId.getLotnum());
|
|
|
+ iotLotAtt.setLotatt07(palletNo);
|
|
|
+ iotLotAtt.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ invLotAttService.updateInvLotAtt(iotLotAtt);
|
|
|
//重置库存数据
|
|
|
reSetLocationInfo(baseLocationInfo, bindSku, Constants.NO, skuTypeMapping);
|
|
|
}
|
|
@@ -182,15 +188,49 @@ public class ProcessLocationTest {
|
|
|
// System.out.println(handleLocationNo("STAGE01"));
|
|
|
|
|
|
|
|
|
- boolean condition = true;
|
|
|
- Boolean notFail = null;
|
|
|
- process(condition, notFail);
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- private static void process(boolean condition, Boolean notFail) {
|
|
|
- boolean fail = false;
|
|
|
- System.out.println(condition ? notFail : fail);
|
|
|
+ LinkedList<String> linkedList = Lists.newLinkedList();
|
|
|
+ ArrayList<String> arrayList = Lists.newArrayList();
|
|
|
+ linkedList.add("10");
|
|
|
+ linkedList.add("20");
|
|
|
+ linkedList.add("30");
|
|
|
+ linkedList.add("40");
|
|
|
+ linkedList.add("50");
|
|
|
+ linkedList.add("60");
|
|
|
+ linkedList.add("70");
|
|
|
+ linkedList.add("80");
|
|
|
+ System.out.println("queue.element():"+linkedList.element()); //读取第一个
|
|
|
+ System.out.println("queue.remove():"+linkedList.remove()); //删掉第一个
|
|
|
+
|
|
|
+ System.out.println("queue:"+linkedList);
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue.poll():" + linkedList.poll()); //读取且拿取==出队列
|
|
|
+ System.out.println("queue:"+linkedList);
|
|
|
+
|
|
|
+ linkedList.clear();
|
|
|
+
|
|
|
+ linkedList.push("10");
|
|
|
+ linkedList.push("20");
|
|
|
+ linkedList.push("30");
|
|
|
+ linkedList.push("40");
|
|
|
+ linkedList.push("50");
|
|
|
+ linkedList.push("60");
|
|
|
+ linkedList.push("70");
|
|
|
+ linkedList.push("80");
|
|
|
+
|
|
|
+ System.out.println("stack.element():"+linkedList.element()); //读取第一个
|
|
|
+ System.out.println("stack.remove():"+linkedList.remove()); //删掉第一个
|
|
|
+
|
|
|
+ System.out.println("stack:"+linkedList);
|
|
|
+ System.out.println("stack.peek():"+linkedList.peek()); //拿取栈顶==出栈
|
|
|
+ System.out.println("stack:"+linkedList);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -216,13 +256,5 @@ public class ProcessLocationTest {
|
|
|
invLotLocIdService.updateInvLotLocId(invLotLocId);
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- private WmsDocOrderSubService wmsDocOrderSubService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void initOrderDetails(){
|
|
|
- wmsDocOrderSubService.initOrderDetails("SO202309070001");
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
}
|