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
92a90a2f
Commit
92a90a2f
authored
Aug 06, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-08-06 物料清单导入优化,导入存货编码不存在就新增存货档案
parent
c636949a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
14 deletions
+85
-14
HGPZ005.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
+3
-0
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+2
-2
HGSC004A.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004A.java
+50
-2
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+30
-10
No files found.
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
View file @
92a90a2f
...
...
@@ -268,6 +268,9 @@
FLOW_ID
)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,#flowId#)
<selectKey
resultClass=
"java.lang.Long"
keyProperty=
"id"
>
SELECT MAX(ID) FROM ${hggpSchema}.HGPZ005
</selectKey>
</insert>
<delete
id=
"delete"
>
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
92a90a2f
...
...
@@ -240,8 +240,8 @@ public class HGPZTools {
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"inventCode"
,
inventCode
);
List
<
HGPZ005
>
results
=
DaoBase
.
getInstance
().
query
(
HGPZ005
.
QUERY
,
queryMap
);
AssertUtils
.
isEmpty
(
results
,
String
.
format
(
"物料编码[%s]不存在"
,
inventCode
));
return
results
.
get
(
0
);
//
AssertUtils.isEmpty(results, String.format("物料编码[%s]不存在", inventCode));
return
results
.
size
()
==
0
?
null
:
results
.
get
(
0
);
}
/**
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004A.java
View file @
92a90a2f
...
...
@@ -57,6 +57,9 @@ public class HGSC004A extends DaoEPBase {
public
static
final
String
FIELD_updated_by
=
"updatedBy"
;
/* 更新人*/
public
static
final
String
FIELD_updated_name
=
"updatedName"
;
/* 修改人名称*/
public
static
final
String
FIELD_updated_time
=
"updatedTime"
;
/* 更新时间*/
public
static
final
String
FIELD_MATERIAL
=
"material"
;
/* 材质*/
public
static
final
String
FIELD_COEFFICIENT
=
"coefficient"
;
/* 系数*/
public
static
final
String
FIELD_UNIT
=
"unit"
;
/* 单位*/
public
static
final
String
COL_id
=
"id"
;
/* 主键*/
public
static
final
String
COL_company_code
=
"company_code"
;
/* 公司编码(预留)*/
...
...
@@ -144,6 +147,9 @@ public class HGSC004A extends DaoEPBase {
private
String
updatedName
=
" "
;
/* 修改人名称*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
String
material
=
" "
;
/* 材质*/
private
BigDecimal
coefficient
=
new
BigDecimal
(
"0"
);
/* 系数*/
private
String
unit
=
" "
;
/* 单位*/
private
Long
techFlowId
=
new
Long
(
0
);
/* 工艺流程id*/
private
String
finishDate
=
" "
;
/* 完工日期*/
...
...
@@ -242,7 +248,7 @@ public class HGSC004A extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_invent_type
);
eiColumn
.
setFieldLength
(
32
);
eiColumn
.
setDescName
(
"
档案
类型"
);
eiColumn
.
setDescName
(
"
存货
类型"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_spec
);
...
...
@@ -348,7 +354,20 @@ public class HGSC004A extends DaoEPBase {
eiColumn
.
setDescName
(
"更新时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_MATERIAL
);
eiColumn
.
setDescName
(
"材质"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_COEFFICIENT
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
3
);
eiColumn
.
setFieldLength
(
12
);
eiColumn
.
setDescName
(
"系数"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UNIT
);
eiColumn
.
setDescName
(
"单位"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -855,6 +874,30 @@ public class HGSC004A extends DaoEPBase {
this
.
spec
=
spec
;
}
public
String
getMaterial
()
{
return
material
;
}
public
void
setMaterial
(
String
material
)
{
this
.
material
=
material
;
}
public
BigDecimal
getCoefficient
()
{
return
coefficient
;
}
public
void
setCoefficient
(
BigDecimal
coefficient
)
{
this
.
coefficient
=
coefficient
;
}
public
String
getUnit
()
{
return
unit
;
}
public
void
setUnit
(
String
unit
)
{
this
.
unit
=
unit
;
}
/**
* get the value from Map.
*
...
...
@@ -898,6 +941,9 @@ public class HGSC004A extends DaoEPBase {
setUpdatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_updated_by
)),
updatedBy
));
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_updated_name
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_updated_time
)),
updatedTime
));
setMaterial
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_MATERIAL
)),
material
));
setCoefficient
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_COEFFICIENT
)),
coefficient
));
setUnit
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UNIT
)),
unit
));
}
/**
...
...
@@ -942,7 +988,9 @@ public class HGSC004A extends DaoEPBase {
map
.
put
(
FIELD_updated_by
,
StringUtils
.
toString
(
updatedBy
,
eiMetadata
.
getMeta
(
FIELD_updated_by
)));
map
.
put
(
FIELD_updated_name
,
StringUtils
.
toString
(
updatedName
,
eiMetadata
.
getMeta
(
FIELD_updated_name
)));
map
.
put
(
FIELD_updated_time
,
StringUtils
.
toString
(
updatedTime
,
eiMetadata
.
getMeta
(
FIELD_updated_time
)));
map
.
put
(
FIELD_MATERIAL
,
StringUtils
.
toString
(
material
,
eiMetadata
.
getMeta
(
FIELD_MATERIAL
)));
map
.
put
(
FIELD_COEFFICIENT
,
StringUtils
.
toString
(
coefficient
,
eiMetadata
.
getMeta
(
FIELD_COEFFICIENT
)));
map
.
put
(
FIELD_UNIT
,
StringUtils
.
toString
(
unit
,
eiMetadata
.
getMeta
(
FIELD_UNIT
)));
return
map
;
}
}
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
92a90a2f
...
...
@@ -372,16 +372,36 @@ public class HGSCTools {
AssertUtils
.
isTrue
(
true
,
"数量不能为0!"
);
}
hgsc004a
.
setTotalWeight
(
hgsc004a
.
getQuantity
().
multiply
(
hgsc004a
.
getSingleWeight
()));
HGPZ005
hgpz005
=
HGPZTools
.
HgPz005
.
get
(
hgsc004a
.
getProductCode
());
if
(
Objects
.
isNull
(
hgpz005
)){
AssertUtils
.
isTrue
(
true
,
"产品编号不存在!"
);
}
hgsc004a
.
setProductId
(
hgpz005
.
getId
());
hgsc004a
.
setInventType
(
hgpz005
.
getInventType
()+
""
);
hgsc004a
.
setProductType
(
hgpz005
.
getInventTypeDetail
()+
""
);
hgsc004a
.
setLength
(
hgpz005
.
getLength
());
hgsc004a
.
setWidth
(
hgpz005
.
getWidth
());
hgsc004a
.
setThick
(
hgpz005
.
getThick
());
HGPZ005
pz005
=
HGPZTools
.
HgPz005
.
get
(
hgsc004a
.
getProductCode
());
if
(
pz005
==
null
){
List
<
HGPZ004
>
hgpz004s
=
DaoBase
.
getInstance
().
query
(
HGPZ004
.
QUERY
,
new
HashMap
<
String
,
Object
>(){{
put
(
HGPZ004
.
FIELD_STATUS
,
CommonConstant
.
YesNo
.
YES_1
);
}});
Map
parmap
=
hgpz004s
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ004:
:
getInventTypeName
,
HGPZ004:
:
getInventType
,(
v1
,
v2
)
->
v1
));
String
inventType
=
com
.
baosight
.
hggp
.
util
.
MapUtils
.
getString
(
parmap
,
com
.
baosight
.
hggp
.
util
.
StringUtils
.
trimToEmpty
(
hgsc004a
.
getInventType
()));
AssertUtils
.
isEmpty
(
inventType
,
String
.
format
(
"存货类型[%s]代码不存在,添加失败!"
,
hgsc004a
.
getInventType
()));
pz005
=
new
HGPZ005
();
pz005
.
setInventType
(
inventType
);
pz005
.
setInventCode
(
hgsc004a
.
getProductCode
());
pz005
.
setInventName
(
hgsc004a
.
getProductName
());
pz005
.
setSpec
(
hgsc004a
.
getSpec
());
pz005
.
setInventTypeDetail
(
Integer
.
valueOf
(
hgsc004a
.
getProductType
()));
pz005
.
setLength
(
hgsc004a
.
getLength
());
pz005
.
setWidth
(
hgsc004a
.
getWidth
());
pz005
.
setThick
(
hgsc004a
.
getThick
());
pz005
.
setMaterial
(
hgsc004a
.
getMaterial
());
pz005
.
setCoefficient
(
hgsc004a
.
getCoefficient
());
pz005
.
setUnit
(
hgsc004a
.
getUnit
());
pz005
.
setStatus
(
1
);
//默认启用
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
pz005
);
}
hgsc004a
.
setProductId
(
pz005
.
getId
());
hgsc004a
.
setInventType
(
pz005
.
getInventType
()+
""
);
hgsc004a
.
setProductType
(
pz005
.
getInventTypeDetail
()+
""
);
hgsc004a
.
setLength
(
pz005
.
getLength
());
hgsc004a
.
setWidth
(
pz005
.
getWidth
());
hgsc004a
.
setThick
(
pz005
.
getThick
());
DaoUtils
.
insert
(
HGSC004A
.
INSERT
,
hgsc004a
);
//主表全部提交时需要有改变状态
/*if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
...
...
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