Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
931b84f6
提交
931b84f6
authored
6月 12, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:列表查询
上级
61ba2ab8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
43 行增加
和
9 行删除
+43
-9
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+2
-0
GoodsInfoDao.java
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
+2
-0
WebDeviceDao.java
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
+1
-1
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+17
-5
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
+5
-2
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+7
-0
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+7
-0
WebDeviceDao.xml
src/main/resources/mapper/WebDeviceDao.xml
+2
-1
没有找到文件。
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
931b84f6
...
@@ -62,4 +62,6 @@ public interface CategoriesDao {
...
@@ -62,4 +62,6 @@ public interface CategoriesDao {
List
<
Categories
>
selectCategoryByDirectoryId
(
List
<
Integer
>
directoryIds
);
List
<
Categories
>
selectCategoryByDirectoryId
(
List
<
Integer
>
directoryIds
);
List
<
Categories
>
getCategoriesListByDirectoryIds
(
List
<
Integer
>
directoryIds
);
List
<
Categories
>
getCategoriesListByDirectoryIds
(
List
<
Integer
>
directoryIds
);
int
countChildById
(
Integer
id
);
}
}
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
浏览文件 @
931b84f6
...
@@ -108,4 +108,6 @@ public interface GoodsInfoDao {
...
@@ -108,4 +108,6 @@ public interface GoodsInfoDao {
void
removeWareInfo
(
List
<
Integer
>
ids
);
void
removeWareInfo
(
List
<
Integer
>
ids
);
List
<
SpecPriceVO
>
getPriceBySpecId
(
Integer
productSpecId
,
Integer
leaseTerm
);
List
<
SpecPriceVO
>
getPriceBySpecId
(
Integer
productSpecId
,
Integer
leaseTerm
);
int
countGoodsInfoByCategoryId
(
Integer
id
);
}
}
src/main/java/com/mmc/pms/dao/WebDeviceDao.java
浏览文件 @
931b84f6
...
@@ -41,7 +41,7 @@ public interface WebDeviceDao {
...
@@ -41,7 +41,7 @@ public interface WebDeviceDao {
List
<
GoodsInfo
>
listWareInfoPage
(
List
<
GoodsInfo
>
listWareInfoPage
(
@Param
(
"param"
)
WareInfoQO
param
,
@Param
(
"param"
)
WareInfoQO
param
,
@Param
(
"userIds"
)
List
<
Integer
>
userId
,
@Param
(
"userIds"
)
List
<
Integer
>
userId
s
,
@Param
(
"type"
)
Integer
type
);
@Param
(
"type"
)
Integer
type
);
WareInfoDO
getWareInfoById
(
Integer
id
);
WareInfoDO
getWareInfoById
(
Integer
id
);
...
...
src/main/java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
浏览文件 @
931b84f6
...
@@ -240,11 +240,11 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -240,11 +240,11 @@ public class CategoriesServiceImpl implements CategoriesService {
@Override
@Override
public
List
<
AllCategoryDTO
>
feigQqueryCategoryInfoByType
(
Integer
type
)
{
public
List
<
AllCategoryDTO
>
feigQqueryCategoryInfoByType
(
Integer
type
)
{
List
<
DirectoryDO
>
categoryDirectoryList
=
getCategoryDirectoryList
(
type
);
List
<
DirectoryDO
>
categoryDirectoryList
=
getCategoryDirectoryList
(
type
);
if
(
CollectionUtils
.
isNotEmpty
(
categoryDirectoryList
)){
if
(
CollectionUtils
.
isNotEmpty
(
categoryDirectoryList
))
{
List
<
AllCategoryDTO
>
allCategoryDTOList
=
List
<
AllCategoryDTO
>
allCategoryDTOList
=
categoryDirectoryList
.
stream
()
categoryDirectoryList
.
stream
()
.
map
(
DirectoryDO:
:
buildAllCategoryDTO
)
.
map
(
DirectoryDO:
:
buildAllCategoryDTO
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
categoryMap
=
getCategoryMap
(
allCategoryDTOList
);
Map
<
Integer
,
List
<
CategoriesInfoListDTO
>>
categoryMap
=
getCategoryMap
(
allCategoryDTOList
);
addSubCategories
(
allCategoryDTOList
,
categoryMap
);
addSubCategories
(
allCategoryDTOList
,
categoryMap
);
System
.
out
.
println
(
"Res: "
+
JSONObject
.
toJSON
(
allCategoryDTOList
));
System
.
out
.
println
(
"Res: "
+
JSONObject
.
toJSON
(
allCategoryDTOList
));
...
@@ -255,7 +255,19 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -255,7 +255,19 @@ public class CategoriesServiceImpl implements CategoriesService {
@Override
@Override
public
ResultBody
deleteRelevantBusiness
(
Integer
id
)
{
public
ResultBody
deleteRelevantBusiness
(
Integer
id
)
{
int
count
=
categoriesDao
.
deleteById
(
id
);
int
count
=
goodsInfoDao
.
countGoodsInfoByCategoryId
(
id
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GROUP_DONT_DELETE
);
}
// 获取分类信息
Categories
categories
=
categoriesDao
.
getGoodsGroupById
(
id
);
if
(
categories
!=
null
&&
categories
.
getParentId
().
equals
(
0
))
{
int
childCount
=
categoriesDao
.
countChildById
(
id
);
if
(
childCount
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GROUP_DONT_DELETE_BY_CHILD
);
}
}
categoriesDao
.
deleteById
(
id
);
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
...
src/main/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
浏览文件 @
931b84f6
...
@@ -23,6 +23,7 @@ import com.mmc.pms.model.sale.vo.SpecPriceVO;
...
@@ -23,6 +23,7 @@ import com.mmc.pms.model.sale.vo.SpecPriceVO;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.WebDeviceService
;
import
com.mmc.pms.service.WebDeviceService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -171,7 +172,9 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -171,7 +172,9 @@ public class WebDeviceServiceImpl implements WebDeviceService {
param
.
getProvinceId
(),
param
.
getProvinceId
(),
null
,
null
,
null
,
null
,
request
==
null
?
null
:
request
.
getHeader
(
TokenConstant
.
TOKEN
));
StringUtils
.
isBlank
(
request
.
getHeader
(
TokenConstant
.
TOKEN
))
?
null
:
request
.
getHeader
(
TokenConstant
.
TOKEN
));
if
(
userIds
==
null
||
userIds
.
size
()
==
0
)
{
if
(
userIds
==
null
||
userIds
.
size
()
==
0
)
{
userIds
=
Collections
.
singletonList
(-
1
);
userIds
=
Collections
.
singletonList
(-
1
);
}
}
...
@@ -183,7 +186,7 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -183,7 +186,7 @@ public class WebDeviceServiceImpl implements WebDeviceService {
}
}
int
pageNo
=
param
.
getPageNo
();
int
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
param
.
buildCurrentPage
();
if
(
request
==
null
)
{
if
(
StringUtils
.
isBlank
(
request
.
getHeader
(
TokenConstant
.
TOKEN
))
)
{
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
());
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
());
List
<
LeaseGoodsInfoDTO
>
pageList
=
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
...
...
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
931b84f6
...
@@ -215,6 +215,13 @@
...
@@ -215,6 +215,13 @@
</foreach>
</foreach>
</where>
</where>
</select>
</select>
<select
id=
"countChildById"
resultType=
"java.lang.Integer"
>
SELECT COUNT(*)
FROM categories c1
INNER JOIN categories c2 ON c1.id = c2.parent_id
AND c2.is_deleted = 0
WHERE c1.id = #{id}
</select>
<update
id=
"deleteById"
>
<update
id=
"deleteById"
>
UPDATE `categories`
UPDATE `categories`
...
...
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
931b84f6
...
@@ -579,4 +579,11 @@
...
@@ -579,4 +579,11 @@
AND lease_term = #{leaseTerm}
AND lease_term = #{leaseTerm}
and type = 1
and type = 1
</select>
</select>
<select
id=
"countGoodsInfoByCategoryId"
resultType=
"java.lang.Integer"
>
SELECT COUNT(*)
FROM categories c
LEFT JOIN goods_info gi ON gi.category_by_one = c.id OR gi.category_by_two = c.id
WHERE c.is_deleted = 0
AND c.id = #{id}
</select>
</mapper>
</mapper>
src/main/resources/mapper/WebDeviceDao.xml
浏览文件 @
931b84f6
...
@@ -181,7 +181,8 @@
...
@@ -181,7 +181,8 @@
<where>
<where>
gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type}
gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type}
<if
test=
"param.categoryId != null"
>
<if
test=
"param.categoryId != null"
>
<foreach
collection=
"param"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
<foreach
collection=
"param.categoryId"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
separator=
","
>
#{item}
#{item}
</foreach>
</foreach>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论