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
ce565ede
Commit
ce565ede
authored
Aug 02, 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
672e1bb4
2a0fb520
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
137 行增加
和
530 行删除
+137
-530
OrgTreeDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrgTreeDto.java
+20
-0
QueryOrgReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/QueryOrgReq.java
+13
-0
OrgUpdateReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/OrgUpdateReq.java
+1
-1
UpdateEquipmentSizeReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateEquipmentSizeReq.java
+1
-1
UpdateEquipmentTypeReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateEquipmentTypeReq.java
+2
-2
PubOrgController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/PubOrgController.java
+4
-9
WarehouseController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/WarehouseController.java
+0
-23
Supplier.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Supplier.java
+0
-6
PubOrgService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/PubOrgService.java
+5
-4
WarehouseService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseService.java
+0
-1
EquipmentSizeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentSizeServiceImpl.java
+1
-0
EquipmentTypeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
+1
-0
PubOrgServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PubOrgServiceImpl.java
+88
-97
SupplierServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/SupplierServiceImpl.java
+1
-0
WarehouseServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
+0
-386
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrgTreeDto.java
0 → 100644
View file @
ce565ede
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
public
class
OrgTreeDto
{
private
String
name
;
private
String
code
;
private
Integer
type
;
private
List
<
OrgTreeDto
>
child
=
new
ArrayList
<>();
public
void
addChild
(
OrgTreeDto
child
)
{
this
.
child
.
add
(
child
);
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/QueryOrgReq.java
0 → 100644
View file @
ce565ede
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
//@EqualsAndHashCode(callSuper = true)
public
class
QueryOrgReq
{
private
String
orgCode
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/
query
/OrgUpdateReq.java
→
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/
req
/OrgUpdateReq.java
View file @
ce565ede
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateEquipmentSizeReq.java
View file @
ce565ede
...
@@ -24,5 +24,5 @@ public class UpdateEquipmentSizeReq {
...
@@ -24,5 +24,5 @@ public class UpdateEquipmentSizeReq {
private
BigDecimal
price
;
private
BigDecimal
price
;
@NotBlank
(
message
=
"状态值不能为空"
,
groups
=
{
ValidationApi
.
edit
.
class
})
@NotBlank
(
message
=
"状态值不能为空"
,
groups
=
{
ValidationApi
.
edit
.
class
})
private
Integer
state
;
private
String
state
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateEquipmentTypeReq.java
View file @
ce565ede
...
@@ -10,9 +10,9 @@ import java.util.List;
...
@@ -10,9 +10,9 @@ import java.util.List;
@Data
@Data
public
class
UpdateEquipmentTypeReq
{
public
class
UpdateEquipmentTypeReq
{
@Not
Null
(
message
=
"装备主键不能为空"
,
groups
=
{
ValidationApi
.
edit
.
class
,
ValidationApi
.
delete
.
class
,
ValidationApi
.
detail
.
class
})
@Not
Blank
(
message
=
"装备主键不能为空"
,
groups
=
{
ValidationApi
.
edit
.
class
,
ValidationApi
.
delete
.
class
,
ValidationApi
.
detail
.
class
})
private
String
id
;
private
String
id
;
@Not
Null
(
message
=
"状态不能为空"
,
groups
=
{
ValidationApi
.
updateStatus
.
class
})
@Not
Blank
(
message
=
"状态不能为空"
,
groups
=
{
ValidationApi
.
updateStatus
.
class
})
private
String
state
;
private
String
state
;
private
String
unitType
;
private
String
unitType
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/PubOrgController.java
View file @
ce565ede
package
com
.
junmp
.
jyzb
.
controller
;
package
com
.
junmp
.
jyzb
.
controller
;
import
com.junmp.jyzb.api.bean.dto.OrgTreeDto
;
import
com.junmp.jyzb.api.bean.query.QueryOrgReq
;
import
com.junmp.jyzb.service.PubOrgService
;
import
com.junmp.jyzb.service.PubOrgService
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.v2.common.bean.response.ApiRes
;
import
com.junmp.v2.common.bean.response.ApiRes
;
...
@@ -29,13 +31,6 @@ public class PubOrgController {
...
@@ -29,13 +31,6 @@ public class PubOrgController {
return
ApiRes
.
success
(
pubOrgService
.
showPubOrgList
(
orgId
));
return
ApiRes
.
success
(
pubOrgService
.
showPubOrgList
(
orgId
));
}
}
@PostMapping
(
"/ShowPubOrgListOld"
)
@ApiOperation
(
"查询组织机构列表_完整版"
)
public
ResponseResult
showPubOrgListOld
(
@RequestBody
Map
<
String
,
Object
>
orgId
)
{
//传入当前的组织机构id,展示所有本级及下级的
ResponseResult
returnMsg
=
pubOrgService
.
showPubOrgListOld
(
orgId
);
return
returnMsg
;
}
@PostMapping
(
"/SetOrgParentIds"
)
@PostMapping
(
"/SetOrgParentIds"
)
@ApiOperation
(
"填充组织机构的parent_ids字段"
)
@ApiOperation
(
"填充组织机构的parent_ids字段"
)
...
@@ -54,8 +49,8 @@ public class PubOrgController {
...
@@ -54,8 +49,8 @@ public class PubOrgController {
@PostMapping
(
"/GetOrgDetail"
)
@PostMapping
(
"/GetOrgDetail"
)
@ApiOperation
(
"查询组织机构详细信息"
)
@ApiOperation
(
"查询组织机构详细信息"
)
public
ResponseResult
getOrgDetail
(
@RequestBody
Map
<
String
,
Object
>
msg
)
{
public
List
<
OrgTreeDto
>
getOrgDetail
(
@RequestBody
QueryOrgReq
req
)
{
ResponseResult
returnMsg
=
pubOrgService
.
getOrgDetail
(
msg
);
List
<
OrgTreeDto
>
returnMsg
=
pubOrgService
.
getOrgList
(
req
);
return
returnMsg
;
return
returnMsg
;
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/WarehouseController.java
View file @
ce565ede
...
@@ -32,31 +32,17 @@ public class WarehouseController {
...
@@ -32,31 +32,17 @@ public class WarehouseController {
@Resource
@Resource
public
ShelfService
shelfService
;
public
ShelfService
shelfService
;
// @PostMapping("/AddWarehouse")
// @ApiOperation("添加仓库")
// public ResponseResult addWarehouse(@RequestBody Map<String,Object> msg) {
// ResponseResult returnMsg = warehouseService.addWarehouse(msg);
// return returnMsg;
// }
@PostMapping
(
"/AddWarehouse"
)
@PostMapping
(
"/AddWarehouse"
)
@ApiOperation
(
"添加仓库"
)
@ApiOperation
(
"添加仓库"
)
public
ApiRes
<
Boolean
>
addWarehouse
(
@RequestBody
@Validated
(
WarehouseReq
.
add
.
class
)
WarehouseReq
req
)
{
public
ApiRes
<
Boolean
>
addWarehouse
(
@RequestBody
@Validated
(
WarehouseReq
.
add
.
class
)
WarehouseReq
req
)
{
//ResponseResult returnMsg = warehouseService.addWarehouse(msg);
return
ApiRes
.
success
(
warehouseService
.
addWarehouse
(
req
));
return
ApiRes
.
success
(
warehouseService
.
addWarehouse
(
req
));
}
}
// @PostMapping("/DeleteWarehouse")
// @ApiOperation("删除仓库信息")
// public ResponseResult deleteWarehouse(@RequestBody Map<String,Object> msg) {
// ResponseResult returnMsg = warehouseService.deleteWarehouse(msg);
// return returnMsg;
// }
@PostMapping
(
"/DeleteWarehouse"
)
@PostMapping
(
"/DeleteWarehouse"
)
@ApiOperation
(
"删除仓库信息"
)
@ApiOperation
(
"删除仓库信息"
)
public
ApiRes
<
Boolean
>
deleteWarehouse
(
@RequestBody
@Validated
(
WarehouseReq
.
delete
.
class
)
WarehouseReq
req
)
{
public
ApiRes
<
Boolean
>
deleteWarehouse
(
@RequestBody
@Validated
(
WarehouseReq
.
delete
.
class
)
WarehouseReq
req
)
{
//ResponseResult returnMsg = warehouseService.deleteWarehouse(msg);
return
ApiRes
.
success
(
warehouseService
.
deleteWarehouse
(
req
));
return
ApiRes
.
success
(
warehouseService
.
deleteWarehouse
(
req
));
}
}
...
@@ -70,15 +56,6 @@ public class WarehouseController {
...
@@ -70,15 +56,6 @@ public class WarehouseController {
@ApiOperation
(
"查询仓库列表"
)
@ApiOperation
(
"查询仓库列表"
)
public
ApiRes
<
List
<
Warehouse
>>
getAllWarehouse
(
@RequestBody
WarehouseReq
req
){
public
ApiRes
<
List
<
Warehouse
>>
getAllWarehouse
(
@RequestBody
WarehouseReq
req
){
return
ApiRes
.
success
(
warehouseService
.
getAllWarehouse
(
req
));
return
ApiRes
.
success
(
warehouseService
.
getAllWarehouse
(
req
));
// //获取该组织机构下所有警员的id
// List<Map<String, Object>> allWarehouse=new ArrayList<>();
// List<String> allWarehouseId =warehouseService.getAllWarehouseId(orgId);
// for (String warehouseId :allWarehouseId){
// Map<String, Object> warehouseMsg = warehouseService.getOneWarehouse(warehouseId);
// allWarehouse.add(warehouseMsg);
// }
// return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,allWarehouse);
}
}
@PostMapping
(
"/GetWarehouseDetail"
)
@PostMapping
(
"/GetWarehouseDetail"
)
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Supplier.java
View file @
ce565ede
...
@@ -55,12 +55,6 @@ public class Supplier implements Serializable {
...
@@ -55,12 +55,6 @@ public class Supplier implements Serializable {
private
Date
updateTime
;
private
Date
updateTime
;
/**
* 创建人员
*/
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
String
createUser
;
/**
/**
* 更新人ID
* 更新人ID
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/PubOrgService.java
View file @
ce565ede
package
com
.
junmp
.
jyzb
.
service
;
package
com
.
junmp
.
jyzb
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.junmp.jyzb.api.bean.query.OrgUpdateReq
;
import
com.junmp.jyzb.api.bean.dto.OrgTreeDto
;
import
com.junmp.jyzb.api.bean.query.QueryOrgReq
;
import
com.junmp.jyzb.api.bean.req.OrgUpdateReq
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
java.util.List
;
import
java.util.List
;
...
@@ -12,7 +14,6 @@ public interface PubOrgService extends IService<PubOrg> {
...
@@ -12,7 +14,6 @@ public interface PubOrgService extends IService<PubOrg> {
List
<
Map
<
String
,
Object
>>
showPubOrgList
(
Map
<
String
,
Object
>
orgId
);
List
<
Map
<
String
,
Object
>>
showPubOrgList
(
Map
<
String
,
Object
>
orgId
);
ResponseResult
showPubOrgListOld
(
Map
<
String
,
Object
>
orgId
);
ResponseResult
setShortName
(
Map
<
String
,
Object
>
orgId
);
ResponseResult
setShortName
(
Map
<
String
,
Object
>
orgId
);
...
@@ -20,7 +21,7 @@ public interface PubOrgService extends IService<PubOrg> {
...
@@ -20,7 +21,7 @@ public interface PubOrgService extends IService<PubOrg> {
ResponseResult
setOrgParentIds
();
ResponseResult
setOrgParentIds
();
ResponseResult
getOrgDetail
(
Map
<
String
,
Object
>
orgId
);
List
<
OrgTreeDto
>
getOrgList
(
QueryOrgReq
req
);
// public List<OrgTreeDto> getEquipmentList(QueryOrgReq req)
ResponseResult
changeOrgState
(
OrgUpdateReq
req
);
ResponseResult
changeOrgState
(
OrgUpdateReq
req
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/WarehouseService.java
View file @
ce565ede
...
@@ -35,7 +35,6 @@ public interface WarehouseService extends IService<Warehouse> {
...
@@ -35,7 +35,6 @@ public interface WarehouseService extends IService<Warehouse> {
*/
*/
boolean
updateWarehouse
(
WarehouseReq
req
);
boolean
updateWarehouse
(
WarehouseReq
req
);
List
<
String
>
getAllWarehouseId
(
Map
<
String
,
Object
>
orgId
);
boolean
changeWarehouseState
(
WarehouseReq
req
);
boolean
changeWarehouseState
(
WarehouseReq
req
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentSizeServiceImpl.java
View file @
ce565ede
...
@@ -60,6 +60,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
...
@@ -60,6 +60,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
@Override
@Override
public
Boolean
changeSizeState
(
UpdateEquipmentSizeReq
req
)
{
public
Boolean
changeSizeState
(
UpdateEquipmentSizeReq
req
)
{
EquipmentSize
size
=
this
.
querySize
(
req
);
EquipmentSize
size
=
this
.
querySize
(
req
);
size
.
setState
(
Integer
.
valueOf
(
req
.
getState
()));
return
this
.
updateById
(
size
);
return
this
.
updateById
(
size
);
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
View file @
ce565ede
...
@@ -248,6 +248,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
...
@@ -248,6 +248,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
EquipmentType
equipment
=
this
.
getById
(
req
.
getId
());
EquipmentType
equipment
=
this
.
getById
(
req
.
getId
());
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
equipment
.
setState
(
Integer
.
valueOf
(
req
.
getState
()));
equipment
.
setState
(
Integer
.
valueOf
(
req
.
getState
()));
return
this
.
updateById
(
equipment
);
}
}
return
true
;
return
true
;
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PubOrgServiceImpl.java
View file @
ce565ede
...
@@ -3,8 +3,13 @@ package com.junmp.jyzb.service.impl;
...
@@ -3,8 +3,13 @@ package com.junmp.jyzb.service.impl;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.query.OrgUpdateReq
;
import
com.junmp.jyzb.api.bean.dto.EquipmentTreeDto
;
import
com.junmp.jyzb.api.bean.dto.OrgTreeDto
;
import
com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq
;
import
com.junmp.jyzb.api.bean.query.QueryOrgReq
;
import
com.junmp.jyzb.api.bean.req.OrgUpdateReq
;
import
com.junmp.jyzb.api.bean.query.ProductTagReq
;
import
com.junmp.jyzb.api.bean.query.ProductTagReq
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
com.junmp.jyzb.entity.PubOrg
;
import
com.junmp.jyzb.entity.PubOrg
;
import
com.junmp.jyzb.utils.HttpStatus
;
import
com.junmp.jyzb.utils.HttpStatus
;
import
com.junmp.jyzb.utils.RedisUtils
;
import
com.junmp.jyzb.utils.RedisUtils
;
...
@@ -17,6 +22,7 @@ import com.junmp.jyzb.mapper.PubOrgMapper;
...
@@ -17,6 +22,7 @@ import com.junmp.jyzb.mapper.PubOrgMapper;
import
com.junmp.jyzb.service.PubOrgService
;
import
com.junmp.jyzb.service.PubOrgService
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
junmp
.
jyzb
.
utils
.
CheckBlank
.
checkNotBlank
;
import
static
com
.
junmp
.
jyzb
.
utils
.
CheckBlank
.
checkNotBlank
;
...
@@ -197,71 +203,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
...
@@ -197,71 +203,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
}
}
}
}
/**
* 组织机构名称不进行删减的代码
* */
@Override
public
ResponseResult
showPubOrgListOld
(
Map
<
String
,
Object
>
orgId
)
{
//构建 Redis 缓存键
String
redisKey
=
"showPubOrgList"
;
// 从 Redis 中获取数据
List
<
PubOrg
>
cachedData
=
redisUtils
.
findCachedData
(
redisKey
);
List
<
PubOrg
>
menuList
=
new
ArrayList
<>();
if
(
cachedData
!=
null
){
menuList
=
cachedData
;
}
else
{
menuList
=
pubOrgMapper
.
selectAllOrg
();
redisUtils
.
set
(
redisKey
,
menuList
);
}
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
Map
<
Long
,
List
<
Map
<
String
,
Object
>>>
childrenMap
=
new
HashMap
<>();
// 构建子菜单映射表
for
(
PubOrg
menu
:
menuList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
menu
.
getOrgId
());
map
.
put
(
"parentId"
,
menu
.
getOrgParentId
());
map
.
put
(
"orgName"
,
menu
.
getOrgName
());
if
(!
childrenMap
.
containsKey
(
menu
.
getOrgParentId
()))
{
childrenMap
.
put
(
menu
.
getOrgParentId
(),
new
ArrayList
<>());
}
childrenMap
.
get
(
menu
.
getOrgParentId
()).
add
(
map
);
}
Long
orgInfo
=
Long
.
valueOf
(
orgId
.
get
(
"orgId"
).
toString
());
// 获取顶级菜单
List
<
Map
<
String
,
Object
>>
topMenus
=
childrenMap
.
get
(
orgInfo
);
// 迭代构建菜单�
if
(
topMenus
!=
null
)
{
for
(
Map
<
String
,
Object
>
topMenu
:
topMenus
)
{
Stack
<
Map
<
String
,
Object
>>
stack
=
new
Stack
<>();
stack
.
push
(
topMenu
);
while
(!
stack
.
isEmpty
())
{
Map
<
String
,
Object
>
currentMenu
=
stack
.
pop
();
Long
currentMenuId
=
(
Long
)
currentMenu
.
get
(
"id"
);
if
(
childrenMap
.
containsKey
(
currentMenuId
))
{
List
<
Map
<
String
,
Object
>>
children
=
childrenMap
.
get
(
currentMenuId
);
currentMenu
.
put
(
"children"
,
children
);
for
(
int
i
=
children
.
size
()
-
1
;
i
>=
0
;
i
--)
{
stack
.
push
(
children
.
get
(
i
));
}
}
}
resultList
.
add
(
topMenu
);
}
}
//redisUtils.set(redisKey, resultList);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
"操作成功"
,
resultList
);
}
@Override
@Override
public
List
<
String
>
getLowerOrg
(
String
orgId
)
{
public
List
<
String
>
getLowerOrg
(
String
orgId
)
{
...
@@ -426,11 +368,6 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
...
@@ -426,11 +368,6 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
List
<
Map
<
String
,
Object
>>
children
=
getChildMenus
(
menu
.
getOrgId
(),
menuList
,
name1
,
name2
,
deleteName3
);
List
<
Map
<
String
,
Object
>>
children
=
getChildMenus
(
menu
.
getOrgId
(),
menuList
,
name1
,
name2
,
deleteName3
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
map
.
put
(
"children"
,
children
);
map
.
put
(
"children"
,
children
);
// for (Map<String,Object> msg:children){
// Long id = (Long) msg.get("id");
// String orgName = msg.get("orgName").toString();
// pubOrgMapper.setMsg(id,orgName);
// }
}
}
childList
.
add
(
map
);
childList
.
add
(
map
);
}
}
...
@@ -438,32 +375,95 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
...
@@ -438,32 +375,95 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
return
childList
;
return
childList
;
}
}
@Override
// @Override
public
ResponseResult
getOrgDetail
(
Map
<
String
,
Object
>
msg
)
{
// public ResponseResult getOrgDetail(QueryOrgReq msg) {
try
{
// try {
checkNotBlank
(
msg
.
get
(
"orgId"
),
"orgId不能为空"
);
// checkNotBlank(msg.get("orgId"), "orgId不能为空");
}
catch
(
IllegalArgumentException
e
)
{
// } catch (IllegalArgumentException e) {
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
// return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
// }
//
// String orgId = msg.get("orgId").toString();
//
// Map<String,Object> resultList = pubOrgMapper.getOrgDetail(orgId);
// return new ResponseResult(HttpStatus.SUCCESS, "操作成功", resultList);
// }
public
List
<
OrgTreeDto
>
getOrgList
(
QueryOrgReq
req
)
{
String
selfCode
=
"1369509498032808905"
;
List
<
OrgTreeDto
>
OrgDTOList
=
new
ArrayList
<>();
LambdaQueryWrapper
<
PubOrg
>
wrapper
=
new
LambdaQueryWrapper
<>();
String
setNewCode
=
""
;
List
<
PubOrg
>
orgList
=
new
ArrayList
<>();
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgCode
()))
{
setNewCode
=
req
.
getOrgCode
().
replaceAll
(
"0+$"
,
""
);
}
wrapper
.
eq
(
PubOrg:
:
getStatusFlag
,
1
);
wrapper
.
likeRight
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgCode
()),
PubOrg:
:
getOrgCode
,
setNewCode
);
orgList
=
this
.
list
(
wrapper
);
// 创建一个 Map 来存储机构 ID 和对应的 DTO 对象
Map
<
String
,
OrgTreeDto
>
orgDtoMap
=
new
HashMap
<>();
// 创建一个 Map 来存储父类的 parentid 和对应的父类节点
Map
<
String
,
OrgTreeDto
>
parentDtoMap
=
new
HashMap
<>();
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgCode
())
&&
!
req
.
getOrgCode
().
equals
(
"330000000000"
))
{
LambdaQueryWrapper
<
PubOrg
>
wrapper2
=
new
LambdaQueryWrapper
<>();
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgCode
()))
{
selfCode
=
req
.
getOrgCode
();
}
wrapper2
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getOrgCode
()),
PubOrg:
:
getOrgCode
,
selfCode
);
PubOrg
orgA
=
this
.
getOne
(
wrapper2
);
String
id
=
this
.
getOne
(
wrapper2
).
getOrgId
().
toString
();
selfCode
=
id
;
PubOrg
org
=
this
.
getById
(
Long
.
parseLong
(
id
));
OrgTreeDto
orgDTO
=
new
OrgTreeDto
();
orgDTO
.
setName
(
org
.
getDName
());
orgDTO
.
setCode
(
org
.
getOrgCode
());
orgDTO
.
setType
(
org
.
getOrgType
());
orgDtoMap
.
put
(
org
.
getOrgId
().
toString
(),
orgDTO
);
}
}
String
orgId
=
msg
.
get
(
"orgId"
).
toString
();
// 第一轮遍历:创建 OrgTreeDto 对象并将其加入到 Map 中
for
(
PubOrg
org
:
orgList
)
{
OrgTreeDto
orgDTO
=
new
OrgTreeDto
();
orgDTO
.
setName
(
org
.
getDName
());
orgDTO
.
setCode
(
org
.
getOrgCode
());
orgDTO
.
setType
(
org
.
getOrgType
());
orgDtoMap
.
put
(
org
.
getOrgId
().
toString
(),
orgDTO
);
Map
<
String
,
Object
>
resultList
=
pubOrgMapper
.
getOrgDetail
(
orgId
);
// 如果 parentid 是传进来的值,则将其作为顶级节点添加到 OrgDTOList 中
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
"操作成功"
,
resultList
);
if
(
org
.
getOrgId
().
toString
().
equals
(
selfCode
))
{
OrgDTOList
.
add
(
orgDTO
);
}
}
// 第二轮遍历:将子节点连接到父节点或添加为顶级节点
boolean
isStartAddingChildren
=
false
;
for
(
PubOrg
org
:
orgList
)
{
String
parentId
=
org
.
getOrgParentId
().
toString
();
OrgTreeDto
orgDTO
=
orgDtoMap
.
get
(
org
.
getOrgId
().
toString
());
// 如果找到传入的ID对应的节点,则开始添加子节点
if
(
org
.
getOrgId
().
toString
().
equals
(
selfCode
))
{
isStartAddingChildren
=
true
;
}
// 如果 isStartAddingChildren 为 true,并且 parentDtoMap 中有对应的父类节点,则将节点连接到父节点
if
(
isStartAddingChildren
&&
parentDtoMap
.
containsKey
(
parentId
))
{
OrgTreeDto
parentDto
=
parentDtoMap
.
get
(
parentId
);
parentDto
.
addChild
(
orgDTO
);
}
// 将当前节点添加到 parentDtoMap 中,以便后续节点连接
parentDtoMap
.
put
(
org
.
getOrgId
().
toString
(),
orgDTO
);
}
return
OrgDTOList
;
}
}
@Override
@Override
public
ResponseResult
changeOrgState
(
OrgUpdateReq
req
)
{
public
ResponseResult
changeOrgState
(
OrgUpdateReq
req
)
{
LambdaQueryWrapper
<
PubOrg
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PubOrg
>
wrapper
=
new
LambdaQueryWrapper
<>();
// wrapper.in(ObjectUtil.isNotEmpty(req.getOrgIdList()), PubOrg::getOrgId, req.getOrgIdList());
// PubOrg entity = this.list(req);
// BeanPlusUtil.copyProperties(req, entity);
// return this.updateById(entity);
// List<String> orgIdList = (List<String>) msg.get("orgIdList");
// Integer statusFlag = (Integer) msg.get("statusFlag");
// pubOrgMapper.changeOrgState(statusFlag,orgIdList);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
}
...
@@ -474,15 +474,6 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
...
@@ -474,15 +474,6 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
return
wrapper
;
return
wrapper
;
}
}
// //根据业务编码查询
// wrapper.eq(ObjectUtil.isNotEmpty(req.getProductCode()), ProductTag::getProductCode, req.getProductCode());
// wrapper.eq(ObjectUtil.isNotEmpty(req.getTagUid()), ProductTag::getTagUid, req.getTagUid());
// wrapper.eq(ObjectUtil.isNotEmpty(req.getBatchId()), ProductTag::getBatchId, req.getBatchId());
// wrapper.eq(ObjectUtil.isNotEmpty(req.getTagId()), ProductTag::getTagId, req.getTagId());
//
//
// wrapper.eq(ProductTag::getHasInit, true);
// wrapper.orderByDesc(ProductTag::getCheckTime);
return
wrapper
;
return
wrapper
;
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/SupplierServiceImpl.java
View file @
ce565ede
...
@@ -27,6 +27,7 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
...
@@ -27,6 +27,7 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
@Override
@Override
public
boolean
AddSupplier
(
UpdateSupplierReq
req
)
{
public
boolean
AddSupplier
(
UpdateSupplierReq
req
)
{
Supplier
supplier
=
new
Supplier
();
Supplier
supplier
=
new
Supplier
();
req
.
setId
(
UUID
.
randomUUID
().
toString
());
BeanPlusUtil
.
copyProperties
(
req
,
supplier
);
BeanPlusUtil
.
copyProperties
(
req
,
supplier
);
return
this
.
save
(
supplier
);
return
this
.
save
(
supplier
);
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/WarehouseServiceImpl.java
View file @
ce565ede
...
@@ -49,69 +49,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -49,69 +49,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
private
static
final
String
REDIS_WAREHOUSE
=
"Warehouse_"
;
private
static
final
String
REDIS_WAREHOUSE
=
"Warehouse_"
;
//@Override
public
ResponseResult
addWarehouse
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"name"
),
"name不能为空"
);
checkNotBlank
(
msg
.
get
(
"orgId"
),
"orgId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//查询传入的组织机构id是否存在
Long
onePubOrg
=
pubOrgMapper
.
getOnePubOrg
(
msg
.
get
(
"orgId"
).
toString
());
if
(
onePubOrg
==
null
||
onePubOrg
.
equals
(
""
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"该组织机构不存在"
);
}
Warehouse
warehouse
=
new
Warehouse
();
//将警员相关信息添加到警员表
//生成一个uuid
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
warehouse
.
setId
(
uuid
);
warehouse
.
setCreateTime
(
currentDate
);
warehouse
.
setUpdateTime
(
currentDate
);
warehouse
.
setName
((
String
)
msg
.
get
(
"name"
));
//warehouse.setUpdateUser((String) msg.get("updateUser"));
warehouse
.
setLocation
((
String
)
msg
.
get
(
"location"
));
warehouse
.
setPhone
((
String
)
msg
.
get
(
"phone"
));
warehouse
.
setOrgId
((
String
)
msg
.
get
(
"orgId"
));
warehouse
.
setVideo
((
String
)
msg
.
get
(
"video"
));
warehouseMapper
.
addWarehouse
(
warehouse
);
// 将uuid、创建时间、更新时间加入到policeman中
msg
.
put
(
"id"
,
uuid
);
long
timestamp
=
currentDate
.
getTime
();
// 将Date对象转换为long类型的时间戳
msg
.
put
(
"updateTime"
,
timestamp
);
/**
* 更新缓存
* */
//构建Redis缓存键
String
redisKey
=
REDIS_WAREHOUSE
+
"true"
+
'_'
+
msg
.
get
(
"orgId"
).
toString
();
// 从 Redis 中获取数据
List
<
Map
<
String
,
Object
>>
cachedDataTrue
=
redisUtils
.
findCachedData
(
redisKey
);
if
(
cachedDataTrue
!=
null
)
{
cachedDataTrue
.
add
(
0
,
msg
);
//将查询结果存入 Redis 中
redisUtils
.
set
(
redisKey
,
cachedDataTrue
);
}
//构建Redis缓存键
redisKey
=
REDIS_WAREHOUSE
+
"false"
+
'_'
+
msg
.
get
(
"orgId"
).
toString
();
// 从 Redis 中获取数据
List
<
Map
<
String
,
Object
>>
cachedDataFalse
=
redisUtils
.
findCachedData
(
redisKey
);
if
(
cachedDataFalse
!=
null
)
{
cachedDataFalse
.
add
(
0
,
msg
);
//将查询结果存入 Redis 中
redisUtils
.
set
(
redisKey
,
cachedDataFalse
);
}
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
uuid
);
}
@Override
@Override
public
boolean
addWarehouse
(
WarehouseReq
req
)
{
public
boolean
addWarehouse
(
WarehouseReq
req
)
{
...
@@ -131,36 +68,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -131,36 +68,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
warehouseMsg
;
return
warehouseMsg
;
}
}
//@Override
public
ResponseResult
getOneWarehouse
(
Map
<
String
,
Object
>
id
)
{
try
{
checkNotBlank
(
id
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
String
warehouseId
=
id
.
get
(
"warehouseId"
).
toString
();
Map
<
String
,
Object
>
warehouse
=
warehouseMapper
.
getOneWarehouse
(
warehouseId
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
warehouse
);
}
//@Override
public
ResponseResult
deleteWarehouse
(
Map
<
String
,
Object
>
msg
)
{
// 进行参数校验
try
{
checkNotBlank
(
msg
.
get
(
"warehouseList"
),
"warehouseList不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
List
<
Object
>
warehouseList
=
(
List
<
Object
>)
msg
.
get
(
"warehouseList"
);
for
(
Object
warehouseId:
warehouseList
){
warehouseMapper
.
deleteWarehouse
(
warehouseId
.
toString
());
}
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
@Override
@Override
public
boolean
deleteWarehouse
(
WarehouseReq
req
)
{
public
boolean
deleteWarehouse
(
WarehouseReq
req
)
{
...
@@ -175,40 +82,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -175,40 +82,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
this
.
updateById
(
warehouse
);
return
this
.
updateById
(
warehouse
);
}
}
//@Override
public
ResponseResult
updateWarehouse
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
checkNotBlank
(
msg
.
get
(
"name"
),
"name不能为空"
);
checkNotBlank
(
msg
.
get
(
"orgId"
),
"orgId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//查询传入的组织机构id是否存在
Long
onePubOrg
=
pubOrgMapper
.
getOnePubOrg
(
msg
.
get
(
"orgId"
).
toString
());
if
(
onePubOrg
==
null
||
onePubOrg
.
equals
(
""
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"该组织机构不存在"
);
}
Warehouse
warehouse
=
new
Warehouse
();
//修改警员相关信息
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
warehouse
.
setUpdateTime
(
currentDate
);
//police.setId(uuid);
warehouse
.
setId
((
String
)
msg
.
get
(
"warehouseId"
));
warehouse
.
setName
((
String
)
msg
.
get
(
"name"
));
//warehouse.setUpdateUser((String) msg.get("updateUser"));
warehouse
.
setLocation
((
String
)
msg
.
get
(
"location"
));
warehouse
.
setPhone
((
String
)
msg
.
get
(
"phone"
));
warehouse
.
setOrgId
((
String
)
msg
.
get
(
"orgId"
));
warehouseMapper
.
updateWarehouse
(
warehouse
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
public
List
<
String
>
getSubIds
(
String
id
)
{
public
List
<
String
>
getSubIds
(
String
id
)
{
List
<
String
>
subIds
=
new
ArrayList
<>();
List
<
String
>
subIds
=
new
ArrayList
<>();
...
@@ -222,28 +95,8 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -222,28 +95,8 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
subIds
;
return
subIds
;
}
}
//@Override
public
ResponseResult
changeWarehouseState
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
Objects
.
requireNonNull
(
msg
.
get
(
"state"
),
"state不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
Warehouse
warehouse
=
new
Warehouse
();
warehouse
.
setId
(
msg
.
get
(
"warehouseId"
).
toString
());
warehouse
.
setState
((
Integer
)
msg
.
get
(
"state"
));
warehouseMapper
.
changeWarehouseState
(
warehouse
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
@Override
@Override
public
List
<
Warehouse
>
getAllWarehouse
(
WarehouseReq
msg
)
{
public
List
<
Warehouse
>
getAllWarehouse
(
WarehouseReq
msg
)
{
// Warehouse warehouse = new Warehouse();
// BeanPlusUtil.copyProperties(msg, warehouse);
//
List
<
Warehouse
>
allWarehouse
=
new
ArrayList
<>();
List
<
Warehouse
>
allWarehouse
=
new
ArrayList
<>();
//如果组织机构是浙江省公安厅
//如果组织机构是浙江省公安厅
...
@@ -261,10 +114,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -261,10 +114,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
allWarehouse
;
return
allWarehouse
;
}
}
//@Override
public
boolean
addArea
(
WarehouseAreaReq
msg
)
{
return
false
;
}
private
List
<
String
>
getAllOrgId
(
WarehouseReq
msg
)
{
private
List
<
String
>
getAllOrgId
(
WarehouseReq
msg
)
{
List
<
String
>
allOrg
=
new
ArrayList
<>();
List
<
String
>
allOrg
=
new
ArrayList
<>();
...
@@ -287,242 +136,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
...
@@ -287,242 +136,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
return
allWarehouse
;
return
allWarehouse
;
}
}
//@Override
public
ResponseResult
addArea
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"name"
),
"name不能为空"
);
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//查询传入的warehouseId是否存在
Map
<
String
,
Object
>
oneWarehouse
=
warehouseMapper
.
getOneWarehouse
(
msg
.
get
(
"warehouseId"
).
toString
());
if
(
oneWarehouse
==
null
||
oneWarehouse
.
equals
(
""
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"该仓库不存在"
);
}
WarehouseArea
warehouseArea
=
new
WarehouseArea
();
//生成一个uuid
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
warehouseArea
.
setId
(
uuid
);
warehouseArea
.
setCreateTime
(
currentDate
);
warehouseArea
.
setUpdateTime
(
currentDate
);
warehouseArea
.
setAreaName
((
String
)
msg
.
get
(
"name"
));
warehouseArea
.
setWarehouseId
((
String
)
msg
.
get
(
"warehouseId"
));
warehouseArea
.
setPhoto
((
String
)
msg
.
get
(
"photo"
));
areaMapper
.
addArea
(
warehouseArea
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
uuid
);
}
//@Override
public
ResponseResult
updateArea
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"areaId"
),
"areaId不能为空"
);
checkNotBlank
(
msg
.
get
(
"name"
),
"name不能为空"
);
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//查询传入的warehouseId是否存在
Map
<
String
,
Object
>
oneWarehouse
=
warehouseMapper
.
getOneWarehouse
(
msg
.
get
(
"warehouseId"
).
toString
());
if
(
oneWarehouse
==
null
||
oneWarehouse
.
equals
(
""
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"该仓库不存在"
);
}
WarehouseArea
warehouseArea
=
new
WarehouseArea
();
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
warehouseArea
.
setUpdateTime
(
currentDate
);
warehouseArea
.
setId
((
String
)
msg
.
get
(
"areaId"
));
warehouseArea
.
setAreaName
((
String
)
msg
.
get
(
"name"
));
warehouseArea
.
setWarehouseId
((
String
)
msg
.
get
(
"warehouseId"
));
warehouseArea
.
setPhoto
((
String
)
msg
.
get
(
"photo"
));
areaMapper
.
updateArea
(
warehouseArea
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
//@Override
public
ResponseResult
deleteArea
(
Map
<
String
,
Object
>
msg
)
{
// 进行参数校验
try
{
checkNotBlank
(
msg
.
get
(
"areaId"
),
"areaId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
String
areaId
=
msg
.
get
(
"areaId"
).
toString
();
areaMapper
.
deleteArea
(
areaId
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
//@Override
public
ResponseResult
getAreaList
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
Shelf
shelf
=
new
Shelf
();
shelf
.
setWarehouseId
((
String
)
msg
.
get
(
"warehouseId"
));
List
<
Map
<
String
,
Object
>>
areaList
=
areaMapper
.
getAreaList
(
shelf
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
areaList
);
}
//@Override
public
ResponseResult
addShelf
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"shelfName"
),
"shelfName不能为空"
);
checkNotBlank
(
msg
.
get
(
"code"
),
"code不能为空"
);
checkNotBlank
(
msg
.
get
(
"type"
),
"type不能为空"
);
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfRows"
),
"shelfRows不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfColumns"
),
"shelfColumns不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfRanges"
),
"shelfRanges不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
//查询传入的warehouseId是否存在
Map
<
String
,
Object
>
oneWarehouse
=
warehouseMapper
.
getOneWarehouse
(
msg
.
get
(
"warehouseId"
).
toString
());
if
(
oneWarehouse
==
null
||
oneWarehouse
.
equals
(
""
)){
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
"该仓库不存在"
);
}
Shelf
shelf
=
new
Shelf
();
//生成一个uuid
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
shelf
.
setShelfId
(
uuid
);
shelf
.
setCreateTime
(
currentDate
);
shelf
.
setUpdateTime
(
currentDate
);
shelf
.
setShelfName
((
String
)
msg
.
get
(
"shelfName"
));
shelf
.
setCode
((
String
)
msg
.
get
(
"code"
));
shelf
.
setType
((
String
)
msg
.
get
(
"type"
));
shelf
.
setWarehouseId
((
String
)
msg
.
get
(
"warehouseId"
));
shelf
.
setShelfRows
((
Integer
)
msg
.
get
(
"shelfRows"
));
shelf
.
setShelfColumns
((
Integer
)
msg
.
get
(
"shelfColumns"
));
shelf
.
setShelfRanges
((
Integer
)
msg
.
get
(
"shelfRanges"
));
shelf
.
setUrl
((
String
)
msg
.
get
(
"url"
));
shelf
.
setSizeInfo
((
String
)
msg
.
get
(
"sizeInfo"
));
shelfMapper
.
addShelf
(
shelf
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
uuid
);
}
//@Override
public
ResponseResult
updateShelf
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"shelfId"
),
"shelfId不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfName"
),
"shelfName不能为空"
);
checkNotBlank
(
msg
.
get
(
"code"
),
"code不能为空"
);
checkNotBlank
(
msg
.
get
(
"type"
),
"type不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfRows"
),
"shelfRows不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfColumns"
),
"shelfColumns不能为空"
);
checkNotBlank
(
msg
.
get
(
"shelfRanges"
),
"shelfRanges不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
Shelf
shelf
=
new
Shelf
();
//生成一个uuid
//生成当前时间
Date
currentDate
=
DateTimeUtil
.
getCurrentDateTime
();
shelf
.
setUpdateTime
(
currentDate
);
shelf
.
setShelfId
((
String
)
msg
.
get
(
"shelfId"
));
shelf
.
setShelfName
((
String
)
msg
.
get
(
"shelfName"
));
shelf
.
setCode
((
String
)
msg
.
get
(
"code"
));
shelf
.
setType
((
String
)
msg
.
get
(
"type"
));
shelf
.
setShelfRows
((
Integer
)
msg
.
get
(
"shelfRows"
));
shelf
.
setShelfColumns
((
Integer
)
msg
.
get
(
"shelfColumns"
));
shelf
.
setShelfRanges
((
Integer
)
msg
.
get
(
"shelfRanges"
));
shelf
.
setUrl
((
String
)
msg
.
get
(
"url"
));
shelf
.
setSizeInfo
((
String
)
msg
.
get
(
"sizeInfo"
));
shelfMapper
.
updateShelf
(
shelf
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
//@Override
public
ResponseResult
deleteShelf
(
Map
<
String
,
Object
>
msg
)
{
// 进行参数校验
try
{
checkNotBlank
(
msg
.
get
(
"shelfId"
),
"shelfId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
String
shelfId
=
msg
.
get
(
"shelfId"
).
toString
();
shelfMapper
.
deleteShelf
(
shelfId
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
//@Override
public
ResponseResult
getShelfList
(
Map
<
String
,
Object
>
msg
)
{
try
{
checkNotBlank
(
msg
.
get
(
"warehouseId"
),
"warehouseId不能为空"
);
}
catch
(
IllegalArgumentException
e
)
{
return
new
ResponseResult
(
HttpStatus
.
ERROR
,
ReturnMsg
.
ERROR
,
e
.
getMessage
());
}
Shelf
shelf
=
new
Shelf
();
shelf
.
setWarehouseId
((
String
)
msg
.
get
(
"warehouseId"
));
List
<
Map
<
String
,
Object
>>
areaList
=
shelfMapper
.
getShelfList
(
shelf
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
,
areaList
);
}
@Override
public
List
<
String
>
getAllWarehouseId
(
Map
<
String
,
Object
>
msg
)
{
//如果组织机构是最高级的,获取所有id
if
(
msg
.
get
(
"orgId"
).
toString
().
equals
(
"1369509498032808905"
)){
//构建 Redis 缓存键
String
redisKey
=
"getAllWarehouseId_"
+
msg
.
get
(
"orgId"
);
// 从 Redis 中获取数据
List
<
String
>
cachedData
=
redisUtils
.
findCachedData
(
redisKey
);
if
(
cachedData
!=
null
){
return
cachedData
;
}
List
<
String
>
allWarehouseId
=
warehouseMapper
.
getAllWarehouseIdByHighest
();
//将查询结果存入 Redis 中
redisUtils
.
set
(
redisKey
,
allWarehouseId
);
return
allWarehouseId
;
}
//构建 Redis 缓存键
String
redisKey
=
"getAllWarehouseId_"
+
msg
.
get
(
"IncludeLowerLevel"
)+
'_'
+
msg
.
get
(
"orgId"
);
// 从 Redis 中获取数据
List
<
String
>
cachedData
=
redisUtils
.
findCachedData
(
redisKey
);
if
(
cachedData
!=
null
){
return
cachedData
;
}
List
<
String
>
warehouseId
=
new
ArrayList
<>();
if
(!
msg
.
containsKey
(
"IncludeLowerLevel"
)){
warehouseId
=
warehouseMapper
.
getAllWarehouseId
(
msg
.
get
(
"orgId"
).
toString
());
}
else
if
(
msg
.
get
(
"IncludeLowerLevel"
).
equals
(
"false"
)){
warehouseId
=
warehouseMapper
.
getAllWarehouseId
(
msg
.
get
(
"orgId"
).
toString
());
}
else
{
//warehouseId = warehouseMapper.getAllWarehouseId(msg.get("orgId").toString());
List
<
String
>
orgIds
=
getSubIds
(
msg
.
get
(
"orgId"
).
toString
());
//调用本级及下级的所有组织机构的id
for
(
String
orgId:
orgIds
){
List
<
String
>
allPoliceId
=
warehouseMapper
.
getAllWarehouseId
(
orgId
);
warehouseId
.
addAll
(
allPoliceId
);
}
}
//将查询结果存入 Redis 中
redisUtils
.
set
(
redisKey
,
warehouseId
);
return
warehouseId
;
}
@Override
@Override
public
boolean
changeWarehouseState
(
WarehouseReq
req
)
{
public
boolean
changeWarehouseState
(
WarehouseReq
req
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论