Commit ac6d4f69 authored by 周健威's avatar 周健威

修改短信相关代码

parent 7cc50755
......@@ -31,10 +31,7 @@ public class WalletJobHandler extends IJobHandler {
XxlJobLogger.log("-----定时器进入---walletHandler---");
log.info("-----定时器进入---walletHandler---");
myWaterBiz.updTodayAmount();
ReturnT returnT = new ReturnT();
returnT.setCode(100);
returnT.setMsg("成功");
return returnT;
return ReturnT.SUCCESS;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
......
......@@ -29,11 +29,8 @@ public class BaseOrderStatisticsJobHandler extends IJobHandler {
XxlJobLogger.log("-----定时器进入---baseOrderStatisticsHandler---");
log.info("-----定时器进入---baseOrderStatisticsHandler---");
// boolean flag = statisticsBiz.statisticalOrder();
ReturnT returnT = new ReturnT();
// if (flag) {
returnT.setCode(100);
returnT.setMsg("成功");
return returnT;
return ReturnT.SUCCESS;
// }
// else {
......
package com.xxfc.platform.order.jobhandler;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.xxfc.platform.order.biz.*;
import com.xxfc.platform.order.biz.inner.OrderMsgBiz;
import com.xxfc.platform.order.contant.enumerate.*;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderVehicleCrosstown;
import com.xxfc.platform.order.entity.OrderViolation;
import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
......@@ -17,17 +17,18 @@ import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
/**
......@@ -40,23 +41,53 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@Slf4j
public class RemindMsgJobHandler extends IJobHandler {
@Autowired
BaseOrderBiz baseOrderBiz;
@Autowired
OrderRentVehicleBiz orderRentVehicleBiz;
@Autowired
OrderTourDetailBiz orderTourDetailBiz;
@Autowired
OrderMsgBiz orderMsgBiz;
@Autowired
ThirdFeign thirdFeign;
@Autowired
UserFeign userFeign;
@Override
public ReturnT<String> execute(String idLastNumInterval) {
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Integer rentDepositAutoRefundTime = new Integer(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_DEPOSIT_AUTO_REFUND_TIME).getDetail());
try {
Date tomorrow = DateUtil.offsetDay(DateUtil.parse(DateUtil.today(), "yyyy-MM-dd"), 1);
//检索明天需要出车的订单
List<BaseOrder> lists = baseOrderBiz.selectByExample(new Example.Builder(BaseOrder.class)
//订单已完成的租车订单
.where(WeekendSqls.<BaseOrder>custom()
.andIn(BaseOrder::getType, CollectionUtil.newArrayList(OrderTypeEnum.RENT_VEHICLE.getCode(), OrderTypeEnum.TOUR.getCode()))
.andEqualTo(BaseOrder::getStatus, OrderStatusEnum.ORDER_TOSTART.getCode()) //待出发的订单
.andLessThanOrEqualTo(BaseOrder::getCrtTime, DateUtil.beginOfDay(tomorrow))
.andGreaterThanOrEqualTo(BaseOrder::getCrtTime, DateUtil.endOfDay(tomorrow))
).build());
for(BaseOrder baseOrder : lists) {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
if(OrderTypeEnum.RENT_VEHICLE.getCode().equals(baseOrder.getType())) {
OrderRentVehicleDetail orvd = orderRentVehicleBiz.selectById(baseOrder.getDetailId());
orderMsgBiz.handelMsgStart(orvd, null, null, baseOrder, appUserDTO);
}else {
OrderTourDetail otd = orderTourDetailBiz.selectById(baseOrder.getDetailId());
orderMsgBiz.handelMsgStart(null, otd, null, baseOrder, appUserDTO);
}
}
ReturnT returnT = new ReturnT();
returnT.setCode(100);
returnT.setMsg("成功");
returnT.setContent(idLastNumInterval);
return returnT;
return ReturnT.SUCCESS;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
......
......@@ -126,11 +126,8 @@ public class RentDepositJobHandler extends IJobHandler {
}
}
ReturnT returnT = new ReturnT();
returnT.setCode(100);
returnT.setMsg("成功");
returnT.setContent(idLastNumInterval);
return returnT;
return ReturnT.SUCCESS;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
......
......@@ -60,10 +60,7 @@ public class VehicleJobHandler extends IJobHandler {
vehicleBookInfoBiz.InsertBatch(bookInfos);
XxlJobLogger.log("----插入车型对象:【{}】",bookInfos);
}
ReturnT returnT = new ReturnT();
returnT.setCode(100);
returnT.setMsg("成功");
return returnT;
return ReturnT.SUCCESS;
} catch (Exception ex) {
XxlJobLogger.log(ex);
return FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment