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
cf068ec5
Commit
cf068ec5
authored
Sep 30, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-29 委托加工
parent
91cdba6f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
18 deletions
+94
-18
ServiceHGSC010.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC010.java
+12
-6
HGSC010A.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC010A.xml
+3
-0
HGSC010B.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC010B.xml
+3
-0
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+59
-1
HGSC010.js
src/main/webapp/HG/SC/HGSC010.js
+7
-1
HGSC010A.jsp
src/main/webapp/HG/SC/HGSC010A.jsp
+10
-10
No files found.
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC010.java
View file @
cf068ec5
...
...
@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.constant.HGConstant;
import
com.baosight.hggp.hg.sc.domain.HGSC010
;
import
com.baosight.hggp.hg.sc.domain.HGSC010A
;
import
com.baosight.hggp.hg.sc.domain.HGSC010B
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
...
@@ -21,6 +22,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import
org.apache.commons.lang.StringUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author LiuYang
...
...
@@ -122,16 +124,20 @@ public class ServiceHGSC010 extends ServiceEPBase {
public
EiInfo
updateStatus
(
EiInfo
inInfo
)
{
int
i
=
0
;
try
{
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HGSC010
hgsc010
=
new
HGSC010
();
hgsc010
.
fromMap
(
map
);
List
<
HGSC010
>
resultMaps
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGSC010
.
class
);
List
<
Long
>
ids
=
ObjectUtils
.
listEpKey
(
resultMaps
,
HGSC010
.
FIELD_ID
);
List
<
HGSC010A
>
hgsc010As
=
HGSCTools
.
Hgsc010a
.
getByParentIds
(
ids
);
List
<
HGSC010B
>
hgsc010Bs
=
HGSCTools
.
Hgsc010b
.
getByParentIds
(
ids
);
for
(
HGSC010
hgsc010:
resultMaps
)
{
List
<
HGSC010A
>
hgsc010AList
=
hgsc010As
.
stream
().
filter
(
item
->
item
.
getParentId
().
equals
(
hgsc010
.
getId
())).
collect
(
Collectors
.
toList
());
List
<
HGSC010B
>
hgsc010BList
=
hgsc010Bs
.
stream
().
filter
(
item
->
item
.
getParentId
().
equals
(
hgsc010
.
getId
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isTrue
(
hgsc010AList
.
size
()<=
0
||
hgsc010BList
.
size
()<=
0
,
"请先添加成本委托明细或者原料委托明细"
);
hgsc010
.
setSubStatus
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
"HGSC010.updateBySubStatus"
,
hgsc010
.
toMap
());
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.dele
te"
,
"提交"
)});
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
resultMaps
.
size
()),
I18nMessages
.
getText
(
"label.upda
te"
,
"提交"
)});
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"提交失败"
);
}
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC010A.xml
View file @
cf068ec5
...
...
@@ -108,6 +108,9 @@
<isNotEmpty
prepend=
" AND "
property=
"remainingWeight"
>
REMAINING_WEIGHT = #remainingWeight#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parentIds"
>
PARENT_ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"parentIds"
>
#parentIds[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC010B.xml
View file @
cf068ec5
...
...
@@ -108,6 +108,9 @@
<isNotEmpty
prepend=
" AND "
property=
"remainingWeight"
>
REMAINING_WEIGHT = #remainingWeight#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parentIds"
>
PARENT_ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"parentIds"
>
#parentIds[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
cf068ec5
...
...
@@ -1944,7 +1944,65 @@ public class HGSCTools {
public
static
HGSC010
getById
(
Long
id
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
id
)||
id
<=
0
,
"委托加工ID不能为空!"
);
return
(
HGSC010
)
DaoBase
.
getInstance
().
get
(
HGSC010
.
QUERY
,
HGSC009
.
FIELD_ID
,
id
);
return
(
HGSC010
)
DaoBase
.
getInstance
().
get
(
HGSC010
.
QUERY
,
HGSC010A
.
FIELD_ID
,
id
);
}
}
public
static
class
Hgsc010a
{
public
static
HGSC010A
getById
(
Long
id
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
id
)||
id
<=
0
,
"委托加工ID不能为空!"
);
return
(
HGSC010A
)
DaoBase
.
getInstance
().
get
(
HGSC010A
.
QUERY
,
HGSC010A
.
FIELD_ID
,
id
);
}
public
static
List
<
HGSC010A
>
getByParentId
(
Long
parentId
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
parentId
)||
parentId
<=
0
,
"委托加工ID不能为空!"
);
Map
queryMap
=
new
HashMap
<
String
,
Object
>(){{
put
(
"parentId"
,
parentId
);
put
(
"deleteFlag"
,
CommonConstant
.
YesNo
.
NO_0
);
}};
List
<
HGSC010A
>
list
=
DaoBase
.
getInstance
().
query
(
HGSC010A
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
list
)?
new
ArrayList
<>():
list
;
}
public
static
List
<
HGSC010A
>
getByParentIds
(
List
<
Long
>
parentIds
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
parentIds
)||
parentIds
.
size
()<=
0
,
"委托加工ID不能为空!"
);
Map
queryMap
=
new
HashMap
<
String
,
Object
>(){{
put
(
"parentIds"
,
parentIds
);
put
(
"deleteFlag"
,
CommonConstant
.
YesNo
.
NO_0
);
}};
List
<
HGSC010A
>
list
=
DaoBase
.
getInstance
().
query
(
HGSC010A
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
list
)?
new
ArrayList
<>():
list
;
}
}
public
static
class
Hgsc010b
{
public
static
HGSC010B
getById
(
Long
id
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
id
)||
id
<=
0
,
"委托加工ID不能为空!"
);
return
(
HGSC010B
)
DaoBase
.
getInstance
().
get
(
HGSC010B
.
QUERY
,
HGSC010B
.
FIELD_ID
,
id
);
}
public
static
List
<
HGSC010B
>
getByParentId
(
Long
parentId
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
parentId
)||
parentId
<=
0
,
"委托加工ID不能为空!"
);
Map
queryMap
=
new
HashMap
<
String
,
Object
>(){{
put
(
"parentId"
,
parentId
);
put
(
"deleteFlag"
,
CommonConstant
.
YesNo
.
NO_0
);
}};
List
<
HGSC010B
>
list
=
DaoBase
.
getInstance
().
query
(
HGSC010B
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
list
)?
new
ArrayList
<>():
list
;
}
public
static
List
<
HGSC010B
>
getByParentIds
(
List
<
Long
>
parentIds
){
AssertUtils
.
isTrue
(
Objects
.
isNull
(
parentIds
)||
parentIds
.
size
()<=
0
,
"委托加工ID不能为空!"
);
Map
queryMap
=
new
HashMap
<
String
,
Object
>(){{
put
(
"parentIds"
,
parentIds
);
put
(
"deleteFlag"
,
CommonConstant
.
YesNo
.
NO_0
);
}};
List
<
HGSC010B
>
list
=
DaoBase
.
getInstance
().
query
(
HGSC010B
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
list
)?
new
ArrayList
<>():
list
;
}
}
...
...
src/main/webapp/HG/SC/HGSC010.js
View file @
cf068ec5
...
...
@@ -165,7 +165,13 @@ function updateStatus() {
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
提交
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGSC010"
,
"updateStatus"
,
true
);
JSUtils
.
submitGridsData
(
"result"
,
"HGSC010"
,
"updateStatus"
,
true
,
function
(
e
)
{
var
status
=
e
.
getStatus
();
if
(
status
!==
-
1
)
{
query
();
}
});
}
});
}
...
...
src/main/webapp/HG/SC/HGSC010A.jsp
View file @
cf068ec5
...
...
@@ -24,17 +24,17 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" needAuth="false">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="productCode" cname="成品编码" width="120" align="center" required="true" readonly="false"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="productName" cname="成品名称" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center"/>
<EF:EFColumn ename="pcsQty" cname="加工数量" width="120" enable="true" format="{0:N0}" editType="text"
...
...
@@ -66,17 +66,17 @@
<EF:EFRegion id="detail" title="原料信息">
<EF:EFGrid blockId="detail" autoDraw="override" isFloat="true" needAuth="false" serviceName="HGSC010B">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="原料编码" width="120" align="center" required="true" readonly="false"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="原料名称" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center"/>
<EF:EFColumn ename="pcsQty" cname="加工数量" width="120" enable="true" format="{0:N0}" editType="text"
...
...
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