Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
warehouse
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
苗卫卫
warehouse
Commits
fcf565e6
提交
fcf565e6
authored
11月 08, 2023
作者:
zhangqiliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
仓库管理的查询的优化
父级
a35799a4
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
34 行增加
和
3 行删除
+34
-3
src/main/java/com/boco/nbd/wios/manage/entity/bo/WarehouseEx.java
+9
-0
src/main/java/com/boco/nbd/wios/manage/entity/dto/WarehouseDTO.java
+2
-0
src/main/java/com/boco/nbd/wios/manage/mapper/extdb/WarehouseMapper.java
+6
-0
src/main/java/com/boco/nbd/wios/manage/service/impl/WarehouseService.java
+11
-0
src/main/resources/bootstrap-dev.yml
+1
-1
src/main/resources/bootstrap-test.yml
+1
-1
src/main/resources/mybatis/mapper/extdb/common/WarehouseMapper.xml
+4
-0
src/main/resources/mybatis/mapper/extdb/common/WarehouseMapperEx.xml
+0
-1
没有找到文件。
src/main/java/com/boco/nbd/wios/manage/entity/bo/WarehouseEx.java
查看文件 @
fcf565e6
...
@@ -19,6 +19,7 @@ public class WarehouseEx extends Warehouse {
...
@@ -19,6 +19,7 @@ public class WarehouseEx extends Warehouse {
private
String
pathCode
;
private
String
pathCode
;
private
String
pathName
;
private
String
pathName
;
private
String
serviceProviderName
;
public
Integer
getParentId
()
{
public
Integer
getParentId
()
{
return
parentId
;
return
parentId
;
...
@@ -43,4 +44,12 @@ public class WarehouseEx extends Warehouse {
...
@@ -43,4 +44,12 @@ public class WarehouseEx extends Warehouse {
public
void
setPathName
(
String
pathName
)
{
public
void
setPathName
(
String
pathName
)
{
this
.
pathName
=
pathName
;
this
.
pathName
=
pathName
;
}
}
public
String
getServiceProviderName
()
{
return
serviceProviderName
;
}
public
void
setServiceProviderName
(
String
serviceProviderName
)
{
this
.
serviceProviderName
=
serviceProviderName
;
}
}
}
src/main/java/com/boco/nbd/wios/manage/entity/dto/WarehouseDTO.java
查看文件 @
fcf565e6
...
@@ -77,4 +77,6 @@ public class WarehouseDTO implements Serializable {
...
@@ -77,4 +77,6 @@ public class WarehouseDTO implements Serializable {
private
String
receivePhone
;
private
String
receivePhone
;
@ApiModelProperty
(
value
=
"收件地址"
)
@ApiModelProperty
(
value
=
"收件地址"
)
private
String
receiveAddress
;
private
String
receiveAddress
;
@ApiModelProperty
(
value
=
"安装服务商团队的名字"
)
private
String
serviceProviderName
;
}
}
src/main/java/com/boco/nbd/wios/manage/mapper/extdb/WarehouseMapper.java
查看文件 @
fcf565e6
...
@@ -62,6 +62,12 @@ public interface WarehouseMapper extends CoreDao {
...
@@ -62,6 +62,12 @@ public interface WarehouseMapper extends CoreDao {
* @return
* @return
*/
*/
Warehouse
selectByPrimaryKey
(
String
id
);
Warehouse
selectByPrimaryKey
(
String
id
);
/**
* 根据id查询上级仓库ID数量
* @param id
* @return
*/
int
selectBySuperiorWarehouseId
(
String
id
);
/**
/**
* updateByExampleSelective
* updateByExampleSelective
...
...
src/main/java/com/boco/nbd/wios/manage/service/impl/WarehouseService.java
查看文件 @
fcf565e6
...
@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -271,6 +272,11 @@ public class WarehouseService {
...
@@ -271,6 +272,11 @@ public class WarehouseService {
}
else
{
}
else
{
List
<
WarehouseDTO
>
result
=
new
ArrayList
<>();
List
<
WarehouseDTO
>
result
=
new
ArrayList
<>();
for
(
WarehouseEx
warehouseEx
:
warehouseList
)
{
for
(
WarehouseEx
warehouseEx
:
warehouseList
)
{
//获取安装服务商的名字
Supplier
supplier
=
supplierDao
.
selectById
(
Integer
.
valueOf
(
warehouseEx
.
getServiceProvider
()));
if
(
supplier
!=
null
){
warehouseEx
.
setServiceProviderName
(
supplier
.
getName
());
}
WarehouseDTO
warehouseDTO
=
JSONUtilsEx
.
deserialize
(
JSONUtilsEx
.
serialize
(
warehouseEx
),
WarehouseDTO
.
class
);
WarehouseDTO
warehouseDTO
=
JSONUtilsEx
.
deserialize
(
JSONUtilsEx
.
serialize
(
warehouseEx
),
WarehouseDTO
.
class
);
if
(
warehouseEx
.
getParentId
()
==
null
)
{
if
(
warehouseEx
.
getParentId
()
==
null
)
{
warehouseDTO
.
setIsDel
(
0
);
warehouseDTO
.
setIsDel
(
0
);
...
@@ -700,6 +706,11 @@ public class WarehouseService {
...
@@ -700,6 +706,11 @@ public class WarehouseService {
* @param id
* @param id
*/
*/
public
void
delWarehouseById
(
String
id
)
{
public
void
delWarehouseById
(
String
id
)
{
//仓库有子仓库则无法删除
int
countId
=
warehouseMapper
.
selectBySuperiorWarehouseId
(
id
);
if
(
countId
>
0
){
throw
new
ServiceException
(
"仓库下有子仓库,无法删除"
);
}
List
<
MaterialsDTO
>
materialList
=
getStockMaterialByWId
(
id
);
List
<
MaterialsDTO
>
materialList
=
getStockMaterialByWId
(
id
);
if
(!
materialList
.
isEmpty
())
{
if
(!
materialList
.
isEmpty
())
{
BigDecimal
count
=
materialList
.
stream
().
filter
(
m
->
m
.
getRemainingNumber
()
!=
null
).
map
(
MaterialsDTO:
:
getRemainingNumber
)
BigDecimal
count
=
materialList
.
stream
().
filter
(
m
->
m
.
getRemainingNumber
()
!=
null
).
map
(
MaterialsDTO:
:
getRemainingNumber
)
...
...
src/main/resources/bootstrap-dev.yml
查看文件 @
fcf565e6
server
:
server
:
port
:
303
6
0
port
:
303
5
0
spring
:
spring
:
application
:
application
:
...
...
src/main/resources/bootstrap-test.yml
查看文件 @
fcf565e6
server
:
server
:
port
:
303
6
0
port
:
303
5
0
spring
:
spring
:
application
:
application
:
...
...
src/main/resources/mybatis/mapper/extdb/common/WarehouseMapper.xml
查看文件 @
fcf565e6
...
@@ -99,6 +99,10 @@
...
@@ -99,6 +99,10 @@
from t_warehouse
from t_warehouse
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</select>
</select>
<select
id=
"selectBySuperiorWarehouseId"
parameterType=
"java.lang.String"
resultType=
"int"
>
select count(id) from t_warehouse where superior_warehouse_id = #{id,jdbcType=VARCHAR} and status = 1
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from t_warehouse
delete from t_warehouse
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
...
...
src/main/resources/mybatis/mapper/extdb/common/WarehouseMapperEx.xml
查看文件 @
fcf565e6
...
@@ -93,7 +93,6 @@
...
@@ -93,7 +93,6 @@
LEFT JOIN t_warehouse_leven twl on tw.warehouse_leven_id = twl.id
LEFT JOIN t_warehouse_leven twl on tw.warehouse_leven_id = twl.id
where
where
tw.status = 1
tw.status = 1
and twl.`status` = 1
and tw.appkey = #{appkey}
and tw.appkey = #{appkey}
<if
test=
"id != null and id != ''"
>
<if
test=
"id != null and id != ''"
>
and tw.id = #{id}
and tw.id = #{id}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论