Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
3fd2dbfd
Commit
3fd2dbfd
authored
Oct 18, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-16 添加生产驾驶舱接口
parent
c62da236
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
209 additions
and
0 deletions
+209
-0
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+45
-0
HGSC007.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
+164
-0
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
3fd2dbfd
...
...
@@ -289,4 +289,49 @@ public class ServiceHGSC007 extends ServiceEPBase {
}
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"生产驾驶舱"
,
operType
=
"工序日产量"
,
operDesc
=
"工序日产量"
)
public
EiInfo
getByProcessWt
(
EiInfo
inInfo
)
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
String
depositDate
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
);
if
(
StringUtils
.
isEmpty
(
depositDate
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
,
depositDate
);
}
inInfo
=
super
.
query
(
inInfo
,
"HGSC007.queryByWt"
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"生产驾驶舱"
,
operType
=
"工序累计产量"
,
operDesc
=
"工序累计产量"
)
public
EiInfo
queryBySunWt
(
EiInfo
inInfo
)
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
String
depositDate
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
);
if
(
StringUtils
.
isEmpty
(
depositDate
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
,
depositDate
);
}
inInfo
=
super
.
query
(
inInfo
,
"HGSC007.queryBySunWt"
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"生产驾驶舱"
,
operType
=
"7日综合产量"
,
operDesc
=
"7日综合产量"
)
public
EiInfo
getByProcessDayWt
(
EiInfo
inInfo
)
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
String
depositDate
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
);
if
(
StringUtils
.
isEmpty
(
depositDate
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
"depositDate"
,
depositDate
);
}
inInfo
=
super
.
query
(
inInfo
,
"HGSC007.queryByDayWt"
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
3fd2dbfd
...
...
@@ -1043,4 +1043,168 @@
group by a.proj_code, a.proj_name, a.finish_date, a.updated_time
order by a.updated_time desc
</select>
<!--工序日产量-->
<select
id=
"queryByWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
A.process_name as "processName",
ROUND(ifnull(SUM(B.INV_WEIGHT),0)/1000, 4) "totalWeight"
from ${hggpSchema}.HGGY001 A
join ${platSchema}.TXSOG01 C on A.FACTORY_CODE = C.COMPANY_CODE
left join (
select
h2.process_code ,
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
A.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
C.factory_name = #factoryName#
</isNotEmpty>
group by
A.process_name
</select>
<!--工序累计产量-->
<select
id=
"queryBySunWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
A.process_name as "processName",
ROUND(ifnull(SUM(B.INV_WEIGHT),0)/1000, 4) "totalWeight"
from ${hggpSchema}.HGGY001 A
join ${platSchema}.TXSOG01 C on A.FACTORY_CODE = C.COMPANY_CODE
left join (
select
h2.process_code ,
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
left(h.DEPOSIT_DATE,6) = left(#depositDate#,6)
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
A.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
C.factory_name = #factoryName#
</isNotEmpty>
group by
A.process_name
</select>
<!--日期到条件7天日产量-->
<select
id=
"queryByDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
A.DEPOSIT_DATE as "depositDate",
ROUND(ifnull(SUM(A.INV_WEIGHT),0)/1000, 4) "totalWeight"
from (
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 6 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 6 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 5 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 5 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 4 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 4 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 3 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 3 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 2 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 2 day), '-', '')
</isNotEmpty>
UNION ALL
select
replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 1 day), '-', '') as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = replace(date_sub(str_to_date(#depositDate#, '%Y%m%d'), interval 1 day), '-', '')
</isNotEmpty>
UNION ALL
select
#depositDate# as "DEPOSIT_DATE",
ROUND(ifnull(SUM(h.INV_WEIGHT), 0)/ 1000, 4) "INV_WEIGHT"
from ${hggpSchema}.hgkc003 h
inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1
and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include
refid=
"appCondition"
/>
<include
refid=
"appOrderCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
) A
group by A.DEPOSIT_DATE
</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