|
|
@@ -8,6 +8,7 @@ import com.ruoyi.app.user.dto.StoreOutput;
|
|
|
import com.ruoyi.common.annotation.Anonymous;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.utils.LocaleUtils;
|
|
|
import com.ruoyi.system.domain.*;
|
|
|
import com.ruoyi.system.mapper.InfoUserMapper;
|
|
|
import com.ruoyi.system.mapper.PosFoodMapper;
|
|
|
@@ -67,18 +68,16 @@ public class NightMarketStoreController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 夜市附近商家列表(含搜索)
|
|
|
+ * 夜市摊位列表
|
|
|
*/
|
|
|
@Anonymous
|
|
|
- @GetMapping("/stores")
|
|
|
- public AjaxResult nearbyStores(@RequestParam Long nightMarketId,
|
|
|
- @RequestParam BigDecimal longitude,
|
|
|
- @RequestParam BigDecimal latitude,
|
|
|
+ @GetMapping("/nightMarkteStores")
|
|
|
+ public AjaxResult nightMarkteStores(@RequestParam Long nightMarketId,
|
|
|
@RequestParam(defaultValue = "1") Integer page,
|
|
|
@RequestParam(required = false) String keyword,
|
|
|
@RequestParam(defaultValue = "zh-TW", required = false) String language) {
|
|
|
int offset = (page - 1) * 20;
|
|
|
- List<PosStore> list = posStoreMapper.getNightMarketStalls(longitude, latitude, nightMarketId, keyword, offset);
|
|
|
+ List<PosStore> list = posStoreMapper.getNightMarketStalls(nightMarketId, keyword, offset);
|
|
|
posStoreEnrichService.enrichStoreList(list);
|
|
|
int total = posStoreMapper.getNightMarketStallsCount(nightMarketId, keyword);
|
|
|
Page<StoreOutput> result = posStoreEnrichService.buildStoreOutputPage(list, language, page, total);
|
|
|
@@ -161,7 +160,7 @@ public class NightMarketStoreController extends BaseController {
|
|
|
orderQw.eq("md_id", storeId).apply("DATE_FORMAT(cretim,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
|
|
|
long monthlySales = posOrderService.count(orderQw);
|
|
|
|
|
|
- String langCode = "zh-CN".equals(language) ? "2" : ("en-US".equals(language) ? "1" : "3");
|
|
|
+ String langCode = LocaleUtils.toLangCode(language);
|
|
|
List<PosFood> foods = posFoodMapper.selectFoodsByStoreId(storeId, langCode);
|
|
|
|
|
|
JSONObject result = new JSONObject();
|