|
|
@@ -9,6 +9,7 @@ import com.github.zuihou.authority.entity.common.DictionaryItem;
|
|
|
import com.github.zuihou.base.service.SuperCacheServiceImpl;
|
|
|
import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
+import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
|
|
|
import com.github.zuihou.business.edgeLibrary.dao.StorgeMapper;
|
|
|
import com.github.zuihou.business.edgeLibrary.dao.StorgeTrayConfMapper;
|
|
|
import com.github.zuihou.business.edgeLibrary.dto.StorgeSaveDTO;
|
|
|
@@ -19,11 +20,17 @@ import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.Plate;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.Tray;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.PlateService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.TrayService;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
|
|
|
@@ -89,6 +96,18 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
|
|
|
@Autowired
|
|
|
private MsgUtil msgUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProductionresourceBizMapper productionresourceBizMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StockInfoMapper stockInfoMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WorkpieceService tWorkpieceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TrayService trayService;
|
|
|
+
|
|
|
@Override
|
|
|
protected String getRegion() {
|
|
|
return TENANT;
|
|
|
@@ -509,4 +528,62 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
|
|
|
List list = baseMapper.getstorgeByZone(map);
|
|
|
return CollectionUtil.isNotEmpty(list)?list.size():0;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long getLikuStockInList() {
|
|
|
+ List <StockInfo> returnList = null;
|
|
|
+
|
|
|
+ List<Productionresource> productionresources = productionresourceBizMapper.selectList(Wraps.<Productionresource>lbQ().like(Productionresource::getCode,DictionaryKey.YJ_ZONE_XBK.get("plateAndClamp")));
|
|
|
+ List<Long> productionresourceIds = productionresources.stream().map(t->t.getId()).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(CollectionUtil.isEmpty(productionresourceIds)){
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ String resourceIds = "";
|
|
|
+ for(int i = 0; i < productionresourceIds.size(); i++){
|
|
|
+ if(i == productionresourceIds.size() - 1){
|
|
|
+ resourceIds = resourceIds + productionresourceIds.get(i);
|
|
|
+ }else{
|
|
|
+ resourceIds = resourceIds + productionresourceIds.get(i)+ ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map queryMap = new HashMap();
|
|
|
+ queryMap.put("resourceIds",resourceIds);
|
|
|
+
|
|
|
+ // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
|
|
|
+
|
|
|
+ List<Long> allStockList = stockInfoMapper.getAvailableStorge(queryMap);
|
|
|
+ if(allStockList.size() > 0){
|
|
|
+ return allStockList.get(0);
|
|
|
+ }else{
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 立库获取舱体限高工装的库位(298-330)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public long getLikuHeightLimitStock(){
|
|
|
+ Productionresource productionresource = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().eq(Productionresource::getCode, DictionaryKey.YJ_ZONE_XBK.get("plateAndClamp")));
|
|
|
+ if(null==productionresource) return -1;
|
|
|
+ List<ProductionresourcePosition> productionresourcePositionList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{productionresource.getId().toString()});
|
|
|
+ List<Long> storgeIds = productionresourcePositionList.stream().filter(item->{
|
|
|
+ int pointId = Integer.parseInt(item.getPointId());
|
|
|
+ return pointId>=298 && pointId<=330;
|
|
|
+ }).map(item->item.getStorgeId()).collect(Collectors.toList());
|
|
|
+ return storgeIds==null || storgeIds.size()==0 ? -1 : storgeIds.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean isHeightLimit(String completeBatchNo) {
|
|
|
+ Storge storge = tWorkpieceService.getWorkPieceStock(completeBatchNo, false);
|
|
|
+ StockInfo stockInfo = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, storge.getId()).eq(StockInfo::getGoodsType, "1"));
|
|
|
+ Tray tray = trayService.getById(stockInfo.getGoodsId());
|
|
|
+ return tray.getHeightLimit().equals(1) ? true : false;
|
|
|
+ }
|
|
|
}
|