ソースを参照

fixed 店铺查询

fushengqian 1 年間 前
コミット
195f39607c

+ 26 - 26
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendGoodsController.java

@@ -501,70 +501,70 @@ public class BackendGoodsController extends BaseController {
             storeId = myStoreId;
         }
 
-        MtGoods info = new MtGoods();
-        info.setId(Integer.parseInt(goodsId));
+        MtGoods mtGoods = new MtGoods();
+        mtGoods.setId(Integer.parseInt(goodsId));
         if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
-            info.setMerchantId(accountInfo.getMerchantId());
+            mtGoods.setMerchantId(accountInfo.getMerchantId());
         }
         if (StringUtil.isNotEmpty(type)) {
-            info.setType(type);
+            mtGoods.setType(type);
         }
-        info.setCateId(cateId);
-        info.setName(name);
-        info.setGoodsNo(goodsNo);
+        mtGoods.setCateId(cateId);
+        mtGoods.setName(name);
+        mtGoods.setGoodsNo(goodsNo);
         if (StringUtil.isNotEmpty(serviceTime)) {
-            info.setServiceTime(Integer.parseInt(serviceTime));
+            mtGoods.setServiceTime(Integer.parseInt(serviceTime));
         }
         if (StringUtil.isNotEmpty(couponIds)) {
-            info.setCouponIds(couponIds);
+            mtGoods.setCouponIds(couponIds);
         }
-        info.setIsSingleSpec(isSingleSpec);
+        mtGoods.setIsSingleSpec(isSingleSpec);
         if (StringUtil.isNotEmpty(stock)) {
-            info.setStock(Integer.parseInt(stock));
+            mtGoods.setStock(Integer.parseInt(stock));
         }
         if (StringUtil.isNotEmpty(description)) {
-            info.setDescription(description);
+            mtGoods.setDescription(description);
         }
         if (storeId != null && storeId > 0) {
-            info.setStoreId(storeId);
+            mtGoods.setStoreId(storeId);
         }
         if (images.size() > 0) {
-            info.setLogo(images.get(0));
+            mtGoods.setLogo(images.get(0));
         }
         if (StringUtil.isNotEmpty(sort)) {
-            info.setSort(Integer.parseInt(sort));
+            mtGoods.setSort(Integer.parseInt(sort));
         }
         if (StringUtil.isNotEmpty(status)) {
-            info.setStatus(status);
+            mtGoods.setStatus(status);
         }
         if (StringUtil.isNotEmpty(price)) {
-            info.setPrice(new BigDecimal(price));
+            mtGoods.setPrice(new BigDecimal(price));
         }
         if (StringUtil.isNotEmpty(linePrice)) {
-            info.setLinePrice(new BigDecimal(linePrice));
+            mtGoods.setLinePrice(new BigDecimal(linePrice));
         }
         if (StringUtil.isNotEmpty(weight)) {
-            info.setWeight(new BigDecimal(weight));
+            mtGoods.setWeight(new BigDecimal(weight));
         }
         if (initSale > 0) {
-            info.setInitSale(initSale);
+            mtGoods.setInitSale(initSale);
         }
         if (StringUtil.isNotEmpty(salePoint)) {
-            info.setSalePoint(salePoint);
+            mtGoods.setSalePoint(salePoint);
         }
         if (StringUtil.isNotEmpty(canUsePoint)) {
-            info.setCanUsePoint(canUsePoint);
+            mtGoods.setCanUsePoint(canUsePoint);
         }
         if (StringUtil.isNotEmpty(isMemberDiscount)) {
-            info.setIsMemberDiscount(isMemberDiscount);
+            mtGoods.setIsMemberDiscount(isMemberDiscount);
         }
         if (images.size() > 0) {
             String imagesJson = JSONObject.toJSONString(images);
-            info.setImages(imagesJson);
+            mtGoods.setImages(imagesJson);
         }
-        info.setOperator(accountInfo.getAccountName());
+        mtGoods.setOperator(accountInfo.getAccountName());
 
-        MtGoods goodsInfo = goodsService.saveGoods(info);
+        MtGoods goodsInfo = goodsService.saveGoods(mtGoods);
 
         Map<String, Object> result = new HashMap();
         result.put("goodsInfo", goodsInfo);

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

@@ -70,7 +70,6 @@ public class BackendStoreController extends BaseController {
         Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
         Integer pageSize = request.getParameter("pageSize") == null ? Constants.PAGE_SIZE : Integer.parseInt(request.getParameter("pageSize"));
 
-        String storeId = request.getParameter("id");
         String storeName = request.getParameter("name");
         String storeStatus = request.getParameter("status");
 
@@ -78,9 +77,6 @@ public class BackendStoreController extends BaseController {
         if (accountInfo == null) {
             return getFailureResult(1001, "请先登录");
         }
-        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
-            storeId = accountInfo.getStoreId().toString();
-        }
 
         PaginationRequest paginationRequest = new PaginationRequest();
         paginationRequest.setCurrentPage(page);
@@ -90,8 +86,8 @@ public class BackendStoreController extends BaseController {
         if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
             params.put("merchantId", accountInfo.getMerchantId());
         }
-        if (StringUtil.isNotEmpty(storeId)) {
-            params.put("storeId", storeId);
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            params.put("storeId", accountInfo.getStoreId());
         }
         if (StringUtil.isNotEmpty(storeName)) {
             params.put("name", storeName);
@@ -107,8 +103,8 @@ public class BackendStoreController extends BaseController {
         if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
             param.put("merchantId", accountInfo.getMerchantId());
         }
-        if (StringUtil.isNotEmpty(storeId)) {
-            param.put("storeId", storeId);
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            param.put("storeId", accountInfo.getStoreId());
         }
         List<MtMerchant> merchantList = merchantService.queryMerchantByParams(param);
         String imagePath = settingService.getUploadBasePath();