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
c30e336c
Commit
c30e336c
authored
Jul 06, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
eef3ea34
7c6ccd01
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1247 additions
and
182 deletions
+1247
-182
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+2
-0
AppUserManageDTO.java
...m/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
+61
-0
BaseUserMemberVO.java
...m/github/wxiaoqi/security/admin/dto/BaseUserMemberVO.java
+75
-0
BaseUserMember.java
.../github/wxiaoqi/security/admin/entity/BaseUserMember.java
+3
-0
AppUserManageVo.java
...com/github/wxiaoqi/security/admin/vo/AppUserManageVo.java
+154
-0
AppUserManageBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
+29
-11
BaseUserMemberBiz.java
.../github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
+64
-0
AppUserDetailMapper.java
...ub/wxiaoqi/security/admin/mapper/AppUserDetailMapper.java
+3
-2
AppUsersManageController.java
...wxiaoqi/security/admin/rest/AppUsersManageController.java
+14
-6
BaseUserMemberController.java
...wxiaoqi/security/admin/rest/BaseUserMemberController.java
+42
-0
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+63
-79
UploadUtil.java
...src/main/java/com/xxfc/platform/app/utils/UploadUtil.java
+217
-0
AppVersionBiz.java
...rc/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
+106
-0
AppHomeController.java
...in/java/com/xxfc/platform/app/rest/AppHomeController.java
+8
-3
AppVersionController.java
...java/com/xxfc/platform/app/rest/AppVersionController.java
+76
-5
BaseAuthentication.java
...a/com/xxfc/platform/universal/api/BaseAuthentication.java
+14
-0
FQAuthentication.java
...om/xxfc/platform/universal/api/impl/FQAuthentication.java
+13
-0
Authentication.java
.../com/xxfc/platform/universal/api/pojo/Authentication.java
+4
-0
RedisKey.java
...n/java/com/xxfc/platform/universal/constant/RedisKey.java
+4
-0
IdInformation.java
...ava/com/xxfc/platform/universal/entity/IdInformation.java
+0
-3
ThirdFeign.java
...in/java/com/xxfc/platform/universal/feign/ThirdFeign.java
+2
-2
TrafficViolationsController.java
...orm/universal/controller/TrafficViolationsController.java
+17
-7
TrafficViolationsService.java
.../platform/universal/service/TrafficViolationsService.java
+21
-0
UploadService.java
...va/com/xxfc/platform/universal/service/UploadService.java
+1
-1
AccompanyingItem.java
...va/com/xxfc/platform/vehicle/entity/AccompanyingItem.java
+1
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+10
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+2
-1
VehicleModelBiz.java
...n/java/com/xxfc/platform/vehicle/biz/VehicleModelBiz.java
+43
-6
VehicleModelController.java
...om/xxfc/platform/vehicle/rest/VehicleModelController.java
+38
-29
ListTest.java
...ver/src/test/java/com/xxfc/platform/vehicle/ListTest.java
+15
-0
TimeTest.java
...ver/src/test/java/com/xxfc/platform/vehicle/TimeTest.java
+11
-27
TimedTaskTest.java
...rc/test/java/com/xxfc/platform/vehicle/TimedTaskTest.java
+55
-0
IdService.java
...test/java/com/xxfc/platform/vehicle/entity/IdService.java
+4
-0
SimpleGenId.java
...st/java/com/xxfc/platform/vehicle/entity/SimpleGenId.java
+20
-0
Student.java
...c/test/java/com/xxfc/platform/vehicle/entity/Student.java
+32
-0
UUIdGenId.java
...test/java/com/xxfc/platform/vehicle/entity/UUIdGenId.java
+12
-0
VestaGenId.java
...est/java/com/xxfc/platform/vehicle/entity/VestaGenId.java
+11
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
c30e336c
...
@@ -86,4 +86,6 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
...
@@ -86,4 +86,6 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
//查询列表数据
//查询列表数据
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
entity
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
entity
));
}
}
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
0 → 100644
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
* 用户信息表
*/
@Data
public
class
AppUserManageDTO
{
/**
* 每页条数
*/
private
Integer
limit
;
/**
* 当前页数
*/
private
Integer
page
;
/**
* 手机号
*/
private
Integer
mobile
;
/**
* 注册终端
*/
private
Integer
channel
;
/**
* 会员等级
*/
private
Integer
memberLevel
;
/**
* 注册时间(开始)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-DD HH:mm"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-DD HH:mm"
)
private
Date
registrationTimeBegin
;
/**
* 注册时间(结束)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-DD HH:mm"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-DD HH:mm"
)
private
Date
registrationTimeEnd
;
public
Long
getRegistrationTimeBegin
()
{
return
registrationTimeBegin
.
getTime
();
}
public
Long
getRegistrationTimeEnd
()
{
return
registrationTimeEnd
.
getTime
();
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/BaseUserMemberVO.java
0 → 100644
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 用户会员信息
*/
@Data
public
class
BaseUserMemberVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userId
;
/**
* 会员等级
*/
@Column
(
name
=
"member_level"
)
@ApiModelProperty
(
value
=
"会员等级"
)
private
Integer
memberLevel
;
/**
* 赠送总天数
*/
@Column
(
name
=
"total_number"
)
@ApiModelProperty
(
value
=
"赠送总天数"
)
private
Integer
totalNumber
;
/**
* 剩余天数
*/
@Column
(
name
=
"rent_free_days"
)
@ApiModelProperty
(
value
=
"剩余天数"
)
private
Integer
rentFreeDays
;
/**
* 购买会员次数
*/
@Column
(
name
=
"buy_count"
)
@ApiModelProperty
(
value
=
"购买会员次数"
)
private
Integer
buyCount
;
/**
* 有效期;0代表永久
*/
@Column
(
name
=
"valid_time"
)
@ApiModelProperty
(
value
=
"有效期;0代表永久"
)
private
Long
validTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseUserMember.java
View file @
c30e336c
...
@@ -132,6 +132,9 @@ public class BaseUserMember implements Serializable {
...
@@ -132,6 +132,9 @@ public class BaseUserMember implements Serializable {
@Column
(
name
=
"is_del"
)
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
private
Integer
isDel
;
private
Integer
isDel
;
@Column
(
name
=
"recent_recharge"
)
private
Long
recentRecharge
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserManageVo.java
0 → 100644
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
lombok.Data
;
import
javax.persistence.Column
;
/**
* 用户信息表
*/
@Data
public
class
AppUserManageVo
{
/**
* 用户id
*/
@Column
(
name
=
"userid"
)
private
Integer
userId
;
/**
* 注册终端
*/
@Column
(
name
=
"channel"
)
private
String
channel
;
/**
* 是否是会员:0-不是;1-会员
*/
@Column
(
name
=
"is_member"
)
private
Integer
isMember
;
/**
* 真实姓名
*/
@Column
(
name
=
"realname"
)
private
String
realName
;
/**
* 状态:0-正常,1-禁用
*/
@Column
(
name
=
"isdel"
)
private
Integer
isDel
;
/**
* 昵称
*/
@Column
(
name
=
"nickname"
)
private
String
nickName
;
/**
* 用户来源:0-自来,1-公司人员推荐,2-用户推荐
*/
@Column
(
name
=
"source"
)
private
Integer
source
;
/**
* 邀请人id
*/
@Column
(
name
=
"Inviter_account"
)
private
Integer
InviterAccount
;
/**
* 账号申请所在地
*/
@Column
(
name
=
"address"
)
private
String
address
;
/**
* 用户性别
*/
@Column
(
name
=
"sex"
)
private
Integer
sex
;
/**
* 用户邮箱
*/
@Column
(
name
=
"email"
)
private
String
email
;
/**
* 用户名(手机号码)
*/
@Column
(
name
=
"username"
)
private
String
username
;
/**
* 实名认证状态:0-未认证,1-已认证
*/
@Column
(
name
=
"certification_status"
)
private
String
certification_status
;
/**
* 身份证号
*/
@Column
(
name
=
"id_number"
)
private
String
idNumber
;
/**
* 会员等级
*/
@Column
(
name
=
"member_level"
)
private
Integer
memberLevel
;
/**
* 有效期;0代表永久
*/
@Column
(
name
=
"valid_time"
)
private
Integer
validTime
;
/**
* 创建时间
*/
@Column
(
name
=
"createtime"
)
private
Long
createTime
;
/**
* 最后的登录时间
*/
@Column
(
name
=
"last_time"
)
private
Long
lastTime
;
/**
* 购买会员次数
*/
@Column
(
name
=
"buy_count"
)
private
String
buyCount
;
/**
* 赠送总天数
*/
@Column
(
name
=
"total_number"
)
private
String
totalNumber
;
/**
* 剩余天数
*/
@Column
(
name
=
"rent_free_days"
)
private
String
rentFreeDays
;
/**
* 加入会员时间
*/
private
Long
timeOfMembership
;
/**
* 最近充值时间
*/
@Column
(
name
=
"recent_recharge"
)
private
Long
recentRecharge
;
/**
* 会员名称
*/
private
String
memberName
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserManageDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.mapper.*
;
import
com.github.wxiaoqi.security.admin.mapper.*
;
import
com.github.wxiaoqi.security.admin.vo.AppUserManageVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
...
@@ -24,42 +26,58 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
...
@@ -24,42 +26,58 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
@Autowired
@Autowired
private
AppUserLoginMapper
appUserLoginMapper
;
private
AppUserLoginMapper
appUserLoginMapper
;
@Autowired
private
BaseUserMemberMapper
baseUserMemberMapper
;
/**
/**
* 根据条件查询
* 根据条件查询
*
*
* @param appUser
Vo
* @param appUser
ManageDTO 查询条件
* @return
* @return
*/
*/
public
AppUser
Vo
findAllByQuery
(
AppUserVo
appUserVo
)
{
public
AppUser
ManageVo
findAllByQuery
(
AppUserManageDTO
appUserManageDTO
)
{
return
mapper
.
selectAppUserManage
(
appUser
Vo
);
return
mapper
.
selectAppUserManage
(
appUser
ManageDTO
);
}
}
/**
@Transactional
* 禁用账户
public
void
deleteAppUser
(
Integer
id
)
{
* @param id
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteAppUser
(
Integer
id
,
Integer
isDel
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setIsdel
(
1
);
//修改为禁用并设置修改时间
appUserLogin
.
setIsdel
(
isDel
);
appUserLogin
.
setUpdatetime
(
System
.
currentTimeMillis
());
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"id"
,
id
);
criteria
.
andEqualTo
(
"id"
,
id
);
appUserLogin
.
setUpdatetime
(
System
.
currentTimeMillis
());
appUserLoginMapper
.
updateByExampleSelective
(
appUserLogin
,
example
);
appUserLoginMapper
.
updateByExampleSelective
(
appUserLogin
,
example
);
//设置
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
appUserDetail
.
setIsdel
(
1
);
appUserDetail
.
setIsdel
(
isDel
);
appUserDetail
.
setUpdatetime
(
System
.
currentTimeMillis
());
appUserDetail
.
setUpdatetime
(
System
.
currentTimeMillis
());
Example
detailExample
=
new
Example
(
AppUserLogin
.
class
);
Example
detailExample
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
detailCriteria
=
detailExample
.
createCriteria
();
Example
.
Criteria
detailCriteria
=
detailExample
.
createCriteria
();
criteria
.
andEqualTo
(
"id"
,
id
);
criteria
.
andEqualTo
(
"id"
,
id
);
mapper
.
updateByExampleSelective
(
appUserDetail
,
detailCriteria
);
mapper
.
updateByExampleSelective
(
appUserDetail
,
detailCriteria
);
}
}
/**
* 查询一条
* @param id
* @return
*/
public
AppUserVo
findOneById
(
Integer
id
)
{
public
AppUserVo
findOneById
(
Integer
id
)
{
return
mapper
.
getUserInfo
(
id
);
return
mapper
.
getUserInfo
(
id
);
}
}
@Transactional
/**
*
* @param appUserVo
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
save
(
AppUserVo
appUserVo
)
{
public
void
save
(
AppUserVo
appUserVo
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
View file @
c30e336c
...
@@ -2,18 +2,28 @@ package com.github.wxiaoqi.security.admin.biz;
...
@@ -2,18 +2,28 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.UserMemberVo
;
import
com.github.wxiaoqi.security.admin.vo.UserMemberVo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.integration.amqp.dsl.Amqp
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberMapper
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.List
;
/**
/**
* 用户会员表
* 用户会员表
...
@@ -30,6 +40,9 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
...
@@ -30,6 +40,9 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
@Autowired
@Autowired
AppUserDetailBiz
detailBiz
;
AppUserDetailBiz
detailBiz
;
@Autowired
private
TaskExecutor
taskExecutor
;
//获取用户会员信息
//获取用户会员信息
@Cache
(
key
=
"user:member{1}"
)
@Cache
(
key
=
"user:member{1}"
)
public
UserMemberVo
getMemberInfoByUserId
(
Integer
userId
){
public
UserMemberVo
getMemberInfoByUserId
(
Integer
userId
){
...
@@ -155,5 +168,56 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
...
@@ -155,5 +168,56 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
return
AopContext
.
currentProxy
()
!=
null
?
(
BaseUserMemberBiz
)
AopContext
.
currentProxy
()
:
this
;
return
AopContext
.
currentProxy
()
!=
null
?
(
BaseUserMemberBiz
)
AopContext
.
currentProxy
()
:
this
;
}
}
/**
* 获取用户会员信息
* @param userId
* @return
*/
public
BaseUserMember
findOneByUserId
(
Integer
userId
)
{
Example
exa
=
new
Example
(
BaseUserMember
.
class
);
Example
.
Criteria
criteria
=
exa
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
userId
);
List
<
BaseUserMember
>
baseUserMembers
=
mapper
.
selectByExample
(
exa
);
if
(
baseUserMembers
.
size
()>
1
)
{
throw
new
BaseException
(
"Member purchase repeat!"
);
}
return
baseUserMembers
!=
null
&&
baseUserMembers
.
size
()!=
0
?
baseUserMembers
.
get
(
0
):
null
;
}
/**
* 设置用户会员
* @param baseUserMemberVO
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
setUserMember
(
BaseUserMemberVO
baseUserMemberVO
)
throws
InvocationTargetException
,
IllegalAccessException
{
Example
exa
=
Example
.
builder
(
BaseUserMember
.
class
).
where
(
WeekendSqls
.<
BaseUserMember
>
custom
()
.
andEqualTo
(
BaseUserMember:
:
getUserId
,
baseUserMemberVO
.
getUserId
())
).
build
();
List
<
BaseUserMember
>
baseUserMembers
=
mapper
.
selectByExample
(
exa
);
BaseUserMember
baseUserMember
=
new
BaseUserMember
();
BeanUtilsBean
.
getInstance
().
copyProperties
(
baseUserMember
,
baseUserMemberVO
);
if
(
baseUserMembers
==
null
||
baseUserMembers
.
size
()==
0
)
{
baseUserMember
.
setCrtTime
(
System
.
currentTimeMillis
());
baseUserMember
.
setIsDel
(
0
);
baseUserMember
.
setPayCount
(
0
);
baseUserMember
.
setCardLeave
(
0
);
baseUserMember
.
setRecentRecharge
(
System
.
currentTimeMillis
());
insertSelective
(
baseUserMember
);
return
;
}
else
if
(
baseUserMembers
.
size
()==
1
){
baseUserMember
.
setUpdTime
(
System
.
currentTimeMillis
());
updateSelectiveById
(
baseUserMember
);
}
else
{
throw
new
BaseException
(
"Member purchase repeat!"
);
}
}
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserDetailMapper.java
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.dto.AppUserManageDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.
entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.
vo.AppUserManageVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
@@ -11,5 +12,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
...
@@ -11,5 +12,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
//查询用户信息
//查询用户信息
public
AppUserVo
getUserInfo
(
@Param
(
"userId"
)
Integer
userId
);
public
AppUserVo
getUserInfo
(
@Param
(
"userId"
)
Integer
userId
);
AppUser
Vo
selectAppUserManage
(
AppUserVo
appUserVo
);
AppUser
ManageVo
selectAppUserManage
(
AppUserManageDTO
appUserManageDTO
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUsersManageController.java
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserManageBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserManageBiz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserManageDTO
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.vo.AppUserManageVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
...
@@ -20,18 +23,18 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
...
@@ -20,18 +23,18 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
* @return
* @return
*/
*/
@GetMapping
(
"/findAll"
)
@GetMapping
(
"/findAll"
)
public
ObjectRestResponse
<
AppUser
Vo
>
findAllByQuery
(
@RequestBody
AppUserVo
appUserVo
){
public
ObjectRestResponse
<
AppUser
ManageVo
>
findAllByQuery
(
@RequestBody
AppUserManageDTO
appUserManageDTO
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUser
Vo
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUser
ManageDTO
));
}
}
/**
/**
*
删除
*
禁用
* @param id
* @param id
* @return
* @return
*/
*/
@DeleteMapping
(
"/deleteById/{id}"
)
@DeleteMapping
(
"/deleteById/{id}
/{isDel}
"
)
public
ObjectRestResponse
deleteById
(
@PathVariable
Integer
id
){
public
ObjectRestResponse
deleteById
(
@PathVariable
Integer
id
,
@PathVariable
Integer
isDel
){
baseBiz
.
deleteAppUser
(
id
);
baseBiz
.
deleteAppUser
(
id
,
isDel
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -45,6 +48,11 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
...
@@ -45,6 +48,11 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneById
(
id
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneById
(
id
));
}
}
/**
* 保存
* @param appUserVo
* @return
*/
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
public
ObjectRestResponse
save
(
@RequestBody
AppUserVo
appUserVo
){
public
ObjectRestResponse
save
(
@RequestBody
AppUserVo
appUserVo
){
baseBiz
.
save
(
appUserVo
);
baseBiz
.
save
(
appUserVo
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/BaseUserMemberController.java
0 → 100644
View file @
c30e336c
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.InvocationTargetException
;
/**
* 用户会员
* @author Administrator
*/
@RestController
@RequestMapping
(
"baseUserMember"
)
public
class
BaseUserMemberController
extends
BaseController
<
BaseUserMemberBiz
,
BaseUserMember
>
{
@RequestMapping
(
"/findOne/{userId}"
)
public
ObjectRestResponse
<
AppUserManage
>
findOneByUserId
(
@PathVariable
Integer
userId
){
BaseUserMember
oneByUserId
=
baseBiz
.
findOneByUserId
(
userId
);
if
(
oneByUserId
==
null
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
succ
(
oneByUserId
);
}
/**
* 设置用户会员
* @param baseUserMemberVO
* @return
*/
@PostMapping
(
"/setUserMember"
)
public
ObjectRestResponse
setUserMember
(
@RequestBody
BaseUserMemberVO
baseUserMemberVO
)
throws
InvocationTargetException
,
IllegalAccessException
{
baseBiz
.
setUserMember
(
baseUserMemberVO
);
return
ObjectRestResponse
.
succ
();
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
c30e336c
...
@@ -32,85 +32,69 @@
...
@@ -32,85 +32,69 @@
where d.userid = #{userId} limit 1
where d.userid = #{userId} limit 1
</select>
</select>
<select
id=
"selectAppUserManage"
parameterType=
"Integer"
resultMap=
"AppUserVoMap"
>
<select
id=
"selectAppUserManage"
parameterType=
"com.github.wxiaoqi.security.admin.dto.AppUserManageDTO"
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
resultType=
"com.github.wxiaoqi.security.admin.vo.AppUserManageVo"
>
left join app_user_detail d
select
on d.userid = l.id where 1=1
d.userid,
d.channel,
<if
test=
"id != null"
>
d.is_member,
and d.id =#{id}
d.realname,
</if>
d.isdel,
d.nickname,
<if
test=
"userid != null"
>
d.source,
and d.userid = #{userId}
d.Inviter_account,
</if>
d.address,
d.sex,
<if
test=
"username != null"
>
d.email,
and l.username=#{username}
l.username,
</if>
l.certification_status,
l.id_number,
l.createtime,
<if
test=
"imUserd != null"
>
l.last_time,
and l.im_userid=#{imUserid}
m.member_level,
</if>
m.valid_time,
m.buy_count,
<if
test=
"wxOpenid != null"
>
m.total_number,
and l.wx_openid=#{wxOpenid}
m.rent_free_days,
</if>
m.crt_time AS timeOfMembership,
m.recent_recharge,
<if
test=
"unionid != null"
>
m.name as memberName
and l.unionid=#{unionid}
from
</if>
app_user_login l
left join
<if
test=
"openid != null"
>
app_user_detail d
and l.openid=#{openid}
on d.userid = l.id
</if>
left join
(
<if
test=
"status != null"
>
select
and l.status=#{status}
b.*,
</if>
ml.name
from
<if
test=
"idNumber != null"
>
base_user_member b
and l.id_number=#{idNumber}
left join
</if>
base_user_member_level ml
on
<if
test=
"certificationStatus != null"
>
ml.id = b.member_level
and l.certification_status=#{certificationStatus}
) m
</if>
on
l.id = m.user_id
<if
test=
"isMember != null"
>
where 1=1
and d.is member=#{isMember}
</if>
<if
test=
"mobile !=null || mobile ! = ''"
>
and l.username=#{mobile}
<if
test=
"nickname != null"
>
</if>
and d.nickname=#{nickname}
<if
test=
"channel !=null || channel != ''"
>
</if>
and d.channel=#{channel}
</if>
<if
test=
"realname != null"
>
<if
test=
"memberLevel !=null || memberLevel != ''"
>
and d.realname=#{realname}
and m.member_level = #{memberLevel}
</if>
</if>
<if
test=
"registrationTimeBegin !=null || registrationTimeBegin != ''"
>
<if
test=
"email != null"
>
and l.createtime
>
= #{registrationTimeBegin}
and d.email=#{email}
</if>
</if>
<if
test=
"registrationTimeEnd!=null || registrationTimeEnd != ''"
>
and l.createtime
<
= #{registrationTimeEn}
<if
test=
"sex != null"
>
</if>
and d.sex=#{sex}
</if>
<if
test=
"birthday != null"
>
and d.birthday=#{birthday}
</if>
<if
test=
"personSign != null"
>
and d.person_sign=#{personSign}
</if>
<if
test=
"remark != null"
>
and d.remark=#{remark}
</if>
</select>
</select>
...
...
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/utils/UploadUtil.java
0 → 100644
View file @
c30e336c
//package com.xxfc.platform.app.utils;
//
//import lombok.extern.slf4j.Slf4j;
//
//import java.io.*;
//import java.net.*;
//import java.util.Map;
//import java.util.UUID;
//@Slf4j
//public class UploadUtil {
//
//
// public static final String TAG = UploadUtil.class.getName();
//
// private static final String CHARSET = "utf-8"; // 设置编码
// private static final int TIME_OUT = 8*1000;
// public static String result = null;
// /**
// * Android上传文件到服务端
// *
// * @param file 需要上传的文件
// * @param RequestURL 请求的url
// * @return 返回响应的内容
// */
// public static String uploadFile(final File file, final String RequestURL) {
//
//// Thread thread = new Thread(new Runnable() {
//// @Override
//// public void run() {
// String result = null;
// String BOUNDARY = UUID.randomUUID().toString(); // 边界标识 随机生成
// String PREFIX = "--", LINE_END = "\r\n";
// String CONTENT_TYPE = "multipart/form-data"; // 内容类型
// try {
// URL url = new URL(RequestURL);
// HttpURLConnection conn = (HttpURLConnection) url.openConnection();
//
// conn.setReadTimeout(TIME_OUT);
// conn.setConnectTimeout(TIME_OUT);
// conn.setDoInput(true); // 允许输入流
// conn.setDoOutput(true); // 允许输出流
// conn.setUseCaches(false); // 不允许使用缓存
// conn.setRequestMethod("POST"); // 请求方式
// conn.setRequestProperty("Charset", CHARSET); // 设置编码
// conn.setRequestProperty("connection", "keep-alive");
// conn.setRequestProperty("Content-Type", CONTENT_TYPE + ";boundary=" + BOUNDARY);
//
//
// if (file != null) {
// /**
// * 当文件不为空,把文件包装并且上传
// */
// DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
// StringBuffer sb = new StringBuffer();
// sb.append(PREFIX);
// sb.append(BOUNDARY);
// sb.append(LINE_END);
// /**
// * 这里重点注意: name里面的值为服务端需要key 只有这个key 才可以得到对应的文件
// * filename是文件的名字,包含后缀名的 比如:abc.png
// */
//
// sb.append("Content-Disposition: form-data; name=\"upload\"; filename=\""
// + file.getName() + "\"" + LINE_END);
// sb.append("Content-Type: application/octet-stream; charset=" + CHARSET + LINE_END);
// sb.append(LINE_END);
// dos.write(sb.toString().getBytes());
// InputStream is = new FileInputStream(file);
// byte[] bytes = new byte[1024];
// int len = 0;
// while ((len = is.read(bytes)) != -1) {
// dos.write(bytes, 0, len);
// }
// is.close();
// dos.write(LINE_END.getBytes());
// byte[] end_data = (PREFIX + BOUNDARY + PREFIX + LINE_END).getBytes();
// dos.write(end_data);
// dos.flush();
// /**
// * 获取响应码 200=成功 当响应成功,获取响应的流
// */
// int res = conn.getResponseCode();
// LOG.i(TAG, "response code:" + res);
// if(res==200)
// {
// LOG.i(TAG, "request success");
// InputStream input = conn.getInputStream();
// StringBuffer sb1 = new StringBuffer();
// int ss;
// while ((ss = input.read()) != -1) {
// sb1.append((char) ss);
// }
// result = sb1.toString();
// UploadUtil.result = new String(result.getBytes("iso-8859-1"),"utf-8");
// LOG.i(TAG, "result : " + UploadUtil.result);
// input.close();
// }
// else{
// LOG.e(TAG, "request error");
// }
//
// }
// } catch (MalformedURLException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// } catch (ProtocolException e) {
// e.printStackTrace();
// } catch (MalformedURLException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
//
//// }
//// });
//// thread.start();
// LOG.i(TAG, "---"+UploadUtil.result+"---");
// return UploadUtil.result;
// }
//
//
// /**
// * 通过拼接的方式构造请求内容,实现参数传输以及文件传输
// *
// * @param url Service net address
// * @param params text content
// * @param files pictures
// * @return String result of Service response
// * @throws IOException
// */
// public static String post(String url, Map<String, String> params, Map<String, File> files)
// throws IOException {
// String BOUNDARY = java.util.UUID.randomUUID().toString();
// String PREFIX = "--", LINEND = "\r\n";
// String MULTIPART_FROM_DATA = "multipart/form-data";
// String CHARSET = "UTF-8";
//
//
// URL uri = new URL(url);
// HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
// conn.setReadTimeout(10 * 1000); // 缓存的最长时间
// conn.setDoInput(true);// 允许输入
// conn.setDoOutput(true);// 允许输出
// conn.setUseCaches(false); // 不允许使用缓存
// conn.setRequestMethod("POST");
// conn.setRequestProperty("connection", "keep-alive");
// conn.setRequestProperty("Charsert", "UTF-8");
// conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA + ";boundary=" + BOUNDARY);
//
//
// // 首先组拼文本类型的参数
// StringBuilder sb = new StringBuilder();
// for (Map.Entry<String, String> entry : params.entrySet()) {
// sb.append(PREFIX);
// sb.append(BOUNDARY);
// sb.append(LINEND);
// sb.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"" + LINEND);
// sb.append("Content-Type: text/plain; charset=" + CHARSET + LINEND);
// sb.append("Content-Transfer-Encoding: 8bit" + LINEND);
// sb.append(LINEND);
// sb.append(entry.getValue());
// sb.append(LINEND);
// }
//
//
// DataOutputStream outStream = new DataOutputStream(conn.getOutputStream());
// outStream.write(sb.toString().getBytes());
// // 发送文件数据
// if (files != null)
// for (Map.Entry<String, File> file : files.entrySet()) {
// StringBuilder sb1 = new StringBuilder();
// sb1.append(PREFIX);
// sb1.append(BOUNDARY);
// sb1.append(LINEND);
// sb1.append("Content-Disposition: form-data; name=\"upload\"; filename=\""
// + file.getValue().getName() + "\"" + LINEND);
// sb1.append("Content-Type: application/octet-stream; charset=" + CHARSET + LINEND);
// sb1.append(LINEND);
// outStream.write(sb1.toString().getBytes());
//
//
// InputStream is = new FileInputStream(file.getValue());
// byte[] buffer = new byte[1024];
// int len = 0;
// while ((len = is.read(buffer)) != -1) {
// outStream.write(buffer, 0, len);
// }
//
//
// is.close();
// outStream.write(LINEND.getBytes());
// }
//
//
// // 请求结束标志
// byte[] end_data = (PREFIX + BOUNDARY + PREFIX + LINEND).getBytes();
// outStream.write(end_data);
// outStream.flush();
// // 得到响应码
// int res = conn.getResponseCode();
// InputStream in = conn.getInputStream();
// StringBuilder sb2 = new StringBuilder();
// if (res == 200) {
// int ch;
// while ((ch = in.read()) != -1) {
// sb2.append((char) ch);
// }
// }
// outStream.close();
// conn.disconnect();
// return sb2.toString();
// }
//
//}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
app
.
biz
;
package
com
.
xxfc
.
platform
.
app
.
biz
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
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.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.stereotype.Service
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.mapper.AppVersionMapper
;
import
com.xxfc.platform.app.mapper.AppVersionMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Transactional
;
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.multipart.MultipartFile
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
/**
/**
*
*
...
@@ -22,6 +46,13 @@ import java.util.List;
...
@@ -22,6 +46,13 @@ import java.util.List;
@Service
@Service
public
class
AppVersionBiz
extends
BaseBiz
<
AppVersionMapper
,
AppVersion
>
{
public
class
AppVersionBiz
extends
BaseBiz
<
AppVersionMapper
,
AppVersion
>
{
@Value
(
"${app.uploadPath}"
)
private
String
uploadPath
;
@Autowired
private
RedisTemplate
redisTemplate
;
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
ObjectRestResponse
getVersion
(
String
version
,
Integer
type
){
public
ObjectRestResponse
getVersion
(
String
version
,
Integer
type
){
if
(
StringUtils
.
isBlank
(
version
)||
type
==
null
){
if
(
StringUtils
.
isBlank
(
version
)||
type
==
null
){
...
@@ -49,4 +80,79 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
...
@@ -49,4 +80,79 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
public
RestResponse
uploadDrivingLicense
(
MultipartFile
file
)
throws
IOException
{
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
File
.
separator
+
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(1L)){
// redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
// }
String
fileName
=
file
.
getOriginalFilename
();
String
realFileRelPath
=
dirPathToday
+
File
.
separator
+
fileName
.
substring
(
fileName
.
lastIndexOf
(
"/"
));
String
filePath
=
uploadPath
+
realFileRelPath
;
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
return
RestResponse
.
suc
(
filePath
);
}
/**
* 下载行驶证图片
* @param realFileRelPath
* @return
* @throws Exception
*/
public
ResponseEntity
<
byte
[]>
downloadInstallationPackage
(
String
realFileRelPath
)
throws
Exception
{
String
filePath
=
uploadPath
+
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
);
}
/**
* 添加版本信息
* @param appVersion
*/
@Transactional
public
void
insertAppVersion
(
AppVersion
appVersion
)
{
appVersion
.
setDownloadSwitch
(
0
);
insertSelective
(
appVersion
);
}
public
AppVersion
get
(
Integer
id
)
{
if
(
id
==
null
)
{
throw
new
IllegalArgumentException
(
"Parameter is null"
);
}
return
selectById
(
id
);
}
/**
* 修改一条信息
* @param appVersion
*/
@Transactional
public
void
updateAppVersionById
(
AppVersion
appVersion
)
{
updateSelectiveById
(
appVersion
);
}
/**
* 删除
* @param id
*/
public
void
remove
(
Integer
id
)
{
AppVersion
appVersion
=
new
AppVersion
();
appVersion
.
setIsDel
(
1
);
Example
example
=
Example
.
builder
(
AppVersion
.
class
)
.
where
(
WeekendSqls
.<
AppVersion
>
custom
().
andEqualTo
(
AppVersion:
:
getId
,
id
))
.
build
();
mapper
.
updateByExampleSelective
(
appVersion
,
example
);
}
}
}
\ No newline at end of file
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppHomeController.java
View file @
c30e336c
...
@@ -2,17 +2,15 @@ package com.xxfc.platform.app.rest;
...
@@ -2,17 +2,15 @@ package com.xxfc.platform.app.rest;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
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.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.xxfc.platform.app.biz.CofigBiz
;
import
com.xxfc.platform.app.biz.CofigBiz
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.campsite.feign.CampsiteFeign
;
import
com.xxfc.platform.campsite.feign.CampsiteFeign
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -35,6 +33,11 @@ public class AppHomeController extends BaseController<CofigBiz,Cofig> {
...
@@ -35,6 +33,11 @@ public class AppHomeController extends BaseController<CofigBiz,Cofig> {
@Autowired
@Autowired
TourFeign
tourFeign
;
TourFeign
tourFeign
;
@Autowired
VehicleFeign
vehicleFeign
;
@RequestMapping
(
value
=
"/app/unauth/goodList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/unauth/goodList"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
List
<
GoodDataVO
>>
goodList
(
public
ObjectRestResponse
<
List
<
GoodDataVO
>>
goodList
(
...
@@ -47,6 +50,8 @@ public class AppHomeController extends BaseController<CofigBiz,Cofig> {
...
@@ -47,6 +50,8 @@ public class AppHomeController extends BaseController<CofigBiz,Cofig> {
list
=
tourFeign
.
goodList
(
page
,
limit
);
list
=
tourFeign
.
goodList
(
page
,
limit
);
}
else
if
(
type
==
3
){
}
else
if
(
type
==
3
){
list
=
campsiteFeign
.
goodList
(
page
,
limit
);
list
=
campsiteFeign
.
goodList
(
page
,
limit
);
}
else
if
(
type
==
4
){
list
=
vehicleFeign
.
goodList
(
page
,
limit
);
}
}
return
new
ObjectRestResponse
<>().
rel
(
true
).
data
(
list
);
return
new
ObjectRestResponse
<>().
rel
(
true
).
data
(
list
);
}
}
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppVersionController.java
View file @
c30e336c
...
@@ -9,14 +9,24 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
...
@@ -9,14 +9,24 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import
com.xxfc.platform.app.biz.AppVersionBiz
;
import
com.xxfc.platform.app.biz.AppVersionBiz
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Delete
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -24,7 +34,9 @@ import java.util.List;
...
@@ -24,7 +34,9 @@ import java.util.List;
@RequestMapping
(
"version"
)
@RequestMapping
(
"version"
)
@IgnoreClientToken
@IgnoreClientToken
public
class
AppVersionController
extends
BaseController
<
AppVersionBiz
,
AppVersion
>
{
public
class
AppVersionController
extends
BaseController
<
AppVersionBiz
,
AppVersion
>
{
//最大上传500MB
private
Long
MAX_DRIVING_LICENSE_SIZE
=
1024
*
1024
*
500L
;
private
int
id
;
@ApiModelProperty
(
"app自动更新"
)
@ApiModelProperty
(
"app自动更新"
)
@RequestMapping
(
value
=
"/app/unauth/info"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/unauth/info"
,
method
=
RequestMethod
.
GET
)
...
@@ -36,4 +48,63 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
...
@@ -36,4 +48,63 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
return
baseBiz
.
getVersion
(
version
,
type
);
return
baseBiz
.
getVersion
(
version
,
type
);
}
}
@Override
@ApiOperation
(
"添加"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
AppVersion
>
add
(
@RequestBody
AppVersion
appVersion
){
baseBiz
.
insertAppVersion
(
appVersion
);
return
new
ObjectRestResponse
<
AppVersion
>();
}
@ApiOperation
(
"查询"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
AppVersion
>
get
(
@PathVariable
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
get
(
id
));
}
@Override
@ApiOperation
(
"修改"
)
@RequestMapping
(
value
=
"/update/{id}"
,
method
=
RequestMethod
.
PUT
)
public
ObjectRestResponse
<
AppVersion
>
update
(
@RequestBody
AppVersion
appVersion
){
baseBiz
.
updateAppVersionById
(
appVersion
);
return
new
ObjectRestResponse
<
AppVersion
>();
}
@ApiOperation
(
"删除"
)
@DeleteMapping
(
value
=
"/remove/{id}"
)
public
ObjectRestResponse
<
AppVersion
>
remove
(
@PathVariable
Integer
id
){
baseBiz
.
remove
(
id
);
return
new
ObjectRestResponse
<
AppVersion
>();
}
@PostMapping
(
value
=
"/upload/installationPackage"
)
@ApiOperation
(
value
=
"上传app安装包"
)
public
RestResponse
uploadInstallationPackage
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
Assert
.
notNull
(
file
);
String
contentType
=
file
.
getContentType
();
//文件类型
//// String fileName = file.getOriginalFilename(); //文件名
if
(!
contentType
.
equals
(
"apk"
)
&&
!
contentType
.
equals
(
"ipa"
))
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
if
(
file
.
getSize
()
>
MAX_DRIVING_LICENSE_SIZE
)
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
baseBiz
.
uploadDrivingLicense
(
file
);
}
@IgnoreUserToken
@GetMapping
(
value
=
"/download/installationPackage/{realFileRelPath}"
)
//匹配的是href中的download请求
@ApiOperation
(
value
=
"下载app安装包"
)
public
ResponseEntity
<
byte
[]>
downloadInstallationPackage
(
@RequestParam
(
"realFileRelPath"
)
String
realFileRelPath
)
throws
Exception
{
return
baseBiz
.
downloadInstallationPackage
(
realFileRelPath
);
}
}
}
\ No newline at end of file
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/BaseAuthentication.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
universal
.
api
;
import
com.xxfc.platform.universal.api.pojo.Authentication
;
import
com.xxfc.platform.universal.entity.IdInformation
;
/**
* 调用外部接口实现类。调用不同的外部接口,需要编写不同了类实现该类
*/
public
interface
BaseAuthentication
{
Authentication
getAuthentication
(
IdInformation
idInformation
);
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/impl/FQAuthentication.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
universal
.
api
.
impl
;
import
com.xxfc.platform.universal.api.BaseAuthentication
;
import
com.xxfc.platform.universal.api.pojo.Authentication
;
import
com.xxfc.platform.universal.entity.IdInformation
;
public
class
FQAuthentication
implements
BaseAuthentication
{
@Override
public
Authentication
getAuthentication
(
IdInformation
idInformation
)
{
return
null
;
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/pojo/Authentication.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
universal
.
api
.
pojo
;
public
class
Authentication
{
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/RedisKey.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
universal
.
constant
;
package
com
.
xxfc
.
platform
.
universal
.
constant
;
public
class
RedisKey
{
public
class
RedisKey
{
/**
/**
...
@@ -94,4 +97,5 @@ public class RedisKey {
...
@@ -94,4 +97,5 @@ public class RedisKey {
public
static
final
String
CACHE_DICTIONARY_ALL
=
CACHE_DICTIONARY_PREFIX
+
"all:"
;
public
static
final
String
CACHE_DICTIONARY_ALL
=
CACHE_DICTIONARY_PREFIX
+
"all:"
;
public
static
final
String
CACHE_DICTIONARY_ALL_MAP
=
CACHE_DICTIONARY_ALL
+
"map:"
;
public
static
final
String
CACHE_DICTIONARY_ALL_MAP
=
CACHE_DICTIONARY_ALL
+
"map:"
;
public
static
final
String
ILLEGAL_VEHICLE_ENQUIRIES
=
"cache:violation"
;
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/IdInformation.java
View file @
c30e336c
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.universal.entity;
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.universal.entity;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
@@ -12,8 +11,6 @@ import javax.persistence.GeneratedValue;
...
@@ -12,8 +11,6 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/ThirdFeign.java
View file @
c30e336c
...
@@ -57,7 +57,6 @@ public interface ThirdFeign {
...
@@ -57,7 +57,6 @@ public interface ThirdFeign {
@GetMapping
(
"/LicensePlateType"
)
@GetMapping
(
"/LicensePlateType"
)
ObjectRestResponse
getLicensePlateType
();
ObjectRestResponse
getLicensePlateType
();
/***************************************** 数据字典 ********************************************/
/***************************************** 数据字典 ********************************************/
...
@@ -65,7 +64,7 @@ public interface ThirdFeign {
...
@@ -65,7 +64,7 @@ public interface ThirdFeign {
@RequestMapping
(
value
=
"/dictionary/getParents"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/dictionary/getParents"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGetParent
(
@RequestParam
(
value
=
"type"
)
String
type
);
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGetParent
(
@RequestParam
(
value
=
"type"
)
String
type
);
// @GetMapping(value = "/dictionary/get")
// @GetMapping(value = "/dictionary/get")
@RequestMapping
(
value
=
"/dictionary/get"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/dictionary/get"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGet
(
@RequestParam
(
value
=
"dictionary"
)
Map
<
String
,
Object
>
dictionary
);
public
ObjectRestResponse
<
List
<
Dictionary
>>
dictionaryGet
(
@RequestParam
(
value
=
"dictionary"
)
Map
<
String
,
Object
>
dictionary
);
...
@@ -77,4 +76,5 @@ public interface ThirdFeign {
...
@@ -77,4 +76,5 @@ public interface ThirdFeign {
@GetMapping
(
"/3p/tv/getRentViolation"
)
@GetMapping
(
"/3p/tv/getRentViolation"
)
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
@RequestParam
(
value
=
"rentViolationDTO"
)
Map
<
String
,
Object
>
rentViolationDTO
);
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
@RequestParam
(
value
=
"rentViolationDTO"
)
Map
<
String
,
Object
>
rentViolationDTO
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/TrafficViolationsController.java
View file @
c30e336c
...
@@ -2,21 +2,24 @@ package com.xxfc.platform.universal.controller;
...
@@ -2,21 +2,24 @@ 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.service.TrafficViolationsService
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
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
com.xxfc.platform.universal.vo.ViolationVO
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
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
@RequestMapping
(
"3p/tv"
)
@RequestMapping
(
"3p/tv"
)
public
class
TrafficViolationsController
{
public
class
TrafficViolationsController
{
@Autowired
private
VehicleFeign
vehicleFeign
;
@Autowired
@Autowired
TrafficViolationsService
tvService
;
TrafficViolationsService
tvService
;
...
@@ -64,10 +67,17 @@ public class TrafficViolationsController {
...
@@ -64,10 +67,17 @@ public class TrafficViolationsController {
@GetMapping
(
"/getRentViolation"
)
@GetMapping
(
"/getRentViolation"
)
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
RentViolationDTO
rentViolationDTO
)
{
public
ObjectRestResponse
<
List
<
ViolationVO
>>
getRentViolation
(
RentViolationDTO
rentViolationDTO
)
{
return
ObjectRestResponse
.
succ
(
new
ArrayList
<
ViolationVO
>(){{
String
vehicleId
=
rentViolationDTO
.
getVehicleId
();
add
(
new
ViolationVO
(){{
setPrice
(
new
BigDecimal
(
"100.00"
));}});
if
(
rentViolationDTO
==
null
||
rentViolationDTO
.
getVehicleId
()==
null
)
{
add
(
new
ViolationVO
(){{
setPrice
(
new
BigDecimal
(
"200.00"
));}});
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"Vehicle information is empty"
);
}});
}
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
));
}
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/TrafficViolationsService.java
View file @
c30e336c
...
@@ -3,9 +3,12 @@ package com.xxfc.platform.universal.service;
...
@@ -3,9 +3,12 @@ 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.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
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.vehicle.entity.Vehicle
;
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
;
...
@@ -14,6 +17,7 @@ import org.apache.http.util.EntityUtils;
...
@@ -14,6 +17,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
;
...
@@ -60,6 +64,9 @@ public class TrafficViolationsService {
...
@@ -60,6 +64,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
;
/**
/**
* 支持查询的城市
* 支持查询的城市
...
@@ -209,4 +216,18 @@ public class TrafficViolationsService {
...
@@ -209,4 +216,18 @@ public class TrafficViolationsService {
licensePlateTypeBiz
.
insertLicensePlateType
(
finalLicensePlateTypes
);
licensePlateTypeBiz
.
insertLicensePlateType
(
finalLicensePlateTypes
);
}
}
/**
* 订单完成后调用接口获取车辆信息
* @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
;
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/UploadService.java
View file @
c30e336c
...
@@ -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
;
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/AccompanyingItem.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
lombok.Data
;
import
lombok.Data
;
import
tk.mybatis.mapper.annotation.KeySql
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
feign
;
package
com
.
xxfc
.
platform
.
vehicle
.
feign
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
...
@@ -63,4 +64,13 @@ public interface VehicleFeign {
...
@@ -63,4 +64,13 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/user/license/company/getOne"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/license/company/getOne"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
VehicleUserLicense
>
getOne
(
public
RestResponse
<
VehicleUserLicense
>
getOne
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
;
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
;
/**
* 获取优质车型接口
* @param page
* @param limit
* @return 返回
*/
@GetMapping
(
value
=
"/vehicleModel/goodList"
)
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
value
=
"page"
)
Integer
page
,
@RequestParam
(
"limit"
)
Integer
limit
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
c30e336c
...
@@ -126,6 +126,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
...
@@ -126,6 +126,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
* @throws Exception
* @throws Exception
*/
*/
public
ResponseEntity
<
byte
[]>
downloadDrivingLicense
(
String
realFileRelPath
)
throws
Exception
{
public
ResponseEntity
<
byte
[]>
downloadDrivingLicense
(
String
realFileRelPath
)
throws
Exception
{
String
filePath
=
baseUploadPath
+
realFileRelPath
;
String
filePath
=
baseUploadPath
+
realFileRelPath
;
File
file
=
new
File
(
filePath
);
//新建一个文件
File
file
=
new
File
(
filePath
);
//新建一个文件
HttpHeaders
headers
=
new
HttpHeaders
();
//http头信息
HttpHeaders
headers
=
new
HttpHeaders
();
//http头信息
...
@@ -152,7 +153,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
...
@@ -152,7 +153,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
params
.
put
(
"vehicle"
,
vehicle
);
params
.
put
(
"vehicle"
,
vehicle
);
params
.
put
(
"yearMonth"
,
yearMonth
);
params
.
put
(
"yearMonth"
,
yearMonth
);
List
<
VehicleBookInfo
>
vehicleBookInfoList
=
vehicleBookInfoMapper
.
getByVehicleIdAndYearMonth
(
params
);
List
<
VehicleBookInfo
>
vehicleBookInfoList
=
vehicleBookInfoMapper
.
getByVehicleIdAndYearMonth
(
params
);
return
CollectionUtils
.
isEmpty
(
vehicleBookInfoList
)?
null
:
vehicleBookInfoList
.
get
(
0
);
return
CollectionUtils
.
isEmpty
(
vehicleBookInfoList
)?
null
:
vehicleBookInfoList
.
get
(
0
);
}
}
/**
/**
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelBiz.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -12,7 +17,10 @@ import com.xxfc.platform.vehicle.mapper.VehicleModelMapper;
...
@@ -12,7 +17,10 @@ import com.xxfc.platform.vehicle.mapper.VehicleModelMapper;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -36,20 +44,19 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
...
@@ -36,20 +44,19 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
updateSelectiveById
(
model
);
updateSelectiveById
(
model
);
}
}
/**
* 分页查询车型列表
* @param vmqc
* @return
*/
public
ObjectRestResponse
findVehicleModelPage
(
VehicleModelQueryCondition
vmqc
)
{
public
ObjectRestResponse
findVehicleModelPage
(
VehicleModelQueryCondition
vmqc
)
{
// List<VehicleModelVo > vehicleModelPage = mapper.findVehicleModelPage(vmqc);
// log.debug("vehicleModelPage"+vehicleModelPage);
try
{
try
{
PageDataVO
<
VehicleModelVo
>
mPageDataVO
=
PageDataVO
.
pageInfo
(
vmqc
.
getPage
(),
PageDataVO
<
VehicleModelVo
>
mPageDataVO
=
PageDataVO
.
pageInfo
(
vmqc
.
getPage
(),
vmqc
.
getLimit
(),
()
->
mapper
.
findVehicleModelPage
(
vmqc
));
vmqc
.
getLimit
(),
()
->
mapper
.
findVehicleModelPage
(
vmqc
));
// List<VehicleModelVo> vehicleModelVos = mPageDataVO.getData();
// vehicleModelVos.parallelStream().forEach(vehicleModelVo -> vehicleModelVo.setPicture(vehicleModelVo.getPicture().split(",")[0]));
return
ObjectRestResponse
.
succ
(
mPageDataVO
);
return
ObjectRestResponse
.
succ
(
mPageDataVO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -85,4 +92,34 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
...
@@ -85,4 +92,34 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
public
void
updateByPrimaryKeySelective
(
VehicleModel
vm
){
public
void
updateByPrimaryKeySelective
(
VehicleModel
vm
){
mapper
.
updateByPrimaryKeySelective
(
vm
);
mapper
.
updateByPrimaryKeySelective
(
vm
);
}
}
/**
* 分页查询返回List<GoodDataVO>
* @param page
* @param limit
* @return
*/
public
List
<
GoodDataVO
>
goodList
(
Integer
page
,
Integer
limit
)
{
List
<
GoodDataVO
>
goodDataVOS
=
Arrays
.
asList
();
/*设置分页*/
Page
<
VehicleModel
>
pages
=
PageHelper
.
startPage
(
page
,
limit
);
Example
example
=
Example
.
builder
(
VehicleModel
.
class
)
.
where
(
WeekendSqls
.<
VehicleModel
>
custom
().
andEqualTo
(
VehicleModel:
:
getIsdel
,
0
)).
orderByDesc
(
"hot_sign"
).
build
();
selectByExample
(
example
);
PageInfo
<
VehicleModel
>
pageInfo
=
PageInfo
.
of
(
pages
.
getResult
());
List
<
VehicleModel
>
vehicleModelList
=
pageInfo
.
getList
();
/*遍历车型列表设置List<GoodDataVO>*/
for
(
VehicleModel
vm
:
vehicleModelList
)
{
GoodDataVO
goodDataVO
=
new
GoodDataVO
();
goodDataVO
.
setId
(
vm
.
getId
());
goodDataVO
.
setImgUrl
(
vm
.
getPicture
());
goodDataVO
.
setName
(
vm
.
getName
());
goodDataVO
.
setName1
(
vm
.
getKeyword
());
goodDataVO
.
setPrice
(
String
.
valueOf
(
vm
.
getBuyPrice
()));
goodDataVOS
.
add
(
goodDataVO
);
}
return
goodDataVOS
;
}
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelController.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
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.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
...
@@ -9,6 +10,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -9,6 +10,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleCataBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleCataBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleModelBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleModelBiz
;
...
@@ -37,6 +39,7 @@ import tk.mybatis.mapper.entity.Example;
...
@@ -37,6 +39,7 @@ import tk.mybatis.mapper.entity.Example;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.awt.print.Pageable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -93,28 +96,22 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -93,28 +96,22 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
* @return
* @return
*/
*/
@ApiOperation
(
"车型列表"
)
@ApiOperation
(
"车型列表"
)
@PostMapping
(
value
=
"/app/
find
VehicleModelPage"
)
@PostMapping
(
value
=
"/app/
unauthfind/
VehicleModelPage"
)
public
ObjectRestResponse
<
VehicleModelVo
>
findVehicleModelPage
(
public
ObjectRestResponse
<
VehicleModelVo
>
findVehicleModelPage
Unauthfind
(
@RequestBody
@ApiParam
(
"查询条件"
)
VehicleModelQueryCondition
vmqc
,
HttpServletRequest
request
)
{
@RequestBody
@ApiParam
(
"查询条件"
)
VehicleModelQueryCondition
vmqc
,
HttpServletRequest
request
)
{
// UserDTO user = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
//
// if (user!=null) {
// if (user.getDataAll()==2) {
//
// }
// }
if
(
vmqc
.
getIsDel
()==
null
)
{
if
(
vmqc
.
getIsDel
()==
null
)
{
vmqc
.
setIsDel
(
0
);
vmqc
.
setIsDel
(
0
);
}
}
if
(
vmqc
==
null
||
vmqc
.
getPage
()
==
null
||
vmqc
.
getLimit
()
==
null
||
vmqc
.
getPage
()
<
0
||
vmqc
.
getLimit
()
<=
0
)
{
if
(
vmqc
==
null
||
vmqc
.
getPage
()
==
null
||
vmqc
.
getLimit
()
==
null
||
vmqc
.
getPage
()
<
0
||
vmqc
.
getLimit
()
<=
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
return
vehicleModelBiz
.
findVehicleModelPage
(
vmqc
);
return
vehicleModelBiz
.
findVehicleModelPage
(
vmqc
);
}
}
/**
/**
* 添加车型
* 添加车型
*
*
...
@@ -124,7 +121,6 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -124,7 +121,6 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
*/
*/
@ApiOperation
(
"添加"
)
@ApiOperation
(
"添加"
)
@PostMapping
(
value
=
"/app/add"
)
@PostMapping
(
value
=
"/app/add"
)
@ResponseBody
@Transactional
@Transactional
public
ObjectRestResponse
<
VehicleModel
>
add
(
@RequestBody
VehicleModel
vm
,
HttpServletRequest
request
)
{
public
ObjectRestResponse
<
VehicleModel
>
add
(
@RequestBody
VehicleModel
vm
,
HttpServletRequest
request
)
{
if
(
vm
==
null
)
{
if
(
vm
==
null
)
{
...
@@ -156,6 +152,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -156,6 +152,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
//设置信息
//设置信息
vm
.
setCrtName
(
uorr
.
getData
().
getName
());
vm
.
setCrtName
(
uorr
.
getData
().
getName
());
vm
.
setCrtUser
(
uorr
.
getData
().
getId
());
vm
.
setCrtUser
(
uorr
.
getData
().
getId
());
vm
.
setHotSign
(
2
);
vm
.
setCrtTime
(
new
Date
());
vm
.
setCrtTime
(
new
Date
());
vm
.
setCrtHost
(
host
);
vm
.
setCrtHost
(
host
);
vm
.
setIsdel
(
0
);
vm
.
setIsdel
(
0
);
...
@@ -193,7 +190,6 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -193,7 +190,6 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@ApiOperation
(
"修改"
)
@ApiOperation
(
"修改"
)
@PutMapping
(
value
=
"/app/update"
)
@PutMapping
(
value
=
"/app/update"
)
@ResponseBody
@Transactional
@Transactional
public
ObjectRestResponse
<
VehicleModel
>
update
(
@RequestBody
VehicleModel
vm
,
HttpServletRequest
request
)
{
public
ObjectRestResponse
<
VehicleModel
>
update
(
@RequestBody
VehicleModel
vm
,
HttpServletRequest
request
)
{
...
@@ -252,26 +248,9 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -252,26 +248,9 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@Override
@Override
@ApiOperation
(
"删除"
)
@ApiOperation
(
"删除"
)
@DeleteMapping
(
value
=
"/app/{id}"
)
@DeleteMapping
(
value
=
"/app/{id}"
)
@ResponseBody
@Transactional
@Transactional
public
ObjectRestResponse
<
VehicleModel
>
remove
(
@PathVariable
int
id
)
{
public
ObjectRestResponse
<
VehicleModel
>
remove
(
@PathVariable
int
id
)
{
//1.先判断是否有属于该车型可用的车辆,有不能删除,无可以进行删除
//根据车型查询对应的车辆
// Example exa = Example.builder(Vehicle.class).where(
// WeekendSqls.<Vehicle>custom()
// .andEqualTo(Vehicle::getModelId, id)
// .andEqualTo(Vehicle::getStatus, 1)
// .orEqualTo(Vehicle::getStatus,"2")
// ).build();
//
// List<Vehicle> vehicles = vehicleBiz.selectByExample(exa);
//
// //判断是查询到对应的车辆
// if (vehicles != null) {
// ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "该车型,无法删除");
// }
if
(
id
==
1
||
id
==
14
)
{
if
(
id
==
1
||
id
==
14
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"The label cannot be deleted"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"The label cannot be deleted"
);
}
}
...
@@ -302,4 +281,34 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -302,4 +281,34 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
vehicleModel
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
vehicleModel
));
}
}
@ApiOperation
(
"查询所有"
)
@GetMapping
(
value
=
"/goodList"
)
public
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
"page"
)
Integer
page
,
@RequestParam
(
"limit"
)
Integer
limit
){
return
baseBiz
.
goodList
(
page
,
limit
);
}
/**
* 车型列表查
*
* @param vmqc 条件
* @return
*/
@ApiOperation
(
"车型列表"
)
@PostMapping
(
value
=
"/app/VehicleModelPage"
)
public
ObjectRestResponse
<
VehicleModelVo
>
findVehicleModelPage
(
@RequestBody
@ApiParam
(
"查询条件"
)
VehicleModelQueryCondition
vmqc
,
HttpServletRequest
request
)
{
if
(
vmqc
.
getIsDel
()==
null
)
{
vmqc
.
setIsDel
(
0
);
}
if
(
vmqc
==
null
||
vmqc
.
getPage
()
==
null
||
vmqc
.
getLimit
()
==
null
||
vmqc
.
getPage
()
<
0
||
vmqc
.
getLimit
()
<=
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
return
vehicleModelBiz
.
findVehicleModelPage
(
vmqc
);
}
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/ListTest.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
;
import
org.junit.Test
;
import
java.lang.reflect.Array
;
import
java.util.Arrays
;
import
java.util.List
;
public
class
ListTest
{
@Test
public
void
ListTest
(){
List
<
Object
>
objects
=
Arrays
.
asList
();
System
.
out
.
println
(
"objects.size()"
+
objects
.
get
(
0
));
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/TimeTest.java
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
;
package
com
.
xxfc
.
platform
.
vehicle
;
import
cn.hutool.core.date.DateUtil
;
import
com.xxfc.platform.vehicle.entity.SimpleGenId
;
import
cn.hutool.core.io.file.FileWriter
;
import
com.xxfc.platform.vehicle.entity.Student
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.xxfc.platform.vehicle.biz.SysRegionBiz
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
lombok.Data
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
={
VehicleApplication
.
class
})
@SpringBootTest
(
classes
={
VehicleApplication
.
class
})
...
@@ -48,22 +38,16 @@ public class TimeTest {
...
@@ -48,22 +38,16 @@ public class TimeTest {
}
}
@Test
public
void
testMapper
(){
Student
sOne
=
new
Student
(
"张4"
,
"14"
,
1
);
sOne
.
getId
();
// Assert.assertEquals();
SimpleGenId
simpleGenId
=
new
SimpleGenId
();
Long
aLong
=
simpleGenId
.
genId
(
"6696"
,
"122223"
);
}
}
@Data
class
Student
implements
Serializable
{
private
String
name
;
private
String
age
;
private
int
code
;
public
Student
(
String
name
,
String
age
,
int
code
)
{
this
.
name
=
name
;
this
.
age
=
age
;
this
.
code
=
code
;
}
public
Student
(
String
name
,
String
age
)
{
this
.
name
=
name
;
this
.
age
=
age
;
}
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/TimedTaskTest.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
;
import
org.junit.Test
;
import
org.springframework.core.task.TaskExecutor
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.TimeUnit
;
public
class
TimedTaskTest
{
public
static
void
main
(
String
[]
args
)
{
ScheduledExecutorService
executorService
=
Executors
.
newSingleThreadScheduledExecutor
();
executorService
.
scheduleWithFixedDelay
(
new
MyRunnable
(),
0
,
4000
,
TimeUnit
.
MILLISECONDS
);
}
// @Test
// public void fn1() {
// TaskExecutor taskExecutor = new TaskExecutor() {
// @Override
// public void execute(Runnable task) {
//
// ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
// executorService.scheduleAtFixedRate(
// () -> System.out.println("测试定时任务11111111111111" + System.currentTimeMillis()), 0, 100, TimeUnit.MILLISECONDS);
// System.out.println("========================================================================");
// executorService.schedule(new Runnable() {
// @Override
// public void run() {
// System.out.println("测试定时任务222222222222222222" + System.currentTimeMillis());
// }
// }, 10, TimeUnit.MILLISECONDS);
// }
// };
//
// }
private
static
class
MyRunnable
implements
Runnable
{
@Override
public
void
run
()
{
System
.
out
.
println
(
"测试+++++++++++"
+
System
.
currentTimeMillis
());
// ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
//
// executorService.scheduleWithFixedDelay(new Runnable() {
// @Override
// public void run() {
// System.out.println("测试+++++++"+System.currentTimeMillis());
// }
// },0,100,TimeUnit.MILLISECONDS);
}
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/entity/IdService.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
public
class
IdService
{
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/entity/SimpleGenId.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
tk.mybatis.mapper.genid.GenId
;
public
class
SimpleGenId
implements
GenId
<
Long
>
{
private
Long
time
;
private
Integer
seq
;
@Override
public
synchronized
Long
genId
(
String
table
,
String
column
)
{
long
current
=
System
.
currentTimeMillis
();
if
(
time
==
null
||
time
!=
current
)
{
time
=
current
;
seq
=
1
;
}
else
if
(
current
==
time
)
{
seq
++;
}
return
(
time
<<
20
)
|
seq
;
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/entity/Student.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
com.xxfc.platform.vehicle.entity.UUIdGenId
;
import
lombok.Data
;
import
tk.mybatis.mapper.annotation.KeySql
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
@Data
public
class
Student
implements
Serializable
{
public
static
final
Integer
NO_AMOUNT_LIMIT
=
-
1
;
@Id
@KeySql
(
genId
=
UUIdGenId
.
class
)
private
Integer
id
;
private
String
name
;
private
String
age
;
private
int
code
;
public
Student
(
String
name
,
String
age
,
int
code
)
{
this
.
name
=
name
;
this
.
age
=
age
;
this
.
code
=
code
;
}
public
Student
(
String
name
,
String
age
)
{
this
.
name
=
name
;
this
.
age
=
age
;
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/entity/UUIdGenId.java
0 → 100644
View file @
c30e336c
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
tk.mybatis.mapper.genid.GenId
;
import
java.util.UUID
;
public
class
UUIdGenId
implements
GenId
{
@Override
public
Object
genId
(
String
table
,
String
column
)
{
return
UUID
.
randomUUID
().
toString
();
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/entity/VestaGenId.java
0 → 100644
View file @
c30e336c
//package com.xxfc.platform.vehicle.entity;
//import tk.mybatis.mapper.genid.GenId;
//
//public class VestaGenId implements GenId<Long> {
// public Long genId(String table, String column){
// //ApplicationUtil.getBean 需要自己实现
// IdService idService = ApplicationUtil.getBean(IdService.class);
// return idService.genId();
// }
//}
\ 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