|  |  | 
 |  |  |  | 
 |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
 |  |  | import com.doumee.core.constants.Constants; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.utils.DateUtil; | 
 |  |  | import com.doumee.dao.business.model.Goodsorder; | 
 |  |  | import com.doumee.service.business.GoodsorderService; | 
 |  |  | import com.doumee.service.business.WxBillService; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.scheduling.annotation.EnableScheduling; | 
 |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
 |  |  | 
 |  |  |  */ | 
 |  |  | @Component | 
 |  |  | @EnableScheduling | 
 |  |  | @Slf4j | 
 |  |  | public class ScheduleTool { | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |      * 測試 | 
 |  |  |      * @throws Exception | 
 |  |  |      */ | 
 |  |  | //    @Scheduled(fixedDelay = 1000*60) | 
 |  |  |     @Scheduled(cron = "0 0 21 * * ? ") | 
 |  |  |     public void getYesterdayBill() throws Exception { | 
 |  |  |  | 
 |  |  |         Goodsorder goodsorder = new Goodsorder(); | 
 |  |  |         goodsorder.setIsdeleted(Constants.ZERO); | 
 |  |  |         goodsorder.setStatus(Constants.goodsorderStatus.pay); | 
 |  |  |         List<Goodsorder> list = goodsorderService.findList(goodsorder); | 
 |  |  |         if (!CollectionUtils.isEmpty(list)){ | 
 |  |  |             list.forEach(s->{ | 
 |  |  |                 goodsorderService.closerGoodsorder(s.getId()); | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |         log.info("=====================开始每天自动结算======================="); | 
 |  |  |         goodsorderService.autoCloseOrder(); | 
 |  |  |         log.info("=====================结束每天自动结算======================="); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |