Commit ff49aee7 authored by jiaorz's avatar jiaorz

Merge branch 'jrz_dev' into base-modify

parents 484159e7 1910aa66
......@@ -129,7 +129,8 @@ public class AppAuthServiceImpl implements AuthService {
if (ijwtInfo==null){
return ObjectRestResponse.createFailedResult(10009,"token失效");
}
return ObjectRestResponse.succ();
token=jwtTokenUtil.generateToken(ijwtInfo);
return ObjectRestResponse.succ(token);
}catch (Exception e){
e.printStackTrace();
return ObjectRestResponse.createFailedResult(10009,"token失效");
......
......@@ -126,7 +126,8 @@ public class AuthServiceImpl implements AuthService {
if (ijwtInfo==null){
return ObjectRestResponse.createFailedResult(10009,"token失效");
}
return ObjectRestResponse.succ();
token=jwtTokenUtil.generateToken(ijwtInfo);
return ObjectRestResponse.succ(token);
}catch (Exception e){
e.printStackTrace();
return ObjectRestResponse.createFailedResult(10009,"token失效");
......
package com.github.wxiaoqi.security.common.constant;
import cn.hutool.core.date.format.FastDateFormat;
import java.time.format.DateTimeFormatter;
/**
......@@ -41,8 +43,10 @@ public class CommonConstants {
public static final String LONG_TIME = "HHmmss";
public static final String SHORT_TIME = "HHmm";
public static final String DATE_TIME_LINE = "yyyy-MM-dd HH:mm:ss";
public static final String HOUR_MINUTE = "mm:ss";
public static final DateTimeFormatter DATE_TIME_LINE_FORMATTER = DateTimeFormatter.ofPattern(DATE_TIME_LINE);
public static final DateTimeFormatter YMR_SLASH_FORMATTER = DateTimeFormatter.ofPattern(YMR_SLASH);
public static final FastDateFormat HOUR_MINUTE_FORMATTE_HUTOOL = FastDateFormat.getInstance(HOUR_MINUTE);
}
......@@ -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;
......
......@@ -184,12 +184,12 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
vehicle = restResponse.getData();
}
if (vehicle == null) {
return ObjectRestResponse.createFailedResult(500, "订单车辆不存在!");
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode(), ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc());
}
if( vehicle.getMileageLastUpdate() != null) {
//判断车辆公里数
if (orderVehicleCrosstownDto.getMileage() == null || orderVehicleCrosstownDto.getMileage() <= vehicle.getMileageLastUpdate()) {
return ObjectRestResponse.createFailedResult(500, "请输入车辆仪表盘实际公里数!");
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode(), ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc());
}
}
......@@ -377,7 +377,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
public boolean getTodayTime(Long time) {
long current = System.currentTimeMillis();
if (current <= (time / (1000 * 3600 * 24) * (1000 * 3600 * 24) - TimeZone.getDefault().getRawOffset() )+ 24 * 60 * 60 * 1000 -1) {
if (current <= (time / (1000 * 3600 * 24) * (1000 * 3600 * 24) - TimeZone.getDefault().getRawOffset() ) + 24 * 60 * 60 * 1000 -1) {
return true;
}
return false;
......
......@@ -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.DateTime;
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.*;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxl.job.core.biz.model.ReturnT;
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.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
/**
* 跨平台Http任务
*
* @author xuxueli 2018-09-16 03:48:34
*/
@JobHandler(value = "remindMsgJobHandler")
@Component
@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);
Date tomorrowBegin = DateUtil.beginOfDay(tomorrow);
Date tomorrowEnd = DateUtil.endOfDay(tomorrow);
//检索明天需要出车的订单
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());
DateTime startDate = DateUtil.date(orvd.getStartTime());
if(startDate.isAfterOrEquals(tomorrowBegin) && startDate.isBeforeOrEquals(tomorrowEnd)) {
orderMsgBiz.handelMsgStart(orvd, null, null, baseOrder, appUserDTO);
}
}else {
OrderTourDetail otd = orderTourDetailBiz.selectById(baseOrder.getDetailId());
DateTime startDate = DateUtil.date(otd.getStartTime());
if(startDate.isAfterOrEquals(tomorrowBegin) && startDate.isBeforeOrEquals(tomorrowEnd)) {
orderMsgBiz.handelMsgStart(null, otd, null, baseOrder, appUserDTO);
}
}
}
return ReturnT.SUCCESS;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
} finally {
;
}
}
}
\ No newline at end of file
......@@ -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;
......
package com.xxfc.platform.uccn;
import com.github.wxiaoqi.security.api.vo.config.HeaderConfig;
import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -12,12 +13,12 @@ import tk.mybatis.spring.annotation.MapperScan;
* @author Administrator
*/
@SpringBootApplication(scanBasePackages ={
"com.github.wxiaoqi",
"com.github.wxiaoqi.security.common.handler",
"com.xxfc.platform"
})
@EnableDiscoveryClient
@EnableAceAuthClient
@EnableFeignClients(value = {"com.xxfc.platform","com.github.wxiaoqi.security"})
@EnableFeignClients(value = {"com.xxfc.platform","com.github.wxiaoqi.security"}, defaultConfiguration = HeaderConfig.class)
@MapperScan(basePackages = "com.xxfc.platform.uccn.mapper")
public class UccnApplication {
public static void main(String[] args) {
......
......@@ -24,7 +24,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
/**
* 随机文章条数
*/
private final Integer RANDOM_NUMBER = 3;
private final Integer RANDOM_NUMBER = 2;
/**
* 首页文章条数
......
......@@ -37,9 +37,10 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
}
/**
*
* 随机获取三条数据
* @param type
* @param id 当前文章id
* @param number
* @param id
* @return
*/
@GetMapping("/app/unauth/three")
......
......@@ -62,6 +62,7 @@ public class SmsTemplateDTO {
public static final int REFUND_A = 22;
//违章押金退还
public static final int REFUND_B = 23;
//旅游内部通知(客服)
public static final int PAY_H = 24;
//取消旅游订单(客服)
......
......@@ -195,21 +195,26 @@ public class SmsService {
try {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
jsonParams.put(param+(i+1),params[i]);
String para=params[i];
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
}
jsonParams.put(param+(i+1),para);
}
sendTemplate(PhoneNumbers,jsonParams.toJSONString(),templateCode);
}catch (Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) throws ClientException, InterruptedException {
SmsService smsService=new SmsService();
//发短信
String[] params={"1","2","3","2019-08-29","松山湖"};
String[] params={"1","2","3","2019-08-29","【松山湖】"};
SmsService.sendTemplateToJson("13612688539,13265487972",params,"SMS_169904346");
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
......
......@@ -27,6 +27,9 @@ public class FileUploadServiceImpl implements FileUploadService {
@Value("${universal.url}")
private String xx_url ;
private static final String APK_SUFFIX=".apk";
private static final String APK_NAME="xxfc.apk";
@Override
public ObjectRestResponse handlerUpload(MultipartFile zipFile,String password,String prefix)throws Exception {
if (null == zipFile) {
......@@ -63,7 +66,18 @@ public class FileUploadServiceImpl implements FileUploadService {
String path=readZipFile(packFilePath);
if (StringUtils.isNotBlank(path)){
String filename = path;
path=xx_url+"/"+prefix+"/"+path;
log.info("文件名:{}",path);
if (filename.contains(APK_SUFFIX)){
Runtime runtime = Runtime.getRuntime();
log.info("执行删除xxfc.apk");
//删除包
runtime.exec("rm -rf "+uploadPath+"/"+APK_NAME);
log.info("执行复制上传包为xxfc.apk");
//复制包
runtime.exec("cp -f "+uploadPath+"/"+filename+" "+uploadPath+"/"+APK_NAME);
}
return ObjectRestResponse.succ(path);
}else {
return ObjectRestResponse.createDefaultFail();
......
......@@ -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;
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -44,6 +45,7 @@ import java.util.List;
@RestController
@RequestMapping("vehicleModel")
@Api(value = "车型controller", tags = {"车型操作接口"})
@IgnoreClientToken
public class VehicleModelController extends BaseController<VehicleModelBiz, VehicleModel> implements UserRestInterface {
@Autowired
......
......@@ -43,8 +43,7 @@
</choose>
where
vehicle = #{vehicleId} and `year_month`=#{yearMonth} and
booked_date &amp; #{andOperationFactor} = #{andOperationRs}
vehicle = #{vehicleId} and `year_month`=#{yearMonth}
</update>
<update id="updateById" parameterType="com.xxfc.platform.vehicle.entity.VehicleBookInfo">
update vehicle_book_info set
......
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