Parcourir la source

更新店铺列表排序,商户二维码展示,快跑者订单中的地址姓名处理

liu il y a 9 mois
Parent
commit
32e7a11603

+ 6 - 2
src/main/java/com/sqx/modules/callBack/controller/CallBackController.java

@@ -320,6 +320,7 @@ public class CallBackController {
         String userName = address.getUserName();
         if (ObjectUtils.isNotEmpty(userName)) {
             try {
+                userName=userName.replaceAll("\\r\\n|\\n|\\r", " ");
                 userName = URLEncoder.encode(userName, "UTF-8");
             } catch (UnsupportedEncodingException e) {
                 throw new RuntimeException(e);
@@ -448,8 +449,11 @@ public class CallBackController {
 
 
 //        String userName = address.getUserName();
-
-        body2.put("customer_name", address.getUserName());
+        String userName1 = address.getUserName();
+        if (ObjectUtils.isNotEmpty(userName1)) {
+            userName1=userName1.replaceAll("\\r\\n|\\n|\\r", " ");
+        }
+        body2.put("customer_name", userName1);
 
 //        String userPhone = address.getUserPhone();
 

+ 3 - 0
src/main/java/com/sqx/modules/datacentre/entity/SysUserShop.java

@@ -40,4 +40,7 @@ public class SysUserShop implements Serializable {
     @TableField(exist = false)
     private Integer bannedFlag;
 
+    @TableField(exist = false)
+    private String shopTypeId;
+
 }

+ 6 - 2
src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java

@@ -524,6 +524,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
         String userName = address.getUserName();
         if (ObjectUtils.isNotEmpty(userName)) {
             try {
+                userName=userName.replaceAll("\\r\\n|\\n|\\r", " ");
                 userName = URLEncoder.encode(userName, "UTF-8");
             } catch (UnsupportedEncodingException e) {
                 throw new RuntimeException(e);
@@ -652,8 +653,11 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
 
 
 //        String userName = address.getUserName();
-
-        body2.put("customer_name", address.getUserName());
+        String userName1 = address.getUserName();
+        if (ObjectUtils.isNotEmpty(userName1)) {
+            userName1=userName1.replaceAll("\\r\\n|\\n|\\r", " ");
+        }
+        body2.put("customer_name", userName1);
 
 //        String userPhone = address.getUserPhone();
 

+ 1 - 1
src/main/java/com/sqx/modules/goods/dto/ShopQueryDTO.java

@@ -13,7 +13,7 @@ import lombok.Data;
 public class ShopQueryDTO extends PageQuery {
     private Long userId;
     /**
-     * 1 综合排序(评分),2 商户类型筛选,3 距离排序,4 销量, 5 配送费排序,6 免配送费筛选
+     * 1 系统排序 2评分排序 3销量排序 4店铺创建时间排序
      */
     private Integer screen;
     private Integer shopTypeId;

+ 4 - 4
src/main/java/com/sqx/modules/invite/controller/InviteController.java

@@ -60,14 +60,14 @@ public class InviteController {
 
     @GetMapping("/shopQr")
     @ApiOperation("门店二维码")
-    public void shopQr(String shopId, HttpServletResponse response) {
-        SenInfoCheckUtil.getShopQr(shopId,response);
+    public void shopQr(String shopId,String shopTypeId, HttpServletResponse response) {
+        SenInfoCheckUtil.getShopQr(shopId,shopTypeId,response);
     }
 
     @GetMapping("/shopQr2")
     @ApiOperation("门店二维码")
-    public void shopQr2(String shopId, HttpServletResponse response) {
-        SenInfoCheckUtil.getShopQr2(shopId,response);
+    public void shopQr2(String shopId,String shopTypeId, HttpServletResponse response) {
+        SenInfoCheckUtil.getShopQr2(shopId,shopTypeId,response);
     }
 
 

+ 7 - 6
src/main/java/com/sqx/modules/utils/SenInfoCheckUtil.java

@@ -173,12 +173,13 @@ public class SenInfoCheckUtil {
     /**
      * 获取二维码图片
      */
-    public static void getShopQr(String shopId, HttpServletResponse response){
+    public static void getShopQr(String shopId,String shopTypeId, HttpServletResponse response){
         String mpToken = getMpToken();
         //获取二维码数据
         String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+mpToken;
         Map<String,Object> map = Maps.newHashMap();
-        map.put("scene",shopId);
+
+        map.put("scene","shopId="+shopId+"&shopTypeId="+shopTypeId);
         CommonInfo one = commonInfoService.findOne(261);
         if("是".equals(one.getValue())){
             map.put("page","pages/index/index");
@@ -201,18 +202,18 @@ public class SenInfoCheckUtil {
     /**
      * 获取二维码图片
      */
-    public static void getShopQr2(String shopId, HttpServletResponse response){
+    public static void  getShopQr2(String shopId,String shopTypeId, HttpServletResponse response){
         String mpToken = getMpToken();
         //获取二维码数据
         String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+mpToken;
         Map<String,Object> map = Maps.newHashMap();
-        map.put("scene",shopId);
+        map.put("scene","shopId="+shopId+"&shopTypeId="+shopTypeId);
         CommonInfo one = commonInfoService.findOne(261);
         if("是".equals(one.getValue())){
             map.put("page","my/index/shop/index2");
         }
-        map.put("check_path",false);
-        map.put("env_version","trial");
+//        map.put("check_path",false);
+//        map.put("env_version","trial");
         map.put("width", 280);
         String jsonString = JSON.toJSONString(map);
         InputStream inputStream = sendPostBackStream(url, jsonString);

+ 49 - 33
src/main/resources/mapper/goods/GoodsShopMapper.xml

@@ -217,39 +217,55 @@
     </select>
 
     <select id="selectShop" resultType="com.sqx.modules.goods.entity.GoodsShop">
-        select * from (select gs.*,(st_distance (point (gs.shop_lng,gs.shop_lat),point(#{lng},#{lat}) ) *111195) AS
-        distance
-        from goods_shop gs
-        left join shop_type st on gs.shop_type_id = st.id
-        where gs.status = 1 and gs.city = #{city} and gs.putaway_flag = 0 and gs.is_supplier=1 and (gs.is_conceal =0 or gs.is_conceal is NULL)
-        <if test="impotr!=null and impotr!=''">
-            AND (gs.shop_name LIKE concat('%',#{impotr},'%') or
-            st.shop_type_name like concat('%',#{impotr},'%') or
-            gs.shop_lable LIKE concat('%',#{impotr},'%') or
-            gs.shop_id in (
-            select shop_id from goods where goods_name like concat('%',#{impotr},'%')
-            )
-            )
-        </if>
-
-        <if test="activityId!=null">
-            and gs.activity_id = #{activityId}
-        </if>
-        <if test="shopTypeId!=null">
-            and FIND_IN_SET(#{shopTypeId},gs.shop_type_id)
-        </if>
-        order by gs.is_recommend desc
-        <if test="screen==1">
-            ,gs.sort,gs.shop_score desc, distance asc
-        </if>
-        <if test="screen==3">
-            ,distance asc
-        </if>
-        <if test="screen==4">
-            ,gs.shop_sales desc
-        </if>
-        ) a
-        where distribution_distance >= distance
+        select
+            *
+        from
+            (
+                select
+                    gs.*,
+                    (st_distance (point (gs.shop_lng,gs.shop_lat),point(#{lng}, #{lat}) ) * 111195) AS distance
+                from
+                    goods_shop gs
+                left join shop_type st on gs.shop_type_id = st.id
+                where
+                    gs.status = 1
+                    and gs.city = #{city}
+                    and gs.putaway_flag = 0
+                    and gs.is_supplier=1
+                    and (gs.is_conceal =0 or gs.is_conceal is NULL)
+                <if test="impotr!=null and impotr!=''">
+                    AND (
+                        gs.shop_name LIKE concat('%',#{impotr},'%')
+                        or st.shop_type_name like concat('%',#{impotr},'%')
+                        or gs.shop_lable LIKE concat('%',#{impotr},'%')
+                        or gs.shop_id in (
+                            select shop_id from goods where goods_name like concat('%',#{impotr},'%')
+                        )
+                    )
+                </if>
+                <if test="activityId!=null">
+                    and gs.activity_id = #{activityId}
+                </if>
+                <if test="shopTypeId!=null">
+                    and FIND_IN_SET(#{shopTypeId},gs.shop_type_id)
+                </if>
+                order by
+                    gs.is_recommend desc
+                <if test="screen == 1">
+                    ,gs.sort,gs.shop_score desc, distance asc
+                </if>
+                <if test="screen == 2">
+                    ,gs.shop_score desc
+                </if>
+                <if test="screen == 3">
+                    ,gs.shop_sales desc
+                </if>
+                <if test="screen == 4">
+                    ,gs.create_time desc
+                </if>
+            ) a
+        where
+            distribution_distance >= distance
     </select>
 
     <select id="selectEvaluate" resultType="com.sqx.modules.order.entity.Evaluate">

+ 2 - 1
src/main/resources/mapper/sys/SysShopDao.xml

@@ -8,7 +8,8 @@
     </select>
 
     <select id="selectShopId" resultType="com.sqx.modules.datacentre.entity.SysUserShop">
-        select sus.*, gs.shop_name as shopName, gs.shop_cover as shopCover, gs.putaway_flag as putawayFlag, gs.banned_flag as bannedFlag from sys_user_shop sus
+        select sus.*, gs.shop_name as shopName, gs.shop_cover as shopCover, gs.putaway_flag as putawayFlag, gs.banned_flag as bannedFlag,gs.shop_type_id as shopTypeId
+        from sys_user_shop sus
         left join goods_shop gs on sus.shop_id = gs.shop_id where sus.user_id = #{userId}
     </select>