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
513e7626
Commit
513e7626
authored
Dec 05, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.sothing.top/843502640/jyzb_platformV2
into develop-lxh
parents
bf296e00
ae06e2e0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
34 行增加
和
31 行删除
+34
-31
Cabinet.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Cabinet.java
+10
-0
CabinetMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
+2
-1
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+11
-20
CabinetMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
+11
-10
没有找到文件。
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Cabinet.java
View file @
513e7626
...
@@ -108,6 +108,8 @@ public class Cabinet implements Serializable {
...
@@ -108,6 +108,8 @@ public class Cabinet implements Serializable {
private
Date
updateTime
;
private
Date
updateTime
;
/**
/**
* 新增人员
* 新增人员
*/
*/
...
@@ -128,6 +130,13 @@ public class Cabinet implements Serializable {
...
@@ -128,6 +130,13 @@ public class Cabinet implements Serializable {
@ApiModelProperty
(
value
=
"箱数"
)
@ApiModelProperty
(
value
=
"箱数"
)
private
Integer
num
;
private
Integer
num
;
private
String
policeName
;
private
Long
policeId
;
private
Integer
number
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/CabinetMapper.java
View file @
513e7626
...
@@ -13,7 +13,7 @@ import java.util.Map;
...
@@ -13,7 +13,7 @@ import java.util.Map;
public
interface
CabinetMapper
extends
BaseMapper
<
Cabinet
>
{
public
interface
CabinetMapper
extends
BaseMapper
<
Cabinet
>
{
List
<
Cabinet
>
getAllCabinetByOrgList
(
@Param
(
"list"
)
List
<
Long
>
allOrgId
);
List
<
Cabinet
>
getAllCabinetByOrgList
(
@Param
(
"list"
)
List
<
Long
>
allOrgId
);
List
<
Cabinet
>
getAllCabinetsWithSingleCabinet
(
@Param
(
"orgId"
)
String
id
,
@Param
(
"containType"
)
String
containType
);
List
<
Cabinet
>
getAllCabinetsWithSingleCabinet
(
@Param
(
"orgId"
)
String
id
);
boolean
SetInventoryInfo
(
String
id
);
boolean
SetInventoryInfo
(
String
id
);
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
513e7626
...
@@ -178,11 +178,8 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
...
@@ -178,11 +178,8 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
*/
*/
@Override
@Override
public
List
<
CabinetDto
>
getAllCabinetList
(
CabinetReq
req
)
{
public
List
<
CabinetDto
>
getAllCabinetList
(
CabinetReq
req
)
{
// 判断组织机构是否存在
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
CabinetDto
>
cabinetList
=
new
ArrayList
<>();
List
<
CabinetDto
>
cabinetList
=
new
ArrayList
<>();
List
<
Cabinet
>
list
=
cabinetMapper
.
getAllCabinetsWithSingleCabinet
(
String
.
valueOf
(
req
.
getOrgId
())
,
req
.
getContainType
()
);
List
<
Cabinet
>
list
=
cabinetMapper
.
getAllCabinetsWithSingleCabinet
(
String
.
valueOf
(
req
.
getOrgId
()));
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
...
@@ -192,31 +189,25 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
...
@@ -192,31 +189,25 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
CabinetDto
cabinetDto
=
new
CabinetDto
();
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
List
<
CabinetBox
>
list1
;
List
<
CabinetBox
>
list1
;
if
(
StringUtils
.
isNotBlank
(
req
.
getContainType
()))
{
list1
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
eq
(
CabinetBox:
:
getContainType
,
req
.
getContainType
())
);
}
else
{
list1
=
cabinetBoxService
.
list
(
list1
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
orderByAsc
(
CabinetBox:
:
getNum
)
// 根据 Num 字段升序排序
);
);
}
List
<
CabinetBoxDto
>
cabinetBoxList
=
new
ArrayList
<>();
List
<
CabinetBoxDto
>
cabinetBoxList
=
new
ArrayList
<>();
for
(
CabinetBox
cabinetBox
:
list1
)
{
for
(
CabinetBox
cabinetBox
:
list1
)
{
CabinetBoxDto
cabinetBoxDto
=
new
CabinetBoxDto
();
CabinetBoxDto
cabinetBoxDto
=
new
CabinetBoxDto
();
BeanPlusUtil
.
copyProperties
(
cabinetBox
,
cabinetBoxDto
);
BeanPlusUtil
.
copyProperties
(
cabinetBox
,
cabinetBoxDto
);
// 查询箱门绑定的警员id和姓名
// 查询箱门绑定的警员id和姓名
// List<Policeman> policeList = policemanService.list(new LambdaQueryWrapper<Policeman>()
// List<Policeman> policeList=cabinetBoxPoliceMapper.selectByBoxId(cabinetBox.getId());
// .eq(Policeman::getCabinetBoxId, cabinetBox.getId()));
// if (policeList.size() != 0) {
List
<
Policeman
>
policeList
=
cabinetBoxPoliceMapper
.
selectByBoxId
(
cabinetBox
.
getId
());
// Policeman policeman = policeList.get(0);
if
(
policeList
.
size
()
!=
0
)
{
// cabinetBoxDto.setPoliceId(policeman.getId());
Policeman
policeman
=
policeList
.
get
(
0
);
// cabinetBoxDto.setPoliceName(policeman.getName());
cabinetBoxDto
.
setPoliceId
(
policeman
.
getId
());
// }
cabinetBoxDto
.
setPoliceName
(
policeman
.
getName
());
}
cabinetBoxDto
.
setNum
(
cabinetBox
.
getNum
());
cabinetBoxDto
.
setNum
(
cabinetBox
.
getNum
());
cabinetBoxList
.
add
(
cabinetBoxDto
);
cabinetBoxList
.
add
(
cabinetBoxDto
);
}
}
...
...
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
View file @
513e7626
<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.junmp.jyzb.mapper.CabinetMapper"
>
<mapper
namespace=
"com.junmp.jyzb.mapper.CabinetMapper"
>
<resultMap
id=
"
BaseC
abinetResultMap"
type=
"com.junmp.jyzb.entity.Cabinet"
>
<resultMap
id=
"
c
abinetResultMap"
type=
"com.junmp.jyzb.entity.Cabinet"
>
<id
property=
"id"
column=
"id"
/>
<id
property=
"id"
column=
"id"
/>
<result
property=
"cabinetNum"
column=
"cabinet_num"
/>
<result
property=
"cabinetNum"
column=
"cabinet_num"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
...
@@ -16,8 +16,10 @@
...
@@ -16,8 +16,10 @@
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"policeName"
column=
"police_name"
/>
<result
property=
"policeId"
column=
"police_id"
/>
<result
property=
"number"
column=
"number"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<!-- <collection property="list" ofType="com.junmp.jyzb.entity.CabinetBox" column="cabinet_id"-->
<!-- <collection property="list" ofType="com.junmp.jyzb.entity.CabinetBox" column="cabinet_id"-->
<!-- select="com.junmp.jyzb.mapper.CabinetBoxMapper.selectById">-->
<!-- select="com.junmp.jyzb.mapper.CabinetBoxMapper.selectById">-->
...
@@ -73,16 +75,15 @@
...
@@ -73,16 +75,15 @@
</foreach>
</foreach>
</select>
</select>
<select
id=
"getAllCabinetsWithSingleCabinet"
resultType=
"com.junmp.jyzb.entity.Cabinet"
>
<select
id=
"getAllCabinetsWithSingleCabinet"
resultType=
"com.junmp.jyzb.entity.Cabinet"
>
SELECT c.*
SELECT c.*
, cb.num as number,bp.`name` as police_name,bp.id as police_id
FROM base_cabinet c
FROM base_cabinet c
JOIN pub_org o ON c.org_id_int = o.org_id
JOIN pub_org o ON c.org_id_int = o.org_id
WHERE c.org_id_int = #{orgId}
LEFT JOIN base_cabinet_box cb ON cb.cabinet_id = c.id
AND (#{containType} IS NULL OR #{containType} = '' OR EXISTS (
LEFT JOIN base_cabinet_box_police ccp ON ccp.cabinet_box_id = cb.id
SELECT 1
LEFT JOIN base_policeman bp ON bp.id = ccp.police_id
FROM base_cabinet_box cb
WHERE c.org_id_int = #{orgId} and cb.num is not null;
WHERE cb.cabinet_id = c.id
AND cb.contain_type = #{containType}
))
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论