| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.account.util.Base64Util; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.IUserMerchantCouponService; |
| | | import com.stylefeng.guns.modular.system.service.IUserTaxiCardService; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.SMSUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.SendSmsRequest; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskMinute(){ |
| | | try { |
| | | |
| | | //修改过期的优惠券 |
| | | userCouponRecordService.updateTimeOut(); |
| | | //修改过期的商家优惠券 |
| | |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskDay(){ |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 每天中午12点发送提醒短信 |
| | | */ |
| | | @Scheduled(cron = "0 0 12 * * ?") |
| | | public void taskMonth(){ |
| | | try { |
| | | List<Integer> integers = Arrays.asList(8, 9, 10, 12); |
| | | // 获取快车的已完成订单 |
| | | List<OrderPrivateCar> status = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().in("state", integers)); |
| | | for (OrderPrivateCar orderPrivateCar : status) { |
| | | chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX(),10000l); |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().eq("isDelete", 1) |
| | | .eq("state", 7).eq("abnormal", 1) |
| | | .last(" and now() > DATE_ADD(endServiceTime, INTERVAL 24 HOUR)")); |
| | | for (OrderPrivateCar orderPrivateCar : orderPrivateCars) { |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | request.setDestAddress(userInfo.getPhone()); |
| | | request.setTemplateId("TPL202507300002"); |
| | | Map<String, String> templateParams = new HashMap<>(); |
| | | request.setTemplateParams(templateParams); |
| | | request.setSpId("Y86asr7J"); |
| | | SMSUtil.sendSms(request); |
| | | } |
| | | |
| | | // 获取出租车订单 |
| | | List<OrderTaxi> status1 = orderTaxiService.selectList(new EntityWrapper<OrderTaxi>().in("state", integers)); |
| | | for (OrderTaxi orderTaxi : status1) { |
| | | chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(),orderTaxi.getTelX(),10000l); |
| | | List<OrderTaxi> orderTaxis = orderTaxiService.selectList(new EntityWrapper<OrderTaxi>().eq("isDelete", 1) |
| | | .eq("state", 7).eq("abnormal", 1) |
| | | .last(" and now() > DATE_ADD(endServiceTime, INTERVAL 24 HOUR)")); |
| | | for (OrderTaxi orderTaxi : orderTaxis) { |
| | | UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | request.setDestAddress(userInfo.getPhone()); |
| | | request.setTemplateId("TPL202507300002"); |
| | | Map<String, String> templateParams = new HashMap<>(); |
| | | request.setTemplateParams(templateParams); |
| | | request.setSpId("Y86asr7J"); |
| | | SMSUtil.sendSms(request); |
| | | } |
| | | |
| | | // 获取跨城出行订单 |
| | | List<OrderCrossCity> status2 = orderCrossCityService.selectList(new EntityWrapper<OrderCrossCity>().eq("state", integers)); |
| | | for (OrderCrossCity orderCrossCity : status2) { |
| | | chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId(),orderCrossCity.getTelX(),10000l); |
| | | } |
| | | |
| | | // 获取小件物流订单 |
| | | List<OrderLogistics> status3 = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("state", Arrays.asList(6,10))); |
| | | for (OrderLogistics orderLogistics : status3) { |
| | | chinaMobileUtil.midAxbUnBindSend(orderLogistics.getBindId(),orderLogistics.getTelX(),10000l); |
| | | chinaMobileUtil.midAxbUnBindSend(orderLogistics.getBindIdOne(),orderLogistics.getTelXOne(),10000l); |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // |
| | | // /** |
| | | // * 每月第一天的1点执行的任务 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 1 1 * *") |
| | | // public void taskMonth(){ |
| | | // try { |
| | | // |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |