Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
service_mall
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
冯秋丽
service_mall
Commits
4c25d0df
Commit
4c25d0df
authored
Dec 08, 2020
by
冯秋丽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页接口
parent
a6a21383
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1852 additions
and
285 deletions
+1852
-285
pom.xml
pom.xml
+5
-0
Plan.java
src/main/java/com/servicemall/loyalty/data/Plan.java
+64
-65
Selected.java
src/main/java/com/servicemall/loyalty/data/Selected.java
+64
-0
DemoDto.java
src/main/java/com/servicemall/loyalty/dto/DemoDto.java
+33
-0
DemoOutputDto.java
src/main/java/com/servicemall/loyalty/dto/DemoOutputDto.java
+29
-0
SelectedMicro.java
...ain/java/com/servicemall/loyalty/micro/SelectedMicro.java
+71
-0
SeletedService.java
.../java/com/servicemall/loyalty/service/SeletedService.java
+28
-0
Coupon.java
src/main/java/com/servicemall/right/data/Coupon.java
+633
-0
CouponFeign.bak
src/main/java/com/servicemall/right/feign/CouponFeign.bak
+33
-0
CouponMapper.java
src/main/java/com/servicemall/right/mapper/CouponMapper.java
+29
-0
CouponMicro.java
src/main/java/com/servicemall/right/micro/CouponMicro.java
+363
-0
CouponService.java
...ain/java/com/servicemall/right/service/CouponService.java
+239
-0
Slider.java
src/main/java/com/servicemall/website/data/Slider.java
+11
-0
SliderMicro.java
src/main/java/com/servicemall/website/micro/SliderMicro.java
+5
-4
SliderService.java
...n/java/com/servicemall/website/service/SliderService.java
+29
-0
application-dev.properties
src/main/resources/application-dev.properties
+2
-2
PlanMapper.xml
src/main/resources/mybatis/mapper/PlanMapper.xml
+214
-214
No files found.
pom.xml
View file @
4c25d0df
...
@@ -103,6 +103,11 @@
...
@@ -103,6 +103,11 @@
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
<version>
1.18.12
</version>
<version>
1.18.12
</version>
</dependency>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-common
</artifactId>
<version>
2.9.2
</version>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/servicemall/loyalty/data/Plan.java
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
data
;
package
com
.
servicemall
.
loyalty
.
data
;
import
team.bangbang.config.data.Item
;
import
java.util.Date
;
import
java.util.Date
;
import
team.bangbang.common.CommonMPI
;
import
team.bangbang.common.CommonMPI
;
...
@@ -22,6 +21,12 @@ public class Plan {
...
@@ -22,6 +21,12 @@ public class Plan {
/* 购买数量限制 */
/* 购买数量限制 */
private
Integer
buyAmountLimit
=
null
;
private
Integer
buyAmountLimit
=
null
;
/* 是否显示在精选位置{0:否 1:是} */
private
Integer
selectedStatus
=
null
;
/* 核销时是否绑定车辆使用{0:否 1:是} */
private
Integer
bindingUseStatus
=
null
;
/* 厂家价格,单位 元 */
/* 厂家价格,单位 元 */
private
Double
factoryGuidePrice
=
null
;
private
Double
factoryGuidePrice
=
null
;
...
@@ -31,12 +36,6 @@ public class Plan {
...
@@ -31,12 +36,6 @@ public class Plan {
/* 统一售价,单位 元 */
/* 统一售价,单位 元 */
private
Double
uniformPrice
=
null
;
private
Double
uniformPrice
=
null
;
/* 是否显示在精选位置{0:否 1:是} */
private
Integer
selectedStatus
=
null
;
/* 核销时是否绑定车辆使用{0:否 1:是} */
private
Integer
bindingUseStatus
=
null
;
/* 付款方式{1:定金 2:全款} */
/* 付款方式{1:定金 2:全款} */
private
Integer
payTypeFlag
=
null
;
private
Integer
payTypeFlag
=
null
;
...
@@ -64,18 +63,18 @@ public class Plan {
...
@@ -64,18 +63,18 @@ public class Plan {
/* 活动轮播图 */
/* 活动轮播图 */
private
String
activityImage
=
null
;
private
String
activityImage
=
null
;
/* 创建人编号 */
private
Long
creatorId
=
null
;
/* 修改人编号 */
private
Long
updatorId
=
null
;
/* 删除状态{0:否 1:是} */
/* 删除状态{0:否 1:是} */
private
Integer
delStatus
=
null
;
private
Integer
delStatus
=
null
;
/* 生效状态{1:待生效 2:生效中 3:已暂停 4:已结束} */
/* 生效状态{1:待生效 2:生效中 3:已暂停 4:已结束} */
private
Integer
activeStatus
=
null
;
private
Integer
activeStatus
=
null
;
/* 创建人编号 */
private
Long
creatorId
=
null
;
/* 修改人编号 */
private
Long
updatorId
=
null
;
/* 购买起始时间 */
/* 购买起始时间 */
private
Date
buyStartTime
=
null
;
private
Date
buyStartTime
=
null
;
/* 购买起始时间 (查询上线) */
/* 购买起始时间 (查询上线) */
...
@@ -156,6 +155,34 @@ public class Plan {
...
@@ -156,6 +155,34 @@ public class Plan {
this
.
buyAmountLimit
=
buyAmountLimit
;
this
.
buyAmountLimit
=
buyAmountLimit
;
}
}
/**
* @return 是否显示在精选位置{0:否 1:是}
*/
public
Integer
getSelectedStatus
()
{
return
selectedStatus
;
}
/**
* @param selectedStatus 是否显示在精选位置{0:否 1:是}
*/
public
void
setSelectedStatus
(
Integer
selectedStatus
)
{
this
.
selectedStatus
=
selectedStatus
;
}
/**
* @return 核销时是否绑定车辆使用{0:否 1:是}
*/
public
Integer
getBindingUseStatus
()
{
return
bindingUseStatus
;
}
/**
* @param bindingUseStatus 核销时是否绑定车辆使用{0:否 1:是}
*/
public
void
setBindingUseStatus
(
Integer
bindingUseStatus
)
{
this
.
bindingUseStatus
=
bindingUseStatus
;
}
/**
/**
* @return 厂家价格,单位 元
* @return 厂家价格,单位 元
*/
*/
...
@@ -206,34 +233,6 @@ public class Plan {
...
@@ -206,34 +233,6 @@ public class Plan {
this
.
uniformPrice
=
uniformPrice
;
this
.
uniformPrice
=
uniformPrice
;
}
}
/**
* @return 是否显示在精选位置{0:否 1:是}
*/
public
Integer
getSelectedStatus
()
{
return
selectedStatus
;
}
/**
* @param selectedStatus 是否显示在精选位置{0:否 1:是}
*/
public
void
setSelectedStatus
(
Integer
selectedStatus
)
{
this
.
selectedStatus
=
selectedStatus
;
}
/**
* @return 核销时是否绑定车辆使用{0:否 1:是}
*/
public
Integer
getBindingUseStatus
()
{
return
bindingUseStatus
;
}
/**
* @param bindingUseStatus 核销时是否绑定车辆使用{0:否 1:是}
*/
public
void
setBindingUseStatus
(
Integer
bindingUseStatus
)
{
this
.
bindingUseStatus
=
bindingUseStatus
;
}
/**
/**
* @return 付款方式{1:定金 2:全款}
* @return 付款方式{1:定金 2:全款}
*/
*/
...
@@ -369,59 +368,59 @@ public class Plan {
...
@@ -369,59 +368,59 @@ public class Plan {
}
}
/**
/**
* @return
创建人编号
* @return
删除状态{0:否 1:是}
*/
*/
public
Long
getCreatorId
()
{
public
Integer
getDelStatus
()
{
return
creatorId
;
return
delStatus
;
}
}
/**
/**
* @param
creatorId 创建人编号
* @param
delStatus 删除状态{0:否 1:是}
*/
*/
public
void
set
CreatorId
(
Long
creatorId
)
{
public
void
set
DelStatus
(
Integer
delStatus
)
{
this
.
creatorId
=
creatorId
;
this
.
delStatus
=
delStatus
;
}
}
/**
/**
* @return
修改人编号
* @return
生效状态{1:待生效 2:生效中 3:已暂停 4:已结束}
*/
*/
public
Long
getUpdatorId
()
{
public
Integer
getActiveStatus
()
{
return
updatorId
;
return
activeStatus
;
}
}
/**
/**
* @param
updatorId 修改人编号
* @param
activeStatus 生效状态{1:待生效 2:生效中 3:已暂停 4:已结束}
*/
*/
public
void
set
UpdatorId
(
Long
updatorId
)
{
public
void
set
ActiveStatus
(
Integer
activeStatus
)
{
this
.
updatorId
=
updatorId
;
this
.
activeStatus
=
activeStatus
;
}
}
/**
/**
* @return
删除状态{0:否 1:是}
* @return
创建人编号
*/
*/
public
Integer
getDelStatus
()
{
public
Long
getCreatorId
()
{
return
delStatus
;
return
creatorId
;
}
}
/**
/**
* @param
delStatus 删除状态{0:否 1:是}
* @param
creatorId 创建人编号
*/
*/
public
void
set
DelStatus
(
Integer
delStatus
)
{
public
void
set
CreatorId
(
Long
creatorId
)
{
this
.
delStatus
=
delStatus
;
this
.
creatorId
=
creatorId
;
}
}
/**
/**
* @return
生效状态{1:待生效 2:生效中 3:已暂停 4:已结束}
* @return
修改人编号
*/
*/
public
Integer
getActiveStatus
()
{
public
Long
getUpdatorId
()
{
return
activeStatus
;
return
updatorId
;
}
}
/**
/**
* @param
activeStatus 生效状态{1:待生效 2:生效中 3:已暂停 4:已结束}
* @param
updatorId 修改人编号
*/
*/
public
void
set
ActiveStatus
(
Integer
activeStatus
)
{
public
void
set
UpdatorId
(
Long
updatorId
)
{
this
.
activeStatus
=
activeStatus
;
this
.
updatorId
=
updatorId
;
}
}
/**
/**
...
...
src/main/java/com/servicemall/loyalty/data/Selected.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
data
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* 礼遇计划 - POJO
* 对应数据库表:loyalty_plan_base
*
* @author qiuli.feng
* @version 1.0 2020-12-08
*/
public
class
Selected
implements
Serializable
{
/* 编号(关键字) */
@ApiModelProperty
(
value
=
"编号"
,
required
=
true
)
private
Long
id
=
null
;
/* 精选名称(计划/活动/产品(只含轮胎)) */
@ApiModelProperty
(
value
=
"精选名称(计划/活动/产品(只含轮胎)"
,
required
=
true
)
private
String
name
=
null
;
/* 图片 */
@ApiModelProperty
(
value
=
"图片"
,
required
=
true
)
private
String
image
=
null
;
/* 精选类型 */
@ApiModelProperty
(
value
=
"精选类型{1:计划2:活动3:轮胎}"
,
required
=
true
)
private
Integer
type
=
null
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getImage
()
{
return
image
;
}
public
void
setImage
(
String
image
)
{
this
.
image
=
image
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
}
src/main/java/com/servicemall/loyalty/dto/DemoDto.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
dto
;
import
com.sun.istack.NotNull
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@ApiModel
(
value
=
"演示类"
,
description
=
"请求参数类"
)
public
class
DemoDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
@ApiModelProperty
(
value
=
"defaultStr"
,
example
=
"mockStrValue"
)
private
String
strDemo
;
@NotNull
@ApiModelProperty
(
example
=
"1234343523"
,
required
=
true
)
private
Long
longNum
;
@NotNull
@ApiModelProperty
(
example
=
"111111.111"
)
private
Double
doubleNum
;
@NotNull
@ApiModelProperty
(
example
=
"2018-12-04T13:46:56.711Z"
)
private
Date
date
;
}
src/main/java/com/servicemall/loyalty/dto/DemoOutputDto.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
dto
;
import
com.sun.istack.NotNull
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
lombok.Data
;
@Data
public
class
DemoOutputDto
{
private
String
res
;
@NotNull
@ApiModelProperty
(
value
=
"defaultOutputStr"
,
example
=
"mockOutputStrValue"
)
private
String
outputStrDemo
;
@NotNull
@ApiModelProperty
(
example
=
"6666666"
,
required
=
true
)
private
Long
outputLongNum
;
@NotNull
@ApiModelProperty
(
example
=
"88888.888"
)
private
Double
outputDoubleNum
;
@NotNull
@ApiModelProperty
(
example
=
"2018-12-12T11:11:11.111Z"
)
private
Date
outputDate
;
}
src/main/java/com/servicemall/loyalty/micro/SelectedMicro.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
micro
;
import
com.servicemall.loyalty.data.Selected
;
import
com.servicemall.loyalty.service.SeletedService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
team.bangbang.common.data.Pagination
;
import
team.bangbang.common.data.response.DataResponse
;
import
team.bangbang.common.data.response.ResponseBase
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 精选 -
*
* 对应
*
* @author 帮帮组
* @version 1.0 2020-12-08
*/
@Api
(
description
=
"ServiceMall首页精选API接口"
)
@RestController
@CrossOrigin
(
allowCredentials
=
"true"
,
allowedHeaders
=
"*"
,
origins
=
"*"
,
maxAge
=
3600
)
@RequestMapping
(
"/microservice/loyalty/"
)
public
class
SelectedMicro
{
/**
* 查询精选列表 计划/活动/产品(只含轮胎),并转化为相应的POJO对象列表
*
*
* @return 返回结果记录,并转化为相应的POJO对象列表
*/
@PostMapping
(
"/selectedlist"
)
@ApiOperation
(
value
=
"获取精选列表"
,
notes
=
"精选包含计划/活动/轮胎等"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageNo"
,
value
=
"分页参数 - 页号,默认为1"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页参数 - 每页最大记录数量,默认为10"
,
dataType
=
"Integer"
)
})
public
ResponseBase
list
(
Integer
pageNo
,
Integer
pageSize
)
{
if
(
pageNo
==
null
)
pageNo
=
1
;
if
(
pageSize
==
null
)
pageSize
=
10
;
// 分页数据
Pagination
pagination
=
new
Pagination
();
pagination
.
setRecordCount
(
Integer
.
MAX_VALUE
);
pagination
.
setMaxResults
(
pageSize
);
pagination
.
setPageNo
(
pageNo
);
// 统计符合条件的结果记录数量
int
recordCount
=
0
;
pagination
.
setRecordCount
(
recordCount
);
List
<
Selected
>
selectedList
=
SeletedService
.
list
();
DataResponse
<
Map
<
String
,
Object
>>
result
=
new
DataResponse
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
datas
=
new
HashMap
<
String
,
Object
>();
datas
.
put
(
"list"
,
selectedList
);
datas
.
put
(
"pagination"
,
pagination
);
result
.
setData
(
datas
);
return
result
;
}
}
src/main/java/com/servicemall/loyalty/service/SeletedService.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
loyalty
.
service
;
import
com.servicemall.loyalty.data.Selected
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 精选 - Service
*
* @author qiuli.feng
* @version 1.0 2020-12-08
*/
public
class
SeletedService
{
/**
* 查询
*/
public
static
List
<
Selected
>
list
()
{
List
<
Selected
>
selectedList
=
new
ArrayList
<>();
Selected
selected
=
new
Selected
();
selected
.
setId
(
1
l
);
selected
.
setImage
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
selected
.
setName
(
"轮胎"
);
selectedList
.
add
(
selected
);
return
selectedList
;
}
}
src/main/java/com/servicemall/right/data/Coupon.java
0 → 100644
View file @
4c25d0df
This diff is collapsed.
Click to expand it.
src/main/java/com/servicemall/right/feign/CouponFeign.bak
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
right
.
feign
;
import
org
.
springframework
.
cloud
.
openfeign
.
FeignClient
;
import
team
.
bangbang
.
spring
.
microservice
.
IFeign
;
import
com
.
servicemall
.
right
.
data
.
Coupon
;
/**
*
优惠权益
-
FeignClient
*
对应微服务:
com
.
servicemall
.
right
.
micro
.
CouponMicro
*
*
使用时请按照以下
2
步执行:
*
<
pre
>
*
1.
将
FeignClien
注解的
value
值替换为微服务提供者的工程名称;
*
即提供者工程
application
.
properties
中的
spring
.
application
.
name
配置
*
注意工程名称不能含有下划线,但可以使用减号
*
*
2.
提取本类及相关的
POJO
文件并放入调用者工程中,别的类及文件不需要带入。具体为:
*
com
.
servicemall
.
right
.
data
.
Coupon
*
com
.
servicemall
.
right
.
feign
.
CouponFeign
*
</
pre
>
*
*
@
author
帮帮组
*
@
version
1.0
2020
-
12
-
08
*/
@
FeignClient
(
value
=
"[TODO:此处要填入固定值,不可引用配置]"
,
path
=
"/microservice/coupon"
)
public
interface
CouponFeign
extends
IFeign
<
Coupon
>
{
/**************************************************************************
*
!!除非设计、指导人员有特别说明,否则此处不得随意增加、修改、删除!!
*
------------------------------------
*
*************************************************************************/
}
src/main/java/com/servicemall/right/mapper/CouponMapper.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
right
.
mapper
;
import
team.bangbang.spring.db.IMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.servicemall.right.data.Coupon
;
/**
* 优惠权益 - Mapper
* 对应数据库表:right_coupon_base
*
* @author 帮帮组
* @version 1.0 2020-12-08
*/
@Mapper
public
interface
CouponMapper
extends
IMapper
<
Coupon
>
{
/**************************************************************************
* !!除非设计、指导人员有特别说明,否则此处不得随意增加、修改、删除!!
* ------------------------------------
*
* 如确需添加自定义方法,相应的mapper.xml中应配置SQL块,注意3点:
*
* 1. SQL块的id须与方法名保持一致;
*
* 2. 方法中的参数添加@Param注解;
*
* 3. SQL块中的参数对象名与@Param注解内名称一致。
*
*************************************************************************/
}
src/main/java/com/servicemall/right/micro/CouponMicro.java
0 → 100644
View file @
4c25d0df
This diff is collapsed.
Click to expand it.
src/main/java/com/servicemall/right/service/CouponService.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
right
.
service
;
import
java.util.*
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
team.bangbang.common.CommonMPI
;
import
team.bangbang.common.data.KeyValue
;
import
team.bangbang.common.data.Pagination
;
import
com.servicemall.right.data.Coupon
;
import
com.servicemall.right.mapper.CouponMapper
;
import
org.springframework.stereotype.Service
;
/**
* 优惠权益 - Service
*
* @author 帮帮组
* @version 1.0 2020-12-08
*/
@Service
public
final
class
CouponService
{
/* 优惠权益(Coupon)Mapper */
@Resource
private
CouponMapper
_couponMapper
=
null
;
/* 设置static的Mapper对象,主要是为了兼顾Service层的static方法需要 */
private
static
CouponMapper
couponMapper
=
null
;
@PostConstruct
public
void
init
()
{
// 设置static的Mapper对象,主要是为了兼顾Service层的static方法需要
couponMapper
=
_couponMapper
;
}
/**
* 得到指定的优惠权益
*
* @param id
* 指定的权益编号
* @return 优惠权益
*/
public
static
Coupon
getObject
(
Long
id
)
{
if
(
couponMapper
==
null
)
{
return
null
;
}
// 参数校验
if
(
id
==
null
||
id
==
0L
)
{
return
null
;
}
// 查询条件
Coupon
form
=
new
Coupon
();
form
.
setId
(
id
);
return
getObject
(
form
,
null
);
}
/**
* 查询一条优惠权益,并转化为相应的POJO对象
*
* @param coupon
* 查询条件,不能为null
* @param appendix
* 附加限定条件
* @return 返回结果记录,并转化为相应的POJO对象
*/
public
static
Coupon
getObject
(
Coupon
coupon
,
String
appendix
)
{
if
(
couponMapper
==
null
)
{
return
null
;
}
// 参数校验
if
(
coupon
==
null
&&
(
appendix
==
null
||
appendix
.
trim
().
length
()
==
0
))
{
return
null
;
}
return
couponMapper
.
getObject
(
coupon
,
appendix
);
}
/**
* 插入一条优惠权益
*
* @param data
* 插入的数据,不能为null
* @return 1:成功 其它:失败
*/
public
static
int
insert
(
Coupon
data
)
{
if
(
couponMapper
==
null
)
{
return
0
;
}
if
(
data
.
getId
()
==
null
)
{
// 返回创建的关键字的值,如果是系统自动生成的,则此处不返回
long
id
=
CommonMPI
.
generateSequenceId
();
data
.
setId
(
id
);
}
return
couponMapper
.
insert
(
data
);
}
/**
* 删除优惠权益
*
* @param where
* 删除条件,不能为null
* @param appendix
* 附加限定条件
* @return 成功删除的记录数量
*/
public
static
int
delete
(
Coupon
where
,
String
appendix
)
{
if
(
couponMapper
==
null
)
{
return
0
;
}
return
couponMapper
.
delete
(
where
,
appendix
);
}
/**
* 修改优惠权益
*
* @param where
* 更新条件,不能为null
* @param appendix
* 附加限定条件
* @param data
* 更新数据,不能为null
* @return 成功修改的记录数量
*/
public
static
int
update
(
Coupon
where
,
String
appendix
,
Coupon
data
)
{
if
(
couponMapper
==
null
)
{
return
0
;
}
return
couponMapper
.
update
(
where
,
appendix
,
data
);
}
/**
* 查询多条优惠权益,并转化为相应的POJO对象列表
*
* @param where
* 更新条件,不能为null
* @param appendix
* 附加限定条件
* @param pagination
* 分页参数,如果分页参数为空,表示不分页
* @return 返回结果记录,并转化为相应的POJO对象列表
*/
public
static
List
<
Coupon
>
list
(
Coupon
where
,
String
appendix
,
Pagination
pagination
)
{
if
(
couponMapper
==
null
)
{
return
Collections
.
emptyList
();
}
return
couponMapper
.
list
(
where
,
appendix
,
pagination
);
}
/**
* 获得符合条件的优惠权益数量
*
* @param where
* 查询条件,不能为null
* @param appendix
* 附加限定条件
* @return 返回记录数量
*/
public
static
int
count
(
Coupon
where
,
String
appendix
)
{
if
(
couponMapper
==
null
)
{
return
0
;
}
return
couponMapper
.
count
(
where
,
appendix
);
}
/**
* 获得有效期类型{1:按日期期间 2:按有效期}列表
*
* @return 有效期类型{1:按日期期间 2:按有效期}列表
*/
public
static
List
<
KeyValue
>
getActiveTypeList
()
{
return
CommonMPI
.
getDictionaryList
(
Coupon
.
activeTypeFlags
);
}
/**
* 获得核销类型{1:订单核销 2:快速核销}列表
*
* @return 核销类型{1:订单核销 2:快速核销}列表
*/
public
static
List
<
KeyValue
>
getUsedTypeList
()
{
return
CommonMPI
.
getDictionaryList
(
Coupon
.
usedTypeFlags
);
}
/**
* 获得是否可核销多次{1:是 2:否}列表
*
* @return 是否可核销多次{1:是 2:否}列表
*/
public
static
List
<
KeyValue
>
getUseNumTypeList
()
{
return
CommonMPI
.
getDictionaryList
(
Coupon
.
useNumTypeFlags
);
}
/**
* 获得每{1:不限制 2:年 3:季度 4:月}列表
*
* @return 每{1:不限制 2:年 3:季度 4:月}列表
*/
public
static
List
<
KeyValue
>
getPhaseTypeList
()
{
return
CommonMPI
.
getDictionaryList
(
Coupon
.
phaseTypeFlags
);
}
/**
* 获得权益类型{1:满减券金额类-整单减2:满减券金额类-每满减3:满减券产品类-整单减4:满减券产品类-每满减 5:折扣券6赠品券7免单券8代金券9动态折扣券}列表
*
* @return 权益类型{1:满减券金额类-整单减2:满减券金额类-每满减3:满减券产品类-整单减4:满减券产品类-每满减 5:折扣券6赠品券7免单券8代金券9动态折扣券}列表
*/
public
static
List
<
KeyValue
>
getRightTypeList
()
{
return
CommonMPI
.
getDictionaryList
(
Coupon
.
rightTypeFlags
);
}
public
static
List
<
Coupon
>
queryCouponList
(
String
dms_code
,
Pagination
pagination
){
List
<
Coupon
>
couponList
=
new
ArrayList
<>();
Coupon
coupon
=
new
Coupon
();
coupon
.
setActiveEndTime
(
new
Date
());
coupon
.
setActiveStartTime
(
new
Date
());
coupon
.
setRightName
(
"代金券"
);
coupon
.
setUsedTypeFlag
(
1
);
coupon
.
setTotalUseNum
(-
1
);
coupon
.
setId
(
1
l
);
coupon
.
setSortValue
(
1
);
Map
<
String
,
Integer
>
map
=
new
HashMap
<
String
,
Integer
>();
map
.
put
(
"price"
,
10
);
coupon
.
setRightContent
(
map
.
toString
());
couponList
.
add
(
coupon
);
return
couponList
;
}
}
src/main/java/com/servicemall/website/data/Slider.java
View file @
4c25d0df
...
@@ -24,6 +24,9 @@ public class Slider {
...
@@ -24,6 +24,9 @@ public class Slider {
/* 轮播图图片地址 */
/* 轮播图图片地址 */
private
String
imageUrl
=
null
;
private
String
imageUrl
=
null
;
/* 双击图片放大 */
private
String
dblclickImage
=
null
;
/* 排序 */
/* 排序 */
private
Integer
sortNo
=
null
;
private
Integer
sortNo
=
null
;
...
@@ -308,6 +311,14 @@ public class Slider {
...
@@ -308,6 +311,14 @@ public class Slider {
this
.
createTimeBottom
=
createTimeBottom
;
this
.
createTimeBottom
=
createTimeBottom
;
}
}
public
String
getDblclickImage
()
{
return
dblclickImage
;
}
public
void
setDblclickImage
(
String
dblclickImage
)
{
this
.
dblclickImage
=
dblclickImage
;
}
/* (non-Javadoc)
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
* @see java.lang.Object#hashCode()
*/
*/
...
...
src/main/java/com/servicemall/website/micro/SliderMicro.java
View file @
4c25d0df
...
@@ -6,7 +6,9 @@ import java.util.HashMap;
...
@@ -6,7 +6,9 @@ import java.util.HashMap;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.servicemall.website.service.SliderService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
...
@@ -43,15 +45,14 @@ public final class SliderMicro {
...
@@ -43,15 +45,14 @@ public final class SliderMicro {
*
*
* @return 返回结果记录,并转化为相应的POJO对象列表
* @return 返回结果记录,并转化为相应的POJO对象列表
*/
*/
@ApiOperation
(
value
=
"轮播图"
,
notes
=
"首页轮播图"
,
httpMethod
=
"POST"
)
@PostMapping
(
"/slidelist"
)
@PostMapping
(
"/slidelist"
)
@ResponseBody
@ResponseBody
public
ResponseBase
slidelist
()
{
public
ResponseBase
slidelist
()
{
DataResponse
<
Map
<
String
,
Object
>>
result
=
new
DataResponse
<
Map
<
String
,
Object
>>();
DataResponse
<
Map
<
String
,
Object
>>
result
=
new
DataResponse
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
datas
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
datas
=
new
HashMap
<
String
,
Object
>();
datas
.
put
(
"list"
,
"sliderList"
);
List
<
Slider
>
sliderList
=
SliderService
.
list
(
);
Slider
slider
=
new
Slider
(
);
datas
.
put
(
"list"
,
sliderList
);
result
.
setData
(
datas
);
result
.
setData
(
datas
);
return
result
;
return
result
;
...
...
src/main/java/com/servicemall/website/service/SliderService.java
0 → 100644
View file @
4c25d0df
package
com
.
servicemall
.
website
.
service
;
import
com.servicemall.website.data.Slider
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 轮播图 - Service
*
* @author qiuli.feng
* @version 1.0 2020-12-08
*/
public
class
SliderService
{
/**
* 查询轮播图
*/
public
static
List
<
Slider
>
list
()
{
List
<
Slider
>
sliderList
=
new
ArrayList
<>();
Slider
slider
=
new
Slider
();
slider
.
setId
(
1
l
);
slider
.
setImageUrl
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
slider
.
setJumpUrl
(
"轮胎"
);
slider
.
setSortNo
(
1
);
sliderList
.
add
(
slider
);
return
sliderList
;
}
}
src/main/resources/application-dev.properties
View file @
4c25d0df
...
@@ -21,8 +21,8 @@ file.attachment.manager.qiniu.bucket=static
...
@@ -21,8 +21,8 @@ file.attachment.manager.qiniu.bucket=static
#file.attachment.manager.qiniu.root=http://static.nari.js.cn/
#file.attachment.manager.qiniu.root=http://static.nari.js.cn/
# database config (1)
# database config (1)
application.druid.url
=
jdbc:postgresql://123.59.55.239:5432/sevicemall_dev
application.druid.url
=
jdbc:postgresql://123.59.55.239:5432/se
r
vicemall_dev
application.druid.driver-class
=
com.postgresql.jdbc
.Driver
application.druid.driver-class
=
org.postgresql
.Driver
application.druid.username
=
postgres
application.druid.username
=
postgres
application.druid.password
=
postgres
application.druid.password
=
postgres
application.druid.initial-size
=
1
application.druid.initial-size
=
1
...
...
src/main/resources/mybatis/mapper/PlanMapper.xml
View file @
4c25d0df
This diff is collapsed.
Click to expand it.
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