Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
508d78cc
提交
508d78cc
authored
6月 09, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化:接口优化
上级
df18afb2
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
106 行增加
和
151 行删除
+106
-151
ResultEnum.java
src/main/java/com/mmc/pms/common/ResultEnum.java
+0
-0
ProductMallController.java
...in/java/com/mmc/pms/controller/ProductMallController.java
+4
-5
WebLeaseGoodsController.java
...a/com/mmc/pms/controller/web/WebLeaseGoodsController.java
+0
-23
WebDeviceDao.java
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
+24
-18
WareInfoQO.java
src/main/java/com/mmc/pms/model/qo/WareInfoQO.java
+19
-17
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+0
-0
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
+3
-7
WebProductMallServiceImpl.java
...a/com/mmc/pms/service/Impl/WebProductMallServiceImpl.java
+49
-74
WebDeviceDao.xml
src/main/resources/mapper/WebDeviceDao.xml
+5
-5
not-check.yml
src/main/resources/not-check.yml
+2
-2
没有找到文件。
src/main/java/com/mmc/pms/common/ResultEnum.java
浏览文件 @
508d78cc
差异被折叠。
点击展开。
src/main/java/com/mmc/pms/controller/
common/LeaseGoods
Controller.java
→
src/main/java/com/mmc/pms/controller/
ProductMall
Controller.java
浏览文件 @
508d78cc
package
com
.
mmc
.
pms
.
controller
.
common
;
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.sale.dto.MallGoodsDetailDTO
;
...
...
@@ -23,10 +22,10 @@ import javax.servlet.http.HttpServletRequest;
*
* @date 2023/6/8 17:16 概要:
*/
@Api
(
tags
=
{
"v1.0.1-
设备租赁
-相关接口"
})
@Api
(
tags
=
{
"v1.0.1-
租赁销售
-相关接口"
})
@RestController
@RequestMapping
(
"/
lease/goods
"
)
public
class
LeaseGoods
Controller
extends
BaseController
{
@RequestMapping
(
"/
product/mall
"
)
public
class
ProductMall
Controller
extends
BaseController
{
@Autowired
private
WebDeviceService
webDeviceService
;
@ApiOperation
(
value
=
"设备列表筛选"
)
...
...
src/main/java/com/mmc/pms/controller/web/WebLeaseGoodsController.java
deleted
100644 → 0
浏览文件 @
df18afb2
package
com
.
mmc
.
pms
.
controller
.
web
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* @Author LW
* @date 2023/6/8 15:19
* 概要:
*/
@RestController
@RequestMapping
(
"/lease/goods"
)
@Api
(
tags
=
{
"web端-设备租赁-相关接口"
})
public
class
WebLeaseGoodsController
{
@Resource
WebDeviceService
webDeviceService
;
}
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
浏览文件 @
508d78cc
...
...
@@ -2,6 +2,7 @@ package com.mmc.pms.dao;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -12,37 +13,42 @@ import java.util.List;
*/
@Mapper
public
interface
WebDeviceDao
{
List
<
DistrictDO
>
listSecondDistrict
();
List
<
DistrictDO
>
listSecondDistrict
();
List
<
DeviceCategory
>
category
();
List
<
DeviceCategory
>
category
();
List
<
Brand
>
brand
();
List
<
Brand
>
brand
();
List
<
Brand
>
deviceBrand
();
List
<
Brand
>
deviceBrand
();
List
<
Model
>
model
();
List
<
Model
>
model
();
List
<
Model
>
deviceModel
();
List
<
Model
>
deviceModel
();
List
<
DeviceListDO
>
deviceList
(
Integer
districtId
,
Integer
categoryId
,
Integer
brandId
,
Integer
modelId
);
List
<
DeviceListDO
>
deviceList
(
Integer
districtId
,
Integer
categoryId
,
Integer
brandId
,
Integer
modelId
);
int
update
(
LeaseVo
param
);
int
update
(
LeaseVo
param
);
InventoryDO
findInventory
(
Integer
inventoryId
);
InventoryDO
findInventory
(
Integer
inventoryId
);
List
<
WareInfoDO
>
detail
(
Integer
id
);
List
<
WareInfoDO
>
detail
(
Integer
id
);
int
countListWareInfoPage
(
@Param
(
"categoryIds"
)
List
<
Integer
>
categoryIds
,
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
int
countListWareInfoPage
(
@Param
(
"categoryIds"
)
List
<
Integer
>
categoryIds
,
@Param
(
"userIds"
)
List
<
Integer
>
userIds
,
@Param
(
"type"
)
Integer
type
);
List
<
GoodsInfo
>
listWareInfoPage
(
@Param
(
"categoryIds"
)
List
<
Integer
>
categoryIds
,
@Param
(
"userIds"
)
List
<
Integer
>
userId
,
@Param
(
"pageNo"
)
Integer
pageNo
,
@Param
(
"pageSize"
)
Integer
pageSize
);
List
<
GoodsInfo
>
listWareInfoPage
(
@Param
(
"param"
)
WareInfoQO
param
,
@Param
(
"userIds"
)
List
<
Integer
>
userId
,
@Param
(
"type"
)
Integer
type
);
WareInfoDO
getWareInfoById
(
Integer
id
);
WareInfoDO
getWareInfoById
(
Integer
id
);
WareDetailDO
getWareDetailById
(
Integer
id
);
WareDetailDO
getWareDetailById
(
Integer
id
);
List
<
AdDO
>
ad
();
List
<
AdDO
>
ad
();
List
<
SkuInfoDO
>
listSkuInfo
(
Integer
id
);
List
<
SkuInfoDO
>
listSkuInfo
(
Integer
id
);
}
src/main/java/com/mmc/pms/model/qo/WareInfoQO.java
浏览文件 @
508d78cc
...
...
@@ -17,27 +17,29 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
// @ApiModel(value = "com.mmc.csf.model.qo.WareInfoQO", description = "model")
public
class
WareInfoQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2953141525621912414L
;
private
static
final
long
serialVersionUID
=
-
2953141525621912414L
;
@ApiModelProperty
(
name
=
"districtId"
,
value
=
"地域id"
,
example
=
"1"
,
required
=
false
)
private
Integer
provinceId
;
@ApiModelProperty
(
name
=
"districtId"
,
value
=
"地域id"
,
example
=
"440000"
)
private
Integer
provinceId
;
@ApiModelProperty
(
name
=
"categoryId"
,
value
=
"分类id"
)
private
List
<
Integer
>
categoryId
;
@ApiModelProperty
(
name
=
"categoryId"
,
value
=
"分类id"
)
private
List
<
Integer
>
categoryId
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
name
=
"产品类型:0商城 1租赁"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@NotNull
(
message
=
"每页显示数
不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"页码
不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
浏览文件 @
508d78cc
差异被折叠。
点击展开。
src/main/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
浏览文件 @
508d78cc
...
...
@@ -169,7 +169,7 @@ public class WebDeviceServiceImpl implements WebDeviceService {
userIds
=
Collections
.
singletonList
(-
1
);
}
}
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
);
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getType
()
);
if
(
count
==
0
)
{
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
...
...
@@ -177,9 +177,7 @@ public class WebDeviceServiceImpl implements WebDeviceService {
int
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
if
(
request
==
null
)
{
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
());
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
...
...
@@ -190,9 +188,7 @@ public class WebDeviceServiceImpl implements WebDeviceService {
if
(
userAccountSimpleDTO
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
INTERNAL_SERVER_ERROR
);
}
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
());
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
if
(
userAccountSimpleDTO
.
getCooperationTagId
()
==
null
)
{
...
...
src/main/java/com/mmc/pms/service/Impl/WebProductMallServiceImpl.java
浏览文件 @
508d78cc
...
...
@@ -3,13 +3,9 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.dao.WebProductMallDao
;
import
com.mmc.pms.entity.AdDO
;
import
com.mmc.pms.entity.GoodsInfoDO
;
import
com.mmc.pms.entity.ProductCategory
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.sale.dto.ProductCategoryDTO
;
import
com.mmc.pms.model.qo.GoodsInfoQO
;
import
com.mmc.pms.model.sale.dto.GoodsInfoListDTO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.WebProductMallService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -23,78 +19,57 @@ import java.util.stream.Collectors;
@Service
public
class
WebProductMallServiceImpl
implements
WebProductMallService
{
@Autowired
private
WebProductMallDao
webProductMallDao
;
@Autowired
private
WebProductMallDao
webProductMallDao
;
@Override
public
ResultBody
productCategory
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productCategory
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
productCategory
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productCategory
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
productParts
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productParts
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
productParts
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productParts
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
productQuality
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productQuality
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
productQuality
()
{
List
<
ProductCategory
>
category
=
webProductMallDao
.
productQuality
();
List
<
ProductCategoryDTO
>
collect
=
category
.
stream
()
.
map
(
t
->
{
return
t
.
productCategoryDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
PageResult
listPageGoodsInfo
(
GoodsInfoQO
param
)
{
int
count
=
webProductMallDao
.
countListGoodsInfo
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
GoodsInfoDO
>
goodsInfo
=
webProductMallDao
.
listGoodsInfo
(
param
);
goodsInfo
.
stream
()
.
forEach
(
t
->
{
Integer
product
=
webProductMallDao
.
findProduct
(
t
.
getId
());
t
.
setIsCoupons
(
product
);
});
List
<
GoodsInfoListDTO
>
pageList
=
goodsInfo
.
stream
().
map
(
GoodsInfoDO:
:
buildGoodsInfoListDTO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
);
}
@Override
public
ResultBody
<
AdDTO
>
ad
()
{
List
<
AdDO
>
ad
=
webProductMallDao
.
ad
();
List
<
AdDTO
>
collect
=
ad
.
stream
()
.
map
(
t
->
{
return
t
.
adDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
<
AdDTO
>
ad
()
{
List
<
AdDO
>
ad
=
webProductMallDao
.
ad
();
List
<
AdDTO
>
collect
=
ad
.
stream
()
.
map
(
t
->
{
return
t
.
adDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
}
src/main/resources/mapper/WebDeviceDao.xml
浏览文件 @
508d78cc
...
...
@@ -157,7 +157,7 @@
FROM goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id
<where>
gi.is_deleted = 0 and gi.shelf_status = 0 and gi.goods_type =
1
gi.is_deleted = 0 and gi.shelf_status = 0 and gi.goods_type =
#{type}
<if
test=
"categoryIds != null and categoryIds.size != 0"
>
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
...
...
@@ -180,9 +180,9 @@
goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0
<where>
gi.is_deleted = 0 and gi.shelf_status = 0 and gi.goods_type =
1
<if
test=
"
categoryIds
!= null"
>
<foreach
collection=
"
categoryIds
"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
gi.is_deleted = 0 and gi.shelf_status = 0 and gi.goods_type =
#{type}
<if
test=
"
param.categoryId
!= null"
>
<foreach
collection=
"
param
"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
#{item}
</foreach>
...
...
@@ -195,7 +195,7 @@
</if>
</where>
order by gi.create_time DESC
limit #{pa
geNo},#{
pageSize}
limit #{pa
ram.pageNo},#{param.
pageSize}
</select>
<select
id=
"getWareInfoById"
resultMap=
"wareInfoResultMap"
parameterType=
"java.lang.Integer"
>
select wi.id,
...
...
src/main/resources/not-check.yml
浏览文件 @
508d78cc
...
...
@@ -7,6 +7,6 @@ data-filter:
-
/pms/swagger-resources/**
-
/pms/webjars/**
-
/pms/product/spec/feignGetSpecLeaseUnitPrice
-
/pms/
/lease/goods
/deviceList
-
/pms/
product/mall
/deviceList
-
/pms/classify/queryCategoryInfoByType
-
/pms/
lease/goods
/getLeaseGoodsDetail
-
/pms/
product/mall
/getLeaseGoodsDetail
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论