修改首页、商品
This commit is contained in:
parent
0210b25c70
commit
74bdae2928
@ -23,9 +23,6 @@ import java.util.Map;
|
||||
@RestController
|
||||
public class IndexController {
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@Autowired
|
||||
private IndexService indexService;
|
||||
|
||||
|
@ -5,6 +5,9 @@ import com.wzj.soopin.content.mapper.VlogMapper;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Withdraw;
|
||||
import com.wzj.soopin.member.service.IFeedbackService;
|
||||
import com.wzj.soopin.member.service.IMemberAccountService;
|
||||
import com.wzj.soopin.member.service.IWithdrawService;
|
||||
import com.wzj.soopin.member.service.impl.FeedbackServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.MemberServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.WithdrawServiceImpl;
|
||||
@ -23,38 +26,35 @@ import java.util.Map;
|
||||
public class IndexServiceImpl implements IndexService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
private final SysTenantMapper sysTenantMapper;
|
||||
private final VlogMapper vlogMapper;
|
||||
private final IMemberAccountService memberService;
|
||||
private final IFeedbackService feedbackService;
|
||||
private final IWithdrawService withdrawService;
|
||||
private final SystemStatisticsMapper systemStatisticsMapper;
|
||||
private final SysIntegralHistoryMapper sysIntegralHistoryMapper;
|
||||
private final ProductMapper productMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
|
||||
@Autowired
|
||||
private VlogMapper vlogMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberServiceImpl memberService;
|
||||
|
||||
@Autowired
|
||||
private FeedbackServiceImpl feedbackService;
|
||||
|
||||
@Autowired
|
||||
private WithdrawServiceImpl withdrawService;
|
||||
|
||||
@Autowired
|
||||
private SystemStatisticsMapper systemStatisticsMapper;
|
||||
|
||||
@Autowired
|
||||
private SysIntegralHistoryMapper sysIntegralHistoryMapper;
|
||||
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
public IndexServiceImpl(SysTenantMapper sysTenantMapper, VlogMapper vlogMapper, IMemberAccountService memberService, IFeedbackService feedbackService, IWithdrawService withdrawService, SystemStatisticsMapper systemStatisticsMapper, SysIntegralHistoryMapper sysIntegralHistoryMapper, ProductMapper productMapper, OrderMapper orderMapper) {
|
||||
this.sysTenantMapper = sysTenantMapper;
|
||||
this.vlogMapper = vlogMapper;
|
||||
this.memberService = memberService;
|
||||
this.feedbackService = feedbackService;
|
||||
this.withdrawService = withdrawService;
|
||||
this.systemStatisticsMapper = systemStatisticsMapper;
|
||||
this.sysIntegralHistoryMapper = sysIntegralHistoryMapper;
|
||||
this.productMapper = productMapper;
|
||||
this.orderMapper = orderMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCount() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("memberCount", memberService.count()); //用户数量
|
||||
result.put("vlogCount", vlogMapper.countVlog()); //待审核视频
|
||||
//用户数量
|
||||
result.put("memberCount", memberService.count());
|
||||
//待审核视频
|
||||
result.put("vlogCount", vlogMapper.countVlog());
|
||||
|
||||
// 待审核举报统计
|
||||
QueryWrapper<Feedback> FeedbackWrapper = new QueryWrapper<>();
|
||||
|
@ -58,7 +58,7 @@ public class SkuController extends BaseController {
|
||||
@Tag(name ="获取sku信息详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok(service.getById(id));
|
||||
return R.ok(service.selectSkuByid(id));
|
||||
}
|
||||
|
||||
@Tag(name ="新增sku信息")
|
||||
|
@ -41,7 +41,8 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
@Select("SELECT " +
|
||||
"name, " +
|
||||
"sales, " +
|
||||
"sales * price AS total_amount " +
|
||||
"price, " +
|
||||
"CASE WHEN sales = 0 OR sales IS NULL THEN price ELSE sales * price END AS total_amount " +
|
||||
"FROM pms_product " +
|
||||
"ORDER BY total_amount DESC " +
|
||||
"LIMIT 20")
|
||||
|
@ -6,14 +6,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.goods.domain.bo.SkuBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.domain.query.SkuQuery;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import com.wzj.soopin.goods.domain.vo.SkuVO;
|
||||
import com.wzj.soopin.goods.domain.vo.SkuVO;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.goods.service.SkuService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -34,4 +30,8 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
||||
IPage<SkuVO> resultPage = skuMapper.getlist(page,query);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
public SkuVO selectSkuByid(Long id) {
|
||||
return skuMapper.selectSkuByid(id);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getlist" resultType="SkuVO">
|
||||
<select id="getlist" resultType="com.wzj.soopin.goods.domain.vo.SkuVO">
|
||||
|
||||
SELECT
|
||||
s.*,
|
||||
@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSkuByid" resultType="SkuVO">
|
||||
<select id="selectSkuByid" resultType="com.wzj.soopin.goods.domain.vo.SkuVO">
|
||||
SELECT
|
||||
s.*,
|
||||
p.name AS productName
|
||||
|
Loading…
x
Reference in New Issue
Block a user