Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
4b6b21af
提交
4b6b21af
authored
8月 19, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复bug
上级
ef7b7a9b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
97 行增加
和
9 行删除
+97
-9
LeaseGoodsDao.java
src/main/java/com/mmc/pms/dao/lease/LeaseGoodsDao.java
+4
-0
LeaseGoodsServiceImpl.java
...com/mmc/pms/service/lease/impl/LeaseGoodsServiceImpl.java
+20
-8
LeaseGoodsDao.xml
src/main/resources/mapper/lease/LeaseGoodsDao.xml
+73
-1
没有找到文件。
src/main/java/com/mmc/pms/dao/lease/LeaseGoodsDao.java
浏览文件 @
4b6b21af
...
...
@@ -72,4 +72,8 @@ public interface LeaseGoodsDao {
void
removeWareInfo
(
List
<
Integer
>
list
);
int
feignLeaseGoodsInfoByAddressId
(
Integer
id
);
int
countLeaseGoodsByApp
(
LeaseGoodsQO
param
);
List
<
LeaseGoodsDO
>
listLeaseGoodsByApp
(
LeaseGoodsQO
param
);
}
src/main/java/com/mmc/pms/service/lease/impl/LeaseGoodsServiceImpl.java
浏览文件 @
4b6b21af
...
...
@@ -121,24 +121,36 @@ public class LeaseGoodsServiceImpl implements LeaseGoodsService {
@Override
public
ResultBody
leaseGoodsList
(
LeaseGoodsQO
param
,
LoginSuccessDTO
loginSuccessDTO
)
{
if
(
loginSuccessDTO
==
null
||
loginSuccessDTO
.
getRoleInfo
().
getSuperAdmin
().
equals
(
1
))
{
//
小程序和
超级管理员获取所有商品信息
return
ResultBody
.
success
(
getLeaseGoodsInfo
(
param
));
}
else
{
if
(
loginSuccessDTO
!=
null
&&
loginSuccessDTO
.
getRoleInfo
().
getSuperAdmin
().
equals
(
1
))
{
// 超级管理员获取所有商品信息
return
ResultBody
.
success
(
getLeaseGoodsInfo
(
param
,
1
));
}
else
if
(
loginSuccessDTO
!=
null
&&
!
loginSuccessDTO
.
getRoleInfo
().
getSuperAdmin
().
equals
(
1
))
{
// 非超级管理员获取自家的商品信息
param
.
setUserAccountId
(
loginSuccessDTO
.
getUserAccountId
());
return
ResultBody
.
success
(
getLeaseGoodsInfo
(
param
));
return
ResultBody
.
success
(
getLeaseGoodsInfo
(
param
,
1
));
}
else
{
return
ResultBody
.
success
(
getLeaseGoodsInfo
(
param
,
0
));
}
}
private
PageResult
getLeaseGoodsInfo
(
LeaseGoodsQO
param
)
{
int
count
=
leaseGoodsDao
.
countLeaseGoods
(
param
);
private
PageResult
getLeaseGoodsInfo
(
LeaseGoodsQO
param
,
Integer
type
)
{
int
count
;
if
(
type
.
equals
(
1
))
{
count
=
leaseGoodsDao
.
countLeaseGoods
(
param
);
}
else
{
count
=
leaseGoodsDao
.
countLeaseGoodsByApp
(
param
);
}
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
LeaseGoodsDO
>
leaseGoodsDOList
=
leaseGoodsDao
.
listLeaseGoods
(
param
);
List
<
LeaseGoodsDO
>
leaseGoodsDOList
;
if
(
type
.
equals
(
1
))
{
leaseGoodsDOList
=
leaseGoodsDao
.
listLeaseGoods
(
param
);
}
else
{
leaseGoodsDOList
=
leaseGoodsDao
.
listLeaseGoodsByApp
(
param
);
}
// 转成vo
List
<
LeaseGoodsVO
>
leaseGoodsVOList
=
leaseGoodsDOList
.
stream
().
map
(
LeaseGoodsDO:
:
buildLeaseGoodsVO
)
.
skip
(
param
.
getPageNo
()).
limit
(
param
.
getPageSize
()).
collect
(
Collectors
.
toList
());
...
...
src/main/resources/mapper/lease/LeaseGoodsDao.xml
浏览文件 @
4b6b21af
...
...
@@ -141,7 +141,10 @@
logistics_company = #{logisticsCompany},
</if>
<if
test=
"modeOfDelivery != null"
>
mode_of_delivery = #{modeOfDelivery}
mode_of_delivery = #{modeOfDelivery},
</if>
<if
test=
"showPrice != null"
>
show_price = #{showPrice}
</if>
</set>
where id = #{id}
...
...
@@ -416,4 +419,72 @@
where ship_address = #{id}
or return_address = #{id}
</select>
<select
id=
"countLeaseGoodsByApp"
resultType=
"java.lang.Integer"
>
select count(*) from lease_goods
<where>
shelf_status = 1
<if
test=
"tradeName != null and tradeName != ''"
>
and (trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if
test=
"productTypeId != null"
>
and product_type_id = #{productTypeId}
</if>
<if
test=
"brandInfoId != null"
>
and brand_info_id = #{brandInfoId}
</if>
<if
test=
"userAccountId != null"
>
and user_account_id = #{userAccountId}
</if>
<if
test=
"districtCode != null and districtCode != ''"
>
and district_code = #{districtCode}
</if>
</where>
</select>
<select
id=
"listLeaseGoodsByApp"
resultType=
"com.mmc.pms.entity.lease.LeaseGoodsDO"
>
SELECT
lg.id,
lg.trade_name,
lg.product_type_id,
lg.shelf_status,
lg.selling_point,
lg.product_param,
lg.user_account_id,
lg.show_price,
lg.min_lease_term,
lg.max_lease_term,
lg.create_time,
lgr.id resourceId,
lgr.type,
lgr.url,
lps.cash_pledge,
lps.three_days_rental,
lps.seven_days_rental,
lps.thirty_days_rental,
lps.ninety_days_rental,
lps.max_days_rental,
lps.stock
FROM
lease_goods lg
LEFT JOIN lease_goods_resources lgr ON lgr.lease_goods_id = lg.id
LEFT JOIN lease_price_stock lps ON lps.lease_goods_id = lg.id
<where>
shelf_status = 1
<if
test=
"tradeName != null and tradeName != ''"
>
and (lg.trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if
test=
"productTypeId != null"
>
and lg.product_type_id = #{productTypeId}
</if>
<if
test=
"brandInfoId != null"
>
and lg.brand_info_id = #{brandInfoId}
</if>
<if
test=
"userAccountId != null"
>
and lg.user_account_id = #{userAccountId}
</if>
<if
test=
"districtCode != null and districtCode != ''"
>
and district_code = #{districtCode}
</if>
</where>
order by lg.shelf_status DESC, lg.sort DESC
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论