|
|
@@ -1334,7 +1334,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
//判断是否相等
|
|
|
if(set.size()>1){
|
|
|
//最优惠公司
|
|
|
- int index = getCompanyNameByMinAmount(yhhbjList)+1;
|
|
|
+ int index = getCompanyNameByMinAmount(yhhbjList);
|
|
|
companyName = companyAllList.get(index);
|
|
|
// priceList.add(getZYList(companyList,index,false));
|
|
|
priceList.add(companyList);
|
|
|
@@ -1390,12 +1390,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
private static int getCompanyNameByMinAmount(List<String> yhhbjList) {
|
|
|
int minIndex=0;
|
|
|
if(yhhbjList !=null && yhhbjList.size()>0){
|
|
|
- String minValue = yhhbjList.get(0);
|
|
|
- for (int i = 0; i < yhhbjList.size(); i++) {
|
|
|
- if (minValue.compareTo(yhhbjList.get(i)) > 0) {
|
|
|
- minIndex = i;
|
|
|
- }
|
|
|
- }
|
|
|
+ String max = Collections.max(yhhbjList);
|
|
|
+ minIndex = yhhbjList.indexOf(max);
|
|
|
}
|
|
|
return minIndex;
|
|
|
}
|