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
591b0662
Commit
591b0662
authored
Jun 28, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
材料计划生成采购计划重复校验添加
parent
e8f1be20
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
12 deletions
+85
-12
HGCG001.java
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG001.java
+32
-1
HGCG001.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG001.xml
+16
-3
HGCGTools.java
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
+13
-0
ServiceHGSC009A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC009A.java
+13
-0
HGSC009.js
src/main/webapp/HG/SC/HGSC009.js
+7
-4
HGSC009.jsp
src/main/webapp/HG/SC/HGSC009.jsp
+4
-4
No files found.
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG001.java
View file @
591b0662
...
...
@@ -58,6 +58,9 @@ public class HGCG001 extends DaoEPBase {
public
static
final
String
FIELD_AUDIT_USER_NAME
=
"auditUserName"
;
/* 审核人名称*/
public
static
final
String
FIELD_AUDIT_REASON
=
"auditReason"
;
/* 审核原因*/
public
static
final
String
FIELD_INVENT_TYPE_DETAIL
=
"inventTypeDetail"
;
/*存货类型明细*/
public
static
final
String
FIELD_MATERIAL_PLAN_ID
=
"materialPlanId"
;
/*材料计划id*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_ACCOUNT_CODE
=
"ACCOUNT_CODE"
;
/* 企业编码*/
public
static
final
String
COL_DEP_CODE
=
"DEP_CODE"
;
/* 部门编码*/
...
...
@@ -135,6 +138,8 @@ public class HGCG001 extends DaoEPBase {
private
String
auditUserId
=
" "
;
/* 审核人ID*/
private
String
auditUserName
=
" "
;
/* 审核人名称*/
private
String
auditReason
=
" "
;
/* 审核原因*/
private
Integer
inventTypeDetail
;
/*存货类型明细 1:构建 2:零件*/
private
Long
materialPlanId
=
new
Long
(
0
);
/*材料计划id*/
/**
* initialize the metadata.
...
...
@@ -310,7 +315,13 @@ public class HGCG001 extends DaoEPBase {
eiColumn
.
setDescName
(
"审核原因"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_TYPE_DETAIL
);
eiColumn
.
setDescName
(
"存货类型明细"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_MATERIAL_PLAN_ID
);
eiColumn
.
setDescName
(
"存货类型明细"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -880,6 +891,23 @@ public class HGCG001 extends DaoEPBase {
public
void
setAuditReason
(
String
auditReason
)
{
this
.
auditReason
=
auditReason
;
}
public
Integer
getInventTypeDetail
()
{
return
inventTypeDetail
;
}
public
void
setInventTypeDetail
(
Integer
inventTypeDetail
)
{
this
.
inventTypeDetail
=
inventTypeDetail
;
}
public
Long
getMaterialPlanId
()
{
return
materialPlanId
;
}
public
void
setMaterialPlanId
(
Long
materialPlanId
)
{
this
.
materialPlanId
=
materialPlanId
;
}
/**
* get the value from Map.
*
...
...
@@ -923,6 +951,8 @@ public class HGCG001 extends DaoEPBase {
setAuditUserId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AUDIT_USER_ID
)),
auditUserId
));
setAuditUserName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AUDIT_USER_NAME
)),
auditUserName
));
setAuditReason
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_AUDIT_REASON
)),
auditReason
));
setMaterialPlanId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_MATERIAL_PLAN_ID
)),
materialPlanId
));
setInventTypeDetail
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_TYPE_DETAIL
)),
inventTypeDetail
));
}
/**
...
...
@@ -967,7 +997,8 @@ public class HGCG001 extends DaoEPBase {
map
.
put
(
FIELD_AUDIT_USER_ID
,
StringUtils
.
toString
(
auditUserId
,
eiMetadata
.
getMeta
(
FIELD_AUDIT_USER_ID
)));
map
.
put
(
FIELD_AUDIT_USER_NAME
,
StringUtils
.
toString
(
auditUserName
,
eiMetadata
.
getMeta
(
FIELD_AUDIT_USER_NAME
)));
map
.
put
(
FIELD_AUDIT_REASON
,
StringUtils
.
toString
(
auditReason
,
eiMetadata
.
getMeta
(
FIELD_AUDIT_REASON
)));
map
.
put
(
FIELD_MATERIAL_PLAN_ID
,
StringUtils
.
toString
(
materialPlanId
,
eiMetadata
.
getMeta
(
FIELD_MATERIAL_PLAN_ID
)));
map
.
put
(
FIELD_INVENT_TYPE_DETAIL
,
StringUtils
.
toString
(
inventTypeDetail
,
eiMetadata
.
getMeta
(
FIELD_INVENT_TYPE_DETAIL
)));
return
map
;
}
}
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG001.xml
View file @
591b0662
...
...
@@ -37,7 +37,9 @@
AUDIT_TIME as "auditTime",
<!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId",
<!-- 审核人ID -->
AUDIT_USER_NAME as "auditUserName",
<!-- 审核人名称 -->
AUDIT_REASON as "auditReason"
<!-- 审核原因 -->
AUDIT_REASON as "auditReason",
<!-- 审核原因 -->
INVENT_TYPE_DETAIL as "inventTypeDetail",
<!-- 存货类型明细 -->
MATERIAL_PLAN_ID as "materialPlanId"
<!-- 材料计划id -->
</sql>
<sql
id=
"condition"
>
...
...
@@ -78,6 +80,12 @@
<isNotEmpty
prepend=
" AND "
property=
"auditUserName"
>
AUDIT_USER_NAME = #auditUserName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventTypeDetail"
>
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"materialPlanId"
>
MATERIAL_PLAN_ID = #materialPlanId#
</isNotEmpty>
</sql>
<sql
id=
"idCondition"
>
...
...
@@ -90,6 +98,9 @@
<isNotEmpty
prepend=
" AND "
property=
"planNos"
>
PLAN_NO IN
<iterate
open=
"("
close=
")"
conjunction=
","
property=
"planNos"
>
#planNos[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"materialPlanIds"
>
MATERIAL_PLAN_ID IN
<iterate
open=
"("
close=
")"
conjunction=
","
property=
"materialPlanIds"
>
#materialPlanIds[]#
</iterate>
</isNotEmpty>
</sql>
<sql
id=
"customCondition"
>
...
...
@@ -152,12 +163,14 @@
PLAN_QTY,
<!-- 计划数量 -->
PLAN_UNIT_WEIGHT,
<!-- 计划单重 -->
PLAN_WEIGHT,
<!-- 计划重量 -->
STATUS
<!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
STATUS,
<!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
INVENT_TYPE_DETAIL,
<!-- 存货类型明细 -->
MATERIAL_PLAN_ID
<!-- 材料计划id -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#,
#specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#planQty#, #planUnitWeight#, #planWeight#, #status#
#planQty#, #planUnitWeight#, #planWeight#, #status#
, #inventTypeDetail#, #materialPlanId#
)
</insert>
...
...
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
View file @
591b0662
...
...
@@ -73,6 +73,19 @@ public class HGCGTools {
/**
* 查询
*
* @param materialPlanIds
* @return
*/
public
static
List
<
HGCG001
>
listByMaterialPlanIds
(
List
<
Long
>
materialPlanIds
)
{
AssertUtils
.
isEmpty
(
materialPlanIds
,
"材料计划id不能为空"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"materialPlanIds"
,
materialPlanIds
);
return
DaoBase
.
getInstance
().
query
(
HGCG001
.
QUERY
,
paramMap
);
}
/**
* 查询
*
* @param planNos
* @return
*/
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC009A.java
View file @
591b0662
...
...
@@ -5,6 +5,7 @@ import com.baosight.hggp.common.AssignStatusEnum;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cg.domain.HGCG001
;
import
com.baosight.hggp.hg.cg.tools.HGCGTools
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
...
...
@@ -219,11 +220,14 @@ public class ServiceHGSC009A extends ServiceBase {
inventUnitMap
=
hgpz005List
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005:
:
getInventCode
,
HGPZ005:
:
getUnit
,(
v1
,
v2
)->
v1
));
}
}
// 数据校验
this
.
checkInsertcgData
(
hgsc009AList
);
for
(
HGSC009A
hgsc009
:
hgsc009AList
)
{
// 写入子表数据
HGCG001
hgcg001
=
new
HGCG001
();
BeanUtils
.
copyProperties
(
hgsc009
,
hgcg001
);
hgcg001
.
setMaterialPlanId
(
hgsc009
.
getId
());
hgcg001
.
setCompanyCode
(
hgsc009
.
getCompanyCode
());
hgcg001
.
setCompanyName
(
hgsc009
.
getCompanyName
());
hgcg001
.
setInventCode
(
hgsc009
.
getInventCode
());
...
...
@@ -251,4 +255,13 @@ public class ServiceHGSC009A extends ServiceBase {
return
inInfo
;
}
private
void
checkInsertcgData
(
List
<
HGSC009A
>
hgsc009AList
)
{
List
<
Long
>
materialPlanIds
=
hgsc009AList
.
stream
().
map
(
HGSC009A:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGCG001
>
hgcg001List
=
HGCGTools
.
HgCg001
.
listByMaterialPlanIds
(
materialPlanIds
);
hgsc009AList
.
forEach
(
o
->{
HGCG001
hgcg001
=
hgcg001List
.
stream
().
filter
(
c
->
c
.
getMaterialPlanId
().
intValue
()
==
o
.
getId
()).
findAny
().
orElse
(
null
);
AssertUtils
.
isTrue
(
Objects
.
nonNull
(
hgcg001
),
String
.
format
(
"材料计划[%s]已生成采购计划"
,
o
.
getPlanMaterialCode
()));
});
}
}
src/main/webapp/HG/SC/HGSC009.js
View file @
591b0662
...
...
@@ -107,7 +107,6 @@ $(function () {
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"companyName"
,
companyCodeBox
[
i
][
'companyName'
]);
}
}
loadChange
(
grid
,
e
,
"projCode"
);
}
// 判断父级节点是否发生变化
if
(
e
.
field
==
"projCode"
)
{
...
...
@@ -136,9 +135,6 @@ $(function () {
}
let
query
=
function
()
{
resultGrid
.
dataSource
.
page
(
1
);
}
let
save
=
function
(
btnNode
)
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
...
...
@@ -174,6 +170,9 @@ $(function () {
});
let
query
=
function
()
{
resultGrid
.
dataSource
.
page
(
1
);
}
/**
* 显示附件详情
*
...
...
@@ -237,8 +236,12 @@ function INSERTCG() {
ok
:
function
()
{
EiCommunicator
.
send
(
'HGSC009A'
,
'insertcg'
,
inEiInfo
,
{
onSuccess
(
response
)
{
if
(
response
.
status
==
1
){
NotificationUtil
(
response
.
msg
);
query
();
}
else
{
NotificationUtil
(
response
.
msg
,
"error"
);
}
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
...
...
src/main/webapp/HG/SC/HGSC009.jsp
View file @
591b0662
...
...
@@ -29,13 +29,13 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=
textField#" itemTemplate="#=textField
#"
textField="
textField" valueField="valueField
"
maxLength="16" readonly="false" width="
2
00" required="true"
columnTemplate="#=
companyName#" itemTemplate="#=companyName
#"
textField="
companyName" valueField="companyCode
"
maxLength="16" readonly="false" width="
1
00" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"
hidden="true"
/>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<%-- <EF:EFComboColumn ename="projCode" cname="项目编码"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#"--%>
<%-- textField="textField" valueField="valueField"--%>
...
...
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