Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
5beb14b9
Commit
5beb14b9
authored
Jul 03, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆违章查询和app自动更新(19/7/03)
parent
1ec3d497
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
30 deletions
+52
-30
AppVersionBiz.java
...rc/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
+8
-9
AppVersionController.java
...java/com/xxfc/platform/app/rest/AppVersionController.java
+2
-2
RedisKey.java
...n/java/com/xxfc/platform/universal/constant/RedisKey.java
+2
-1
Vehicle.java
...ava/com/xxfc/platform/universal/feign/result/Vehicle.java
+13
-13
TrafficViolationsController.java
...orm/universal/controller/TrafficViolationsController.java
+7
-2
TrafficViolationsService.java
.../platform/universal/service/TrafficViolationsService.java
+19
-2
UploadService.java
...va/com/xxfc/platform/universal/service/UploadService.java
+1
-1
No files found.
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
View file @
5beb14b9
...
@@ -79,21 +79,20 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
...
@@ -79,21 +79,20 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
}
}
public
RestResponse
uploadDrivingLicense
(
MultipartFile
file
)
throws
IOException
{
public
RestResponse
uploadDrivingLicense
(
MultipartFile
file
)
throws
IOException
{
//创建本日存放目录
DateTime
now
=
DateTime
.
now
();
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
File
.
separator
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
String
dirPathToday
=
File
.
separator
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
String
redisNoKey
=
RedisKey
.
UPLOAD_FILE_NO_PREFIX
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
String
redisNoKey
=
RedisKey
.
UPLOAD_FILE_NO_PREFIX
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
Long
no
=
redisTemplate
.
opsForValue
().
increment
(
redisNoKey
);
//
Long no = redisTemplate.opsForValue().increment(redisNoKey);
if
(
no
.
equals
(
1L
)){
//
if(no.equals(1L)){
redisTemplate
.
expire
(
redisNoKey
,
1
,
TimeUnit
.
DAYS
);
//
redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
}
//
}
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
String
realFileRelPath
=
dirPathToday
+
File
.
separator
+
no
+
fileName
.
substring
(
fileName
.
lastIndexOf
(
".
"
));
String
realFileRelPath
=
dirPathToday
+
File
.
separator
+
fileName
.
substring
(
fileName
.
lastIndexOf
(
"/
"
));
//文件存放路径
String
filePath
=
uploadPath
+
realFileRelPath
;
String
filePath
=
uploadPath
+
realFileRelPath
;
//将文件写入指定位置
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
return
RestResponse
.
suc
(
realFileRel
Path
);
return
RestResponse
.
suc
(
file
Path
);
}
}
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppVersionController.java
View file @
5beb14b9
...
@@ -50,8 +50,8 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
...
@@ -50,8 +50,8 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
public
RestResponse
uploadInstallationPackage
(
@RequestParam
(
"file"
)
MultipartFile
file
)
public
RestResponse
uploadInstallationPackage
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
throws
Exception
{
Assert
.
notNull
(
file
);
Assert
.
notNull
(
file
);
String
contentType
=
file
.
getContentType
();
//
图片
文件类型
String
contentType
=
file
.
getContentType
();
//文件类型
//
String fileName = file.getOriginalFilename(); //图片名字
//
// String fileName = file.getOriginalFilename(); //文件名
if
(!
contentType
.
equals
(
"apk"
)
&&
!
contentType
.
equals
(
"ipa"
))
{
if
(!
contentType
.
equals
(
"apk"
)
&&
!
contentType
.
equals
(
"ipa"
))
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
}
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/RedisKey.java
View file @
5beb14b9
package
com
.
xxfc
.
platform
.
vehicle
.
constant
;
package
com
.
xxfc
.
platform
.
universal
.
constant
;
public
class
RedisKey
{
public
class
RedisKey
{
...
@@ -88,4 +88,5 @@ public class RedisKey {
...
@@ -88,4 +88,5 @@ public class RedisKey {
*/
*/
public
static
final
String
MILEAGE_LAST_DAY_PREFIX
=
"mileage:last_day:"
;
public
static
final
String
MILEAGE_LAST_DAY_PREFIX
=
"mileage:last_day:"
;
public
static
final
String
ILLEGAL_VEHICLE_ENQUIRIES
=
"cache:violation:"
;
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/result/Vehicle.java
View file @
5beb14b9
...
@@ -158,17 +158,17 @@ public class Vehicle {
...
@@ -158,17 +158,17 @@ public class Vehicle {
/**
/**
* 车牌类型
* 车牌类型
*/
*/
private
String
t
ype
;
private
String
numberPlateT
ype
;
/**
//
/**
* 车牌号码
//
* 车牌号码
*/
//
*/
private
String
plateno
;
//
private String plateno;
/**
//
/**
* 发动机号
//
* 发动机号
*/
//
*/
private
String
engineno
;
//
private String engineno;
/**
//
/**
* 车架号
//
* 车架号
*/
//
*/
private
String
frameno
;
//
private String frameno;
}
}
\ No newline at end of file
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/TrafficViolationsController.java
View file @
5beb14b9
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.universal.controller;
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.universal.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.universal.feign.VehicleFeign
;
import
com.xxfc.platform.universal.feign.VehicleFeign
;
import
com.xxfc.platform.universal.feign.result.Vehicle
;
import
com.xxfc.platform.universal.feign.result.Vehicle
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
...
@@ -11,8 +12,6 @@ import com.xxfc.platform.universal.vo.ViolationVO;
...
@@ -11,8 +12,6 @@ import com.xxfc.platform.universal.vo.ViolationVO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
...
@@ -68,8 +67,14 @@ public class TrafficViolationsController {
...
@@ -68,8 +67,14 @@ public class TrafficViolationsController {
@GetMapping
(
"/getRentViolation"
)
@GetMapping
(
"/getRentViolation"
)
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
RentViolationDTO
rentViolationDTO
)
{
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
RentViolationDTO
rentViolationDTO
)
{
String
vehicleId
=
rentViolationDTO
.
getVehicleId
();
String
vehicleId
=
rentViolationDTO
.
getVehicleId
();
if
(
rentViolationDTO
==
null
||
rentViolationDTO
.
getVehicleId
()==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"Vehicle information is empty"
);
}
Vehicle
vehicle
=
vehicleFeign
.
get
(
vehicleId
).
getData
();
Vehicle
vehicle
=
vehicleFeign
.
get
(
vehicleId
).
getData
();
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"No corresponding vehicle information"
);
}
return
ObjectRestResponse
.
succ
(
tvService
.
getRentViolation
(
rentViolationDTO
,
vehicle
));
return
ObjectRestResponse
.
succ
(
tvService
.
getRentViolation
(
rentViolationDTO
,
vehicle
));
}
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/TrafficViolationsService.java
View file @
5beb14b9
...
@@ -3,11 +3,14 @@ package com.xxfc.platform.universal.service;
...
@@ -3,11 +3,14 @@ package com.xxfc.platform.universal.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.universal.biz.LicensePlateTypeBiz
;
import
com.xxfc.platform.universal.biz.LicensePlateTypeBiz
;
import
com.xxfc.platform.universal.constant.RedisKey
;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
com.xxfc.platform.universal.feign.result.Vehicle
;
import
com.xxfc.platform.universal.feign.result.Vehicle
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.vo.RentViolationDTO
;
import
com.xxfc.platform.universal.vo.RentViolationDTO
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
com.xxfc.platform.universal.vo.ViolationVO
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
...
@@ -16,6 +19,7 @@ import org.apache.http.util.EntityUtils;
...
@@ -16,6 +19,7 @@ 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.core.task.TaskExecutor
;
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
;
...
@@ -62,6 +66,9 @@ public class TrafficViolationsService {
...
@@ -62,6 +66,9 @@ public class TrafficViolationsService {
private
static
final
String
FRAMENO_NAME
=
"frameno"
;
private
static
final
String
FRAMENO_NAME
=
"frameno"
;
private
static
final
String
AUTHORIZATION
=
"Authorization"
;
private
static
final
String
AUTHORIZATION
=
"Authorization"
;
@Autowired
private
RedisTemplate
redisTemplate
;
/**
/**
* 支持查询的城市
* 支持查询的城市
...
@@ -211,8 +218,18 @@ public class TrafficViolationsService {
...
@@ -211,8 +218,18 @@ public class TrafficViolationsService {
licensePlateTypeBiz
.
insertLicensePlateType
(
finalLicensePlateTypes
);
licensePlateTypeBiz
.
insertLicensePlateType
(
finalLicensePlateTypes
);
}
}
public
Object
getRentViolation
(
RentViolationDTO
rentViolationDTO
,
Vehicle
vehicle
)
{
/**
* 订单完成后调用接口获取车辆信息
* @param rentViolationDTO
* @param vehicle
* @return
*/
public
String
getRentViolation
(
RentViolationDTO
rentViolationDTO
,
Vehicle
vehicle
)
{
String
stringViolationVOS
=
(
String
)
redisTemplate
.
opsForValue
()
.
get
(
RedisKey
.
ILLEGAL_VEHICLE_ENQUIRIES
+
rentViolationDTO
.
getVehicleId
());
if
(
StringUtils
.
isBlank
(
stringViolationVOS
))
{
}
return
null
;
return
null
;
}
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/UploadService.java
View file @
5beb14b9
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.universal.service;
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.universal.service;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.xxfc.platform.
vehicle
.constant.RedisKey
;
import
com.xxfc.platform.
universal
.constant.RedisKey
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormat
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment