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
96de65f8
Commit
96de65f8
authored
Jul 06, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产副品制造成本核算dev
parent
a2f7702f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
0 deletions
+94
-0
HGCB005.java
src/main/java/com/baosight/hggp/hg/cb/domain/HGCB005.java
+0
-0
HGCB005.xml
src/main/java/com/baosight/hggp/hg/cb/sql/HGCB005.xml
+0
-0
HGCBTools.java
src/main/java/com/baosight/hggp/hg/cb/tools/HGCBTools.java
+78
-0
HGKC003.xml
src/main/java/com/baosight/hggp/hg/kc/sql/HGKC003.xml
+6
-0
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+10
-0
No files found.
src/main/java/com/baosight/hggp/hg/cb/domain/HGCB005.java
0 → 100644
View file @
96de65f8
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/cb/sql/HGCB005.xml
0 → 100644
View file @
96de65f8
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/cb/tools/HGCBTools.java
View file @
96de65f8
...
@@ -11,7 +11,9 @@ import com.baosight.hggp.hg.cb.domain.HGCB001;
...
@@ -11,7 +11,9 @@ import com.baosight.hggp.hg.cb.domain.HGCB001;
import
com.baosight.hggp.hg.cb.domain.HGCB002
;
import
com.baosight.hggp.hg.cb.domain.HGCB002
;
import
com.baosight.hggp.hg.cb.domain.HGCB003
;
import
com.baosight.hggp.hg.cb.domain.HGCB003
;
import
com.baosight.hggp.hg.cb.domain.HGCB004
;
import
com.baosight.hggp.hg.cb.domain.HGCB004
;
import
com.baosight.hggp.hg.cb.domain.HGCB005
;
import
com.baosight.hggp.hg.cg.domain.HGCG003
;
import
com.baosight.hggp.hg.cg.domain.HGCG003
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.cw.domain.HGCW001
;
import
com.baosight.hggp.hg.cw.domain.HGCW001
;
import
com.baosight.hggp.hg.cw.domain.HGCW012
;
import
com.baosight.hggp.hg.cw.domain.HGCW012
;
...
@@ -19,9 +21,11 @@ import com.baosight.hggp.hg.cw.domain.HGCW012A;
...
@@ -19,9 +21,11 @@ import com.baosight.hggp.hg.cw.domain.HGCW012A;
import
com.baosight.hggp.hg.cw.domain.HGCW013
;
import
com.baosight.hggp.hg.cw.domain.HGCW013
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.kc.domain.*
;
import
com.baosight.hggp.hg.kc.domain.*
;
import
com.baosight.hggp.hg.kc.tools.HGKCTools
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ007
;
import
com.baosight.hggp.hg.pz.domain.HGPZ007
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC005A
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
@@ -29,6 +33,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
...
@@ -29,6 +33,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
...
@@ -613,4 +618,77 @@ public class HGCBTools {
...
@@ -613,4 +618,77 @@ public class HGCBTools {
hgcb004
.
fromMap
(
hgcb002
.
toMap
());
hgcb004
.
fromMap
(
hgcb002
.
toMap
());
}
}
}
}
public
static
class
THGCB005
{
/**
* 同步数据
*
* @return
*/
public
static
void
synchData
()
{
HGCW001
hgcw001
=
new
HGCW001
();
//通过业务账期信息查询入库单
Map
kc003ParamMap
=
new
HashMap
();
kc003ParamMap
.
put
(
HGKC003
.
FIELD_DELETE_FLAG
,
CommonConstant
.
YesNo
.
NO_0
);
kc003ParamMap
.
put
(
HGKC003
.
FIELD_COMPANY_CODE
,
hgcw001
.
getCompanyCode
());
kc003ParamMap
.
put
(
HGKC003
.
FIELD_STORAGE_TYPE
,
HGConstant
.
StorageType
.
RK
);
kc003ParamMap
.
put
(
HGKC003
.
FIELD_IS_RETURN
,
CommonConstant
.
YesNo
.
NO_0
);
kc003ParamMap
.
put
(
HGCW001
.
FIELD_ACCOUNT_PERIOD_DATE_START
,
hgcw001
.
getAccountPeriodDateStart
());
kc003ParamMap
.
put
(
HGCW001
.
FIELD_ACCOUNT_PERIOD_DATE_END
,
hgcw001
.
getAccountPeriodDateEnd
());
List
<
HGKC003
>
hgkc003List
=
HGKCTools
.
HgKc003
.
list
(
kc003ParamMap
);
//入库单按项目编码、产品编码、存货工序ID、规格、单重分组,分别取正向入库单数量、重量和退回数量
//生成制造成本基础数据
List
<
HGCB005
>
hgcb005List
=
constractHGCB005
(
hgcw001
,
hgkc003List
);
//通过存货工序ID查询工序权重
List
<
Long
>
processIds
=
Optional
.
ofNullable
(
hgcb005List
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
HGCB005:
:
getInventProcessId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
processIds
)){
List
<
HGPZ005
>
hgpz005List
=
HGPZTools
.
HgPz005
.
getIds
(
processIds
);
Map
<
Long
,
HGPZ005
>
hgpz005Map
=
Optional
.
ofNullable
(
hgpz005List
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005:
:
getId
,
o
->
o
,
(
o1
,
o2
)->
o1
));
}
//通过业务账期信息查询类型为分摊的费用归集数据,按项目分组金额求和
//计算成本:入库重量*工序权重=产副品权重,SUM(产副品权重)=项目权重,产副品权重/项目权重*总费用=产副品制造总成本
}
}
private
static
List
<
HGCB005
>
constractHGCB005
(
HGCW001
hgcw001
,
List
<
HGKC003
>
hgkc003List
){
List
<
HGCB005
>
hgcb005List
=
Optional
.
ofNullable
(
hgkc003List
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
toMap
(
o
->
o
.
getProjCode
()+
"-"
+
o
.
getPrdtCode
()+
"-"
+
o
.
getInventProcessId
()+
"-"
+
o
.
getPrdtSpec
()+
"-"
+
o
.
getInvUnitWeight
(),
o
->
o
,(
v1
,
v2
)->{
HGKC003
kc003
=
new
HGKC003
();
BeanUtils
.
copyProperties
(
v1
,
kc003
);
kc003
.
setInvQty
(
v1
.
getInvQty
().
add
(
v2
.
getInvQty
()));
kc003
.
setInvWeight
(
v1
.
getInvWeight
().
add
(
v2
.
getInvWeight
()));
return
kc003
;
}
)).
values
().
stream
().
map
(
o
->
{
HGCB005
cb005
=
new
HGCB005
();
cb005
.
setAccountYear
(
hgcw001
.
getAccountYear
());
cb005
.
setAccountMonth
(
hgcw001
.
getAccountPeriod
().
substring
(
4
));
cb005
.
setCompanyCode
(
hgcw001
.
getCompanyCode
());
cb005
.
setCompanyName
(
hgcw001
.
getCompanyName
());
cb005
.
setProductCode
(
o
.
getPrdtCode
());
cb005
.
setProductName
(
o
.
getPrdtName
());
cb005
.
setTechFlowId
(
o
.
getTechFlowId
());
cb005
.
setTechFlowName
(
o
.
getTechFlowName
());
cb005
.
setInventProcessId
(
o
.
getInventProcessId
());
cb005
.
setProcessCode
(
o
.
getProcessCode
());
cb005
.
setProcessName
(
o
.
getProcessName
());
cb005
.
setProcessOrder
(
o
.
getProcessOrder
());
cb005
.
setProductLength
(
o
.
getPrdtLength
());
cb005
.
setProductWidth
(
o
.
getPrdtWidth
());
cb005
.
setProductThick
(
o
.
getPrdtThick
());
cb005
.
setProductSpec
(
o
.
getPrdtSpec
());
cb005
.
setSingleWeight
(
o
.
getInvUnitWeight
());
cb005
.
setQuantity
(
o
.
getInvQty
());
cb005
.
setTotalWeight
(
o
.
getInvWeight
());
return
cb005
;
}).
collect
(
Collectors
.
toList
());
return
hgcb005List
;
}
}
}
src/main/java/com/baosight/hggp/hg/kc/sql/HGKC003.xml
View file @
96de65f8
...
@@ -157,6 +157,12 @@
...
@@ -157,6 +157,12 @@
<isNotEmpty
prepend=
" AND "
property=
"processOrder"
>
<isNotEmpty
prepend=
" AND "
property=
"processOrder"
>
PROCESS_ORDER = #processOrder#
PROCESS_ORDER = #processOrder#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"accountPeriodDateStart"
>
<![CDATA[ DEPOSIT_DATE >= #accountPeriodDateStart# ]]>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"accountPeriodDateEnd"
>
<![CDATA[ DEPOSIT_DATE <= #accountPeriodDateEnd# ]]>
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
96de65f8
...
@@ -387,6 +387,16 @@ public class HGKCTools {
...
@@ -387,6 +387,16 @@ public class HGKCTools {
AssertUtils
.
isEmpty
(
paramMap
,
"时间不能为空"
);
AssertUtils
.
isEmpty
(
paramMap
,
"时间不能为空"
);
return
DaoBase
.
getInstance
().
query
(
"HGKC003.queryCheckList"
,
paramMap
);
return
DaoBase
.
getInstance
().
query
(
"HGKC003.queryCheckList"
,
paramMap
);
}
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public
static
List
<
HGKC003
>
list
(
Map
paramMap
)
{
return
DaoBase
.
getInstance
().
query
(
HGKC003
.
QUERY
,
paramMap
);
}
}
}
/**
/**
...
...
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