浏览代码

fixed bugs

fushengqian 11 月之前
父节点
当前提交
9c7e95abb0

+ 8 - 2
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendStoreController.java

@@ -236,8 +236,14 @@ public class BackendStoreController extends BaseController {
         }
 
         if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            if (StringUtil.isEmpty(storeId)) {
+                return getFailureResult(201, "店铺帐号不能新增店铺,请使用商户帐号添加!");
+            }
             storeId = accountInfo.getStoreId().toString();
         }
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            merchantId = accountInfo.getMerchantId().toString();
+        }
 
         storeInfo.setName(storeName);
         storeInfo.setLogo(logo);
@@ -268,8 +274,8 @@ public class BackendStoreController extends BaseController {
             return getFailureResult(201, "店铺名称不能为空");
         } else {
             if (!StringUtil.isNotEmpty(storeName)) {
-                StoreDto tempDto = storeService.queryStoreByName(storeName);
-                if (null != tempDto && tempDto.getName().equals(storeName) && !tempDto.getId().equals(storeId)) {
+                StoreDto storeDto = storeService.queryStoreByName(storeName);
+                if (storeDto != null && storeDto.getName().equals(storeName) && !storeDto.getId().equals(storeId)) {
                     return getFailureResult(201, "该店铺名称已经存在");
                 }
             }

+ 2 - 2
fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientSystemController.java

@@ -95,7 +95,7 @@ public class ClientSystemController extends BaseController {
             }
         }
 
-        // 默认的店铺
+        // 之前选择的店铺
         if (StringUtil.isNotEmpty(storeId)) {
             storeInfo = storeService.queryStoreById(Integer.parseInt(storeId));
             // 店铺是否已关闭
@@ -107,7 +107,7 @@ public class ClientSystemController extends BaseController {
         }
 
         // 取距离最近的
-        if (storeInfo == null && StringUtil.isNotEmpty(latitude) && StringUtil.isNotEmpty(longitude)) {
+        if (StringUtil.isNotEmpty(latitude) && StringUtil.isNotEmpty(longitude) && mtUser == null) {
             List<MtStore> storeList = storeService.queryByDistance(merchantNo, "", latitude, longitude);
             if (storeList.size() > 0) {
                 storeInfo = storeList.get(0);