| | |
| | | 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 TeamDividentsManager teamDividentsManager; |
| | | |
| | | |
| | | @Resource |
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService; |
| | | @Resource |
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService; |
| | | |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | @Resource |
| | | private OrderProcessService orderProcessService; |
| | | |
| | | public OrderShareIncomeJob() { |
| | | 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; |
| | | } |
| | | // 分享赚到账 |
| | | @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; |
| | | } |
| | | |
| | | } |