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
fc117367
Commit
fc117367
authored
Nov 17, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加调度
parent
3a401855
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
417 additions
and
5 deletions
+417
-5
ConfigFeign.java
...rc/main/java/com/xxfc/platform/app/feign/ConfigFeign.java
+2
-0
VehiclePublish.java
...java/com/xxfc/platform/vehicle/entity/VehiclePublish.java
+11
-4
VehiclePublishFindDTO.java
...xxfc/platform/vehicle/pojo/dto/VehiclePublishFindDTO.java
+52
-0
VehiclePublishGoodsVo.java
.../xxfc/platform/vehicle/pojo/vo/VehiclePublishGoodsVo.java
+22
-0
VehiclePublishVo.java
...a/com/xxfc/platform/vehicle/pojo/vo/VehiclePublishVo.java
+21
-0
pom.xml
xx-vehicle/xx-vehicle-server/pom.xml
+6
-0
VehiclePublishBiz.java
...java/com/xxfc/platform/vehicle/biz/VehiclePublishBiz.java
+80
-1
VehiclePublishGoodsBiz.java
...com/xxfc/platform/vehicle/biz/VehiclePublishGoodsBiz.java
+38
-0
VehiclePublishGoodsMapper.java
...fc/platform/vehicle/mapper/VehiclePublishGoodsMapper.java
+7
-0
VehiclePublishMapper.java
...om/xxfc/platform/vehicle/mapper/VehiclePublishMapper.java
+7
-0
AppVehiclePublishController.java
...fc/platform/vehicle/rest/AppVehiclePublishController.java
+98
-0
VehiclePublishGoodsMapper.xml
...r/src/main/resources/mapper/VehiclePublishGoodsMapper.xml
+22
-0
VehiclePublishMapper.xml
...server/src/main/resources/mapper/VehiclePublishMapper.xml
+51
-0
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/feign/ConfigFeign.java
View file @
fc117367
...
@@ -29,6 +29,8 @@ public interface ConfigFeign {
...
@@ -29,6 +29,8 @@ public interface ConfigFeign {
public
static
final
int
TYPE_COMPANY_CATH
=
89
;
public
static
final
int
TYPE_COMPANY_CATH
=
89
;
public
static
final
int
TYPE_VEHICLE_PUBLISH
=
96
;
@RequestMapping
(
value
=
"/cofig/app/unauth/types"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/cofig/app/unauth/types"
,
method
=
RequestMethod
.
GET
)
ObjectRestResponse
<
List
<
Cofig
>>
getAllByType
(
@RequestParam
(
"types"
)
String
types
);
ObjectRestResponse
<
List
<
Cofig
>>
getAllByType
(
@RequestParam
(
"types"
)
String
types
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehiclePublish.java
View file @
fc117367
...
@@ -3,11 +3,9 @@ package com.xxfc.platform.vehicle.entity;
...
@@ -3,11 +3,9 @@ package com.xxfc.platform.vehicle.entity;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
...
@@ -60,6 +58,11 @@ public class VehiclePublish implements Serializable {
...
@@ -60,6 +58,11 @@ public class VehiclePublish implements Serializable {
private
Integer
waitConfirmNumber
;
private
Integer
waitConfirmNumber
;
@Column
(
name
=
"publish_end_time"
)
@ApiModelProperty
(
value
=
"需求结束时间"
)
private
Long
publishEndTime
;
@Column
(
name
=
"start_time"
)
@Column
(
name
=
"start_time"
)
@ApiModelProperty
(
value
=
"开始时间"
)
@ApiModelProperty
(
value
=
"开始时间"
)
private
Long
startTime
;
private
Long
startTime
;
...
@@ -93,6 +96,10 @@ public class VehiclePublish implements Serializable {
...
@@ -93,6 +96,10 @@ public class VehiclePublish implements Serializable {
@Column
(
name
=
"is_del"
)
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
private
Integer
isDel
;
private
Integer
isDel
;
@Transient
@ApiModelProperty
(
value
=
"调出信息"
)
private
List
<
VehiclePublishGoods
>
publishGoodsList
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehiclePublishFindDTO.java
0 → 100644
View file @
fc117367
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
import
com.github.wxiaoqi.security.common.vo.DataInter
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 16:27
*/
@Data
public
class
VehiclePublishFindDTO
extends
PageParam
implements
DataInter
{
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇;4-豪车"
)
private
Integer
goodsType
;
@ApiModelProperty
(
"类型:1-我要车;2-我有车"
)
private
Integer
type
;
@ApiModelProperty
(
"类型:1-调度信息;2-我的发布"
)
private
Integer
selectType
;
@ApiModelProperty
(
"店铺id"
)
private
Integer
companyId
;
@ApiModelProperty
(
"需求id"
)
private
Integer
publishId
;
@ApiModelProperty
(
"当前时间"
)
private
Long
nowTime
;
List
<
Integer
>
dataCorporationIds
;
List
<
Integer
>
dataCompanyIds
;
Integer
bizType
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/VehiclePublishGoodsVo.java
0 → 100644
View file @
fc117367
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
VehiclePublishGoodsVo
extends
VehiclePublishGoods
{
@ApiModelProperty
(
"品牌名称"
)
String
brandName
;
@ApiModelProperty
(
"型号名称"
)
String
categoryName
;
private
List
<
VehicleExtensionVO
>
extensionVOS
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/VehiclePublishVo.java
0 → 100644
View file @
fc117367
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
VehiclePublishVo
extends
VehiclePublish
{
@ApiModelProperty
(
"店铺名称"
)
String
companyName
;
@ApiModelProperty
(
"需求商品"
)
List
<
VehiclePublishGoodsVo
>
publishGoodsVos
;
}
xx-vehicle/xx-vehicle-server/pom.xml
View file @
fc117367
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
<artifactId>
xx-order-api
</artifactId>
<artifactId>
xx-order-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-app-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishBiz.java
View file @
fc117367
...
@@ -2,20 +2,99 @@ package com.xxfc.platform.vehicle.biz;
...
@@ -2,20 +2,99 @@ package com.xxfc.platform.vehicle.biz;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.feign.ConfigFeign
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.mapper.VehiclePublishMapper
;
import
com.xxfc.platform.vehicle.mapper.VehiclePublishMapper
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Service
@Slf4j
@Slf4j
public
class
VehiclePublishBiz
extends
BaseBiz
<
VehiclePublishMapper
,
VehiclePublish
>
{
public
class
VehiclePublishBiz
extends
BaseBiz
<
VehiclePublishMapper
,
VehiclePublish
>
{
public
void
addOrUpd
(){
@Autowired
VehiclePublishGoodsBiz
publishGoodsBiz
;
@Autowired
ConfigFeign
configFeign
;
public
void
addOrUpd
(
VehiclePublish
vehiclePublish
){
List
<
VehiclePublishGoods
>
goodsList
=
vehiclePublish
.
getPublishGoodsList
();
if
(
CollectionUtils
.
isEmpty
(
goodsList
)){
throw
new
BaseException
(
"参数不能为空"
,
ResultCode
.
FAILED_CODE
);
}
vehiclePublish
.
setId
(
null
);
insertSelective
(
vehiclePublish
);
Integer
id
=
vehiclePublish
.
getId
();
JSONObject
config
=
getConfig
();
for
(
VehiclePublishGoods
publishGoods
:
goodsList
){
publishGoods
.
setId
(
null
);
publishGoods
.
setPublishId
(
id
);
publishGoods
.
setGoodsType
(
vehiclePublish
.
getGoodsType
());
publishGoods
.
setPublishAmount
(
config
.
getBigDecimal
(
"publishAmount"
));
publishGoods
.
setReceiveAmount
(
config
.
getBigDecimal
(
"receiveAmount"
));
publishGoodsBiz
.
insertSelective
(
publishGoods
);
}
}
public
List
<
VehiclePublishVo
>
getList
(
VehiclePublishFindDTO
publishFindDTO
){
return
mapper
.
selectList
(
publishFindDTO
);
}
public
PageDataVO
<
VehiclePublishVo
>
selectList
(
VehiclePublishFindDTO
publishFindDTO
){
Integer
page
=
publishFindDTO
.
getPage
()
==
null
?
1
:
publishFindDTO
.
getPage
();
Integer
limit
=
publishFindDTO
.
getLimit
()
==
null
?
10
:
publishFindDTO
.
getLimit
();
PageHelper
.
startPage
(
page
,
limit
);
PageInfo
<
VehiclePublishVo
>
pageInfo
=
new
PageInfo
<>(
getList
(
publishFindDTO
));
PageDataVO
<
VehiclePublishVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
pageInfo
);
List
<
VehiclePublishVo
>
list
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
VehiclePublishVo
publishVo
:
list
){
publishFindDTO
.
setPublishId
(
publishVo
.
getId
());
publishVo
.
setPublishGoodsVos
(
publishGoodsBiz
.
getList
(
publishFindDTO
));
}
}
return
pageDataVO
;
}
//入驻规则管理
public
JSONObject
getConfig
(){
try
{
List
<
Cofig
>
list
=
configFeign
.
getAllByType
(
ConfigFeign
.
TYPE_VEHICLE_PUBLISH
+
""
).
getData
();
if
(
list
!=
null
&&
list
.
size
()>
0
){
String
params
=
list
.
get
(
0
).
getParams
();
JSONObject
object
=
JSONObject
.
parseObject
(
params
);
return
object
;
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);;
}
return
null
;
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishGoodsBiz.java
View file @
fc117367
...
@@ -5,15 +5,53 @@ package com.xxfc.platform.vehicle.biz;
...
@@ -5,15 +5,53 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.mapper.VehiclePublishGoodsMapper
;
import
com.xxfc.platform.vehicle.mapper.VehiclePublishGoodsMapper
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
@Slf4j
@Slf4j
public
class
VehiclePublishGoodsBiz
extends
BaseBiz
<
VehiclePublishGoodsMapper
,
VehiclePublishGoods
>
{
public
class
VehiclePublishGoodsBiz
extends
BaseBiz
<
VehiclePublishGoodsMapper
,
VehiclePublishGoods
>
{
@Autowired
VehicleExtensionBiz
extensionBiz
;
public
List
<
VehiclePublishGoodsVo
>
getList
(
VehiclePublishFindDTO
publishFindDTO
){
List
<
VehiclePublishGoodsVo
>
list
=
mapper
.
selectList
(
publishFindDTO
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
VehiclePublishGoodsVo
publishGoodsVo
:
list
){
String
vehicleId
=
publishGoodsVo
.
getVehicleId
();
List
<
VehicleExtensionVO
>
extensionVOS
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
vehicleId
)){
extensionVOS
=
extensionBiz
.
getTree
(
vehicleId
);
}
else
{
String
extensionList
=
publishGoodsVo
.
getExtensionList
();
if
(
StringUtils
.
isNotBlank
(
extensionList
)){
extensionVOS
=
extensionBiz
.
getTreeByApply
(
Arrays
.
asList
(
extensionList
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
()));
}
}
publishGoodsVo
.
setExtensionVOS
(
extensionVOS
);
}
}
return
list
;
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehiclePublishGoodsMapper.java
View file @
fc117367
...
@@ -2,9 +2,16 @@ package com.xxfc.platform.vehicle.mapper;
...
@@ -2,9 +2,16 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
VehiclePublishGoodsMapper
extends
Mapper
<
VehiclePublishGoods
>,
SelectByIdListMapper
<
VehiclePublishGoods
,
Integer
>
{
public
interface
VehiclePublishGoodsMapper
extends
Mapper
<
VehiclePublishGoods
>,
SelectByIdListMapper
<
VehiclePublishGoods
,
Integer
>
{
List
<
VehiclePublishGoodsVo
>
selectList
(
VehiclePublishFindDTO
publishFindDTO
);
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehiclePublishMapper.java
View file @
fc117367
...
@@ -2,9 +2,16 @@ package com.xxfc.platform.vehicle.mapper;
...
@@ -2,9 +2,16 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
VehiclePublishMapper
extends
Mapper
<
VehiclePublish
>,
SelectByIdListMapper
<
VehiclePublish
,
Integer
>
{
public
interface
VehiclePublishMapper
extends
Mapper
<
VehiclePublish
>,
SelectByIdListMapper
<
VehiclePublish
,
Integer
>
{
List
<
VehiclePublishVo
>
selectList
(
VehiclePublishFindDTO
publishFindDTO
);
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/AppVehiclePublishController.java
0 → 100644
View file @
fc117367
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.BeanUtils
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.biz.VehicleApplyBiz
;
import
com.xxfc.platform.vehicle.biz.VehiclePublishBiz
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleApply
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleApplyFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping
(
"app/publish"
)
@Api
(
tags
=
{
"商品需求"
})
public
class
AppVehiclePublishController
extends
BaseController
<
VehiclePublishBiz
>
{
@PostMapping
(
"save"
)
@ApiModelProperty
(
"发布需求"
)
public
ObjectRestResponse
apply
(
@RequestBody
VehiclePublish
vehiclePublish
)
{
if
(
vehiclePublish
.
getCompanyId
()
==
null
||
vehiclePublish
.
getCompanyId
()
==
0
){
List
<
Integer
>
companyIds
=
getBusinessUserCompanyIds
();
if
(
companyIds
!=
null
&&
companyIds
.
size
()
>
0
){
vehiclePublish
.
setCompanyId
(
companyIds
.
get
(
0
));
}
}
baseBiz
.
addOrUpd
(
vehiclePublish
);
return
ObjectRestResponse
.
succ
();
}
@GetMapping
(
"app/unauth/selectList"
)
@ApiModelProperty
(
"需求列表"
)
@IgnoreUserToken
public
ObjectRestResponse
selectList
(
VehiclePublishFindDTO
publishFindDTO
)
{
publishFindDTO
.
setSelectType
(
1
);
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
publishFindDTO
));
}
@GetMapping
(
"selectListByCompany"
)
@ApiModelProperty
(
"我的发布"
)
public
ObjectRestResponse
selectListByCompany
(
VehiclePublishFindDTO
publishFindDTO
)
{
if
(
publishFindDTO
.
getCompanyId
()
==
null
||
publishFindDTO
.
getCompanyId
()
==
0
){
List
<
Integer
>
companyIds
=
getBusinessUserCompanyIds
();
if
(
companyIds
!=
null
&&
companyIds
.
size
()
>
0
){
publishFindDTO
.
setCompanyId
(
companyIds
.
get
(
0
));
}
}
publishFindDTO
.
setSelectType
(
2
);
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
publishFindDTO
));
}
@GetMapping
(
"app/unauth/detail"
)
@ApiModelProperty
(
"详情"
)
@IgnoreUserToken
public
ObjectRestResponse
detail
(
VehiclePublishFindDTO
publishFindDTO
)
{
PageDataVO
<
VehiclePublishVo
>
pageDataVO
=
baseBiz
.
selectList
(
publishFindDTO
);
List
<
VehiclePublishVo
>
list
=
pageDataVO
.
getData
();
VehiclePublishVo
publishVo
=
new
VehiclePublishVo
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
publishVo
=
list
.
get
(
0
);
}
return
ObjectRestResponse
.
succ
(
publishVo
);
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehiclePublishGoodsMapper.xml
0 → 100644
View file @
fc117367
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehiclePublishGoodsMapper"
>
<select
id=
"selectList"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO"
>
SELECT g.*, IFNULL(b1.cn_name,b.cn_name) as brandName,IFNULL(c1.`name`,c.`name`) as categoryName FROM vehicle_publish_goods g
LEFT JOIN vehicle v ON g.vehicle_id=v.id
LEFT JOIN vehicle_brand b1 ON v.brand_id=b1.id
LEFT JOIN vehicle_category c1 ON v.category_id=c1.id
LEFT JOIN vehicle_brand b ON g.brand_id=b.id
LEFT JOIN vehicle_category c ON g.category_id=c.id
<where>
g.is_del = 0
<if
test=
"publishId != null and publishId > 0"
>
AND g.`publish_id`= #{publishId}
</if>
</where>
order by g.number DESC
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehiclePublishMapper.xml
0 → 100644
View file @
fc117367
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehiclePublishMapper"
>
<select
id=
"selectList"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO"
>
SELECT p.*,c.`name` as companyName FROM vehicle_publish p
LEFT JOIN branch_company c ON p.company_id = c.id
<where>
p.is_del = 0
<if
test=
"type != null "
>
AND p.`type`= #{type}
</if>
<if
test=
"companyId != null and companyId > 0"
>
AND p.`company_id`= #{companyId}
</if>
<if
test=
"goodsType != null "
>
AND p.`goods_type`= #{goodsType}
</if>
<if
test=
"nowTime != null and nowTime > 0"
>
AND p.`publish_end_time` >= #{nowTime}
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and p.id in
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and p.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
</where>
<if
test=
"selectType != null "
>
<choose>
<when
test=
"selectType == 1"
>
order by p.publish_end_time ASC
</when>
<when
test=
"selectType == 2"
>
order by p.wait_confirm_number DESC,p.publish_end_time ASC
</when>
<otherwise>
order by p.id DESC
</otherwise>
</choose>
</if>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment