Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
e8a606b6
由
sonin
编写于
2025-04-25 17:11:11 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
水厂运营分析 工单统计
1 个父辈
34423309
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
44 行增加
和
1 行删除
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/controller/FactoryOperateCenterController.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/controller/FactoryOperateCenterController.java
查看文件 @
e8a606b
package
com
.
skua
.
modules
.
dataAnalysis
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.skua.common.constant.BusinessConstant
;
import
com.skua.core.api.vo.Result
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.modules.dataAnalysis.service.IFactoryCenterService
;
import
com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService
;
import
com.skua.modules.dataAnalysis.vo.*
;
import
com.skua.modules.flow.business.service.FlowBusinessService
;
import
com.skua.modules.flow.core.entity.BladeFlow
;
import
com.skua.modules.flow.support.Condition
;
import
com.skua.modules.flow.support.Query
;
import
com.skua.tool.util.DateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -25,6 +34,9 @@ public class FactoryOperateCenterController {
@Autowired
private
IFactoryOperateCenterService
factoryOperateCenterService
;
@Autowired
private
FlowBusinessService
flowBusinessService
;
@ApiOperation
(
value
=
"厂区统计数据"
,
notes
=
"厂区统计数据"
)
@GetMapping
(
value
=
"/getData"
)
public
Result
<
Map
<
String
,
Object
>>
getData
(
String
departId
,
String
month
)
{
...
...
@@ -100,8 +112,39 @@ public class FactoryOperateCenterController {
@GetMapping
(
value
=
"/flow"
)
public
Result
<
Map
<
String
,
Object
>>
getFlowData
(
String
departId
,
String
month
)
{
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
map
=
factoryOperateCenterService
.
getFlowData
(
departId
,
month
);
// Map<String,Object> map = factoryOperateCenterService.getFlowData(departId,month);
WorkAnalysisController
workAnalysisController
=
(
WorkAnalysisController
)
SpringContextUtils
.
getBean
(
WorkAnalysisController
.
class
);
int
days
=
DateUtils
.
lengthOfSomeMonth
(
Integer
.
parseInt
(
month
.
split
(
"-"
)[
0
]),
Integer
.
parseInt
(
month
.
split
(
"-"
)[
1
]));
String
startTime
=
month
+
"-01"
+
BusinessConstant
.
startTimeSuffix
;
String
endTime
=
month
+
"-"
+
days
+
BusinessConstant
.
endTimeSuffix
;
Result
<
List
<
ProcessProgressVO
>>
voResult
=
workAnalysisController
.
analysisByProcessProgress
(
1
,
departId
,
1
,
startTime
.
substring
(
0
,
10
),
endTime
.
substring
(
0
,
10
));
int
ing
=
0
,
no
=
0
,
yes
=
0
,
total
=
0
;
if
(!
voResult
.
getResult
().
isEmpty
())
{
Map
<
String
,
Object
>
tmpMap
=
BeanUtil
.
beanToMap
(
voResult
.
getResult
().
get
(
0
),
false
,
true
);
for
(
String
key:
tmpMap
.
keySet
())
{
if
(
key
.
endsWith
(
"TotalNum"
))
{
total
+=
Integer
.
parseInt
(
tmpMap
.
get
(
key
).
toString
());
}
else
if
(
key
.
endsWith
(
"HandleNum"
))
{
yes
+=
Integer
.
parseInt
(
tmpMap
.
get
(
key
).
toString
());
}
}
}
// 查询工作流待签收
BladeFlow
bladeFlow
=
new
BladeFlow
();
bladeFlow
.
setBeginDate
(
DateUtils
.
strToDate
(
startTime
,
BusinessConstant
.
dateFormat
));
bladeFlow
.
setEndDate
(
DateUtils
.
strToDate
(
endTime
,
BusinessConstant
.
dateFormat
));
Query
query
=
new
Query
();
query
.
setCurrent
(
1
);
query
.
setSize
(
10000
);
IPage
<
BladeFlow
>
claimPage
=
this
.
flowBusinessService
.
selectClaimPage
(
Condition
.
getPage
(
query
),
bladeFlow
);
no
=
claimPage
.
getRecords
().
size
();
result
.
setSuccess
(
true
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"no"
,
no
);
map
.
put
(
"ing"
,
total
-
yes
-
no
);
map
.
put
(
"yes"
,
yes
);
map
.
put
(
"total"
,
total
);
result
.
setResult
(
map
);
return
result
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论