Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
Details
Activity
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
platform
hp-smart
Commits
7cb2ed91
Commit
7cb2ed91
authored
Feb 28, 2024
by
“zhangzhichao_123”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加鸿鹏机械APP接口的目录和部分相关代码
parent
8fef1e5d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
0 deletions
+216
-0
ServiceHPMT001.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
+106
-0
HPMT001.xml
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT001.xml
+110
-0
No files found.
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
0 → 100644
View file @
7cb2ed91
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.zl.domain.HPZL001
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.MapUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 鸿鹏机械APP移动端接口调用处
*/
public
class
ServiceHPMT001
extends
ServiceBase
{
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
return
inInfo
;
}
/**
* 生产管理-整体概览
*
* @param inInfo
* @return
*/
public
EiInfo
pmOverview
(
EiInfo
inInfo
)
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
queryMonth
=
MapUtils
.
getString
(
queryMap
,
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
sqlMap
.
put
(
"companyCode"
,
companyCode
);
List
<
Map
>
row1
=
this
.
dao
.
query
(
"HPMT001.pmOverview1"
,
sqlMap
);
List
<
Map
>
row2
=
this
.
dao
.
query
(
"HPMT001.pmOverview2"
,
sqlMap
);
List
<
Map
>
rows
=
new
ArrayList
<>();
Map
resultMap
=
new
HashMap
();
if
(
BeanUtil
.
isEmpty
(
row1
.
get
(
0
)))
{
resultMap
.
put
(
"targetWt"
,
0
);
}
else
{
resultMap
.
put
(
"targetWt"
,
row1
.
get
(
0
).
get
(
"targetWt"
));
}
if
(
BeanUtil
.
isEmpty
(
row2
.
get
(
0
)))
{
resultMap
.
put
(
"actualWt"
,
0
);
}
else
{
resultMap
.
put
(
"actualWt"
,
row2
.
get
(
0
).
get
(
"actualWt"
));
}
rows
.
add
(
resultMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
return
outInfo
;
}
/**
* 生产管理-基地对标
*
* @param inInfo
* @return
*/
public
EiInfo
pmBenchmarking
(
EiInfo
inInfo
)
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
queryMonth
=
MapUtils
.
getString
(
queryMap
,
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
sqlMap
.
put
(
"companyCode"
,
companyCode
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT001.pmBenchmarking"
,
sqlMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
return
outInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT001.xml
0 → 100644
View file @
7cb2ed91
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HPMT001"
>
<select
id=
"pmOverview1"
resultClass=
"java.util.HashMap"
>
SELECT
CAST(SUM(NUM*UNIT_WT) AS DECIMAL(15,3)) AS targetWt
FROM
hpjx.t_hpsc004
WHERE
PROJ_CODE IN
(
SELECT
PROJ_CODE
FROM
(
SELECT
COMPANY_CODE,
PROJ_CODE,
REPLACE(PLAN_COMPLETION_DATE,'/','') AS PLAN_COMPLETION_DATE
FROM
hpjx.t_hpsc003
WHERE
LENGTH(PLAN_COMPLETION_DATE) > 6
) AS T
WHERE
SUBSTR(PLAN_COMPLETION_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode#
)
</select>
<select
id=
"pmOverview2"
resultClass=
"java.util.HashMap"
>
SELECT
CAST(SUM(AMOUNT*WEIGHT) AS DECIMAL(15,3)) AS actualWt
FROM
hpjx.t_hpkc003
WHERE
SUBSTR(DOCUMENT_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode#
</select>
<select
id=
"pmBenchmarking"
resultClass=
"java.util.HashMap"
>
SELECT
T1.DOCUMENT_DATE,
T1.FACTORY_NAME,
SUM(T1.ACTUAL_TOTAL_AMOUNT) AS ACTUAL_TOTAL_AMOUNT,
SUM(T1.ACTUAL_TOTAL_WT) AS ACTUAL_TOTAL_WT,
SUM(T2.TARGET_TOTAL_WT) AS TARGET_TOTAL_WT
FROM
(
SELECT
SUBSTR(T1.DOCUMENT_DATE,1,6) AS DOCUMENT_DATE,
T1.PROJ_CODE,
T1.PROJ_NAME,
T2.FACTORY_NAME,
SUM(T1.AMOUNT) AS ACTUAL_TOTAL_AMOUNT,
SUM(T1.WEIGHT) AS ACTUAL_TOTAL_WT
FROM
hpjx.t_hpkc003 AS T1
LEFT JOIN
(
SELECT
PROD_ORDER_NO,
FACTORY_NAME
FROM
hpjx.t_hpsc005a
WHERE
COMPANY_CODE = #companyCode#
GROUP BY
PROD_ORDER_NO) AS T2
ON
T1.PROD_ORDER_NO = T2.PROD_ORDER_NO
WHERE
SUBSTR(T1.DOCUMENT_DATE,1,6) = #queryMonth#
GROUP BY
T1.PROJ_CODE ) AS T1
LEFT JOIN
(
SELECT
PROJ_CODE,
CAST(SUM(NUM*UNIT_WT) AS DECIMAL(15,3)) AS TARGET_TOTAL_WT
FROM
hpjx.t_hpsc004
WHERE
PROJ_CODE IN
(
SELECT
PROJ_CODE
FROM
(
SELECT
COMPANY_CODE,
PROJ_CODE,
REPLACE(PLAN_COMPLETION_DATE,'/','') AS PLAN_COMPLETION_DATE
FROM
hpjx.t_hpsc003
WHERE
LENGTH(PLAN_COMPLETION_DATE) > 6) AS T
WHERE
SUBSTR(PLAN_COMPLETION_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode#)
GROUP BY
PROJ_CODE ) AS T2
ON
T1.PROJ_CODE = T2.PROJ_CODE
GROUP BY
T1.FACTORY_NAME
</select>
</sqlMap>
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