| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Slf4j |
| | | public class EdgStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<EdgStorageCageDetailsMapper, EdgStorageCageDetails> implements EdgStorageCageDetailsService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | EngineeringMapper engineeringMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | OptimizeHeatDetailMapper optimizeHeatDetailMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | EdgStorageCageMapper edgStorageCageMapper; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Autowired |
| | | TaskCacheService taskCacheService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | DamageMapper damageMapper; |
| | | |
| | | @Autowired |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<List<Map<String, Object>>> selectTemperingTerritory(String current) { |
| | | public List<Map<String, Object>> selectTemperingTerritory(String current) { |
| | | //此工程的所有优化数据 |
| | | List<Map<String, Object>> resultCutTerritory = optimizeHeatDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeHeatDetail.class) |
| | | .selectAll(OptimizeHeatDetail.class) |
| | | .selectAs(OptimizeProject::getLoadWidth, "olWidth") |
| | | .selectAs(OptimizeProject::getLoadLength, "olHeight") |
| | | .selectAs(OptimizeHeatLayout::getLayoutRate, "olLayoutRate") |
| | | .leftJoin(OptimizeHeatLayout.class, on -> on |
| | | .eq(OptimizeHeatLayout::getProjectNo, OptimizeHeatDetail::getProjectNo) |
| | | .eq(OptimizeHeatLayout::getLayoutId, OptimizeHeatDetail::getLayoutId)) |
| | |
| | | .eq(OptimizeHeatDetail::getProjectNo, current) |
| | | .gt(OptimizeHeatDetail::getLayoutId, 0) |
| | | ); |
| | | |
| | | //这里就是 按版图号分组 [{layout_id:"1",width:200,height:300...},{layout_id:"2",width:300,height:300...}] |
| | | Map<String, List<Map<String, Object>>> groupBy = resultCutTerritory.stream().collect(Collectors.groupingBy(item -> item.get("layout_id").toString())); |
| | | // List<List<Map<String, Object>>> Result=groupBy.values().stream().collect(Collectors.toList()); |
| | | List<List<Map<String, Object>>> result = new ArrayList<>(); |
| | | //按版图号排序 |
| | | |
| | | List<Map<String, Object>> result = new ArrayList<>();//返回结果 |
| | | for (int i = 1; i <= groupBy.keySet().size(); i++) { |
| | | String key = i + ""; |
| | | if (key != null) { |
| | | result.add(groupBy.get(key)); |
| | | List<Map<String, Object>> galssInfo=groupBy.get(key);//当前钢化版图内玻璃小片集合 |
| | | if(!galssInfo.isEmpty()){ |
| | | Map<String, Object> item=new HashMap<>();//新格式编排 |
| | | //以下为同层 {key:"groupBy.get(key)",olLayoutRate:"小片集合"} |
| | | // {key:"groupBy.get(key)",olLayoutRate:[{},{},{},{}]} |
| | | |
| | | |
| | | item.put("listGlass",groupBy.get(key)); |
| | | item.put("LayoutId",key); |
| | | item.put("olWidth",galssInfo.get(0).get("olWidth").toString()); |
| | | item.put("olHeight",galssInfo.get(0).get("olHeight").toString()); |
| | | item.put("olLayoutRate",galssInfo.get(0).get("olLayoutRate").toString()); |
| | | result.add(item); |
| | | }else{ |
| | | log.info("当前钢化版图不存在小片数据请检查,版图号:{}"+key); |
| | | return null ; |
| | | } |
| | | } |
| | | } |
| | | // List<List<Map<String, Object>>> result = new ArrayList<>();//返回结果 |
| | | // |
| | | // for (int i = 1; i <= groupBy.keySet().size(); i++) { |
| | | // String key = i + ""; |
| | | // if (key != null) { |
| | | // result.add(groupBy.get(key)); |
| | | // } |
| | | // } |
| | | return result; |
| | | } |
| | | |