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
3c8d346f
Commit
3c8d346f
authored
Aug 09, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
7f2e8a79
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
66 deletions
+105
-66
AppUserController.java
...github/wxiaoqi/security/admin/rest/AppUserController.java
+5
-0
OrderFeign.java
...c/main/java/com/xxfc/platform/order/feign/OrderFeign.java
+24
-0
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+8
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+68
-66
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserController.java
View file @
3c8d346f
...
@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.msg.TableResultResponse;
...
@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
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.xxfc.platform.order.feign.OrderFeign
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
...
@@ -63,6 +64,9 @@ public class AppUserController extends CommonBaseController {
...
@@ -63,6 +64,9 @@ public class AppUserController extends CommonBaseController {
@Autowired
@Autowired
private
MyWaterBiz
myWaterBiz
;
private
MyWaterBiz
myWaterBiz
;
@Autowired
private
OrderFeign
orderFeign
;
@GetMapping
(
"page"
)
@GetMapping
(
"page"
)
...
@@ -141,6 +145,7 @@ public class AppUserController extends CommonBaseController {
...
@@ -141,6 +145,7 @@ public class AppUserController extends CommonBaseController {
UserMemberVo
memberVo
=
userMemberBiz
.
getMemberInfoByUserId
(
userid
);
UserMemberVo
memberVo
=
userMemberBiz
.
getMemberInfoByUserId
(
userid
);
if
(
memberVo
!=
null
){
if
(
memberVo
!=
null
){
BeanUtils
.
copyProperties
(
userDTO
,
memberVo
);
BeanUtils
.
copyProperties
(
userDTO
,
memberVo
);
// userDTO.setPayCount(orderFeign.baseOrderEntityList(new BaseOrder()));
Integer
level
=
memberVo
.
getMemberLevel
();
Integer
level
=
memberVo
.
getMemberLevel
();
BaseUserMemberLevel
memberLevel
=
userMemberLevelBiz
.
getLevel
(
level
);
BaseUserMemberLevel
memberLevel
=
userMemberLevelBiz
.
getLevel
(
level
);
if
(
memberLevel
!=
null
){
if
(
memberLevel
!=
null
){
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/feign/OrderFeign.java
0 → 100644
View file @
3c8d346f
package
com
.
xxfc
.
platform
.
order
.
feign
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.xxfc.platform.order.entity.BaseOrder
;
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
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* Created by ace on 2017/9/15.
*/
@FeignClient
(
name
=
"vehicle"
)
public
interface
OrderFeign
{
@GetMapping
(
"/baseOrder/entityList"
)
public
ObjectRestResponse
<
List
<
BaseOrder
>>
baseOrderEntityList
(
@RequestParam
(
"entity"
)
Map
<
String
,
Object
>
entity
);
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
3c8d346f
...
@@ -155,6 +155,14 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -155,6 +155,14 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return
new
ObjectRestResponse
<>().
data
(
pages
);
return
new
ObjectRestResponse
<>().
data
(
pages
);
}
}
@ApiOperation
(
"根据参数查询,等于"
)
@RequestMapping
(
value
=
"/entityList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ObjectRestResponse
<
List
<
BaseOrder
>>
entityList
(
BaseOrder
entity
){
//查询列表数据
return
ObjectRestResponse
.
succ
(
baseOrderBiz
.
selectList
(
entity
));
}
@ApiOperation
(
"订单详情"
)
@ApiOperation
(
"订单详情"
)
@RequestMapping
(
value
=
"/{no}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{no}"
,
method
=
RequestMethod
.
GET
)
@IgnoreClientToken
@IgnoreClientToken
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
3c8d346f
...
@@ -362,73 +362,7 @@
...
@@ -362,73 +362,7 @@
where id = #{vehicleId} and status = #{lastStatus}
where id = #{vehicleId} and status = #{lastStatus}
</update>
</update>
<select
id=
"searchUsableModel"
parameterType=
"java.util.Map"
resultMap=
"searchUsableModelMap"
>
select distinct vm.id as model_id, bc.id as company_id
<if
test=
" catas != null "
>
,GROUP_CONCAT(vc.cata_id) as catas
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,max(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
"and"
>
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
) as hasVehicle
</if>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
<include
refid=
"searchUsableSql"
/>
and vm.id is not null
and vm.status = 1
and vm.isdel = 0
and bc.id is not null
GROUP BY model_id, company_id
<if
test=
"lon != null and lat != null"
>
, distance
</if>
<!--<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">, hasVehicle</if>-->
<!-- 循环 相同父级 数据做并集, 不同父级做或集 -->
<if
test=
" catas != null "
>
having ( 1
<foreach
collection=
"catas"
index=
"key"
item=
"cataList"
>
&
(
<foreach
collection=
"cataList"
index=
"cIndex"
item=
"cata"
>
<if
test=
" cIndex != 0"
>
|
</if>
(case when FIND_IN_SET(#{cata.id},catas) > 0 then 1 else 0 end)
</foreach>
)
</foreach>
) > 0
</if>
<if
test=
"lon != null and lat != null"
>
order by
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
hasVehicle desc,
</if>
distance asc
</if>
</select>
<select
id=
"searchUsableVehicle"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select v.*
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
<if
test=
" yearMonthAndParam !=null "
>
,ifnull(vbi.booked_date,0) as booked_date
</if>
<include
refid=
"searchUsableSql"
/>
<if
test=
"lon != null and lat != null"
>
order by
distance asc
</if>
</select>
<select
id=
"getAllVehicle"
parameterType=
"java.util.Map"
resultMap=
"searchModel"
>
<select
id=
"getAllVehicle"
parameterType=
"java.util.Map"
resultMap=
"searchModel"
>
select v1.*, bc2.name subordinateBranchName, bc3.name parkCompanyName, bc4.name destinationBranchCompanyName
select v1.*, bc2.name subordinateBranchName, bc3.name parkCompanyName, bc4.name destinationBranchCompanyName
from vehicle v1
from vehicle v1
...
@@ -564,6 +498,74 @@
...
@@ -564,6 +498,74 @@
</where>
</where>
</select>
</select>
<select
id=
"searchUsableModel"
parameterType=
"java.util.Map"
resultMap=
"searchUsableModelMap"
>
select distinct vm.id as model_id, bc.id as company_id
<if
test=
" catas != null "
>
,GROUP_CONCAT(vc.cata_id) as catas
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,max(
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
separator=
"and"
>
<include
refid=
"yearMonthAndParamSql"
></include>
</foreach>
) as hasVehicle
</if>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
<include
refid=
"searchUsableSql"
/>
and vm.id is not null
and vm.status = 1
and vm.isdel = 0
and bc.id is not null
GROUP BY model_id, company_id
<if
test=
"lon != null and lat != null"
>
, distance
</if>
<!--<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">, hasVehicle</if>-->
<!-- 循环 相同父级 数据做并集, 不同父级做或集 -->
<if
test=
" catas != null "
>
having ( 1
<foreach
collection=
"catas"
index=
"key"
item=
"cataList"
>
&
(
<foreach
collection=
"cataList"
index=
"cIndex"
item=
"cata"
>
<if
test=
" cIndex != 0"
>
|
</if>
(case when FIND_IN_SET(#{cata.id},catas) > 0 then 1 else 0 end)
</foreach>
)
</foreach>
) > 0
</if>
<if
test=
"lon != null and lat != null"
>
order by
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
hasVehicle desc,
</if>
distance asc
</if>
</select>
<select
id=
"searchUsableVehicle"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select v.*
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
<if
test=
" yearMonthAndParam !=null "
>
,ifnull(vbi.booked_date,0) as booked_date
</if>
<include
refid=
"searchUsableSql"
/>
<if
test=
"lon != null and lat != null"
>
order by
distance asc
</if>
</select>
<!-- 查询可用车辆/车型 的公用 from 和 where 部分条件 -->
<!-- 查询可用车辆/车型 的公用 from 和 where 部分条件 -->
<sql
id=
"searchUsableSql"
>
<sql
id=
"searchUsableSql"
>
from vehicle v
from vehicle v
...
...
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