|
@@ -140,14 +140,63 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
OrderInfo orderInfo = new OrderInfo();
|
|
OrderInfo orderInfo = new OrderInfo();
|
|
Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
.eq("common_id", commonId));
|
|
.eq("common_id", commonId));
|
|
- orderInfo.setCountFa(String.valueOf(count));
|
|
|
|
- Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
|
- .eq("satisfaction", "5"));
|
|
|
|
String hao = "";
|
|
String hao = "";
|
|
- if (evaluateInfoCount >= 20 && count != 0) {
|
|
|
|
- hao = String.valueOf(evaluateInfoCount/count*100+"%");
|
|
|
|
|
|
+ Integer zong =0;
|
|
|
|
+ if(count == 0){
|
|
|
|
+ count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
|
|
+ .eq("cargo_common_id", commonId));
|
|
|
|
+ Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("satisfaction", "5")
|
|
|
|
+ .eq("owner_id",commonId));
|
|
|
|
+ orderInfo.setHaoPing(evaluateInfoCount);
|
|
|
|
+ Integer evaluateInfoCount1 = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("satisfaction", "1")
|
|
|
|
+ .eq("owner_id",commonId));
|
|
|
|
+ orderInfo.setChaPing(evaluateInfoCount1);
|
|
|
|
+ if (evaluateInfoCount >= 20 && count != 0) {
|
|
|
|
+ hao = String.valueOf(evaluateInfoCount/count*100+"%");
|
|
|
|
+ }
|
|
|
|
+ List<EvaluateInfo> evaluateInfos = evaluateInfoService.selectList(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("owner_id",commonId));
|
|
|
|
+ if(CollectionUtil.isNotEmpty(evaluateInfos)){
|
|
|
|
+ int fen = 0;
|
|
|
|
+ for(int i=0;i<evaluateInfos.size();i++){
|
|
|
|
+
|
|
|
|
+ fen = fen+Integer.parseInt(evaluateInfos.get(i).getComprehensiveSatisfaction());
|
|
|
|
+ }
|
|
|
|
+ if(fen!= 0){
|
|
|
|
+ zong=fen/(evaluateInfos.size()*5);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ else{
|
|
|
|
+ Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("satisfaction", "5")
|
|
|
|
+ .eq("driver_id",commonId));
|
|
|
|
+ orderInfo.setHaoPing(evaluateInfoCount);
|
|
|
|
+ Integer evaluateInfoCount1 = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("satisfaction", "1")
|
|
|
|
+ .eq("driver_id",commonId));
|
|
|
|
+ orderInfo.setChaPing(evaluateInfoCount1);
|
|
|
|
+ if (evaluateInfoCount >= 20 && count != 0) {
|
|
|
|
+ hao = String.valueOf(evaluateInfoCount/count*100+"%");
|
|
|
|
+ }
|
|
|
|
+ List<EvaluateInfo> evaluateInfos = evaluateInfoService.selectList(new EntityWrapper<EvaluateInfo>()
|
|
|
|
+ .eq("driver_id",commonId));
|
|
|
|
+ if(CollectionUtil.isNotEmpty(evaluateInfos)){
|
|
|
|
+ int fen = 0;
|
|
|
|
+ for(int i=0;i<evaluateInfos.size();i++){
|
|
|
|
+
|
|
|
|
+ fen = fen+Integer.parseInt(evaluateInfos.get(i).getComprehensiveSatisfaction());
|
|
|
|
+ }
|
|
|
|
+ if(fen!= 0){
|
|
|
|
+ zong=fen/(evaluateInfos.size()*5);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ orderInfo.setCountFa(String.valueOf(count));
|
|
orderInfo.setHaoPingLv(hao);
|
|
orderInfo.setHaoPingLv(hao);
|
|
|
|
+ orderInfo.setZong(zong);
|
|
return orderInfo;
|
|
return orderInfo;
|
|
}
|
|
}
|
|
|
|
|