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
8d48fcc0
Commit
8d48fcc0
authored
Aug 11, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改测试出现的bug以及修改库存模块代码
parent
3aac106c
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
593 行增加
和
221 行删除
+593
-221
.gitignore
.gitignore
+3
-0
dataSources.xml
.idea/dataSources.xml
+2
-2
EqsBriefDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EqsBriefDto.java
+3
-4
InventoryDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InventoryDto.java
+43
-37
InventoryReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventoryReq.java
+16
-3
InventorySumReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventorySumReq.java
+3
-8
PolicemanReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/PolicemanReq.java
+6
-1
BorrowFormReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/BorrowFormReq.java
+56
-0
UpdateCabinetReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetReq.java
+1
-0
UpdatePolicemanReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdatePolicemanReq.java
+9
-6
CabinetExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/CabinetExceptionEnum.java
+1
-1
UserExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/UserExceptionEnum.java
+28
-0
CabinetController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
+2
-2
InventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
+22
-18
PoliceController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/PoliceController.java
+5
-4
ToOutWarehouseController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ToOutWarehouseController.java
+30
-0
ToWarehouseController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ToWarehouseController.java
+13
-0
Inventory.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
+3
-2
InventorySummary.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
+0
-1
PoliceEquipment.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/PoliceEquipment.java
+73
-0
InventoryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
+4
-2
PoliceEquipmentMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/PoliceEquipmentMapper.java
+18
-0
InventoryService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
+4
-7
PoliceEquipmentService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/PoliceEquipmentService.java
+15
-0
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+22
-14
InventoryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
+44
-55
InventorySummaryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventorySummaryServiceImpl.java
+25
-3
PoliceEquipmentServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PoliceEquipmentServiceImpl.java
+43
-0
PolicemanServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
+21
-9
WarehouseServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
+8
-5
InventoryMapper.xml
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
+47
-37
PoliceEquipmentMapper.xml
jyzb-biz/src/main/resources/mapper/PoliceEquipmentMapper.xml
+23
-0
没有找到文件。
.gitignore
View file @
8d48fcc0
...
...
@@ -73,3 +73,6 @@ Thumbs.db
/.idea/modules.xml
/.idea/compiler.xml
/.idea/modules.xml
/.idea/dataSources.xml
/.idea/mybatisx/templates.xml
/.idea/dataSources.xml
.idea/dataSources.xml
View file @
8d48fcc0
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"DataSourceManagerImpl"
format=
"xml"
multifile-model=
"true"
>
<data-source
source=
"LOCAL"
name=
"j
dbc:mysql://192.168.3.128:3306/db_jyzb?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
"
uuid=
"ce8e9dd8-fc56-41f7-9a8b-6cbd906018c3"
>
<data-source
source=
"LOCAL"
name=
"j
unmp
"
uuid=
"ce8e9dd8-fc56-41f7-9a8b-6cbd906018c3"
>
<driver-ref>
mysql.8
</driver-ref>
<synchronize>
true
</synchronize>
<jdbc-driver>
com.mysql.
cj.
jdbc.Driver
</jdbc-driver>
<jdbc-driver>
com.mysql.jdbc.Driver
</jdbc-driver>
<jdbc-url>
jdbc:mysql://192.168.3.128:3306/db_jyzb?characterEncoding=UTF-8
&
useUnicode=true
&
useSSL=false
&
tinyInt1isBit=false
&
allowPublicKeyRetrieval=true
&
serverTimezone=Asia/Shanghai
</jdbc-url>
</data-source>
</component>
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/Eqs
Summary
Dto.java
→
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/Eqs
Brief
Dto.java
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
cn.hutool.core.date.DateTime
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,10 +7,10 @@ import java.math.BigDecimal;
import
java.util.Date
;
/**
* 装备信息
粗略
输出实体类,只包含部分字段
* 装备信息
简要
输出实体类,只包含部分字段
*/
@Data
public
class
Eqs
Summary
Dto
implements
Serializable
{
public
class
Eqs
Brief
Dto
implements
Serializable
{
/**
* epc
*/
...
...
@@ -49,7 +48,7 @@ public class EqsSummaryDto implements Serializable {
/**
* 业务状态
*/
private
String
bussiness
_s
tate
;
private
String
bussiness
S
tate
;
/**
* 位置状态
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InventoryDto.java
View file @
8d48fcc0
...
...
@@ -15,7 +15,11 @@ import java.util.Date;
@Data
public
class
InventoryDto
implements
Serializable
{
private
String
ID
;
private
String
id
;
/**
* epc
*/
private
String
epc
;
/**
* 装备包ID
*/
...
...
@@ -24,65 +28,79 @@ public class InventoryDto implements Serializable {
/**
* 装备类型ID
*/
private
String
type
Name
;
private
String
type
Id
;
/**
* 装备类型
* 装备类型
名称
*/
// private EquipmentTypeDto eqTyp
e;
private
String
typeNam
e
;
/**
* 装备号型ID
*/
private
String
sizeId
;
/**
* 装备号型名称
*/
private
String
sizeName
;
/**
*
装备号型
*
供应商id
*/
// private EquipmentSizeDto eqSize;
private
String
supplierId
;
/**
* 供应商
*/
private
String
supplierName
;
/**
*
部门
*
物资状态
*/
private
String
departmentNam
e
;
private
String
stat
e
;
/**
*
货架位置
*
位置状态
*/
private
String
shelfLocation
;
private
String
locationState
;
/**
*
epc
*
生产日期
*/
private
String
epc
;
private
Date
productionDate
;
/**
*
组织机构
*
位置类型
*/
private
String
orgName
;
private
String
locationType
;
/**
*
物资状态
*
位置
*/
private
String
state
;
private
String
locationId
;
/**
*
业务状态
*
价格
*/
private
String
bussiness_state
;
private
BigDecimal
price
;
/**
*
位置状态
*
货架id
*/
private
String
locationState
;
private
String
shelfId
;
/**
* 货架位置
*/
private
String
shelfLocation
;
/**
*
生产日期
*
业务状态
*/
private
Date
productionDate
;
private
String
bussinessState
;
/**
* 组织机构id
*/
private
Long
orgId
;
/**
* 组织机构
*/
private
String
orgName
;
/**
* 质保期
...
...
@@ -99,16 +117,8 @@ public class InventoryDto implements Serializable {
*/
private
int
fixCount
;
/**
* 位置类型
*/
private
String
locationType
;
/**
* 位置
*/
private
String
locationName
;
/**
* 是否遗失
*/
private
int
lostFlag
;
...
...
@@ -119,10 +129,6 @@ public class InventoryDto implements Serializable {
*/
private
String
tid
;
/**
* 价格
*/
private
BigDecimal
price
;
/**
* 备注
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventoryReq.java
View file @
8d48fcc0
...
...
@@ -20,7 +20,7 @@ import java.util.List;
public
class
InventoryReq
extends
BaseRequest
{
private
String
ID
;
private
String
id
;
/**
* 装备包ID
*/
...
...
@@ -71,7 +71,19 @@ public class InventoryReq extends BaseRequest {
*/
@NotNull
(
message
=
"组织机构id不能为空"
,
groups
=
{
detail
.
class
})
private
Long
orgId
;
/**
* 单警柜id
*/
private
String
cabinetId
;
/**
* 仓库id
*/
private
String
warehouseId
;
/**
* 查询类型,org:组织机构,warehouse:仓库,cabinet:单警柜
*/
@NotBlank
(
message
=
"查询类型不能为空"
,
groups
=
{
edit
.
class
})
private
String
queryType
;
/**
* 物资状态
*/
...
...
@@ -80,7 +92,7 @@ public class InventoryReq extends BaseRequest {
/**
* 业务状态
*/
private
String
bussiness
_s
tate
;
private
String
bussiness
S
tate
;
/**
* 位置状态
...
...
@@ -88,6 +100,7 @@ public class InventoryReq extends BaseRequest {
private
String
locationState
;
/**
* 生产日期
*/
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventorySumReq.java
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
import
com.junmp.v2.validator.api.validators.unique.TableUniqueValue
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
InventorySumReq
{
/**
* 批次主键
*/
@NotBlank
(
message
=
"组织机构号不能为空"
,
groups
=
{
ValidationApi
.
edit
.
class
})
private
Long
orgId
;
/**
*
位置ID
*
组织机构名称
*/
private
String
orgName
;
/**
* 位置ID
* 位置ID
(仓库id或者单警柜id)
*/
private
String
locationId
;
/**
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/PolicemanReq.java
View file @
8d48fcc0
...
...
@@ -12,9 +12,10 @@ import java.util.Date;
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
PolicemanReq
extends
BaseRequest
{
@NotBlank
(
message
=
"警员主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@NotBlank
(
message
=
"警员主键不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
delete
.
class
,
detail
.
class
})
private
String
id
;
@NotBlank
(
message
=
"姓名不能为空"
,
groups
=
{
add
.
class
})
private
String
name
;
@NotBlank
(
message
=
"箱门id不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
})
...
...
@@ -27,6 +28,7 @@ public class PolicemanReq extends BaseRequest {
private
String
policeCode
;
@NotBlank
(
message
=
"性别不能为空"
,
groups
=
{
add
.
class
})
private
String
sex
;
private
String
faceInfo
;
...
...
@@ -36,13 +38,16 @@ public class PolicemanReq extends BaseRequest {
private
String
doorCode
;
//账号
@NotBlank
(
message
=
"账号不能为空"
,
groups
=
{
add
.
class
})
private
String
account
;
//密码
@NotBlank
(
message
=
"密码不能为空"
,
groups
=
{
add
.
class
})
private
String
password
;
private
String
photo
;
@NotBlank
(
message
=
"电话不能为空"
,
groups
=
{
add
.
class
})
private
String
phone
;
private
Date
createTime
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/BorrowFormReq.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
BorrowFormReq
extends
BaseRequest
{
/**
*id
*/
private
String
id
;
/**
* 警员ID
*/
private
String
policeId
;
/**
* 装备ID
*/
private
String
equipmentId
;
/**
* 装备数量
*/
private
Integer
num
;
/**
* 组织机构ID
*/
private
Long
orgId
;
/**
* 装备名称
*/
private
String
equipmentName
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 警员名称
*/
private
String
policeName
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetReq.java
View file @
8d48fcc0
...
...
@@ -89,6 +89,7 @@ public class UpdateCabinetReq extends BaseRequest {
private
List
<
UpdateCabinetBoxReq
>
cabinetBoxList
;
//单警柜id列表
private
List
<
String
>
cabinetList
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdatePolicemanReq.java
View file @
8d48fcc0
...
...
@@ -4,6 +4,7 @@ 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.Date
;
...
...
@@ -11,10 +12,10 @@ import java.util.Date;
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
UpdatePolicemanReq
extends
BaseRequest
{
@Not
Null
(
message
=
"警员主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@Not
Blank
(
message
=
"警员主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
,
updateStatus
.
class
})
private
String
id
;
@Not
Null
(
message
=
"警员名字不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
@Not
Blank
(
message
=
"警员名字不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
name
;
private
String
cabinetBoxId
;
...
...
@@ -24,12 +25,13 @@ public class UpdatePolicemanReq extends BaseRequest {
private
Long
departmentId
;
@Not
Null
(
message
=
"警员编号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
@Not
Blank
(
message
=
"警员编号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
policeCode
;
@Not
Null
(
message
=
"性别不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
@Not
Blank
(
message
=
"性别不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
sex
;
@NotBlank
(
message
=
"人脸信息不能为空"
,
groups
=
{
detail
.
class
})
private
String
faceInfo
;
private
Boolean
isCreatedAccount
;
...
...
@@ -38,20 +40,21 @@ public class UpdatePolicemanReq extends BaseRequest {
private
String
password
;
@NotNull
(
message
=
"电话不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
photo
;
@NotBlank
(
message
=
"电话不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
phone
;
private
Date
createTime
;
private
Date
updateTime
;
@Not
Null
(
message
=
"身份证号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
@Not
Blank
(
message
=
"身份证号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
idCard
;
private
String
updateUser
;
@NotNull
(
message
=
"状态不能为空"
,
groups
=
{
updateStatus
.
class
})
private
Integer
state
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/CabinetExceptionEnum.java
View file @
8d48fcc0
...
...
@@ -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/UserExceptionEnum.java
0 → 100644
View file @
8d48fcc0
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
UserExceptionEnum
implements
IExceptionEnum
{
/**
* 账号已存在
*/
USER_IS_EXIST
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"账号已存在"
)
;
/**
* 错误编码
*/
private
final
Integer
code
;
/**
* 提示用户信息
*/
private
final
String
message
;
UserExceptionEnum
(
Integer
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
View file @
8d48fcc0
...
...
@@ -54,13 +54,13 @@ public class CabinetController {
@PostMapping
(
"/DeleteCabinetInfo"
)
@ApiOperation
(
"删除单警柜信息"
)
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
UpdateCabinetReq
req
)
{
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
delete
.
class
)
UpdateCabinetReq
req
)
{
return
ApiRes
.
success
(
cabinetService
.
deleteCabinetInfo
(
req
));
}
@PostMapping
(
"/UpdateCabinetInfo"
)
@ApiOperation
(
"修改单警柜信息"
)
public
ApiRes
<
Boolean
>
updateCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
UpdateCabinetReq
req
)
{
public
ApiRes
<
Boolean
>
updateCabinetInfo
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
if
(!
result
){
return
ApiRes
.
failure
(
"操作失败"
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.dto.Eqs
Summary
Dto
;
import
com.junmp.jyzb.api.bean.dto.Eqs
Brief
Dto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
...
...
@@ -42,16 +42,12 @@ public class InventoryController {
String
aa
=
""
;
return
ApiRes
.
success
(
mqProductService
.
sendMessage
());
}
//根据组织机构id/单警柜id/仓库id查询出库存的汇总信息
@PostMapping
(
"/GetEquipmentInfo"
)
@ApiOperation
(
"根据组织机构查询库存信息"
)
@ApiOperation
(
"根据组织机构查询库存
汇总
信息"
)
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"
)
...
...
@@ -61,17 +57,12 @@ public class InventoryController {
return
returnMsg
;
}
@PostMapping
(
"/GetInventoryList"
)
@ApiOperation
(
"查询库存汇总信息"
)
public
ResponseResult
getInventoryList
(
@RequestBody
Map
<
String
,
Object
>
msg
)
{
ResponseResult
returnMsg
=
inventoryService
.
getInventoryList
(
msg
);
return
returnMsg
;
}
//根据装备id查询出装备的详细信息
@PostMapping
(
"/GetDetail"
)
@ApiOperation
(
"
查询库存
明细信息"
)
@ApiOperation
(
"
根据装备id查询装备
明细信息"
)
public
ApiRes
<
InventoryDto
>
getDetail
(
@RequestBody
InventoryReq
req
)
{
return
ApiRes
.
success
(
inventoryService
.
getInventoryDetail
(
req
));
return
ApiRes
.
success
(
inventoryService
.
getInventoryDetail
(
req
));
}
@PostMapping
(
"/getEquipmentInfo"
)
@ApiOperation
(
"查询库存明细信息"
)
...
...
@@ -80,8 +71,6 @@ public class InventoryController {
return
returnMsg
;
}
@PostMapping
(
"/GetInventoryDevelop"
)
@ApiOperation
(
"获取装备明细表所有信息"
)
public
ResponseResult
getInventoryDevelop
()
{
...
...
@@ -109,7 +98,22 @@ public class InventoryController {
@PostMapping
(
"/GetInvInfoByEpc"
)
@ApiOperation
(
"根据EPC列表获取装备信息"
)
public
ApiRes
<
List
<
Eqs
Summary
Dto
>>
GetInvInfoByEpc
(
@RequestBody
InventoryReq
req
){
public
ApiRes
<
List
<
Eqs
Brief
Dto
>>
GetInvInfoByEpc
(
@RequestBody
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
GetInvInfoByEpc
(
req
));
}
@PostMapping
(
"/GetInventoryByOrgId"
)
@ApiOperation
(
"查询组织机构拥有装备"
)
public
ApiRes
<
List
<
EqsBriefDto
>>
getInventoryByOrgId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
getInventoryByOrgId
(
req
));
}
//根据组织机构/单警柜id/仓库id查询每件装备的详细信息
@PostMapping
(
"/EqsBySearchType"
)
@ApiOperation
(
"根据传入信息查询装备信息"
)
public
ApiRes
<
List
<
InventoryDto
>>
EqsBySearchType
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
EqsBySearchType
(
req
));
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/PoliceController.java
View file @
8d48fcc0
...
...
@@ -49,7 +49,7 @@ public class PoliceController {
@PostMapping
(
"/ChangePoliceState"
)
@ApiOperation
(
"修改警员状态"
)
public
ApiRes
<
Boolean
>
ChangePoliceState
(
@RequestBody
UpdatePolicemanReq
req
)
{
public
ApiRes
<
Boolean
>
ChangePoliceState
(
@RequestBody
@Validated
(
ValidationApi
.
updateStatus
.
class
)
UpdatePolicemanReq
req
)
{
boolean
b
=
policemanService
.
ChangePoliceState
(
req
);
if
(!
b
){
return
ApiRes
.
failure
(
"修改失败"
);
...
...
@@ -59,7 +59,7 @@ public class PoliceController {
@PostMapping
(
"/UpdatePolice"
)
@ApiOperation
(
"修改警员信息"
)
public
ApiRes
<
Boolean
>
UpdatePolice
(
@RequestBody
UpdatePolicemanReq
req
)
{
public
ApiRes
<
Boolean
>
UpdatePolice
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
UpdatePolicemanReq
req
)
{
boolean
b
=
policemanService
.
UpdatePolice
(
req
);
if
(!
b
){
return
ApiRes
.
failure
(
"修改失败"
);
...
...
@@ -126,7 +126,7 @@ public class PoliceController {
@PostMapping
(
"/UpdateFaceInfo"
)
@ApiOperation
(
"修改、删除人脸信息"
)
public
ApiRes
<
Boolean
>
UpdateFaceInfo
(
@RequestBody
@Validated
(
ValidationApi
.
de
tail
.
class
)
UpdatePolicemanReq
req
)
{
public
ApiRes
<
Boolean
>
UpdateFaceInfo
(
@RequestBody
@Validated
(
ValidationApi
.
de
lete
.
class
)
UpdatePolicemanReq
req
)
{
boolean
b
=
policemanService
.
UpdateFaceInfo
(
req
);
if
(!
b
){
return
ApiRes
.
failure
(
"操作失败"
);
...
...
@@ -147,7 +147,7 @@ public class PoliceController {
//警员绑定账号
@PostMapping
(
"/PoliceBindUser"
)
@ApiOperation
(
"警员绑定账号"
)
public
ApiRes
<
Boolean
>
PoliceBindUser
(
@RequestBody
PolicemanReq
req
){
public
ApiRes
<
Boolean
>
PoliceBindUser
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
PolicemanReq
req
){
boolean
b
=
policemanService
.
PoliceBindUser
(
req
);
if
(!
b
){
return
ApiRes
.
failure
(
"操作失败"
);
...
...
@@ -167,4 +167,5 @@ public class PoliceController {
}
return
ApiRes
.
success
(
b
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ToOutWarehouseController.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.req.BorrowFormReq
;
import
com.junmp.jyzb.service.PoliceEquipmentService
;
import
com.junmp.v2.common.bean.response.ApiRes
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@Slf4j
@RequestMapping
(
"/ToOutWarehouse"
)
@Api
(
tags
=
"出库模块"
)
public
class
ToOutWarehouseController
{
@Resource
private
PoliceEquipmentService
policeEquipmentService
;
//警员借用装备后在在数据库中增加相关借用装备数据
@PostMapping
(
"/AddBorrowEqs"
)
@ApiOperation
(
"增加警员借用装备数据信息"
)
public
ApiRes
<
Boolean
>
AddBorrowEqs
(
BorrowFormReq
req
){
return
ApiRes
.
success
(
policeEquipmentService
.
AddBorrowEqs
(
req
));
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/ToWarehouseController.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
controller
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@Slf4j
@RequestMapping
(
"/ToWarehouse"
)
@Api
(
tags
=
"入库模块"
)
public
class
ToWarehouseController
{
}
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
View file @
8d48fcc0
...
...
@@ -20,7 +20,7 @@ import java.util.Date;
public
class
Inventory
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_UUID
)
private
String
ID
;
private
String
id
;
/**
* 装备包ID
...
...
@@ -81,7 +81,8 @@ public class Inventory implements Serializable {
/**
* 业务状�
*/
private
String
bussiness_state
;
@TableField
(
"bussiness_state"
)
private
String
bussinessState
;
/**
* 位置状�
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
View file @
8d48fcc0
...
...
@@ -165,7 +165,6 @@ public class InventorySummary implements Serializable {
* 货架id
*/
@ApiModelProperty
(
"货架id"
)
@TableField
(
"location_shelf_id"
)
private
String
locationShelfId
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/PoliceEquipment.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@TableName
(
value
=
"base_police_equipment"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PoliceEquipment
implements
Serializable
{
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"主键ID"
)
private
String
id
;
/**
* 警员ID
*/
@TableField
(
"police_id"
)
private
String
policeId
;
/**
* 装备ID
*/
@TableField
(
"equipment_id"
)
private
String
equipmentId
;
/**
* 装备数量
*/
@TableField
(
"num"
)
private
Integer
num
;
/**
* 组织机构ID
*/
@TableField
(
"org_id"
)
private
Long
orgId
;
/**
* 装备名称
*/
@TableField
(
"equipment_name"
)
private
String
equipmentName
;
/**
* 更新时间
*/
@TableField
(
"update_time"
)
private
Date
updateTime
;
/**
* 创建时间
*/
@TableField
(
"create_time"
)
private
Date
createTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
import
com.junmp.jyzb.entity.Inventory
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -24,6 +26,5 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
void
setWarehouseInventory
();
List
<
Map
<
String
,
Object
>>
getInventoryList
(
@Param
(
"queryType"
)
String
queryType
,
@Param
(
"typeCode"
)
String
typeCode
,
@Param
(
"typeId"
)
String
typeId
,
@Param
(
"sizeId"
)
String
sizeId
);
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
);
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/PoliceEquipmentMapper.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.junmp.jyzb.entity.PoliceEquipment
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* @author lxh专属坐骑
* @description 针对表【base_police_equipment】的数据库操作Mapper
* @createDate 2023-08-10 13:13:20
* @Entity com.junmp.jyzb.entity.PoliceEquipment
*/
public
interface
PoliceEquipmentMapper
extends
BaseMapper
<
PoliceEquipment
>
{
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.dto.Eqs
Summary
Dto
;
import
com.junmp.jyzb.api.bean.dto.Eqs
Brief
Dto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
...
...
@@ -10,7 +10,6 @@ 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
;
...
...
@@ -23,10 +22,7 @@ public interface InventoryService extends IService<Inventory> {
ResponseResult
setInventoryMsg
();
ResponseResult
getInventoryList
(
Map
<
String
,
Object
>
msg
);
List
<
EqsSummaryDto
>
getInventoryByOrgId
(
InventoryReq
req
);
List
<
EqsBriefDto
>
getInventoryByOrgId
(
InventoryReq
req
);
ResponseResult
getInventoryDevelop
();
...
...
@@ -36,6 +32,7 @@ public interface InventoryService extends IService<Inventory> {
boolean
InvertoryBind
(
EquipmentBindReq
req
);
List
<
Eqs
Summary
Dto
>
GetInvInfoByEpc
(
InventoryReq
req
);
List
<
Eqs
Brief
Dto
>
GetInvInfoByEpc
(
InventoryReq
req
);
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/PoliceEquipmentService.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
service
;
import
com.junmp.jyzb.api.bean.req.BorrowFormReq
;
import
com.junmp.jyzb.entity.PoliceEquipment
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* @author lxh
* @description 针对表【base_police_equipment】的数据库操作Service
* @createDate 2023-08-10 13:13:20
*/
public
interface
PoliceEquipmentService
extends
IService
<
PoliceEquipment
>
{
boolean
AddBorrowEqs
(
BorrowFormReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
8d48fcc0
...
...
@@ -90,20 +90,20 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
cabinet
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
//添加单警柜
save
(
cabinet
);
Cabinet
one
=
getOne
(
new
LambdaQueryWrapper
<
Cabinet
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
ObjectUtil
.
isNotEmpty
(
req
.
getCabinetNum
())),
Cabinet:
:
getCabinetNum
,
req
.
getCabinetNum
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgId
())),
Cabinet:
:
getOrgId
,
req
.
getOrgId
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
ObjectUtil
.
isNotEmpty
(
req
.
getName
())),
Cabinet:
:
getName
,
req
.
getName
()));
List
<
CabinetBox
>
objects
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<=
req
.
getNum
();
i
++)
{
CabinetBox
cabinetBox
=
new
CabinetBox
();
cabinetBox
.
setCabinetId
(
one
.
getId
());
cabinetBox
.
setState
(
1
);
cabinetBox
.
setNum
(
i
);
//添加到列表进行批量增加
objects
.
add
(
cabinetBox
);
//判断num值是否传递,如果没有不做操作
if
(
ObjectUtil
.
isNotNull
(
req
.
getCabinetNum
())
&&
!
req
.
getCabinetNum
().
equals
(
""
)){
for
(
int
i
=
1
;
i
<=
req
.
getNum
();
i
++)
{
CabinetBox
cabinetBox
=
new
CabinetBox
();
cabinetBox
.
setCabinetId
(
cabinet
.
getId
());
cabinetBox
.
setState
(
1
);
cabinetBox
.
setNum
(
i
);
//添加到列表进行批量增加
objects
.
add
(
cabinetBox
);
}
cabinetBoxService
.
saveBatch
(
objects
);
}
cabinetBoxService
.
saveBatch
(
objects
);
return
cabinet
.
getId
();
}
...
...
@@ -118,10 +118,15 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
deleteCabinetInfo
(
UpdateCabinetReq
req
)
{
//获取传递的id列表
List
<
String
>
cabinetIdList
=
req
.
getCabinetList
();
if
(
cabinetIdList
.
size
()==
0
){
if
(
ObjectUtil
.
isNull
(
req
.
getCabinetList
())
||
req
.
getCabinetList
().
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
List
<
String
>
cabinetIdList
=
req
.
getCabinetList
();
for
(
String
s:
cabinetIdList
)
{
if
(
s
.
equals
(
""
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
}
List
<
Cabinet
>
cabinetList
=
new
ArrayList
<>();
//遍历单警柜id列表
for
(
String
id:
cabinetIdList
)
{
...
...
@@ -294,6 +299,9 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
public
boolean
ChangeCabinetState
(
UpdateCabinetReq
req
)
{
//查询单警柜是否存在
CabinetExist
(
req
.
getId
());
if
(
ObjectUtil
.
isNull
(
req
.
getCabinetBoxList
())
||
req
.
getCabinetBoxList
().
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
List
<
UpdateCabinetBoxReq
>
cabinetBoxList
=
req
.
getCabinetBoxList
();
List
<
CabinetBox
>
list
=
new
ArrayList
<>();
for
(
UpdateCabinetBoxReq
updateCabinet:
cabinetBoxList
)
{
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
View file @
8d48fcc0
...
...
@@ -3,10 +3,9 @@ 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.Eqs
Summary
Dto
;
import
com.junmp.jyzb.api.bean.dto.Eqs
Brief
Dto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.InventoryReq
;
...
...
@@ -23,12 +22,9 @@ 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
;
...
...
@@ -69,7 +65,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
@Override
public
InventoryDto
getInventoryDetail
(
InventoryReq
req
)
{
Inventory
invMap
=
this
.
getById
(
req
.
getI
D
());
Inventory
invMap
=
this
.
getById
(
req
.
getI
d
());
if
(
invMap
==
null
)
{
return
null
;
}
...
...
@@ -207,60 +203,34 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
inventoryMapper
.
setOrgInventory
();
//放入组织机构信息汇总
inventoryMapper
.
setCabinetInventory
();
//放入
组织机构
信息汇总
inventoryMapper
.
setCabinetInventory
();
//放入
单警柜
信息汇总
inventoryMapper
.
setWarehouseInventory
();
//放入
组织机构
信息汇总
inventoryMapper
.
setWarehouseInventory
();
//放入
仓库
信息汇总
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
@Override
public
ResponseResult
getInventoryList
(
Map
<
String
,
Object
>
msg
)
{
//参数校验
try
{
checkNotBlank
(
msg
.
get
(
"queryType"
),
"queryType不能为空"
);
checkNotBlank
(
msg
.
get
(
"typeCode"
),
"typeCode不能为空"
);
checkNotBlank
(
msg
.
get
(
"typeId"
),
"typeId不能为空"
);
checkNotBlank
(
msg
.
get
(
"sizeId"
),
"sizeId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//解析json中的信息
String
queryType
=
msg
.
get
(
"queryType"
).
toString
();
String
typeCode
=
msg
.
get
(
"typeCode"
).
toString
();
String
typeId
=
msg
.
get
(
"typeId"
).
toString
();
String
sizeId
=
msg
.
get
(
"sizeId"
).
toString
();
//根据传入的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
);
}
else
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"输入的queryType信息有误"
);
}
}
@Override
public
List
<
Eqs
Summary
Dto
>
getInventoryByOrgId
(
InventoryReq
req
)
{
public
List
<
Eqs
Brief
Dto
>
getInventoryByOrgId
(
InventoryReq
req
)
{
//判断组织机构是否存在
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
Eqs
SummaryDto
>
eqsSummaryDtoList
=
new
ArrayList
<>();
List
<
Eqs
BriefDto
>
eqsBriefDtoList
=
new
ArrayList
<>();
List
<
Inventory
>
list
=
list
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getOrgId
,
req
.
getOrgId
()));
for
(
Inventory
inventory:
list
)
{
Eqs
SummaryDto
eqsSummaryDto
=
new
EqsSummary
Dto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsSummary
Dto
);
Eqs
BriefDto
eqsBriefDto
=
new
EqsBrief
Dto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsBrief
Dto
);
//设置型号名称,类别名称,供应商名称
String
sizeName
=
equipmentSizeService
.
getById
(
inventory
.
getSizeId
()).
getName
();
String
typeName
=
equipmentTypeService
.
getById
(
inventory
.
getTypeId
()).
getName
();
String
supplierName
=
supplierService
.
getById
(
inventory
.
getSupplierId
()).
getName
();
eqs
Summary
Dto
.
setSizeName
(
sizeName
);
eqs
Summary
Dto
.
setTypeName
(
typeName
);
eqs
Summary
Dto
.
setSupplierName
(
supplierName
);
eqs
SummaryDtoList
.
add
(
eqsSummary
Dto
);
eqs
Brief
Dto
.
setSizeName
(
sizeName
);
eqs
Brief
Dto
.
setTypeName
(
typeName
);
eqs
Brief
Dto
.
setSupplierName
(
supplierName
);
eqs
BriefDtoList
.
add
(
eqsBrief
Dto
);
}
return
eqs
Summary
DtoList
;
return
eqs
Brief
DtoList
;
}
@Override
...
...
@@ -269,7 +239,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
//设置仓库库存数量
//设置仓库库存数量
(总数,在库数,出库数,价格)
@Override
public
boolean
UpdateWarehouseInsNum
(
WarehouseReq
req
)
{
Warehouse
warehouse
=
warehouseService
.
WarehoustExist
(
req
.
getId
());
...
...
@@ -277,7 +247,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
b
;
}
//设置单警柜库存数量
//设置单警柜库存数量
(总数,在库数,出库数,价格)
@Override
public
boolean
UpdateCabinetInsNum
(
CabinetReq
req
)
{
Cabinet
cabinet
=
cabinetService
.
CabinetExist
(
req
.
getId
());
...
...
@@ -314,8 +284,8 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
//根据Epc查询装备信息
@Override
public
List
<
Eqs
Summary
Dto
>
GetInvInfoByEpc
(
InventoryReq
req
)
{
List
<
Eqs
SummaryDto
>
eqsSummaryDtoList
=
new
ArrayList
<>();
public
List
<
Eqs
Brief
Dto
>
GetInvInfoByEpc
(
InventoryReq
req
)
{
List
<
Eqs
BriefDto
>
eqsBriefDtoList
=
new
ArrayList
<>();
//判断传入的是否为空
List
<
String
>
epcList
=
req
.
getEpcList
();
if
(
epcList
.
size
()==
0
){
...
...
@@ -329,20 +299,39 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
if
(
Objects
.
isNull
(
inventory
)){
throw
new
ServiceException
(
InventoryExceptionEnum
.
INVENTORY_NOT_EXIST
);
}
Eqs
SummaryDto
eqsSummaryDto
=
new
EqsSummary
Dto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsSummary
Dto
);
Eqs
BriefDto
eqsBriefDto
=
new
EqsBrief
Dto
();
BeanPlusUtil
.
copyProperties
(
inventory
,
eqsBrief
Dto
);
//设置型号名称,类别名称,供应商名称
String
sizeName
=
equipmentSizeService
.
getById
(
inventory
.
getSizeId
()).
getName
();
String
typeName
=
equipmentTypeService
.
getById
(
inventory
.
getTypeId
()).
getName
();
String
supplierName
=
supplierService
.
getById
(
inventory
.
getSupplierId
()).
getName
();
eqs
Summary
Dto
.
setSizeName
(
sizeName
);
eqs
Summary
Dto
.
setTypeName
(
typeName
);
eqs
Summary
Dto
.
setSupplierName
(
supplierName
);
eqs
SummaryDtoList
.
add
(
eqsSummary
Dto
);
eqs
Brief
Dto
.
setSizeName
(
sizeName
);
eqs
Brief
Dto
.
setTypeName
(
typeName
);
eqs
Brief
Dto
.
setSupplierName
(
supplierName
);
eqs
BriefDtoList
.
add
(
eqsBrief
Dto
);
}
return
eqs
Summary
DtoList
;
return
eqs
Brief
DtoList
;
}
@Override
public
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
)
{
//判断传入的queryType参数是否是正确的
if
(!
req
.
getQueryType
().
equals
(
"org"
)
&&
!
req
.
getQueryType
().
equals
(
"warehouse"
)
&&
!
req
.
getQueryType
().
equals
(
"cabinet"
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//判断如果传递了类别,判断传递的值是否为空或者是否不存在
if
(
ObjectUtil
.
isNotNull
(
req
.
getOrgId
())){
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
}
if
(
ObjectUtil
.
isNotNull
(
req
.
getWarehouseId
())){
warehouseService
.
WarehoustExist
(
req
.
getWarehouseId
());
}
if
(
ObjectUtil
.
isNotNull
(
req
.
getCabinetId
())){
cabinetService
.
CabinetExist
(
req
.
getCabinetId
());
}
List
<
InventoryDto
>
inventoryDtos
=
inventoryMapper
.
EqsBySearchType
(
req
);
return
inventoryDtos
;
}
/**
...
...
@@ -358,7 +347,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
wrapper
;
}
//根据库存ID查询
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getI
D
()),
Inventory:
:
getID
,
req
.
getID
());
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getI
d
()),
Inventory:
:
getId
,
req
.
getId
());
//根据epc模糊查询
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getEpc
()),
Inventory:
:
getEpc
,
req
.
getEpc
());
//根据位置
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventorySummaryServiceImpl.java
View file @
8d48fcc0
...
...
@@ -5,21 +5,43 @@ 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.query.InventorySumReq
;
import
com.junmp.jyzb.api.exception.enums.CabinetExceptionEnum
;
import
com.junmp.jyzb.entity.InventorySummary
;
import
com.junmp.jyzb.service.InventorySummaryService
;
import
com.junmp.jyzb.service.PubOrgService
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.db.api.factory.PageFactory
;
import
com.junmp.v2.db.api.factory.PageResultFactory
;
import
com.junmp.v2.db.api.page.PageResult
;
import
org.springframework.stereotype.Service
;
import
com.junmp.jyzb.mapper.InventorySummaryMapper
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
InventorySummaryServiceImpl
extends
ServiceImpl
<
InventorySummaryMapper
,
InventorySummary
>
implements
InventorySummaryService
{
@Resource
private
PubOrgService
pubOrgService
;
@Override
public
PageResult
<
InventorySummary
>
getEquipmentInfo
(
InventorySumReq
req
)
{
//判断传递参数是否不为空
if
(
ObjectUtil
.
isNull
(
req
.
getOrgId
())
&&
ObjectUtil
.
isNull
(
req
.
getLocationId
())){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//判断组织机构是否存在
if
(
ObjectUtil
.
isNotNull
(
req
.
getOrgId
())){
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
}
//如果传递了参数则判断是否存在,不存在则表示传递的参数一定不正确
if
(
ObjectUtil
.
isNotNull
(
req
.
getLocationId
())){
List
<
InventorySummary
>
list
=
list
(
new
LambdaQueryWrapper
<
InventorySummary
>().
eq
(
InventorySummary:
:
getLocationId
,
req
.
getLocationId
()));
if
(
list
.
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
}
LambdaQueryWrapper
<
InventorySummary
>
wp
=
createWrapper
(
req
);
//取出仓库中总数并计算
Page
<
InventorySummary
>
sumList
=
this
.
page
(
PageFactory
.
getDefaultPage
(),
wp
);
return
PageResultFactory
.
createPageResult
(
sumList
);
...
...
@@ -33,9 +55,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgId
()),
InventorySummary:
:
getOrgId
,
req
.
getOrgId
());
//根据组织机构名模糊查询
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgName
()),
InventorySummary:
:
getOrgName
,
req
.
getOrgName
());
//位置
信息
//位置
id(单警柜/仓库)
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getLocationId
()),
InventorySummary:
:
getLocationId
,
req
.
getLocationId
());
//位置信息
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getLocationName
()),
InventorySummary:
:
getLocationName
,
req
.
getLocationName
());
//根据类别
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getTypeId
()),
InventorySummary:
:
getTypeId
,
req
.
getTypeId
());
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PoliceEquipmentServiceImpl.java
0 → 100644
View file @
8d48fcc0
package
com
.
junmp
.
jyzb
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.req.BorrowFormReq
;
import
com.junmp.jyzb.entity.PoliceEquipment
;
import
com.junmp.jyzb.entity.Policeman
;
import
com.junmp.jyzb.service.PoliceEquipmentService
;
import
com.junmp.jyzb.mapper.PoliceEquipmentMapper
;
import
com.junmp.jyzb.service.PolicemanService
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
/**
* @author lxh
* @description 针对表【base_police_equipment】的数据库操作Service实现
* @createDate 2023-08-10 13:13:20
*/
@Service
public
class
PoliceEquipmentServiceImpl
extends
ServiceImpl
<
PoliceEquipmentMapper
,
PoliceEquipment
>
implements
PoliceEquipmentService
{
@Resource
private
PolicemanService
policemanService
;
/**
* 借用时将装备进行添加借用装备信息
* @param req
* @return
*/
@Override
public
boolean
AddBorrowEqs
(
BorrowFormReq
req
)
{
PoliceEquipment
policeEquipment
=
new
PoliceEquipment
();
//判断警员是否存在
policemanService
.
PoliceExist
(
req
.
getPoliceId
());
BeanPlusUtil
.
copyProperties
(
req
,
policeEquipment
);
return
save
(
policeEquipment
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
View file @
8d48fcc0
...
...
@@ -9,11 +9,8 @@ import com.junmp.jyzb.api.bean.dto.PolicemanDto;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.query.PolicemanReq
;
import
com.junmp.jyzb.api.bean.req.UpdatePolicemanReq
;
import
com.junmp.jyzb.api.exception.enums.*
;
import
com.junmp.jyzb.entity.*
;
import
com.junmp.jyzb.api.exception.enums.CabinetBoxExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.CabinetExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.PolicemanExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.PubOrgExceptionEnum
;
import
com.junmp.jyzb.mapper.*
;
import
com.junmp.jyzb.service.*
;
import
com.junmp.jyzb.utils.*
;
...
...
@@ -76,6 +73,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
if
(
list
.
size
()
>
0
)
{
throw
new
ServiceException
(
PolicemanExceptionEnum
.
POLICECODE_IS_EXISTS
);
}
if
(!
req
.
getSex
().
equals
(
"男"
)
&&!
req
.
getSex
().
equals
(
"女"
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
Policeman
policeman
=
new
Policeman
();
BeanPlusUtil
.
copyProperties
(
req
,
policeman
);
//添加警员绑定用户信息
...
...
@@ -174,6 +174,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
*/
@Override
public
boolean
UpdatePolice
(
UpdatePolicemanReq
req
)
{
if
(!
req
.
getSex
().
equals
(
"男"
)
&&!
req
.
getSex
().
equals
(
"女"
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
Policeman
policeman
=
new
Policeman
();
BeanPlusUtil
.
copyProperties
(
req
,
policeman
);
//查询传入的组织机构id是否存在
...
...
@@ -188,8 +191,10 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
throw
new
ServiceException
(
PolicemanExceptionEnum
.
POLICECODE_IS_EXISTS
);
}
}
System
.
out
.
println
(
"one = "
+
ObjectUtil
.
isNotNull
(
req
.
getCabinetBoxId
()));
req
.
getCabinetBoxId
();
//判断是否传递了箱子id,如果传了则判断箱子是否存在
if
(
ObjectUtil
.
isNot
Empty
(
req
.
getCabinetBoxId
())||
!
req
.
getCabinetBoxId
().
equals
(
""
)){
if
(
ObjectUtil
.
isNot
Null
(
req
.
getCabinetBoxId
())
&&
!
req
.
getCabinetBoxId
().
equals
(
""
)){
//查询单警柜箱号是否存在,箱门不存在抛异常
cabinetBoxService
.
CabinetBoxExist
(
req
.
getCabinetBoxId
());
}
...
...
@@ -208,6 +213,10 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public
boolean
ChangePoliceState
(
UpdatePolicemanReq
req
)
{
//通过警员id查询出警员信息
Policeman
one
=
PoliceExist
(
req
.
getId
());
//判断状态码是否是0或1
if
(
req
.
getState
()!=
1
&&
req
.
getState
()!=
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
one
.
setState
(
req
.
getState
());
return
updateById
(
one
);
...
...
@@ -318,10 +327,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//添加人脸信息
@Override
public
boolean
AddFaceInfo
(
UpdatePolicemanReq
req
)
{
//面部信息为null或者为空
if
(
ObjectUtil
.
isNull
(
req
.
getFaceInfo
())
||
ObjectUtil
.
isEmpty
(
req
.
getFaceInfo
()))
{
return
false
;
}
Policeman
police
=
PoliceExist
(
req
.
getId
());
police
.
setFaceInfo
(
req
.
getFaceInfo
());
police
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
...
...
@@ -370,10 +375,17 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public
boolean
PoliceBindUser
(
PolicemanReq
req
)
{
User
user
=
new
User
();
BeanPlusUtil
.
copyProperties
(
req
,
user
);
//判断数据库中是否已经存在账号,如果存在则抛出异常提示账号已存在
//密码加密,bcrypt加密方式
BcryptPasswordStoredEncrypt
passwordStoredEncrypt
=
new
BcryptPasswordStoredEncrypt
();
String
encrypt
=
passwordStoredEncrypt
.
encrypt
(
req
.
getPassword
());
user
.
setPassword
(
encrypt
);
User
one
=
sysUserService
.
getOne
(
new
LambdaQueryWrapper
<
User
>()
.
eq
(
User:
:
getAccount
,
user
.
getAccount
())
.
eq
(
User:
:
getPassword
,
user
.
getPassword
()));
if
(
ObjectUtil
.
isNotNull
(
one
)){
throw
new
ServiceException
(
UserExceptionEnum
.
USER_IS_EXIST
);
}
//存储到数据库
//判断传入的sex是什么,需要做处理
if
(
req
.
getSex
().
equals
(
"男"
))
{
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
View file @
8d48fcc0
...
...
@@ -65,13 +65,16 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
DeleteWarehouse
(
UpdateWarehouseReq
req
)
{
List
<
String
>
warehouseList
=
req
.
getWarehouseList
();
if
(
warehouseList
.
size
()<
1
){
//抛出参数传递异常
if
(
ObjectUtil
.
isNull
(
req
.
getWarehouseList
())||
req
.
getWarehouseList
().
size
()==
0
){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
removeBatchByIds
(
warehouseList
);
return
true
;
List
<
String
>
warehouseList
=
req
.
getWarehouseList
();
for
(
String
s:
warehouseList
)
{
if
(
s
.
equals
(
""
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
}
return
removeBatchByIds
(
warehouseList
);
}
@Override
...
...
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
View file @
8d48fcc0
...
...
@@ -189,46 +189,56 @@ and location_type = 0
GROUP BY location_id, type_id,size_id,bi.org_id_int;
</insert>
<select
id=
"getInventoryList"
resultType=
"Map"
>
select
IFNULL(i.id, 'null') as id,
IFNULL(i.epc, 'null') as epc,
IFNULL(i.size_id, 'null') as sizeId,
IFNULL(es.name, 'null') as sizeName,
IFNULL(i.type_id, 'null') as typeId,
IFNULL(et.name, 'null') as typeName,
IFNULL(i.supplier_id, 'null') as supplierId,
IFNULL(s.name, 'null') as supplierName,
IFNULL(i.state, 'null') as state,
IFNULL(i.location_state, 'null') as locationState,
IFNULL(i.production_date, 'null') as productionDate,
IFNULL(i.location_type, 'null') as locationType,
IFNULL(i.location_id, 'null') as locationId,
IFNULL(i.price, 'null') as price,
IFNULL(i.shelf_id, 'null') as shelfId,
IFNULL(i.shelf_location, 'null') as shelfLocation,
IFNULL(i.bussiness_state, 'null') as bussinessState,
IFNULL(i.warranty_period, 'null') as warrantyPeriod,
IFNULL(i.maintenance_period, 'null') as maintenancePeriod,
IFNULL(i.create_time, 'null') as createTime,
IFNULL(i.update_time, 'null') as updateTime,
IFNULL(i.update_user, 'null') as updateUser,
IFNULL(i.create_user, 'null') as createUser
from base_inventory i
join base_equipment_type et on et.id = i.type_id
join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id
<if
test=
"queryType == 'org'"
>
where org_id_int = #{typeCode}
</if>
<if
test=
"queryType == 'warehouse' or queryType == 'cabinet'"
>
where location_id = #{typeCode}
</if>
and size_id = #{sizeId}
<select
id=
"EqsBySearchType"
resultType=
"com.junmp.jyzb.api.bean.dto.InventoryDto"
>
select
i.id as id,
i.package_id as package_id,
i.epc as epc,
i.size_id as sizeId,
es.name as sizeName,
i.type_id as typeId,
et.name as typeName,
i.supplier_id as supplierId,
s.name as supplierName,
i.state as state,
i.location_state as locationState,
i.production_date as productionDate,
i.location_type as locationType,
i.location_id as locationId,
i.price as price,
i.shelf_id as shelfId,
i.shelf_location as shelfLocation,
i.bussiness_state as bussinessState,
i.warranty_period as warrantyPeriod,
i.maintenance_period as maintenancePeriod,
i.tid as tid,
i.note as note,
i.fix_count as fixCount,
i.lost_flag as lostFlag,
i.create_time as createTime,
i.update_time as updateTime,
i.update_user as updateUser,
i.create_user as create_user,
i.org_id_int as orgId,
po.org_name as orgName
from base_inventory i
join base_equipment_type et on et.id = i.type_id
join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id
<if
test=
"queryType == 'org'"
>
where org_id_int = #{orgId}
</if>
<if
test=
"queryType == 'warehouse' "
>
where location_id = #{warehouseId}
</if>
<if
test=
"queryType == 'cabinet'"
>
where org_id_int = #{cabinetId}
</if>
</select>
<!--<select id="getInventoryByOrgId" resultType="Map">-->
<!--<select id="getInventoryByOrgId" resultType="Map">-->
<!--select-->
<!-- *-->
<!--from base_inventory i-->
...
...
jyzb-biz/src/main/resources/mapper/PoliceEquipmentMapper.xml
0 → 100644
View file @
8d48fcc0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.junmp.jyzb.mapper.PoliceEquipmentMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.junmp.jyzb.entity.PoliceEquipment"
>
<id
property=
"id"
column=
"id"
jdbcType=
"VARCHAR"
/>
<result
property=
"policeId"
column=
"police_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"equipmentId"
column=
"equipment_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"num"
column=
"num"
jdbcType=
"INTEGER"
/>
<result
property=
"orgId"
column=
"org_id"
jdbcType=
"BIGINT"
/>
<result
property=
"equipmentName"
column=
"equipment_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,police_id,equipment_id,
num,org_id,equipment_name,
update_time,create_time
</sql>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论