Commit 85101ce1 authored by shiyu's avatar shiyu

藏家个人主页

parent 3a7e2268
......@@ -142,6 +142,14 @@ public interface DistributionOrderDao {
*/
List<DistributionOrderNum> countGroupByStateForDistributor(long distributorId);
/**
* 统计藏家各状态的订单数量
* @param userId
* @return
*/
List<DistributionOrderNum> countGroupByStateForCollector(long userId);
/**
* 统计用户各状态的订单数量
* @param userId
......
......@@ -193,6 +193,11 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao {
return distributionOrderMapper.countGroupByStateForDistributor(distributorId);
}
@Override
public List<DistributionOrderNum> countGroupByStateForCollector(long userId) {
return distributionOrderMapper.countGroupByStateForCollector(userId);
}
@Override
public List<DistributionOrderNum> countGroupByStateForUser(long userId) {
return distributionOrderMapper.countGroupByStateForUser(userId);
......
......@@ -75,7 +75,12 @@ public interface DistributionOrderMapper {
*/
List<DistributionOrderNum> countGroupByStateForDistributor(@Param("sellerId")Long distributorId);
/**
* 统计分销商各状态的订单数量
* @param distributorId
* @return
*/
List<DistributionOrderNum> countGroupByStateForCollector(@Param("sellerId")Long userId);
/**
* 介绍人产生的订单金额总和
......
......@@ -634,6 +634,10 @@
select state, count(distribution_order_id) as num from distribution_order where seller_id = #{sellerId} group by state
</select>
<select id="countGroupByStateForCollector" parameterType="java.lang.Long" resultType="com.wwdz.ch.db.bean.DistributionOrderNum">
select state, count(distribution_order_id) as num from distribution_order where seller_id = #{sellerId} and type =3 group by state
</select>
<select id="countGroupByStateForUser" parameterType="java.lang.Long" resultType="com.wwdz.ch.db.bean.DistributionOrderNum">
select state, count(distribution_order_id) as num from distribution_order where buyer_id = #{buyerId} group by state
</select>
......
......@@ -214,6 +214,13 @@ public class UserServiceImpl implements UserService {
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) {
result.put("isShop", true);
result.put("shopId", shopDTO.getShopId());
//新商家登录,在表中记录
ShopWhiteList shopWhiteList = new ShopWhiteList();
shopWhiteList.setUserId(dto.getUserId());
shopWhiteList.setShopId(dto.getUserId());
shopWhiteList.setCreateTime(new Date());
shopWhiteList.setIsValid(true);
shopWhiteListDao.insert(shopWhiteList);
} else {
result.put("isShop", false);
}
......
......@@ -155,7 +155,7 @@ public class SelfPageServiceImpl implements SelfPageService {
selfPageInfoVo.setAvatarUrl(cacheUtil.appletUserInfoCache.get(dto.getUserId()).get().getAvatar());
selfPageInfoVo.setProfile(cacheUtil.appletUserInfoCache.get(dto.getUserId()).get().getProfile());
selfPageInfoVo.setBackground(cacheUtil.appletUserInfoCache.get(dto.getUserId()).get().getBackground());
List<DistributionOrderNum> distributionOrderNumList = distributionOrderDao.countGroupByStateForDistributor(dto.getUserId());
List<DistributionOrderNum> distributionOrderNumList = distributionOrderDao.countGroupByStateForCollector(dto.getUserId());
distributionOrderNumList.forEach(distributionOrderNum -> {
distributionOrderNum.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(distributionOrderNum.getState()));
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment