Commit 46b4b41d authored by libin's avatar libin

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents ab94bbdf 3fa359b8
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
......
...@@ -86,7 +86,7 @@ public class CommonLogServiceImpl implements CommonLogService { ...@@ -86,7 +86,7 @@ public class CommonLogServiceImpl implements CommonLogService {
} }
@Override @Override
public void run() { public void run() {
// mongoTemplate.insert(xxLogEntity, xxLogEntity.getMongoKey()); mongoTemplate.insert(xxLogEntity, xxLogEntity.getMongoKey());
} }
} }
......
...@@ -97,10 +97,6 @@ ...@@ -97,10 +97,6 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.33</version> <version>1.2.33</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId> <artifactId>spring-cloud-alibaba-dependencies</artifactId>
......
...@@ -16,13 +16,15 @@ import org.apache.http.HttpResponse; ...@@ -16,13 +16,15 @@ import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.task.TaskExecutor;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -207,7 +209,7 @@ public class TrafficViolationsService { ...@@ -207,7 +209,7 @@ public class TrafficViolationsService {
* @throws SQLException * @throws SQLException
*/ */
@Scheduled(cron = "0 0 0 0/7 * ?") @Scheduled(cron = "0 0 0 0/7 * ?")
private void updateLicensePlateType() throws SQLException { public void updateLicensePlateType() throws SQLException {
List<LicensePlateType> licensePlateTypes = licensePlateTypeBiz.selectListAll(); List<LicensePlateType> licensePlateTypes = licensePlateTypeBiz.selectListAll();
licensePlateTypeBiz.updateLicensePlateType(licensePlateTypes); licensePlateTypeBiz.updateLicensePlateType(licensePlateTypes);
} }
......
package com.xxfc.platform.vehicle.feign;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Component
public class AdminInfoFeign {
@Autowired
UserFeign userFeign;
public UserDTO getAdminUserInfo() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
if(request.getHeader("Authorization") !=null) {
return userFeign.userinfoByToken(request.getHeader("Authorization")).getData();
}
return null;
}
}
...@@ -7,7 +7,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -7,7 +7,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.Area; import com.xxfc.platform.vehicle.entity.Area;
import com.xxfc.platform.vehicle.feign.AdminInfoFeign;
import com.xxfc.platform.vehicle.mapper.AreaMapper; import com.xxfc.platform.vehicle.mapper.AreaMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
...@@ -15,7 +15,6 @@ import com.xxfc.platform.vehicle.constant.RedisKey; ...@@ -15,7 +15,6 @@ import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo; import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo;
import com.xxfc.platform.vehicle.entity.SysRegion; import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.feign.AdminInfoFeign;
import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper; import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import com.xxfc.platform.vehicle.util.excel.ExcelImport; import com.xxfc.platform.vehicle.util.excel.ExcelImport;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVo; import com.xxfc.platform.vehicle.pojo.BranchCompanyVo;
......
...@@ -5,7 +5,9 @@ import cn.hutool.core.bean.copier.CopyOptions; ...@@ -5,7 +5,9 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -20,7 +22,6 @@ import com.xxfc.platform.vehicle.common.RestResponse; ...@@ -20,7 +22,6 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.*; import com.xxfc.platform.vehicle.constant.*;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.feign.AdminInfoFeign;
import com.xxfc.platform.vehicle.mapper.*; import com.xxfc.platform.vehicle.mapper.*;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto; import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
...@@ -59,7 +60,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants. ...@@ -59,7 +60,7 @@ import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.
@Service @Service
@Slf4j @Slf4j
public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> { public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserRestInterface {
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd"); public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
...@@ -84,7 +85,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> { ...@@ -84,7 +85,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
@Autowired @Autowired
private VehicleBookHourInfoBiz vehicleBookHourInfoBiz; private VehicleBookHourInfoBiz vehicleBookHourInfoBiz;
@Autowired @Autowired
AdminInfoFeign adminInfoFeign; UserFeign userFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
@Value("${vehicle.baseUploadPath}") @Value("${vehicle.baseUploadPath}")
private String baseUploadPath ; private String baseUploadPath ;
@Value("${vehicle.fristMileage}") @Value("${vehicle.fristMileage}")
...@@ -1266,7 +1273,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> { ...@@ -1266,7 +1273,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
Integer limit = vehiclePlanDto.getLimit() == null ? 10 : vehiclePlanDto.getLimit(); Integer limit = vehiclePlanDto.getLimit() == null ? 10 : vehiclePlanDto.getLimit();
vehiclePlanDto.setPage(page); vehiclePlanDto.setPage(page);
vehiclePlanDto.setLimit(limit); vehiclePlanDto.setLimit(limit);
UserDTO userDTO = adminInfoFeign.getAdminUserInfo(); UserDTO userDTO = getAdminUserInfo();
if(userDTO == null) { if(userDTO == null) {
return ObjectRestResponse.createFailedResult(235, "token失效"); return ObjectRestResponse.createFailedResult(235, "token失效");
} }
......
...@@ -19,7 +19,6 @@ import com.xxfc.platform.vehicle.constant.ResCode.ResCode; ...@@ -19,7 +19,6 @@ import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus; import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.BookRecordAccItem; import com.xxfc.platform.vehicle.entity.BookRecordAccItem;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord; import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.feign.AdminInfoFeign;
import com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper; import com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper;
import com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper; import com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
......
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