Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9e5d104a
由
LN
编写于
2023-04-17 14:26:05 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master'
2 个父辈
19775fb0
c889840c
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
70 行增加
和
12 行删除
src/main/java/com/neotel/smfcore/common/utils/QueryHelp.java
src/main/java/com/neotel/smfcore/common/utils/SecurityUtils.java
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
src/main/java/com/neotel/smfcore/core/report/ReportController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialStockController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
src/main/java/com/neotel/smfcore/core/system/rest/bean/query/TaskQueryCondition.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/common/utils/QueryHelp.java
查看文件 @
9e5d104
...
...
@@ -175,4 +175,12 @@ public class QueryHelp {
return
keyword
;
}
public
static
List
<
String
>
getGroupStorageIdList
(
List
<
String
>
storageIdList
)
{
//增加用户所属分组id
if
(
storageIdList
!=
null
&&
!
storageIdList
.
isEmpty
()
&&
!
storageIdList
.
contains
(
"0"
))
{
return
storageIdList
;
}
else
{
return
SecurityUtils
.
getUserGroupStorageId
();
}
}
}
src/main/java/com/neotel/smfcore/common/utils/SecurityUtils.java
查看文件 @
9e5d104
...
...
@@ -166,4 +166,27 @@ public class SecurityUtils {
}
return
resultList
;
}
/**
* 获取当前用户分组对应料仓cid
*
* @return
*/
public
static
List
<
String
>
getUserGroupCid
()
{
List
<
String
>
resultList
=
new
ArrayList
<>();
String
username
=
getLoginUsername
();
User
user
=
userManager
.
findByUserName
(
username
);
List
<
Storage
>
storageList
=
storageManager
.
findAll
();
if
(
user
!=
null
&&
user
.
getGroups
()
!=
null
&&
!
user
.
getGroups
().
isEmpty
())
{
for
(
Storage
storage
:
storageList
)
{
if
(
user
.
getGroups
().
contains
(
storage
.
getGroupId
()))
{
resultList
.
add
(
storage
.
getCid
());
}
}
}
else
{
resultList
=
storageList
.
stream
().
map
(
item
->
item
.
getCid
()).
collect
(
Collectors
.
toList
());
}
return
resultList
;
}
}
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
查看文件 @
9e5d104
...
...
@@ -50,6 +50,11 @@ public class HumitureController {
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
Float
minTemperature
=
msdSettiings
.
getMinTemperature
();
List
<
String
>
cids
=
criteria
.
getCids
();
if
(
cids
==
null
||
cids
.
isEmpty
()){
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
...
...
@@ -80,6 +85,10 @@ public class HumitureController {
}
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
List
<
String
>
cids
=
criteria
.
getCids
();
if
(
cids
==
null
||
cids
.
isEmpty
()){
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
...
...
src/main/java/com/neotel/smfcore/core/report/ReportController.java
查看文件 @
9e5d104
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.neotel.smfcore.common.bean.BetweenData
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inout.service.manager.IInOutDataManager
;
...
...
@@ -169,12 +170,7 @@ public class ReportController {
startDate
=
DateUtil
.
offsetDay
(
endDate
,
-
7
);
}
//增加用户所属分组id
List
<
String
>
storageIdList
;
if
(
query
.
getStorageIdList
()
!=
null
&&
!
query
.
getStorageIdList
().
isEmpty
()
&&
!
query
.
getStorageIdList
().
contains
(
"0"
)){
storageIdList
=
query
.
getStorageIdList
();
}
else
{
storageIdList
=
SecurityUtils
.
getUserGroupStorageId
();
}
List
<
String
>
storageIdList
=
QueryHelp
.
getGroupStorageIdList
(
query
.
getStorageIdList
());
//判断相差小时数,是否超过48小时
long
between
=
DateUtil
.
between
(
startDate
,
endDate
,
DateUnit
.
HOUR
);
List
<
InOutData
>
inOutDataList
=
inOutDataManager
.
findByDate
(
startDate
,
endDate
,
storageIdList
);
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
查看文件 @
9e5d104
...
...
@@ -80,6 +80,7 @@ public class MaterialController {
@GetMapping
(
value
=
"/inventory/download"
)
@PreAuthorize
(
"@el.check('tacticsOuput')"
)
public
void
inventoryDownload
(
HttpServletResponse
response
,
InventoryQueryCriteria
criteria
,
Pageable
pageable
,
Locale
locale
)
throws
IOException
{
criteria
.
setStorageIdList
(
QueryHelp
.
getGroupStorageIdList
(
criteria
.
getStorageIdList
()));
List
<
InventoryItemDto
>
list
=
getInventory
(
criteria
,
pageable
);
String
partNumberStr
=
MessageUtils
.
getText
(
"smfcore.inventory.partNumber"
,
locale
,
"物料编号"
);
...
...
@@ -149,6 +150,7 @@ public class MaterialController {
@GetMapping
(
value
=
"/inventory"
)
@PreAuthorize
(
"@el.check('tacticsOuput')"
)
public
ResponseEntity
<
List
<
InventoryItemDto
>>
inventory
(
InventoryQueryCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
{
criteria
.
setStorageIdList
(
QueryHelp
.
getGroupStorageIdList
(
criteria
.
getStorageIdList
()));
List
<
InventoryItemDto
>
dtoList
=
getInventory
(
criteria
,
pageable
);
return
new
ResponseEntity
<>(
dtoList
,
HttpStatus
.
OK
);
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialStockController.java
查看文件 @
9e5d104
...
...
@@ -217,6 +217,7 @@ public class MaterialStockController {
if
(
criteria
.
getStorageId
()
!=
null
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
criteria
.
setStorageId
(
null
);
}
criteria
.
setStorageIdList
(
QueryHelp
.
getGroupStorageIdList
(
criteria
.
getStorageIdList
()));
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Criteria
baseCriteria
=
Criteria
.
where
(
"used"
).
is
(
true
);
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
查看文件 @
9e5d104
...
...
@@ -158,13 +158,17 @@ public class StorageController {
User
user
=
userManager
.
get
(
userId
);
mygroups
=
user
.
getGroups
();
}
mygroups
.
add
(
""
);
//
mygroups.add("");
List
<
Storage
>
allStorages
=
storageManager
.
findAll
();
List
<
Storage
>
myStorages
=
new
ArrayList
<>();
for
(
Storage
s
:
allStorages
)
{
if
(
mygroups
.
contains
(
s
.
getGroupId
()))
{
if
(
mygroups
!=
null
&&
!
mygroups
.
isEmpty
())
{
if
(
mygroups
.
contains
(
s
.
getGroupId
()))
{
myStorages
.
add
(
s
);
}
}
else
{
myStorages
.
add
(
s
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
9e5d104
...
...
@@ -93,6 +93,7 @@ public class StoragePosController {
if
(
criteria
.
getStorageIdList
()
!=
null
&&
criteria
.
getStorageIdList
().
contains
(
"0"
))
{
criteria
.
setStorageIdList
(
null
);
}
criteria
.
setStorageIdList
(
QueryHelp
.
getGroupStorageIdList
(
criteria
.
getStorageIdList
()));
String
blurry
=
criteria
.
getBlurry
();
if
(!
Strings
.
isNullOrEmpty
(
blurry
)){
//去除库位中的SOxxxx
...
...
@@ -325,6 +326,9 @@ public class StoragePosController {
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getStorageId
())
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
criteria
.
setStorageId
(
null
);
}
criteria
.
setStorageIdList
(
QueryHelp
.
getGroupStorageIdList
(
criteria
.
getStorageIdList
()));
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Criteria
baseCriteria
=
Criteria
.
where
(
"used"
).
is
(
true
);
...
...
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
查看文件 @
9e5d104
...
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager
;
...
...
@@ -84,7 +85,9 @@ public class TaskController {
criteria
.
setStatus
(
null
);
finished
=
true
;
}
if
(
StringUtils
.
isBlank
(
criteria
.
getStorageId
())){
criteria
.
setStorageIdList
(
SecurityUtils
.
getUserGroupStorageId
());
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
if
(
unEnd
)
{
query
.
addCriteria
(
Criteria
.
where
(
"status"
).
nin
(
OP_STATUS
.
END
.
name
(),
OP_STATUS
.
FINISHED
.
name
()));
...
...
src/main/java/com/neotel/smfcore/core/system/rest/bean/query/TaskQueryCondition.java
查看文件 @
9e5d104
...
...
@@ -9,6 +9,7 @@ import lombok.Data;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
@Data
@ApiModel
(
"查询条件"
)
...
...
@@ -37,6 +38,9 @@ public class TaskQueryCondition {
@ApiModelProperty
(
"料仓Id"
)
private
String
storageId
;
@QueryCondition
(
type
=
QueryCondition
.
Type
.
IN
,
propName
=
"storageId"
)
private
List
<
String
>
storageIdList
;
@QueryCondition
@ApiModelProperty
(
"出入库类型"
)
private
Integer
type
;
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
9e5d104
...
...
@@ -1003,9 +1003,13 @@ public class TaskService {
public
synchronized
void
tacticsCheckOut
(
Set
<
TacticsOutDto
>
tacticsOutDtos
)
{
CHECKOUT_TYPE
checkoutType
=
dataCache
.
getCheckOutType
();
List
<
String
>
availableStorageIds
=
dataCache
.
getAvailableStorageIds
();
List
<
String
>
availableStorageIds
;
List
<
String
>
groupStorageId
=
SecurityUtils
.
getUserGroupStorageId
();
if
(
groupStorageId
!=
null
&&
!
groupStorageId
.
isEmpty
()){
availableStorageIds
=
groupStorageId
;
}
else
{
availableStorageIds
=
dataCache
.
getAvailableStorageIds
();
}
//其他出库模式一次性全部生成任务
for
(
TacticsOutDto
item
:
tacticsOutDtos
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论