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
d74582fd
Commit
d74582fd
authored
Aug 09, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购房车
parent
db1bbf24
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
471 additions
and
26 deletions
+471
-26
.gitignore
.gitignore
+1
-0
UserBusinessBiz.java
...om/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
+4
-0
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+1
-1
MapperTest.java
.../src/test/java/com/github/wxiaoqi/service/MapperTest.java
+34
-0
ServiceTest.java
...src/test/java/com/github/wxiaoqi/service/ServiceTest.java
+211
-0
BuyVehicleFormFindDTO.java
...m/xxfc/platform/app/entity/dto/BuyVehicleFormFindDTO.java
+24
-0
BuyVehicleFormPageVo.java
...com/xxfc/platform/app/entity/vo/BuyVehicleFormPageVo.java
+4
-4
BuyVehicleFormBiz.java
...ain/java/com/xxfc/platform/app/biz/BuyVehicleFormBiz.java
+21
-5
BuyVehicleFormMapper.java
...va/com/xxfc/platform/app/mapper/BuyVehicleFormMapper.java
+2
-0
BuyVehicleFormAdminController.java
...latform/app/rest/admin/BuyVehicleFormAdminController.java
+7
-9
BuyVehicleFormMapper.xml
...server/src/main/resources/mapper/BuyVehicleFormMapper.xml
+13
-5
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+5
-1
BranComanyLeaderVo.java
...com/xxfc/platform/vehicle/pojo/vo/BranComanyLeaderVo.java
+27
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+14
-0
BranchCompanyMapper.java
...com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
+2
-1
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+7
-0
CompanyDataUpdateTest.java
...java/com/xxfc/platform/vehicle/CompanyDataUpdateTest.java
+65
-0
VehicleServiceTest.java
...st/java/com/xxfc/platform/vehicle/VehicleServiceTest.java
+29
-0
No files found.
.gitignore
View file @
d74582fd
...
...
@@ -10,4 +10,5 @@ ace-modules/ace-tool/src/main/resources/application-dev.yml
src/main/test/**
logs/**
xx-order/xx-order-server/logs/**
*.log
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
View file @
d74582fd
...
...
@@ -46,6 +46,10 @@ public class UserBusinessBiz {
List
<
AppUserRelation
>
teamMemberBos
=
memberPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
teamMemberBos
))
{
userTeamMemberVo
.
setPageNum
(
pageNo
);
userTeamMemberVo
.
setPageSize
(
pageSize
);
userTeamMemberVo
.
setTotalIncome
(
new
BigDecimal
(
0
));
userTeamMemberVo
.
setUserTeamMemberBos
(
Collections
.
EMPTY_LIST
);
return
userTeamMemberVo
;
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
d74582fd
...
...
@@ -107,7 +107,7 @@
l.id = m.user_id
left join
`app_user_position` as aup
on
d.position_id= aup.level
on
aup.id = d.position_id
where l.isdel = 0
<if
test=
"mobile !=null and mobile !='' "
>
and l.username like CONCAT('%',#{mobile},'%')
...
...
ace-modules/ace-admin/src/test/java/com/github/wxiaoqi/service/MapperTest.java
0 → 100644
View file @
d74582fd
package
com
.
github
.
wxiaoqi
.
service
;
import
com.github.wxiaoqi.security.admin.AdminBootstrap
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/6 16:43
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
{
AdminBootstrap
.
class
})
@Slf4j
public
class
MapperTest
{
@Autowired
private
AppUserMapper
appUserMapper
;
@Test
public
void
testOptional
(){
}
}
ace-modules/ace-admin/src/test/java/com/github/wxiaoqi/service/ServiceTest.java
0 → 100644
View file @
d74582fd
package
com
.
github
.
wxiaoqi
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.AdminBootstrap
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletFindDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MvcResult
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.web.context.WebApplicationContext
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 15:37
*/
@Slf4j
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
AdminBootstrap
.
class
)
public
class
ServiceTest
{
@Autowired
private
WebApplicationContext
wac
;
@Autowired
private
MyWalletBiz
myWalletBiz
;
@Autowired
private
MyWalletDetailBiz
myWalletDetailBiz
;
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
@Autowired
private
AppUserDetailBiz
appUserDetailBiz
;
private
MockMvc
mockMvc
;
private
String
token
;
@Autowired
private
GroupBiz
groupBiz
;
// @Before
public
void
init
()
throws
Exception
{
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
wac
).
build
();
long
loginCode
=
0
;
/* LinkedMultiValueMap smsparam = new LinkedMultiValueMap();
smsparam.put("username",Arrays.asList("19972242603"));
smsparam.put("type",Arrays.asList(1));
MvcResult smsResult = mockMvc.perform(MockMvcRequestBuilders.post("/api/app/user/sendsms").params(smsparam)
.header("Content-Type", "application/json"))
.andExpect(status().isOk())
.andReturn();
loginCode = Long.valueOf(smsResult.getResponse().getContentAsString());
log.debug("登录验证码:【{}】",loginCode);*/
LinkedMultiValueMap
loginParams
=
new
LinkedMultiValueMap
();
loginParams
.
put
(
"username"
,
Arrays
.
asList
(
"19972242603"
));
loginParams
.
put
(
"mobilecode"
,
Arrays
.
asList
(
"5003"
));
loginParams
.
put
(
"password"
,
Arrays
.
asList
(
"12345678"
));
loginParams
.
put
(
"type"
,
Arrays
.
asList
(
"1"
));
MvcResult
tokenResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
post
(
"/api/app/user/login"
)
.
params
(
loginParams
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
isOk
())
.
andReturn
();
String
contentAsString
=
tokenResult
.
getResponse
().
getContentAsString
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
contentAsString
);
log
.
debug
(
"**************************"
);
log
.
debug
(
"登录的token:【{}】"
,
token
);
log
.
debug
(
"**************************"
);
}
@Test
public
void
testWalletPage
()
throws
Exception
{
WalletFindDTO
walletFindDTO
=
new
WalletFindDTO
();
walletFindDTO
.
setPhone
(
"19972242603"
);
walletFindDTO
.
setPage
(
1
);
walletFindDTO
.
setLimit
(
20
);
LinkedMultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
params
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
params
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
params
.
put
(
"phone"
,
Arrays
.
asList
(
"19972242603"
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/wallet/admin/page"
).
params
(
params
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testBatchUpdatePostion
()
throws
Exception
{
List
<
UserPostionDTO
>
userPostionDTOS
=
new
ArrayList
<>();
UserPostionDTO
userPostionDTO
=
new
UserPostionDTO
();
userPostionDTO
.
setId
(
1
);
userPostionDTO
.
setExtract
(
50
);
UserPostionDTO
userPostion2
=
new
UserPostionDTO
();
userPostion2
.
setExtract
(
25
);
userPostion2
.
setId
(
2
);
userPostionDTOS
.
add
(
userPostionDTO
);
userPostionDTOS
.
add
(
userPostion2
);
log
.
debug
(
"更新数据:【{}】"
,
JSON
.
toJSONString
(
userPostionDTOS
));
mockMvc
.
perform
(
MockMvcRequestBuilders
.
put
(
"/postion/admin"
)
.
header
(
"Content-Type"
,
"application/json"
)
.
content
(
JSON
.
toJSONString
(
userPostionDTOS
)))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
}
@Test
public
void
testPostions
()
throws
Exception
{
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/postion/admin/postions"
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testWalletDetailAdminPage
()
throws
Exception
{
LinkedMultiValueMap
<
String
,
String
>
linkedMultiValueMap
=
new
LinkedMultiValueMap
();
linkedMultiValueMap
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
linkedMultiValueMap
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
linkedMultiValueMap
.
put
(
"source"
,
Arrays
.
asList
(
"1"
));
linkedMultiValueMap
.
put
(
"username"
,
Arrays
.
asList
(
"XX"
));
// linkedMultiValueMap.put("phone", Arrays.asList("19972242603"));
log
.
debug
(
"请求参数:【{}】"
,
JSON
.
toJSONString
(
linkedMultiValueMap
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/walletdetail/admin/page"
).
params
(
linkedMultiValueMap
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
String
contentAsString
=
mvcResult
.
getResponse
().
getContentAsString
();
log
.
debug
(
"请求返回的结果:【{}】"
,
contentAsString
);
}
/**
* walletcath/admin
*/
@Test
public
void
testWalletCathPage
()
throws
Exception
{
LinkedMultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
params
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
params
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
params
.
put
(
"username"
,
Arrays
.
asList
(
"XX_981132"
));
params
.
put
(
"phone"
,
Arrays
.
asList
(
"19972242603"
));
params
.
put
(
"state"
,
Arrays
.
asList
(
"1"
));
log
.
debug
(
"请求参数:【{}】"
,
JSON
.
toJSONString
(
params
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/walletcath/admin/page"
).
params
(
params
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testPromote
()
throws
Exception
{
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
""
)
.
header
(
"Authorization"
,
token
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
isOk
())
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testUnBinding
(){
appUserLoginBiz
.
unBindThirdPartyByType
(
"wx"
,
"18178966185"
,
265
);
}
@Test
public
void
testGetByUserName
(){
appUserLoginBiz
.
getUserByUsername
(
"18178966185"
);
}
}
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/dto/BuyVehicleFormFindDTO.java
0 → 100644
View file @
d74582fd
package
com
.
xxfc
.
platform
.
app
.
entity
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/9 16:25
*/
@Data
public
class
BuyVehicleFormFindDTO
extends
PageParam
{
private
Long
startTime
;
private
Long
endTime
;
private
Integer
companyId
;
private
Integer
areaId
;
private
Integer
status
;
}
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/vo/BuyVehicleFormPageVo.java
View file @
d74582fd
...
...
@@ -59,14 +59,14 @@ public class BuyVehicleFormPageVo {
private
Integer
status
;
/**
*
申请
人
*
负责
人
*/
private
String
apply
Name
;
private
String
leader
Name
;
/**
*
申请
人电话
*
负责
人电话
*/
private
String
apply
Phone
;
private
String
leader
Phone
;
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/BuyVehicleFormBiz.java
View file @
d74582fd
package
com
.
xxfc
.
platform
.
app
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.dto.BuyVehicleFormFindDTO
;
import
com.xxfc.platform.app.entity.vo.BuyVehicleFormPageVo
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,10 +16,7 @@ import com.xxfc.platform.app.entity.BuyVehicleForm;
import
com.xxfc.platform.app.mapper.BuyVehicleFormMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -32,6 +32,9 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
@Autowired
private
VehicleFeign
vehicleFeign
;
@Autowired
private
UserFeign
userFeign
;
public
PageDataVO
<
BuyVehicleFormPageVo
>
findBuyVehicleFormWithPage
(
BuyVehicleFormFindDTO
buyVehicleFormFindDTO
)
{
PageDataVO
<
BuyVehicleFormPageVo
>
buyVehicleFormPage
=
new
PageDataVO
<>();
List
<
Integer
>
cpyIds
=
new
ArrayList
<>();
...
...
@@ -43,6 +46,8 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
boolean
flag
=
companyIds
.
contains
(
buyVehicleFormFindDTO
.
getCompanyId
());
if
(
flag
){
cpyIds
.
add
(
buyVehicleFormFindDTO
.
getCompanyId
());
}
else
{
return
buyVehicleFormPage
;
}
}
}
else
{
...
...
@@ -57,13 +62,20 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
return
buyVehicleFormPage
;
}
List
<
Integer
>
userIds
=
data
.
stream
().
map
(
BuyVehicleForm:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
companyIds
=
data
.
stream
().
map
(
BuyVehicleForm:
:
getCompanyId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
BranComanyLeaderVo
>
comanyLeaderVoMap
=
vehicleFeign
.
findCompanyLeaderMapByIds
(
companyIds
);
List
<
BuyVehicleFormPageVo
>
buyVehicleFormPageVoList
=
new
ArrayList
<>();
BuyVehicleFormPageVo
buyVehicleFormPageVo
;
for
(
BuyVehicleForm
buyVehicleForm
:
data
)
{
buyVehicleFormPageVo
=
new
BuyVehicleFormPageVo
();
BeanUtils
.
copyProperties
(
buyVehicleForm
,
buyVehicleFormPageVo
);
if
(
comanyLeaderVoMap
!=
null
)
{
BranComanyLeaderVo
branComanyLeaderVo
=
comanyLeaderVoMap
.
get
(
buyVehicleForm
.
getCompanyId
());
buyVehicleFormPageVo
.
setLeaderName
(
branComanyLeaderVo
==
null
?
""
:
branComanyLeaderVo
.
getLeader
());
buyVehicleFormPageVo
.
setLeaderPhone
(
branComanyLeaderVo
==
null
?
""
:
branComanyLeaderVo
.
getPhone
());
buyVehicleFormPageVo
.
setCompanyName
(
branComanyLeaderVo
==
null
?
""
:
branComanyLeaderVo
.
getName
());
}
buyVehicleFormPageVoList
.
add
(
buyVehicleFormPageVo
);
}
...
...
@@ -74,4 +86,8 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
buyVehicleFormPage
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
return
buyVehicleFormPage
;
}
public
void
processApplyStatusById
(
Integer
id
)
{
mapper
.
updateApplyStatusById
(
id
);
}
}
\ No newline at end of file
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/BuyVehicleFormMapper.java
View file @
d74582fd
...
...
@@ -17,4 +17,6 @@ import java.util.List;
public
interface
BuyVehicleFormMapper
extends
Mapper
<
BuyVehicleForm
>
{
List
<
BuyVehicleForm
>
findBuyVehicleForms
(
@Param
(
"bvf"
)
BuyVehicleFormFindDTO
buyVehicleFormFindDTO
,
@Param
(
"companyIds"
)
List
<
Integer
>
companyIds
);
void
updateApplyStatusById
(
Integer
id
);
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/admin/BuyVehicleFormAdminController.java
View file @
d74582fd
...
...
@@ -6,10 +6,7 @@ import com.xxfc.platform.app.biz.BuyVehicleFormBiz;
import
com.xxfc.platform.app.entity.dto.BuyVehicleFormFindDTO
;
import
com.xxfc.platform.app.entity.vo.BuyVehicleFormPageVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author libin
...
...
@@ -18,20 +15,21 @@ import org.springframework.web.bind.annotation.RestController;
* @data 2019/8/9 13:55
*/
@RestController
@RequestMapping
(
"buy_vehicle"
)
@RequestMapping
(
"
admin/
buy_vehicle"
)
public
class
BuyVehicleFormAdminController
{
@Autowired
private
BuyVehicleFormBiz
vehicleFormBiz
;
@PostMapping
(
"/page"
)
public
ObjectRestResponse
<
BuyVehicleFormPageVo
>
findBuyVehicleFormWithPage
(
BuyVehicleFormFindDTO
buyVehicleFormFindDTO
){
public
ObjectRestResponse
<
BuyVehicleFormPageVo
>
findBuyVehicleFormWithPage
(
@RequestBody
BuyVehicleFormFindDTO
buyVehicleFormFindDTO
){
PageDataVO
<
BuyVehicleFormPageVo
>
pageDataVO
=
vehicleFormBiz
.
findBuyVehicleFormWithPage
(
buyVehicleFormFindDTO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
@PostMapping
(
"/status/id"
)
public
ObjectRestResponse
<
Void
>
processApplyById
(
@PathVariable
(
"id"
)
Integer
id
){
@PostMapping
(
"/status/{id}"
)
public
ObjectRestResponse
<
Void
>
processApplyById
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
vehicleFormBiz
.
processApplyStatusById
(
id
);
return
ObjectRestResponse
.
succ
();
}
}
xx-app/xx-app-server/src/main/resources/mapper/BuyVehicleFormMapper.xml
View file @
d74582fd
...
...
@@ -21,21 +21,29 @@
<select
id=
"findBuyVehicleForms"
resultMap=
"buyVehicleFormMap"
>
select * from `buy_vehicle_form` where 1=1
<if
test=
"bvf.startTime != null and bvf.endTime !=null"
>
and `book
T
ime` between #{bvf.startTime} and #{bvf.endTime}
and `book
_t
ime` between #{bvf.startTime} and #{bvf.endTime}
</if>
<if
test=
"bvf.startTime != null and bvf.endTime == null"
>
and `book
T
ime`>= #{bvf.startTime}
and `book
_t
ime`>= #{bvf.startTime}
</if>
<if
test=
"bvf.endTime != null and bvf.startTime == null"
>
and
<![CDATA[ `book
T
ime`<= #{bvf.endTime}]]>
and
<![CDATA[ `book
_t
ime`<= #{bvf.endTime}]]>
</if>
<if
test=
"bvf.areaId != null || bvf.companyId !=null"
>
<if
test=
"companyIds != null and companyIds.size() != 0"
>
and `company_id` in
<foreach
collection=
"companyIds"
item=
"c
ompanyId
"
separator=
","
>
#{c
ompan
yId}
<foreach
collection=
"companyIds"
item=
"c
pyId"
close=
")"
open=
"(
"
separator=
","
>
#{c
p
yId}
</foreach>
</if>
</if>
<if
test=
"bvf.status != null"
>
and `status`=#{bvf.status}
</if>
order by `book_time` desc
</select>
<update
id=
"updateApplyStatusById"
>
update `buy_vehicle_form` set `status`=1 where `id`=#{id}
</update>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
d74582fd
...
...
@@ -6,6 +6,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -117,6 +118,9 @@ public interface VehicleFeign {
@GetMapping
(
"/accompanyingItem/app/unauth/items"
)
public
RestResponse
<
List
<
AccompanyingItemVo
>>
listAccompanyingItem
();
@GetMapping
(
"/findByAreaId"
)
@GetMapping
(
"/
branchCompany/
findByAreaId"
)
List
<
Integer
>
findCompanyIdsByAreaId
(
@RequestParam
(
value
=
"areaId"
)
Integer
areaId
);
@GetMapping
(
"/branchCompany/company"
)
Map
<
Integer
,
BranComanyLeaderVo
>
findCompanyLeaderMapByIds
(
@RequestParam
(
value
=
"companyIds"
)
List
<
Integer
>
companyIds
);
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/BranComanyLeaderVo.java
0 → 100644
View file @
d74582fd
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/9 18:44
*/
@Data
public
class
BranComanyLeaderVo
{
/**
* 负责人
*/
private
String
leader
;
/**
* 负责人联系电话
*/
private
String
phone
;
/**
* 公司名
*/
private
String
name
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
d74582fd
...
...
@@ -20,6 +20,7 @@ import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.util.excel.ExcelImport
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -331,4 +332,17 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
public
List
<
Integer
>
selectCompanyIdsByAreaId
(
Integer
areaId
)
{
return
mapper
.
findCompanyIdsByAreaId
(
areaId
);
}
public
Map
<
Integer
,
BranComanyLeaderVo
>
findCompanyLeaderMapByIds
(
List
<
Integer
>
companyIds
)
{
Map
<
Integer
,
BranComanyLeaderVo
>
companyIdAndLeaderMap
=
new
HashMap
<>(
companyIds
.
size
());
List
<
BranchCompany
>
branchCompanies
=
mapper
.
selectByIdList
(
companyIds
);
if
(
CollectionUtils
.
isEmpty
(
branchCompanies
)){
return
companyIdAndLeaderMap
;
}
return
branchCompanies
.
stream
().
collect
(
Collectors
.
toMap
(
BranchCompany:
:
getId
,
branchCompany
->
{
BranComanyLeaderVo
branComanyLeaderVo
=
new
BranComanyLeaderVo
();
BeanUtils
.
copyProperties
(
branchCompany
,
branComanyLeaderVo
);
return
branComanyLeaderVo
;
}));
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
View file @
d74582fd
...
...
@@ -2,12 +2,13 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.Map
;
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>
{
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
>
selectByZoneId
(
Map
<
String
,
Object
>
param
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
d74582fd
...
...
@@ -16,6 +16,7 @@ import com.xxfc.platform.vehicle.pojo.BranchCompanyVo;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"/branchCompany"
)
...
...
@@ -169,4 +171,9 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
public
List
<
Integer
>
findCompanyIdsByAreaId
(
@RequestParam
(
value
=
"areaId"
)
Integer
areaId
){
return
baseBiz
.
selectCompanyIdsByAreaId
(
areaId
);
}
@GetMapping
(
"/company"
)
Map
<
Integer
,
BranComanyLeaderVo
>
findCompanyLeaderMapByIds
(
@RequestParam
(
"companyIds"
)
List
<
Integer
>
companyIds
){
return
baseBiz
.
findCompanyLeaderMapByIds
(
companyIds
);
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/CompanyDataUpdateTest.java
0 → 100644
View file @
d74582fd
package
com
.
xxfc
.
platform
.
vehicle
;
import
com.github.wxiaoqi.security.common.util.excel.Excel2003Reader
;
import
com.github.wxiaoqi.security.common.util.excel.Excel2007Reader
;
import
com.xxfc.platform.vehicle.biz.BranchCompanyBiz
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyMapper
;
import
lombok.SneakyThrows
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/31 15:26
*/
//@RunWith(SpringJUnit4ClassRunner.class)
//@SpringBootTest(classes = {VehicleApplication.class})
public
class
CompanyDataUpdateTest
{
@Autowired
private
BranchCompanyMapper
branchCompanyMapper
;
@Autowired
private
BranchCompanyBiz
branchCompanyBiz
;
@SneakyThrows
@Test
public
void
updateCompanyInfo
(){
Excel2007Reader
excel2007Reader
=
new
Excel2007Reader
();
Excel2003Reader
excel2003Reader
=
new
Excel2003Reader
();
InputStream
fileInputStream
=
new
FileInputStream
(
"C:\\Users\\Administrator\\Desktop\\company.xls"
);
excel2003Reader
.
process
(
fileInputStream
);
List
<
String
[]>
sheetData
=
excel2003Reader
.
getSheetData
(
0
);
sheetData
.
forEach
(
System
.
out
::
println
);
/* FileInputStream fileInputStream = new FileInputStream("C:\\Users\\Administrator\\Desktop\\company.xls");
HSSFWorkbook sheets = new HSSFWorkbook(fileInputStream);
HSSFSheet sheetAt = sheets.getSheetAt(0);
int lastRowNum = sheetAt.getLastRowNum();
List<BranComV> branComVList = new ArrayList<>();
for (int i=1;i<=lastRowNum;i++){
HSSFRow row = sheetAt.getRow(i);
HSSFCell cell1 = row.getCell(0);
cell1.setCellType(CellType.STRING);
String company_id = cell1.getStringCellValue();
HSSFCell cell2 = row.getCell(2);
cell2.setCellType(CellType.STRING);
String actual_area_id = cell2.getStringCellValue();
System.out.println("公司id:"+ company_id);
System.out.println("片区id:"+actual_area_id);
System.out.println("***********************");
BranComV branComV = new BranComV();
branComV.setId(Integer.valueOf(company_id));
branComV.setZoneId(Integer.valueOf(actual_area_id));
branComVList.add(branComV);
}
branchCompanyBiz.updatein(branComVList);
fileInputStream.close();*/
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/VehicleServiceTest.java
0 → 100644
View file @
d74582fd
package
com
.
xxfc
.
platform
.
vehicle
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
lombok.SneakyThrows
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/1 17:33
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
VehicleApplication
.
class
)
public
class
VehicleServiceTest
{
@Autowired
VehicleJobHandler
vehicleJobHandler
;
@Test
@SneakyThrows
public
void
testVehicleJob
(){
vehicleJobHandler
.
execute
(
""
);
}
}
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