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
6f4f23a2
Commit
6f4f23a2
authored
Jun 17, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-17 app查询工序月产量
parent
9144122a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
24 deletions
+74
-24
HGSC007.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC007.java
+2
-1
ServiceHGSC007.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
+36
-11
HGSC007.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
+28
-10
HGXSOrg.xml
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
+2
-0
DateUtil.java
src/main/java/com/baosight/hggp/util/DateUtil.java
+6
-2
No files found.
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC007.java
View file @
6f4f23a2
...
...
@@ -115,7 +115,8 @@ public class HGSC007 extends DaoEPBase {
public
static
final
String
UPDATE
=
"HGSC007.update"
;
public
static
final
String
DELETE
=
"HGSC007.delete"
;
public
static
final
String
QUERY_SUM_WT
=
"HGSC007.querySumWt"
;
/*查询累计产量*/
public
static
final
String
QUERY_DAY_WT
=
"HGSC007.queryDayWt"
;
/*查询工序产量*/
public
static
final
String
QUERY_DAY_WT
=
"HGSC007.queryDayWt"
;
/*查询工序日产量*/
public
static
final
String
QUERY_MONTH_WT
=
"HGSC007.queryMonthWt"
;
/*查询工序月产量*/
public
static
final
String
QUERY_PROJ_CODE_WT
=
"HGSC007.queryProjCodeWt"
;
/*查询项目产量*/
private
Long
id
=
new
Long
(
0
);
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007.java
View file @
6f4f23a2
...
...
@@ -22,10 +22,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
...
...
@@ -96,13 +93,12 @@ import java.util.Map;
if
(
CollectionUtils
.
isEmpty
(
orgs
))
{
return
new
ArrayList
<>();
}
for
(
Org
org
:
orgs
)
{
List
<
Map
>
org1
=
DaoBase
.
getInstance
().
query
(
"HGXSOrg.queryFactoryComboBox"
,
new
HashMap
<
String
,
Object
>(){{
put
(
Org
.
FIELD_PARENT_ORG_ID
,
org
.
getOrgId
());
}});
factoryCodes
.
addAll
(
org1
);
for
(
Org
org
:
orgs
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
Org
.
FIELD_ORG_ID
,
org
.
getFactoryCode
());
map
.
put
(
Org
.
FIELD_ORG_CNAME
,
org
.
getFactoryName
());
factoryCodes
.
add
(
map
);
}
}
catch
(
Exception
e
){
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"APP查询工厂失败"
);
...
...
@@ -149,7 +145,7 @@ import java.util.Map;
}
/**
* app查询工序产量
* app查询工序
日
产量
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询工序日产量"
,
operDesc
=
"APP查询工序日产量"
)
public
EiInfo
getProcessDayWt
(
EiInfo
inInfo
)
{
...
...
@@ -157,6 +153,11 @@ import java.util.Map;
EiBlock
queryRow
=
inInfo
.
getBlock
(
EiConstant
.
queryBlock
);
UserVO
userVO
=
HGCWTools
.
HgCw002
.
getUserCompany
();
String
companyCode
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
);
String
endDate
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
ACConstants
.
SQL_END_DATE
);
if
(
StringUtils
.
isNotEmpty
(
endDate
))
{
String
startDate
=
DateUtil
.
dateSubStr
(
endDate
,-
7
);
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
ACConstants
.
SQL_START_DATE
,
startDate
);
}
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
}
...
...
@@ -168,6 +169,30 @@ import java.util.Map;
}
/**
* app查询工序日产量
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询工序日产量"
,
operDesc
=
"APP查询工序日产量"
)
public
EiInfo
getProcessMonthWt
(
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
);
String
endDate
=
queryRow
.
getCellStr
(
ACConstants
.
ROW_CODE_0
,
ACConstants
.
SQL_END_DATE
);
if
(
StringUtils
.
isNotEmpty
(
endDate
))
{
String
startDate
=
DateUtil
.
getMonthOfDays
(
endDate
,-
6
,
DateUtil
.
DATE8_PATTERN
);
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
ACConstants
.
SQL_START_DATE
,
startDate
);
}
if
(
StringUtils
.
isEmpty
(
companyCode
))
{
queryRow
.
setCell
(
ACConstants
.
ROW_CODE_0
,
HGSC007
.
FIELD_company_code
,
userVO
.
getUsercode
());
}
inInfo
=
super
.
query
(
inInfo
,
HGSC007
.
QUERY_MONTH_WT
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* app查询工序产量
*/
@OperationLogAnnotation
(
operModul
=
"生产任务"
,
operType
=
"APP查询项目产量"
,
operDesc
=
"APP查询项目产量"
)
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC007.xml
View file @
6f4f23a2
...
...
@@ -525,13 +525,13 @@
</update>
<!--查询累计完成重量-->
<select
id=
"querySumWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
<select
id=
"querySumWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
select
a.factoryCode ,
a.factoryName ,
sum(a.dayWt) as dayWt,
sum(a.monthWt) as monthWt,
sum(a.yearWt) as yearWt
sum(a.dayWt) as dayW
eigh
t,
sum(a.monthWt) as monthW
eigh
t,
sum(a.yearWt) as yearW
eigh
t
from (
select
h2.factory_code as factoryCode ,
...
...
@@ -581,7 +581,7 @@
group by a.factoryCode , a.factoryName
</select>
<!--查询工序日产量-->
<select
id=
"queryDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
<select
id=
"queryDayWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
select
h.DEPOSIT_DATE as "completeDate",
h2.factory_code as "factoryCode",
...
...
@@ -593,15 +593,33 @@
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
prepend=
" AND "
property=
"endDate"
>
h.DEPOSIT_DATE between #startDate# and #endDate#
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc
</select>
<!--查询工序月产量-->
<select
id=
"queryMonthWt"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
select
left(h.DEPOSIT_DATE,6) as "completeDate",
h2.factory_code as "factoryCode",
h2.factory_name as "factoryName",
h2.process_code as "processCode",
h2.process_name as "processName",
SUM(h.INV_WEIGHT) "totalWeight"
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=
"endDate"
>
left(h.DEPOSIT_DATE,6) between left(#startDate#,6) and left(#endDate#,6)
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE
de
sc
order by h.DEPOSIT_DATE
a
sc
</select>
<!--项目产量-->
<select
id=
"queryProjCodeWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
com.baosight.hggp.hg.sc.domain.HGSC007POJO
"
>
<select
id=
"queryProjCodeWt"
parameterClass=
"java.util.HashMap"
resultClass=
"
java.util.HashMap
"
>
select
h2.factory_code as factoryCode ,
h2.factory_name as factoryName ,
...
...
src/main/java/com/baosight/hggp/hg/xs/sql/HGXSOrg.xml
View file @
6f4f23a2
...
...
@@ -228,7 +228,9 @@
A.ORG_TYPE AS "orgType",
A.ACCOUNT_CODE AS "accounCcode",
A.FACTORY_CODE AS "factoryCode",
A.FACTORY_NAME AS "factoryName",
A.COMPANY_CODE AS "companyCode",
A.COMPANY_NAME AS "companyName",
A.PARENT_ORG_ID as "parentOrgId"
FROM ${platSchema}.TXSOG01 A, ${platSchema}.TXSOG02 B, ${platSchema}.XS_USER C
WHERE 1=1
...
...
src/main/java/com/baosight/hggp/util/DateUtil.java
View file @
6f4f23a2
...
...
@@ -80,9 +80,13 @@ public class DateUtil {
* @return
*/
public
static
String
getMonthOfDays
(
String
date
){
return
getMonthOfDays
(
date
,
-
1
,
DATE10_PATTERN
);
}
public
static
String
getMonthOfDays
(
String
date
,
int
month
,
String
pattern
){
Calendar
calendar
=
Calendar
.
getInstance
();
//日历对象
calendar
.
setTime
(
Objects
.
requireNonNull
(
DateUtil
.
toDate
(
date
,
DATE10_PATTERN
)));
//设置当前日期
calendar
.
add
(
Calendar
.
MONTH
,
-
1
);
//月份减一
calendar
.
setTime
(
Objects
.
requireNonNull
(
DateUtil
.
toDate
(
date
,
pattern
)));
//设置当前日期
calendar
.
add
(
Calendar
.
MONTH
,
month
);
//月份减一
return
DateUtil
.
toDateStr
(
calendar
.
getTime
(),
DATE8_PATTERN
);
//输出上个月的日期
}
...
...
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