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
983ddc5b
Commit
983ddc5b
authored
Sep 29, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into master-bug
parents
25963689
b2269615
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
550 additions
and
35 deletions
+550
-35
AppUserPositionTempDTO.java
...ub/wxiaoqi/security/admin/dto/AppUserPositionTempDTO.java
+31
-0
AppUserPositionTempFindDTO.java
...xiaoqi/security/admin/dto/AppUserPositionTempFindDTO.java
+17
-0
AppUserPositionTemp.java
...ub/wxiaoqi/security/admin/entity/AppUserPositionTemp.java
+61
-0
AppUserPositionTempVo.java
...thub/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
+40
-0
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+1
-1
AppUserPositionBiz.java
...github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
+20
-3
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+232
-0
BaseUserMemberExportBiz.java
...b/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
+35
-7
AppUserPositionMapper.java
.../wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
+2
-4
AppUserPositionTempMapper.java
...aoqi/security/admin/mapper/AppUserPositionTempMapper.java
+20
-0
AppUserPositionController.java
.../security/admin/rest/admin/AppUserPositionController.java
+68
-12
TourGoodMapper.xml
...-tour-server/src/main/resources/mapper/TourGoodMapper.xml
+1
-1
CompanySearchDTO.java
...java/com/xxfc/platform/vehicle/pojo/CompanySearchDTO.java
+3
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+1
-1
BranchCompanyMapper.java
...com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
+1
-1
VehicleModelController.java
...om/xxfc/platform/vehicle/rest/VehicleModelController.java
+8
-5
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+9
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserPositionTempDTO.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/23 16:51
*/
@Builder
(
toBuilder
=
true
)
@Data
public
class
AppUserPositionTempDTO
{
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"手机号码"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"职位id"
)
private
Integer
positionId
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserPositionTempFindDTO.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/23 18:36
*/
@Data
public
class
AppUserPositionTempFindDTO
extends
PageParam
{
private
String
phone
;
private
String
name
;
private
Integer
status
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserPositionTemp.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
* 用户身份职位临时表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
*/
@Data
@Table
(
name
=
"app_user_position_temp"
)
public
class
AppUserPositionTemp
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userId
;
@Column
(
name
=
"phone"
)
@ApiModelProperty
(
value
=
"手机号码"
)
private
String
phone
;
@Column
(
name
=
"position_id"
)
@ApiModelProperty
(
value
=
"职位id"
)
private
Integer
positionId
;
@Column
(
name
=
"name"
)
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
private
Integer
isDel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/9/23 18:38
*/
@Builder
(
toBuilder
=
true
)
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
AppUserPositionTempVo
{
private
Integer
id
;
@ApiModelProperty
(
value
=
"手机号码"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"职位名"
)
private
String
positionName
;
private
Integer
positionId
;
@ApiModelProperty
(
value
=
"数据状态 1:已核销 2:未核销"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
983ddc5b
...
@@ -232,7 +232,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -232,7 +232,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
List
<
AppUserLogin
>
appUserLogins
=
mapper
.
selectbyPhones
(
phones
);
List
<
AppUserLogin
>
appUserLogins
=
mapper
.
selectbyPhones
(
phones
);
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
null
;
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
))
{
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
))
{
phoneAndUserIdMap
=
appUserLogins
.
s
tream
().
collect
(
Collectors
.
toMap
(
AppUserLogin:
:
getUsername
,
AppUserLogin:
:
getId
));
phoneAndUserIdMap
=
appUserLogins
.
parallelS
tream
().
collect
(
Collectors
.
toMap
(
AppUserLogin:
:
getUsername
,
AppUserLogin:
:
getId
));
}
}
return
phoneAndUserIdMap
;
return
phoneAndUserIdMap
;
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
View file @
983ddc5b
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.biz;
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.vo.WalletPostionVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletPostionVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.jsoup.select.Collector
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -11,9 +12,10 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserPositionMapper;
...
@@ -11,9 +12,10 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserPositionMapper;
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
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* 用户身份职位表
* 用户身份职位表
...
@@ -23,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger;
...
@@ -23,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* @date 2019-07-09 10:00:42
* @date 2019-07-09 10:00:42
*/
*/
@Transactional
@Transactional
@Service
@Service
(
"appUserPositionBiz"
)
public
class
AppUserPositionBiz
extends
BaseBiz
<
AppUserPositionMapper
,
AppUserPosition
>
{
public
class
AppUserPositionBiz
extends
BaseBiz
<
AppUserPositionMapper
,
AppUserPosition
>
{
...
@@ -58,4 +60,19 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
...
@@ -58,4 +60,19 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
}
}
return
counter
.
get
();
return
counter
.
get
();
}
}
public
Map
<
Integer
,
AppUserPosition
>
findPostionIdAndPostionMapByIds
(
List
<
Integer
>
postionIds
)
{
Map
<
Integer
,
AppUserPosition
>
postionMap
=
new
HashMap
<>();
List
<
AppUserPosition
>
data
=
mapper
.
selectByIdList
(
postionIds
);
if
(
CollectionUtils
.
isEmpty
(
data
)){
return
postionMap
;
}
postionMap
=
data
.
stream
().
collect
(
Collectors
.
toMap
(
AppUserPosition:
:
getId
,
Function
.
identity
()));
return
postionMap
;
}
public
Map
<
Integer
,
String
>
findPostionIdAndNameMap
()
{
List
<
AppUserPosition
>
postions
=
selectListAll
();
return
postions
.
stream
().
collect
(
Collectors
.
toMap
(
AppUserPosition:
:
getId
,
AppUserPosition:
:
getName
));
}
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserPositionTempDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppUserPositionTempFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPosition
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserPositionTempMapper
;
import
com.github.wxiaoqi.security.admin.vo.AppUserPositionTempVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 用户身份职位表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
*/
@Transactional
@DependsOn
(
"appUserPositionBiz"
)
@Service
public
class
AppUserPositionTempBiz
extends
BaseBiz
<
AppUserPositionTempMapper
,
AppUserPositionTemp
>
implements
InitializingBean
{
@Autowired
private
AppUserDetailBiz
detailBiz
;
@Autowired
private
AppUserLoginBiz
loginBiz
;
@Autowired
private
AppUserPositionBiz
appUserPositionBiz
;
private
Map
<
Integer
,
String
>
postionIdAndNameMap
;
public
ObjectRestResponse
add
(
AppUserPositionTempDTO
appUserPositionTempDTO
)
{
if
(
appUserPositionTempDTO
==
null
||
StringUtils
.
isBlank
(
appUserPositionTempDTO
.
getPhone
())
||
StringUtils
.
isBlank
(
appUserPositionTempDTO
.
getName
())
||
appUserPositionTempDTO
.
getPositionId
()
==
null
||
appUserPositionTempDTO
.
getPositionId
()
==
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"参数不能为空"
);
}
String
phone
=
appUserPositionTempDTO
.
getPhone
();
Integer
id
=
appUserPositionTempDTO
.
getId
()
==
null
?
0
:
appUserPositionTempDTO
.
getId
();
Example
example
=
new
Example
(
AppUserPositionTemp
.
class
);
example
.
createCriteria
().
andEqualTo
(
"phone"
,
phone
).
andNotEqualTo
(
"id"
,
id
).
andEqualTo
(
"isDel"
,
0
);
List
<
AppUserPositionTemp
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()
>
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"手机号码已存在"
);
}
Integer
userId
=
0
;
AppUserLogin
userLogin
=
loginBiz
.
checkeUserLogin
(
phone
);
if
(
userLogin
!=
null
)
{
userId
=
userLogin
.
getId
();
}
AppUserPositionTemp
userPositionTemp
=
new
AppUserPositionTemp
();
BeanUtils
.
copyProperties
(
appUserPositionTempDTO
,
userPositionTemp
);
userPositionTemp
.
setUserId
(
userId
);
//编辑
if
(
id
==
null
||
id
==
0
)
{
insertSelective
(
userPositionTemp
);
}
else
{
updateSelectiveById
(
userPositionTemp
);
}
if
(
userId
!=
0
){
detailBiz
.
updateUserPositionByUserId
(
userId
,
appUserPositionTempDTO
.
getPositionId
());
}
return
ObjectRestResponse
.
succ
();
}
public
void
updateAppuserPostionStatusById
(
Integer
id
,
int
status
)
{
AppUserPositionTemp
appUserPositionTemp
=
new
AppUserPositionTemp
();
appUserPositionTemp
.
setId
(
id
);
appUserPositionTemp
.
setIsDel
(
status
);
mapper
.
updateByPrimaryKeySelective
(
appUserPositionTemp
);
}
public
PageDataVO
<
AppUserPositionTempVo
>
findWithPage
(
AppUserPositionTempFindDTO
appUserPositionTempFindDTO
)
{
PageDataVO
<
AppUserPositionTempVo
>
dataVO
=
new
PageDataVO
<>();
Example
example
=
new
Example
(
AppUserPositionTemp
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
if
(
StringUtils
.
isNotEmpty
(
appUserPositionTempFindDTO
.
getName
()))
{
criteria
.
andLike
(
"name"
,
String
.
format
(
"%%%s%%"
,
appUserPositionTempFindDTO
.
getName
().
trim
()));
}
if
(
StringUtils
.
isNotEmpty
(
appUserPositionTempFindDTO
.
getPhone
()))
{
criteria
.
andEqualTo
(
"phone"
,
appUserPositionTempFindDTO
.
getPhone
());
}
if
(
Objects
.
nonNull
(
appUserPositionTempFindDTO
.
getStatus
()))
{
if
(
DataStatus
.
USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNotNull
(
"userId"
);
}
if
(
DataStatus
.
NO_USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNull
(
"userId"
);
}
}
PageDataVO
<
AppUserPositionTemp
>
pageDataVO
=
PageDataVO
.
pageInfo
(
appUserPositionTempFindDTO
.
getPage
(),
appUserPositionTempFindDTO
.
getLimit
(),
()
->
mapper
.
selectByExample
(
example
));
List
<
AppUserPositionTemp
>
data
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
data
))
{
dataVO
.
setData
(
Collections
.
EMPTY_LIST
);
dataVO
.
setPageNum
(
appUserPositionTempFindDTO
.
getPage
());
dataVO
.
setPageSize
(
appUserPositionTempFindDTO
.
getLimit
());
return
dataVO
;
}
List
<
Integer
>
postionIds
=
data
.
stream
().
map
(
AppUserPositionTemp:
:
getPositionId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
AppUserPosition
>
postionMap
=
appUserPositionBiz
.
findPostionIdAndPostionMapByIds
(
postionIds
);
List
<
AppUserPositionTempVo
>
appUserPositionTempVos
=
new
ArrayList
<>();
AppUserPositionTempVo
appUserPositionTempVo
;
for
(
AppUserPositionTemp
appUserPositionTemp
:
data
)
{
appUserPositionTempVo
=
new
AppUserPositionTempVo
();
BeanUtils
.
copyProperties
(
appUserPositionTemp
,
appUserPositionTempVo
);
String
postionName
=
postionMap
==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
())==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
()).
getName
();
appUserPositionTempVo
.
setPositionName
(
postionName
);
appUserPositionTempVo
.
setStatus
(
appUserPositionTemp
.
getUserId
()
==
null
?
DataStatus
.
NO_USERED
.
code
:
appUserPositionTemp
.
getUserId
()==
0
?
DataStatus
.
NO_USERED
.
code
:
DataStatus
.
USERED
.
code
);
appUserPositionTempVos
.
add
(
appUserPositionTempVo
);
}
dataVO
.
setData
(
appUserPositionTempVos
);
dataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
dataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
dataVO
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
dataVO
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
return
dataVO
;
}
public
Map
<
String
,
Object
>
importUserPostion
(
List
<
String
[]>
userPostionData
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
2
);
List
<
Map
<
String
,
Object
>>
errorResult
=
Lists
.
newArrayList
();
Map
<
String
,
Object
>
errorResultMap
;
Set
<
Map
.
Entry
<
Integer
,
String
>>
entrySet
=
postionIdAndNameMap
.
entrySet
();
AppUserPositionTemp
appUserPositionTemp
;
for
(
int
i
=
0
;
i
<
userPostionData
.
size
();
i
++)
{
String
[]
data
=
userPostionData
.
get
(
i
);
Integer
postionId
=
null
;
String
name
=
""
;
String
phone
=
""
;
String
postionName
=
""
;
try
{
name
=
data
[
0
];
phone
=
data
[
1
];
if
(
StringUtils
.
isEmpty
(
phone
)){
throw
new
BaseException
(
"手机号为空"
);
}
postionName
=
data
[
2
];
if
(
StringUtils
.
isEmpty
(
postionName
)){
throw
new
BaseException
(
"身份为空"
);
}
//根据手机号查询userId
AppUserLogin
userLogin
=
loginBiz
.
checkeUserLogin
(
phone
);
for
(
Map
.
Entry
<
Integer
,
String
>
integerStringEntry
:
entrySet
)
{
if
(
integerStringEntry
.
getValue
().
contains
(
postionName
))
{
postionId
=
integerStringEntry
.
getKey
();
break
;
}
}
appUserPositionTemp
=
new
AppUserPositionTemp
();
appUserPositionTemp
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
appUserPositionTemp
.
setName
(
name
);
appUserPositionTemp
.
setPositionId
(
postionId
);
appUserPositionTemp
.
setPhone
(
phone
);
appUserPositionTemp
.
setUserId
(
0
);
if
(
Objects
.
nonNull
(
userLogin
))
{
//更新用户身份信息
detailBiz
.
updateUserPositionByUserId
(
userLogin
.
getId
(),
postionId
);
appUserPositionTemp
.
setUserId
(
userLogin
.
getId
());
}
mapper
.
insertWithIgnoreRepeat
(
appUserPositionTemp
);
}
catch
(
BaseException
ex
)
{
errorResultMap
=
new
HashMap
<>(
1
);
errorResultMap
.
put
(
"num"
,
i
);
errorResultMap
.
put
(
"msg"
,
ex
.
getMessage
());
errorResult
.
add
(
errorResultMap
);
}
catch
(
ArrayIndexOutOfBoundsException
ex
){
errorResultMap
=
new
HashMap
<>(
1
);
errorResultMap
.
put
(
"num"
,
i
);
String
msg
=
""
;
if
(
StringUtils
.
isEmpty
(
phone
)){
msg
+=
"手机号码缺失"
;
}
if
(
StringUtils
.
isEmpty
(
postionName
)){
msg
+=
",身份信息缺失"
;
}
errorResultMap
.
put
(
"msg"
,
msg
);
errorResult
.
add
(
errorResultMap
);
}
catch
(
Exception
ex
){
errorResultMap
=
new
HashMap
<>(
1
);
errorResultMap
.
put
(
"num"
,
i
);
errorResultMap
.
put
(
"msg"
,
"数据"
+
Arrays
.
toString
(
data
)+
"保存失败"
);
errorResult
.
add
(
errorResultMap
);
}
}
result
.
put
(
"success"
,
userPostionData
.
size
()-
errorResult
.
size
());
result
.
put
(
"error"
,
errorResult
.
size
());
result
.
put
(
"data"
,
errorResult
);
return
result
;
}
private
enum
DataStatus
{
USERED
(
1
),
NO_USERED
(
0
);
private
int
code
;
DataStatus
(
int
code
)
{
this
.
code
=
code
;
}
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
postionIdAndNameMap
=
appUserPositionBiz
.
findPostionIdAndNameMap
()
==
null
?
Collections
.
EMPTY_MAP
:
appUserPositionBiz
.
findPostionIdAndNameMap
();
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
View file @
983ddc5b
...
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -24,6 +25,8 @@ import tk.mybatis.mapper.entity.Example;
...
@@ -24,6 +25,8 @@ import tk.mybatis.mapper.entity.Example;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -47,6 +50,11 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
...
@@ -47,6 +50,11 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
@Autowired
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
private
AppUserLoginBiz
appUserLoginBiz
;
@Autowired
private
ThreadPoolTaskExecutor
threadPoolTaskExecutor
;
private
final
int
BORDER_NUM
=
250
;
public
void
saveUserMember
(
UserMemberSaveDTO
userMemberSaveDTO
,
Integer
userId
,
String
name
)
{
public
void
saveUserMember
(
UserMemberSaveDTO
userMemberSaveDTO
,
Integer
userId
,
String
name
)
{
if
(
userMemberSaveDTO
!=
null
)
{
if
(
userMemberSaveDTO
!=
null
)
{
...
@@ -95,15 +103,37 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
...
@@ -95,15 +103,37 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
List
<
BaseUserMemberExport
>
baseUserMemberExports
=
new
ArrayList
<>();
List
<
BaseUserMemberExport
>
baseUserMemberExports
=
new
ArrayList
<>();
List
<
BaseUserMemberLevel
>
levesls
=
userMemberLevelBiz
.
getLevesls
();
List
<
BaseUserMemberLevel
>
levesls
=
userMemberLevelBiz
.
getLevesls
();
Map
<
Integer
,
BaseUserMemberLevel
>
levelAndbaseUserMemberMap
=
levesls
.
s
tream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getLevel
,
Function
.
identity
()));
Map
<
Integer
,
BaseUserMemberLevel
>
levelAndbaseUserMemberMap
=
levesls
.
parallelS
tream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getLevel
,
Function
.
identity
()));
Map
<
String
,
Integer
>
leavelNameAndLeaveMap
=
levelAndbaseUserMemberMap
.
values
().
s
tream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getName
,
BaseUserMemberLevel:
:
getLevel
));
Map
<
String
,
Integer
>
leavelNameAndLeaveMap
=
levelAndbaseUserMemberMap
.
values
().
parallelS
tream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getName
,
BaseUserMemberLevel:
:
getLevel
));
List
<
String
>
phones
=
userMemberData
.
stream
().
map
(
x
->
x
[
0
]).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
phones
=
userMemberData
.
stream
().
map
(
x
->
x
[
0
]).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
appUserLoginBiz
.
findPhoneAndUserIdMapByPhones
(
phones
);
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
appUserLoginBiz
.
findPhoneAndUserIdMapByPhones
(
phones
);
Set
<
Map
.
Entry
<
String
,
Integer
>>
leaveNameAndLeaveEntry
=
leavelNameAndLeaveMap
.
entrySet
();
Set
<
Map
.
Entry
<
String
,
Integer
>>
leaveNameAndLeaveEntry
=
leavelNameAndLeaveMap
.
entrySet
();
Integer
memberLevel
=
1
;
Integer
memberLevel
=
1
;
Integer
discount
=
0
;
Integer
discount
=
0
;
for
(
String
[]
data
:
userMemberData
)
{
AtomicInteger
counter
=
new
AtomicInteger
(
0
);
int
threadNums
=
userMemberData
.
size
()/
BORDER_NUM
==
0
?
1
:
userMemberData
.
size
()/
BORDER_NUM
;
CountDownLatch
latch
=
new
CountDownLatch
(
threadNums
);
for
(
int
i
=
0
;
i
<
threadNums
;
i
++){
int
startIndex
=
i
*
BORDER_NUM
;
int
endIndex
=
i
==(
threadNums
-
1
)?
userMemberData
.
size
():(
i
+
1
)*
BORDER_NUM
;
List
<
String
[]>
subResultDate
=
userMemberData
.
subList
(
startIndex
,
endIndex
);
threadPoolTaskExecutor
.
execute
(()->{
wrapperData
(
subResultDate
,
userId
,
userName
,
baseUserMemberExports
,
levelAndbaseUserMemberMap
,
phoneAndUserIdMap
,
leaveNameAndLeaveEntry
,
memberLevel
,
discount
,
counter
);
latch
.
countDown
();
});
}
try
{
latch
.
await
();
}
catch
(
InterruptedException
e
)
{
throw
new
BaseException
(
"导入数据失败"
);
}
InsertBatch
(
baseUserMemberExports
);
return
baseUserMemberExports
.
size
();
}
private
void
wrapperData
(
List
<
String
[]>
userMemberData
,
Integer
userId
,
String
userName
,
List
<
BaseUserMemberExport
>
baseUserMemberExports
,
Map
<
Integer
,
BaseUserMemberLevel
>
levelAndbaseUserMemberMap
,
Map
<
String
,
Integer
>
phoneAndUserIdMap
,
Set
<
Map
.
Entry
<
String
,
Integer
>>
leaveNameAndLeaveEntry
,
Integer
memberLevel
,
Integer
discount
,
AtomicInteger
counter
)
{
for
(
String
[]
data
:
userMemberData
)
{
counter
.
incrementAndGet
();
String
phone
=
data
[
0
];
String
phone
=
data
[
0
];
String
memberLevelName
=
data
[
1
];
String
memberLevelName
=
data
[
1
];
String
memberName
=
data
[
2
];
String
memberName
=
data
[
2
];
...
@@ -131,6 +161,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
...
@@ -131,6 +161,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
try
{
try
{
baseUserMemberBiz
.
updUserMemberByUserId
(
userMemberDTO
);
baseUserMemberBiz
.
updUserMemberByUserId
(
userMemberDTO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"当前行数:【{}】"
,
counter
.
get
());
log
.
error
(
"会员更新错误:【{}】"
,
e
.
getMessage
());
log
.
error
(
"会员更新错误:【{}】"
,
e
.
getMessage
());
throw
new
BaseException
(
e
);
throw
new
BaseException
(
e
);
}
}
...
@@ -138,7 +169,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
...
@@ -138,7 +169,7 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
BaseUserMemberExport
memberExport
=
BaseUserMemberExport
BaseUserMemberExport
memberExport
=
BaseUserMemberExport
.
builder
()
.
builder
()
.
username
(
phone
)
.
username
(
phone
.
trim
()
)
.
memberLevel
(
memberLevel
)
.
memberLevel
(
memberLevel
)
.
totalNumber
(
Integer
.
valueOf
(
totalNumber
))
.
totalNumber
(
Integer
.
valueOf
(
totalNumber
))
.
rentFreeDays
(
Integer
.
valueOf
(
rentFreeDays
))
.
rentFreeDays
(
Integer
.
valueOf
(
rentFreeDays
))
...
@@ -155,9 +186,6 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
...
@@ -155,9 +186,6 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
}
}
baseUserMemberExports
.
add
(
memberExport
);
baseUserMemberExports
.
add
(
memberExport
);
}
}
InsertBatch
(
baseUserMemberExports
);
return
baseUserMemberExports
.
size
();
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPosition
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPosition
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.additional.idlist.IdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
/**
* 用户身份职位表
* 用户身份职位表
*
*
...
@@ -14,7 +12,7 @@ import java.util.List;
...
@@ -14,7 +12,7 @@ import java.util.List;
* @email 18178966185@163.com
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
* @date 2019-07-09 10:00:42
*/
*/
public
interface
AppUserPositionMapper
extends
Mapper
<
AppUserPosition
>
{
public
interface
AppUserPositionMapper
extends
Mapper
<
AppUserPosition
>
,
IdListMapper
<
AppUserPosition
,
Integer
>
{
AppUserPosition
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
AppUserPosition
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserPositionTempMapper.java
0 → 100644
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp
;
import
org.apache.ibatis.annotations.Insert
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 用户身份职位表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
*/
public
interface
AppUserPositionTempMapper
extends
Mapper
<
AppUserPositionTemp
>
{
@Insert
(
"INSERT IGNORE INTO `app_user_position_temp`(`user_id`,`phone`,`name`,`position_id`,`crt_time`)VALUES(#{userId},#{phone},#{name},#{positionId},#{crtTime})"
)
void
insertWithIgnoreRepeat
(
AppUserPositionTemp
appUserPositionTemp
);
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/AppUserPositionController.java
View file @
983ddc5b
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.biz.AppUserPositionBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserPositionBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserPositionTempBiz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserPositionTempDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppUserPositionTempFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.vo.AppUserPositionTempVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletPostionVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletPostionVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
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
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author libin
* @author libin
...
@@ -22,15 +30,63 @@ public class AppUserPositionController {
...
@@ -22,15 +30,63 @@ public class AppUserPositionController {
@Autowired
@Autowired
private
AppUserPositionBiz
appUserPositionBiz
;
private
AppUserPositionBiz
appUserPositionBiz
;
@Autowired
private
AppUserPositionTempBiz
appUserPositionTempBiz
;
@GetMapping
(
"/postions"
)
@GetMapping
(
"/postions"
)
public
ObjectRestResponse
<
List
<
WalletPostionVo
>>
findAllPostions
()
{
public
ObjectRestResponse
<
List
<
WalletPostionVo
>>
findAllPostions
()
{
List
<
WalletPostionVo
>
walletPostionVos
=
appUserPositionBiz
.
findAllPostions
();
List
<
WalletPostionVo
>
walletPostionVos
=
appUserPositionBiz
.
findAllPostions
();
return
ObjectRestResponse
.
succ
(
walletPostionVos
);
return
ObjectRestResponse
.
succ
(
walletPostionVos
);
}
}
@PutMapping
@PutMapping
public
ObjectRestResponse
updateUserPostionPercentage
(
@RequestBody
List
<
UserPostionDTO
>
userPostionDTOS
)
{
public
ObjectRestResponse
updateUserPostionPercentage
(
@RequestBody
List
<
UserPostionDTO
>
userPostionDTOS
)
{
appUserPositionBiz
.
updateUserPostionPercentage
(
userPostionDTOS
);
appUserPositionBiz
.
updateUserPostionPercentage
(
userPostionDTOS
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
/**
* 新增或编辑身份信息
* @return
*/
@PostMapping
(
"/add"
)
public
ObjectRestResponse
<
Void
>
addUserPostion
(
@RequestBody
AppUserPositionTempDTO
appUserPositionTempDTO
){
appUserPositionTempBiz
.
add
(
appUserPositionTempDTO
);
return
ObjectRestResponse
.
succ
();
}
/**
* 批量导入
* @param userPostionExcel
* @return
*/
@PostMapping
(
"/excel/import"
)
public
ObjectRestResponse
<
Map
<
String
,
Object
>>
importUserPostion
(
@RequestPart
(
"file"
)
MultipartFile
userPostionExcel
)
{
List
<
String
[]>
userPostionData
=
ExcelImport
.
getExcelData
(
userPostionExcel
);
if
(
userPostionData
.
size
()
<
2
)
{
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
}
userPostionData
.
remove
(
0
);
Map
<
String
,
Object
>
result
=
appUserPositionTempBiz
.
importUserPostion
(
userPostionData
);
return
ObjectRestResponse
.
succ
(
result
);
}
/**
* 删除
* @param id
* @return
*/
@DeleteMapping
(
"/{id}"
)
public
ObjectRestResponse
<
Void
>
deleteUserPostion
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
appUserPositionTempBiz
.
updateAppuserPostionStatusById
(
id
,
1
);
return
ObjectRestResponse
.
succ
();
}
@PostMapping
(
"/page"
)
public
ObjectRestResponse
<
PageDataVO
<
AppUserPositionTempVo
>>
findWithPage
(
@RequestBody
AppUserPositionTempFindDTO
appUserPositionTempFindDTO
){
PageDataVO
<
AppUserPositionTempVo
>
dataVO
=
appUserPositionTempBiz
.
findWithPage
(
appUserPositionTempFindDTO
);
return
ObjectRestResponse
.
succ
(
dataVO
);
}
}
}
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodMapper.xml
View file @
983ddc5b
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
from tour_good g
from tour_good g
LEFT JOIN (SELECT * FROM tour_good_tag WHERE is_del=0) tag ON g.id=tag.good_id
LEFT JOIN (SELECT * FROM tour_good_tag WHERE is_del=0) tag ON g.id=tag.good_id
LEFT JOIN (SELECT * FROM tour_tag WHERE is_del=0) t ON tag.tag_id=t.id
LEFT JOIN (SELECT * FROM tour_tag WHERE is_del=0
and name!='全部'
) t ON tag.tag_id=t.id
where g.recommend=1 and g.status=1 and g.is_del=0
where g.recommend=1 and g.status=1 and g.is_del=0
GROUP BY g.id
GROUP BY g.id
ORDER BY g.rank DESC ,g.id DESC
ORDER BY g.rank DESC ,g.id DESC
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/CompanySearchDTO.java
View file @
983ddc5b
...
@@ -9,4 +9,7 @@ public class CompanySearchDTO {
...
@@ -9,4 +9,7 @@ public class CompanySearchDTO {
Integer
addrCity
;
Integer
addrCity
;
String
lon
;
String
lon
;
String
lat
;
String
lat
;
Integer
state
;
Integer
isShow
=
1
;
Integer
isDel
=
0
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
983ddc5b
...
@@ -208,7 +208,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -208,7 +208,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
public
PageDataVO
<
BranchCompany
>
search
(
CompanySearchDTO
vo
)
{
public
PageDataVO
<
BranchCompany
>
search
(
CompanySearchDTO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPage
(),
vo
.
getLimit
());
PageHelper
.
startPage
(
vo
.
getPage
(),
vo
.
getLimit
());
PageInfo
<
BranchCompany
>
branchCompanyPageInfo
=
new
PageInfo
<>(
mapper
.
search
(
vo
.
getLon
(),
vo
.
getLat
(),
vo
.
getAddrCity
()));
PageInfo
<
BranchCompany
>
branchCompanyPageInfo
=
new
PageInfo
<>(
mapper
.
search
(
vo
.
getLon
(),
vo
.
getLat
(),
vo
.
getAddrCity
()
,
vo
.
getState
(),
vo
.
getIsShow
(),
vo
.
getIsDel
()
));
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
View file @
983ddc5b
...
@@ -12,7 +12,7 @@ import java.util.List;
...
@@ -12,7 +12,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>,
SelectByIdListMapper
<
BranchCompany
,
Integer
>
{
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>,
SelectByIdListMapper
<
BranchCompany
,
Integer
>
{
List
<
BranchCompany
>
search
(
@Param
(
"lon"
)
String
lon
,
@Param
(
"lat"
)
String
lat
,
@Param
(
"addrCity"
)
Integer
addrCity
);
List
<
BranchCompany
>
search
(
@Param
(
"lon"
)
String
lon
,
@Param
(
"lat"
)
String
lat
,
@Param
(
"addrCity"
)
Integer
addrCity
,
Integer
state
,
Integer
isShow
,
Integer
isDel
);
List
<
BranchCompany
>
selectByZoneId
(
Map
<
String
,
Object
>
param
);
List
<
BranchCompany
>
selectByZoneId
(
Map
<
String
,
Object
>
param
);
List
<
Integer
>
findCompanyIdsByAreaId
(
@Param
(
"areaId"
)
Integer
areaId
);
List
<
Integer
>
findCompanyIdsByAreaId
(
@Param
(
"areaId"
)
Integer
areaId
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelController.java
View file @
983ddc5b
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.ClientUtil
;
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.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
@@ -32,8 +33,6 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
...
@@ -32,8 +33,6 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -295,11 +294,10 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -295,11 +294,10 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
}
}
@Override
@ApiOperation
(
"删除"
)
@ApiOperation
(
"删除"
)
@DeleteMapping
(
value
=
"/app/{id}"
)
@DeleteMapping
(
value
=
"/app/{id}"
)
@Transactional
@Transactional
public
ObjectRestResponse
<
VehicleModel
>
remove
(
@PathVariable
int
id
)
{
public
ObjectRestResponse
<
VehicleModel
>
remove
(
@PathVariable
int
id
,
UserDTO
userDTO
)
{
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"
);
...
@@ -308,7 +306,12 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
...
@@ -308,7 +306,12 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
VehicleModel
vm
=
new
VehicleModel
();
VehicleModel
vm
=
new
VehicleModel
();
vm
.
setId
(
id
);
vm
.
setId
(
id
);
vm
.
setIsdel
(
1
);
vm
.
setIsdel
(
1
);
vehicleModelBiz
.
updateSelectiveById
(
vm
);
vm
.
setUpdTime
(
new
Date
());
vm
.
setUpdUser
(
userDTO
.
getId
());
vm
.
setUpdName
(
userDTO
.
getUsername
());
vm
.
setUpdHost
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
)));
// vehicleModelBiz.updateSelectiveById(vm);
vehicleModelBiz
.
updateByPrimaryKeySelective
(
vm
);
//3.删除车型对应的标签
//3.删除车型对应的标签
VehicleCata
vehicleCata
=
new
VehicleCata
();
VehicleCata
vehicleCata
=
new
VehicleCata
();
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
983ddc5b
...
@@ -36,6 +36,15 @@
...
@@ -36,6 +36,15 @@
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
and longitude is not null and latitude is not null
and longitude is not null and latitude is not null
</if>
</if>
<if
test=
"state != null"
>
and state = #{state}
</if>
<if
test=
"isShow != null"
>
and is_show = #{isShow}
</if>
<if
test=
"isDel != null"
>
and is_del = #{isDel}
</if>
</where>
</where>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
order by distance asc
order by distance asc
...
...
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