提交 3a7d995b authored 作者: 吴德鹏's avatar 吴德鹏

评论

上级 98b0c314
...@@ -8,11 +8,7 @@ import com.platform.utils.R; ...@@ -8,11 +8,7 @@ import com.platform.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -111,4 +107,12 @@ public class TbCfItemCommentController { ...@@ -111,4 +107,12 @@ public class TbCfItemCommentController {
return R.ok().put("list", list); return R.ok().put("list", list);
} }
@GetMapping("/queryItemSku/{commentId}")
@ResponseBody
public R queryItemSku(@PathVariable("commentId") String commentId) {
List<String> list = tbCfItemCommentService.queryItemSku(commentId);
return R.ok().put("list", list);
}
} }
package com.platform.service; package com.platform.service;
import com.platform.entity.TbCfItemCommentEntity; import com.platform.entity.TbCfItemCommentEntity;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -68,4 +69,6 @@ public interface TbCfItemCommentService { ...@@ -68,4 +69,6 @@ public interface TbCfItemCommentService {
* @return 删除条数 * @return 删除条数
*/ */
int deleteBatch(String[] ids); int deleteBatch(String[] ids);
List<String> queryItemSku(String commentId);
} }
package com.platform.service.impl; package com.platform.service.impl;
import com.platform.dao.TbCfItemCommentDao; import com.platform.dao.TbCfItemCommentDao;
import com.platform.dao.TbCfItemSkusDao;
import com.platform.dao.TbCfStationItemDao;
import com.platform.dao.TbCfUserInfoDao; import com.platform.dao.TbCfUserInfoDao;
import com.platform.entity.TbCfItemCommentEntity; import com.platform.entity.TbCfItemCommentEntity;
import com.platform.entity.TbCfItemSkusEntity;
import com.platform.service.TbCfItemCommentService; import com.platform.service.TbCfItemCommentService;
import com.platform.utils.IdUtil; import com.platform.utils.IdUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -12,6 +15,7 @@ import org.springframework.stereotype.Service; ...@@ -12,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* Service实现类 * Service实现类
...@@ -27,6 +31,12 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService { ...@@ -27,6 +31,12 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
@Autowired @Autowired
private TbCfUserInfoDao tbCfUserInfoDao; private TbCfUserInfoDao tbCfUserInfoDao;
@Autowired
private TbCfStationItemDao tbCfStationItemDao;
@Autowired
private TbCfItemSkusDao tbCfItemSkusDao;
@Override @Override
public TbCfItemCommentEntity queryObject(String id) { public TbCfItemCommentEntity queryObject(String id) {
return tbCfItemCommentDao.queryObject(id); return tbCfItemCommentDao.queryObject(id);
...@@ -78,4 +88,12 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService { ...@@ -78,4 +88,12 @@ public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
public int deleteBatch(String[] ids) { public int deleteBatch(String[] ids) {
return tbCfItemCommentDao.deleteBatch(ids); return tbCfItemCommentDao.deleteBatch(ids);
} }
@Override
public List<String> queryItemSku(String commentId) {
TbCfItemCommentEntity comment = tbCfItemCommentDao.queryObject(commentId);
List<TbCfItemSkusEntity> list = tbCfItemSkusDao.querySkusByItemId(comment.getItemId());
List<String> collect = list.stream().map(s -> s.getSkuDesc()).collect(Collectors.toList());
return collect;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论