package com.prolog.cs.biz.outbound.stage; 

import com.alibaba.fastjson.JSON;
import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext;
import com.prolog.cs.biz.outbound.model.dto.MoveTaskDODTO;
import com.prolog.cs.biz.outbound.service.impl.MoveTaskServiceImpl;
import com.prolog.framework.authority.util.HystrixVarUtil;
import com.prolog.upcloud.base.inventory.vo.StockWaveResultDetailVO;
import com.prolog.upcloud.base.inventory.vo.StockWaveResultVO;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
@WebAppConfiguration 
public class WorkStageServiceImplTest { 

    @Autowired
    private com.prolog.cs.biz.outbound.service.impl.WorkStageServiceImpl WorkStageServiceImpl;
    @Autowired
    private com.prolog.cs.biz.outbound.service.impl.MoveTaskServiceImpl MoveTaskServiceImpl;


    @Autowired
    private com.prolog.cs.biz.outbound.service.impl.MoveTaskServiceImpl moveTaskService;
    @Before
    public void before() throws Exception { 
        HystrixRequestContext context = HystrixRequestContext.initializeContext();
        HystrixVarUtil.setUserKey("test-yj");
    } 
    
    @After
    public void after() throws Exception { 
    } 

    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.init()));
    public void testInit() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.handleWaveHandleResult()));
    public void testHandleWaveHandleResult() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.tryHandle()));
    public void testTryHandle() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.handle()));
    public void testHandle() throws Exception { 
        
    } 
    @Test//
    public void testExtractedMove() throws Exception {
        String waveResultStr="{ \t\"waveId\": \"728653997162622976\", \t\"enterpriseId\": \"106\", \t\"warehouseId\": \"726788113300975616\", \t\"success\": true, \t\"errorMsg\": null, \t\"opUser\": \"白慧\", \t\"opUserId\": \"726118424878649344\", \t\"details\": [ \t\t{ \t\t\t\"billId\": \"728653998277660673\", \t\t\t\"billCode\": \"SKPMDG00658768\", \t\t\t\"srcId\": \"17523873\", \t\t\t\"srcCode\": \"SKPMDG00658768\", \t\t\t\"billGroupId\": \"SKPMDG00658768\", \t\t\t\"cargoOwnerId\": \"E2EDZU22HUV\", \t\t\t\"success\": true, \t\t\t\"errorMsg\": \"\", \t\t\t\"itemDetails\": [\t\t\t\t \t\t\t\t{ \t\t\t\t\t\"lineBillId\": \"728653998302826496\", \t\t\t\t\t\"pickRule\": \"FIFO\", \t\t\t\t\t\"srcLineId\": \"1000150156\", \t\t\t\t\t\"itemId\": \"0021295582\", \t\t\t\t\t\"itemName\": null, \t\t\t\t\t\"itemHealthCategory\": null, \t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\"success\": true, \t\t\t\t\t\"errorMsg\": null, \t\t\t\t\t\"pickLocators\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR24676\", \t\t\t\t\t\t\t\"locatorCode\": \"LY36-02-4-1\", \t\t\t\t\t\t\t\"batchId\": \"ZCC22053928\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22053928\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 6, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": null, \t\t\t\t\t\t\t\"outIndex\": null, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t}, \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR24863\", \t\t\t\t\t\t\t\"locatorCode\": \"LY38-04-1-3\", \t\t\t\t\t\t\t\"batchId\": \"ZCC22056615\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22056615\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 4, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": \"1\", \t\t\t\t\t\t\t\"outIndex\": 0, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"replenishTaskList\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"headerId\": \"728654121624530944\", \t\t\t\t\t\t\t\"detailId\": \"728654121641308160\", \t\t\t\t\t\t\t\"pieceQuantity\": 80, \t\t\t\t\t\t\t\"chooseQuantity\": 4, \t\t\t\t\t\t\t\"srcWarehouseLocatorId\": \"HHLOCATOR10259\", \t\t\t\t\t\t\t\"srcWarehouseLocatorCode\": \"WY001\", \t\t\t\t\t\t\t\"srcWarehouseAreaId\": \"726831912446324736\", \t\t\t\t\t\t\t\"srcWarehouseAreaCode\": \"ZJ3\", \t\t\t\t\t\t\t\"srcWarehouseAreaCategory\": \"ZJK\", \t\t\t\t\t\t\t\"srcWarehouseLocatorType\": \"0\", \t\t\t\t\t\t\t\"srcFloorNum\": 3, \t\t\t\t\t\t\t\"srcItemPlaceType\": \"3\", \t\t\t\t\t\t\t\"destWarehouseLocatorId\": \"HHLOCATOR24863\", \t\t\t\t\t\t\t\"destWarehouseLocatorCode\": \"LY38-04-1-3\", \t\t\t\t\t\t\t\"destWarehouseAreaId\": \"726831119710285824\", \t\t\t\t\t\t\t\"destWarehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"destWarehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"destWarehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"destFloorNum\": 4, \t\t\t\t\t\t\t\"destItemPlaceType\": \"1\", \t\t\t\t\t\t\t\"pickRule\": null, \t\t\t\t\t\t\t\"batchId\": \"ZCC22056615\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22056615\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"caseConvertionRate\": null, \t\t\t\t\t\t\t\"length\": 0, \t\t\t\t\t\t\t\"width\": 0, \t\t\t\t\t\t\t\"height\": 0, \t\t\t\t\t\t\t\"volume\": 0, \t\t\t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\" \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"refReplenishes\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"billId\": \"728653998277660673\", \t\t\t\t\t\t\t\"lineBillId\": \"728653998302826496\", \t\t\t\t\t\t\t\"refBillId\": \"728654121624530944\", \t\t\t\t\t\t\t\"refLineBillId\": \"728654121641308160\", \t\t\t\t\t\t\t\"refQuantity\": 4 \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"extData\": { \t\t\t\t\t\t\"caseBarcode\": \"6940756220090\", \t\t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\t\"itemCode\": \"YCYGK0277\", \t\t\t\t\t\t\"isCaseOrPiece\": 1, \t\t\t\t\t\t\"itemCategoryId\": \"中成药\", \t\t\t\t\t\t\"itemCategoryCode\": \"002\", \t\t\t\t\t\t\"caseUom\": \"盒\", \t\t\t\t\t\t\"itemName\": \"云南白药膏\", \t\t\t\t\t\t\"itemIsSpecialSharped\": \"0\", \t\t\t\t\t\t\"itemTemperatureHigh\": null, \t\t\t\t\t\t\"itemTemperatureLow\": null, \t\t\t\t\t\t\"itemIsLot\": null, \t\t\t\t\t\t\"height\": null, \t\t\t\t\t\t\"itemIsUnpack\": 1, \t\t\t\t\t\t\"length\": null, \t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\"abcType\": null, \t\t\t\t\t\t\"volume\": 449.2125, \t\t\t\t\t\t\"itemId\": \"0021295582\", \t\t\t\t\t\t\"storeTemperature\": \"阴凉遮光\", \t\t\t\t\t\t\"itemIsBatch\": null, \t\t\t\t\t\t\"itemHealthCategory\": \"002\", \t\t\t\t\t\t\"width\": null, \t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\"enterpriseId\": \"106\", \t\t\t\t\t\t\"itemHealthIsDouble\": \"0\" \t\t\t\t\t} \t\t\t\t}, \t\t\t\t{ \t\t\t\t\t\"lineBillId\": \"728653998311215104\", \t\t\t\t\t\"pickRule\": \"FIFO\", \t\t\t\t\t\"srcLineId\": \"1000150157\", \t\t\t\t\t\"itemId\": \"0021295593\", \t\t\t\t\t\"itemName\": null, \t\t\t\t\t\"itemHealthCategory\": null, \t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\"success\": true, \t\t\t\t\t\"errorMsg\": null, \t\t\t\t\t\"pickLocators\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR21147\", \t\t\t\t\t\t\t\"locatorCode\": \"LY08-05-2-2\", \t\t\t\t\t\t\t\"batchId\": \"2022031275749\", \t\t\t\t\t\t\t\"batchNum\": \"2022031275749\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 20, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1738339200000, \t\t\t\t\t\t\t\"batchProductionDate\": 1648396800000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202502\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220328\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": null, \t\t\t\t\t\t\t\"outIndex\": null, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"202203127\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"replenishTaskList\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"headerId\": \"728654121624530944\", \t\t\t\t\t\t\t\"detailId\": \"728654121641308161\", \t\t\t\t\t\t\t\"pieceQuantity\": 80, \t\t\t\t\t\t\t\"chooseQuantity\": 3, \t\t\t\t\t\t\t\"srcWarehouseLocatorId\": \"HHLOCATOR10000\", \t\t\t\t\t\t\t\"srcWarehouseLocatorCode\": \"ZYJD2\", \t\t\t\t\t\t\t\"srcWarehouseAreaId\": \"726831831441731584\", \t\t\t\t\t\t\t\"srcWarehouseAreaCode\": \"ZJ2\", \t\t\t\t\t\t\t\"srcWarehouseAreaCategory\": \"ZJK\", \t\t\t\t\t\t\t\"srcWarehouseLocatorType\": \"0\", \t\t\t\t\t\t\t\"srcFloorNum\": 2, \t\t\t\t\t\t\t\"srcItemPlaceType\": \"3\", \t\t\t\t\t\t\t\"destWarehouseLocatorId\": \"HHLOCATOR21147\", \t\t\t\t\t\t\t\"destWarehouseLocatorCode\": \"LY08-05-2-2\", \t\t\t\t\t\t\t\"destWarehouseAreaId\": \"726831119710285824\", \t\t\t\t\t\t\t\"destWarehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"destWarehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"destWarehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"destFloorNum\": 4, \t\t\t\t\t\t\t\"destItemPlaceType\": \"1\", \t\t\t\t\t\t\t\"pickRule\": null, \t\t\t\t\t\t\t\"batchId\": \"2022031275749\", \t\t\t\t\t\t\t\"batchNum\": \"2022031275749\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"202203127\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"batchProductionDate\": 1648396800000, \t\t\t\t\t\t\t\"batchExpiredDate\": 1738339200000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202502\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220328\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\t\"caseConvertionRate\": null, \t\t\t\t\t\t\t\"length\": 0, \t\t\t\t\t\t\t\"width\": 0, \t\t\t\t\t\t\t\"height\": 0, \t\t\t\t\t\t\t\"volume\": 0, \t\t\t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\" \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"refReplenishes\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"billId\": \"728653998277660673\", \t\t\t\t\t\t\t\"lineBillId\": \"728653998311215104\", \t\t\t\t\t\t\t\"refBillId\": \"728654121624530944\", \t\t\t\t\t\t\t\"refLineBillId\": \"728654121641308161\", \t\t\t\t\t\t\t\"refQuantity\": 3 \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"extData\": { \t\t\t\t\t\t\"caseBarcode\": \"6928880322262\", \t\t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\t\"itemCode\": \"10201030231\", \t\t\t\t\t\t\"isCaseOrPiece\": 1, \t\t\t\t\t\t\"itemCategoryId\": \"中成药\", \t\t\t\t\t\t\"itemCategoryCode\": \"001\", \t\t\t\t\t\t\"caseUom\": \"盒\", \t\t\t\t\t\t\"itemName\": \"藿香正气水\", \t\t\t\t\t\t\"itemIsSpecialSharped\": \"0\", \t\t\t\t\t\t\"itemTemperatureHigh\": null, \t\t\t\t\t\t\"itemTemperatureLow\": null, \t\t\t\t\t\t\"itemIsLot\": null, \t\t\t\t\t\t\"height\": null, \t\t\t\t\t\t\"itemIsUnpack\": 1, \t\t\t\t\t\t\"length\": null, \t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\"abcType\": null, \t\t\t\t\t\t\"volume\": 449.2125, \t\t\t\t\t\t\"itemId\": \"0021295593\", \t\t\t\t\t\t\"storeTemperature\": \"阴凉\", \t\t\t\t\t\t\"itemIsBatch\": null, \t\t\t\t\t\t\"itemHealthCategory\": \"001\", \t\t\t\t\t\t\"width\": null, \t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\"enterpriseId\": \"106\", \t\t\t\t\t\t\"itemHealthIsDouble\": \"0\" \t\t\t\t\t} \t\t\t\t}\t\t\t\t \t\t\t] \t\t} \t] }";
        StockWaveResultVO waveResult=JSON.parseObject(waveResultStr,StockWaveResultVO.class);
        String successBillsResultsStr="[ \t\t{ \t\t\t\"billId\": \"728653998277660673\", \t\t\t\"billCode\": \"SKPMDG00658768\", \t\t\t\"srcId\": \"17523873\", \t\t\t\"srcCode\": \"SKPMDG00658768\", \t\t\t\"billGroupId\": \"SKPMDG00658768\", \t\t\t\"cargoOwnerId\": \"E2EDZU22HUV\", \t\t\t\"success\": true, \t\t\t\"errorMsg\": \"\", \t\t\t\"itemDetails\": [\t\t\t\t \t\t\t\t{ \t\t\t\t\t\"lineBillId\": \"728653998302826496\", \t\t\t\t\t\"pickRule\": \"FIFO\", \t\t\t\t\t\"srcLineId\": \"1000150156\", \t\t\t\t\t\"itemId\": \"0021295582\", \t\t\t\t\t\"itemName\": null, \t\t\t\t\t\"itemHealthCategory\": null, \t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\"success\": true, \t\t\t\t\t\"errorMsg\": null, \t\t\t\t\t\"pickLocators\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR24676\", \t\t\t\t\t\t\t\"locatorCode\": \"LY36-02-4-1\", \t\t\t\t\t\t\t\"batchId\": \"ZCC22053928\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22053928\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 6, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": null, \t\t\t\t\t\t\t\"outIndex\": null, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t}, \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR24863\", \t\t\t\t\t\t\t\"locatorCode\": \"LY38-04-1-3\", \t\t\t\t\t\t\t\"batchId\": \"ZCC22056615\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22056615\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 4, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": \"1\", \t\t\t\t\t\t\t\"outIndex\": 0, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"replenishTaskList\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"headerId\": \"728654121624530944\", \t\t\t\t\t\t\t\"detailId\": \"728654121641308160\", \t\t\t\t\t\t\t\"pieceQuantity\": 80, \t\t\t\t\t\t\t\"chooseQuantity\": 4, \t\t\t\t\t\t\t\"srcWarehouseLocatorId\": \"HHLOCATOR10259\", \t\t\t\t\t\t\t\"srcWarehouseLocatorCode\": \"WY001\", \t\t\t\t\t\t\t\"srcWarehouseAreaId\": \"726831912446324736\", \t\t\t\t\t\t\t\"srcWarehouseAreaCode\": \"ZJ3\", \t\t\t\t\t\t\t\"srcWarehouseAreaCategory\": \"ZJK\", \t\t\t\t\t\t\t\"srcWarehouseLocatorType\": \"0\", \t\t\t\t\t\t\t\"srcFloorNum\": 3, \t\t\t\t\t\t\t\"srcItemPlaceType\": \"3\", \t\t\t\t\t\t\t\"destWarehouseLocatorId\": \"HHLOCATOR24863\", \t\t\t\t\t\t\t\"destWarehouseLocatorCode\": \"LY38-04-1-3\", \t\t\t\t\t\t\t\"destWarehouseAreaId\": \"726831119710285824\", \t\t\t\t\t\t\t\"destWarehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"destWarehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"destWarehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"destFloorNum\": 4, \t\t\t\t\t\t\t\"destItemPlaceType\": \"1\", \t\t\t\t\t\t\t\"pickRule\": null, \t\t\t\t\t\t\t\"batchId\": \"ZCC22056615\", \t\t\t\t\t\t\t\"batchNum\": \"ZCC22056615\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"ZCC2205\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"batchProductionDate\": 1644249600000, \t\t\t\t\t\t\t\"batchExpiredDate\": 1735660800000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202501\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220208\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\t\"caseConvertionRate\": null, \t\t\t\t\t\t\t\"length\": 0, \t\t\t\t\t\t\t\"width\": 0, \t\t\t\t\t\t\t\"height\": 0, \t\t\t\t\t\t\t\"volume\": 0, \t\t\t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\" \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"refReplenishes\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"billId\": \"728653998277660673\", \t\t\t\t\t\t\t\"lineBillId\": \"728653998302826496\", \t\t\t\t\t\t\t\"refBillId\": \"728654121624530944\", \t\t\t\t\t\t\t\"refLineBillId\": \"728654121641308160\", \t\t\t\t\t\t\t\"refQuantity\": 4 \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"extData\": { \t\t\t\t\t\t\"caseBarcode\": \"6940756220090\", \t\t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\t\"itemCode\": \"YCYGK0277\", \t\t\t\t\t\t\"isCaseOrPiece\": 1, \t\t\t\t\t\t\"itemCategoryId\": \"中成药\", \t\t\t\t\t\t\"itemCategoryCode\": \"002\", \t\t\t\t\t\t\"caseUom\": \"盒\", \t\t\t\t\t\t\"itemName\": \"云南白药膏\", \t\t\t\t\t\t\"itemIsSpecialSharped\": \"0\", \t\t\t\t\t\t\"itemTemperatureHigh\": null, \t\t\t\t\t\t\"itemTemperatureLow\": null, \t\t\t\t\t\t\"itemIsLot\": null, \t\t\t\t\t\t\"height\": null, \t\t\t\t\t\t\"itemIsUnpack\": 1, \t\t\t\t\t\t\"length\": null, \t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\"abcType\": null, \t\t\t\t\t\t\"volume\": 449.2125, \t\t\t\t\t\t\"itemId\": \"0021295582\", \t\t\t\t\t\t\"storeTemperature\": \"阴凉遮光\", \t\t\t\t\t\t\"itemIsBatch\": null, \t\t\t\t\t\t\"itemHealthCategory\": \"002\", \t\t\t\t\t\t\"width\": null, \t\t\t\t\t\t\"shelfLifeDays\": 1095, \t\t\t\t\t\t\"enterpriseId\": \"106\", \t\t\t\t\t\t\"itemHealthIsDouble\": \"0\" \t\t\t\t\t} \t\t\t\t}, \t\t\t\t{ \t\t\t\t\t\"lineBillId\": \"728653998311215104\", \t\t\t\t\t\"pickRule\": \"FIFO\", \t\t\t\t\t\"srcLineId\": \"1000150157\", \t\t\t\t\t\"itemId\": \"0021295593\", \t\t\t\t\t\"itemName\": null, \t\t\t\t\t\"itemHealthCategory\": null, \t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\"success\": true, \t\t\t\t\t\"errorMsg\": null, \t\t\t\t\t\"pickLocators\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"id\": null, \t\t\t\t\t\t\t\"locatorId\": \"HHLOCATOR21147\", \t\t\t\t\t\t\t\"locatorCode\": \"LY08-05-2-2\", \t\t\t\t\t\t\t\"batchId\": \"2022031275749\", \t\t\t\t\t\t\t\"batchNum\": \"2022031275749\", \t\t\t\t\t\t\t\"stockStatus\": null, \t\t\t\t\t\t\t\"quantity\": 20, \t\t\t\t\t\t\t\"warehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"batchExpiredDate\": 1738339200000, \t\t\t\t\t\t\t\"batchProductionDate\": 1648396800000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202502\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220328\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\t\"warehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"warehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"pickModel\": null, \t\t\t\t\t\t\t\"floorNum\": 4, \t\t\t\t\t\t\t\"locatorLaneCode\": null, \t\t\t\t\t\t\t\"outIndex\": null, \t\t\t\t\t\t\t\"splitGroup\": null, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"202203127\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"itemPlaceType\": \"1\", \t\t\t\t\t\t\t\"refBillId\": null, \t\t\t\t\t\t\t\"refLineBillId\": null \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"replenishTaskList\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"headerId\": \"728654121624530944\", \t\t\t\t\t\t\t\"detailId\": \"728654121641308161\", \t\t\t\t\t\t\t\"pieceQuantity\": 80, \t\t\t\t\t\t\t\"chooseQuantity\": 3, \t\t\t\t\t\t\t\"srcWarehouseLocatorId\": \"HHLOCATOR10000\", \t\t\t\t\t\t\t\"srcWarehouseLocatorCode\": \"ZYJD2\", \t\t\t\t\t\t\t\"srcWarehouseAreaId\": \"726831831441731584\", \t\t\t\t\t\t\t\"srcWarehouseAreaCode\": \"ZJ2\", \t\t\t\t\t\t\t\"srcWarehouseAreaCategory\": \"ZJK\", \t\t\t\t\t\t\t\"srcWarehouseLocatorType\": \"0\", \t\t\t\t\t\t\t\"srcFloorNum\": 2, \t\t\t\t\t\t\t\"srcItemPlaceType\": \"3\", \t\t\t\t\t\t\t\"destWarehouseLocatorId\": \"HHLOCATOR21147\", \t\t\t\t\t\t\t\"destWarehouseLocatorCode\": \"LY08-05-2-2\", \t\t\t\t\t\t\t\"destWarehouseAreaId\": \"726831119710285824\", \t\t\t\t\t\t\t\"destWarehouseAreaCode\": \"LH4\", \t\t\t\t\t\t\t\"destWarehouseAreaCategory\": \"LHK\", \t\t\t\t\t\t\t\"destWarehouseLocatorType\": \"1\", \t\t\t\t\t\t\t\"destFloorNum\": 4, \t\t\t\t\t\t\t\"destItemPlaceType\": \"1\", \t\t\t\t\t\t\t\"pickRule\": null, \t\t\t\t\t\t\t\"batchId\": \"2022031275749\", \t\t\t\t\t\t\t\"batchNum\": \"2022031275749\", \t\t\t\t\t\t\t\"manufacturerLotNum\": \"202203127\", \t\t\t\t\t\t\t\"uom\": \"盒\", \t\t\t\t\t\t\t\"batchProductionDate\": 1648396800000, \t\t\t\t\t\t\t\"batchExpiredDate\": 1738339200000, \t\t\t\t\t\t\t\"batchExpiredDateShow\": \"202502\", \t\t\t\t\t\t\t\"batchProductionDateShow\": \"20220328\", \t\t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\t\"caseConvertionRate\": null, \t\t\t\t\t\t\t\"length\": 0, \t\t\t\t\t\t\t\"width\": 0, \t\t\t\t\t\t\t\"height\": 0, \t\t\t\t\t\t\t\"volume\": 0, \t\t\t\t\t\t\t\"isCaseOrPiece\": null, \t\t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\t\"buildingId\": \"726788273657606144\", \t\t\t\t\t\t\t\"buildingName\": \"红河仓\", \t\t\t\t\t\t\t\"buildingCode\": \"005\" \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"refReplenishes\": [ \t\t\t\t\t\t{ \t\t\t\t\t\t\t\"billId\": \"728653998277660673\", \t\t\t\t\t\t\t\"lineBillId\": \"728653998311215104\", \t\t\t\t\t\t\t\"refBillId\": \"728654121624530944\", \t\t\t\t\t\t\t\"refLineBillId\": \"728654121641308161\", \t\t\t\t\t\t\t\"refQuantity\": 3 \t\t\t\t\t\t} \t\t\t\t\t], \t\t\t\t\t\"extData\": { \t\t\t\t\t\t\"caseBarcode\": \"6928880322262\", \t\t\t\t\t\t\"caseConversionRate\": 80, \t\t\t\t\t\t\"itemCode\": \"10201030231\", \t\t\t\t\t\t\"isCaseOrPiece\": 1, \t\t\t\t\t\t\"itemCategoryId\": \"中成药\", \t\t\t\t\t\t\"itemCategoryCode\": \"001\", \t\t\t\t\t\t\"caseUom\": \"盒\", \t\t\t\t\t\t\"itemName\": \"藿香正气水\", \t\t\t\t\t\t\"itemIsSpecialSharped\": \"0\", \t\t\t\t\t\t\"itemTemperatureHigh\": null, \t\t\t\t\t\t\"itemTemperatureLow\": null, \t\t\t\t\t\t\"itemIsLot\": null, \t\t\t\t\t\t\"height\": null, \t\t\t\t\t\t\"itemIsUnpack\": 1, \t\t\t\t\t\t\"length\": null, \t\t\t\t\t\t\"weight\": 0, \t\t\t\t\t\t\"abcType\": null, \t\t\t\t\t\t\"volume\": 449.2125, \t\t\t\t\t\t\"itemId\": \"0021295593\", \t\t\t\t\t\t\"storeTemperature\": \"阴凉\", \t\t\t\t\t\t\"itemIsBatch\": null, \t\t\t\t\t\t\"itemHealthCategory\": \"001\", \t\t\t\t\t\t\"width\": null, \t\t\t\t\t\t\"shelfLifeDays\": 1080, \t\t\t\t\t\t\"enterpriseId\": \"106\", \t\t\t\t\t\t\"itemHealthIsDouble\": \"0\" \t\t\t\t\t} \t\t\t\t}\t\t\t\t \t\t\t] \t\t} \t]";
        List<StockWaveResultDetailVO> successBillsResults=JSON.parseArray(successBillsResultsStr,StockWaveResultDetailVO.class);
        MoveTaskServiceImpl.extractedMove(waveResult,successBillsResults);
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.extractedMoveNoTx()));
    public void testExtractedMoveNoTx() throws Exception {
        String s = "[{\"batchExpiredDateShow\":\"20250831\",\"batchId\":\"800444918769258496\",\"batchNum\":\"800444918794424320\",\"batchProductionDateShow\":\"20220519\",\"bldgCode\":\"build-hnsyy\",\"bldgId\":\"770720011168911360\",\"bldgName\":\"build-hnsyy\",\"cargoOwnerId\":\"748963439141064799\",\"conversionRate\":10.0000,\"destWarehouseAreaCategory\":\"LHK\",\"destWarehouseAreaId\":\"773203722959458305\",\"destWarehouseAreaNum\":\"LHK-CW\",\"destWarehouseLocatorId\":\"808038146892763136\",\"destWarehouseLocatorNum\":\"LHHW002\",\"destWarehouseLocatorType\":\"1\",\"detailId\":\"812683504906276864\",\"expiredDate\":1756569600000,\"headerId\":\"812683502926565376\",\"height\":50.00000000,\"isCaseOrPiece\":1,\"itemCode\":\"TCCS1545\",\"itemId\":\"202207011545\",\"itemName\":\"TC测试商品01\",\"length\":50.00000000,\"manufacturerLotNum\":\"444\",\"moveType\":\"2\",\"productionDate\":1652889600000,\"qty\":10,\"srcWarehouseAreaCategory\":\"AGVZ\",\"srcWarehouseAreaId\":\"793206997746061312\",\"srcWarehouseAreaNum\":\"AGVTP01-R01\",\"srcWarehouseLocatorId\":\"894290490223104000\",\"srcWarehouseLocatorNum\":\"AGVTP01\",\"srcWarehouseLocatorType\":\"0\",\"status\":\"0\",\"uom\":\"箱\",\"volume\":48.39000000,\"warehouseId\":\"759131791285161985\",\"weight\":0E-8,\"width\":50.00000000}]";
        List<MoveTaskDODTO> moveTaskDODTOS = JSON.parseArray(s, MoveTaskDODTO.class);
        moveTaskService.addMoveTask(moveTaskDODTOS);
        System.out.println("=========");
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.calculusWorkspaces()));
    public void testCalculusWorkspaces() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.releaseWorkStage()));
    public void testReleaseWorkStage() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.transfer()));
    public void testTransfer() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.handle2()));
    public void testHandle2() throws Exception { 
        
    } 
    @Test//System.out.println(JSON.toJSONString(WorkStageServiceImpl.waveStorageUpdateIsFunctionRoomSaveBatch()));
    public void testWaveStorageUpdateIsFunctionRoomSaveBatch() throws Exception { 
        
    } 
        
} 
