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
70008595
Commit
70008595
authored
Jul 27, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改测试单警柜模块和人脸、指纹模块接口
parent
cfdba71d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
245 行增加
和
40 行删除
+245
-40
CabinetBoxReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/CabinetBoxReq.java
+8
-0
CabinetReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/CabinetReq.java
+6
-0
CabinetDto.java
jyzb-biz/src/main/java/com/junmp/jyzb/Dto/CabinetDto.java
+93
-0
CabinetController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
+26
-15
Cabinet.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Cabinet.java
+0
-2
Policeman.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Policeman.java
+1
-1
CabinetMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
+3
-0
CabinetService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
+6
-3
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+61
-15
CabinetMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
+41
-4
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/CabinetBoxReq.java
View file @
70008595
...
...
@@ -47,5 +47,12 @@ public class CabinetBoxReq extends BaseRequest {
@ApiModelProperty
(
value
=
"使用日志存储位置信息"
)
private
String
logMap
;
/**
* 警员id
*/
@ApiModelProperty
(
value
=
"警员id"
)
private
String
policeId
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/CabinetReq.java
View file @
70008595
...
...
@@ -76,6 +76,12 @@ public class CabinetReq extends BaseRequest {
@ApiModelProperty
(
value
=
"更新人员"
)
private
String
updateUser
;
/**
* 是否包含本级及下级,true为包含,false为不包含,只显示本级
*/
@ApiModelProperty
(
value
=
"本机及下级"
)
private
String
includeLowerLevel
;
// /**
// * 单警柜与箱门一对多关系
// */
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/Dto/CabinetDto.java
0 → 100644
View file @
70008595
package
com
.
junmp
.
jyzb
.
Dto
;
import
com.junmp.jyzb.entity.CabinetBox
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
CabinetDto
extends
BaseRequest
{
/**
* 单警柜ID
*/
@NotNull
(
message
=
"单警柜ID主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜ID"
)
private
String
id
;
/**
* 单警柜编号
*/
@NotNull
(
message
=
"单警柜编号不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜编号"
)
private
String
cabinetNum
;
/**
* 箱数
*/
@ApiModelProperty
(
value
=
"箱数"
)
private
Integer
num
;
/**
* 单警柜名称
*/
@NotNull
(
message
=
"单警柜名称不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜名称"
)
private
String
name
;
/**
* 组织机构号
*/
@NotNull
(
message
=
"组织机构号不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"组织机构号"
)
private
String
orgId
;
/**
* 位置信息
*/
@ApiModelProperty
(
value
=
"位置信息"
)
private
String
location
;
/**
* 单警柜当前状态,0正常,1异常
*/
@ApiModelProperty
(
value
=
"单警柜当前状态,0正常,1异常"
)
private
Integer
state
;
/**
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
/**
* 更新时间
*/
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
/**
* 更新人员
*/
@ApiModelProperty
(
value
=
"更新人员"
)
private
String
updateUser
;
/**
* 是否包含本级及下级,true为包含,false为不包含,只显示本级
*/
@ApiModelProperty
(
value
=
"本机及下级"
)
private
String
includeLowerLevel
;
/**
* 单警柜与箱门一对多关系
*/
private
List
<
CabinetBox
>
list
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
View file @
70008595
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.Dto.CabinetDto
;
import
com.junmp.jyzb.api.bean.req.CabinetBoxReq
;
import
com.junmp.jyzb.api.bean.req.CabinetReq
;
import
com.junmp.jyzb.entity.Cabinet
;
...
...
@@ -46,14 +47,14 @@ public class CabinetController {
}
@PostMapping
(
"/DeleteCabinet"
)
@ApiOperation
(
"删除单警柜
信息
"
)
@ApiOperation
(
"删除单警柜"
)
public
ResponseResult
deleteCabinet
(
@RequestBody
Map
<
String
,
Object
>
msg
)
{
ResponseResult
returnMsg
=
cabinetService
.
deleteCabinet
(
msg
);
return
returnMsg
;
}
@PostMapping
(
"/ShowCabinet"
)
@ApiOperation
(
"查询单警柜
列表
"
)
@ApiOperation
(
"查询单警柜"
)
public
ResponseResult
showCabinet
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
cabinetService
.
getAllCabinet
(
msg
);
return
returnMsg
;
...
...
@@ -83,7 +84,7 @@ public class CabinetController {
@PostMapping
(
"/AddCabinetInfo"
)
@ApiOperation
(
"添加单警柜"
)
@ApiOperation
(
"添加单警柜
信息(新)
"
)
public
ApiRes
<
Boolean
>
addCabinetInfo
(
@RequestBody
CabinetReq
req
){
boolean
result
=
cabinetService
.
addCabinetInfo
(
req
);
if
(!
result
){
...
...
@@ -93,37 +94,47 @@ public class CabinetController {
}
@PostMapping
(
"/DeleteCabinetInfo"
)
@ApiOperation
(
"删除单警柜信息"
)
@ApiOperation
(
"删除单警柜信息
(新)
"
)
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
CabinetReq
req
)
{
return
ApiRes
.
success
(
cabinetService
.
deleteCabinetInfo
(
req
));
}
@PostMapping
(
"/ShowCabinetList"
)
@ApiOperation
(
"查询单警柜列表"
)
public
ApiRes
<
List
<
Cabinet
>>
showCabinetList
(
@RequestBody
CabinetReq
req
,
@RequestBody
String
includeLowerLevel
){
List
<
Cabinet
>
allCabinetList
=
cabinetService
.
getAllCabinetList
(
req
,
includeLowerLevel
);
@ApiOperation
(
"查询单警柜列表
(新)
"
)
public
ApiRes
<
List
<
Cabinet
>>
showCabinetList
(
@RequestBody
CabinetReq
req
){
List
<
Cabinet
>
allCabinetList
=
cabinetService
.
getAllCabinetList
(
req
);
if
(
allCabinetList
.
size
()<=
0
){
return
ApiRes
.
failure
(
"查询失败,列表为null"
);
}
return
ApiRes
.
success
(
cabinetService
.
getAllCabinetList
(
req
,
includeLowerLevel
));
return
ApiRes
.
success
(
allCabinetList
);
}
@PostMapping
(
"/ShowCabinetList1111"
)
@ApiOperation
(
"查询单警柜列表(新)"
)
public
ApiRes
<
List
<
CabinetDto
>>
showCabinetList1111
(
@RequestBody
CabinetReq
req
){
List
<
CabinetDto
>
allCabinetList
=
cabinetService
.
getAllCabinetList111
(
req
);
if
(
allCabinetList
.
size
()<=
0
){
return
ApiRes
.
failure
(
"查询失败,列表为null"
);
}
return
ApiRes
.
success
(
allCabinetList
);
}
//通过单警柜id查询单个箱门及其箱门信息
@PostMapping
(
"/ShowOneCabinet"
)
@ApiOperation
(
"查询单个单警柜及其箱门信息"
)
public
ApiRes
<
Cabinet
>
showOneCabinet
(
@RequestBody
CabinetReq
req
){
@ApiOperation
(
"查询单个单警柜及其箱门信息
(新)
"
)
public
ApiRes
<
Cabinet
Dto
>
showOneCabinet
(
@RequestBody
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetService
.
showOneCabinet
(
req
));
}
@PostMapping
(
"/getCabinetBoxList"
)
@ApiOperation
(
"通过单警柜id获取箱门列表"
)
@ApiOperation
(
"通过单警柜id获取箱门列表
(新)
"
)
public
ApiRes
<
List
<
CabinetBox
>>
getCabinetBoxList
(
@RequestBody
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetBoxService
.
getCabinetBoxList
(
req
));
}
@PostMapping
(
"/UpdateCabinetInfo"
)
@ApiOperation
(
"修改单警柜信息"
)
@ApiOperation
(
"修改单警柜信息
(新)
"
)
public
ApiRes
<
Boolean
>
updateCabinetInfo
(
@RequestBody
CabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
if
(!
result
){
...
...
@@ -133,9 +144,9 @@ public class CabinetController {
}
@PostMapping
(
"/boxBindPolice"
)
@ApiOperation
(
"箱门绑定人员"
)
public
ApiRes
<
Boolean
>
boxBindPolice
(
@RequestBody
CabinetBoxReq
req
,
@RequestBody
String
policeId
)
{
boolean
result
=
cabinetService
.
boxBindPolice
(
req
,
policeId
);
@ApiOperation
(
"箱门绑定人员
(新)
"
)
public
ApiRes
<
Boolean
>
boxBindPolice
(
@RequestBody
CabinetBoxReq
req
)
{
boolean
result
=
cabinetService
.
boxBindPolice
(
req
);
if
(!
result
){
return
ApiRes
.
failure
(
"操作失败"
);
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Cabinet.java
View file @
70008595
...
...
@@ -124,7 +124,6 @@ public class Cabinet implements Serializable {
@ApiModelProperty
(
value
=
"箱数"
)
private
Integer
num
;
private
List
<
CabinetBox
>
list
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Policeman.java
View file @
70008595
...
...
@@ -28,7 +28,7 @@ public class Policeman implements Serializable {
@TableField
(
value
=
"name"
)
private
String
name
;
@TableField
(
value
=
"cabinet_box_id"
)
@TableField
(
value
=
"cabinet_box_id"
,
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
cabinetBoxId
;
@TableField
(
value
=
"org_id_int"
)
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
View file @
70008595
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.junmp.jyzb.Dto.CabinetDto
;
import
com.junmp.jyzb.entity.Cabinet
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -14,6 +15,7 @@ public interface CabinetMapper extends BaseMapper<Cabinet> {
public
int
addCabinet
(
Cabinet
cabinet
);
public
List
<
Cabinet
>
getAllCabinet
();
public
List
<
CabinetDto
>
getAllCabinet111
();
public
List
<
Cabinet
>
getAllCabinetList
();
Map
<
String
,
Object
>
getOneCabinet
(
String
id
);
...
...
@@ -35,6 +37,7 @@ public interface CabinetMapper extends BaseMapper<Cabinet> {
String
getCabinetNumById
(
String
id
);
List
<
Cabinet
>
getAllCabinetByOrgList
(
List
<
String
>
allOrgId
);
List
<
CabinetDto
>
getAllCabinetByOrgList111
(
List
<
String
>
allOrgId
);
void
setCabinetSumInventory
(
@Param
(
"updateId"
)
String
id
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
View file @
70008595
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.Dto.CabinetDto
;
import
com.junmp.jyzb.api.bean.req.CabinetBoxReq
;
import
com.junmp.jyzb.api.bean.req.CabinetReq
;
import
com.junmp.jyzb.entity.Cabinet
;
...
...
@@ -50,15 +51,17 @@ public interface CabinetService extends IService<Cabinet> {
* @param req
* @return
*/
List
<
Cabinet
>
getAllCabinetList
(
CabinetReq
req
,
String
includeLowerLevel
);
List
<
Cabinet
>
getAllCabinetList
(
CabinetReq
req
);
List
<
CabinetDto
>
getAllCabinetList111
(
CabinetReq
req
);
/**
* 通过单警柜id进行查询单个单警柜信息及其箱门信息
* @param req
* @return
*/
Cabinet
showOneCabinet
(
CabinetReq
req
);
Cabinet
Dto
showOneCabinet
(
CabinetReq
req
);
/**
* 修改单警柜信息
...
...
@@ -72,5 +75,5 @@ public interface CabinetService extends IService<Cabinet> {
* @param req
* @return
*/
boolean
boxBindPolice
(
CabinetBoxReq
req
,
String
policeId
);
boolean
boxBindPolice
(
CabinetBoxReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
70008595
...
...
@@ -3,6 +3,7 @@ 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.Dto.CabinetDto
;
import
com.junmp.jyzb.api.bean.req.CabinetBoxReq
;
import
com.junmp.jyzb.api.bean.req.CabinetReq
;
import
com.junmp.jyzb.entity.Cabinet
;
...
...
@@ -17,10 +18,8 @@ import com.junmp.jyzb.service.CabinetService;
import
com.junmp.jyzb.service.PolicemanService
;
import
com.junmp.jyzb.service.PubOrgService
;
import
com.junmp.jyzb.utils.*
;
import
com.junmp.v2.common.constant.CommonConstant
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -342,6 +341,11 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
allCabinet
=
cabinetMapper
.
getAllCabinetByOrgList
(
allOrgId
);
return
allCabinet
;
}
private
List
<
CabinetDto
>
getAllCabinetByOrg111
(
List
<
String
>
allOrgId
)
{
List
<
CabinetDto
>
allCabinet
=
new
ArrayList
<>();
allCabinet
=
cabinetMapper
.
getAllCabinetByOrgList111
(
allOrgId
);
return
allCabinet
;
}
@Override
public
List
<
String
>
getAllCabinetId
(
Map
<
String
,
Object
>
msg
)
{
...
...
@@ -489,6 +493,13 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getId
()),
CabinetBox:
:
getCabinetId
,
req
.
getId
());
List
<
CabinetBox
>
list
=
cabinetBoxService
.
list
(
eq
);
for
(
CabinetBox
cabinetBox:
list
)
{
//删除箱门信息的同时需要去判断箱门是否绑定警员,如果有,则解除绑定
Policeman
one
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
cabinetBox
.
getId
()),
Policeman:
:
getCabinetBoxId
,
cabinetBox
.
getId
()));
if
(!
ObjectUtil
.
isNull
(
one
)){
one
.
setCabinetBoxId
(
null
);
policemanService
.
updateById
(
one
);
}
cabinetBoxService
.
removeById
(
cabinetBox
.
getId
());
}
//删除单警柜id
...
...
@@ -499,20 +510,20 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
* 获取单警柜列表
*通过机构id进行查询
* @param req 单警柜信息
* @param
i
ncludeLowerLevel true:查询本级及下级 false:查询本级
* @param
req getI
ncludeLowerLevel true:查询本级及下级 false:查询本级
* @return
*/
@Override
public
List
<
Cabinet
>
getAllCabinetList
(
CabinetReq
req
,
String
includeLowerLevel
)
{
public
List
<
Cabinet
>
getAllCabinetList
(
CabinetReq
req
)
{
List
<
Cabinet
>
cabinets
=
new
ArrayList
<>();
//如果组织机构时浙江省公安厅
if
(
req
.
getOrgId
().
equals
(
"1369509498032808905"
)
&&
includeLowerLevel
.
equals
(
"true"
))
{
if
(
req
.
getOrgId
().
equals
(
"1369509498032808905"
)
&&
req
.
getIncludeLowerLevel
()
.
equals
(
"true"
))
{
cabinets
=
cabinetMapper
.
getAllCabinet
();
return
cabinets
;
}
//分两种情况,如果说是本级及下级(全部)所有的单警柜信息,则incluLowerLevel为true,如果是查询本级的单警柜信息则为false
if
(
includeLowerLevel
.
equals
(
"true"
)
||
includeLowerLevel
.
equals
(
"false"
))
{
List
<
String
>
allOrgId
=
getAllOrgId
(
req
,
includeLowerLevel
);
if
(
req
.
getIncludeLowerLevel
().
equals
(
"true"
)
||
req
.
getIncludeLowerLevel
()
.
equals
(
"false"
))
{
List
<
String
>
allOrgId
=
getAllOrgId
(
req
,
req
.
getIncludeLowerLevel
()
);
if
(
allOrgId
.
isEmpty
())
{
//抛出组织机构不存在异常
throw
new
ServiceException
(
CabinetExceptionEnum
.
PUBORG_NOT_EXIST
);
...
...
@@ -526,23 +537,58 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
}
/**
* 获取单警柜列表
*通过机构id进行查询
* @param req 单警柜信息
* @param req getIncludeLowerLevel true:查询本级及下级 false:查询本级
* @return
*/
@Override
public
List
<
CabinetDto
>
getAllCabinetList111
(
CabinetReq
req
)
{
List
<
CabinetDto
>
cabinets
=
new
ArrayList
<>();
//如果组织机构时浙江省公安厅
if
(
req
.
getOrgId
().
equals
(
"1369509498032808905"
)
&&
req
.
getIncludeLowerLevel
().
equals
(
"true"
))
{
cabinets
=
cabinetMapper
.
getAllCabinet111
();
return
cabinets
;
}
//分两种情况,如果说是本级及下级(全部)所有的单警柜信息,则incluLowerLevel为true,如果是查询本级的单警柜信息则为false
if
(
req
.
getIncludeLowerLevel
().
equals
(
"true"
)
||
req
.
getIncludeLowerLevel
().
equals
(
"false"
))
{
List
<
String
>
allOrgId
=
getAllOrgId
(
req
,
req
.
getIncludeLowerLevel
());
if
(
allOrgId
.
isEmpty
())
{
//抛出组织机构不存在异常
throw
new
ServiceException
(
CabinetExceptionEnum
.
PUBORG_NOT_EXIST
);
}
cabinets
=
getAllCabinetByOrg111
(
allOrgId
);
return
cabinets
;
}
else
{
//传递的数据是否正确,不正确抛异常(只接受true、false)
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
}
/**
* 通过单警柜id查询单个单警柜及其箱门信息
* @param req
* @return
*/
@Override
public
Cabinet
showOneCabinet
(
CabinetReq
req
)
{
public
CabinetDto
showOneCabinet
(
CabinetReq
req
)
{
//查询单警柜信息
LambdaQueryWrapper
<
Cabinet
>
eq
=
CabinetWrapper
(
req
)
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getId
()),
Cabinet:
:
getId
,
req
.
getId
());
Cabinet
one
=
getOne
(
eq
);
if
(
ObjectUtil
.
isNull
(
one
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
CABINET_ISNOT_EXISTS
);
}
//查询单警柜的箱门信息
LambdaQueryWrapper
<
CabinetBox
>
eq1
=
CabinetboxWrapper
(
req
)
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
get
OrgId
()),
CabinetBox:
:
getCabinetId
,
req
.
getOrg
Id
());
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
get
Id
()),
CabinetBox:
:
getCabinetId
,
req
.
get
Id
());
List
<
CabinetBox
>
list
=
cabinetBoxService
.
list
(
eq1
);
one
.
setList
(
list
);
return
one
;
//将单警柜的信息和它的箱门信息返回
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
one
,
cabinetDto
);
cabinetDto
.
setList
(
list
);
return
cabinetDto
;
}
/**
...
...
@@ -601,7 +647,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
* @return
*/
@Override
public
boolean
boxBindPolice
(
CabinetBoxReq
req
,
String
policeId
)
{
public
boolean
boxBindPolice
(
CabinetBoxReq
req
)
{
//通过箱门id查询出箱门信息
CabinetBox
one
=
cabinetBoxService
.
getOne
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getId
()),
CabinetBox:
:
getId
,
req
.
getId
()));
...
...
@@ -621,18 +667,18 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
long
orgId
=
one1
.
getOrgId
();
//通过警员id获取警员所在的机构id
Policeman
one2
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
policeId
),
Policeman:
:
getId
,
policeId
));
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getPoliceId
()),
Policeman:
:
getId
,
req
.
getPoliceId
()
));
if
(
ObjectUtil
.
isEmpty
(
one2
)){
//警员不存在异常
throw
new
ServiceException
(
PolicemanExceptionEnum
.
POLICEMAN_NOT_EXIST
);
}
Long
orgId1
=
one2
.
getOrgId
();
//判断两个机构id是否相同,相同则可以绑定,不相同则绑定失败
if
(!
orgId1
.
equals
(
orgId
)){
if
(!
(
orgId1
==
orgId
)){
return
false
;
}
one2
.
setCabinetBoxId
(
one
.
getId
());
return
policemanService
.
save
(
one2
);
return
policemanService
.
updateById
(
one2
);
}
...
...
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
View file @
70008595
...
...
@@ -19,10 +19,10 @@
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<collection
property=
"list"
ofType=
"com.junmp.jyzb.entity.CabinetBox"
column=
"cabinet_id"
select=
"com.junmp.jyzb.mapper.CabinetBoxMapper.selectById"
>
<!-- <collection property="list" ofType="com.junmp.jyzb.entity.CabinetBox" column="cabinet_id"-->
<!-- select="com.junmp.jyzb.mapper.CabinetBoxMapper.selectById">--
>
</collection
>
<!-- </collection>--
>
</resultMap>
...
...
@@ -64,7 +64,7 @@
where p.id =#{id}
</update>
<select
id=
"getAllCabinet"
>
<select
id=
"getAllCabinet"
resultMap=
"BaseCabinetResultMap"
>
select
c.id,
c.cabinet_num as cabinetNum,
...
...
@@ -155,6 +155,43 @@
#{item}
</foreach>
</select>
<select
id=
"getAllCabinet111"
resultType=
"com.junmp.jyzb.Dto.CabinetDto"
>
select
c.id,
c.cabinet_num as cabinetNum,
c.name,
o.org_id as orgId,
o.org_name as orgName,
c.location,
c.state,
c.update_time as updateTime,
c.sum as sum,
c.in_sum as inSum,
c.out_sum as outSum
from base_cabinet c
left join pub_org o on c.org_id_int =o.org_id
</select>
<select
id=
"getAllCabinetByOrgList111"
resultType=
"com.junmp.jyzb.Dto.CabinetDto"
>
select
c.id,
c.cabinet_num as cabinetNum,
c.name,
o.org_id as orgId,
o.org_name as orgName,
c.location,
c.state,
c.update_time as updateTime,
c.sum as sum,
c.in_sum as inSum,
c.out_sum as outSum
from base_cabinet c
left join pub_org o on c.org_id_int =o.org_id
where c.org_id_int in
<foreach
item=
"item"
collection=
"list"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<update
id=
"setCabinetSumInventory"
>
UPDATE base_cabinet AS c
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论