Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gavelinfo
kwell-mes
Commits
967fe382
Commit
967fe382
authored
Apr 01, 2022
by
yff
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.gavelinfo.com:gavelinfo/kwell-mes
parents
c0ecc236
3791ee7c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
13 deletions
+126
-13
RestTemplateConfig.java
.../main/java/com/gavel/kwell/config/RestTemplateConfig.java
+39
-0
KmesBoardServiceImpl.java
...va/com/gavel/kwell/service/impl/KmesBoardServiceImpl.java
+39
-11
api.js
gavel/src/main/resources/static/js/dashboard/api.js
+12
-0
first.html
.../main/resources/templates/views/kmes/dashboard/first.html
+2
-1
wosngzinfo.html
...ain/resources/templates/views/kmes/wosngz/wosngzinfo.html
+34
-1
No files found.
gavel/src/main/java/com/gavel/kwell/config/RestTemplateConfig.java
0 → 100644
View file @
967fe382
package
com
.
gavel
.
kwell
.
config
;
import
org.apache.http.conn.HttpClientConnectionManager
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
;
import
org.springframework.web.client.RestTemplate
;
@Configuration
public
class
RestTemplateConfig
{
@Bean
public
HttpClientConnectionManager
poolingConnectionManager
()
{
PoolingHttpClientConnectionManager
poolingConnectionManager
=
new
PoolingHttpClientConnectionManager
();
poolingConnectionManager
.
setMaxTotal
(
1000
);
// 连接池最大连接数
poolingConnectionManager
.
setDefaultMaxPerRoute
(
500
);
// 每个主机的并发
return
poolingConnectionManager
;
}
@Bean
public
HttpClientBuilder
httpClientBuilder
()
{
HttpClientBuilder
httpClientBuilder
=
HttpClientBuilder
.
create
();
//设置HTTP连接管理器
httpClientBuilder
.
setConnectionManager
(
poolingConnectionManager
());
return
httpClientBuilder
;
}
@Bean
(
"restTemplate"
)
public
RestTemplate
restTemplate
(){
HttpComponentsClientHttpRequestFactory
httpRequestFactory
=
new
HttpComponentsClientHttpRequestFactory
();
httpRequestFactory
.
setHttpClient
(
httpClientBuilder
().
build
());
httpRequestFactory
.
setConnectionRequestTimeout
(
3000
);
//获取链接超时时间
httpRequestFactory
.
setConnectTimeout
(
3000
);
//指客户端和服务器建立连接的timeout
httpRequestFactory
.
setReadTimeout
(
120000
);
//读取数据的超时时间
RestTemplate
restTemplate
=
new
RestTemplate
(
httpRequestFactory
);
return
restTemplate
;
}
}
gavel/src/main/java/com/gavel/kwell/service/impl/KmesBoardServiceImpl.java
View file @
967fe382
package
com
.
gavel
.
kwell
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gavel.common.base.service.impl.BaseEditServiceImpl
;
import
com.gavel.common.business.service.CommonService
;
import
com.gavel.common.http.HttpUtils
;
import
com.gavel.common.utils.CollectionUtils
;
import
com.gavel.common.utils.DateUtils
;
import
com.gavel.common.utils.NumberUtils
;
import
com.gavel.common.utils.StringUtils
;
import
com.gavel.common.utils.*
;
import
com.gavel.kwell.dao.GpfkcxDao
;
import
com.gavel.kwell.dao.KmesBoardDao
;
import
com.gavel.kwell.persistent.Gpfkjg
;
...
...
@@ -19,11 +16,14 @@ import com.gavel.wo.persistent.Pcjhmx;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -44,6 +44,9 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
@Autowired
private
CommonService
commonService
;
@Autowired
private
RestTemplate
restTemplate
;
@Override
public
void
initService
(){
}
...
...
@@ -316,15 +319,40 @@ public class KmesBoardServiceImpl extends BaseEditServiceImpl implements KmesBoa
@Override
public
KqtjVO
queryOA
()
{
KqtjVO
kqtjVO
=
new
KqtjVO
();
String
time
=
DateUtils
.
formatDate
(
DateUtils
.
getDateTime
(),
"yyyyMMddHHmmss"
);
String
url
=
"http://oa.kewell.com.cn/api/cube/restful/interface/getModeDataPageList/mes_kqtj"
;
String
param
=
"{\"datajson\":{\"operationinfo\":{\"operator\":\"1\"},\"mainTable\":{},\"pageInfo\":{\"pageNo\":\"1\",\"pageSize\":\"10\"},"
+
"\"header\":{\"systemid\":\"CRM_System\",\"currentDateTime\":\"20200101010101\",\"Md5\":\"c4ca4238a0b923820dcc509a6f75849b\"}}}"
;
StringBuilder
param
=
new
StringBuilder
();
param
.
append
(
"{\"datajson\":{\"operationinfo\":{\"operator\":\"1\"},\"mainTable\":{},\"pageInfo\":{\"pageNo\":\"1\",\"pageSize\":\"10\"},"
);
param
.
append
(
"\"header\":{\"systemid\":\"oa\","
);
param
.
append
(
"\"currentDateTime\":"
).
append
(
"\""
+
time
+
"\""
).
append
(
",\"Md5\":"
).
append
(
"\""
+
MD5Utils
.
md5Hex
(
"oa"
+
"123456"
+
time
)+
"\""
).
append
(
"}}}"
);
try
{
String
response
=
HttpUtils
.
doPost
(
url
,
param
);
if
(
StringUtils
.
isNotEmpty
(
response
)){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
logger
.
info
(
"返回信息:"
+
response
);
}
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
HttpHeaders
.
ACCEPT_CHARSET
,
StandardCharsets
.
UTF_8
.
toString
());
HttpEntity
httpEntity
=
new
HttpEntity
<>(
param
,
headers
);
ResponseEntity
<
String
>
exchange
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
POST
,
httpEntity
,
String
.
class
);
String
body
=
exchange
.
getBody
();
logger
.
info
(
"返回信息:"
+
body
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
body
);
int
ydrs
=
0
;
int
sdrs
=
0
;
if
(
StringUtils
.
isNotEmpty
(
body
)
&&
!
StringUtils
.
equals
(
jsonObject
.
getString
(
"status"
),
"0"
)){
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"result"
);
for
(
int
j
=
0
;
j
<
jsonArray
.
size
();
j
++){
JSONObject
jsonObjectOne
=
jsonArray
.
getJSONObject
(
j
);
Integer
ydrs1
=
jsonObjectOne
.
getJSONObject
(
"mainTable"
).
getInteger
(
"ydrs"
);
Integer
sdrs1
=
jsonObjectOne
.
getJSONObject
(
"mainTable"
).
getInteger
(
"sdrs"
);
if
(
ydrs1
!=
null
){
ydrs
=
ydrs1
;
}
if
(
sdrs1
!=
null
){
sdrs
=
sdrs1
;
}
}
}
kqtjVO
.
setYdrs
(
ydrs
);
kqtjVO
.
setSdrs
(
sdrs
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"错误信息:"
,
e
);
}
...
...
gavel/src/main/resources/static/js/dashboard/api.js
View file @
967fe382
...
...
@@ -255,6 +255,18 @@
}
});
}
/* OA */
function
apiqueryOA
(){
HTTP
.
post
(
"queryOA"
,
{},
function
(
result
)
{
if
(
result
[
'success'
])
{
let
data
=
result
.
data
.
records
||
{}
$
(
"#ydrs"
).
text
(
data
.
ydrs
||
0
)
$
(
"#sdrs"
).
text
(
data
.
ydrs
||
0
)
}
else
{
console
.
log
(
"请求失败"
)
}
});
}
/* pdf */
function
getPdf
(
time
){
pdfshow
(
"getPdf"
,
"gylct"
,
time
||
20000
)
...
...
gavel/src/main/resources/templates/views/kmes/dashboard/first.html
View file @
967fe382
...
...
@@ -71,7 +71,7 @@
<div
class=
"list clearfix"
>
<div
class=
"listTxt"
>
<p><label
for=
""
>
应到人数:
</label><span
id=
"ydrs"
>
20
</span></p>
<p><label
for=
""
>
实际人数:
</label><span
id=
"s
j
rs"
>
20
</span></p>
<p><label
for=
""
>
实际人数:
</label><span
id=
"s
d
rs"
>
20
</span></p>
<p><label
for=
""
>
休假人数:
</label><span
id=
"xjrs"
>
0
</span>
</p>
<p><label
for=
""
>
总生产量:
</label><span
id=
"zscl"
>
0
</span></p>
</div>
...
...
@@ -394,6 +394,7 @@
}
/* 调用 */
function
getAlldata
(){
apiqueryOA
()
apigetscts
(
$
(
"#aqscts"
))
apiCurProZtsl
(
chartTzzp
)
apisetRpcHglEchart
(
chartRpcdcsj
,
'rcl'
)
...
...
gavel/src/main/resources/templates/views/kmes/wosngz/wosngzinfo.html
View file @
967fe382
...
...
@@ -36,7 +36,8 @@
var
tabIndex
=
{
"ZP"
:
0
,
"JY"
:
1
,
"WX"
:
2
"WX"
:
2
,
"JG"
:
3
,
};
var
columns
=
[
...
...
@@ -80,6 +81,7 @@
if
(
rowData
.
bzgxGxlx
){
var
index
=
tabIndex
[
rowData
.
bzgxGxlx
];
$tab
.
tabs
(
"select"
,
index
);
console
.
log
(
index
)
if
(
index
==
0
){
$zpContainer
.
html
(
""
);
$zpContainer
.
append
(
"<div id=
\"
zpList
\"
style=
\"
width: 100%;height: 100%
\"
></div>"
);
...
...
@@ -136,6 +138,36 @@
$wxListContainer
.
append
(
element
);
wx
(
rowData
)
}
else
if
(
index
==
3
){
$
(
"#zpListContainer"
).
html
(
""
);
$
(
"#zpListContainer"
).
append
(
" <div style=
\"
width: 70%;display: inline-block;height: 100%
\"
>"
+
" <div style=
\"
width: 0%;height: 100%
\"
id=
\"
jyList
\"
></div>"
+
" </div>"
+
" <div style=
\"
width: 100%;float:right;height: 100%;
\"
>"
+
" <div style=
\"
width: 100%;height: 0%
\"
id=
\"
jybhgList
\"
></div>"
+
// "
<
div
style
=
\
"width: 100%;height: 100%;border: 1px solid #D3D3D3;position: relative
\"
>"
+
" <div class=
\"\"
style=
\"
width: 50%;height: 50%;border: 1px solid #D3D3D3;;display: inline-block;position: absolute; top:50%;left:50%;transform:translate(-50%,-50%);
\"
>"
+
" <label style=
\"
text-align: left;font-weight: 700;
\"
>反馈结果</label>"
+
" <div id=
\"
ishgs
\"
class=
\"
mx-dataTable hb-text
\"
style=
\"
margin-top: 60px;bottom: 0;border: none;text-align: center
\"
>"
+
" 合格"
+
" </div>"
+
" <div>"
+
// "
<
/div>"
+
" </div>"
+
" <div class=
\"\"
style=
\"
width: 50%;height: 100%;float: right;position: relative
\"
>"
+
" <label style=
\"
text-align: left;font-weight: 700;
\"
>备注</label>"
+
" <div class=
\"
mx-dataTable bz-text
\"
style=
\"
margin-top: 60px;bottom: 0;border: none;text-align: center
\"
>"
+
" </div>"
+
" <div>"
+
" </div>"
+
" </div>"
+
" </div>"
+
" </div>"
);
console
.
log
(
rowData
)
if
(
rowData
.
hgbz
==
"N"
){
$
(
"#ishgs"
).
text
(
"不合格"
)
}
}
}
}
...
...
@@ -190,6 +222,7 @@
}
})
}
/*加工反馈*/
/*检验反馈*/
function
jy
(
rowData
)
{
var
$zpList
=
$
(
"#jyList"
);
var
$topList
=
$
(
"#jybhgList"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment