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
d2b7bf38
Commit
d2b7bf38
authored
Jun 17, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-17 app查询工序产量
parent
44261c77
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
149 deletions
+163
-149
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+55
-23
HGSC007.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
+108
-126
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
d2b7bf38
...
@@ -111,48 +111,80 @@ import java.util.Map;
...
@@ -111,48 +111,80 @@ import java.util.Map;
}
}
/**
/**
* app查询工序累计产量
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询工序累计产量"
,
operDesc
=
"APP查询工序累计产量"
)
public
EiInfo
getProcessSumWt
(
EiInfo
inInfo
)
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
String
companyCode
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
);
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
}
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY_SUM_WT
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* app查询工序产量
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询工序产量"
,
operDesc
=
"APP查询工序产量"
)
public
EiInfo
getProcessWt
(
EiInfo
inInfo
)
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
String
companyCode
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
);
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
}
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY_DAY_WT
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* app查询工序产量
* app查询工序产量
*/
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询产量"
,
operDesc
=
"APP查询产量"
)
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询工序日产量"
,
operDesc
=
"APP查询工序日产量"
)
public
Map
<
String
,
List
>
getWt
(
EiInfo
inInfo
)
{
public
EiInfo
getProcessDayWt
(
EiInfo
inInfo
)
{
Map
<
String
,
List
>
map
=
new
HashMap
<>();
try
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
companyCode
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
);
Object
companyCode
=
queryRow
.
get
(
HGSC007
.
FIELD_company_code
);
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
if
(
companyCode
==
null
)
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
queryRow
.
put
(
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
}
//queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY_DAY_WT
);
}
List
sumList
=
DaoBase
.
getInstance
().
query
(
HGSC007
.
QUERY_SUM_WT
,
queryRow
);
List
dayList
=
DaoBase
.
getInstance
().
query
(
HGSC007
.
QUERY_DAY_WT
,
queryRow
);
map
.
put
(
"sumList"
,
sumList
);
map
.
put
(
"dayList"
,
dayList
);
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
return
map
;
return
inInfo
;
}
}
/**
/**
* app查询工序产量
* app查询工序产量
*/
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询项目产量"
,
operDesc
=
"APP查询项目产量"
)
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询项目产量"
,
operDesc
=
"APP查询项目产量"
)
public
List
getProjCodeWt
(
EiInfo
inInfo
)
{
public
EiInfo
getProjCodeWt
(
EiInfo
inInfo
)
{
List
sumList
=
null
;
try
{
try
{
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
//Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Object
companyCode
=
queryRow
.
get
(
HGSC007
.
FIELD_company_code
);
String
companyCode
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
);
if
(
companyCode
==
null
)
{
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
queryRow
.
put
(
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
//queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
}
}
sumList
=
DaoBase
.
getInstance
().
query
(
HGSC007
.
QUERY_PROJ_CODE_WT
,
queryRow
);
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY_PROJ_CODE_WT
);
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
return
sumList
;
return
inInfo
;
}
}
}
}
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
d2b7bf38
...
@@ -185,6 +185,43 @@
...
@@ -185,6 +185,43 @@
</isEqual>
</isEqual>
</sql>
</sql>
<sql
id=
"appCondition"
>
<!-- 无权限时使用 -->
<isNotEmpty
prepend=
" AND "
property=
"authDepCode"
>
h.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
(h.CREATED_BY = #authOnlyPeople# OR h.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
<isNotEmpty
property=
"authOnlyPeople"
>
h.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty
property=
"authDepCodes"
>
h.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql
id=
"appOrderCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
h.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
h.company_code = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
h2.factory_name = #factoryName#
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC007"
>
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC007"
>
SELECT
SELECT
...
@@ -488,7 +525,7 @@
...
@@ -488,7 +525,7 @@
</update>
</update>
<!--查询累计完成重量-->
<!--查询累计完成重量-->
<select
id=
"querySumWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
<select
id=
"querySumWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
select
select
a.factoryCode ,
a.factoryCode ,
a.factoryName ,
a.factoryName ,
...
@@ -497,159 +534,104 @@
...
@@ -497,159 +534,104 @@
sum(a.yearWt) as yearWt
sum(a.yearWt) as yearWt
from (
from (
select
select
factory_code as factoryCode ,
h2.
factory_code as factoryCode ,
factory_name as factoryName ,
h2.
factory_name as factoryName ,
0 as dayWt,
0 as dayWt,
0 as monthWt,
0 as monthWt,
sum(finish_weight) as yearWt
sum(h.finish_weight) as yearWt
from hggp.hgsc007 where 1 = 1 and left(created_time,4) = LEFT(#createdTime#,4)
from ${hggpSchema}.hgkc003 h inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
<include
refid=
"HGXSDataAuth.authCondition"
/>
where 1 = 1 and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
<include
refid=
"appCondition"
/>
account_code = #accountCode#
<include
refid=
"appOrderCondition"
/>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
LEFT(h.DEPOSIT_DATE,4) = LEFT(#depositDate#,4)
company_code = #companyCode#
</isNotEmpty>
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
company_name = #companyName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
factory_name = #factoryName#
</isNotEmpty>
group by factory_code , factory_name
union all
union all
select
select
factory_code as factoryCode ,
h2.
factory_code as factoryCode ,
factory_name as factoryName ,
h2.
factory_name as factoryName ,
0 as dayWt,
0 as dayWt,
sum(finish_weight) as monthWt,
sum(
h.
finish_weight) as monthWt,
0 as yearWt
0 as yearWt
from hggp.hgsc007 where 1 = 1 and left(created_time,6) = LEFT(#createdTime#,6)
from ${hggpSchema}.hgkc003 h inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
<include
refid=
"HGXSDataAuth.authCondition"
/>
where 1 = 1 and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
<include
refid=
"appCondition"
/>
account_code = #accountCode#
<include
refid=
"appOrderCondition"
/>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
LEFT(h.DEPOSIT_DATE,6) = LEFT(#depositDate#,6)
company_code = #companyCode#
</isNotEmpty>
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
company_name = #companyName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
factory_name = #factoryName#
</isNotEmpty>
group by factory_code , factory_name
union all
union all
select
select
factory_code as factoryCode ,
h2.
factory_code as factoryCode ,
factory_name as factoryName ,
h2.
factory_name as factoryName ,
sum(finish_weight) as dayWt,
sum(
h.
finish_weight) as dayWt,
0 as monthWt,
0 as monthWt,
0 as yearWt
0 as yearWt
from hggp.hgsc007 where 1 = 1 and left(created_time,8) = LEFT(#createdTime#,8)
from ${hggpSchema}.hgkc003 h inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
<include
refid=
"HGXSDataAuth.authCondition"
/>
where 1 = 1 and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
<include
refid=
"appCondition"
/>
account_code = #accountCode#
<include
refid=
"appOrderCondition"
/>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
LEFT(h.DEPOSIT_DATE,8) = LEFT(#depositDate#,8)
company_code = #companyCode#
</isNotEmpty>
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
company_name = #companyName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
factory_name = #factoryName#
</isNotEmpty>
group by factory_code , factory_name
) a
) a
group by a.factoryCode , a.factoryName
group by a.factoryCode , a.factoryName
</select>
</select>
<!--查询工序日产量-->
<!--查询工序日产量-->
<select
id=
"queryDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
<select
id=
"queryDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
select
select
factory_code as factoryCode ,
h.DEPOSIT_DATE as "completeDate",
factory_name as factoryName ,
h2.factory_code as "factoryCode",
process_code as processCode ,
h2.factory_name as "factoryName",
process_name as processName ,
h2.process_code as "processCode",
sum(finish_weight) finishWeight
h2.process_name as "processName",
from hggp.HGSC007
SUM(h.INV_WEIGHT) "totalWeight"
where 1 = 1 and left(created_time,8) = #createdTime#
from ${hggpSchema}.hgkc003 h inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
<include
refid=
"HGXSDataAuth.authCondition"
/>
where 1 = 1 and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
<include
refid=
"appCondition"
/>
account_code = #accountCode#
<include
refid=
"appOrderCondition"
/>
</isNotEmpty>
<!-- 入库日期-->
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
<isNotEmpty
prepend=
" AND "
property=
"depositDate"
>
company_code = #companyCode#
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
company_name = #companyName#
order by h.DEPOSIT_DATE desc
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
factory_name = #factoryName#
</isNotEmpty>
group by factory_code , factory_name , process_code , process_name;
</select>
</select>
<!--项目产量-->
<select
id=
"queryProjCodeWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
<select
id=
"queryProjCodeWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
select
select
b
.factory_code as factoryCode ,
h2
.factory_code as factoryCode ,
b
.factory_name as factoryName ,
h2
.factory_name as factoryName ,
a
.proj_code as projCode,
h
.proj_code as projCode,
a
.proj_name as projName,
h
.proj_name as projName,
a.plan_end_date as planEnd
Date,
h.finish_date as complete
Date,
sum(
a
.total_weight) as totalWeight,
sum(
h
.total_weight) as totalWeight,
sum(
a
.finish_weight) as finishWeight
sum(
h
.finish_weight) as finishWeight
from
hggp.HGSC005a a inner join hggp.HGSC007 b on a.id = b
.order_detail_id
from
${hggpSchema}.HGSC005a h inner join ${hggpSchema}.HGSC007 h2 on h.id = h2
.order_detail_id
where 1 = 1
where 1 = 1
<include
refid=
"appCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
a
.account_code = #accountCode#
h
.account_code = #accountCode#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
a
.company_code = #companyCode#
h
.company_code = #companyCode#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
a
.company_name = #companyName#
h
.company_name = #companyName#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
b
.factory_code = #factoryCode#
h2
.factory_code = #factoryCode#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
b.factory_name = #factoryName#
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"planEndDate"
>
a.plan_end_date = #planEndDate#
</isNotEmpty>
</isNotEmpty>
<!-- 无权限时使用 -->
<isNotEmpty
prepend=
" AND "
property=
"finishDate"
>
<isNotEmpty
prepend=
" AND "
property=
"authDepCode"
>
h.finish_date = #finishDate#
a.DEP_CODE = #authDepCode#
</isNotEmpty>
</isNotEmpty>
<!-- 仅本人和部门组合 -->
group by h2.factory_code, h2.factory_name, h.proj_code, h.proj_name, h.finish_date
<isEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
order by h.finish_date desc
(a.CREATED_BY = #authOnlyPeople# OR a.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual
prepend=
" AND "
property=
"authCombination"
compareValue=
"1"
>
<isNotEmpty
property=
"authOnlyPeople"
>
a.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty
property=
"authDepCodes"
>
a.DEP_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"authDepCodes"
>
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
group by b.factory_code , b.factory_name , a.proj_code , a.proj_name, a.plan_end_date
</select>
</select>
</sqlMap>
</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