|
@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.io.FileTypeUtil;
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
import com.example.nngkxxdp.dao.FileDao;
|
|
|
+import com.example.nngkxxdp.dao.FoodDao;
|
|
|
import com.example.nngkxxdp.entity.*;
|
|
|
import com.example.nngkxxdp.dao.SEvaluationDao;
|
|
|
import com.example.nngkxxdp.service.SEvaluationService;
|
|
@@ -41,6 +42,9 @@ public class SEvaluationServiceImpl implements SEvaluationService {
|
|
|
@Autowired
|
|
|
private FileDao fileDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FoodDao foodDao;
|
|
|
+
|
|
|
@Value("${file.location}")
|
|
|
private String location;
|
|
|
|
|
@@ -127,7 +131,13 @@ public class SEvaluationServiceImpl implements SEvaluationService {
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getDetailByDishesId(String canteenId, String dishesId, Integer page, Integer limit) {
|
|
|
Integer count = (page - 1) * limit;
|
|
|
- return sEvaluationDao.getDetailByDishesId(canteenId, dishesId, count, limit);
|
|
|
+ List<Map<String, Object>> list = sEvaluationDao.getDetailByDishesId(canteenId, dishesId, count, limit);
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
+ String photoPath = map.getOrDefault("photoPath", "").toString();
|
|
|
+ List<Map<String, Object>> pic = foodDao.getFoodPicByPicId(photoPath.split(","));
|
|
|
+ map.put("photoPath", pic);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
@Override
|