Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
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
姚本章
dm_project
Commits
052851e7
Commit
052851e7
authored
Dec 09, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
条件商品列表搜索
parent
39dab40a
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
491 additions
and
250 deletions
+491
-250
update.sql
database/qys/update.sql
+1
-0
LoginController.java
...z/dm/mall/moduls/controller/customer/LoginController.java
+5
-6
MallCustomerController.java
...ll/moduls/controller/customer/MallCustomerController.java
+2
-1
DataGoodsController.java
.../dm/mall/moduls/controller/goods/DataGoodsController.java
+11
-9
MallHotRecommendGoodsController.java
...uls/controller/goods/MallHotRecommendGoodsController.java
+6
-3
DataGoodsApiDto.java
...all/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
+2
-1
DataGoodsListDto.java
...ll/moduls/controller/goods/bean/dto/DataGoodsListDto.java
+202
-0
MallHotRecommendGoodsDto.java
...s/controller/goods/bean/dto/MallHotRecommendGoodsDto.java
+8
-6
DataGoodsListRequest.java
...s/controller/goods/bean/request/DataGoodsListRequest.java
+115
-0
DataGoodsDao.java
.../main/java/com/jz/dm/mall/moduls/mapper/DataGoodsDao.java
+2
-1
MallCustomerDao.java
...in/java/com/jz/dm/mall/moduls/mapper/MallCustomerDao.java
+1
-1
MallHotRecommendGoodsDao.java
...om/jz/dm/mall/moduls/mapper/MallHotRecommendGoodsDao.java
+3
-1
DataGoodsService.java
.../java/com/jz/dm/mall/moduls/service/DataGoodsService.java
+4
-4
MallCustomerService.java
...va/com/jz/dm/mall/moduls/service/MallCustomerService.java
+1
-1
MallHotRecommendGoodsService.java
.../dm/mall/moduls/service/MallHotRecommendGoodsService.java
+3
-1
DataGoodsServiceImpl.java
.../jz/dm/mall/moduls/service/impl/DataGoodsServiceImpl.java
+28
-112
MallCustomerServiceImpl.java
.../dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
+3
-3
MallHotRecommendGoodsServiceImpl.java
...moduls/service/impl/MallHotRecommendGoodsServiceImpl.java
+5
-3
DataGoodsDao.xml
jz-dm-mall/src/main/resources/mapperconf/DataGoodsDao.xml
+73
-89
MallCustomerDao.xml
jz-dm-mall/src/main/resources/mapperconf/MallCustomerDao.xml
+12
-4
MallHotRecommendGoodsDao.xml
...rc/main/resources/mapperconf/MallHotRecommendGoodsDao.xml
+4
-4
No files found.
database/qys/update.sql
0 → 100644
View file @
052851e7
alter
table
t_data_goods
add
use_person
varchar
(
64
)
DEFAULT
'0'
COMMENT
'使用人数'
;
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/LoginController.java
View file @
052851e7
...
...
@@ -47,14 +47,13 @@ public class LoginController {
*/
@PostMapping
(
value
=
"/login"
)
@ApiOperation
(
value
=
"登录功能"
,
notes
=
"登录功能"
)
public
Result
<
MallCustomer
>
login
(
String
username
,
String
password
,
HttpServletRequest
request
)
throws
Exception
{
public
Result
<
CustomerDto
>
login
(
String
username
,
String
password
,
HttpServletRequest
request
)
throws
Exception
{
// 手机
String
ph
=
"^[1][34578]\\d{9}$"
;
// 如果是手机验证
if
(
username
.
matches
(
username
))
{
if
(
username
.
matches
(
ph
))
{
CustomerDto
mallCustomer
=
mallCustomerService
.
selectByPhone
(
username
,
request
);
MallCustomerApiDto
mallCustomerApiDto
=
(
MallCustomerApiDto
)
request
.
getSession
().
getAttribute
(
"mallCustomer"
);
System
.
out
.
print
(
mallCustomerApiDto
.
getAssetsId
());
request
.
getSession
().
getAttribute
(
"mallCustomer"
);
if
(
mallCustomer
!=
null
)
{
if
(
mallCustomer
.
getCustomerPhone
().
equals
(
username
)
&&
mallCustomer
.
getPassword
().
equals
(
password
))
{
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
...
...
@@ -62,7 +61,7 @@ public class LoginController {
return
new
Result
<>(
false
,
"用户名或密码错误!"
,
StatusCode
.
ERROR
);
}
}
MallCustomer
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
CustomerDto
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
if
(
mallCustomer
!=
null
)
{
if
(
mallCustomer
.
getCustomerAccount
().
equals
(
username
)
&&
mallCustomer
.
getPassword
().
equals
(
password
))
{
return
new
Result
<>(
true
,
"登录成功!"
,
StatusCode
.
OK
);
...
...
@@ -139,7 +138,7 @@ public class LoginController {
}
}
// 根据手机号查询用户信息
MallCustomer
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
CustomerDto
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
if
(
mallCustomer
!=
null
)
{
if
(
mallCustomer
.
getCustomerAccount
().
equals
(
username
))
{
return
new
Result
(
false
,
"用户名相同!"
);
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/MallCustomerController.java
View file @
052851e7
...
...
@@ -7,6 +7,7 @@ import com.jz.common.constant.RedisMessageConstant;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.constant.ResultMsg
;
import
com.jz.common.utils.SessionUtils
;
import
com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.StatusCode
;
...
...
@@ -63,7 +64,7 @@ public class MallCustomerController extends BaseController {
}
}
// 根据手机号查询用户信息
MallCustomer
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
CustomerDto
mallCustomer
=
mallCustomerService
.
selectByAccount
(
username
,
request
);
if
(
mallCustomer
!=
null
)
{
if
(
mallCustomer
.
getCustomerAccount
().
equals
(
username
))
{
return
new
Result
(
false
,
"用户名相同"
);
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/DataGoodsController.java
View file @
052851e7
...
...
@@ -5,8 +5,9 @@ import com.jz.common.bean.BaseBeanResponse;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.utils.Result
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest
;
import
com.jz.dm.mall.moduls.entity.DataGoods
;
import
com.jz.dm.mall.moduls.service.DataGoodsService
;
...
...
@@ -15,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
...
...
@@ -32,22 +32,24 @@ public class DataGoodsController extends BaseController {
*/
@Autowired
private
DataGoodsService
dataGoodsService
;
/**列表查询数据商品
* @param dataGoodsRequest
/**
* 列表查询商品数据
* @param dataGoodsListRequest
* @param httpRequest
* @return
*/
@PostMapping
(
value
=
"/findList"
)
public
PageInfoResponse
<
DataGoodsDto
>
findList
(
@RequestBody
DataGoodsRequest
dataGoodsRequest
,
HttpServletRequest
httpRequest
){
PageInfoResponse
<
DataGoodsDto
>
pageInfo
=
new
PageInfoResponse
<
DataGoodsDto
>();
@ApiOperation
(
value
=
"分页展示商品列表"
,
notes
=
"首页点击分类展示商品列表"
)
public
PageInfoResponse
<
DataGoodsListDto
>
findByCategory
(
@RequestBody
DataGoodsListRequest
dataGoodsListRequest
,
HttpServletRequest
httpRequest
)
{
PageInfoResponse
<
DataGoodsListDto
>
pageInfo
=
new
PageInfoResponse
<
DataGoodsListDto
>();
try
{
pageInfo
=
dataGoodsService
.
findList
(
dataGoodsRequest
,
httpRequest
);
pageInfo
=
dataGoodsService
.
findList
(
dataGoods
List
Request
,
httpRequest
);
}
catch
(
Exception
e
)
{
pageInfo
.
setMessage
(
"查询失败"
);
pageInfo
.
setCode
(
Constants
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
pageInfo
;
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/MallHotRecommendGoodsController.java
View file @
052851e7
...
...
@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* 热门推荐商品(TMallHotRecommendGoods)表控制层
*
...
...
@@ -30,9 +32,10 @@ public class MallHotRecommendGoodsController extends BaseController {
@GetMapping
(
value
=
"/popularApi"
)
@ApiOperation
(
value
=
"热门商品api"
,
notes
=
"热门商品api展示"
)
public
Result
<
MallHotRecommendGoodsDto
>
popularApi
()
{
MallHotRecommendGoodsDto
popularApi
=
tMallHotRecommendGoodsService
.
selectByPopularApi
();
return
new
Result
<>(
true
,
"查询热门api成功"
,
StatusCode
.
OK
,
popularApi
);
public
Result
<
List
<
MallHotRecommendGoodsDto
>
>
popularApi
()
{
List
<
MallHotRecommendGoodsDto
>
popularApiList
=
tMallHotRecommendGoodsService
.
selectByPopularApi
();
return
new
Result
<>(
true
,
"查询热门api成功"
,
StatusCode
.
OK
,
popularApi
List
);
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
View file @
052851e7
...
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
...
...
@@ -13,7 +14,7 @@ import java.util.Date;
* @Version:
*/
@ApiModel
(
value
=
"商品详情--商品详情参数对象"
,
description
=
"商品详情参数对象"
)
public
class
DataGoodsApiDto
{
public
class
DataGoodsApiDto
implements
Serializable
{
/**
* api商品id
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/dto/DataGoodsListDto.java
0 → 100644
View file @
052851e7
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
goods
.
bean
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.math.BigDecimal
;
/**
* @ClassName: 商品列表返回对象
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel
(
value
=
"商品列表"
,
description
=
"商品列表参数对象"
)
public
class
DataGoodsListDto
{
/**
* 数据商品id
*/
@ApiModelProperty
(
value
=
"数据商品id"
)
private
Long
dataGoodsId
;
/**
* 商品分类id
*/
@ApiModelProperty
(
value
=
"商品分类id"
)
private
Long
categoryId
;
/**
* 数据商品名称
*/
@ApiModelProperty
(
value
=
"数据商品名称"
)
private
String
dataName
;
/**
* 分类名称
*/
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
categoryName
;
/**
* 数据类型
*/
@ApiModelProperty
(
value
=
"数据类型:01api,02数据包"
)
private
String
dataType
;
/**
* 数据商品标签
*/
@ApiModelProperty
(
value
=
"数据商品标签"
)
private
String
dataLabel
;
/**
* 数据商品图片
*/
@ApiModelProperty
(
value
=
"数据商品图片"
)
private
String
dataPicture
;
/**
* 数据商品价格
*/
@ApiModelProperty
(
value
=
"数据商品价格"
)
private
String
dataPrice
;
/**
* 价格类型
*/
@ApiModelProperty
(
value
=
"价格类型"
)
private
String
priceType
;
/**
* 年(元)
*/
@ApiModelProperty
(
value
=
"年(元)"
)
private
BigDecimal
yearType
;
/**
* 季(元)
*/
@ApiModelProperty
(
value
=
"季(元)"
)
private
BigDecimal
seasonType
;
/**
* 月(元)
*/
@ApiModelProperty
(
value
=
"月(元)"
)
private
BigDecimal
monthType
;
/**
* 次(元)
*/
@ApiModelProperty
(
value
=
"次(元)"
)
private
BigDecimal
secondType
;
public
Long
getDataGoodsId
()
{
return
dataGoodsId
;
}
public
void
setDataGoodsId
(
Long
dataGoodsId
)
{
this
.
dataGoodsId
=
dataGoodsId
;
}
public
Long
getCategoryId
()
{
return
categoryId
;
}
public
void
setCategoryId
(
Long
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
public
String
getDataName
()
{
return
dataName
;
}
public
void
setDataName
(
String
dataName
)
{
this
.
dataName
=
dataName
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
public
String
getDataType
()
{
return
dataType
;
}
public
void
setDataType
(
String
dataType
)
{
this
.
dataType
=
dataType
;
}
public
String
getDataLabel
()
{
return
dataLabel
;
}
public
void
setDataLabel
(
String
dataLabel
)
{
this
.
dataLabel
=
dataLabel
;
}
public
String
getDataPicture
()
{
return
dataPicture
;
}
public
void
setDataPicture
(
String
dataPicture
)
{
this
.
dataPicture
=
dataPicture
;
}
public
String
getDataPrice
()
{
return
dataPrice
;
}
public
void
setDataPrice
(
String
dataPrice
)
{
this
.
dataPrice
=
dataPrice
;
}
public
String
getPriceType
()
{
return
priceType
;
}
public
void
setPriceType
(
String
priceType
)
{
this
.
priceType
=
priceType
;
}
public
BigDecimal
getYearType
()
{
return
yearType
;
}
public
void
setYearType
(
BigDecimal
yearType
)
{
this
.
yearType
=
yearType
;
}
public
BigDecimal
getSeasonType
()
{
return
seasonType
;
}
public
void
setSeasonType
(
BigDecimal
seasonType
)
{
this
.
seasonType
=
seasonType
;
}
public
BigDecimal
getMonthType
()
{
return
monthType
;
}
public
void
setMonthType
(
BigDecimal
monthType
)
{
this
.
monthType
=
monthType
;
}
public
BigDecimal
getSecondType
()
{
return
secondType
;
}
public
void
setSecondType
(
BigDecimal
secondType
)
{
this
.
secondType
=
secondType
;
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/dto/MallHotRecommendGoodsDto.java
View file @
052851e7
...
...
@@ -3,6 +3,8 @@ package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @ClassName:
* @Author: Carl
...
...
@@ -10,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty;
* @Version:
*/
@ApiModel
(
"热门商品api"
)
public
class
MallHotRecommendGoodsDto
{
public
class
MallHotRecommendGoodsDto
implements
Serializable
{
@ApiModelProperty
(
value
=
"数据商品id"
)
private
Long
dataGoodsId
;
...
...
@@ -34,7 +36,7 @@ public class MallHotRecommendGoodsDto {
private
String
discountPrice
;
@ApiModelProperty
(
value
=
"用户使用人数"
)
private
Long
customer
;
private
Long
usePerson
;
public
Long
getDataGoodsId
()
{
return
dataGoodsId
;
...
...
@@ -92,11 +94,11 @@ public class MallHotRecommendGoodsDto {
this
.
discountPrice
=
discountPrice
;
}
public
Long
get
Customer
()
{
return
customer
;
public
Long
get
UsePerson
()
{
return
usePerson
;
}
public
void
set
Customer
(
Long
customer
)
{
this
.
customer
=
customer
;
public
void
set
UsePerson
(
Long
usePerson
)
{
this
.
usePerson
=
usePerson
;
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/request/DataGoodsListRequest.java
0 → 100644
View file @
052851e7
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
goods
.
bean
.
request
;
import
com.jz.common.bean.BasePageBean
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel
(
value
=
"数据集市--数据商品列表参数对象"
,
description
=
"数据商品列表参数对象"
)
public
class
DataGoodsListRequest
extends
BasePageBean
{
/**
* 商品分类id
*/
@ApiModelProperty
(
value
=
"商品分类id"
)
private
Long
categoryId
;
/**
* 价格类型
*/
@ApiModelProperty
(
value
=
"价格类型"
)
private
String
priceType
;
/**
* 综合排序
*/
@ApiModelProperty
(
value
=
"综合排序"
)
private
String
synthesizeRank
;
/**
* 更新时间
*/
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
uptTime
;
/**
* 数据商品名称
*/
@ApiModelProperty
(
value
=
"数据商品名称"
)
private
String
dataName
;
/**
* 使用人数
*/
@ApiModelProperty
(
value
=
"使用人数"
)
private
Long
usePerson
;
/**
* 数据类型
*/
@ApiModelProperty
(
value
=
"数据类型:01api,02数据包"
)
private
String
dataType
;
public
Long
getUsePerson
()
{
return
usePerson
;
}
public
void
setUsePerson
(
Long
usePerson
)
{
this
.
usePerson
=
usePerson
;
}
public
Long
getCategoryId
()
{
return
categoryId
;
}
public
void
setCategoryId
(
Long
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
public
String
getPriceType
()
{
return
priceType
;
}
public
void
setPriceType
(
String
priceType
)
{
this
.
priceType
=
priceType
;
}
public
String
getSynthesizeRank
()
{
return
synthesizeRank
;
}
public
void
setSynthesizeRank
(
String
synthesizeRank
)
{
this
.
synthesizeRank
=
synthesizeRank
;
}
public
Date
getUptTime
()
{
return
uptTime
;
}
public
void
setUptTime
(
Date
uptTime
)
{
this
.
uptTime
=
uptTime
;
}
public
String
getDataName
()
{
return
dataName
;
}
public
void
setDataName
(
String
dataName
)
{
this
.
dataName
=
dataName
;
}
public
String
getDataType
()
{
return
dataType
;
}
public
void
setDataType
(
String
dataType
)
{
this
.
dataType
=
dataType
;
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/DataGoodsDao.java
View file @
052851e7
...
...
@@ -6,6 +6,7 @@ import java.util.Map;
import
com.jz.common.base.BaseMapper
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto
;
import
com.jz.dm.mall.moduls.entity.DataGoods
;
...
...
@@ -57,7 +58,7 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
* @return
* @throws Exception
*/
public
List
<
DataGoodsDto
>
findList
(
Map
<
String
,
Object
>
param
)
throws
Exception
;
public
List
<
DataGoods
List
Dto
>
findList
(
Map
<
String
,
Object
>
param
)
throws
Exception
;
/**主键查询数据商品
* @param DataGoodsId
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/MallCustomerDao.java
View file @
052851e7
...
...
@@ -20,7 +20,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param username
* @return
*/
MallCustomer
selectByAccount
(
String
username
);
CustomerDto
selectByAccount
(
String
username
);
/**
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/MallHotRecommendGoodsDao.java
View file @
052851e7
...
...
@@ -4,6 +4,8 @@ import com.jz.common.base.BaseMapper;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto
;
import
com.jz.dm.mall.moduls.entity.MallHotRecommendGoods
;
import
java.util.List
;
/**
* 热门推荐商品(TMallHotRecommendGoods)表数据库访问层
*
...
...
@@ -13,5 +15,5 @@ import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods;
public
interface
MallHotRecommendGoodsDao
extends
BaseMapper
<
MallHotRecommendGoods
>
{
MallHotRecommendGoodsDto
selectByPopularApi
();
List
<
MallHotRecommendGoodsDto
>
selectByPopularApi
();
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/DataGoodsService.java
View file @
052851e7
...
...
@@ -5,6 +5,8 @@ import com.jz.common.bean.BaseResponse;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest
;
import
com.jz.dm.mall.moduls.entity.DataGoods
;
...
...
@@ -21,12 +23,12 @@ public interface DataGoodsService {
/**条件查询所有数据商品
* @param
DataGoods
Request
* @param
dataGoodsList
Request
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DataGoods
Dto
>
findList
(
DataGoodsRequest
dataGoods
Request
,
HttpServletRequest
httpRequest
)
throws
Exception
;
public
PageInfoResponse
<
DataGoods
ListDto
>
findList
(
DataGoodsListRequest
dataGoodsList
Request
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增数据商品
...
...
@@ -61,6 +63,4 @@ public interface DataGoodsService {
*/
public
BaseResponse
deleteById
(
DataGoodsRequest
dataGoodsRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/MallCustomerService.java
View file @
052851e7
...
...
@@ -19,7 +19,7 @@ public interface MallCustomerService {
* @param username
* @return
*/
MallCustomer
selectByAccount
(
String
username
,
HttpServletRequest
request
);
CustomerDto
selectByAccount
(
String
username
,
HttpServletRequest
request
);
/**
* 通过手机号进行查询
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/MallHotRecommendGoodsService.java
View file @
052851e7
...
...
@@ -2,6 +2,8 @@ package com.jz.dm.mall.moduls.service;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto
;
import
java.util.List
;
/**
* 热门推荐商品(TMallHotRecommendGoods)表服务接口
*
...
...
@@ -15,5 +17,5 @@ public interface MallHotRecommendGoodsService {
* 查询热门api数据
* @return
*/
MallHotRecommendGoodsDto
selectByPopularApi
();
List
<
MallHotRecommendGoodsDto
>
selectByPopularApi
();
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/DataGoodsServiceImpl.java
View file @
052851e7
...
...
@@ -8,6 +8,8 @@ import com.jz.common.bean.PageInfoResponse;
import
com.jz.common.constant.Constants
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest
;
import
com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest
;
import
com.jz.dm.mall.moduls.entity.DataGoods
;
import
com.jz.dm.mall.moduls.mapper.DataGoodsDao
;
...
...
@@ -35,131 +37,44 @@ public class DataGoodsServiceImpl implements DataGoodsService {
private
DataGoodsDao
dataGoodsDao
;
@Override
public
PageInfoResponse
<
DataGoods
Dto
>
findList
(
DataGoodsRequest
dataGoods
Request
,
HttpServletRequest
httpRequest
)
public
PageInfoResponse
<
DataGoods
ListDto
>
findList
(
DataGoodsListRequest
dataGoodsList
Request
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DataGoodsDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
PageInfoResponse
<
DataGoodsListDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//数据商品id
if
(
dataGoodsRequest
.
getDataGoodsId
()
!=
null
)
{
param
.
put
(
"dataGoodsId"
,
dataGoodsRequest
.
getDataGoodsId
());
}
//商品分类id(行业)
if
(
dataGoodsRequest
.
getCategoryId
()
!=
null
)
{
param
.
put
(
"categoryId"
,
dataGoodsRequest
.
getCategoryId
());
}
//数据商户id
if
(
dataGoodsRequest
.
getUserId
()
!=
null
)
{
param
.
put
(
"userId"
,
dataGoodsRequest
.
getUserId
());
if
(
dataGoodsListRequest
.
getCategoryId
()
!=
null
)
{
param
.
put
(
"categoryId"
,
dataGoodsListRequest
.
getCategoryId
());
}
//数据商品名称
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDataName
()))
{
param
.
put
(
"dataName"
,
dataGoodsRequest
.
getDataName
());
if
(!
StringUtils
.
isEmpty
(
dataGoods
List
Request
.
getDataName
()))
{
param
.
put
(
"dataName"
,
dataGoods
List
Request
.
getDataName
());
}
//数据类型:01api,02数据包
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDataType
()))
{
param
.
put
(
"dataType"
,
dataGoodsRequest
.
getDataType
());
}
//数据商品标签
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDataLabel
()))
{
param
.
put
(
"dataLabel"
,
dataGoodsRequest
.
getDataLabel
());
}
//数据商品图片
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDataPicture
()))
{
param
.
put
(
"dataPicture"
,
dataGoodsRequest
.
getDataPicture
());
}
//数据商品价格
if
(
dataGoodsRequest
.
getDataPrice
()
!=
null
)
{
param
.
put
(
"dataPrice"
,
dataGoodsRequest
.
getDataPrice
());
}
//优惠价格
if
(
dataGoodsRequest
.
getDiscountPrice
()
!=
null
)
{
param
.
put
(
"discountPrice"
,
dataGoodsRequest
.
getDiscountPrice
());
if
(!
StringUtils
.
isEmpty
(
dataGoodsListRequest
.
getDataType
()))
{
param
.
put
(
"dataType"
,
dataGoodsListRequest
.
getDataType
());
}
//价格类型:01免费,02收费
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getPriceType
()))
{
param
.
put
(
"priceType"
,
dataGoodsRequest
.
getPriceType
());
}
//商品规格
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getGoodsStandards
()))
{
param
.
put
(
"goodsStandards"
,
dataGoodsRequest
.
getGoodsStandards
());
}
//数据状态:01预售,02在售中,03下架,04上架
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dataGoodsRequest
.
getDataStatus
());
}
//审核状态:01待审核,02已审核,03未通过
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getAuditStatus
()))
{
param
.
put
(
"auditStatus"
,
dataGoodsRequest
.
getAuditStatus
());
}
//清洗规则(脱敏校验)
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getCleanRule
()))
{
param
.
put
(
"cleanRule"
,
dataGoodsRequest
.
getCleanRule
());
}
//驳回原因
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getRejectReason
()))
{
param
.
put
(
"rejectReason"
,
dataGoodsRequest
.
getRejectReason
());
}
//审核人
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getAuditPerson
()))
{
param
.
put
(
"auditPerson"
,
dataGoodsRequest
.
getAuditPerson
());
}
//审核时间起
if
(
dataGoodsRequest
.
getAuditTimeStart
()
!=
null
)
{
param
.
put
(
"auditTimeStart"
,
dataGoodsRequest
.
getAuditTimeStart
());
if
(!
StringUtils
.
isEmpty
(
dataGoodsListRequest
.
getPriceType
()))
{
param
.
put
(
"priceType"
,
dataGoodsListRequest
.
getPriceType
());
}
//审核时间止
if
(
dataGoodsRequest
.
getAuditTimeEnd
()
!=
null
)
{
param
.
put
(
"auditTimeEnd"
,
dataGoodsRequest
.
getAuditTimeEnd
());
}
//创建时间起
if
(
dataGoodsRequest
.
getCreTimeStart
()
!=
null
)
{
param
.
put
(
"creTimeStart"
,
dataGoodsRequest
.
getCreTimeStart
());
}
//创建时间止
if
(
dataGoodsRequest
.
getCreTimeEnd
()
!=
null
)
{
param
.
put
(
"creTimeEnd"
,
dataGoodsRequest
.
getCreTimeEnd
());
}
//创建人
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getCrePerson
()))
{
param
.
put
(
"crePerson"
,
dataGoodsRequest
.
getCrePerson
());
}
//更新时间起
if
(
dataGoodsRequest
.
getUptTimeStart
()
!=
null
)
{
param
.
put
(
"uptTimeStart"
,
dataGoodsRequest
.
getUptTimeStart
());
}
//更新时间止
if
(
dataGoodsRequest
.
getUptTimeEnd
()
!=
null
)
{
param
.
put
(
"uptTimeEnd"
,
dataGoodsRequest
.
getUptTimeEnd
());
}
//更新人
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getUptPerson
()))
{
param
.
put
(
"uptPerson"
,
dataGoodsRequest
.
getUptPerson
());
}
//删除标识
if
(!
StringUtils
.
isEmpty
(
dataGoodsRequest
.
getDelFlag
()))
{
param
.
put
(
"delFlag"
,
dataGoodsRequest
.
getDelFlag
());
}
//年(元)
if
(
dataGoodsRequest
.
getYearType
()
!=
null
)
{
param
.
put
(
"yearType"
,
dataGoodsRequest
.
getYearType
());
}
//季(元)
if
(
dataGoodsRequest
.
getSeasonType
()
!=
null
)
{
param
.
put
(
"seasonType"
,
dataGoodsRequest
.
getSeasonType
());
//更新时间排序
if
(
dataGoodsListRequest
.
getUptTime
()
!=
null
)
{
param
.
put
(
"uptTime"
,
dataGoodsListRequest
.
getUptTime
());
}
//
月(元)
if
(
dataGoods
Request
.
getMonthType
()
!=
null
)
{
param
.
put
(
"
monthType"
,
dataGoodsRequest
.
getMonthType
());
//
使用人数
if
(
dataGoods
ListRequest
.
getUsePerson
()
!=
null
)
{
param
.
put
(
"
usePerson"
,
dataGoodsListRequest
.
getUsePerson
());
}
//
次(元)
if
(
dataGoods
Request
.
getSecondType
()
!=
null
)
{
param
.
put
(
"s
econdType"
,
dataGoodsRequest
.
getSecondType
());
//
综合排序
if
(
dataGoods
ListRequest
.
getSynthesizeRank
()
!=
null
)
{
param
.
put
(
"s
ynthesizeRank"
,
dataGoodsListRequest
.
getSynthesizeRank
());
}
PageHelper
.
startPage
(
dataGoods
Request
.
getPageNum
(),
dataGoods
Request
.
getPageSize
());
List
<
DataGoodsDto
>
list
=
dataGoodsDao
.
findList
(
param
);
PageInfo
<
DataGoodsDto
>
pageInfo
=
new
PageInfo
<>(
list
);
PageHelper
.
startPage
(
dataGoods
ListRequest
.
getPageNum
(),
dataGoodsList
Request
.
getPageSize
());
List
<
DataGoods
List
Dto
>
list
=
dataGoodsDao
.
findList
(
param
);
PageInfo
<
DataGoods
List
Dto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
Constants
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
...
...
@@ -247,4 +162,5 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return
baseResponse
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
View file @
052851e7
...
...
@@ -40,8 +40,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
* @return
*/
@Override
public
MallCustomer
selectByAccount
(
String
username
,
HttpServletRequest
request
)
{
MallCustomer
mallCustomer
=
tMallCustomerDao
.
selectByAccount
(
username
);
public
CustomerDto
selectByAccount
(
String
username
,
HttpServletRequest
request
)
{
CustomerDto
mallCustomer
=
tMallCustomerDao
.
selectByAccount
(
username
);
// String customer = JSON.toJSONString(mallCustomer);
if
(
mallCustomer
!=
null
)
{
...
...
@@ -55,7 +55,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
// 存入到session
request
.
getSession
().
setAttribute
(
"mallCustomer"
,
mallCustomerApiDto
);
// 存入到redis
redisTemplate
.
opsForValue
().
set
(
"user_"
+
RedisMessageConstant
.
SENDTYPE_LOGIN_CUSTOMER
,
mallCustomerApiDto
,
3
,
TimeUnit
.
DAYS
);
//
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
}
return
mallCustomer
;
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallHotRecommendGoodsServiceImpl.java
View file @
052851e7
...
...
@@ -7,6 +7,8 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 热门推荐商品(TMallHotRecommendGoods)表服务实现类
*
...
...
@@ -24,9 +26,9 @@ public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsSe
* @return
*/
@Override
public
MallHotRecommendGoodsDto
selectByPopularApi
()
{
MallHotRecommendGoodsDto
popularApi
=
tMallHotRecommendGoodsDao
.
selectByPopularApi
();
public
List
<
MallHotRecommendGoodsDto
>
selectByPopularApi
()
{
List
<
MallHotRecommendGoodsDto
>
popularApiList
=
tMallHotRecommendGoodsDao
.
selectByPopularApi
();
return
popularApi
;
return
popularApi
List
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/resources/mapperconf/DataGoodsDao.xml
View file @
052851e7
...
...
@@ -47,95 +47,6 @@
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"findList"
resultType=
"com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto"
parameterType=
"map"
>
select
data_goods_id, category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price,
price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time,
cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type
from t_data_goods
<where>
<if
test=
"dataGoodsId != null"
>
and data_goods_id = #{dataGoodsId}
</if>
<if
test=
"categoryId != null"
>
and category_id = #{categoryId}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"dataName != null and dataName != ''"
>
and data_name = #{dataName}
</if>
<if
test=
"dataType != null and dataType != ''"
>
and data_type = #{dataType}
</if>
<if
test=
"dataLabel != null and dataLabel != ''"
>
and data_label = #{dataLabel}
</if>
<if
test=
"dataPicture != null and dataPicture != ''"
>
and data_picture = #{dataPicture}
</if>
<if
test=
"dataPrice != null"
>
and data_price = #{dataPrice}
</if>
<if
test=
"discountPrice != null"
>
and discount_price = #{discountPrice}
</if>
<if
test=
"priceType != null and priceType != ''"
>
and price_type = #{priceType}
</if>
<if
test=
"goodsStandards != null and goodsStandards != ''"
>
and goods_standards = #{goodsStandards}
</if>
<if
test=
"dataStatus != null and dataStatus != ''"
>
and data_status = #{dataStatus}
</if>
<if
test=
"auditStatus != null and auditStatus != ''"
>
and audit_status = #{auditStatus}
</if>
<if
test=
"cleanRule != null and cleanRule != ''"
>
and clean_rule = #{cleanRule}
</if>
<if
test=
"rejectReason != null and rejectReason != ''"
>
and reject_reason = #{rejectReason}
</if>
<if
test=
"auditPerson != null and auditPerson != ''"
>
and audit_person = #{auditPerson}
</if>
<if
test=
"auditTime != null"
>
and audit_time = #{auditTime}
</if>
<if
test=
"creTime != null"
>
and cre_time = #{creTime}
</if>
<if
test=
"crePerson != null and crePerson != ''"
>
and cre_person = #{crePerson}
</if>
<if
test=
"uptTime != null"
>
and upt_time = #{uptTime}
</if>
<if
test=
"uptPerson != null and uptPerson != ''"
>
and upt_person = #{uptPerson}
</if>
<if
test=
"delFlag != null and delFlag != ''"
>
and del_flag = #{delFlag}
</if>
<if
test=
"yearType != null"
>
and year_type = #{yearType}
</if>
<if
test=
"seasonType != null"
>
and season_type = #{seasonType}
</if>
<if
test=
"monthType != null"
>
and month_type = #{monthType}
</if>
<if
test=
"secondType != null"
>
and second_type = #{secondType}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"dataGoodsId"
useGeneratedKeys=
"true"
>
insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type)
...
...
@@ -246,4 +157,77 @@
delete from t_data_goods where data_goods_id = #{dataGoodsId}
</delete>
<select
id=
"findByCategoryId"
resultType=
"com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto"
parameterType=
"list"
>
SELECT
t1.data_goods_id,
t1.category_id,
t2.category_name,
t1.data_name,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label,
t1.data_picture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price,
t1.data_price,
t1.price_type,
t2.if_child,
t2.parent_id
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"findList"
resultType=
"com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto"
parameterType=
"map"
>
SELECT
t1.data_goods_id as dataGoods,
t1.category_id as categoryId,
t2.category_name as categoryName,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price as discountPrice,
t1.data_price as dataPrice,
t1.price_type as pariceType,
t2.parent_id as parentId,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
where
1= 1 and
t1.del_flag = 'N' and
t1.data_status = '02'
<if
test=
"categoryId != null"
>
and t1.category_id = #{categoryId}
</if>
<if
test=
"dataName != null and dataName != ''"
>
and data_name = #{dataName}
</if>
<if
test=
"dataType != null and dataType != ''"
>
and data_type = #{dataType}
</if>
<if
test=
"priceType != null and priceType != ''"
>
and price_type = #{priceType}
</if>
<if
test=
"uptTime != null"
>
ORDER BY
#{uptTime} desc
</if>
<if
test=
"usePerson != null"
>
ORDER BY
#{usePerson} desc
</if>
<if
test=
"synthesizeRank != null"
>
ORDER BY
#{synthesizeRank} desc
</if>
</select>
</mapper>
\ No newline at end of file
jz-dm-mall/src/main/resources/mapperconf/MallCustomerDao.xml
View file @
052851e7
...
...
@@ -165,11 +165,19 @@
delete from t_mall_customer where customer_id = #{customerId}
</delete>
<select
id=
"selectByAccount"
result
Map=
"TMallCustomerMap
"
>
<select
id=
"selectByAccount"
result
Type=
"com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto
"
>
select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag
from t_mall_customer
where customer_account = #{username};
t1.customer_id as customerId,
t1.department_id as departmentId,
t1.password,
t1.customer_account as customerAccount,
t1.customer_name as customerName,
t1.customer_phone as customerPhone,
t3.assets_id as assetsId
from t_mall_customer t1
left join t_department t2 on t1.department_id=t2.department_id
left join t_finance_customer_assets t3 on t3.department_id=t2.department_id
where 1=1 and t1.del_flag='N' and customer_account = #{username};
</select>
<select
id=
"selectByPhone"
resultType=
"com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto"
>
...
...
jz-dm-mall/src/main/resources/mapperconf/MallHotRecommendGoodsDao.xml
View file @
052851e7
...
...
@@ -90,17 +90,17 @@
</delete>
<select
id=
"selectByPopularApi"
parameterType=
"
map"
resultType=
"com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApi
Dto"
>
<select
id=
"selectByPopularApi"
parameterType=
"
list"
resultType=
"com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoods
Dto"
>
SELECT
t1.data_goods_id as dataGoodsId ,
t1.data_name as dataName,
t1.data_type as
dataTYpe,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end)
dataTYpe,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
t1.data_price as dataPrice,
t1.discount_price as discountPrice,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
count(customer_id) as customer
t1.use_person AS usePerson
FROM
t_data_goods t1
INNER JOIN t_mall_hot_recommend_goods t2 ON t1.data_goods_id = t2.data_goods_id
...
...
@@ -109,6 +109,6 @@
t1.del_flag = 'N' and
t1.data_status = '02'
group by t1.data_goods_id
order by
customer
desc
order by
usePerson
desc
</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