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
b6162003
Commit
b6162003
authored
Aug 02, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单警柜模块所有接口调试修改
parent
ce565ede
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
215 行增加
和
216 行删除
+215
-216
CabinetBoxDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/CabinetBoxDto.java
+35
-0
CabinetDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/CabinetDto.java
+2
-31
UpdateCabinetBoxReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetBoxReq.java
+27
-0
UpdateCabinetReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetReq.java
+15
-9
CabinetDto.java
jyzb-biz/src/main/java/com/junmp/jyzb/Dto/CabinetDto.java
+0
-89
CabinetBoxController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetBoxController.java
+35
-0
CabinetController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
+48
-52
CabinetBoxMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetBoxMapper.java
+0
-2
CabinetMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
+1
-2
CabinetBoxService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetBoxService.java
+3
-0
CabinetService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
+11
-6
CabinetBoxServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetBoxServiceImpl.java
+37
-0
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+0
-0
PolicemanServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
+1
-0
CabinetBoxMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetBoxMapper.xml
+0
-5
CabinetMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
+0
-20
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/CabinetBoxDto.java
0 → 100644
View file @
b6162003
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
CabinetBoxDto
implements
Serializable
{
/**
* 主键ID
*/
@ApiModelProperty
(
value
=
"主键ID"
)
private
String
id
;
/**
* 箱号
*/
@ApiModelProperty
(
value
=
"箱号"
)
private
Integer
num
;
/**
* 异常状态:1正常/0异常
*/
@ApiModelProperty
(
value
=
"异常状态:1正常/0异常"
)
private
Integer
state
;
/**
* 异常原因
*/
@ApiModelProperty
(
value
=
"异常原因"
)
private
String
errorMsg
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/CabinetDto.java
View file @
b6162003
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
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.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
CabinetDto
implements
Serializable
{
public
class
CabinetDto
implements
Serializable
{
/**
* 单警柜ID
*/
...
...
@@ -49,32 +44,9 @@ public class CabinetDto implements Serializable {
@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
;
private
List
<
CabinetBoxDto
>
cabinetBoxList
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateCabinetBoxReq.java
0 → 100644
View file @
b6162003
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
UpdateCabinetBoxReq
extends
BaseRequest
{
@NotBlank
(
message
=
"箱门id不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
private
String
id
;
@NotBlank
(
message
=
"箱门状态不能为空"
,
groups
=
{
edit
.
class
})
private
Integer
state
;
private
String
errorMsg
;
//单警柜编号
@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/UpdateCabinetReq.java
View file @
b6162003
...
...
@@ -5,8 +5,10 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
...
...
@@ -14,14 +16,14 @@ public class UpdateCabinetReq extends BaseRequest {
/**
* 单警柜ID
*/
@Not
Null
(
message
=
"单警柜ID主键不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@Not
Blank
(
message
=
"单警柜ID主键不能为空"
,
groups
=
{
edit
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜ID"
)
private
String
id
;
/**
* 单警柜编号
*/
@Not
Null
(
message
=
"单警柜编号不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@Not
Blank
(
message
=
"单警柜编号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜编号"
)
private
String
cabinetNum
;
...
...
@@ -34,20 +36,21 @@ public class UpdateCabinetReq extends BaseRequest {
/**
* 单警柜名称
*/
@Not
Null
(
message
=
"单警柜名称不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@Not
Blank
(
message
=
"单警柜名称不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"单警柜名称"
)
private
String
name
;
/**
* 组织机构号
*/
@Not
Null
(
message
=
"组织机构号不能为空"
,
groups
=
{
edit
.
class
,
delete
.
class
,
detail
.
class
})
@Not
Blank
(
message
=
"组织机构号不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
,
detail
.
class
})
@ApiModelProperty
(
value
=
"组织机构号"
)
private
String
orgId
;
/**
* 位置信息
*/
@NotBlank
(
message
=
"位置信息不能为空"
,
groups
=
{
add
.
class
,
edit
.
class
})
@ApiModelProperty
(
value
=
"位置信息"
)
private
String
location
;
...
...
@@ -81,11 +84,13 @@ public class UpdateCabinetReq extends BaseRequest {
@ApiModelProperty
(
value
=
"本机及下级"
)
private
String
includeLowerLevel
;
// /**
// * 单警柜与箱门一对多关系
// */
// private List<CabinetBox> list;
// private List<CabinetBox> a ;
//箱门信息列表
private
List
<
UpdateCabinetBoxReq
>
cabinetBoxList
;
//单警柜id列表
@NotBlank
(
message
=
"单警柜不能为空"
,
groups
=
{
delete
.
class
})
private
List
<
String
>
cabinetList
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/Dto/CabinetDto.java
deleted
100644 → 0
View file @
ce565ede
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
*/
@ApiModelProperty
(
value
=
"单警柜ID"
)
private
String
id
;
/**
* 单警柜编号
*/
@ApiModelProperty
(
value
=
"单警柜编号"
)
private
String
cabinetNum
;
/**
* 箱数
*/
@ApiModelProperty
(
value
=
"箱数"
)
private
Integer
num
;
/**
* 单警柜名称
*/
@ApiModelProperty
(
value
=
"单警柜名称"
)
private
String
name
;
/**
* 组织机构号
*/
@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/CabinetBoxController.java
0 → 100644
View file @
b6162003
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.req.UpdateCabinetBoxReq
;
import
com.junmp.jyzb.service.CabinetBoxService
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
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.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@Slf4j
@RequestMapping
(
"/CabinetBox"
)
@Api
(
tags
=
"箱门信息模块"
)
public
class
CabinetBoxController
{
@Resource
private
CabinetBoxService
cabinetBoxService
;
//添加箱门信息
@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
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/CabinetController.java
View file @
b6162003
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.
D
to.CabinetDto
;
import
com.junmp.jyzb.
api.bean.d
to.CabinetDto
;
import
com.junmp.jyzb.api.bean.query.CabinetBoxReq
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.req.UpdateCabinetReq
;
import
com.junmp.jyzb.entity.Cabinet
;
import
com.junmp.jyzb.entity.CabinetBox
;
import
com.junmp.jyzb.service.CabinetBoxService
;
import
com.junmp.jyzb.service.CabinetService
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
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.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -34,29 +35,46 @@ public class CabinetController {
private
CabinetBoxService
cabinetBoxService
;
@PostMapping
(
"/ErrorState"
)
@ApiOperation
(
"单警柜状态变更"
)
public
ApiRes
<
Boolean
>
ChangeCabinetState
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
ChangeCabinetState
(
req
);
if
(!
result
){
return
ApiRes
.
failure
(
"操作失败"
);
}
return
ApiRes
.
success
(
result
);
}
@PostMapping
(
"/
ShowCabinet
"
)
@ApiOperation
(
"
查询单警柜
"
)
public
ResponseResult
showCabinet
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
cabinetService
.
getAllCabinet
(
msg
);
return
returnMsg
;
@PostMapping
(
"/
AddCabinetInfo
"
)
@ApiOperation
(
"
添加单警柜信息
"
)
public
ApiRes
<
String
>
addCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
add
.
class
)
UpdateCabinetReq
req
){
String
cabinetId
=
cabinetService
.
addCabinetInfo
(
req
);
return
ApiRes
.
success
(
cabinetId
)
;
}
@PostMapping
(
"/DeleteCabinetInfo"
)
@ApiOperation
(
"删除单警柜信息"
)
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
delete
.
class
)
UpdateCabinetReq
req
)
{
return
ApiRes
.
success
(
cabinetService
.
deleteCabinetInfo
(
req
));
}
@PostMapping
(
"/ErrorState"
)
@ApiOperation
(
"单警柜状态变更"
)
public
ResponseResult
changeCabinetState
(
@RequestBody
Map
<
String
,
Object
>
msg
)
{
ResponseResult
returnMsg
=
cabinetService
.
changeCabinetState
(
msg
);
return
returnMsg
;
@PostMapping
(
"/UpdateCabinetInfo"
)
@ApiOperation
(
"修改单警柜信息"
)
public
ApiRes
<
Boolean
>
updateCabinetInfo
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
if
(!
result
){
return
ApiRes
.
failure
(
"操作失败"
);
}
return
ApiRes
.
success
(
result
);
}
@PostMapping
(
"/GetCabinetDetail"
)
@
ApiOperation
(
"查询单警柜及其箱号信息
"
)
public
ResponseResult
getCabinetDetail
(
@RequestBody
Map
<
String
,
Object
>
msg
){
ResponseResult
returnMsg
=
cabinetService
.
getCabinetDetail
(
msg
);
return
returnMsg
;
//通过单警柜id查询单个箱门及其箱门信息
@
PostMapping
(
"/ShowOneCabinet
"
)
@ApiOperation
(
"查询单个单警柜及其箱门信息"
)
public
ApiRes
<
CabinetDto
>
showOneCabinet
(
@RequestBody
CabinetReq
req
){
return
ApiRes
.
success
(
cabinetService
.
showOneCabinet
(
req
))
;
}
@PostMapping
(
"/GetCabinetByOrgId"
)
...
...
@@ -65,56 +83,26 @@ public class CabinetController {
ResponseResult
returnMsg
=
cabinetService
.
getCabinetByOrgId
(
msg
);
return
returnMsg
;
}
@PostMapping
(
"/AddCabinetInfo"
)
@ApiOperation
(
"添加单警柜信息(新)"
)
public
ApiRes
<
String
>
addCabinetInfo
(
@RequestBody
UpdateCabinetReq
req
){
String
cabinetId
=
cabinetService
.
addCabinetInfo
(
req
);
return
ApiRes
.
success
(
cabinetId
);
}
@PostMapping
(
"/DeleteCabinetInfo"
)
@ApiOperation
(
"删除单警柜信息(新)"
)
public
ApiRes
<
Boolean
>
deleteCabinetInfo
(
@RequestBody
UpdateCabinetReq
req
)
{
return
ApiRes
.
success
(
cabinetService
.
deleteCabinetInfo
(
req
));
}
@PostMapping
(
"/ShowCabinetList"
)
@ApiOperation
(
"查询单警柜列表
(新)
"
)
public
ApiRes
<
List
<
Cabinet
>>
showCabinetList
(
@RequestBody
CabinetReq
req
){
List
<
Cabinet
>
allCabinetList
=
cabinetService
.
getAllCabinetList
(
req
);
@ApiOperation
(
"查询单警柜列表"
)
public
ApiRes
<
List
<
Cabinet
Dto
>>
showCabinetList
(
@RequestBody
CabinetReq
req
){
List
<
Cabinet
Dto
>
allCabinetList
=
cabinetService
.
getAllCabinetList
(
req
);
if
(
allCabinetList
.
size
()<=
0
){
return
ApiRes
.
failure
(
"查询失败,列表为null"
);
}
return
ApiRes
.
success
(
allCabinetList
);
}
//通过单警柜id查询单个箱门及其箱门信息
@PostMapping
(
"/ShowOneCabinet"
)
@ApiOperation
(
"查询单个单警柜及其箱门信息(新)"
)
public
ApiRes
<
CabinetDto
>
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
(
"修改单警柜信息(新)"
)
public
ApiRes
<
Boolean
>
updateCabinetInfo
(
@RequestBody
UpdateCabinetReq
req
)
{
boolean
result
=
cabinetService
.
updateCabinetInfo
(
req
);
if
(!
result
){
return
ApiRes
.
failure
(
"操作失败"
);
}
return
ApiRes
.
success
(
result
);
}
@PostMapping
(
"/boxBindPolice"
)
@ApiOperation
(
"箱门绑定人员
(新)
"
)
@ApiOperation
(
"箱门绑定人员"
)
public
ApiRes
<
Boolean
>
boxBindPolice
(
@RequestBody
CabinetBoxReq
req
)
{
boolean
result
=
cabinetService
.
boxBindPolice
(
req
);
if
(!
result
){
...
...
@@ -122,4 +110,11 @@ public class CabinetController {
}
return
ApiRes
.
success
(
result
);
}
@PostMapping
(
"/SearchOrgId"
)
@ApiOperation
(
"/根据单警柜id查询组织机构id"
)
public
ApiRes
<
Long
>
SearchOrgId
(
String
id
){
return
ApiRes
.
success
(
cabinetService
.
SearchOrgId
(
id
));
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetBoxMapper.java
View file @
b6162003
...
...
@@ -12,8 +12,6 @@ public interface CabinetBoxMapper extends BaseMapper<CabinetBox> {
List
<
Map
<
String
,
Object
>>
getBoxMsg
(
String
id
);
void
changeCabinetState
(
CabinetBox
cabinetBox
);
List
<
CabinetBox
>
selectByIdCabinetBoxes
(
String
id
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
View file @
b6162003
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.junmp.jyzb.
D
to.CabinetDto
;
import
com.junmp.jyzb.
api.bean.d
to.CabinetDto
;
import
com.junmp.jyzb.entity.Cabinet
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -36,7 +36,6 @@ 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/CabinetBoxService.java
View file @
b6162003
...
...
@@ -2,6 +2,7 @@ package com.junmp.jyzb.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.req.UpdateCabinetBoxReq
;
import
com.junmp.jyzb.entity.CabinetBox
;
import
com.junmp.jyzb.entity.Policeman
;
...
...
@@ -15,4 +16,6 @@ public interface CabinetBoxService extends IService<CabinetBox> {
List
<
CabinetBox
>
getCabinetBoxList
(
CabinetReq
req
);
//添加箱门信息
boolean
AddBoxInfo
(
UpdateCabinetBoxReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/CabinetService.java
View file @
b6162003
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.
D
to.CabinetDto
;
import
com.junmp.jyzb.
api.bean.d
to.CabinetDto
;
import
com.junmp.jyzb.api.bean.query.CabinetBoxReq
;
import
com.junmp.jyzb.api.bean.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.req.UpdateCabinetReq
;
...
...
@@ -21,13 +21,9 @@ public interface CabinetService extends IService<Cabinet> {
Map
<
String
,
Object
>
getOneCabinet
(
String
cabinetId
);
ResponseResult
changeCabinetState
(
Map
<
String
,
Object
>
msg
);
List
<
String
>
getAllCabinetBoxId
(
String
id
);
ResponseResult
getAllCabinet
(
Map
<
String
,
Object
>
msg
);
ResponseResult
getCabinetDetail
(
Map
<
String
,
Object
>
msg
);
ResponseResult
setCabinetInventory
(
Map
<
String
,
Object
>
msg
);
...
...
@@ -50,7 +46,7 @@ public interface CabinetService extends IService<Cabinet> {
* @param req
* @return
*/
List
<
Cabinet
>
getAllCabinetList
(
CabinetReq
req
);
List
<
Cabinet
Dto
>
getAllCabinetList
(
CabinetReq
req
);
...
...
@@ -81,4 +77,13 @@ public interface CabinetService extends IService<Cabinet> {
* @return
*/
ResponseResult
getCabinetByOrgId
(
Map
<
String
,
Object
>
msg
);
/**
* 修改单警柜箱门状态
* @param req
* @return
*/
boolean
ChangeCabinetState
(
UpdateCabinetReq
req
);
Long
SearchOrgId
(
String
id
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetBoxServiceImpl.java
View file @
b6162003
...
...
@@ -4,17 +4,26 @@ 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.query.CabinetReq
;
import
com.junmp.jyzb.api.bean.req.UpdateCabinetBoxReq
;
import
com.junmp.jyzb.entity.Cabinet
;
import
com.junmp.jyzb.entity.CabinetBox
;
import
com.junmp.jyzb.entity.Policeman
;
import
com.junmp.jyzb.exception.enums.CabinetExceptionEnum
;
import
com.junmp.jyzb.mapper.CabinetBoxMapper
;
import
com.junmp.jyzb.mapper.PoliceFingerMapper
;
import
com.junmp.jyzb.mapper.PolicemanMapper
;
import
com.junmp.jyzb.service.CabinetBoxService
;
import
com.junmp.jyzb.service.CabinetService
;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
@Service
public
class
CabinetBoxServiceImpl
extends
ServiceImpl
<
CabinetBoxMapper
,
CabinetBox
>
implements
CabinetBoxService
{
...
...
@@ -31,6 +40,9 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
@Resource
private
PoliceFingerMapper
policeFingerMapper
;
@Resource
private
CabinetService
cabinetService
;
@Override
public
List
<
Map
<
String
,
Object
>>
getAllBoxMsg
(
String
id
)
{
return
cabinetBoxMapper
.
getBoxMsg
(
id
);
...
...
@@ -50,4 +62,29 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
return
cabinetBoxList
;
}
//添加箱门信息
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
AddBoxInfo
(
UpdateCabinetBoxReq
req
)
{
CabinetBox
cabinetBox
=
new
CabinetBox
();
BeanPlusUtil
.
copyProperties
(
req
,
cabinetBox
);
//添加单警柜箱门信息默认状态为1
cabinetBox
.
setState
(
1
);
Cabinet
cabinet
=
cabinetService
.
getOne
(
new
LambdaQueryWrapper
<
Cabinet
>()
.
eq
(
Cabinet:
:
getCabinetNum
,
req
.
getCabinetNum
()));
if
(
ObjectUtil
.
isNull
(
cabinet
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
CABINET_ISNOT_EXISTS
);
}
cabinetBox
.
setCabinetId
(
cabinet
.
getId
());
Integer
num
=
cabinet
.
getNum
();
if
(
num
==
null
){
num
=
1
;
cabinet
.
setNum
(
num
);
}
else
{
cabinet
.
setNum
(
cabinet
.
getNum
()+
1
);
}
cabinetService
.
updateById
(
cabinet
);
return
save
(
cabinetBox
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
b6162003
差异被折叠。
点击展开。
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
View file @
b6162003
...
...
@@ -393,6 +393,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
}
policemanDto
.
setFingersList
(
policeFingerDtoList
);
policeList
.
add
(
policemanDto
);
}
PoliceDto
policeDto
=
new
PoliceDto
();
policeDto
.
setPolicemanlist
(
policeList
);
...
...
jyzb-biz/src/main/resources/mapper/CabinetBoxMapper.xml
View file @
b6162003
...
...
@@ -22,11 +22,6 @@
WHERE f.cabinet_id = #{id};
</select>
<update
id=
"changeCabinetState"
>
update base_cabinet_box f
set state = #{state},error_msg=#{errorMsg}
where f.id =#{id}
</update>
<select
id=
"selectByIdCabinetBoxes"
resultType=
"com.junmp.jyzb.entity.CabinetBox"
parameterType=
"java.lang.String"
>
...
...
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
View file @
b6162003
...
...
@@ -146,26 +146,6 @@
#{item}
</foreach>
</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"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论