zhangyuewww пре 2 година
родитељ
комит
1d2bba11fc

+ 23 - 26
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyReleaseGoodsInfoServiceImpl.java

@@ -51,38 +51,34 @@ public class HyReleaseGoodsInfoServiceImpl extends ServiceImpl<HyReleaseGoodsInf
         pageView.put("currentPage", hyReleaseGoodsInfo.getCurrentPage());
         pageView.put("loadingPlaceCity", hyReleaseGoodsInfo.getLoadingPlaceCity());
         pageView.put("unLoadingPlaceCity", hyReleaseGoodsInfo.getUnLoadingPlaceCity());
-        if (hyReleaseGoodsInfo.getLoadingPlace().contains(",")){
-            StringBuffer sb = new StringBuffer();
-            String[] temp = hyReleaseGoodsInfo.getLoadingPlace().split(",");
-            for (int i = 0; i < temp.length; i++) {
-                if (!"".equals(temp[i]) && temp[i] != null)
-                    sb.append("'" + temp[i] + "',");
+        if(hyReleaseGoodsInfo.getLoadingPlace() != null && !hyReleaseGoodsInfo.getLoadingPlace().isEmpty()){
+            String result = "";
+            String[] array = hyReleaseGoodsInfo.getLoadingPlace().split(",");
+            for (String tmp:array) {
+                result += "'"+tmp+"',";
             }
-            String result = sb.toString();
-            String tp = result.substring(result.length() - 1, result.length());
-            if (",".equals(tp)){
-                hyReleaseGoodsInfo.setLoadingPlace(result.substring(0, result.length() - 1));
-            } else{
-                hyReleaseGoodsInfo.setLoadingPlace(result);
+            if(result.length() > 0){
+                result = result.substring(0,result.length()-1);
             }
+            else{
+                result = "'"+hyReleaseGoodsInfo.getLoadingPlace()+"'";
+            }
+            pageView.put("loadingPlace", result);
         }
-        if (hyReleaseGoodsInfo.getUnLoadingPlace().contains(",")){
-            StringBuffer sb = new StringBuffer();
-            String[] temp = hyReleaseGoodsInfo.getUnLoadingPlace().split(",");
-            for (int i = 0; i < temp.length; i++) {
-                if (!"".equals(temp[i]) && temp[i] != null)
-                    sb.append("'" + temp[i] + "',");
+        if(hyReleaseGoodsInfo.getUnLoadingPlace() != null && !hyReleaseGoodsInfo.getUnLoadingPlace().isEmpty()){
+            String result = "";
+            String[] array = hyReleaseGoodsInfo.getUnLoadingPlace().split(",");
+            for (String tmp:array) {
+                result += "'"+tmp+"',";
+            }
+            if(result.length() > 0){
+                result = result.substring(0,result.length()-1);
             }
-            String result = sb.toString();
-            String tp = result.substring(result.length() - 1, result.length());
-            if (",".equals(tp)){
-                hyReleaseGoodsInfo.setUnLoadingPlace(result.substring(0, result.length() - 1));
-            } else{
-                hyReleaseGoodsInfo.setUnLoadingPlace(result);
+            else{
+                result = "'"+hyReleaseGoodsInfo.getUnLoadingPlace()+"'";
             }
+            pageView.put("unLoadingPlace", result);
         }
-        pageView.put("loadingPlace", hyReleaseGoodsInfo.getLoadingPlace());
-        pageView.put("unLoadingPlace", hyReleaseGoodsInfo.getUnLoadingPlace());
         //货源列表
         List<HyReleaseGoodsInfo> hyReleaseGoodsInfoList = new ArrayList<>();
         //按时间排序货源列表
@@ -145,6 +141,7 @@ public class HyReleaseGoodsInfoServiceImpl extends ServiceImpl<HyReleaseGoodsInf
             }
             //周边信息列表
             List<HyReleaseGoodsInfo> dataList1 = baseMapper.getAllListsByCondition(pageView);
+            dataList1.removeAll(dataList);
             if (!CollectionUtils.isEmpty(dataList1)) {
                 if (!StringUtils.isEmpty(hyReleaseGoodsInfo.getLoadingPlaceCity())) {
                     //查询发货地经纬度

+ 12 - 12
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyReleaseGoodsInfoMapper.xml

@@ -148,18 +148,18 @@
         <if test="commonId != null and commonId != ''">
             AND common_id = #{commonId}
         </if>
-        <if test="loadingPlaceCity != null and loadingPlaceCity != '' and loadingPlace == null and loadingPlace == ''">
-            AND (lower(send_city) not like lower(CONCAT('%',#{loadingPlaceCity},'%')))
-        </if>
-        <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != '' and unLoadingPlace == null and unLoadingPlace == ''">
-            AND (lower(unload_city) not like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
-        </if>
-        <if test="loadingPlace != null and loadingPlace != ''">
-            AND send_area not in (${loadingPlace})
-        </if>
-        <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND unload_area not in (${unLoadingPlace})
-        </if>
+<!--        <if test="loadingPlaceCity != null and loadingPlaceCity != '' and (loadingPlace == null or loadingPlace == '' or unLoadingPlace == null or unLoadingPlace == '')">-->
+<!--            AND (lower(send_city) not like lower(CONCAT('%',#{loadingPlaceCity},'%')))-->
+<!--        </if>-->
+<!--        <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != '' and( unLoadingPlace == null or unLoadingPlace == ''or loadingPlace == null or loadingPlace == '')">-->
+<!--            AND (lower(unload_city) not like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))-->
+<!--        </if>-->
+<!--        <if test="loadingPlace != null and loadingPlace != ''">-->
+<!--            AND send_area not in (${loadingPlace})-->
+<!--        </if>-->
+<!--        <if test="unLoadingPlace != null and unLoadingPlace != ''">-->
+<!--            AND unload_area not in (${unLoadingPlace})-->
+<!--        </if>-->
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND status!='已下架' and delete_flag = '0'