1
0
Переглянути джерело

小程序BBC改造修改,线下订单修改

hyq 6 роки тому
батько
коміт
35ae217c73
53 змінених файлів з 1158 додано та 109 видалено
  1. 32 46
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  2. 5 5
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  3. 1 1
      kmall-admin/src/main/resources/conf/common.properties
  4. 37 8
      kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java
  5. 2 0
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  6. 2 2
      kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java
  7. 2 1
      kmall-api/src/main/java/com/kmall/api/api/ApiHelpIssueController.java
  8. 1 0
      kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java
  9. 15 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiMerchMapper.java
  10. 16 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiMerchUserMapper.java
  11. 20 0
      kmall-api/src/main/java/com/kmall/api/entity/AdVo.java
  12. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/CartVo.java
  13. 19 0
      kmall-api/src/main/java/com/kmall/api/entity/CategoryVo.java
  14. 18 0
      kmall-api/src/main/java/com/kmall/api/entity/FeedbackVo.java
  15. 30 0
      kmall-api/src/main/java/com/kmall/api/entity/GoodsVo.java
  16. 171 0
      kmall-api/src/main/java/com/kmall/api/entity/MerchUserVo.java
  17. 222 0
      kmall-api/src/main/java/com/kmall/api/entity/MerchVo.java
  18. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderGoodsVo.java
  19. 19 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  20. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/TokenEntity.java
  21. 20 0
      kmall-api/src/main/java/com/kmall/api/entity/UserVo.java
  22. 1 0
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  23. 54 0
      kmall-api/src/main/java/com/kmall/api/service/ApiMerchUserService.java
  24. 15 9
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  25. 8 1
      kmall-api/src/main/java/com/kmall/api/service/TokenService.java
  26. 8 0
      kmall-api/src/main/resources/mybatis/mapper/ApiAdMapper.xml
  27. 11 1
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  28. 8 0
      kmall-api/src/main/resources/mybatis/mapper/ApiCategoryMapper.xml
  29. 12 4
      kmall-api/src/main/resources/mybatis/mapper/ApiFeedbackMapper.xml
  30. 3 0
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsIssueMapper.xml
  31. 9 1
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml
  32. 3 0
      kmall-api/src/main/resources/mybatis/mapper/ApiHelpIssueMapper.xml
  33. 154 0
      kmall-api/src/main/resources/mybatis/mapper/ApiMerchMapper.xml
  34. 132 0
      kmall-api/src/main/resources/mybatis/mapper/ApiMerchUserMapper.xml
  35. 2 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml
  36. 3 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml
  37. 1 1
      wx-mall/config/api.js
  38. 1 1
      wx-mall/pages/auth/btnAuth/btnAuth.js
  39. 1 0
      wx-mall/pages/catalog/catalog.js
  40. 2 2
      wx-mall/pages/commentPost/commentPost.wxml
  41. 2 1
      wx-mall/pages/goods/goods.js
  42. 2 1
      wx-mall/pages/goods/goods.wxml
  43. 10 0
      wx-mall/pages/goods/goods.wxss
  44. 29 5
      wx-mall/pages/index/index.js
  45. 11 6
      wx-mall/pages/map/map.js
  46. 1 1
      wx-mall/pages/map/map.wxml
  47. 2 1
      wx-mall/pages/search/search.js
  48. 2 2
      wx-mall/pages/shopping/checkout/checkout.js
  49. 1 1
      wx-mall/pages/store/store.js
  50. 2 0
      wx-mall/pages/ucenter/feedback/feedback.js
  51. 1 1
      wx-mall/pages/ucenter/helpInfo/helpInfo.js
  52. 4 4
      wx-mall/pages/ucenter/order/order.wxml
  53. 1 1
      wx-mall/services/user.js

+ 32 - 46
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -193,62 +193,48 @@ public class OrderController {
     @RequiresPermissions("order:getProcess")
     public R getProcess(@PathVariable("orderSn") String orderSn) {
         OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordService.queryObjectByOrderSn(orderSn);
-        if (orderProcessRecordEntity != null) {
-            if (orderProcessRecordEntity.getShipmentStartTime() != null) {
-                orderProcessRecordEntity.setShipmentStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getShipmentStartTime(), DateUtils.DATE_TIME_PATTERN));
+        if(orderProcessRecordEntity != null){
+            if(orderProcessRecordEntity.getShipmentStartTime()!=null){
+                orderProcessRecordEntity.setShipmentStartTimeStr(DateUtils.format(orderProcessRecordEntity.getShipmentStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getShipmentSuccTime() != null) {
-                orderProcessRecordEntity.setShipmentSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getShipmentSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getShipmentSuccTime()!=null){
+                orderProcessRecordEntity.setShipmentSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getShipmentSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getCustomsStartTime() != null) {
-                orderProcessRecordEntity.setCustomsStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getCustomsStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getCustomsStartTime()!=null){
+                orderProcessRecordEntity.setCustomsStartTimeStr(DateUtils.format(orderProcessRecordEntity.getCustomsStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getCustomsSuccTime() != null) {
-                orderProcessRecordEntity.setCustomsSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getCustomsSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getCustomsSuccTime()!=null){
+                orderProcessRecordEntity.setCustomsSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getCustomsSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getWaybillStartTime() != null) {
-                orderProcessRecordEntity.setWaybillStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getWaybillStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getWaybillStartTime()!=null){
+                orderProcessRecordEntity.setWaybillStartTimeStr(DateUtils.format(orderProcessRecordEntity.getWaybillStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getWaybillSuccTime() != null) {
-                orderProcessRecordEntity.setWaybillSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getWaybillSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getWaybillSuccTime()!=null){
+                orderProcessRecordEntity.setWaybillSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getWaybillSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getEleOrderStartTime() != null) {
-                orderProcessRecordEntity.setEleOrderStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getEleOrderStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getEleOrderStartTime()!=null){
+                orderProcessRecordEntity.setEleOrderStartTimeStr(DateUtils.format(orderProcessRecordEntity.getEleOrderStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getEleOrderSuccTime() != null) {
-                orderProcessRecordEntity.setEleOrderSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getEleOrderSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getEleOrderSuccTime()!=null){
+                orderProcessRecordEntity.setEleOrderSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getEleOrderSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getAddOrderStartTime() != null) {
-                orderProcessRecordEntity.setAddOrderStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getAddOrderStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getAddOrderStartTime()!=null){
+                orderProcessRecordEntity.setAddOrderStartTimeStr(DateUtils.format(orderProcessRecordEntity.getAddOrderStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getAddOrderSuccTime() != null) {
-                orderProcessRecordEntity.setAddOrderSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getAddOrderSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getAddOrderSuccTime()!=null){
+                orderProcessRecordEntity.setAddOrderSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getAddOrderSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getPaySuccTime() != null) {
-                orderProcessRecordEntity.setPaySuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getPaySuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getPaySuccTime()!=null){
+                orderProcessRecordEntity.setPaySuccTimeStr(DateUtils.format(orderProcessRecordEntity.getPaySuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getPayStartTime() != null) {
-                orderProcessRecordEntity.setPayStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getPayStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getPayStartTime()!=null){
+                orderProcessRecordEntity.setPayStartTimeStr(DateUtils.format(orderProcessRecordEntity.getPayStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getPaymentStartTime() != null) {
-                orderProcessRecordEntity.setPaymentStartTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getPaymentStartTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getPaymentStartTime()!=null){
+                orderProcessRecordEntity.setPaymentStartTimeStr(DateUtils.format(orderProcessRecordEntity.getPaymentStartTime(),DateUtils.DATE_TIME_PATTERN));
             }
-            if (orderProcessRecordEntity.getPaymentSuccTime() != null) {
-                orderProcessRecordEntity.setPaymentSuccTimeStr(
-                        DateUtils.format(orderProcessRecordEntity.getPaymentSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            if(orderProcessRecordEntity.getPaymentSuccTime()!=null){
+                orderProcessRecordEntity.setPaymentSuccTimeStr(DateUtils.format(orderProcessRecordEntity.getPaymentSuccTime(),DateUtils.DATE_TIME_PATTERN));
             }
         }
         return R.ok().put("orderProcessRecordEntity", orderProcessRecordEntity);
@@ -360,9 +346,9 @@ public class OrderController {
         Map resultObj = null;
         try {
             SysUserEntity user = ShiroUtils.getUserEntity();
-            resultObj = orderService.orderSubmit(offlineCartEntityList, user);
-            if (null != resultObj) {
-                return R.error((String) resultObj.get("errmsg"));
+            resultObj = orderService.orderSubmit(offlineCartEntityList,user);
+            if (((Integer)resultObj.get("errno")) != 0) {
+                return R.error((String)resultObj.get("errmsg"));
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 5 - 5
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -511,9 +511,9 @@ public class OrderServiceImpl implements OrderService {
                 return resultObj;
             }
             List<OfflineCartEntity> offlineCartEntityList = offlineCartDao.queryOfflineCartByBizType(param);
-            if (null == offlineCartEntityList && offlineCartEntityList.size() == 0 && offlineCartList.size()>0) {
-                resultObj.put("errno", 400);
-                resultObj.put("errmsg", "已下单成功,请重新扫描商品进行购买");
+            if (offlineCartEntityList.size() == 0 && offlineCartList.size() > 0) {
+                resultObj.put("errno", 0);
+                resultObj.put("errmsg", "该单已下单成功,请重新扫描商品进行购买");
                 return resultObj;
             }
             // 检查库存和更新库存
@@ -558,10 +558,10 @@ public class OrderServiceImpl implements OrderService {
                 }
                 //清空预订单商品临时表
                 offlineCartDao.deleteByUserId(userId);
-                resultObj.put("errno", 0);
-                resultObj.put("errmsg", "订单提交成功");
                 Map orderInfoMap = new HashMap();
                 orderInfoMap.put("orderInfo", order);
+                resultObj.put("errno", 0);
+                resultObj.put("errmsg", "订单提交成功");
                 resultObj.put("data", orderInfoMap);
             }
         }catch (Exception e){

+ 1 - 1
kmall-admin/src/main/resources/conf/common.properties

@@ -6,7 +6,7 @@
 #前海电商apikey
 #yunpian.sms.apikey=3084e52ffff6adb96a67995b43edfb93
 #生产apikey
-yunpian.sms.apikey=928c373d-9481-4ce2-817a-a28863766a4f
+yunpian.sms.apikey=6968bd2d54ceaba25d6211301831059f
 
 #url
 yunpian.sms.url=https://sms.yunpian.com/v2/sms/single_send.json

+ 37 - 8
kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java

@@ -2,10 +2,8 @@ package com.kmall.api.api;
 
 import com.alibaba.fastjson.JSONObject;
 import com.kmall.api.annotation.IgnoreAuth;
-import com.kmall.api.entity.FullUserInfo;
-import com.kmall.api.entity.StoreVo;
-import com.kmall.api.entity.UserInfo;
-import com.kmall.api.entity.UserVo;
+import com.kmall.api.entity.*;
+import com.kmall.api.service.ApiMerchUserService;
 import com.kmall.api.service.ApiStoreService;
 import com.kmall.api.service.ApiUserService;
 import com.kmall.api.service.TokenService;
@@ -41,6 +39,8 @@ public class ApiAuthController extends ApiBaseAction {
     private TokenService tokenService;
     @Autowired
     private ApiStoreService apiStoreService;
+    @Autowired
+    private ApiMerchUserService apiMerchUserService;
 
     /**
      * 登录
@@ -52,6 +52,7 @@ public class ApiAuthController extends ApiBaseAction {
         JSONObject jsonParam = this.getJsonRequest();
         FullUserInfo fullUserInfo = null;
         Long storeId = jsonParam.getLong("storeId");
+        String merchSn = (String)jsonParam.get("merchSn");
         String code = "";
         if (!StringUtils.isNullOrEmpty(jsonParam.getString("code"))) {
             code = jsonParam.getString("code");
@@ -104,8 +105,7 @@ public class ApiAuthController extends ApiBaseAction {
             userVo.setGender(userInfo.getGender()); // //性别 0:未知、1:男、2:女
             userService.update(userVo);
         }
-
-        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(userVo.getWeixin_openid(), storeId,userVo.getId());
+        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(userVo.getWeixin_openid(), storeId,userVo.getId(),merchSn);
         String token = MapUtils.getString(tokenMap, "token");
 
         if (null == userInfo || StringUtils.isNullOrEmpty(token)) {
@@ -143,7 +143,7 @@ public class ApiAuthController extends ApiBaseAction {
         param.put("longitude", longitude);
         List<StoreVo> storeVoList = apiStoreService.queryNearbyList(param);
         if (null != storeVoList && storeVoList.size() > 0 && null != getOpenId()) {
-            tokenService.createAndUpdateToken(getOpenId(), storeVoList.get(0).getId(),getUserId());
+            tokenService.createAndUpdateToken(getOpenId(), storeVoList.get(0).getId(),getUserId(),storeVoList.get(0).getMerchSn());
         }
         return toResponsSuccess(storeVoList);
     }
@@ -171,11 +171,40 @@ public class ApiAuthController extends ApiBaseAction {
         JSONObject jsonParam = this.getJsonRequest();
         String openId = getOpenId();
         Long storeId = jsonParam.getLong("storeId");
+        String merchSn = (String)jsonParam.get("merchSn");
         //
         Map<String, Object> resultObj = new HashMap();
-        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(openId, storeId,getUserId());
+        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(openId, storeId,getUserId(),merchSn);
         String token = MapUtils.getString(tokenMap, "token");
         resultObj.put("token", token);
         return toResponsSuccess(resultObj);
     }
+
+    @IgnoreAuth
+    @PostMapping("updateLoginUser")
+    public Object updateLoginUser() {
+        JSONObject jsonParam = this.getJsonRequest();
+        Long storeId = jsonParam.getLong("storeId");
+        Long userId = jsonParam.getLong("userId");
+        String merchSn = (String)jsonParam.get("merchSn");
+        Date nowTime = new Date();
+        UserVo userVo = userService.queryObject(userId);
+        if (null != userVo) {
+            MerchUserVo merchUser = apiMerchUserService.queryObjectByStoreId(storeId);
+            MerchUserVo merchUserVo = new MerchUserVo();
+            merchUserVo.setStoreId(Integer.parseInt(String.valueOf(storeId)));
+            merchUserVo.setMerchSn(merchSn);
+            merchUserVo.setUserId(Integer.parseInt(String.valueOf(userId)));
+            if(merchUser != null) {;
+                merchUserVo.setModTime(new Date());
+                merchUserVo.setId(merchUser.getId());
+                apiMerchUserService.update(merchUserVo);
+            }else{
+                merchUserVo.setCreateTime(new Date());
+                merchUserVo.setModTime(new Date());
+                apiMerchUserService.save(merchUserVo);
+            }
+        }
+        return toResponsSuccess("1");
+    }
 }

+ 2 - 0
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -273,6 +273,7 @@ public class ApiCartController extends ApiBaseAction {
             cartInfo.setChecked(1);
             cartInfo.setGoodsBizType(goodsInfo.getGoodsBizType());//业务类型
             cartInfo.setStockNum(productInfo.getStock_num());
+            cartInfo.setMerchSn(goodsInfo.getMerchSn());
             cartService.save(cartInfo);
         } else {
             if(number + cartInfo.getNumber() > productInfo.getStock_num()){
@@ -348,6 +349,7 @@ public class ApiCartController extends ApiBaseAction {
             cartInfo.setChecked(1);
             cartInfo.setGoodsBizType(goodsVo.getOrderBizType());
             cartInfo.setStockNum(productInfo.getStock_num());
+            cartInfo.setMerchSn(goodsVo.getMerchSn());
 
             Map map = new HashMap();
             map.put("user_id", getUserId());

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -128,7 +128,7 @@ public class ApiGoodsController extends ApiBaseAction {
      * 商品详情页数据
      * */
     @GetMapping("detail")
-    public Object detail(Long id, Long referrer) {
+    public Object detail(Long id, Long referrer,String merchSn) {
         Map<String, Object> resultObj = new HashMap();
         //
         Long userId = getUserId();
@@ -158,7 +158,7 @@ public class ApiGoodsController extends ApiBaseAction {
         List<AttributeVo> attribute = attributeService.queryList(ngaParam);
         //
         Map issueParam = new HashMap();
-//        issueParam.put("goods_id", id);
+        issueParam.put("merch_sn", merchSn);
         List<GoodsIssueVo> issue = goodsIssueService.queryList(issueParam);
         //
         param.put("value_id", id);

+ 2 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiHelpIssueController.java

@@ -47,10 +47,11 @@ public class ApiHelpIssueController extends ApiBaseAction {
      */
     @GetMapping("/issueList")
     @IgnoreAuth
-    public Object issueList(Long type_id) {
+    public Object issueList(Long type_id,String merchSn) {
 
         Map params = new HashMap();
         params.put("type_id", type_id);
+        params.put("merchSn",merchSn);
         List<HelpIssueVo> helpIssueList = helpIssueService.queryList(params);
 
         return toResponsSuccess(helpIssueList);

+ 1 - 0
kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java

@@ -62,6 +62,7 @@ public class ApiIndexController extends ApiBaseAction {
         Map param = new HashMap();
 //        param.put("ad_position_ids", new Integer[]{1, 2, 3});
         param.put("ad_position_ids", new Integer[]{1});//用户注册
+        param.put("storeId",storeId);
         List<AdVo> adVos = apiAdService.queryList(param);
         //
         List<AdVo> banner = new ArrayList();

+ 15 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiMerchMapper.java

@@ -0,0 +1,15 @@
+package com.kmall.api.dao;
+
+import com.kmall.api.entity.MerchVo;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 18:06:35
+ */
+public interface ApiMerchMapper extends BaseDao<MerchVo> {
+    MerchVo queryObjectByMerchSn(String merchSn);
+}

+ 16 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiMerchUserMapper.java

@@ -0,0 +1,16 @@
+package com.kmall.api.dao;
+
+
+import com.kmall.api.entity.MerchUserVo;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 14:34:32
+ */
+public interface ApiMerchUserMapper extends BaseDao<MerchUserVo> {
+    MerchUserVo queryObjectByStoreId(Long storeId);
+}

+ 20 - 0
kmall-api/src/main/java/com/kmall/api/entity/AdVo.java

@@ -33,6 +33,26 @@ public class AdVo implements Serializable {
 
     private Integer sortOrder;
 
+    private Long storeId;
+
+    private String merchSn;
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
     public Integer getSortOrder() {
         return sortOrder;
     }

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/CartVo.java

@@ -66,6 +66,16 @@ public class CartVo implements Serializable {
 
     private Integer stockNum;
 
+    private String merchSn;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
     public Integer getStockNum() {
         return stockNum;
     }

+ 19 - 0
kmall-api/src/main/java/com/kmall/api/entity/CategoryVo.java

@@ -45,8 +45,27 @@ public class CategoryVo implements Serializable {
 
     private Boolean checked;
 
+    private String merchSn;
+
+    private Long storeId;
+
     private List<CategoryVo> subCategoryList;
 
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
 
     public Integer getId() {
         return id;

+ 18 - 0
kmall-api/src/main/java/com/kmall/api/entity/FeedbackVo.java

@@ -31,6 +31,24 @@ public class FeedbackVo implements Serializable {
     private Integer status;
     //反馈时间
     private Date addTime;
+    private String merchSn;
+    private Long storeId;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
 
     /**
      * 设置:主键

+ 30 - 0
kmall-api/src/main/java/com/kmall/api/entity/GoodsVo.java

@@ -103,6 +103,36 @@ public class GoodsVo implements Serializable {
 
     private Integer stockNum;
 
+    private Integer storeId;
+
+    private String merchSn;
+
+    private String merchName;
+
+    public Integer getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Integer storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStockNum() {
         return stockNum;
     }

+ 171 - 0
kmall-api/src/main/java/com/kmall/api/entity/MerchUserVo.java

@@ -0,0 +1,171 @@
+package com.kmall.api.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 实体
+ * 表名 mall_merch_user
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 14:34:32
+ */
+public class MerchUserVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Integer id;
+    /**
+     * 商户编号
+     */
+    private String merchSn;
+    /**
+     * 门店编号
+     */
+    private Integer storeId;
+    /**
+     * 用户编号
+     */
+    private Integer userId;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    /**
+     * 设置:主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:主键
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:商户编号
+     */
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 获取:商户编号
+     */
+    public String getMerchSn() {
+        return merchSn;
+    }
+    /**
+     * 设置:门店编号
+     */
+    public void setStoreId(Integer storeId) {
+        this.storeId = storeId;
+    }
+
+    /**
+     * 获取:门店编号
+     */
+    public Integer getStoreId() {
+        return storeId;
+    }
+    /**
+     * 设置:用户编号
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取:用户编号
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 222 - 0
kmall-api/src/main/java/com/kmall/api/entity/MerchVo.java

@@ -0,0 +1,222 @@
+package com.kmall.api.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 实体
+ * 表名 mall_merch
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 18:06:35
+ */
+public class MerchVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Integer id;
+    /**
+     * 商户编号
+     */
+    private String merchSn;
+    /**
+     * 商户名称
+     */
+    private String merchName;
+    /**
+     * 商户简称
+     */
+    private String merchShortName;
+    /**
+     * 商户图片
+     */
+    private String merchImg;
+    /**
+     * 排序
+     */
+    private Integer sortOrder;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    /**
+     * 设置:主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:主键
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:商户编号
+     */
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 获取:商户编号
+     */
+    public String getMerchSn() {
+        return merchSn;
+    }
+    /**
+     * 设置:商户名称
+     */
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
+    /**
+     * 获取:商户名称
+     */
+    public String getMerchName() {
+        return merchName;
+    }
+    /**
+     * 设置:商户简称
+     */
+    public void setMerchShortName(String merchShortName) {
+        this.merchShortName = merchShortName;
+    }
+
+    /**
+     * 获取:商户简称
+     */
+    public String getMerchShortName() {
+        return merchShortName;
+    }
+    /**
+     * 设置:商户图片
+     */
+    public void setMerchImg(String merchImg) {
+        this.merchImg = merchImg;
+    }
+
+    /**
+     * 获取:商户图片
+     */
+    public String getMerchImg() {
+        return merchImg;
+    }
+    /**
+     * 设置:排序
+     */
+    public void setSortOrder(Integer sortOrder) {
+        this.sortOrder = sortOrder;
+    }
+
+    /**
+     * 获取:排序
+     */
+    public Integer getSortOrder() {
+        return sortOrder;
+    }
+    /**
+     * 设置:备注
+     */
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    /**
+     * 获取:备注
+     */
+    public String getRemark() {
+        return remark;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderGoodsVo.java

@@ -60,6 +60,16 @@ public class OrderGoodsVo implements Serializable {
 
     private BigDecimal settlePrice;
 
+    private String merchSn;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
     public BigDecimal getGoodsRate() {
         return goodsRate;
     }

+ 19 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java

@@ -175,6 +175,25 @@ public class OrderVo implements Serializable {
 
     private String isOnfflineOrder;
 
+    private String merchName;
+    private Long storeId;
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
+
     public String getIsOnfflineOrder() {
         return isOnfflineOrder;
     }

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/TokenEntity.java

@@ -26,6 +26,8 @@ public class TokenEntity implements Serializable {
     private Date updateTime;
     //选择门店id
     private Long storeId;
+    //商户编号
+    private String merchSn;
 
     /**
      * 设置:用户ID
@@ -104,4 +106,12 @@ public class TokenEntity implements Serializable {
     public void setStoreId(Long storeId) {
         this.storeId = storeId;
     }
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
 }

+ 20 - 0
kmall-api/src/main/java/com/kmall/api/entity/UserVo.java

@@ -55,6 +55,26 @@ public class UserVo implements Serializable {
 
     private Date tstm;
 
+    private Long storeId;
+
+    private String merchSn;
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
     public String getIdNo() {
         return idNo;
     }

+ 1 - 0
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -170,6 +170,7 @@ public class ApiCartService {
         cartInfo.setGoods_specification_ids(productVo.getGoods_specification_ids());
         cartInfo.setChecked(1);
         cartInfo.setGoodsBizType(goodsVo.getGoodsBizType());
+        cartInfo.setMerchSn(goodsVo.getMerchSn());
         save(cartInfo);
         return resultObj;
     }

+ 54 - 0
kmall-api/src/main/java/com/kmall/api/service/ApiMerchUserService.java

@@ -0,0 +1,54 @@
+package com.kmall.api.service;
+
+import com.kmall.api.dao.ApiMerchUserMapper;
+import com.kmall.api.entity.MerchUserVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 14:34:32
+ */
+@Service
+public class ApiMerchUserService {
+    @Autowired
+    private ApiMerchUserMapper apiMerchUserMapper;
+
+    public MerchUserVo queryObject(Integer id) {
+        return apiMerchUserMapper.queryObject(id);
+    }
+
+    public List<MerchUserVo> queryList(Map<String, Object> map) {
+        return apiMerchUserMapper.queryList(map);
+    }
+
+    public int queryTotal(Map<String, Object> map) {
+        return apiMerchUserMapper.queryTotal(map);
+    }
+
+    public int save(MerchUserVo merchUser) {
+        return apiMerchUserMapper.save(merchUser);
+    }
+
+    public int update(MerchUserVo merchUser) {
+        return apiMerchUserMapper.update(merchUser);
+    }
+
+    public int delete(Integer id) {
+        return apiMerchUserMapper.delete(id);
+    }
+
+    public int deleteBatch(Integer[]ids) {
+        return apiMerchUserMapper.deleteBatch(ids);
+    }
+
+    public MerchUserVo queryObjectByStoreId(Long storeId){
+        return apiMerchUserMapper.queryObjectByStoreId(storeId);
+    }
+}

+ 15 - 9
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -67,6 +67,8 @@ public class ApiOrderService {
     private ApiOrderProcessRecordMapper orderProcessRecordMapper;
     @Autowired
     private ApiStoreMapper apiStoreMapper;
+    @Autowired
+    private ApiMerchMapper apiMerchMapper;
 
     public OrderVo queryObject(Long id) {
         return apiOrderMapper.queryObject(id);
@@ -137,7 +139,6 @@ public class ApiOrderService {
     @Transactional
     public Map submit(JSONObject jsonParam, UserVo loginUser, Long storeId) {
         Map resultObj = new HashMap();
-
         AddressVo addressVo = jsonParam.getObject("checkedAddress", AddressVo.class);
         if (addressVo == null) {
             resultObj.put("errno", 400);
@@ -218,22 +219,22 @@ public class ApiOrderService {
             //订单业务类型:00:保税备货, 02:保税展示补货,10:保税展示跨境,11:普通商品
             if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
                 FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice00 =freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;//查询商品运费信息
+                freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;//查询商品运费信息
                 isBizType00 =true;
             }
             if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
                 FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice02 =freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;//查询商品运费信息
+                freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;//查询商品运费信息
                 isBizType02 =true;
             }
             if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
                 FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice10 =freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;//查询商品运费信息
+                freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;//查询商品运费信息
                 isBizType10 =true;
             }
             if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
                 FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice11 =freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;//查询商品运费信息
+                freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;//查询商品运费信息
                 isBizType11 =true;
             }
         }
@@ -358,6 +359,7 @@ public class ApiOrderService {
         Long fullCutCouponId = jsonParam.getLong("fullCutCouponId");//满减券
         AddressVo addressVo = jsonParam.getObject("checkedAddress", AddressVo.class);
         Date delivery_date = jsonParam.getDate("delivery_date");
+        String merchSn = (String)jsonParam.get("merchSn");
         if (null == delivery_date) {
             delivery_date = new Date();
         }
@@ -413,10 +415,14 @@ public class ApiOrderService {
 //        BigDecimal actualPrice = orderTotalPrice.subtract(fullCutCouponDec).subtract(couponPrice);
 
         //商户(拼音首字母)+业务类型+编号
-        String merchSn = OmsMerchPropertiesBuilder.instance().getMerchSn();
-        String merchShortName = OmsMerchPropertiesBuilder.instance().getMerchShortName();
-        String supplier = "";//供货商标识
-        String orderSn = merchShortName + supplier + bizType + CommonUtil.generateOrderNumber();
+//        String merchSn = OmsMerchPropertiesBuilder.instance().getMerchSn();
+//        String merchShortName = OmsMerchPropertiesBuilder.instance().getMerchShortName();
+        MerchVo merchVo = apiMerchMapper.queryObjectByMerchSn(merchSn);
+        String merchShortName = "";
+        if(merchVo != null){
+            merchShortName = merchVo.getMerchShortName();
+        }
+        String orderSn = merchShortName + bizType + CommonUtil.generateOrderNumber();
         orderInfo.setOrder_sn(orderSn);
         orderInfo.setMerchSn(merchSn);
 

+ 8 - 1
kmall-api/src/main/java/com/kmall/api/service/TokenService.java

@@ -3,6 +3,7 @@ package com.kmall.api.service;
 import com.kmall.api.cache.UserTokenCache;
 import com.kmall.api.entity.TokenEntity;
 import com.kmall.common.utils.CharUtil;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
@@ -15,7 +16,7 @@ public class TokenService {
     //12小时后过期
     private final static int EXPIRE = 3600 * 12;
 
-    public Map<String, Object> createAndUpdateToken(String openId, Long storeId, Long userId) {
+    public Map<String, Object> createAndUpdateToken(String openId, Long storeId, Long userId,String merchSn) {
         //生成一个token
         String token = CharUtil.getRandomString(32);
         //当前时间
@@ -35,6 +36,9 @@ public class TokenService {
             tokenEntity.setUpdateTime(now);
             tokenEntity.setExpireTime(expireTime);
             tokenEntity.setStoreId(storeId);
+            if(StringUtils.isNotEmpty(merchSn)) {
+                tokenEntity.setMerchSn(merchSn);
+            }
 
             //保存token
 //            save(tokenEntity);
@@ -47,6 +51,9 @@ public class TokenService {
             if (null != storeId) {
                 tokenEntity.setStoreId(storeId);
             }
+            if(StringUtils.isNotEmpty(merchSn)) {
+                tokenEntity.setMerchSn(merchSn);
+            }
             //更新token
 //            update(tokenEntity);
             UserTokenCache.putUserToken(tokenEntity);

+ 8 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiAdMapper.xml

@@ -15,6 +15,8 @@
         <result property="end_time" column="endTime"/>
         <result property="enabled" column="enabled"/>
         <result property="sortOrder" column="sort_order"/>
+        <result property="merchSn" column="mersh_sn"/>
+        <result property="storeId" column="store_id"/>
     </resultMap>
 
     <select id="queryObject" resultMap="adMap">
@@ -27,6 +29,12 @@
         <if test="ad_position_id != null and ad_position_id != null">
             and ad_position_id = #{ad_position_id}
         </if>
+        <if test="storeId != null and storeId != null">
+            and store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn != null">
+            and mersh_sn = #{merchSn}
+        </if>
         <if test="ad_position_ids != null and ad_position_ids.length > 0">
             and ad_position_id in
             <foreach item="item" collection="ad_position_ids" open="(" separator="," close=")">

+ 11 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -27,12 +27,13 @@
         <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
         <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
         <result property="stockNum" column="productStockNum"/>
+        <result property="merchSn" column="merch_sn"/>
     </resultMap>
 
     <sql id="Base_Column_List" >
         id, user_id, goods_id, sku, goods_sn, product_id, goods_name, market_price, retail_price,
         number, goods_specification_ids, checked, list_pic_url, store_id, goods_biz_type,
-        creater_sn, create_time, moder_sn, mod_time, tstm,goods_specification_name_value,stock_num
+        creater_sn, create_time, moder_sn, mod_time, tstm,goods_specification_name_value,stock_num,merch_sn
     </sql>
     <select id="queryObject" resultMap="cartMap">
 		select
@@ -206,6 +207,9 @@
             <if test="goods_specification_name_value != null" >
                 goods_specification_name_value,
             </if>
+            <if test="merchSn != null" >
+                merch_sn,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
             <if test="user_id != null" >
@@ -271,6 +275,9 @@
             <if test="goods_specification_name_value != null" >
                 #{goods_specification_name_value,jdbcType=LONGVARCHAR},
             </if>
+            <if test="merchSn != null" >
+                #{merchSn,jdbcType=LONGVARCHAR},
+            </if>
         </trim>
 	</insert>
 
@@ -340,6 +347,9 @@
             <if test="goods_specification_name_value != null" >
                 goods_specification_name_value = #{goods_specification_name_value,jdbcType=LONGVARCHAR},
             </if>
+            <if test="merchSn != null" >
+                merch_sn = #{merchSn},
+            </if>
         </set>
         where id = #{id}
     </update>

+ 8 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiCategoryMapper.xml

@@ -20,6 +20,8 @@
         <result property="level" column="level"/>
         <result property="type" column="type"/>
         <result property="front_name" column="front_name"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="storeId" column="store_id"/>
     </resultMap>
 
     <select id="queryObject" resultMap="categoryMap">
@@ -39,6 +41,9 @@
         <if test="parent_id != null and parent_id != null">
             and parent_id = #{parent_id}
         </if>
+        <if test="store_id != null and store_id != null">
+            and store_id = #{store_id}
+        </if>
         <if test="notName != null and notName != null">
             and 'name' != #{notName}
         </if>
@@ -141,6 +146,9 @@
         <if test="notName != null and notName != null">
             and 'name' != #{notName}
         </if>
+        <if test="store_id != null and store_id != null">
+            and store_id = #{store_id}
+        </if>
         <if test="ids != null and ids.size > 0">
             and id in
             <foreach item="item" collection="ids" open="(" separator="," close=")">

+ 12 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiFeedbackMapper.xml

@@ -13,6 +13,8 @@
 		<result property="content" column="content"/>
 		<result property="status" column="status"/>
 		<result property="addTime" column="add_time"/>
+		<result property="storeId" column="store_id"/>
+		<result property="merchSn" column="merch_sn"/>
     </resultMap>
 
 	<select id="queryObject" resultMap="feedbackMap">
@@ -24,7 +26,7 @@
 			`feed_Type`,
 			`content`,
 			`status`,
-			`add_time`
+			`add_time`,store_id,merch_sn
 		from mall_feedback
 		where msg_id = #{id}
 	</select>
@@ -38,7 +40,7 @@
 		`feed_Type`,
 		`content`,
 		`status`,
-		`add_time`
+		`add_time`,store_id,merch_sn
 		from mall_feedback
 		WHERE 1=1
 		<if test="name != null and name.trim() != ''">
@@ -73,7 +75,9 @@
 			`feed_Type`,
 			`content`,
 			`status`,
-			`add_time`)
+			`add_time`,
+			store_id,
+			merch_sn)
 		values(
 			#{userId},
 			#{userName},
@@ -81,7 +85,9 @@
 			#{feedType},
 			#{content},
 			#{status},
-			#{addTime})
+			#{addTime},
+			#{storeId},
+			#{merchSn})
 	</insert>
 	 
 	<update id="update" parameterType="com.kmall.api.entity.FeedbackVo">
@@ -94,6 +100,8 @@
 			<if test="content != null">`content` = #{content}, </if>
 			<if test="status != null">`status` = #{status}, </if>
 			<if test="addTime != null">`add_time` = #{addTime}</if>
+			<if test="storeId != null">`store_id` = #{storeId}</if>
+			<if test="merchSn != null">`merch_sn` = #{merchSn}</if>
 		</set>
 		where msg_id = #{msgId}
 	</update>

+ 3 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsIssueMapper.xml

@@ -28,6 +28,9 @@
             <if test="goods_id != null">
                 and goods_id = #{goods_id}
             </if>
+            <if test="merch_sn != null">
+                and merch_sn = #{merch_sn}
+            </if>
         </where>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">

+ 9 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml

@@ -46,6 +46,9 @@
         <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
         <result property="goodsRate" column="goods_rate"/>
         <result property="stockNum" column="stock_num"/>
+        <result property="storeId" column="store_id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="merchName" column="merch_name"/>
     </resultMap>
 
     <sql id="Base_Column_List" >
@@ -94,10 +97,13 @@
         a.is_app_exclusive,
         a.is_limited,
         a.is_hot,
+        a.merch_sn,
+        m.merch_name,
+        psr1.store_id,
         psr1.market_price,
         psr1.stock_num,
         a.goods_desc,a.goods_biz_type,a.goods_rate
-        from mall_goods a
+        from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id
         where a.id = #{id} and psr1.store_id = #{storeId}
     </select>
@@ -114,6 +120,7 @@
         from mall_goods a
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id
         LEFT JOIN mall_product b ON b.id = psr1.product_id
+        left join mall_category c on a.category_id = c.id
         where 1 = 1 and a.is_delete != 1 and psr1.stock_num > 0 and a.is_on_sale = 1
         <if test="is_new != null and is_new != ''">
             and a.is_new = #{is_new}
@@ -156,6 +163,7 @@
         </if>
         <if test="store_id != null and store_id != ''">
             and psr1.store_id = #{store_id}
+            and c.store_id = #{store_id}
         </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">

+ 3 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiHelpIssueMapper.xml

@@ -34,6 +34,9 @@
         <if test="type_id != null and type_id != ''">
             AND type_id = #{type_id}
         </if>
+        <if test="merchSn != null and merchSn != ''">
+            AND merch_sn = #{merchSn}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 154 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiMerchMapper.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.api.dao.ApiMerchMapper">
+
+    <resultMap type="com.kmall.api.entity.MerchVo" id="merchMap">
+        <result property="id" column="id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="merchName" column="merch_name"/>
+        <result property="merchShortName" column="merch_short_name"/>
+        <result property="merchImg" column="merch_img"/>
+        <result property="sortOrder" column="sort_order"/>
+        <result property="remark" column="remark"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.api.entity.MerchVo">
+		select
+			`id`,
+			`merch_sn`,
+			`merch_name`,
+			`merch_short_name`,
+			`merch_img`,
+			`sort_order`,
+			`remark`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from mall_merch
+		where id = #{id}
+	</select>
+
+	<select id="queryObjectByMerchSn" resultType="com.kmall.api.entity.MerchVo">
+		select
+		`id`,
+		`merch_sn`,
+		`merch_name`,
+		`merch_short_name`,
+		`merch_img`,
+		`sort_order`,
+		`remark`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from mall_merch
+		where merch_sn = #{value}
+	</select>
+
+
+	<select id="queryList" resultType="com.kmall.api.entity.MerchVo">
+		select
+    		`id`,
+    		`merch_sn`,
+    		`merch_name`,
+    		`merch_short_name`,
+    		`merch_img`,
+    		`sort_order`,
+    		`remark`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from mall_merch
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mall_merch
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.api.entity.MerchVo" useGeneratedKeys="true" keyProperty="id">
+		insert into mall_merch(
+			`merch_sn`,
+			`merch_name`,
+			`merch_short_name`,
+			`merch_img`,
+			`sort_order`,
+			`remark`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{merchName},
+			#{merchShortName},
+			#{merchImg},
+			#{sortOrder},
+			#{remark},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.api.entity.MerchVo">
+		update mall_merch 
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+			<if test="merchName != null">`merch_name` = #{merchName}, </if>
+			<if test="merchShortName != null">`merch_short_name` = #{merchShortName}, </if>
+			<if test="merchImg != null">`merch_img` = #{merchImg}, </if>
+			<if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
+			<if test="remark != null">`remark` = #{remark}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+	
+	<delete id="delete">
+		delete from mall_merch where id = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from mall_merch where id in 
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>

+ 132 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiMerchUserMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.api.dao.ApiMerchUserMapper">
+
+    <resultMap type="com.kmall.api.entity.MerchUserVo" id="merchUserMap">
+        <result property="id" column="id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="storeId" column="store_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.api.entity.MerchUserVo">
+		select
+			`id`,
+			`merch_sn`,
+			`store_id`,
+			`user_id`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from mall_merch_user
+		where id = #{id}
+	</select>
+
+	<select id="queryObjectByStoreId" resultType="com.kmall.api.entity.MerchUserVo">
+		select
+		`id`,
+		`merch_sn`,
+		`store_id`,
+		`user_id`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from mall_merch_user
+		where store_id = #{value}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.api.entity.MerchUserVo">
+		select
+    		`id`,
+    		`merch_sn`,
+    		`store_id`,
+    		`user_id`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from mall_merch_user
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mall_merch_user
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.api.entity.MerchUserVo" useGeneratedKeys="true" keyProperty="id">
+		insert into mall_merch_user(
+			`merch_sn`,
+			`store_id`,
+			`user_id`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{storeId},
+			#{userId},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.api.entity.MerchUserVo">
+		update mall_merch_user 
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+			<if test="storeId != null">`store_id` = #{storeId}, </if>
+			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+	
+	<delete id="delete">
+		delete from mall_merch_user where id = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from mall_merch_user where id in 
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>

+ 2 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml

@@ -27,6 +27,7 @@
         <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
         <result property="goodsRate" column="goods_rate"/>
         <result property="settlePrice" column="settle_price"/>
+        <result property="merchSn" column="merch_sn"/>
     </resultMap>
 
     <select id="queryObject" resultMap="orderGoodsMap">
@@ -34,7 +35,7 @@
 	</select>
 
     <select id="queryList" resultMap="orderGoodsMap">
-        select * from mall_order_goods
+        select g.*,o.merch_sn from mall_order_goods g left join mall_order o on o.id = g.order_id
         <where>
             <if test="order_id != null and order_id != ''">
                 and order_id = #{order_id}

+ 3 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

@@ -70,6 +70,7 @@
         <result property="approvalRemark" column="approval_remark"/>
         <result property="isMergePay" column="is_merge_pay"/>
         <result property="isOnfflineOrder" column="is_onffline_order"/>
+        <result column="merch_name" property="merchName" jdbcType="VARCHAR" />
     </resultMap>
 
     <select id="queryObject" resultMap="orderMap">
@@ -87,8 +88,9 @@
     </select>
 
     <select id="queryList" resultMap="orderMap">
-        select a.*,b.latitude,b.longitude,s.store_name,f.refund_status,f.approval_remark
+        select a.*,b.latitude,b.longitude,s.store_name,f.refund_status,f.approval_remark,m.merch_name
         from mall_order a
+        left join mall_merch m on a.merch_sn = m.merch_sn
         left join mall_address b on a.address_id = b.id
         left join mall_store s on a.store_id = s.id
         left join mall_order_refund f on a.id = f.order_id

+ 1 - 1
wx-mall/config/api.js

@@ -133,5 +133,5 @@ module.exports = {
   getCheckedDataByType: NewApiRootUrl + 'cart/getCheckedDataByType',  //校验该业务类型的购物车数据
   idCardRealName: NewApiRootUrl + 'index/idCardRealName', //身份证实名
   saveApplyRefund: NewApiRootUrl + 'order/saveApplyRefund', //申请维权
-
+  updateLoginUser: NewApiRootUrl + 'auth/updateLoginUser',
 };

+ 1 - 1
wx-mall/pages/auth/btnAuth/btnAuth.js

@@ -42,7 +42,7 @@ Page({
               wx.request({
                 url: api.AuthLoginByWeixin,
                 data: {
-                  code: res.code, userInfo: succRes, storeId: wx.getStorageSync('storeId')
+                  code: res.code, userInfo: succRes, storeId: wx.getStorageSync('storeId'), merchSn: wx.getStorageSync('merchSn')
                 },
                 method: 'POST',
                 header: {

+ 1 - 0
wx-mall/pages/catalog/catalog.js

@@ -164,6 +164,7 @@ Page({
           }
         });
     }
+    wx.hideLoading();
   },
   getFootCart: function () {
     let that = this;

+ 2 - 2
wx-mall/pages/commentPost/commentPost.wxml

@@ -23,13 +23,13 @@
       </view>
       <text class="desc">{{handleDesc[mannerScore -1]}}</text>
     </view>
-    <view class="service-item">
+    <!-- <view class="service-item">
       <text class="label">配送速度</text>
       <view class="star-box">
         <text class="star {{ speedScore > index ? 'checked' : '' }}" bindtap="handleScore" wx:for="{{5}}" wx:key="{{index}}" data-score="{{index + 1}}" data-aim="speedScore">★</text>
       </view>
       <text class="desc">{{handleDesc[speedScore -1]}}</text>
-    </view>
+    </view> -->
   </view>
 
   <view class="goods-list" wx:for="{{goodsList}}" wx:key="{{num}}" wx:for-index="num">

+ 2 - 1
wx-mall/pages/goods/goods.js

@@ -58,7 +58,8 @@ Page({
       title: '加载中...',
     });
     let that = this;
-    util.request(api.GoodsDetail, { id: that.data.id, referrer: this.data.referrer }).then(function (res) {
+    util.request(api.GoodsDetail, { id: that.data.id, referrer: this.data.referrer, 
+      merchSn: wx.getStorageSync('merchSn') }).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           goods: res.data.info,

+ 2 - 1
wx-mall/pages/goods/goods.wxml

@@ -186,7 +186,7 @@
         </view>
       </view>
     </view>
-    <view class="goods-attr" bindtap="hideSwitchAttrPop">
+    <view class="goods-attr" wx:if="{{attribute.length>0}}" bindtap="hideSwitchAttrPop">
       <view class="t">商品参数</view>
       <view class="l">
         <view class="item" wx:for="{{attribute}}" wx:key="{{item.name}}">
@@ -197,6 +197,7 @@
     </view>
 
     <view class="detail"  bindtap="hideSwitchAttrPop">
+      <view class="t">商品详情</view>
       <import src="../../lib/wxParse/wxParse.wxml" />
       <template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
     </view>

+ 10 - 0
wx-mall/pages/goods/goods.wxss

@@ -564,6 +564,9 @@
   width: 750rpx;
   height: auto;
   overflow: hidden;
+
+  padding: 0 31.25rpx 25rpx 31.25rpx;
+  background: #fff;
 }
 
 .detail image {
@@ -1125,4 +1128,11 @@
   flex: 1;
   text-align: center;
   color: #fff;
+}
+
+.detail .t {
+  width: 687.5rpx;
+  height: 104rpx;
+  line-height: 104rpx;
+  font-size: 38.5rpx;
 }

+ 29 - 5
wx-mall/pages/index/index.js

@@ -45,7 +45,7 @@ Page({
     let that = this;
     util.request(api.IndexUrl).then(function (res) {
       if (res.errno === 0) {
-        console.log(res.data.banner);
+        // console.log(res.data.banner);
         that.setData({
           // newGoods: res.data.newGoodsList,
           hotGoods: res.data.hotGoodsList,
@@ -129,6 +129,29 @@ Page({
   reLoad: function () {
     let that = this;
     if (wx.getStorageSync('storeId')) {
+      // console.log(wx.getStorageSync('userId'));
+      // console.log(wx.getStorageSync('storeId'));
+      console.log(wx.getStorageSync('merchSn'));
+      if (wx.getStorageSync('userId')){
+        wx.request({
+          url: api.updateLoginUser,
+          data: {
+            userId: wx.getStorageSync('userId'), storeId: wx.getStorageSync('storeId'), merchSn: wx.getStorageSync('merchSn')
+          },
+          method: 'POST',
+          header: {
+            'Content-Type': 'application/json'
+          },
+          success: function (wxRes) {
+            if (wxRes.data.errno === 0) {
+              console.log("用户信息更新成功");
+            }
+          },
+          fail: function (err) {
+            console.log("failed");
+          }
+        });
+      }
       that.getIndexData();
       that.enableActivity();
       that.getGroupData();
@@ -154,7 +177,7 @@ Page({
                 storeName: nlist[0].storeName,
                 storeId: nlist[0].id
               })
-              that.chooseStore(nlist[0].id);
+              that.chooseStore(nlist[0].id, nlist[0].merchSn);
               wx.setStorageSync('nearStoreList', JSON.stringify(nlist));
               wx.setStorageSync('storeVo', JSON.stringify(nlist[0]));
             }
@@ -162,7 +185,7 @@ Page({
         });
     } else {
       var storeVo = JSON.parse(wx.getStorageSync('storeVo'));
-      that.chooseStore(storeVo.id);
+      that.chooseStore(storeVo.id,storeVo.merchSn);
       that.setData({
         storeName: storeVo.storeName,
         storeId: storeVo.id
@@ -170,11 +193,12 @@ Page({
       }
   },
   // 更新门店Id
-  chooseStore: function (storeId) {
+  chooseStore: function (storeId,merchSn) {
     let that = this;
-    util.request(api.ChooseStoreId, { storeId: storeId }, 'POST').then(function (res) {
+    util.request(api.ChooseStoreId, { storeId: storeId, merchSn: merchSn }, 'POST').then(function (res) {
       if (res.errno === 0) {
         wx.setStorageSync('storeId', storeId);
+        wx.setStorageSync('merchSn', merchSn);        
         that.reLoad();
       }
     });

+ 11 - 6
wx-mall/pages/map/map.js

@@ -18,7 +18,8 @@ Page({
     storeId: "",
     storeName: "",
     storeAddress: "",
-    distance: ""
+    distance: "",
+    merchSn: ""
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
@@ -48,7 +49,8 @@ Page({
             storeId: nlist[i].id,
             storeName: nlist[i].storeName,
             storeAddress: nlist[i].storeAddress,
-            distance: nlist[i].distance
+            distance: nlist[i].distance,
+            merchSn: nlist[i].merchSn
           };
           markers.push(marker);
 
@@ -89,23 +91,26 @@ Page({
 
   },
   markersClick: function(res) {
-    console.log(res);
+    // console.log(res);
     let that = this;
     let marker = that.data.markers[res.markerId];
     that.setData({
       isShow: true,
       storeId: marker.storeId,
+      merchSn: marker.merchSn,
       storeName: marker.storeName,
       storeAddress: marker.storeAddress,
       distance: marker.distance
     });
   },
   chooseStore(e) {
-    console.log(e.currentTarget.id)
-    let storeId = e.currentTarget.id;
+    // console.log(e.currentTarget.dataset.id)
+    // console.log(e.currentTarget.dataset.merchSn)
+    let storeId = e.currentTarget.dataset.id;
+    let merchSn = e.currentTarget.dataset.merchSn;
 
     let that = this;
-    util.request(api.ChooseStoreId, { storeId: storeId }, 'POST').then(function (res) {
+    util.request(api.ChooseStoreId, { storeId: storeId, merchSn: merchSn }, 'POST').then(function (res) {
       if (res.errno === 0) {
         wx.setStorageSync('storeId', storeId);
         var item = "";

+ 1 - 1
wx-mall/pages/map/map.wxml

@@ -4,7 +4,7 @@
         <cover-view class="map-storeName">{{storeName}}</cover-view>
         <cover-view class="map-storeAddress">{{storeAddress}}</cover-view>
         <cover-view class="map-distance">距离当前定位地址{{distance}}米</cover-view>
-        <button id="{{storeId}}" bindtap='chooseStore'>确定</button>
+        <button data-id="{{storeId}}" data-merch-sn="{{merchSn}}" bindtap='chooseStore'>确定</button>
       </cover-view>
   </map>
 </view>

+ 2 - 1
wx-mall/pages/search/search.js

@@ -113,7 +113,8 @@ Page({
       wx.showLoading({
         title: '加载中...',
       });
-        util.request(api.GoodsList, { keyword: that.data.keyword, page: that.data.page, size: that.data.size, sort: that.data.currentSortType, order: that.data.currentSortOrder, categoryId: that.data.categoryId }).then(function (res) {
+        util.request(api.GoodsList, { keyword: that.data.keyword, page: that.data.page, size: that.data.size, sort: that.data.currentSortType, order: that.data.currentSortOrder, categoryId: that.data.categoryId,
+        storeId:wx.getStorageSync("storeId")}).then(function (res) {
             if (res.errno === 0) {
                 that.setData({
                     searchStatus: true,

+ 2 - 2
wx-mall/pages/shopping/checkout/checkout.js

@@ -292,8 +292,8 @@ Page({
       delivery_date: that.data.delivery_date,
       delivery_remark: that.data.delivery_remark,
       idNo: that.data.idNo,
-      userName: that.data.userName
-
+      userName: that.data.userName,
+      merchSn: wx.getStorageSync("merchSn")
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         let actualPrice = that.data.actualPrice;

+ 1 - 1
wx-mall/pages/store/store.js

@@ -35,7 +35,7 @@ Page({
     console.log(e.currentTarget.dataset.item)
     let item = e.currentTarget.dataset.item;
     let that = this;
-    util.request(api.ChooseStoreId, { storeId: item.id }, 'POST').then(function (res) {
+    util.request(api.ChooseStoreId, { storeId: item.id,merchSn:item.merchSn }, 'POST').then(function (res) {
       if (res.errno === 0) {
         wx.setStorageSync('storeId', item.id);
         for (var i = 0; i < that.data.cityStoreList.length; i++) {

+ 2 - 0
wx-mall/pages/ucenter/feedback/feedback.js

@@ -42,6 +42,8 @@ Page({
     }
 
     let that = this;
+    feedback.merchSn = wx.getStorageSync("merchSn");
+    feedback.storeId = wx.getStorageSync("storeId");
     util.request(api.FeedbackSave, {
       feedback: feedback
     }, 'POST').then(function (res) {

+ 1 - 1
wx-mall/pages/ucenter/helpInfo/helpInfo.js

@@ -8,7 +8,7 @@ Page({
   },
   getHelpList(id) {
     let that = this;
-    util.request(api.HelpIssueList, { type_id: id}).then(function (res) {
+    util.request(api.HelpIssueList, { type_id: id, merchSn: wx.getStorageSync("merchSn")}).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           helpList: res.data

+ 4 - 4
wx-mall/pages/ucenter/order/order.wxml

@@ -14,13 +14,13 @@
           <view class="list-label" style="color: #FE7200;">
             
             <image wx:if="{{item.orderBizType==00}}" src="../../../static/images/service-bao.png" class="search-icon-shop"></image>
-            <text class="biz-type" wx:if="{{item.orderBizType==00}}">{{item.storeName}} - 保税仓 </text>
+            <text class="biz-type" wx:if="{{item.orderBizType==00}}">{{item.merchName}}{{item.storeName}} - 保税仓 </text>
             <image wx:if="{{item.orderBizType==02}}" src="../../../static/images/service-zs.png" class="search-icon-shop"></image>
-            <text class="biz-type" wx:if="{{item.orderBizType==02}}">{{item.storeName}} - 保税展示</text>
+            <text class="biz-type" wx:if="{{item.orderBizType==02}}">{{item.merchName}}{{item.storeName}} - 保税展示</text>
             <image wx:if="{{item.orderBizType==10}}" src="../../../static/images/service-ziti.png" class="search-icon-shop"></image>
-            <text class="biz-type" wx:if="{{item.orderBizType==10}}">{{item.storeName}} - 现场速递</text>
+            <text class="biz-type" wx:if="{{item.orderBizType==10}}">{{item.merchName}}{{item.storeName}} - 现场速递</text>
             <image wx:if="{{item.orderBizType==11}}" src="../../../static/images/service-ptsp.png" class="search-icon-shop"></image>
-            <text class="biz-type" wx:if="{{item.orderBizType==11}}">{{item.storeName}} - 普通商品</text> 
+            <text class="biz-type" wx:if="{{item.orderBizType==11}}">{{item.merchName}}{{item.storeName}} - 普通商品</text> 
             
             <!-- <text class="add_time">{{item.add_time}}{{orderList[0].id}}</text> -->
             <text class="add_time" wx:if="{{tabIndex!=5}}">{{item.pay_status==3?'退款中':item.order_status_text}}{{item.order_status == 201 && item.isRefundStatus?"(维权申请中)":""}}

+ 1 - 1
wx-mall/services/user.js

@@ -19,7 +19,7 @@ function loginByWeixin() {
       wx.request({
         url: api.AuthLoginByWeixin,
         data: {
-          code: code, userInfo: userInfoRes, storeId: wx.getStorageSync('storeId')
+          code: code, userInfo: userInfoRes, storeId: wx.getStorageSync('storeId'),merchSn:wx.getStorageSync('merchSn')
         },
         method: 'POST',
         header: {