Kaynağa Gözat

feature: 订餐订单下载权限问题

wuyongyi 2 yıl önce
ebeveyn
işleme
59df42d6d0

+ 19 - 4
src/main/java/com/ywt/mg/services/MealOrderService.java

@@ -2,11 +2,13 @@ package com.ywt.mg.services;
 
 import com.ywt.mg.configs.Constants;
 import com.ywt.mg.core.SqlHelper;
-import com.ywt.mg.core.utils.*;
+import com.ywt.mg.core.utils.BizUtil;
+import com.ywt.mg.core.utils.Checker;
+import com.ywt.mg.core.utils.DateUtil;
+import com.ywt.mg.core.utils.FormatUtil;
 import com.ywt.mg.domain.entities.OrderPayment;
 import com.ywt.mg.domain.entities.RefundLog;
 import com.ywt.mg.domain.mealEntities.Shop;
-
 import com.ywt.mg.domain.mealEntities.UserMealOrderView;
 import com.ywt.mg.domain.models.ConstantDef;
 import com.ywt.mg.domain.models.ExcelDataMap;
@@ -144,14 +146,27 @@ public class MealOrderService {
         String shopIds = Checker.getStringValue(request.getShopIds());
         int hosp = Checker.getIntegerValue(request.getHosp());
         if (!Checker.isNone(shopId) || hosp == 1) {
+            if (!Checker.isNone(shopId)) {
+                int shopIdInt = Integer.parseInt(shopId);
+                if (shopIdInt > 0) {
+                    whereSql += " and ( shop_id = ?)";
+                    paramList.add(shopIdInt);
+                } else if (!Checker.isNone(shopIds) && !shopIds.equals("0") && !shopIds.startsWith(",") && !shopIds.endsWith(",")) {
+                    whereSql += " and ( shop_id in (" + shopIds + "))";
+                }
+            } else if (!Checker.isNone(shopIds) && !shopIds.equals("0") && !shopIds.startsWith(",") && !shopIds.endsWith(",")) {
+                whereSql += " and ( shop_id in (" + shopIds + "))";
+            }
+
+        }
+        if (!Checker.isNone(shopId)) {
             int shopIdInt = Integer.parseInt(shopId);
             if (shopIdInt > 0) {
                 whereSql += " and ( shop_id = ?)";
                 paramList.add(shopIdInt);
-            } else if (!Checker.isNone(shopIds) && !shopIds.equals("0") && !shopIds.startsWith(",") && !shopIds.endsWith(",")) {
-                whereSql += " and ( shop_id in (" + shopIds + "))";
             }
         }
+
         try {
             int clientTypeInt = 2;
             if (!Checker.isNone(request.getClientType())) {

+ 1 - 1
src/main/java/com/ywt/mg/web/controllers/hospital/HospRegisteredOrderController.java

@@ -40,7 +40,7 @@ public class HospRegisteredOrderController {
 
 
     @RequestMapping({"/downloadRegisteredOrderList"})
-    public BaseResponse downloadDepositList(@RequestBody RegisteredOrderListRequest request) {
+    public BaseResponse downloadRegisteredOrderList(@RequestBody RegisteredOrderListRequest request) {
         int currentAdminId = Checker.getIntegerValue(authService.getCurrentAdminId());
 //        request.setCurrentAdminId(currentAdminId);
         // 插入记录