Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
5756c6df
Commit
5756c6df
authored
Aug 10, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.sothing.top/843502640/jyzb_platformV2
into develop-zhaojw
parents
364c8da2
3aac106c
隐藏空白字符变更
内嵌
并排
正在显示
51 个修改的文件
包含
1044 行增加
和
380 行删除
+1044
-380
.gitignore
.gitignore
+2
-0
modules.xml
.idea/modules.xml
+1
-0
AreaInsDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/AreaInsDto.java
+28
-0
AreaInventoryDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/AreaInventoryDto.java
+33
-0
EqsSummaryDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EqsSummaryDto.java
+84
-0
InsDetailDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InsDetailDto.java
+89
-0
InventorySumDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InventorySumDto.java
+44
-13
ShelfInsDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/ShelfInsDto.java
+25
-0
ShelfInventoryDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/ShelfInventoryDto.java
+34
-0
WarehouseAreaDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/WarehouseAreaDto.java
+1
-1
InventoryReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventoryReq.java
+65
-1
ShelfReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/ShelfReq.java
+2
-1
WarehouseAreaReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/WarehouseAreaReq.java
+3
-2
WarehouseReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/WarehouseReq.java
+0
-4
EquipmentBindReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/EquipmentBindReq.java
+34
-0
UpdateCabinetBoxReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetBoxReq.java
+0
-1
UpdateShelfReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateShelfReq.java
+6
-1
UpdateWarehouseAreaReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateWarehouseAreaReq.java
+4
-4
UpdateWarehouseReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateWarehouseReq.java
+6
-10
CabinetExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/CabinetExceptionEnum.java
+1
-1
InventoryExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/InventoryExceptionEnum.java
+25
-0
ShelfExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/ShelfExceptionEnum.java
+1
-52
WarehouseAreaExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/WarehouseAreaExceptionEnum.java
+7
-2
MybatisPlusConfig.java
jyzb-biz/src/main/java/com/junmp/jyzb/config/MybatisPlusConfig.java
+5
-3
CabinetBoxController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetBoxController.java
+2
-6
InventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
+32
-16
WarehouseController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/WarehouseController.java
+30
-5
Inventory.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
+1
-1
InventorySummary.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
+8
-0
Shelf.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Shelf.java
+1
-1
Warehouse.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Warehouse.java
+1
-4
WarehouseArea.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/WarehouseArea.java
+1
-2
CabinetMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
+3
-2
InventoryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
+0
-2
WarehouseMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/WarehouseMapper.java
+2
-6
CabinetBoxService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetBoxService.java
+1
-1
CabinetService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
+1
-2
InventoryService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
+14
-3
ShelfService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/ShelfService.java
+8
-0
WarehouseAreaService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseAreaService.java
+18
-2
WarehouseService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseService.java
+2
-2
CabinetBoxServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetBoxServiceImpl.java
+8
-6
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+20
-62
InventoryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
+115
-44
PubOrgServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PubOrgServiceImpl.java
+4
-4
ShelfServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/ShelfServiceImpl.java
+98
-10
WarehouseAreaServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseAreaServiceImpl.java
+116
-20
WarehouseServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
+15
-36
CabinetMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
+20
-1
InventorySummaryMapper.xml
jyzb-biz/src/main/resources/mapper/InventorySummaryMapper.xml
+3
-1
WarehouseMapper.xml
jyzb-biz/src/main/resources/mapper/WarehouseMapper.xml
+20
-45
没有找到文件。
.gitignore
View file @
5756c6df
...
...
@@ -71,3 +71,5 @@ Thumbs.db
/jyzb-mq/jyzb-mq-producer/jyzb-mq-producer.iml
/jyzb-mq/jyzb-mq-consumer/jyzb-mq-consumer.iml
/.idea/modules.xml
/.idea/compiler.xml
/.idea/modules.xml
.idea/modules.xml
View file @
5756c6df
...
...
@@ -2,6 +2,7 @@
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/jyzb-api/jyzb-api.iml"
filepath=
"$PROJECT_DIR$/jyzb-api/jyzb-api.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/jyzb-biz/jyzb-biz.iml"
filepath=
"$PROJECT_DIR$/jyzb-biz/jyzb-biz.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/jyzb-boot/jyzb-boot.iml"
filepath=
"$PROJECT_DIR$/jyzb-boot/jyzb-boot.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/jyzb-mq/jyzb-mq-consumer/jyzb-mq-consumer.iml"
filepath=
"$PROJECT_DIR$/jyzb-mq/jyzb-mq-consumer/jyzb-mq-consumer.iml"
/>
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/AreaInsDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* 根据区域id查询装备详细信息输出实体类
*/
@Data
public
class
AreaInsDto
{
/**
* 仓库id
*/
private
String
warehouseId
;
/**
* warehouseName
*/
private
String
warehouseName
;
/**
*location 仓库地点
*/
private
String
warehouseLocation
;
/**
*list 装备汇总列表
*/
private
List
<
InventorySumDto
>
list
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/AreaInventoryDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 根据区域id查询装备汇总输出实体类
*/
@Data
public
class
AreaInventoryDto
implements
Serializable
{
/**
* 仓库id
*/
private
String
warehouseId
;
/**
* warehouseName
*/
private
String
warehouseName
;
/**
*location 仓库地点
*/
private
String
warehouseLocation
;
/**
* 区域名称
*/
private
String
warehouseAreaName
;
/**
*list 装备汇总列表
*/
private
List
<
InventorySumDto
>
list
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EqsSummaryDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
cn.hutool.core.date.DateTime
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 装备信息粗略输出实体类,只包含部分字段
*/
@Data
public
class
EqsSummaryDto
implements
Serializable
{
/**
* epc
*/
private
String
epc
;
/**
* 装备类型ID
*/
private
String
typeId
;
/**
* 装备类型
*/
private
String
typeName
;
/**
* 装备号型ID
*/
private
String
sizeId
;
/**
* 装备号型
*/
private
String
sizeName
;
/**
* 供应商
*/
private
String
supplierName
;
/**
* 供应商ID
*/
private
String
supplierId
;
/**
* 物资状态
*/
private
String
state
;
/**
* 业务状态
*/
private
String
bussiness_state
;
/**
* 位置状态
*/
private
String
locationState
;
/**
* 质保期
*/
private
long
warrantyPeriod
;
/**
* 维保期
*/
private
Integer
maintenancePeriod
;
/**
* 价格
*/
private
BigDecimal
price
;
/**
* 位置类型
*/
private
String
locationType
;
/**
* 位置ID
*/
private
String
locationId
;
/**
* 生产日期
*/
private
Date
productionDate
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InsDetailDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 根据区域和货架id获取装备详情输出实体类
*/
@Data
public
class
InsDetailDto
{
/**
*
*/
private
String
id
;
/**
* 装备包ID
*/
private
String
packageId
;
/**
* 供应商
*/
private
String
supplierName
;
/**
* 部门
*/
private
String
departmentName
;
/**
* epc
*/
private
String
epc
;
/**
* 物资状态
*/
private
String
state
;
/**
* 业务状态
*/
private
String
bussinessState
;
/**
* 位置状态
*/
private
String
locationState
;
/**
* 生产日期
*/
private
Date
productionDate
;
/**
* 质保期
*/
private
int
warrantyPeriod
;
/**
* 维保期
*/
private
int
maintenancePeriod
;
/**
* 维修次数
*/
private
int
fixCount
;
/**
* 是否遗失
*/
private
int
lostFlag
;
/**
* Tid
*/
private
String
tid
;
/**
* 价格
*/
private
BigDecimal
price
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InventorySumDto.java
View file @
5756c6df
...
...
@@ -2,28 +2,59 @@ package com.junmp.jyzb.api.bean.dto;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
InventorySumDto
{
/**
*
组织机构
*
id 装备汇总id
*/
private
String
OrgName
;
private
String
id
;
/**
*
位置
*
orgId 组织机构id
*/
private
String
locationType
;
private
Long
orgId
;
/**
*
总数
*
orgName 组织机构名称
*/
private
int
Num
;
private
String
orgName
;
/**
*
总价
*
typeId 装备类型id
*/
private
int
totalPrice
;
private
String
typeId
;
/**
*typeName 装备类型名称
*/
private
String
typeName
;
/**
*sizeId 装备型号id
*/
private
String
sizeId
;
/**
*sizeName 装备型号名称
*/
private
String
sizeName
;
/**
*number 库存数量
*/
private
Integer
number
;
/**
*price 总价
*/
private
BigDecimal
price
;
/**
*stockNumber 在库数
*/
private
Integer
stockNumber
;
/**
*outboundNumber 出库数量
*/
private
Integer
outboundNumber
;
/**
*expireNumber 过质保数量
*/
private
Integer
expireNumber
;
private
List
<
InsDetailDto
>
detailList
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/ShelfInsDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ShelfInsDto
{
/**
* 仓库id
*/
private
String
warehouseId
;
/**
* warehouseName
*/
private
String
warehouseName
;
/**
*location 仓库地点
*/
private
String
warehouseLocation
;
/**
*list 装备汇总列表
*/
private
List
<
InventorySumDto
>
list
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/ShelfInventoryDto.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
ShelfInventoryDto
implements
Serializable
{
/**
* 仓库id
*/
private
String
warehouseId
;
/**
*仓库名称
*/
private
String
warehouseName
;
/**
*货架名称
*/
private
String
shelfAreaName
;
/**
*仓库地点
*/
private
String
warehouseLocation
;
/**
* 装备汇总list
*/
private
List
<
InventorySumDto
>
list
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/WarehouseAreaDto.java
View file @
5756c6df
...
...
@@ -6,7 +6,7 @@ import java.io.Serializable;
@Data
public
class
WarehouseAreaDto
implements
Serializable
{
private
String
i
d
;
private
String
areaI
d
;
private
String
areaName
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventoryReq.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
import
com.junmp.v2.validator.api.validators.unique.TableUniqueValue
;
...
...
@@ -11,6 +13,8 @@ import javax.validation.constraints.NotBlank;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
InventoryReq
extends
BaseRequest
{
...
...
@@ -47,6 +51,10 @@ public class InventoryReq extends BaseRequest {
* 部门ID
*/
private
long
departmentId
;
/**
* 货架位置
*/
private
String
shelfLocation
;
/**
* 货架位置
...
...
@@ -61,7 +69,8 @@ public class InventoryReq extends BaseRequest {
/**
* 组织机构ID
*/
private
String
orgId
;
@NotNull
(
message
=
"组织机构id不能为空"
,
groups
=
{
detail
.
class
})
private
Long
orgId
;
/**
* 物资状态
...
...
@@ -84,9 +93,25 @@ public class InventoryReq extends BaseRequest {
*/
private
DateTime
productionDate
;
/**
* 质保期
*/
private
long
warrantyPeriod
;
/**
* 维保期
*/
private
Integer
maintenancePeriod
;
/**
* 维修次数
*/
private
Integer
fixCount
;
/**
* 维修次数
*/
private
int
TermState
;
/**
* 位置类型
*/
private
String
locationType
;
...
...
@@ -99,4 +124,43 @@ public class InventoryReq extends BaseRequest {
* 是否遗失
*/
private
int
lostFlag
;
/**
* 价格
*/
private
BigDecimal
price
;
/**
* 标签id
*/
private
String
tid
;
/**
* 备注
*/
private
String
note
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 更新人员
*/
private
String
updateUser
;
/**
* 创建人员
*/
private
String
createUser
;
/**
* EPC集合
*/
private
List
<
String
>
epcList
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/ShelfReq.java
View file @
5756c6df
...
...
@@ -10,9 +10,10 @@ import javax.validation.constraints.NotBlank;
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ShelfReq
extends
BaseRequest
{
@NotBlank
(
message
=
"货架id不能为空"
,
groups
=
{
edit
.
class
})
private
String
shelfId
;
private
Lo
ng
areaId
;
private
Stri
ng
areaId
;
private
String
shelfName
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/WarehouseAreaReq.java
View file @
5756c6df
...
...
@@ -10,13 +10,14 @@ import java.util.Date;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
WarehouseAreaReq
extends
BaseRequest
{
@NotBlank
(
message
=
"
地区主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"
区域主键不能为空"
,
groups
=
{
edit
.
class
})
private
String
id
;
private
String
areaName
;
private
Long
orgId
Int
;
private
Long
orgId
;
@NotBlank
(
message
=
"仓库id不能为空"
,
groups
=
{
detail
.
class
})
private
String
warehouseId
;
private
String
photo
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/WarehouseReq.java
View file @
5756c6df
...
...
@@ -16,8 +16,6 @@ public class WarehouseReq extends BaseRequest {
@NotBlank
(
message
=
"仓库主键不能为空"
,
groups
=
{
updateStatus
.
class
,
delete
.
class
,
detail
.
class
})
private
String
id
;
private
Long
departmentId
;
private
String
name
;
private
String
location
;
...
...
@@ -50,6 +48,5 @@ public class WarehouseReq extends BaseRequest {
private
Long
orderId
;
@NotBlank
(
message
=
"IncludeLowerLevel不能为空"
,
groups
=
{
edit
.
class
})
private
String
IncludeLowerLevel
;
}
\ No newline at end of file
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/EquipmentBindReq.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
EquipmentBindReq
extends
BaseRequest
{
/**
* 单警柜箱号id
*/
@NotBlank
(
message
=
"箱号id不能为空"
,
groups
=
{
edit
.
class
})
private
String
cabinetBoxId
;
/**
* 单警柜箱号id
*/
@NotBlank
(
message
=
"单警柜id不能为空"
,
groups
=
{
edit
.
class
})
private
String
cabinetId
;
/**
* 单警柜箱号id
*/
@NotNull
(
message
=
"组织机构id不能为空"
,
groups
=
{
edit
.
class
})
private
Long
orgId
;
/**
* 装备集合
*/
List
<
InventoryReq
>
equipmentList
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetBoxReq.java
View file @
5756c6df
...
...
@@ -22,6 +22,5 @@ public class UpdateCabinetBoxReq extends BaseRequest {
@NotBlank
(
message
=
"单警柜编号不能为空"
,
groups
=
{
add
.
class
})
private
String
cabinetNum
;
@NotNull
(
message
=
"箱号不能为空"
,
groups
=
{
add
.
class
})
private
Integer
num
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateShelfReq.java
View file @
5756c6df
...
...
@@ -2,16 +2,19 @@ package com.junmp.jyzb.api.bean.req;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
UpdateShelfReq
extends
BaseRequest
{
@NotBlank
(
message
=
"货架id不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
})
private
String
shelfId
;
private
Long
areaId
;
@NotNull
(
message
=
"区域id不能为空"
,
groups
=
{
add
.
class
})
private
String
areaId
;
@NotBlank
(
message
=
"货架名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
shelfName
;
...
...
@@ -41,4 +44,6 @@ public class UpdateShelfReq extends BaseRequest {
@NotBlank
(
message
=
"型号信息不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
sizeInfo
;
private
static
final
long
serialVersionUID
=
1L
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateWarehouseAreaReq.java
View file @
5756c6df
...
...
@@ -10,15 +10,15 @@ import java.util.Date;
public
class
UpdateWarehouseAreaReq
extends
BaseRequest
{
@NotBlank
(
message
=
"地区主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
private
String
areaId
;
@NotBlank
(
message
=
"区域名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"区域名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
areaName
;
private
Long
orgId
Int
;
private
Long
orgId
;
@NotBlank
(
message
=
"仓库id不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"仓库id不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
warehouseId
;
@NotBlank
(
message
=
"照片不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"照片不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
photo
;
private
Date
createTime
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateWarehouseReq.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
...
...
@@ -14,18 +12,16 @@ import java.util.List;
@Data
public
class
UpdateWarehouseReq
extends
BaseRequest
{
@NotBlank
(
message
=
"仓库主键不能为空"
,
groups
=
{
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"仓库主键不能为空"
,
groups
=
{
edit
.
class
})
private
String
id
;
private
Long
departmentId
;
@NotBlank
(
message
=
"仓库名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"仓库名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
name
;
@NotBlank
(
message
=
"仓库地点不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"仓库地点不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
location
;
@NotBlank
(
message
=
"联系方式不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"联系方式不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
phone
;
private
String
video
;
...
...
@@ -36,7 +32,7 @@ public class UpdateWarehouseReq extends BaseRequest {
private
String
updateUser
;
@NotNull
(
message
=
"组织机构id不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@NotNull
(
message
=
"组织机构id不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
Long
orgId
;
private
Boolean
isLocked
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/CabinetExceptionEnum.java
View file @
5756c6df
...
...
@@ -32,7 +32,7 @@ public enum CabinetExceptionEnum implements IExceptionEnum {
/**
* 传入参数错误
*/
PARAMETER_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"传入参数错误"
),
PARAMETER_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"传入参数错误
,或为空
"
),
/**
* 箱门id不存在
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/InventoryExceptionEnum.java
0 → 100644
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
api
.
exception
.
enums
;
import
com.junmp.v2.common.constant.CommonConstant
;
import
com.junmp.v2.common.exception.IExceptionEnum
;
import
lombok.Getter
;
@Getter
public
enum
InventoryExceptionEnum
implements
IExceptionEnum
{
INVENTORY_NOT_EXIST
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"装备信息不存在"
)
;
/**
* 错误编码
*/
private
final
Integer
code
;
/**
* 提示用户信息
*/
private
final
String
message
;
InventoryExceptionEnum
(
Integer
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/ShelfExceptionEnum.java
View file @
5756c6df
...
...
@@ -12,58 +12,7 @@ public enum ShelfExceptionEnum implements IExceptionEnum {
*/
SHELF_NOT_EXIST
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
12
,
"货架信息不存在"
),
/**
* 产品信息不存在
*/
PRODUCT_SKU_NOT_EXIST
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
13
,
"号型不存在"
),
/**
* 批次信息不存在
*/
BATCH_NOT_EXIST
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
14
,
"批次不存在"
),
/**
* 批次信息不存在
*/
BATCH_PROCESSED
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
15
,
"批次已生产"
),
/**
* 批次生产已完成
*/
BATCH_PROCESSED_DONE
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
16
,
"批次生产已完成"
),
/**
* 批次生产已完成
*/
MODIFY_NUM_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
17
,
"批次生产已完成,数量不能小于原数量"
),
/**
* 标签信息不存在
*/
TAG_INFO_NOT_EXISTS
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
19
,
"标签信息不存在"
),
/**
* 标签信息初始化完成
*/
TAG_INFO_INIT_DONE
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
20
,
"检查标签信息是否绑定完成"
),
/**
* 标签已绑定
*/
TAG_INFO_HAD_BINDING
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
21
,
"标签已绑定"
),
/**
* 确认绑定是否已完成
*/
TAG_UID_BINDING_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
22
,
"确认绑定是否已完成"
),
/**
* 标签重复
*/
TAG_INFO_REPEAT_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
+
JYZBConstant
.
JYZB_EXCEPTION_STEP_CODE
+
23
,
"标签重复"
),
;
;
/**
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/WarehouseAreaExceptionEnum.java
View file @
5756c6df
...
...
@@ -14,11 +14,16 @@ public enum WarehouseAreaExceptionEnum implements IExceptionEnum {
/**
* 区域已存在
*/
AREA_IS_EXISTS
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"区域已经存在"
)
;
AREA_IS_EXISTS
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"区域已经存在"
),
/**
* 该区域不属于该仓库中
*/
AREA_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"该区域不属于该仓库中"
)
;
/**
* 错误编码
*/
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/config/MybatisPlusConfig.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
config
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@MapperScan
(
"com.junmp.jyzb.mapper*"
)
public
class
MybatisPlusConfig
{
public
class
MybatisPlusConfig
{
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
...
...
@@ -21,4 +21,5 @@ public class MybatisPlusConfig {
return
interceptor
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetBoxController.java
View file @
5756c6df
...
...
@@ -25,11 +25,7 @@ public class CabinetBoxController {
//添加箱门信息
@PostMapping
(
"/AddBoxInfo"
)
@ApiOperation
(
"添加箱门信息"
)
public
ApiRes
<
Boolean
>
AddBoxInfo
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateCabinetBoxReq
req
){
boolean
b
=
cabinetBoxService
.
AddBoxInfo
(
req
);
if
(!
b
){
return
ApiRes
.
failure
(
"添加失败"
);
}
return
ApiRes
.
success
(
b
);
public
ApiRes
<
String
>
AddBoxInfo
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateCabinetBoxReq
req
){
return
ApiRes
.
success
(
cabinetBoxService
.
AddBoxInfo
(
req
));
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.dto.EqsSummaryDto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
import
com.junmp.jyzb.api.bean.query.InventorySumReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseReq
;
import
com.junmp.jyzb.api.bean.req.EquipmentBindReq
;
import
com.junmp.jyzb.entity.InventorySummary
;
import
com.junmp.jyzb.service.InventoryService
;
import
com.junmp.jyzb.service.InventorySummaryService
;
...
...
@@ -18,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
@RestController
...
...
@@ -42,6 +47,12 @@ public class InventoryController {
public
ApiRes
<
PageResult
<
InventorySummary
>>
getEquipmentInfo
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
InventorySumReq
req
)
{
return
ApiRes
.
success
(
inventorySummaryService
.
getEquipmentInfo
(
req
));
}
@PostMapping
(
"/GetInventoryByOrgId"
)
@ApiOperation
(
"查询组织机构拥有装备"
)
public
ApiRes
<
List
<
EqsSummaryDto
>>
getInventoryByOrgId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
getInventoryByOrgId
(
req
));
}
@PostMapping
(
"/SetInventoryMsg"
)
@ApiOperation
(
"填充汇总表信息"
)
...
...
@@ -69,19 +80,7 @@ public class InventoryController {
return
returnMsg
;
}
@PostMapping
(
"/UpdateInventoryNum"
)
@ApiOperation
(
"手动重置库存数量信息"
)
public
ResponseResult
updateInventoryNum
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
inventoryService
.
updateInventoryNum
(
msg
);
return
returnMsg
;
}
@PostMapping
(
"/GetInventoryByOrgId"
)
@ApiOperation
(
"查询组织机构拥有装备"
)
public
ResponseResult
getInventoryByOrgId
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
inventoryService
.
getInventoryByOrgId
(
msg
);
return
returnMsg
;
}
@PostMapping
(
"/GetInventoryDevelop"
)
@ApiOperation
(
"获取装备明细表所有信息"
)
...
...
@@ -90,10 +89,27 @@ public class InventoryController {
return
returnMsg
;
}
@PostMapping
(
"/InvertoryBind
Box
"
)
@PostMapping
(
"/InvertoryBind"
)
@ApiOperation
(
"装备绑定箱门"
)
public
ResponseResult
InvertoryBindBox
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
inventoryService
.
InvertoryBindBox
(
msg
);
return
returnMsg
;
public
ApiRes
<
Boolean
>
InvertoryBind
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
EquipmentBindReq
req
){
return
ApiRes
.
success
(
inventoryService
.
InvertoryBind
(
req
));
}
@PostMapping
(
"/UpdateWarehouseInsNum"
)
@ApiOperation
(
"手动重置仓库库存数量信息"
)
public
ApiRes
<
Boolean
>
UpdateWarehouseInsNum
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
WarehouseReq
req
){
return
ApiRes
.
success
(
inventoryService
.
UpdateWarehouseInsNum
(
req
));
}
@PostMapping
(
"/UpdateCabinetInsNum"
)
@ApiOperation
(
"手动重置单警柜库存数量信息"
)
public
ApiRes
<
Boolean
>
UpdateCabinetInsNum
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetReq
req
){
return
ApiRes
.
success
(
inventoryService
.
UpdateCabinetInsNum
(
req
));
}
@PostMapping
(
"/GetInvInfoByEpc"
)
@ApiOperation
(
"根据EPC列表获取装备信息"
)
public
ApiRes
<
List
<
EqsSummaryDto
>>
GetInvInfoByEpc
(
@RequestBody
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
GetInvInfoByEpc
(
req
));
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/WarehouseController.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.dto.ShelfDto
;
import
com.junmp.jyzb.api.bean.dto.WarehouseAreaDto
;
import
com.junmp.jyzb.api.bean.dto.WarehouseDto
;
import
com.junmp.jyzb.api.bean.dto.*
;
import
com.junmp.jyzb.api.bean.query.ShelfReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseAreaReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseReq
;
...
...
@@ -85,7 +83,7 @@ public class WarehouseController {
@PostMapping
(
"/AddArea"
)
@ApiOperation
(
"添加区域"
)
public
ApiRes
<
Boolean
>
addArea
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateWarehouseAreaReq
req
)
{
public
ApiRes
<
String
>
addArea
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateWarehouseAreaReq
req
)
{
return
ApiRes
.
success
(
warehouseAreaService
.
addArea
(
req
));
}
...
...
@@ -103,10 +101,22 @@ public class WarehouseController {
@PostMapping
(
"/GetAreaList"
)
@ApiOperation
(
"查询区域信息"
)
public
ApiRes
<
List
<
WarehouseAreaDto
>>
getAreaList
(
@RequestBody
WarehouseAreaReq
req
){
public
ApiRes
<
List
<
WarehouseAreaDto
>>
getAreaList
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
WarehouseAreaReq
req
){
return
ApiRes
.
success
(
warehouseAreaService
.
getAreaList
(
req
));
}
@PostMapping
(
"/AreaInventoryList"
)
@ApiOperation
(
"根据区域id查询装备信息汇总"
)
public
ApiRes
<
AreaInventoryDto
>
AreaInventoryList
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
WarehouseAreaReq
req
){
return
ApiRes
.
success
(
warehouseAreaService
.
AreaInventoryList
(
req
));
}
@PostMapping
(
"/AreaInventoryDetail"
)
@ApiOperation
((
"/通过区域id查询每件装备信息详情"
))
public
ApiRes
<
AreaInsDto
>
AreaInventoryDetail
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
WarehouseAreaReq
req
){
return
ApiRes
.
success
(
warehouseAreaService
.
AreaInventoryDetail
(
req
));
}
@PostMapping
(
"/AddShelf"
)
@ApiOperation
(
"添加货架"
)
...
...
@@ -131,4 +141,19 @@ public class WarehouseController {
public
ApiRes
<
List
<
ShelfDto
>>
GetShelfList
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
shelfService
.
GetShelfList
(
req
));
}
@PostMapping
(
"/ShelfInventoryList"
)
@ApiOperation
(
"根据货架id查询装备信息汇总"
)
public
ApiRes
<
ShelfInventoryDto
>
ShelfInventoryList
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
shelfService
.
ShelfInventoryList
(
req
));
}
@PostMapping
(
"/ShelfInventoryDetail"
)
@ApiOperation
((
"/通过货架id查询每件装备信息详情"
))
public
ApiRes
<
ShelfInsDto
>
AreaInventoryDetail
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
shelfService
.
ShelfInventoryDetail
(
req
));
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
View file @
5756c6df
...
...
@@ -138,7 +138,7 @@ public class Inventory implements Serializable {
/**
*
是否遗失
*
标签id
*/
private
String
tid
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
View file @
5756c6df
...
...
@@ -161,5 +161,12 @@ public class InventorySummary implements Serializable {
@TableField
(
"one_id"
)
private
String
oneId
;
/**
* 货架id
*/
@ApiModelProperty
(
"货架id"
)
@TableField
(
"location_shelf_id"
)
private
String
locationShelfId
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Shelf.java
View file @
5756c6df
...
...
@@ -19,7 +19,7 @@ public class Shelf implements Serializable {
private
String
shelfId
;
@TableField
(
"area_id"
)
private
Lo
ng
areaId
;
private
Stri
ng
areaId
;
@TableField
(
"shelf_name"
)
private
String
shelfName
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Warehouse.java
View file @
5756c6df
...
...
@@ -19,9 +19,6 @@ public class Warehouse implements Serializable {
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_UUID
)
private
String
id
;
@TableField
(
"department_id"
)
private
Long
departmentId
;
@TableField
(
"name"
)
private
String
name
;
...
...
@@ -34,7 +31,7 @@ public class Warehouse implements Serializable {
@TableField
(
"video"
)
private
String
video
;
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
_UPDATE
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
UPDATE
)
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/WarehouseArea.java
View file @
5756c6df
...
...
@@ -2,7 +2,6 @@ package com.junmp.jyzb.entity;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.AllArgsConstructor
;
...
...
@@ -22,7 +21,7 @@ public class WarehouseArea implements Serializable {
private
String
areaName
;
@TableField
(
"org_id_int"
)
private
Long
orgId
Int
;
private
Long
orgId
;
@TableField
(
"warehouse_id"
)
private
String
warehouseId
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
View file @
5756c6df
...
...
@@ -12,8 +12,8 @@ import java.util.Map;
@Mapper
public
interface
CabinetMapper
extends
BaseMapper
<
Cabinet
>
{
List
<
Cabinet
>
getAllCabinetByOrgList
(
@Param
(
"allOrgId"
)
List
<
Long
>
allOrgId
);
List
<
Cabinet
>
getAllCabinetByOrgList
(
List
<
Long
>
allOrgId
);
boolean
SetInventoryInfo
(
String
id
);
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
View file @
5756c6df
...
...
@@ -26,5 +26,4 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List
<
Map
<
String
,
Object
>>
getInventoryList
(
@Param
(
"queryType"
)
String
queryType
,
@Param
(
"typeCode"
)
String
typeCode
,
@Param
(
"typeId"
)
String
typeId
,
@Param
(
"sizeId"
)
String
sizeId
);
List
<
Map
<
String
,
Object
>>
getInventoryByOrgId
(
String
orgId
);
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/WarehouseMapper.java
View file @
5756c6df
...
...
@@ -30,11 +30,6 @@ public interface WarehouseMapper extends BaseMapper<Warehouse> {
List
<
Warehouse
>
getAllWarehouseByOrgList
(
List
<
String
>
allOrgId
);
void
setWarehouseSumInventory
(
@Param
(
"updateId"
)
String
id
);
void
setWarehouseInSumInventory
(
@Param
(
"updateId"
)
String
id
);
void
setWarehouseOutSumInventory
(
@Param
(
"updateId"
)
String
id
);
void
setWarehousePriceInventory
(
@Param
(
"updateId"
)
String
id
);
boolean
SetInventoryInfo
(
String
id
);
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetBoxService.java
View file @
5756c6df
...
...
@@ -15,7 +15,7 @@ public interface CabinetBoxService extends IService<CabinetBox> {
//添加箱门信息
boolean
AddBoxInfo
(
UpdateCabinetBoxReq
req
);
String
AddBoxInfo
(
UpdateCabinetBoxReq
req
);
//判断箱门信息是否存在
CabinetBox
CabinetBoxExist
(
String
id
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
View file @
5756c6df
...
...
@@ -14,8 +14,6 @@ import java.util.Map;
public
interface
CabinetService
extends
IService
<
Cabinet
>
{
ResponseResult
setCabinetInventory
(
Map
<
String
,
Object
>
msg
);
/**
* 添加单警柜
* @param req
...
...
@@ -74,4 +72,5 @@ public interface CabinetService extends IService<Cabinet> {
//判断单警柜是否存在
Cabinet
CabinetExist
(
String
id
);
boolean
SetInventoryInfo
(
String
id
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.dto.EqsSummaryDto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseReq
;
import
com.junmp.jyzb.api.bean.req.EquipmentBindReq
;
import
com.junmp.jyzb.entity.Inventory
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.v2.db.api.page.PageResult
;
import
java.util.List
;
import
java.util.Map
;
public
interface
InventoryService
extends
IService
<
Inventory
>
{
...
...
@@ -16,15 +22,20 @@ public interface InventoryService extends IService<Inventory> {
ResponseResult
setInventoryMsg
();
ResponseResult
updateInventoryNum
(
Map
<
String
,
Object
>
msg
);
ResponseResult
getInventoryList
(
Map
<
String
,
Object
>
msg
);
ResponseResult
getInventoryByOrgId
(
Map
<
String
,
Object
>
msg
);
List
<
EqsSummaryDto
>
getInventoryByOrgId
(
InventoryReq
req
);
ResponseResult
getInventoryDevelop
();
ResponseResult
InvertoryBindBox
(
Map
<
String
,
Object
>
msg
);
boolean
UpdateWarehouseInsNum
(
WarehouseReq
req
);
boolean
UpdateCabinetInsNum
(
CabinetReq
req
);
boolean
InvertoryBind
(
EquipmentBindReq
req
);
List
<
EqsSummaryDto
>
GetInvInfoByEpc
(
InventoryReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/ShelfService.java
View file @
5756c6df
...
...
@@ -2,6 +2,8 @@ package com.junmp.jyzb.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.dto.ShelfDto
;
import
com.junmp.jyzb.api.bean.dto.ShelfInsDto
;
import
com.junmp.jyzb.api.bean.dto.ShelfInventoryDto
;
import
com.junmp.jyzb.api.bean.query.ShelfReq
;
import
com.junmp.jyzb.api.bean.req.UpdateShelfReq
;
import
com.junmp.jyzb.entity.Shelf
;
...
...
@@ -16,4 +18,10 @@ public interface ShelfService extends IService<Shelf> {
boolean
DeleteShelf
(
UpdateShelfReq
req
);
List
<
ShelfDto
>
GetShelfList
(
ShelfReq
req
);
//通过货架id查询装备信息汇总
ShelfInventoryDto
ShelfInventoryList
(
ShelfReq
req
);
//通过货架id查询装备详细信息
ShelfInsDto
ShelfInventoryDetail
(
ShelfReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseAreaService.java
View file @
5756c6df
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.dto.WarehouseAreaDto
;
import
com.junmp.jyzb.api.bean.dto.*
;
import
com.junmp.jyzb.api.bean.query.ShelfReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseAreaReq
;
import
com.junmp.jyzb.api.bean.req.UpdateWarehouseAreaReq
;
import
com.junmp.jyzb.entity.WarehouseArea
;
...
...
@@ -10,11 +11,26 @@ import java.util.List;
public
interface
WarehouseAreaService
extends
IService
<
WarehouseArea
>
{
boolean
addArea
(
UpdateWarehouseAreaReq
msg
);
//增加区域
String
addArea
(
UpdateWarehouseAreaReq
msg
);
//更改区域信息
boolean
updateArea
(
UpdateWarehouseAreaReq
msg
);
//删除区域
boolean
deleteArea
(
UpdateWarehouseAreaReq
msg
);
//查询区域信息
List
<
WarehouseAreaDto
>
getAreaList
(
WarehouseAreaReq
msg
);
//判断区域是都存在(通用方法)
WarehouseArea
WarehouseAreaExist
(
String
id
);
//通过区域id查询装备信息汇总
AreaInventoryDto
AreaInventoryList
(
WarehouseAreaReq
req
);
//通过区域id查询每件装备的详细信息
AreaInsDto
AreaInventoryDetail
(
WarehouseAreaReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseService.java
View file @
5756c6df
...
...
@@ -43,8 +43,8 @@ public interface WarehouseService extends IService<Warehouse> {
List
<
WarehouseDto
>
getAllWarehouse
(
WarehouseReq
orgId
);
ResponseResult
setWarehouseInventory
(
Map
<
String
,
Object
>
msg
);
//通过仓库id 判断仓库是否存在
Warehouse
WarehoustExist
(
String
id
);
boolean
SetInventoryInfo
(
String
id
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetBoxServiceImpl.java
View file @
5756c6df
...
...
@@ -48,17 +48,16 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
//添加箱门信息
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
AddBoxInfo
(
UpdateCabinetBoxReq
req
)
{
public
String
AddBoxInfo
(
UpdateCabinetBoxReq
req
)
{
Cabinet
cabinet
=
cabinetService
.
getOne
(
new
LambdaQueryWrapper
<
Cabinet
>()
.
eq
(
Cabinet:
:
getCabinetNum
,
req
.
getCabinetNum
()));
if
(
ObjectUtil
.
isNull
(
cabinet
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
CABINET_ISNOT_EXISTS
);
}
//判断传递的箱号是否存在
CabinetBox
one
=
getOne
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
eq
(
CabinetBox:
:
get
Num
,
req
.
getNum
()));
if
(
ObjectUtil
.
isNull
(
one
)){
.
eq
(
CabinetBox:
:
get
Id
,
req
.
getId
()));
if
(
ObjectUtil
.
isN
otN
ull
(
one
)){
throw
new
ServiceException
(
CabinetBoxExceptionEnum
.
CABINETBOX_IS_EXISTS
);
}
CabinetBox
cabinetBox
=
new
CabinetBox
();
...
...
@@ -70,11 +69,14 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
if
(
num
==
null
){
num
=
1
;
cabinet
.
setNum
(
num
);
cabinetBox
.
setNum
(
num
);
}
else
{
cabinet
.
setNum
(
cabinet
.
getNum
()+
1
);
cabinet
.
setNum
(
num
+
1
);
cabinetBox
.
setNum
(
num
+
1
);
}
cabinetService
.
updateById
(
cabinet
);
return
save
(
cabinetBox
);
save
(
cabinetBox
);
return
cabinetBox
.
getId
();
}
//判断箱子信息是否存在
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
5756c6df
...
...
@@ -66,25 +66,6 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
}
public
ResponseResult
setCabinetInventory
(
Map
<
String
,
Object
>
msg
)
{
String
id
;
if
(
msg
.
containsKey
(
"locationId"
)
&&
msg
.
get
(
"locationId"
)
!=
""
)
{
id
=
msg
.
get
(
"locationId"
).
toString
();
}
else
{
id
=
null
;
}
//统计仓库 装备总数
// cabinetMapper.setCabinetSumInventory(id);
// //统计仓库 装备在库总数
// cabinetMapper.setCabinetInSumInventory(id);
// //统计仓库 装备出库总数
// cabinetMapper.setCabinetOutSumInventory(id);
// //统计仓库 装备出库总数
// cabinetMapper.setCabinetPriceInventory(id);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
/**
* 添加单警柜
*
...
...
@@ -181,63 +162,30 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
* 获取单警柜列表
*通过机构id进行查询
* @param req 单警柜信息
* @param req
getIncludeLowerLevel true:查询本级及下级 false:查询本级
* @param req
* @return
*/
@Override
public
List
<
CabinetDto
>
getAllCabinetList
(
CabinetReq
req
)
{
//判断组织机构是否存在
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
Cabinet
>
cabinets
=
new
ArrayList
<>();
List
<
CabinetDto
>
cabinetList
=
new
ArrayList
<>();
List
<
CabinetBoxDto
>
cabinetBoxList
=
new
ArrayList
<>();
//如果组织机构时浙江省公安厅
if
(
req
.
getOrgId
().
equals
(
"1369509498032808905"
)
&&
req
.
getIncludeLowerLevel
().
equals
(
"true"
))
{
cabinets
=
this
.
list
(
new
LambdaQueryWrapper
<
Cabinet
>()
.
eq
(
Cabinet:
:
getOrgId
,
req
.
getOrgId
()));
for
(
Cabinet
cabinet:
cabinets
)
{
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
//添加箱门信息列表
List
<
CabinetBox
>
list
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
()));
for
(
CabinetBox
cabinetBox:
list
)
{
CabinetBoxDto
cabinetBoxDto
=
new
CabinetBoxDto
();
BeanPlusUtil
.
copyProperties
(
cabinetBox
,
cabinetBoxDto
);
cabinetBoxList
.
add
(
cabinetBoxDto
);
}
cabinetDto
.
setCabinetBoxList
(
cabinetBoxList
);
cabinetList
.
add
(
cabinetDto
);
}
return
cabinetList
;
}
//分两种情况,如果说是本级及下级(全部)所有的单警柜信息,则incluLowerLevel为true,如果是查询本级的单警柜信息则为false
if
(
req
.
getIncludeLowerLevel
().
equals
(
"true"
)
||
req
.
getIncludeLowerLevel
().
equals
(
"false"
))
{
List
<
Long
>
allOrgId
=
getAllOrgId
(
req
,
req
.
getIncludeLowerLevel
());
if
(
allOrgId
.
size
()==
0
)
{
//抛出组织机构不存在异常
throw
new
ServiceException
(
PubOrgExceptionEnum
.
PUBORG_NOT_EXIST
);
}
cabinets
=
getAllCabinetByOrg
(
allOrgId
);
for
(
Cabinet
cabinet:
cabinets
)
{
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
//添加箱门信息列表
List
<
CabinetBox
>
list
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
List
<
Cabinet
>
list
=
list
(
new
LambdaQueryWrapper
<
Cabinet
>().
eq
(
Cabinet:
:
getOrgId
,
req
.
getOrgId
()));
for
(
Cabinet
cabinet:
list
)
{
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
List
<
CabinetBox
>
list1
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
()));
for
(
CabinetBox
cabinetBox:
list
)
{
for
(
CabinetBox
cabinetBox:
list1
)
{
CabinetBoxDto
cabinetBoxDto
=
new
CabinetBoxDto
();
BeanPlusUtil
.
copyProperties
(
cabinetBox
,
cabinetBoxDto
);
cabinetBoxList
.
add
(
cabinetBoxDto
);
}
cabinetDto
.
setCabinetBoxList
(
cabinetBoxList
);
cabinetList
.
add
(
cabinetDto
);
}
return
cabinetList
;
}
else
{
//传递的数据是否正确,不正确抛异常(只接受true、false)
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
cabinetDto
.
setCabinetBoxList
(
cabinetBoxList
);
cabinetList
.
add
(
cabinetDto
);
}
return
cabinetList
;
}
...
...
@@ -373,4 +321,13 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
return
one
;
}
//设置单警柜库存数量信息
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
SetInventoryInfo
(
String
id
)
{
//统计单警柜总数,在库总数,出库总数,装备总价格
cabinetMapper
.
SetInventoryInfo
(
id
);
return
true
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
View file @
5756c6df
...
...
@@ -3,21 +3,37 @@ package com.junmp.jyzb.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.dto.EqsSummaryDto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
import
com.junmp.jyzb.api.bean.query.WarehouseReq
;
import
com.junmp.jyzb.api.bean.req.EquipmentBindReq
;
import
com.junmp.jyzb.api.exception.enums.CabinetBoxExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.CabinetExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.InventoryExceptionEnum
;
import
com.junmp.jyzb.entity.Cabinet
;
import
com.junmp.jyzb.entity.CabinetBox
;
import
com.junmp.jyzb.entity.Inventory
;
import
com.junmp.jyzb.entity.Warehouse
;
import
com.junmp.jyzb.service.*
;
import
com.junmp.jyzb.utils.HttpStatus
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.jyzb.utils.ReturnData
;
import
com.junmp.jyzb.utils.ReturnMsg
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
com.junmp.v2.db.api.factory.PageFactory
;
import
com.junmp.v2.db.api.page.PageResult
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
com.junmp.jyzb.mapper.InventoryMapper
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.*
;
...
...
@@ -40,7 +56,16 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
private
PubOrgService
PubOrgService
;
@Resource
private
CabinetBoxService
cabinetBoxService
;
@Resource
private
PubOrgService
pubOrgService
;
@Resource
private
CabinetService
cabinetService
;
@Resource
private
SupplierService
supplierService
;
@Override
public
InventoryDto
getInventoryDetail
(
InventoryReq
req
)
{
...
...
@@ -188,24 +213,6 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
@Override
public
ResponseResult
updateInventoryNum
(
Map
<
String
,
Object
>
msg
)
{
//参数校验
try
{
checkNotBlank
(
msg
.
get
(
"locationType"
),
"locationType不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
String
locationType
=
msg
.
get
(
"locationType"
).
toString
();
if
(!
locationType
.
equals
(
"warehouse"
)
&&
!
locationType
.
equals
(
"cabinet"
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"输入的locationType值有误"
);
}
else
if
(
locationType
.
equals
(
"warehouse"
)){
warehouseService
.
setWarehouseInventory
(
msg
);
}
else
if
(
locationType
.
equals
(
"cabinet"
)){
cabinetService
.
setCabinetInventory
(
msg
);
}
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
@Override
public
ResponseResult
getInventoryList
(
Map
<
String
,
Object
>
msg
)
{
...
...
@@ -225,7 +232,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
String
typeId
=
msg
.
get
(
"typeId"
).
toString
();
String
sizeId
=
msg
.
get
(
"sizeId"
).
toString
();
//根据传入的queryType来辨别要查询什么信
�
//根据传入的queryType来辨别要查询什么信
息
if
(
queryType
.
equals
(
"org"
)
||
queryType
.
equals
(
"warehouse"
)
||
queryType
.
equals
(
"cabinet"
)){
List
<
Map
<
String
,
Object
>>
returnMsg
=
inventoryMapper
.
getInventoryList
(
queryType
,
typeCode
,
typeId
,
sizeId
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
returnMsg
);
...
...
@@ -235,16 +242,25 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
@Override
public
ResponseResult
getInventoryByOrgId
(
Map
<
String
,
Object
>
msg
)
{
//参数校验
try
{
checkNotBlank
(
msg
.
get
(
"orgId"
),
"orgId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
public
List
<
EqsSummaryDto
>
getInventoryByOrgId
(
InventoryReq
req
)
{
//判断组织机构是否存在
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
EqsSummaryDto
>
eqsSummaryDtoList
=
new
ArrayList
<>();
List
<
Inventory
>
list
=
list
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getOrgId
,
req
.
getOrgId
()));
for
(
Inventory
inventory:
list
)
{
EqsSummaryDto
eqsSummaryDto
=
new
EqsSummaryDto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsSummaryDto
);
//设置型号名称,类别名称,供应商名称
String
sizeName
=
equipmentSizeService
.
getById
(
inventory
.
getSizeId
()).
getName
();
String
typeName
=
equipmentTypeService
.
getById
(
inventory
.
getTypeId
()).
getName
();
String
supplierName
=
supplierService
.
getById
(
inventory
.
getSupplierId
()).
getName
();
eqsSummaryDto
.
setSizeName
(
sizeName
);
eqsSummaryDto
.
setTypeName
(
typeName
);
eqsSummaryDto
.
setSupplierName
(
supplierName
);
eqsSummaryDtoList
.
add
(
eqsSummaryDto
);
}
String
orgId
=
msg
.
get
(
"orgId"
).
toString
();
List
<
Map
<
String
,
Object
>>
returnMsg
=
inventoryMapper
.
getInventoryByOrgId
(
orgId
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
returnMsg
);
return
eqsSummaryDtoList
;
}
@Override
...
...
@@ -252,27 +268,82 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
null
;
}
//设置仓库库存数量
@Override
public
ResponseResult
InvertoryBindBox
(
Map
<
String
,
Object
>
msg
)
{
//参数校验
try
{
checkNotBlank
(
msg
.
get
(
"inventoryId"
),
"inventoryId不能为空"
);
checkNotBlank
(
msg
.
get
(
"locationId"
),
"locationId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
public
boolean
UpdateWarehouseInsNum
(
WarehouseReq
req
)
{
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
req
.
getId
());
boolean
b
=
warehouseService
.
SetInventoryInfo
(
warehouse
.
getId
());
return
b
;
}
//设置单警柜库存数量
@Override
public
boolean
UpdateCabinetInsNum
(
CabinetReq
req
)
{
Cabinet
cabinet
=
cabinetService
.
CabinetExist
(
req
.
getId
());
boolean
b
=
cabinetService
.
SetInventoryInfo
(
cabinet
.
getId
());
return
b
;
}
//装备绑定箱门
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
InvertoryBind
(
EquipmentBindReq
req
)
{
//判断箱门是否存在
CabinetBox
one
=
cabinetBoxService
.
getOne
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
req
.
getCabinetId
())
.
eq
(
CabinetBox:
:
getId
,
req
.
getCabinetBoxId
()));
if
(
Objects
.
isNull
(
one
)){
throw
new
ServiceException
(
CabinetBoxExceptionEnum
.
CABINETBOX_ISNOT_EXISTS
);
}
//判断组织机构是否存在
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
InventoryReq
>
equipmentList
=
req
.
getEquipmentList
();
if
(
equipmentList
.
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//将装备和箱门进行绑定(简单来 说就是更新数据库中的单条记录信息)
Inventory
inventory
=
inventoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getID
,
msg
.
get
(
"inventoryId"
))
.
eq
(
Inventory:
:
getLocationId
,
msg
.
get
(
"locationId"
))
);
if
(
Objects
.
isNull
(
inventory
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
ReturnData
.
NO_DATA
);
List
<
Inventory
>
inventoryList
=
new
ArrayList
<>();
for
(
InventoryReq
inventoryReq:
equipmentList
)
{
Inventory
inventory
=
new
Inventory
();
BeanPlusUtil
.
copyProperties
(
inventoryReq
,
inventory
);
inventory
.
setShelfId
(
req
.
getCabinetBoxId
());
inventoryList
.
add
(
inventory
);
}
inventory
.
setLocationId
((
String
)
msg
.
get
(
"locationId"
));
inventoryMapper
.
updateById
(
inventory
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
"绑定成功"
);
return
updateBatchById
(
inventoryList
);
}
//根据Epc查询装备信息
@Override
public
List
<
EqsSummaryDto
>
GetInvInfoByEpc
(
InventoryReq
req
)
{
List
<
EqsSummaryDto
>
eqsSummaryDtoList
=
new
ArrayList
<>();
//判断传入的是否为空
List
<
String
>
epcList
=
req
.
getEpcList
();
if
(
epcList
.
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//迭代器遍历列表
Iterator
<
String
>
iterator
=
epcList
.
iterator
();
while
(
iterator
.
hasNext
()){
String
epc
=
iterator
.
next
();
Inventory
inventory
=
getOne
(
new
LambdaQueryWrapper
<
Inventory
>().
eq
(
Inventory:
:
getEpc
,
epc
));
if
(
Objects
.
isNull
(
inventory
)){
throw
new
ServiceException
(
InventoryExceptionEnum
.
INVENTORY_NOT_EXIST
);
}
EqsSummaryDto
eqsSummaryDto
=
new
EqsSummaryDto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsSummaryDto
);
//设置型号名称,类别名称,供应商名称
String
sizeName
=
equipmentSizeService
.
getById
(
inventory
.
getSizeId
()).
getName
();
String
typeName
=
equipmentTypeService
.
getById
(
inventory
.
getTypeId
()).
getName
();
String
supplierName
=
supplierService
.
getById
(
inventory
.
getSupplierId
()).
getName
();
eqsSummaryDto
.
setSizeName
(
sizeName
);
eqsSummaryDto
.
setTypeName
(
typeName
);
eqsSummaryDto
.
setSupplierName
(
supplierName
);
eqsSummaryDtoList
.
add
(
eqsSummaryDto
);
}
return
eqsSummaryDtoList
;
}
/**
* @Author: Zhaojw
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PubOrgServiceImpl.java
View file @
5756c6df
...
...
@@ -69,7 +69,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
}
List
<
Long
>
resultList
=
new
ArrayList
<>();
// 存储最终的菜单树结果
Map
<
Stri
ng
,
List
<
Long
>>
childrenMap
=
new
HashMap
<>();
// 存储每个菜单项的子菜单映射
Map
<
Lo
ng
,
List
<
Long
>>
childrenMap
=
new
HashMap
<>();
// 存储每个菜单项的子菜单映射
resultList
.
add
(
orgId
);
//将自己加入到返回的List中
...
...
@@ -77,13 +77,13 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
for
(
PubOrg
menu
:
menuList
)
{
Long
org
=
menu
.
getOrgId
();
if
(!
childrenMap
.
containsKey
(
menu
.
getOrgParentId
()
.
toString
()
))
{
// 如果父菜单还不存在于映射表中
childrenMap
.
put
(
menu
.
getOrgParentId
()
.
toString
()
,
new
ArrayList
<>());
// 创建一个新的子菜单列表
if
(!
childrenMap
.
containsKey
(
menu
.
getOrgParentId
()))
{
// 如果父菜单还不存在于映射表中
childrenMap
.
put
(
menu
.
getOrgParentId
(),
new
ArrayList
<>());
// 创建一个新的子菜单列表
}
childrenMap
.
get
(
menu
.
getOrgParentId
()).
add
(
org
);
// 将当前菜单项放入对应的子菜单列表中
}
Long
orgInfo
=
Long
.
valueOf
(
orgId
);
//获取输入的组织机构id信息
//
Long orgInfo = Long.valueOf(orgId);//获取输入的组织机构id信息
//Long orgInfo = new BigInteger(orgId); // 获取顶级菜单的标识符
// 获取顶级菜单
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/ShelfServiceImpl.java
View file @
5756c6df
...
...
@@ -3,22 +3,23 @@ package com.junmp.jyzb.service.impl;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.dto.
ShelfDto
;
import
com.junmp.jyzb.api.bean.dto.
*
;
import
com.junmp.jyzb.api.bean.query.ShelfReq
;
import
com.junmp.jyzb.api.bean.req.UpdateShelfReq
;
import
com.junmp.jyzb.api.exception.enums.ShelfExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.WarehouseAreaExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.WarehouseExceptionEnum
;
import
com.junmp.jyzb.entity.
Shelf
;
import
com.junmp.jyzb.
entity.Warehouse
;
import
com.junmp.jyzb.
service.WarehouseService
;
import
com.junmp.jyzb.entity.
*
;
import
com.junmp.jyzb.
service.*
;
import
com.junmp.jyzb.
utils.DateTimeUtil
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
com.junmp.jyzb.mapper.ShelfMapper
;
import
com.junmp.jyzb.service.ShelfService
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
@Service
...
...
@@ -26,13 +27,31 @@ public class ShelfServiceImpl extends ServiceImpl<ShelfMapper, Shelf> implements
@Resource
private
WarehouseService
warehouseService
;
@Resource
private
WarehouseAreaService
warehouseAreaService
;
@Resource
private
InventorySummaryService
inventorySummaryService
;
@Resource
private
InventoryService
inventoryService
;
@Override
public
String
AddShelf
(
UpdateShelfReq
req
)
{
//判断仓库是否存在
warehouseService
.
WarehoustExist
(
req
.
getWarehouseId
());
//判断区域是否存在
warehouseAreaService
.
WarehouseAreaExist
(
req
.
getAreaId
());
//判断区域id是否在该仓库中,如果不是则抛出异常
WarehouseArea
one
=
warehouseAreaService
.
getOne
(
new
LambdaQueryWrapper
<
WarehouseArea
>()
.
eq
(
WarehouseArea:
:
getWarehouseId
,
req
.
getWarehouseId
())
.
eq
(
WarehouseArea:
:
getAreaId
,
req
.
getAreaId
()));
if
(
ObjectUtil
.
isNull
(
one
)){
throw
new
ServiceException
(
WarehouseAreaExceptionEnum
.
AREA_ERROR
);
}
Shelf
shelf
=
new
Shelf
();
BeanPlusUtil
.
copyProperties
(
req
,
shelf
);
shelf
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
shelf
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
save
(
shelf
);
return
shelf
.
getShelfId
();
}
...
...
@@ -40,14 +59,15 @@ public class ShelfServiceImpl extends ServiceImpl<ShelfMapper, Shelf> implements
@Override
public
boolean
UpdateShelf
(
UpdateShelfReq
req
)
{
//判断货架id是否正确
Shelf
shelf
=
this
.
QueryShelf
(
req
);
Shelf
shelf
=
ShelfExist
(
req
.
getShelfId
()
);
BeanPlusUtil
.
copyProperties
(
req
,
shelf
);
shelf
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
return
this
.
updateById
(
shelf
);
}
@Override
public
boolean
DeleteShelf
(
UpdateShelfReq
req
)
{
QueryShelf
(
req
);
ShelfExist
(
req
.
getShelfId
()
);
return
removeById
(
req
.
getShelfId
());
}
...
...
@@ -65,14 +85,82 @@ public class ShelfServiceImpl extends ServiceImpl<ShelfMapper, Shelf> implements
}
return
shelfDtoList
;
}
@Override
public
ShelfInventoryDto
ShelfInventoryList
(
ShelfReq
req
)
{
//判断货架是否存在
Shelf
shelf
=
ShelfExist
(
req
.
getShelfId
());
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
shelf
.
getWarehouseId
());
ShelfInventoryDto
shelfInventoryDto
=
new
ShelfInventoryDto
();
shelfInventoryDto
.
setWarehouseId
(
warehouse
.
getId
());
shelfInventoryDto
.
setWarehouseName
(
warehouse
.
getName
());
shelfInventoryDto
.
setWarehouseLocation
(
warehouse
.
getLocation
());
shelfInventoryDto
.
setShelfAreaName
(
shelf
.
getShelfName
());
List
<
InventorySumDto
>
inventorySumDtoList
=
new
ArrayList
<>();
//通过货架id获取装备列表汇总
List
<
InventorySummary
>
list
=
inventorySummaryService
.
list
(
new
LambdaQueryWrapper
<
InventorySummary
>()
.
eq
(
InventorySummary:
:
getLocationShelfId
,
req
.
getShelfId
()));
if
(
list
.
size
()==
0
){
return
null
;
}
for
(
InventorySummary
inventorySummary:
list
)
{
InventorySumDto
inventorySumDto
=
new
InventorySumDto
();
BeanPlusUtil
.
copyProperties
(
inventorySummary
,
inventorySumDto
);
inventorySumDtoList
.
add
(
inventorySumDto
);
}
shelfInventoryDto
.
setList
(
inventorySumDtoList
);
return
shelfInventoryDto
;
}
//通过货架id查询装备详细信息
@Override
public
ShelfInsDto
ShelfInventoryDetail
(
ShelfReq
req
)
{
//判断货架是否存在
Shelf
shelf
=
ShelfExist
(
req
.
getShelfId
());
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
shelf
.
getWarehouseId
());
ShelfInsDto
shelfInsDto
=
new
ShelfInsDto
();
shelfInsDto
.
setWarehouseId
(
warehouse
.
getId
());
shelfInsDto
.
setWarehouseName
(
warehouse
.
getName
());
shelfInsDto
.
setWarehouseLocation
(
warehouse
.
getLocation
());
List
<
InventorySumDto
>
inventorySumDtoList
=
new
ArrayList
<>();
//通过区域id获取装备列表汇总
List
<
InventorySummary
>
list
=
inventorySummaryService
.
list
(
new
LambdaQueryWrapper
<
InventorySummary
>()
.
eq
(
InventorySummary:
:
getLocationShelfId
,
req
.
getShelfId
()));
if
(
list
.
size
()==
0
){
return
null
;
}
List
<
InsDetailDto
>
insDetailDtoList
=
new
ArrayList
<>();
Iterator
<
InventorySummary
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
InventorySummary
inventorySummary
=
iterator
.
next
();
InventorySumDto
inventorySumDto
=
new
InventorySumDto
();
BeanPlusUtil
.
copyProperties
(
inventorySummary
,
inventorySumDto
);
//查询出详情列表信息
List
<
Inventory
>
inventoryList
=
inventoryService
.
list
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getSizeId
,
inventorySummary
.
getSizeId
())
.
eq
(
Inventory:
:
getTypeId
,
inventorySummary
.
getTypeId
())
.
eq
(
Inventory:
:
getOrgId
,
inventorySummary
.
getOrgId
())
.
eq
(
Inventory:
:
getLocationId
,
inventorySummary
.
getLocationId
()));
Iterator
<
Inventory
>
iterator1
=
inventoryList
.
iterator
();
while
(
iterator1
.
hasNext
()){
Inventory
inventory
=
iterator1
.
next
();
InsDetailDto
insDetailDto
=
new
InsDetailDto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
insDetailDto
);
insDetailDtoList
.
add
(
insDetailDto
);
}
inventorySumDto
.
setDetailList
(
insDetailDtoList
);
inventorySumDtoList
.
add
(
inventorySumDto
);
}
shelfInsDto
.
setList
(
inventorySumDtoList
);
return
shelfInsDto
;
}
/**
* 判断货架id是否存在
* @param
req
* @param
* @return
*/
private
Shelf
QueryShelf
(
UpdateShelfReq
req
)
{
Shelf
shelf
=
this
.
getById
(
req
.
getShelfId
()
);
private
Shelf
ShelfExist
(
String
id
)
{
Shelf
shelf
=
this
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
shelf
))
{
throw
new
ServiceException
(
ShelfExceptionEnum
.
SHELF_NOT_EXIST
);
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseAreaServiceImpl.java
View file @
5756c6df
...
...
@@ -3,14 +3,18 @@ package com.junmp.jyzb.service.impl;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.dto.
WarehouseAreaDto
;
import
com.junmp.jyzb.api.bean.dto.
*
;
import
com.junmp.jyzb.api.bean.query.WarehouseAreaReq
;
import
com.junmp.jyzb.api.bean.req.UpdateWarehouseAreaReq
;
import
com.junmp.jyzb.api.exception.enums.WarehouseAreaExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.WarehouseExceptionEnum
;
import
com.junmp.jyzb.entity.Inventory
;
import
com.junmp.jyzb.entity.InventorySummary
;
import
com.junmp.jyzb.entity.Warehouse
;
import
com.junmp.jyzb.entity.WarehouseArea
;
import
com.junmp.jyzb.service.InventoryService
;
import
com.junmp.jyzb.service.InventorySummaryService
;
import
com.junmp.jyzb.service.WarehouseService
;
import
com.junmp.jyzb.utils.DateTimeUtil
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
org.springframework.stereotype.Service
;
...
...
@@ -19,25 +23,32 @@ import com.junmp.jyzb.mapper.WarehouseAreaMapper;
import
com.junmp.jyzb.service.WarehouseAreaService
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
@Service
public
class
WarehouseAreaServiceImpl
extends
ServiceImpl
<
WarehouseAreaMapper
,
WarehouseArea
>
implements
WarehouseAreaService
{
@Resource
private
WarehouseAreaMapper
warehouseAreaMapper
;
@Resource
private
WarehouseService
warehouseService
;
@Resource
private
InventorySummaryService
inventorySummaryService
;
@Resource
private
InventoryService
inventoryService
;
/**
* 增加区域
* @param req
* @return
*/
@Override
public
boolean
addArea
(
UpdateWarehouseAreaReq
req
)
{
public
String
addArea
(
UpdateWarehouseAreaReq
req
)
{
WarehouseArea
area
=
new
WarehouseArea
();
BeanPlusUtil
.
copyProperties
(
req
,
area
);
//判断仓库是否存在
Warehouse
Exist
(
req
.
getWarehouseId
());
warehouseService
.
Warehoust
Exist
(
req
.
getWarehouseId
());
//判断区域名称是否存在如果存在则抛出异常
List
<
WarehouseArea
>
list
=
list
(
new
LambdaQueryWrapper
<
WarehouseArea
>()
.
eq
(
WarehouseArea:
:
getWarehouseId
,
req
.
getWarehouseId
())
...
...
@@ -45,20 +56,34 @@ public class WarehouseAreaServiceImpl extends ServiceImpl<WarehouseAreaMapper, W
if
(
list
.
size
()>
0
){
throw
new
ServiceException
(
WarehouseAreaExceptionEnum
.
AREA_IS_EXISTS
);
}
return
this
.
save
(
area
);
area
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
area
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
save
(
area
);
return
area
.
getAreaId
();
}
/**
* 更新区域信息
* @param req
* @return
*/
@Override
public
boolean
updateArea
(
UpdateWarehouseAreaReq
req
)
{
WarehouseArea
warehouseArea
=
new
WarehouseArea
();
BeanPlusUtil
.
copyProperties
(
req
,
warehouseArea
);
//判断仓库是否存在
Warehouse
Exist
(
req
.
getWarehouseId
());
warehouseService
.
Warehoust
Exist
(
req
.
getWarehouseId
());
//判断传入的区域id是否存在
WarehouseAreaExist
(
req
.
getAreaId
());
warehouseArea
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
return
this
.
updateById
(
warehouseArea
);
}
/**
* 删除区域
* @param req
* @return
*/
@Override
public
boolean
deleteArea
(
UpdateWarehouseAreaReq
req
)
{
//判断传入的区域id是否存在
...
...
@@ -68,10 +93,15 @@ public class WarehouseAreaServiceImpl extends ServiceImpl<WarehouseAreaMapper, W
return
this
.
removeById
(
warehouseArea
);
}
/**
* 通过区域id查询区域信息
* @param req
* @return
*/
@Override
public
List
<
WarehouseAreaDto
>
getAreaList
(
WarehouseAreaReq
req
)
{
//判断仓库是否存在
Warehouse
Exist
(
req
.
getWarehouseId
());
warehouseService
.
Warehoust
Exist
(
req
.
getWarehouseId
());
List
<
WarehouseArea
>
list
=
list
(
new
LambdaQueryWrapper
<
WarehouseArea
>()
.
eq
(
WarehouseArea:
:
getWarehouseId
,
req
.
getWarehouseId
()));
List
<
WarehouseAreaDto
>
warehouseAreaDtoList
=
new
ArrayList
<>();
...
...
@@ -84,22 +114,88 @@ public class WarehouseAreaServiceImpl extends ServiceImpl<WarehouseAreaMapper, W
}
//判断仓库是否存在
private
Warehouse
WarehouseExist
(
String
id
){
Warehouse
one
=
warehouseService
.
getOne
(
new
LambdaQueryWrapper
<
Warehouse
>()
.
eq
(
Warehouse:
:
getId
,
id
));
if
(
ObjectUtil
.
isNull
(
one
)){
throw
new
ServiceException
(
WarehouseExceptionEnum
.
WAREHOUSE_NOT_EXIST
);
}
return
one
;
}
//判断区域id是否正确存在
p
rivate
WarehouseArea
WarehouseAreaExist
(
String
id
){
p
ublic
WarehouseArea
WarehouseAreaExist
(
String
id
){
WarehouseArea
warehouseArea
=
this
.
getById
(
id
);
if
(
ObjectUtil
.
isNull
(
warehouseArea
)){
throw
new
ServiceException
(
WarehouseAreaExceptionEnum
.
WAREHOUSEAREA_NOT_EXIST
);
}
return
warehouseArea
;
}
/**
* 通过区域id查询装备汇总信息
* @param req
* @return
*/
@Override
public
AreaInventoryDto
AreaInventoryList
(
WarehouseAreaReq
req
)
{
//判断区域是否存在
WarehouseArea
warehouseArea
=
WarehouseAreaExist
(
req
.
getId
());
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
warehouseArea
.
getWarehouseId
());
AreaInventoryDto
areaInventoryDto
=
new
AreaInventoryDto
();
areaInventoryDto
.
setWarehouseId
(
warehouse
.
getId
());
areaInventoryDto
.
setWarehouseName
(
warehouse
.
getName
());
areaInventoryDto
.
setWarehouseLocation
(
warehouse
.
getLocation
());
areaInventoryDto
.
setWarehouseAreaName
(
warehouseArea
.
getAreaName
());
List
<
InventorySumDto
>
inventorySumDtoList
=
new
ArrayList
<>();
//通过区域id获取装备列表汇总
List
<
InventorySummary
>
list
=
inventorySummaryService
.
list
(
new
LambdaQueryWrapper
<
InventorySummary
>()
.
eq
(
InventorySummary:
:
getLocationAreaId
,
req
.
getId
()));
if
(
list
.
size
()==
0
){
return
null
;
}
for
(
InventorySummary
inventorySummary:
list
)
{
InventorySumDto
inventorySumDto
=
new
InventorySumDto
();
BeanPlusUtil
.
copyProperties
(
inventorySummary
,
inventorySumDto
);
inventorySumDtoList
.
add
(
inventorySumDto
);
}
areaInventoryDto
.
setList
(
inventorySumDtoList
);
return
areaInventoryDto
;
}
@Override
public
AreaInsDto
AreaInventoryDetail
(
WarehouseAreaReq
req
)
{
//判断区域是否存在
WarehouseArea
warehouseArea
=
WarehouseAreaExist
(
req
.
getId
());
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
warehouseArea
.
getWarehouseId
());
AreaInsDto
areaInsDto
=
new
AreaInsDto
();
areaInsDto
.
setWarehouseId
(
warehouse
.
getId
());
areaInsDto
.
setWarehouseName
(
warehouse
.
getName
());
areaInsDto
.
setWarehouseLocation
(
warehouse
.
getLocation
());
List
<
InventorySumDto
>
inventorySumDtoList
=
new
ArrayList
<>();
//通过区域id获取装备列表汇总
List
<
InventorySummary
>
list
=
inventorySummaryService
.
list
(
new
LambdaQueryWrapper
<
InventorySummary
>()
.
eq
(
InventorySummary:
:
getLocationAreaId
,
req
.
getId
()));
if
(
list
.
size
()==
0
){
return
null
;
}
List
<
InsDetailDto
>
insDetailDtoList
=
new
ArrayList
<>();
Iterator
<
InventorySummary
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
InventorySummary
inventorySummary
=
iterator
.
next
();
InventorySumDto
inventorySumDto
=
new
InventorySumDto
();
BeanPlusUtil
.
copyProperties
(
inventorySummary
,
inventorySumDto
);
//查询出详情列表信息
List
<
Inventory
>
inventoryList
=
inventoryService
.
list
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getSizeId
,
inventorySummary
.
getSizeId
())
.
eq
(
Inventory:
:
getTypeId
,
inventorySummary
.
getTypeId
())
.
eq
(
Inventory:
:
getOrgId
,
inventorySummary
.
getOrgId
())
.
eq
(
Inventory:
:
getLocationId
,
inventorySummary
.
getLocationId
()));
Iterator
<
Inventory
>
iterator1
=
inventoryList
.
iterator
();
while
(
iterator1
.
hasNext
()){
Inventory
inventory
=
iterator1
.
next
();
InsDetailDto
areaInsDetailDto
=
new
InsDetailDto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
areaInsDetailDto
);
insDetailDtoList
.
add
(
areaInsDetailDto
);
}
inventorySumDto
.
setDetailList
(
insDetailDtoList
);
inventorySumDtoList
.
add
(
inventorySumDto
);
}
areaInsDto
.
setList
(
inventorySumDtoList
);
return
areaInsDto
;
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
View file @
5756c6df
...
...
@@ -44,6 +44,8 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
public
String
AddWarehouse
(
UpdateWarehouseReq
req
)
{
Warehouse
warehouse
=
new
Warehouse
();
BeanPlusUtil
.
copyProperties
(
req
,
warehouse
);
warehouse
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
warehouse
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
save
(
warehouse
);
return
warehouse
.
getId
();
}
...
...
@@ -76,6 +78,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
public
boolean
updateWarehouse
(
UpdateWarehouseReq
req
)
{
Warehouse
warehouse
=
new
Warehouse
();
BeanPlusUtil
.
copyProperties
(
req
,
warehouse
);
warehouse
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
return
this
.
updateById
(
warehouse
);
}
...
...
@@ -83,30 +86,15 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
@Override
public
List
<
WarehouseDto
>
getAllWarehouse
(
WarehouseReq
msg
)
{
List
<
Warehouse
>
allWarehouse
=
new
ArrayList
<>();
List
<
WarehouseDto
>
warehouseDtoList
=
new
ArrayList
<>();
//判断组织机构是否存在
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
msg
.
getOrgId
());
//根据组织机构id查询组织机构名称
String
orgName
=
pubOrg
.
getOrgName
();
//如果组织机构是浙江省公安厅
if
(
msg
.
getOrgId
().
equals
(
1369509498032808905L
)
&&
msg
.
getIncludeLowerLevel
().
equals
(
"true"
)){
allWarehouse
=
this
.
list
();
for
(
Warehouse
warehouse:
allWarehouse
)
{
WarehouseDto
warehouseDto
=
new
WarehouseDto
();
BeanPlusUtil
.
copyProperties
(
warehouse
,
warehouseDto
);
warehouseDto
.
setOrgName
(
orgName
);
warehouseDtoList
.
add
(
warehouseDto
);
}
return
warehouseDtoList
;
}
//获取组织机构Id
List
<
Long
>
allOrgId
=
getAllOrgId
(
msg
);
allWarehouse
=
getAllWarehouseByOrg
(
allOrgId
);
for
(
Warehouse
warehouse:
allWarehouse
)
{
List
<
Warehouse
>
list
=
list
(
new
LambdaQueryWrapper
<
Warehouse
>()
.
eq
(
Warehouse:
:
getOrgId
,
msg
.
getOrgId
()));
for
(
Warehouse
warehouse:
list
)
{
WarehouseDto
warehouseDto
=
new
WarehouseDto
();
BeanPlusUtil
.
copyProperties
(
warehouse
,
warehouseDto
);
warehouseDto
.
setOrgName
(
orgName
);
...
...
@@ -146,24 +134,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
this
.
updateById
(
warehouse
);
}
@Override
public
ResponseResult
setWarehouseInventory
(
Map
<
String
,
Object
>
msg
)
{
String
id
;
if
(
msg
.
containsKey
(
"locationId"
)
&&
msg
.
get
(
"locationId"
)!=
""
){
id
=
msg
.
get
(
"locationId"
).
toString
();
}
else
{
id
=
null
;
}
//统计仓库 装备总数
warehouseMapper
.
setWarehouseSumInventory
(
id
);
//统计仓库 装备在库总数
warehouseMapper
.
setWarehouseInSumInventory
(
id
);
//统计仓库 装备出库总数
warehouseMapper
.
setWarehouseOutSumInventory
(
id
);
//统计仓库 装备出库总数
warehouseMapper
.
setWarehousePriceInventory
(
id
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
...
...
@@ -182,4 +152,13 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
warehouseMsg
;
}
//设置仓库中的装备信息(在库数,总数,出库数,价格)
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
SetInventoryInfo
(
String
id
)
{
//统计仓库总数,在库总数,出库总数,装备总价格
warehouseMapper
.
SetInventoryInfo
(
id
);
return
true
;
}
}
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
View file @
5756c6df
...
...
@@ -30,7 +30,26 @@
id, cabinet_num, `name`, org_id, `location`, error_state, create_time, update_time,
create_user, update_user
</sql>
<update
id=
"SetInventoryInfo"
parameterType=
"java.lang.String"
>
UPDATE base_cabinet AS w
SET sum = (
SELECT sum(number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
in_sum=(
SELECT sum(stock_number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
out_sum=(
SELECT sum(outbound_number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
price_total=(
SELECT sum(price) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id)
WHERE w.id=#{id}
</update>
<select
id=
"getAllCabinetByOrgList"
parameterType=
"java.util.List"
resultType=
"com.junmp.jyzb.entity.Cabinet"
>
...
...
jyzb-biz/src/main/resources/mapper/InventorySummaryMapper.xml
View file @
5756c6df
...
...
@@ -24,11 +24,12 @@
<result
column=
"expire_number"
jdbcType=
"INTEGER"
property=
"expireNumber"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"location_shelf_id"
jdbcType=
"VARCHAR"
property=
"locationShelfId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, org_id, org_name, type_id, type_name, size_id, size_name, location_type, location_id,
location_name, location_area_id, location_area, `number`, price, stock_number, outbound_number,
destruction_number, expire_number, create_time, update_time
destruction_number, expire_number, create_time, update_time
,location_shelf_id
</sql>
</mapper>
\ No newline at end of file
jyzb-biz/src/main/resources/mapper/WarehouseMapper.xml
View file @
5756c6df
...
...
@@ -112,52 +112,26 @@
</foreach>
</select>
<update
id=
"setWarehouseSumInventory"
>
UPDATE base_warehouse AS w
SET sum = (
SELECT count(id)
FROM base_inventory AS i
WHERE i.location_id = w.id
)
<if
test=
"updateId != null and updateId != ''"
>
where w.id = #{updateId}
</if>
</update>
<update
id=
"setWarehouseInSumInventory"
>
UPDATE base_warehouse AS w
SET in_sum = (
SELECT count(id)
FROM base_inventory AS i
WHERE i.location_id = w.id and i.location_state="in"
)
<if
test=
"updateId != null and updateId != ''"
>
where w.id = #{updateId}
</if>
</update>
<update
id=
"setWarehouseOutSumInventory"
>
UPDATE base_warehouse AS w
SET out_sum = (
SELECT count(id)
FROM base_inventory AS i
WHERE i.location_id = w.id and i.location_state="out"
)
<if
test=
"updateId != null and updateId != ''"
>
where w.id = #{updateId}
</if>
</update>
<update
id=
"setWarehousePriceInventory"
>
UPDATE base_warehouse AS w
SET price_total = (
SELECT sum(price)
FROM base_inventory AS i
WHERE i.location_id = w.id
)
<if
test=
"updateId != null and updateId != ''"
>
where w.id = #{updateId}
</if>
<update
id=
"SetInventoryInfo"
parameterType=
"java.lang.String"
>
UPDATE base_warehouse AS w
SET sum = (
SELECT sum(number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
in_sum=(
SELECT sum(stock_number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
out_sum=(
SELECT sum(outbound_number) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id),
price_total=(
SELECT sum(price) as sum
FROM base_inventory_summary AS bis
WHERE bis.location_id = w.id)
WHERE w.id=#{id}
</update>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论