Commit 3d4c5398 authored by 廖旭伟's avatar 廖旭伟

排序bug修改

parent 3498267e
...@@ -155,6 +155,11 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD ...@@ -155,6 +155,11 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD
query.setOrderCols(orderCols); query.setOrderCols(orderCols);
query.setSiteId(siteId); query.setSiteId(siteId);
List<SstAppsDeskEntity> appsEntities = this.find(query); List<SstAppsDeskEntity> appsEntities = this.find(query);
Map<String,String> orderCols1 = new HashMap<>();
orderCols1.put("clickSum","DESC");
orderCols1.put("hotSort","DESC");
query.setOrderCols(orderCols1);
List<SstAppsDeskEntity> appsHots = this.find(query);
Map<Long,Long> black = new HashMap<>(); Map<Long,Long> black = new HashMap<>();
if(StringUtils.isNotEmpty(deviceCode)){ if(StringUtils.isNotEmpty(deviceCode)){
DeviceBlackappPdu blackappPdu = new DeviceBlackappPdu(); DeviceBlackappPdu blackappPdu = new DeviceBlackappPdu();
...@@ -162,7 +167,6 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD ...@@ -162,7 +167,6 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD
blackappPdu.setDeviceCode(deviceCode); blackappPdu.setDeviceCode(deviceCode);
Rest<RespData<List<DeviceBlackappPdu>>> rest = appFeign.blackappList(blackappPdu); Rest<RespData<List<DeviceBlackappPdu>>> rest = appFeign.blackappList(blackappPdu);
if (rest.getCode().equals(YesNoEnum.YES.getValue())) { if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
List<AppsInfoEntity> appsInfoEntities = new ArrayList<>();
for(DeviceBlackappPdu pdu:rest.getData().getData()){ for(DeviceBlackappPdu pdu:rest.getData().getData()){
black.put(pdu.getAppId(),pdu.getAppId()); black.put(pdu.getAppId(),pdu.getAppId());
} }
...@@ -183,7 +187,6 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD ...@@ -183,7 +187,6 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD
siteApp.put("allApps", allApps); siteApp.put("allApps", allApps);
if(CollectionUtils.isNotEmpty(appsEntities)){ if(CollectionUtils.isNotEmpty(appsEntities)){
List<AppsInfoEntity> showApps = new ArrayList<>(); List<AppsInfoEntity> showApps = new ArrayList<>();
List<AppsInfoEntity> hotApps = new ArrayList<>();
for(SstAppsDeskEntity sstAppsDeskEntity:appsEntities){ for(SstAppsDeskEntity sstAppsDeskEntity:appsEntities){
if(black.containsKey(sstAppsDeskEntity.getAppId())){ if(black.containsKey(sstAppsDeskEntity.getAppId())){
continue; continue;
...@@ -196,14 +199,28 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD ...@@ -196,14 +199,28 @@ public class SstAppsDeskServiceImpl extends AbstractCRUDServiceImpl<SstAppsDeskD
if(sstAppsDeskEntity.getShowBasic()==1){ if(sstAppsDeskEntity.getShowBasic()==1){
showApps.add(appInfoMap.get(sstAppsDeskEntity.getAppId())); showApps.add(appInfoMap.get(sstAppsDeskEntity.getAppId()));
} }
}
siteApp.put("showApps", showApps);
}else {
siteApp.put("showApps", Collections.emptyList());
}
if(CollectionUtils.isNotEmpty(appsHots)){
List<AppsInfoEntity> hotApps = new ArrayList<>();
for(SstAppsDeskEntity sstAppsDeskEntity:appsHots){
if(black.containsKey(sstAppsDeskEntity.getAppId())){
continue;
}
if(!appInfoMap.containsKey(sstAppsDeskEntity.getAppId())){
continue;
}
appInfoMap.get(sstAppsDeskEntity.getAppId()).setClickSum(sstAppsDeskEntity.getClickSum());
appInfoMap.get(sstAppsDeskEntity.getAppId()).setSort(sstAppsDeskEntity.getBasicSort());
if(sstAppsDeskEntity.getShowHot()==1){ if(sstAppsDeskEntity.getShowHot()==1){
hotApps.add(appInfoMap.get(sstAppsDeskEntity.getAppId())); hotApps.add(appInfoMap.get(sstAppsDeskEntity.getAppId()));
} }
} }
siteApp.put("showApps", showApps);
siteApp.put("hotApps", hotApps); siteApp.put("hotApps", hotApps);
}else { }else {
siteApp.put("showApps", Collections.emptyList());
siteApp.put("hotApps", Collections.emptyList()); siteApp.put("hotApps", Collections.emptyList());
} }
return siteApp; return siteApp;
......
...@@ -157,6 +157,11 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA ...@@ -157,6 +157,11 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
query.setOrderCols(orderCols); query.setOrderCols(orderCols);
query.setSiteId(siteId); query.setSiteId(siteId);
List<SstAppsEntity> appsEntities = this.find(query); List<SstAppsEntity> appsEntities = this.find(query);
Map<String,String> orderCols1 = new HashMap<>();
orderCols1.put("clickSum","DESC");
orderCols1.put("hotSort","DESC");
query.setOrderCols(orderCols1);
List<SstAppsEntity> appsHots = this.find(query);
Map<Long,Long> black = new HashMap<>(); Map<Long,Long> black = new HashMap<>();
if(StringUtils.isNotEmpty(deviceCode)){ if(StringUtils.isNotEmpty(deviceCode)){
DeviceBlackappPdu blackappPdu = new DeviceBlackappPdu(); DeviceBlackappPdu blackappPdu = new DeviceBlackappPdu();
...@@ -164,7 +169,6 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA ...@@ -164,7 +169,6 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
blackappPdu.setDeviceCode(deviceCode); blackappPdu.setDeviceCode(deviceCode);
Rest<RespData<List<DeviceBlackappPdu>>> rest = appFeign.blackappList(blackappPdu); Rest<RespData<List<DeviceBlackappPdu>>> rest = appFeign.blackappList(blackappPdu);
if (rest.getCode().equals(YesNoEnum.YES.getValue())) { if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
List<AppsInfoEntity> appsInfoEntities = new ArrayList<>();
for(DeviceBlackappPdu pdu:rest.getData().getData()){ for(DeviceBlackappPdu pdu:rest.getData().getData()){
black.put(pdu.getAppId(),pdu.getAppId()); black.put(pdu.getAppId(),pdu.getAppId());
} }
...@@ -186,7 +190,6 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA ...@@ -186,7 +190,6 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
siteApp.put("allApps", allApps); siteApp.put("allApps", allApps);
if(CollectionUtils.isNotEmpty(appsEntities)){ if(CollectionUtils.isNotEmpty(appsEntities)){
List<AppsInfoEntity> showApps = new ArrayList<>(); List<AppsInfoEntity> showApps = new ArrayList<>();
List<AppsInfoEntity> hotApps = new ArrayList<>();
for(SstAppsEntity sstAppsEntity:appsEntities){ for(SstAppsEntity sstAppsEntity:appsEntities){
if(black.containsKey(sstAppsEntity.getAppId())){ if(black.containsKey(sstAppsEntity.getAppId())){
continue; continue;
...@@ -199,14 +202,28 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA ...@@ -199,14 +202,28 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
if(sstAppsEntity.getShowBasic()==1){ if(sstAppsEntity.getShowBasic()==1){
showApps.add(appInfoMap.get(sstAppsEntity.getAppId())); showApps.add(appInfoMap.get(sstAppsEntity.getAppId()));
} }
}
siteApp.put("showApps", showApps);
}else {
siteApp.put("showApps", Collections.emptyList());
}
if(CollectionUtils.isNotEmpty(appsHots)){
List<AppsInfoEntity> hotApps = new ArrayList<>();
for(SstAppsEntity sstAppsEntity:appsHots){
if(black.containsKey(sstAppsEntity.getAppId())){
continue;
}
if(!appInfoMap.containsKey(sstAppsEntity.getAppId())){
continue;
}
appInfoMap.get(sstAppsEntity.getAppId()).setClickSum(sstAppsEntity.getClickSum());
appInfoMap.get(sstAppsEntity.getAppId()).setSort(sstAppsEntity.getBasicSort());
if(sstAppsEntity.getShowHot()==1){ if(sstAppsEntity.getShowHot()==1){
hotApps.add(appInfoMap.get(sstAppsEntity.getAppId())); hotApps.add(appInfoMap.get(sstAppsEntity.getAppId()));
} }
} }
siteApp.put("showApps", showApps);
siteApp.put("hotApps", hotApps); siteApp.put("hotApps", hotApps);
}else { }else {
siteApp.put("showApps", Collections.emptyList());
siteApp.put("hotApps", Collections.emptyList()); siteApp.put("hotApps", Collections.emptyList());
} }
return siteApp; return siteApp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment