|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
|---|
|  |  |  | import com.ruoyi.common.core.domain.R; | 
|---|
|  |  |  | import com.ruoyi.common.utils.AliSmsUtil; | 
|---|
|  |  |  | import com.ruoyi.system.model.TbAccountDetail; | 
|---|
|  |  |  | import com.ruoyi.system.model.TbCompany; | 
|---|
|  |  |  | import com.ruoyi.system.model.TbOrder; | 
|---|
|  |  |  | import com.ruoyi.system.model.TbUser; | 
|---|
|  |  |  | import com.ruoyi.system.service.TbAccountDetailService; | 
|---|
|  |  |  | import com.ruoyi.system.service.TbCompanyService; | 
|---|
|  |  |  | import com.ruoyi.system.service.TbOrderService; | 
|---|
|  |  |  | import com.ruoyi.system.service.TbUserService; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  | 
|---|
|  |  |  | private TbCompanyService companyService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TbAccountDetailService accountDetailService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private TbUserService userService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Scheduled(cron ="0 0 10 * * ?") | 
|---|
|  |  |  | public void sendSellerSms() { | 
|---|
|  |  |  | List<TbOrder> list = orderService.list(new LambdaQueryWrapper<TbOrder>().lt(TbOrder::getStatus, 3).eq(TbOrder::getStatus, 2)); | 
|---|
|  |  |  | if(!list.isEmpty()){ | 
|---|
|  |  |  | for (TbOrder tbOrder : list) { | 
|---|
|  |  |  | tbOrder.setSmsNum(tbOrder.getSmsNum() + 1); | 
|---|
|  |  |  | tbOrder.updateById(); | 
|---|
|  |  |  | TbCompany company = companyService.getById(tbOrder.getCompanyId()); | 
|---|
|  |  |  | if(company!=null){ | 
|---|
|  |  |  | TbUser user = userService.getById(company.getUserId()); | 
|---|
|  |  |  | AliSmsUtil.sendSuccessMessageSeller(user.getPhone()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Scheduled(fixedRate = 60000) | 
|---|
|  |  |  | public void confirmOrder() { | 
|---|
|  |  |  | 
|---|
|  |  |  | TbCompany company = companyService.getById(order.getCompanyId()); | 
|---|
|  |  |  | // 订单完成  商品已售卖 | 
|---|
|  |  |  | order.setStatus(6); | 
|---|
|  |  |  | order.updateById(); | 
|---|
|  |  |  | order.setFinishTime( new Date()); | 
|---|
|  |  |  | order.updateById(); | 
|---|
|  |  |  | company.setStatus(3); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 分佣 | 
|---|