Commit 630dbbaa 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);
}
......
......@@ -3,7 +3,9 @@ package com.wwdz.ch.wx.job;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.notify.AliSmsSender;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.FollowFansRecord;
......@@ -12,6 +14,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.wx.api.WxAppletApi;
import com.wwdz.ch.wx.service.distribution.DistributionOrderService;
import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.StringUtils;
......@@ -23,10 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -55,10 +54,16 @@ public class NewItemNoticeJob {
@Autowired
ShopWhiteListDao shopWhiteListDao;
@Autowired
WxAppletApi wxAppletApi;
@Autowired
AliSmsSender aliSmsSender;
/**
* 每天晚上八点执行一次
*/
// @Scheduled(cron = "0 0 20 * * ?")
@Scheduled(cron = "0 0 20 * * ?")
public void execute() {
RLock lock = redissonClient.getLock(NEW_ITEM_NOTICE_KEY);
if (!lock.tryLock()) {
......@@ -91,6 +96,10 @@ public class NewItemNoticeJob {
for (ShopWhiteList shopWhiteList : shopWhiteLists) {
//发送模板消息
long distributorId = shopWhiteList.getUserId();
String url = wxAppletApi.getUrlLink("/pages/salePool/index",null);
//发短信
String msg = "分销中心选品池已上新, " + "请前往"+ url + "查看";
aliSmsSender.sendSms(distributorId, msg);
}
}
......@@ -122,7 +131,9 @@ public class NewItemNoticeJob {
for (FollowFansRecord followFansRecord : followFansRecordList) {
//发送通知
long fansId = followFansRecord.getFansId();
String url = wxAppletApi.getUrlLink("/pages/home/index",null);
String msg = "您关注的用户发布了新的藏品," + "请前往"+ url + "查看";
aliSmsSender.sendSms(fansId, msg);
}
}
}
......
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