|
@@ -146,76 +146,131 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 订
|
|
|
- *
|
|
|
+ * 订单货主/司机详情,好评率
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public OrderInfo selectHaoPing(String commonId) {
|
|
|
+ public OrderInfo selectHaoPing(String commonId,String evaluateFlag) {
|
|
|
OrderInfo orderInfo = new OrderInfo();
|
|
|
- Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
|
- .eq("common_id", commonId));
|
|
|
- String hao = "";
|
|
|
- Integer zong =0;
|
|
|
- if(count == 0){
|
|
|
- count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
|
- .eq("cargo_common_id", commonId));
|
|
|
+ String hao = "";
|
|
|
+ Integer zong = 0;
|
|
|
+ if ("1".equals(evaluateFlag)){
|
|
|
+ //查询司机发运次数
|
|
|
+ Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
|
+ .eq("common_id", commonId).eq("order_status_key","25").eq("delete_flag","0"));
|
|
|
+ orderInfo.setCountFa(String.valueOf(count));
|
|
|
+
|
|
|
Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
.eq("satisfaction", "5")
|
|
|
- .eq("owner_id",commonId));
|
|
|
+ .eq("evaluatored_id", commonId));
|
|
|
orderInfo.setHaoPing(evaluateInfoCount);
|
|
|
Integer evaluateInfoCount1 = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
.eq("satisfaction", "1")
|
|
|
- .eq("owner_id",commonId));
|
|
|
+ .eq("evaluatored_id", commonId));
|
|
|
orderInfo.setChaPing(evaluateInfoCount1);
|
|
|
if (evaluateInfoCount >= 20 && count != 0) {
|
|
|
- hao = String.valueOf(evaluateInfoCount/count*100+"%");
|
|
|
+ hao = String.valueOf(evaluateInfoCount / count * 100 + "%");
|
|
|
}
|
|
|
+
|
|
|
List<EvaluateInfo> evaluateInfos = evaluateInfoService.selectList(new EntityWrapper<EvaluateInfo>()
|
|
|
- .eq("owner_id",commonId));
|
|
|
- if(CollectionUtil.isNotEmpty(evaluateInfos)){
|
|
|
+ .eq("evaluatored_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());
|
|
|
+ for (int i = 0; i < evaluateInfos.size(); i++) {
|
|
|
+ fen = fen + Integer.parseInt(evaluateInfos.get(i).getComprehensiveSatisfaction());
|
|
|
}
|
|
|
- if(fen!= 0){
|
|
|
- zong=fen/(evaluateInfos.size()*5);
|
|
|
+ if (fen != 0) {
|
|
|
+ zong = fen / (evaluateInfos.size() * 5);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else{
|
|
|
+ }else {
|
|
|
+ Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
|
|
|
+ .eq("cargo_common_id", commonId).eq("cargo_owner_status_key","31").eq("delete_flag","0"));
|
|
|
+ orderInfo.setCountFa(String.valueOf(count));
|
|
|
+
|
|
|
Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
.eq("satisfaction", "5")
|
|
|
- .eq("driver_id",commonId));
|
|
|
+ .eq("evaluatored_id", commonId));
|
|
|
orderInfo.setHaoPing(evaluateInfoCount);
|
|
|
Integer evaluateInfoCount1 = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
|
|
|
.eq("satisfaction", "1")
|
|
|
- .eq("driver_id",commonId));
|
|
|
+ .eq("evaluatored_id", commonId));
|
|
|
orderInfo.setChaPing(evaluateInfoCount1);
|
|
|
if (evaluateInfoCount >= 20 && count != 0) {
|
|
|
- hao = String.valueOf(evaluateInfoCount/count*100+"%");
|
|
|
+ hao = String.valueOf(evaluateInfoCount / count * 100 + "%");
|
|
|
}
|
|
|
List<EvaluateInfo> evaluateInfos = evaluateInfoService.selectList(new EntityWrapper<EvaluateInfo>()
|
|
|
- .eq("driver_id",commonId));
|
|
|
- if(CollectionUtil.isNotEmpty(evaluateInfos)){
|
|
|
+ .eq("evaluatored_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());
|
|
|
+ for (int i = 0; i < evaluateInfos.size(); i++) {
|
|
|
+ fen = fen + Integer.parseInt(evaluateInfos.get(i).getComprehensiveSatisfaction());
|
|
|
}
|
|
|
- if(fen!= 0){
|
|
|
- zong=fen/(evaluateInfos.size()*5);
|
|
|
+ if (fen != 0) {
|
|
|
+ zong = fen / (evaluateInfos.size() * 5);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- orderInfo.setCountFa(String.valueOf(count));
|
|
|
orderInfo.setHaoPingLv(hao);
|
|
|
orderInfo.setZong(zong);
|
|
|
return orderInfo;
|
|
|
}
|
|
|
|
|
|
+// 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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 订单详情
|
|
|
*
|