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
7b40b138
Commit
7b40b138
authored
May 25, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加驾驶人
parent
4fa3c872
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
553 additions
and
90 deletions
+553
-90
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+11
-1
CommonConfig.java
...com/github/wxiaoqi/security/gate/config/CommonConfig.java
+20
-0
application.yml
ace-modules/ace-generator/src/main/resources/application.yml
+1
-1
generator.properties
...les/ace-generator/src/main/resources/generator.properties
+1
-1
RedisKey.java
...n/java/com/xxfc/platform/universal/constant/RedisKey.java
+91
-0
CommonConfig.java
...java/com/xxfc/platform/universal/config/CommonConfig.java
+21
-0
RedisConfiguration.java
...om/xxfc/platform/universal/config/RedisConfiguration.java
+35
-0
UploadController.java
.../xxfc/platform/universal/controller/UploadController.java
+34
-8
UploadService.java
...va/com/xxfc/platform/universal/service/UploadService.java
+73
-0
VehicleCata.java
...in/java/com/xxfc/platform/vehicle/entity/VehicleCata.java
+41
-16
VehiclePlatCata.java
...ava/com/xxfc/platform/vehicle/entity/VehiclePlatCata.java
+58
-23
VehicleUserLicense.java
.../com/xxfc/platform/vehicle/entity/VehicleUserLicense.java
+60
-27
VehicleUserLicenseVo.java
...va/com/xxfc/platform/vehicle/vo/VehicleUserLicenseVo.java
+7
-2
VehicleCataBiz.java
...in/java/com/xxfc/platform/vehicle/biz/VehicleCataBiz.java
+16
-0
VehicleLicenseBiz.java
...java/com/xxfc/platform/vehicle/biz/VehicleLicenseBiz.java
+13
-3
VehiclePlatCataBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
+6
-3
VehicleCataMapper.java
...a/com/xxfc/platform/vehicle/mapper/VehicleCataMapper.java
+9
-3
VehicleCataController.java
...com/xxfc/platform/vehicle/rest/VehicleCataController.java
+1
-0
VehicleLicenseController.java
.../xxfc/platform/vehicle/rest/VehicleLicenseController.java
+25
-2
VehicleCataMapper.xml
...le-server/src/main/resources/mapper/VehicleCataMapper.xml
+30
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
7b40b138
...
...
@@ -116,7 +116,17 @@ public class AuthController {
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
)
throws
Exception
{
log
.
info
(
openid
+
"----require wxlogin..."
);
return
appAuthService
.
wxlogin
(
openid
,
isQQ
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
}
else
{
String
token
=
appAuthService
.
getToken
(
result
.
getString
(
"username"
),
result
.
getInteger
(
"userid"
));
data
.
put
(
"token"
,
token
);
}
}
return
data
;
}
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
...
...
ace-gate/src/main/java/com/github/wxiaoqi/security/gate/config/CommonConfig.java
0 → 100644
View file @
7b40b138
package
com
.
github
.
wxiaoqi
.
security
.
gate
.
config
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
javax.servlet.MultipartConfigElement
;
@Configuration
public
class
CommonConfig
{
@Bean
public
MultipartConfigElement
multipartConfigElement
()
{
MultipartConfigFactory
factory
=
new
MultipartConfigFactory
();
// 单个数据大小
factory
.
setMaxFileSize
(
"10240KB"
);
// KB,MB
/// 总上传数据大小
factory
.
setMaxRequestSize
(
"102400KB"
);
return
factory
.
createMultipartConfig
();
}
}
\ No newline at end of file
ace-modules/ace-generator/src/main/resources/application.yml
View file @
7b40b138
...
...
@@ -10,7 +10,7 @@ spring:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.5.52.3:3306/
xxfc_order
?useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://10.5.52.3:3306/
vehicle
?useUnicode=true&characterEncoding=UTF-8
username
:
root
password
:
sslcloud123*()
jackson
:
...
...
ace-modules/ace-generator/src/main/resources/generator.properties
View file @
7b40b138
#代码生成器,配置信息
#包名
package
=
com.xxfc.platform.
order
package
=
com.xxfc.platform.
vehicle
#作者
author
=
zjw
#Email
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/RedisKey.java
0 → 100644
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
constant
;
public
class
RedisKey
{
/**
* 常量缓存key前缀
*/
public
static
final
String
CONSTANT_CACHE_PREFIX
=
"cache:constant:"
;
/**
* 地区常量缓存key前缀(子读取列表)
*/
public
static
final
String
SYS_REGION_SONS_CACHE_PREFIX
=
"cache:sysRegion:sons:"
;
/**
* 地区常量缓存key前缀(子读取列表)
*/
public
static
final
String
SYS_REGION_CACHE_PREFIX
=
"cache:sysRegion:"
;
/**
* 刷新常量缓存乐观锁前缀
*/
public
static
final
String
CONSTANT_REFRESH_LOCK_PREFIX
=
"lock:constant:"
;
/**
* 地区常量缓存key前缀
*/
public
static
final
String
SYS_REGION_REFRESH_LOCK
=
"lock:sysRegion:"
;
/**
* 迁移预定信息rediseky
*/
public
static
final
String
DEL_BOOK_INFO_LOCK_PREFIX
=
"lock:del:bookInfo:"
;
/**
* 迁移预定记录rediseky
*/
public
static
final
String
TRANSFER_BOOK_RECORD_LOCK_PREFIX
=
"lock:bookRecord:transfer"
;
/**
* 子公司列表缓存key前缀
*/
public
static
final
String
BRANCH_COMPANY_CACHE
=
"cache:brachCompany"
;
/**
* 子公司列表缓存key前缀
*/
public
static
final
String
BRANCH_COMPANY_CACHE_ALL
=
BRANCH_COMPANY_CACHE
+
":all"
;
/**
* 片区对应的子公司缓存key前缀
*/
public
static
final
String
BRANCH_COMPANY_CACHE_DATAZONE
=
BRANCH_COMPANY_CACHE
+
":dataZone{1}"
;
/**
* 营地列表缓存key前缀
*/
public
static
final
String
CAMPSITE_CACHE
=
"cache:campsite"
;
/**
* 营地列表缓存key前缀
*/
public
static
final
String
CAMPSITE_CACHE_ALL
=
CAMPSITE_CACHE
+
":all"
;
/**
* 片区对应的营地缓存key前缀
*/
public
static
final
String
CAMPSITE_CACHE_DATAZONE
=
CAMPSITE_CACHE
+
":dataZone{1}"
;
// 随车物品相关key
public
static
final
String
ACCOMPANYING_ITEM_CACHE_ALL
=
"cache:accompanyItem:all"
;
/**
* 服务器上传文件序号
*/
public
static
final
String
UPLOAD_FILE_NO_PREFIX
=
"upload:file:no:"
;
/**
* 预警信息检查乐观锁
*/
public
static
final
String
LOCK_VEHICLE_WARNING_MSG
=
"lock:vehicle:warningMsg"
;
/**
* 车辆预警,前一天检查的里程数redisKey前缀
*/
public
static
final
String
MILEAGE_LAST_DAY_PREFIX
=
"mileage:last_day:"
;
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/config/CommonConfig.java
0 → 100644
View file @
7b40b138
package
com
.
xxfc
.
platform
.
universal
.
config
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.MultipartConfigElement
;
@Configuration
public
class
CommonConfig
{
@Bean
public
MultipartConfigElement
multipartConfigElement
()
{
MultipartConfigFactory
factory
=
new
MultipartConfigFactory
();
// 单个数据大小
factory
.
setMaxFileSize
(
"10240KB"
);
// KB,MB
/// 总上传数据大小
factory
.
setMaxRequestSize
(
"102400KB"
);
return
factory
.
createMultipartConfig
();
}
}
\ No newline at end of file
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/config/RedisConfiguration.java
0 → 100644
View file @
7b40b138
package
com
.
xxfc
.
platform
.
universal
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
/**
* ${DESCRIPTION}
*
* @author wanghaobin
* @create 2017-06-21 8:39
*/
@Configuration
@Primary
public
class
RedisConfiguration
{
@Bean
public
RedisTemplate
<
String
,
Object
>
customRedisTemplate
(
RedisConnectionFactory
factory
)
{
RedisTemplate
redisTemplate
=
new
RedisTemplate
();
redisTemplate
.
setConnectionFactory
(
factory
);
RedisSerializer
<
String
>
stringSerializer
=
new
StringRedisSerializer
();
redisTemplate
.
setKeySerializer
(
stringSerializer
);
redisTemplate
.
setValueSerializer
(
stringSerializer
);
redisTemplate
.
setHashKeySerializer
(
stringSerializer
);
redisTemplate
.
setHashValueSerializer
(
stringSerializer
);
redisTemplate
.
afterPropertiesSet
();
return
redisTemplate
;
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/UploadController.java
View file @
7b40b138
...
...
@@ -14,16 +14,22 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.universal.service.UploadService
;
import
org.apache.commons.fileupload.FileItem
;
import
org.apache.commons.fileupload.FileUploadBase
;
import
org.apache.commons.fileupload.ProgressListener
;
import
org.apache.commons.fileupload.disk.DiskFileItemFactory
;
import
org.apache.commons.fileupload.servlet.ServletFileUpload
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
/**
...
...
@@ -31,14 +37,20 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping
(
"file"
)
@IgnoreUserToken
public
class
UploadController
{
@Autowired
UploadService
uploadService
;
private
static
Integer
MAX_DRIVING_LICENSE_SIZE
=
10
*
1024
*
1024
;
//10M
/**
*
*/
private
static
final
long
serialVersionUID
=
564190060577130813L
;
@RequestMapping
(
value
=
"/app/unauth/upload"
,
method
=
RequestMethod
.
POST
)
/*
@RequestMapping(value="/app/unauth/upload",method = RequestMethod.POST)
public JSONObject doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//得到上传文件的保存目录,将上传的文件存放于WEB-INF目录下,不允许外界直接访问,保证上传文件的安全
...
...
@@ -67,12 +79,12 @@ public class UploadController{
upload.setProgressListener(new ProgressListener(){
public void update(long pBytesRead, long pContentLength, int arg2) {
System.out.println("文件大小为:" + pContentLength + ",当前已处理:" + pBytesRead);
/**
*/
/**
* 文件大小为:14608,当前已处理:4096
文件大小为:14608,当前已处理:7367
文件大小为:14608,当前已处理:11419
文件大小为:14608,当前已处理:14608
*/
*/
/*
float f = pBytesRead/pContentLength;
try {
response.getWriter().write(f+"");
...
...
@@ -96,7 +108,7 @@ public class UploadController{
//设置上传文件总量的最大值,最大值=同时上传的多个文件的大小的最大值的和,目前设置为10MB
upload.setSizeMax(1024*1024*10);
//4、使用ServletFileUpload解析器解析上传数据,解析结果返回的是一个List<FileItem>集合,每一个FileItem对应一个Form表单的输入项
List
<
FileItem
>
list
=
upload
.
parseRequest
(
request
);
List<FileItem> list =
(List<FileItem>)
upload.parseRequest(request);
for(FileItem item : list){
//如果fileitem中封装的是普通输入项的数据
if(item.isFormField()){
...
...
@@ -162,7 +174,7 @@ public class UploadController{
return JsonResultUtil.createSuccessResultWithObj(result);
}
return JsonResultUtil.createDefaultFail();
}
}
*/
/**
* @Method: makeFileName
...
...
@@ -201,10 +213,24 @@ public class UploadController{
return
dir
;
}
public
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
@RequestMapping
(
value
=
"/app/unauth/upload"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
uploadDrivingLicense
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
String
contentType
=
file
.
getContentType
();
//图片文件类型
// String fileName = file.getOriginalFilename(); //图片名字
/* if (!contentType.equals("image/jpeg") && !contentType.equals("image/gif")&&!contentType.equals("image/png")) {
return JsonResultUtil.createFailedResult(2001,"格式不对!!!");
}*/
if
(
file
.
getSize
()
>
MAX_DRIVING_LICENSE_SIZE
)
{
return
JsonResultUtil
.
createFailedResult
(
2002
,
"大小超过限制!!!"
);
}
return
JsonResultUtil
.
createSuccessResultWithObj
(
uploadService
.
uploadFile
(
file
));
}
doGet
(
request
,
response
);
@IgnoreUserToken
@RequestMapping
(
value
=
"/app/unauth/download"
,
method
=
RequestMethod
.
GET
)
//匹配的是href中的download请求
public
ResponseEntity
<
byte
[]>
downloadDrivingLicense
(
@RequestParam
(
"realFileRelPath"
)
String
realFileRelPath
)
throws
Exception
{
return
uploadService
.
downloadFile
(
realFileRelPath
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/UploadService.java
0 → 100644
View file @
7b40b138
package
com
.
xxfc
.
platform
.
universal
.
service
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
org.apache.commons.io.FileUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.util.concurrent.TimeUnit
;
@Service
public
class
UploadService
{
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
@Value
(
"${universal.baseUploadPath}"
)
private
String
baseUploadPath
;
@Value
(
"${universal.url}"
)
private
String
xx_url
;
@Autowired
private
RedisTemplate
redisTemplate
;
/**
* 写入上传文件,返回相对路径
* @param file
* @return
*/
public
String
uploadFile
(
MultipartFile
file
)
throws
Exception
{
//创建本日存放目录
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
"/"
+
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
);
if
(
no
.
equals
(
1
l
)){
redisTemplate
.
expire
(
redisNoKey
,
1
,
TimeUnit
.
DAYS
);
}
String
fileName
=
file
.
getOriginalFilename
();
String
realFileRelPath
=
dirPathToday
+
"/"
+
no
+
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
//文件存放路径
String
filePath
=
baseUploadPath
+
realFileRelPath
;
//将文件写入指定位置
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
realFileRelPath
=
xx_url
+
"/image/u/2/10000002/201905/o/adb766b69c0140018a3aaaa08b37d41d.jpg"
;
return
realFileRelPath
;
}
/**
* 下载图片
* @param realFileRelPath
* @return
* @throws Exception
*/
public
ResponseEntity
<
byte
[]>
downloadFile
(
String
realFileRelPath
)
throws
Exception
{
String
filePath
=
baseUploadPath
+
realFileRelPath
;
File
file
=
new
File
(
filePath
);
//新建一个文件
HttpHeaders
headers
=
new
HttpHeaders
();
//http头信息
String
downloadFileName
=
new
String
(
file
.
getName
());
//设置编码
headers
.
setContentDispositionFormData
(
"attachment"
,
downloadFileName
);
headers
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM
);
return
new
ResponseEntity
<
byte
[]>(
FileUtils
.
readFileToByteArray
(
file
),
headers
,
HttpStatus
.
CREATED
);
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleCata.java
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
@Table
(
name
=
"vehicle_cata"
)
/**
* 平台车型分类表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-25 10:13:57
*/
@Data
public
class
VehicleCata
{
@Table
(
name
=
"vehicle_cata"
)
public
class
VehicleCata
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//主键id
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
//车型id
//车型id
@Column
(
name
=
"vehicle_model_id"
)
@ApiModelProperty
(
value
=
"车型id"
)
private
Integer
vehicleModelId
;
//分类id
//分类id
@Column
(
name
=
"cata_id"
)
@ApiModelProperty
(
value
=
"分类id"
)
private
Integer
cataId
;
//删除状态 0:有效 1:无效
//删除状态 0:有效 1:删除
@Column
(
name
=
"isdel"
)
@ApiModelProperty
(
value
=
"删除状态 0:有效 1:删除"
)
private
Integer
isdel
;
@Column
(
name
=
"update_time"
)
private
Long
updateTime
;
}
\ No newline at end of file
//创建时间
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
//更新时间
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehiclePlatCata.java
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Table
(
name
=
"vehicle_plat_cata"
)
/**
* 车型分类表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-25 10:13:57
*/
@Data
public
class
VehiclePlatCata
{
@Table
(
name
=
"vehicle_plat_cata"
)
public
class
VehiclePlatCata
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//主键自增字段,商品类型id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
,
generator
=
"JDBC"
)
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键自增字段,商品类型id"
)
private
Integer
id
;
//父类id
//父类id
@Column
(
name
=
"parent_id"
)
@ApiModelProperty
(
value
=
"父类id"
)
private
Integer
parentId
;
//名称
//名称
@Column
(
name
=
"name"
)
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
//icon
//图标
@Column
(
name
=
"icon"
)
@ApiModelProperty
(
value
=
"图标"
)
private
String
icon
;
//描述
//描述
@Column
(
name
=
"depict"
)
@ApiModelProperty
(
value
=
"描述"
)
private
String
depict
;
//排序
//排序
@Column
(
name
=
"rank"
)
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
rank
;
//级别 1:一级分类 2:二级分类
//级别 1:一级分类 2:二级分类...
@Column
(
name
=
"level"
)
@ApiModelProperty
(
value
=
"级别 1:一级分类 2:二级分类..."
)
private
Integer
level
;
//删除状态 0:有效 1:无效
//删除状态 0:有效 1:无效
@Column
(
name
=
"state"
)
@ApiModelProperty
(
value
=
"删除状态 0:有效 1:无效"
)
private
Integer
state
;
//创建时间
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
//更新时间
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
@Column
(
name
=
"update_time"
)
private
Long
updateTime
;
}
\ No newline at end of file
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleUserLicense.java
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
/**
* 驾驶人信息表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-25 10:21:45
*/
@Table
(
name
=
"vehicle_user_license"
)
@Data
public
class
VehicleUserLicense
{
@Table
(
name
=
"vehicle_user_license"
)
public
class
VehicleUserLicense
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//主键id
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
//用户id
private
Long
userid
;
//手机号
//用户id
@Column
(
name
=
"userid"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userid
;
//姓名
@Column
(
name
=
"name"
)
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
//手机号
@Column
(
name
=
"phone"
)
@ApiModelProperty
(
value
=
"手机号"
)
private
String
phone
;
//身份证号
//身份证
@Column
(
name
=
"id_card"
)
@ApiModelProperty
(
value
=
"身份证"
)
private
String
idCard
;
//驾驶证
//驾驶证
@Column
(
name
=
"license"
)
@ApiModelProperty
(
value
=
"驾驶证"
)
private
String
license
;
//正面照
//正面图片
@Column
(
name
=
"img"
)
@ApiModelProperty
(
value
=
"正面图片"
)
private
String
img
;
//反面照
//反面图片
@Column
(
name
=
"fimg"
)
@ApiModelProperty
(
value
=
"反面图片"
)
private
String
fimg
;
//更新时间
@Column
(
name
=
"update_time"
)
private
Long
updateTime
;
//创建时间
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
//更新时间
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
//是否删除:0-正常;1-删除
@Column
(
name
=
"isdel"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
private
Integer
isdel
;
}
\ No newline at end of file
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/vo/VehicleUserLicenseVo.java
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
vo
;
import
lombok.Data
;
/**
* 驾驶人信息表
*/
@Data
public
class
VehicleUserLicenseVo
{
private
Integer
id
;
//用户id
private
Long
userid
;
private
Integer
userid
;
//名称
private
String
name
;
//手机号
private
String
phone
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleCataBiz.java
View file @
7b40b138
...
...
@@ -7,6 +7,7 @@ import com.xxfc.platform.vehicle.mapper.VehicleCataMapper;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
...
...
@@ -14,6 +15,21 @@ import org.springframework.stereotype.Service;
public
class
VehicleCataBiz
extends
BaseBiz
<
VehicleCataMapper
,
VehicleCata
>
{
//添加车辆配置
@Transactional
public
void
updateCataByModel
(
String
ids
,
Integer
modelId
){
String
[]
cataIds
=
ids
.
split
(
","
);
if
(
cataIds
.
length
>
0
){
for
(
String
cataId:
cataIds
)
{
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleLicenseBiz.java
View file @
7b40b138
...
...
@@ -33,11 +33,11 @@ public class VehicleLicenseBiz extends BaseBiz<VehicleLicenseMapper, VehicleUser
public
RestResponse
update
(
VehicleUserLicenseVo
licenseVo
){
VehicleUserLicense
vehicleUserLicense
=
new
VehicleUserLicense
();
BeanUtils
.
copyProperties
(
licenseVo
,
vehicleUserLicense
);
vehicleUserLicense
.
setUpdateTime
(
System
.
currentTimeMillis
()/
1000
);
if
(
vehicleUserLicense
.
getId
()==
null
||
vehicleUserLicense
.
getId
()==
0
){
mapper
.
insertSelective
(
vehicleUserLicense
);
vehicleUserLicense
.
setUpdTime
(
System
.
currentTimeMillis
());
insertSelective
(
vehicleUserLicense
);
}
else
{
mapper
.
updateByPrimaryKeySelective
(
vehicleUserLicense
);
updateSelectiveById
(
vehicleUserLicense
);
}
return
RestResponse
.
suc
();
}
...
...
@@ -52,5 +52,15 @@ public class VehicleLicenseBiz extends BaseBiz<VehicleLicenseMapper, VehicleUser
return
PageDataVO
.
pageInfo
(
campsitePageInfo
);
}
public
VehicleUserLicense
getOneById
(
Integer
id
){
return
mapper
.
selectByPrimaryKey
(
id
);
}
public
RestResponse
del
(
Integer
id
){
VehicleUserLicense
vehicleUserLicense
=
new
VehicleUserLicense
();
vehicleUserLicense
.
setId
(
id
);
vehicleUserLicense
.
setIsdel
(
1
);
updateSelectiveById
(
vehicleUserLicense
);
return
RestResponse
.
suc
();
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
View file @
7b40b138
...
...
@@ -28,11 +28,11 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
public
RestResponse
update
(
CataVo
cataVo
){
VehiclePlatCata
vehiclePlatCata
=
new
VehiclePlatCata
();
BeanUtils
.
copyProperties
(
cataVo
,
vehiclePlatCata
);
vehiclePlatCata
.
setUpdateTime
(
System
.
currentTimeMillis
()/
1000
);
if
(
vehiclePlatCata
.
getId
()==
null
||
vehiclePlatCata
.
getId
()==
0
){
mapper
.
insertSelective
(
vehiclePlatCata
);
vehiclePlatCata
.
setUpdTime
(
System
.
currentTimeMillis
());
insertSelective
(
vehiclePlatCata
);
}
else
{
mapper
.
updateByPrimaryKeySelective
(
vehiclePlatCata
);
updateSelectiveById
(
vehiclePlatCata
);
}
return
RestResponse
.
suc
();
}
...
...
@@ -80,6 +80,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
public
List
<
VehiclePlatCata
>
getAll
(
Integer
parentId
){
Example
example
=
new
Example
(
VehiclePlatCata
.
class
);
example
.
createCriteria
().
andEqualTo
(
"parentId"
,
parentId
).
andEqualTo
(
"state"
,
0
);
example
.
setOrderByClause
(
"`rank` desc"
);
return
mapper
.
selectByExample
(
example
);
}
...
...
@@ -90,4 +91,6 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleCataMapper.java
View file @
7b40b138
package
com
.
xxfc
.
platform
.
vehicle
.
mapper
;
import
com.xxfc.platform.vehicle.entity.Campsite
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 平台车型分类表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-25 10:29:46
*/
public
interface
VehicleCataMapper
extends
Mapper
<
VehicleCata
>
{
}
\ No newline at end of file
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCataController.java
View file @
7b40b138
...
...
@@ -58,6 +58,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
/* @RequestMapping(value = "/{id}", method = RequestMethod.GET)
public RestResponse<Vehicle> get(@PathVariable String id) {
return RestResponse.data(baseBiz.get(id));
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleLicenseController.java
View file @
7b40b138
...
...
@@ -23,8 +23,13 @@ import org.springframework.web.bind.annotation.*;
public
class
VehicleLicenseController
extends
VehicleBaseController
<
VehicleLicenseBiz
>
{
@RequestMapping
(
value
=
"/license/update"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/license/update"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
update
(
@RequestBody
VehicleUserLicenseVo
licenseVo
)
throws
Exception
{
AppUserDTO
userDTO
=
getUserInfo
();
if
(
userDTO
==
null
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
licenseVo
.
setUserid
(
userDTO
.
getUserid
());
return
baseBiz
.
update
(
licenseVo
);
}
...
...
@@ -36,7 +41,25 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
if
(
userDTO
==
null
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
RestResponse
.
suc
(
baseBiz
.
getAllByUserid
(
page
,
limit
,
userDTO
.
getId
()));
return
RestResponse
.
suc
(
baseBiz
.
getAllByUserid
(
page
,
limit
,
userDTO
.
getUserid
()));
}
@RequestMapping
(
value
=
"/license/one"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
one
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
{
AppUserDTO
userDTO
=
getUserInfo
();
if
(
userDTO
==
null
||
id
==
0
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
RestResponse
.
suc
(
baseBiz
.
getOneById
(
id
));
}
@RequestMapping
(
value
=
"/license/del"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
del
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
{
if
(
id
==
0
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
baseBiz
.
del
(
id
);
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleCataMapper.xml
0 → 100644
View file @
7b40b138
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleCataMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.vehicle.entity.VehicleCata"
id=
"vehicleCataMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"vehicleModelId"
column=
"vehicle_model_id"
/>
<result
property=
"cataId"
column=
"cata_id"
/>
<result
property=
"isdel"
column=
"isdel"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
</resultMap>
<insert
id=
"addCataList"
parameterType=
"java.util.List"
>
insert into vehicle_cata (
vehicle_model_id,cata_id,crt_time,upd_time
) VALUES
<foreach
collection =
"list"
item=
"item"
index=
"index"
separator =
","
>
(#{item.vehicleModelId},#{item.cataId},#{item.crtTime},#{item.updTime})
</foreach>
</insert>
<select
id=
"getOne"
resultMap=
"vehicleCataMap"
>
SELECT * FROM vehicle_cata WHERE vehicle_model_id=#{vehicleModelId} AND cata_id=#{cataId} limit 1
</select>
</mapper>
\ No newline at end of file
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