|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.OrderToLine; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.asrs.service.impl.OrderDetlServiceImpl; | 
|---|
|  |  |  | import com.zy.asrs.task.core.ReturnT; | 
|---|
|  |  |  | import com.zy.asrs.task.handler.OrderToLineHandler; | 
|---|
|  |  |  | import com.zy.asrs.utils.GroupedLockerOptimizerUtils; | 
|---|
|  |  |  | import com.zy.asrs.utils.OptimizedLockerPackingUtils; | 
|---|
|  |  |  | import com.zy.asrs.utils.OrderInAndOutUtil; | 
|---|
|  |  |  | import com.zy.asrs.utils.ToSortLineUtils; | 
|---|
|  |  |  | import com.zy.asrs.utils.param.ItemUtilParam; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  | 
|---|
|  |  |  | for (String orderNo : orderNos) { | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | List<OrderDetlPakin> orderDetlPakinList = orderDetlPakinService.selectList(new EntityWrapper<OrderDetlPakin>().eq("order_no",orderNo)); | 
|---|
|  |  |  | //                List<GroupedLockerOptimizerUtils.Item> items = new ArrayList<>(); | 
|---|
|  |  |  | if (orderDetlPakinList.size()<1){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<OptimizedLockerPackingUtils.Item> items = new ArrayList<>(); | 
|---|
|  |  |  | List<ItemUtilParam.Item> items = new ArrayList<>(); | 
|---|
|  |  |  | for (OrderDetlPakin orderDetl:orderDetlPakinList){ | 
|---|
|  |  |  | Integer number =  basArmRulesService.getNumber(orderDetl.getWeight(),orderDetl.getVolume(),orderDetl.getManLength(),orderDetl.getWidth(),orderDetl.getHeight()); | 
|---|
|  |  |  | if (number == null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | String name = ToSortLineUtils.MergerParameter(orderDetl.getMatnr(),orderDetl.getStandby1(),orderDetl.getStandby2()); | 
|---|
|  |  |  | int maxCapacity = number; | 
|---|
|  |  |  | int stock = orderDetl.getAnfme().intValue(); | 
|---|
|  |  |  | //                    items.add(new GroupedLockerOptimizerUtils.Item(name, maxCapacity, stock)); | 
|---|
|  |  |  | items.add(new OptimizedLockerPackingUtils.Item(name, maxCapacity, stock)); | 
|---|
|  |  |  | items.add(new ItemUtilParam.Item(name, maxCapacity, stock)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | OrderToLine orderToLine = new OrderToLine(); | 
|---|
|  |  |  | orderToLine.setOrderNo(orderNo);  //单据编号 | 
|---|
|  |  |  | orderToLine.setCreateTime(System.currentTimeMillis());  //创建时间 | 
|---|
|  |  |  | //                OrderToLine orderToLineR = ToSortLineUtils.GetOrderToLineGro(items, orderToLine); | 
|---|
|  |  |  | OrderToLine orderToLineR = ToSortLineUtils.GetOrderToLineOpt(items, orderToLine); | 
|---|
|  |  |  | OrderToLine orderToLineR = ToSortLineUtils.GetOrderToLine(items, orderToLine,"Opt3"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | ReturnT<String> returnT = orderToLineHandler.start(orderToLineR); | 
|---|
|  |  |  | if (!returnT.isSuccess()) { | 
|---|
|  |  |  | log.error("下发单据失败===>"+ JSON.toJSON(orderToLineR)); | 
|---|
|  |  |  | //                        log.error("下发单据失败===>"+ JSON.toJSON(orderToLineR)); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | for (OrderToLine.MatList matList:orderToLineR.getMatList()){ | 
|---|