jiangping
2023-10-12 b1c1c20ef382dd2be0f6bdf81f5d2913e749faef
server/platform/src/main/java/com/doumee/task/ScheduleTool.java
@@ -3,10 +3,12 @@
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;
@@ -24,6 +26,7 @@
 */
@Component
@EnableScheduling
@Slf4j
public class ScheduleTool {
@@ -50,19 +53,11 @@
     * 測試
     * @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("=====================结束每天自动结算=======================");
    }
}