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
905b411e
Commit
905b411e
authored
Oct 09, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-09 物料清单生成模板
parent
21d71108
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
39 deletions
+41
-39
ServiceHGPZ015.java
.../java/com/baosight/hggp/hg/pz/service/ServiceHGPZ015.java
+34
-8
HGPZ015.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ015.xml
+4
-0
HGPZ015A.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ015A.xml
+3
-31
No files found.
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ015.java
View file @
905b411e
...
...
@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.pz.domain.HGPZ015;
import
com.baosight.hggp.hg.pz.domain.HGPZ015A
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.hg.sc.domain.HGSC004A
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -79,14 +80,13 @@ public class ServiceHGPZ015 extends ServiceBase {
@Override
public
EiInfo
insert
(
EiInfo
inInfo
)
{
HashMap
map
=
new
HashMap
();
map
.
put
(
"
id
"
,
inInfo
.
getString
(
"id"
));
map
.
put
(
"
projCode
"
,
inInfo
.
getString
(
"id"
));
List
<
HGPZ015
>
query
=
DaoBase
.
getInstance
().
query
(
"HGPZ015.query"
,
map
);
HGSC001
hpsc001
=
HGSCTools
.
Hgsc001
.
getByCode
(
inInfo
.
getString
(
"id"
));
if
(
query
.
size
()
>
0
)
{
dao
.
delete
(
"HGPZ015.delete"
,
map
);
dao
.
delete
(
"HGPZ015A.delete"
,
hpsc001
.
toMap
()
);
dao
.
delete
(
"HGPZ015.delete
ByProjCode
"
,
map
);
dao
.
delete
(
"HGPZ015A.delete"
,
map
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
HGPZ015
hgpz015
=
new
HGPZ015
();
// hgpz015.setId(Long.parseLong(inInfo.getString("id")));
...
...
@@ -96,11 +96,18 @@ public class ServiceHGPZ015 extends ServiceBase {
hgpz015
.
setUpdatedTime
(
null
);
DaoUtils
.
insert
(
"HGPZ015.insert"
,
hgpz015
.
toMap
());
//模板物料清单
map
.
put
(
"templateName"
,
inInfo
.
getString
(
"templateName"
));
map
.
put
(
"projCode"
,
hpsc001
.
getProjCode
());
List
<
HGPZ015A
>
hppz015AList
=
DaoBase
.
getInstance
().
query
(
"HGPZ015A.queryMb"
,
map
);
List
<
HGSC004A
>
hppz015AList
=
DaoBase
.
getInstance
().
query
(
"HGSC004A.query"
,
new
HashMap
<
String
,
Object
>(){{
put
(
"projCode"
,
hpsc001
.
getProjCode
());
}}
);
if
(
hppz015AList
.
size
()
>
0
){
hppz015AList
.
forEach
(
hgpz015A
->
DaoUtils
.
insert
(
"HGPZ015A.insert"
,
hgpz015A
.
toMap
()));
hppz015AList
.
forEach
(
hgsc004A
->{
HGPZ015A
hgpz015A
=
new
HGPZ015A
();
initHgpz015
(
hgpz015A
,
hgsc004A
);
if
(
hgsc004A
.
getLeaf
().
toString
().
equals
(
inInfo
.
getString
(
"templateName"
))){
hgpz015A
.
setParentPrdtName
(
""
);
}
DaoUtils
.
insert
(
"HGPZ015A.insert"
,
hgpz015A
);
});
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"生成产品模板成功!"
);
...
...
@@ -208,4 +215,23 @@ public class ServiceHGPZ015 extends ServiceBase {
return
eiInfo
;
}
public
void
initHgpz015
(
HGPZ015A
hgpz015A
,
HGSC004A
hgsc004A
){
hgpz015A
.
setProjCode
(
hgsc004A
.
getProjCode
());
hgpz015A
.
setProjName
(
hgsc004A
.
getProjName
());
hgpz015A
.
setParentId
(
hgsc004A
.
getParentProdCode
());
hgpz015A
.
setParentPrdtName
(
hgsc004A
.
getParentProdName
());
hgpz015A
.
setLeaf
(
hgsc004A
.
getLeaf
().
toString
());
hgpz015A
.
setPrdtType
(
Integer
.
valueOf
(
hgsc004A
.
getProductType
()));
hgpz015A
.
setInventRecordId
(
hgsc004A
.
getProductId
());
hgpz015A
.
setPrdtCode
(
hgsc004A
.
getProductCode
());
hgpz015A
.
setPrdtName
(
hgsc004A
.
getProductName
());
hgpz015A
.
setSpec
(
hgsc004A
.
getSpec
());
hgpz015A
.
setLength
(
hgsc004A
.
getLength
());
hgpz015A
.
setWidth
(
hgsc004A
.
getWidth
());
hgpz015A
.
setThick
(
hgsc004A
.
getThick
());
hgpz015A
.
setLv
(
hgsc004A
.
getLv
());
hgpz015A
.
setNum
(
hgsc004A
.
getQuantity
());
hgpz015A
.
setUnitWt
(
hgsc004A
.
getSingleWeight
());
hgpz015A
.
setTotalWt
(
hgsc004A
.
getTotalWeight
());
}
}
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ015.xml
View file @
905b411e
...
...
@@ -183,6 +183,10 @@
ID = #id#
</delete>
<delete
id=
"deleteByProjCode"
>
DELETE FROM ${hggpSchema}.HGPZ015 WHERE PROJ_CODE = #projCode#
</delete>
<update
id=
"update"
>
UPDATE ${hggpSchema}.HGPZ015
SET
...
...
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ015A.xml
View file @
905b411e
...
...
@@ -191,34 +191,6 @@
<include
refid=
"order"
/>
</select>
<select
id=
"queryMb"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.pz.domain.HGPZ015A"
>
SELECT
PROJ_CODE,
PARENT_PROD_CODE,
CASE WHEN LEAF = #templateName# THEN '' ELSE PARENT_PROD_NAME END as PARENT_PRDT_NAME,
LEAF,
SORT,
PRODUCT_TYPE,
PRODUCT_CODE,
PRODUCT_NAME,
MATERIAL_ID,
quantity,
single_weight,
total_weight,
APPROVAL_STATUS,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
LV,
SPEC,
LENGTH,
WIDTH,
THICK
FROM ${hggpSchema}.hgsc004a
where ACCOUNT_CODE=#accountCode# AND PROJ_CODE=#projCode#
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.hgpz015a WHERE 1=1
AND PARENT_ID NOT IN ('root')
...
...
@@ -331,11 +303,11 @@
<!-- 删除 -->
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.h
p
pz015a WHERE PROJ_CODE = #projCode#
DELETE FROM ${hggpSchema}.h
g
pz015a WHERE PROJ_CODE = #projCode#
</delete>
<update
id=
"update"
>
UPDATE ${hggpSchema}.h
p
pz015a
UPDATE ${hggpSchema}.h
g
pz015a
SET
ACCOUNT_CODE = #accountCode#,
<!-- 企业编码 预留 -->
DEP_CODE = #depCode#,
<!-- 部门编码 预留 -->
...
...
@@ -394,7 +366,7 @@
LV as "lv",
SPEC as "spec"
FROM
${hggpSchema}.h
p
pz015a
${hggpSchema}.h
g
pz015a
WHERE 1=1
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
ACCOUNT_CODE = #accountCode#
...
...
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