Commit 3477ef60 authored by hezhen's avatar hezhen

Merge branch 'dev' into hz_dev

parents 69d6a838 c2387863
......@@ -123,16 +123,17 @@ public class AppAuthServiceImpl implements AuthService {
public ObjectRestResponse checkToken(String token) {
try {
if (StringUtils.isEmpty(token)){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
return ObjectRestResponse.createFailedResult(10003,"参数不能为空");
}
IJWTInfo ijwtInfo=jwtTokenUtil.getInfoFromToken(token);
if (ijwtInfo==null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE,"token失效");
return ObjectRestResponse.createFailedResult(10009,"token失效");
}
return ObjectRestResponse.succ();
token=jwtTokenUtil.generateToken(ijwtInfo);
return ObjectRestResponse.succ(token);
}catch (Exception e){
e.printStackTrace();
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE,"token失效");
return ObjectRestResponse.createFailedResult(10009,"token失效");
}
}
......
......@@ -120,16 +120,17 @@ public class AuthServiceImpl implements AuthService {
public ObjectRestResponse checkToken(String token) {
try {
if (StringUtils.isEmpty(token)){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
return ObjectRestResponse.createFailedResult(10003,"参数不能为空");
}
IJWTInfo ijwtInfo=jwtTokenUtil.getInfoFromToken(token);
if (ijwtInfo==null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE,"token失效");
return ObjectRestResponse.createFailedResult(10009,"token失效");
}
return ObjectRestResponse.succ();
token=jwtTokenUtil.generateToken(ijwtInfo);
return ObjectRestResponse.succ(token);
}catch (Exception e){
e.printStackTrace();
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE,"token失效");
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);
}
......@@ -92,6 +92,8 @@ public class AccessGatewayFilter implements GlobalFilter {
@Override
public Mono<Void> filter(ServerWebExchange serverWebExchange, GatewayFilterChain gatewayFilterChain) {
log.error("请求进入:AccessGatewayFilter");
log.info("check token and user permission....");
LinkedHashSet requiredAttribute = serverWebExchange.getRequiredAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
ServerHttpRequest request = serverWebExchange.getRequest();
......
......@@ -74,7 +74,7 @@ private static final ExchangeStrategies STRATEGIES;
@Override
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
log.error("请求进入:ResponseRecordFilter");
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Content-Type", "application/json");
ResponseAdapter responseAdapter = new ResponseAdapter(body, httpHeaders);
......
......@@ -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;
......
......@@ -343,7 +343,7 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
List<GoodDataVO> list = mapper.findAll();
Set<GoodDataVO> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(list)) {
if(number == list.size()) {
if(number >= list.size()) {
return ObjectRestResponse.succ(list);
}
Set<Integer> set = new HashSet<>();
......
......@@ -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;
......
......@@ -149,10 +149,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
}
if (StringUtils.isNotBlank(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds())) {
try {
QueryMultiDTO queryMultiDTO = new QueryMultiDTO();
queryMultiDTO.setIds(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds());
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.multi(queryMultiDTO).getData();
List<VehicleUserLicense> orderUserLicenses = vehicleFeign.getVehicleLicenseList(orderPageVO.getOrderRentVehicleDetail().getMyDriverIds()).getData();
if (orderUserLicenses != null && orderUserLicenses.size() > 0) {
OrderVehicleCrosstownDto orderVehicleCrosstownDto = new OrderVehicleCrosstownDto();
orderVehicleCrosstownDto.setLicenseIdCard(orderUserLicenses.get(0).getIdCard());
......@@ -163,6 +160,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
}
} catch (Exception e) {
log.info("获取驾驶人信息失败!");
e.printStackTrace();
}
}
......
......@@ -119,7 +119,7 @@ public interface TourFeign {
ObjectRestResponse getOne(@PathVariable Integer id);
//首页旅游列表
@GetMapping(value = "/gw/app/shopList")
@GetMapping(value = "/gw/shopList")
List<GoodDataVO> goodListAll(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
......
......@@ -334,7 +334,7 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
List<TourGood> list = mapper.getCoordinateList(param);
Set<TourGood> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(list)) {
if(number == list.size()) {
if(number >= list.size()) {
return ObjectRestResponse.succ(list);
}
Set<Integer> set = new HashSet<>();
......
......@@ -20,4 +20,14 @@ public class RandomListDto {
*/
private Integer location;
/**
* 新闻类型
*/
private Integer newsType;
/**
* 新闻id
*/
private Integer newsId;
}
......@@ -6,8 +6,8 @@ public enum TypeEnum {
VEHICLE(1, "车型"),
TOUR(2, "旅游"),
CAMPSITE(3, "营地"),
ACTIVITY(4, "活动");
ACTIVITY(4, "活动"),
NEWS(5, "新闻");
private Integer code;
private String msg;
......
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) {
......
......@@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.security.SecureRandom;
import java.util.*;
......@@ -23,7 +24,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
/**
* 随机文章条数
*/
private final Integer RANDOM_NUMBER = 3;
private final Integer RANDOM_NUMBER = 2;
/**
* 首页文章条数
......@@ -31,6 +32,8 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
private final Integer HOME_PAGE_NUMBER = 4;
/**
* 文章列表
*
......@@ -41,7 +44,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
*/
public PageInfo getArticleList(Integer page, Integer limit, Integer type) {
PageHelper.startPage(page, limit);
List articleList = mapper.getArticleList(type);
List articleList = mapper.getArticleList(type,null,null);
return PageInfo.of(articleList);
}
......@@ -68,21 +71,24 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
/**
* 随机获取三条连续的文章
*
*
*
* @param type
* @param id
* @return
*/
public List getThree(Integer type) {
List<Article> articleList = mapper.getArticleList(type);
public List getThree( Integer type, Integer number, Integer id) {
number = number == null ? RANDOM_NUMBER : number;
List<Article> articleList = mapper.getArticleList(type,null,id);
if (!Objects.isNull(articleList)) {
int size = articleList.size();
if (RANDOM_NUMBER >= size) {
if (number >= size) {
return articleList;
} else {
Random random = new Random();
int r = random.nextInt(size - RANDOM_NUMBER + 1);
int r = random.nextInt(size - number + 1);
List<Article> result = new ArrayList<>();
for (int i = 0; i < RANDOM_NUMBER.intValue(); i++) {
for (int i = 0; i < number.intValue(); i++) {
int index = i + r;
result.add(articleList.get(index));
}
......@@ -100,16 +106,16 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @return
*/
public List getHomePageArticle(Integer type) {
List<Article> articleList = mapper.getArticleList(type);
if (Objects.isNull(articleList)) {
return new ArrayList();
} else {
if (articleList.size() > HOME_PAGE_NUMBER) {
return articleList.subList(0, HOME_PAGE_NUMBER);
} else {
List<Article> articleList = mapper.getArticleList(type,HOME_PAGE_NUMBER,null);
// if (Objects.isNull(articleList)) {
// return new ArrayList();
// } else {
// if (articleList.size() > HOME_PAGE_NUMBER) {
// return articleList.subList(0, HOME_PAGE_NUMBER);
// } else {
return articleList;
}
}
// }
// }
}
@Transactional(rollbackFor = Exception.class)
......
......@@ -28,13 +28,16 @@ public class RandomListBiz {
@Autowired
SummitActivityBiz summitActivityBiz;
@Autowired
ArticleBiz articleBiz;
/**
* @param type 类型
* @param number 随机数,默认是2
* @return
*/
public ObjectRestResponse getRandomList(Integer type, Integer number, Integer location) {
public ObjectRestResponse getRandomList(Integer type, Integer number, Integer location, Integer id, Integer newsType) {
if(type != null) {
number = number == null ? 2 : number;
switch (TypeEnum.getByValue(type)) {
......@@ -46,6 +49,8 @@ public class RandomListBiz {
return campsiteFeign.findRandomVehicle(number);
case ACTIVITY:
return ObjectRestResponse.succ(summitActivityBiz.getHostWithSummitActivity(number, location));
case NEWS:
return ObjectRestResponse.succ(articleBiz.getThree(type, number, id));
}
}
return ObjectRestResponse.succ();
......
......@@ -11,9 +11,11 @@ import java.util.List;
*/
public interface ArticleMapper extends Mapper<Article> {
/**
* 根据网站类型查询文章
* 获取获取文章信息
* @param type
* @param limit 已使用分业插件传null值即可,不要重复传
* @param id 当前文章id ,无就传null
* @return
*/
List<Article> getArticleList(@Param("type") Integer type);
List<Article> getArticleList(@Param("type") Integer type,@Param( "limit") Integer limit,@Param("id") Integer id);
}
......@@ -36,11 +36,20 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
return ObjectRestResponse.succ(baseBiz.getOne(id,urlType));
}
@GetMapping("/app/unauth/three/{type}")
/**
* 随机获取三条数据
* @param type
* @param number
* @param id
* @return
*/
@GetMapping("/app/unauth/three")
@ApiOperation(value = "随机获取三条数据")
public ObjectRestResponse randomAccessToThreeData(@PathVariable Integer type){
return ObjectRestResponse.succ(baseBiz.getThree(type));
public ObjectRestResponse randomAccessToThreeData(@RequestParam("type") Integer type,
@RequestParam("number") Integer number,
@RequestParam("id") Integer id
){
return ObjectRestResponse.succ(baseBiz.getThree(type,number,id));
}
@GetMapping("/app/unauth/homePage/{type}")
......
......@@ -19,7 +19,7 @@ public class RandomListController {
if(randomListDto == null) {
return ObjectRestResponse.paramIsEmpty();
}
return randomListBiz.getRandomList(randomListDto.getType(), randomListDto.getNumber(), randomListDto.getLocation());
return randomListBiz.getRandomList(randomListDto.getType(), randomListDto.getNumber(), randomListDto.getLocation(), randomListDto.getNewsId(), randomListDto.getNewsType());
}
}
......@@ -47,9 +47,11 @@ public class VehicleModelController extends CommonBaseController {
@RequestMapping(value = "/detail/{name}", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<VModelDetailVO> detail(@PathVariable("name") @ApiParam("车型名称") String name) {
return vehicleFeign.detailByParam(BeanUtil.beanToMap(new VehicleModel(){{
ObjectRestResponse<VModelDetailVO> objectRestResponse = vehicleFeign.detailByParam(BeanUtil.beanToMap(new VehicleModel(){{
setName(name);
}}, false, true));
objectRestResponse.getData().setUccnCataList(initUccnCataCollect(objectRestResponse.getData().getConfig()));
return objectRestResponse;
}
/**
......@@ -65,21 +67,26 @@ public class VehicleModelController extends CommonBaseController {
ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
PageDataVO<VehicleModelVo> pageDataVOs = objectRestResponse.getData();
pageDataVOs.getData().forEach( v -> {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(v.getConfig()).getData();
StrUtil.splitToInt("14,7,11", ",");
v.setUccnCataList(vehiclePlatCataList.parallelStream().filter(v1 -> {return ArrayUtil.contains(StrUtil.splitToInt("14,7,11", ","), v1.getParentId());}).sorted(Comparator.comparing(VehiclePlatCata::getParentId, (x, y) -> {
int xx = 0,yy = 0;
int[] array = StrUtil.splitToInt("14,7,11", ",");
for(int i = 0; i < array.length; i++) {
if(x == array[i]) {
xx = i;
}else if(y == array[i]) {
yy = i;
}
}
return (xx - yy);
})).collect(Collectors.toList()));
v.setUccnCataList(initUccnCataCollect(v.getConfig()));
});
return objectRestResponse;
}
private List<VehiclePlatCata> initUccnCataCollect(String modelConfig) {
List<VehiclePlatCata> vehiclePlatCataList = vehicleFeign.getCatasByIds(modelConfig).getData();
int[] array = StrUtil.splitToInt("14,7,11", ",");
return vehiclePlatCataList.parallelStream()
.filter(v1 -> {return ArrayUtil.contains(array, v1.getParentId());})
.sorted(Comparator.comparing(VehiclePlatCata::getParentId, (x, y) -> {
int xx = 0,yy = 0;
for(int i = 0; i < array.length; i++) {
if(x == array[i]) {
xx = i;
}else if(y == array[i]) {
yy = i;
}
}
return (xx - yy);
})).collect(Collectors.toList());
}
}
......@@ -4,8 +4,22 @@
<mapper namespace="com.xxfc.platform.uccn.mapper.ArticleMapper">
<select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.Article">
select title,epitome,add_time,cover_image from article
where is_del=0 and status=1 and (type=#{type} or type=0) order by weight ASC ,add_time DESC
select id, title,epitome,add_time,cover_image from article
where
is_del=0
and status=1
<if test="id != null">
and id != #{id}
</if>
and (type=#{type} or type=0)
order by
weight ASC ,add_time DESC
<if test="limit != null">
limit #{limit}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -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;
//取消旅游订单(客服)
......
......@@ -125,7 +125,7 @@ public class AliYunSmsBiz {
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_D);
break;
case 14 :
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_E);
SmsService.sendTemplateToJson14(phoneNumbers,params,TEMPLATE_ID_PAY_E);
break;
case 15 :
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_F);
......
......@@ -178,7 +178,7 @@ public class SmsService {
//request.setOutId("yourOutId");
//hint 此处可能会抛出异常,注意catch
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
log.info("短信接口返回的数据----------------mobile======"+PhoneNumbers+"----templateParam===="+params);
log.info("短信接口返回的数据--templateCode===="+templateCode+"--------mobile======"+PhoneNumbers+"----templateParam===="+params);
log.info("Code=" + sendSmsResponse.getCode());
log.info("Message=" + sendSmsResponse.getMessage());
log.info("RequestId=" + sendSmsResponse.getRequestId());
......@@ -192,24 +192,54 @@ public class SmsService {
}
public static void sendTemplateToJson(String PhoneNumbers,String[] params,String templateCode){
try {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
jsonParams.put(param+(i+1),params[i]);
}
try {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;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();
}
sendTemplate(PhoneNumbers,jsonParams.toJSONString(),templateCode);
}catch (Exception e){
e.printStackTrace();
}
}
public static void sendTemplateToJson14(String PhoneNumbers,String[] params,String templateCode){
try {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
String para=params[i];
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
}
if (i>3){
jsonParams.put(param+(i+2),para);
}else {
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();
......
......@@ -83,8 +83,12 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception ;
@RequestMapping(value = "/user/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception;
public ObjectRestResponse<List<VehicleUserLicense>> multi(@RequestBody QueryMultiDTO dto) throws Exception;
@GetMapping("/user/license/getVehicleLicenseList")
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(@RequestParam(value="ids") String ids);
/**
* 获取优质车型接口
......
......@@ -19,4 +19,9 @@ public class VModelDetailVO extends VehicleModel {
@ApiModelProperty("会员列表")
List<BaseUserMemberLevel> userMemberLevel;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList;
}
\ No newline at end of file
......@@ -48,6 +48,9 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty(value = "品牌")
private String brandName;
/**
* 官网需要显示的配置列表
*/
List<VehiclePlatCata> UccnCataList;
}
......@@ -116,6 +116,34 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return ObjectRestResponse.succ();
}
//临时数据同步3
public ObjectRestResponse synchro3(){
List<BranchCompanyStockInfo> list= stockInfoMapper.selectAll();
if (list.size()>0){
int num=0;
for (BranchCompanyStockInfo companyStockInfo:list){
Integer id=companyStockInfo.getId();
Integer balance=companyStockInfo.getBalance();
Integer total=companyStockInfo.getTotal();
BigDecimal price=companyStockInfo.getPrice();
Integer state=companyStockInfo.getState();
BranchCompanyStockRight branchCompanyStockRight=stockRightBiz.selectById(id);
if (branchCompanyStockRight!=null){
branchCompanyStockRight=new BranchCompanyStockRight();
branchCompanyStockRight.setId(id);
branchCompanyStockRight.setBalance(balance);
branchCompanyStockRight.setStockState(state);
branchCompanyStockRight.setTotal(total);
branchCompanyStockRight.setPrice(price);
stockRightBiz.updateSelectiveById(branchCompanyStockRight);
num++;
}
log.info("----成功---num=="+num+"---id==="+id);
}
}
return ObjectRestResponse.succ();
}
//设置基础信息
public ObjectRestResponse updCompany(CompanyVo companyVo){
if (companyVo==null|| StringUtils.isBlank(companyVo.getCompanyName())|| StringUtils.isBlank(companyVo.getName())||
......
......@@ -445,7 +445,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
DateTime endDay = DateTime.parse(bookVehicleVo.getBookEndDate(), DATE_TIME_FORMATTER);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod(yearMonthAndDate, DateTime.parse(startDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER), DateTime.parse(endDay.toString(DEFAULT_DATE_TIME_FORMATTER), DEFAULT_DATE_TIME_FORMATTER));
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
if (yearMonthAndDate.size() > 3) {//连续的日期最多夸3个月
throw new BaseException(ResultCode.ONLY_BOOK_TWO_MONTH);
}
......
......@@ -83,7 +83,7 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
List<VehicleModelVo> list = mapper.findVehicleModelPage(vmqc);
Set<VehicleModelVo> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(list)) {
if(number == list.size()) {
if(number >= list.size()) {
return ObjectRestResponse.succ(list);
}
Set<Integer> set = new HashSet<>();
......
......@@ -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;
......
......@@ -15,10 +15,12 @@ import com.xxfc.platform.vehicle.pojo.VehicleUserLicenseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -70,12 +72,32 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
@RequestMapping(value = "/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(QueryMultiDTO dto) throws Exception {
// BaseContextHandler.getUserID()
log.info("获取驾驶人信息:", dto.toString());
List<VehicleUserLicense> list = baseBiz.selectByExample(new Example.Builder(VehicleUserLicense.class)
.where(WeekendSqls.<VehicleUserLicense>custom()
.andIn(VehicleUserLicense::getId, Arrays.asList(dto.getIds().split(",")))).build());
return ObjectRestResponse.succ().data(list);
}
@GetMapping("/license/getVehicleLicenseList")
public ObjectRestResponse<List<VehicleUserLicense>> getVehicleLicenseList(String ids){
// BaseContextHandler.getUserID()
log.info("获取驾驶人信息:", ids);
List<VehicleUserLicense> list = new ArrayList<>();
if(StringUtils.isNotBlank(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
for(String id : idList) {
VehicleUserLicense vehicleUserLicense = baseBiz.selectById(id);
if(vehicleUserLicense != null) {
list.add(vehicleUserLicense);
}
}
}
return ObjectRestResponse.succ().data(list);
}
@RequestMapping(value = "/license/del", method = RequestMethod.GET)
public RestResponse del(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception {
......
......@@ -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
......
......@@ -31,6 +31,12 @@ public class CompanyController extends BaseController<CompanyBaseBiz> {
return baseBiz.synchro2();
}
@ApiOperation("同步股权3")
@PostMapping("synchro3")
public ObjectRestResponse<String> synchro3() {
return baseBiz.synchro3();
}
@ApiOperation("查询公司列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
......
......@@ -53,6 +53,6 @@
and (b.`name` like CONCAT('%',#{name},'%') or c.`name` like CONCAT('%',#{name},'%') )
</if>
</where>
order by b.id desc
order by b.upd_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -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
......
......@@ -677,6 +677,8 @@
and v.is_del = 0
and v.status != 3
and v.use_type = 1
and bc.is_del = 0
and bc.is_show = 1
</where>
</sql>
......
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