| | |
| | | package com.yeshi.fanli.job.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceUserService;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager;
|
| | | import org.yeshi.utils.TimeUtil;
|
| | |
|
| | | //分享赚到账
|
| | | @Component
|
| | | public class OrderShareIncomeJob {
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | public OrderShareIncomeJob() {
|
| | |
|
| | | }
|
| | |
|
| | | // 分享赚到账
|
| | | @XxlJob("startOrderShareIncomeHandler")
|
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | | orderProcessService.fanliShare(preSendTime);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.job.order; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService; |
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceUserService; |
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | //分享赚到账 |
| | | @Component |
| | | public class OrderShareIncomeJob { |
| | | |
| | | @Resource |
| | | private TeamDividentsManager teamDividentsManager; |
| | | |
| | | |
| | | @Resource |
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService; |
| | | |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | |
| | | public OrderShareIncomeJob() { |
| | | |
| | | } |
| | | |
| | | // 分享赚到账 |
| | | @XxlJob("startOrderShareIncomeHandler") |
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception { |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; |
| | | if (!StringUtil.isNullOrEmpty(param)) { |
| | | day = param; |
| | | } |
| | | |
| | | //25号之前不能到账本月的 |
| | | long times = TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"); |
| | | if (times > System.currentTimeMillis()) { |
| | | throw new Exception("25号之前不能到账本月的"); |
| | | } |
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); |
| | | int uidCount = orderProcessService.fanliShare(preSendTime); |
| | | if(uidCount<=0){ |
| | | throw new Exception("暂无需要到账的用户"); |
| | | } |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |