package com.steerinfo.dil.service.impl; import com.steerinfo.dil.mapper.OmstruckOrderMaterialMapper; import com.steerinfo.dil.mapper.RmsCapacityMapper; import com.steerinfo.dil.mapper.RmsPwarehouseGridMapper; import com.steerinfo.dil.model.OmstruckOrderMaterial; import com.steerinfo.dil.model.RmsPwarehouseGrid; import com.steerinfo.dil.service.IOmstruckOrderMaterialService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * OmstruckOrderMaterial服务实现: * * @author TXF * @version 1.0-SNAPSHORT 2021-09-03 04:55 * 类描述 * 修订历史: * 日期:2021-09-03 * 作者:generator * 参考: * 描述:OmstruckOrderMaterial服务实现 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. * @see null */ @Service(value = "omstruckOrderMaterialService") public class OmstruckOrderMaterialServiceImpl implements IOmstruckOrderMaterialService { @Autowired private OmstruckOrderMaterialMapper omstruckOrderMaterialMapper; @Autowired RmsCapacityMapper rmsCapacityMapper; @Autowired RmsPwarehouseGridMapper rmsPwarehouseGridMapper; /** * 远程调用订单子表新增 * * @param omstruckOrderMaterial * @return */ @Override public int insertSelective(OmstruckOrderMaterial omstruckOrderMaterial) { return omstruckOrderMaterialMapper.insertSelective(omstruckOrderMaterial); } /** * 仓库 * @return */ @Override public List> warehouseId() { return rmsCapacityMapper.warehouseId(); } /** * 月台 * @return */ @Override public List> platformId() { return rmsCapacityMapper.platformId(); } /** * 垛位 * @return */ @Override public List> stackingId() { return rmsCapacityMapper.stackingId(); } /** * 主键 * @return */ @Override public BigDecimal gridId() { return rmsCapacityMapper.gridId(); } @Override public int insertSelective(RmsPwarehouseGrid rmsPwarehouseGrid) { return rmsPwarehouseGridMapper.insertSelective(rmsPwarehouseGrid); } @Override public int insertGrid() { int count = 0; // 仓库 List> warehouseIdList = warehouseId(); // 月台 List> platformIdList = platformId(); // 垛位 List> stackingIdList = stackingId(); // 遍历仓库 for (Map warehouseIdMap : warehouseIdList) { BigDecimal warehouseId = (BigDecimal) warehouseIdMap.get("warehouseId"); // 遍历月台 for (Map platformIdMap : platformIdList) { BigDecimal platformId = (BigDecimal) platformIdMap.get("platformId"); // 遍历垛位 for (Map stackingIdMap : stackingIdList) { BigDecimal stackingId = (BigDecimal) stackingIdMap.get("stackingId"); // 遍历层次 for (int i = 1; i <= 8; i++) { // 遍历层序 for (int j = 1; j <= 24; j++) { // 一棒库时 if (warehouseId.intValue() == 1) { // A月台 if (platformId.intValue() == 1) { // A月台的垛位 if (stackingId.intValue() == 1) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } // B月台 if (platformId.intValue() == 1) { // B月台的垛位: 2-8 if (stackingId.intValue() >= 2 && stackingId.intValue() <= 8) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } } // 二棒库时: if (warehouseId.intValue() == 2) { // A月台 if (platformId.intValue() == 3) { // A月台的垛位 : 1-3 if (stackingId.intValue() >= 41 && stackingId.intValue() <= 43) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } // B月台 if (platformId.intValue() == 4) { } // C月台 if (platformId.intValue() == 5) { // C月台的垛位:4-18 if (stackingId.intValue() >= 44 && stackingId.intValue() <= 58) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } // D月台 if (platformId.intValue() == 6) { // D月台的垛位:19 if (stackingId.intValue() == 59) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } } // 高线库时 if (warehouseId.intValue() == 3) { // A月台 if (platformId.intValue() == 7) { // RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); } } // 配送库时: if (warehouseId.intValue() == 4) { // A月台 if (platformId.intValue() == 8) { // A月台的垛位:8-14 || 24-32 if ((stackingId.intValue() >= 16 && stackingId.intValue() <= 22) || (stackingId.intValue() >= 32 && stackingId.intValue() <= 40)) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } // B月台 if (platformId.intValue() == 9) { // B月台的垛位:1-7 || 15-23 if ((stackingId.intValue() >= 9 && stackingId.intValue() <= 15) || (stackingId.intValue() >= 23 && stackingId.intValue() <= 31)) { RmsPwarehouseGrid rmsPwarehouseGrid = new RmsPwarehouseGrid(); BigDecimal gridId = gridId(); rmsPwarehouseGrid.setGridId(gridId); rmsPwarehouseGrid.setWarehouseId(warehouseId); rmsPwarehouseGrid.setPlatformId(platformId); rmsPwarehouseGrid.setStackingId(stackingId); rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(i)); rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(j)); insertSelective(rmsPwarehouseGrid); count++; } } } } } } } } System.out.println(count); return count; } }