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
f37e2510
Commit
f37e2510
authored
May 20, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料清单明细页面操作处理、提交处理
parent
d6dd4825
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
825 additions
and
347 deletions
+825
-347
DdynamicEnum.java
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
+6
-0
DaoUtils.java
src/main/java/com/baosight/hggp/core/dao/DaoUtils.java
+18
-0
HGConstant.java
src/main/java/com/baosight/hggp/hg/constant/HGConstant.java
+1
-1
HGPZ005.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
+24
-0
HGSC004.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004.java
+19
-3
HGSC004A.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004A.java
+94
-0
ServiceHGSC004.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC004.java
+79
-16
ServiceHGSC004A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC004A.java
+105
-74
HGSC004.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC004.xml
+32
-60
HGSC004A.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC004A.xml
+129
-101
HGSC004.js
src/main/webapp/HG/SC/HGSC004.js
+3
-3
HGSC004A.js
src/main/webapp/HG/SC/HGSC004A.js
+296
-66
HGSC004A.jsp
src/main/webapp/HG/SC/HGSC004A.jsp
+19
-23
No files found.
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
View file @
f37e2510
...
...
@@ -73,6 +73,12 @@ public enum DdynamicEnum {
INVENT_RECORD_BLOCK_ID
(
"invent_record_block_id"
,
"inventCode"
,
"inventName"
,
"HGPZ005.queryComboBox"
),
/**
* 模块:存货档案
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID
(
"product_block_id"
,
"inventCode"
,
"inventName"
,
"id"
,
"inventType"
,
"HGPZ005.queryProductComboBox"
),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
* 编写:
...
...
src/main/java/com/baosight/hggp/core/dao/DaoUtils.java
View file @
f37e2510
...
...
@@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -73,6 +74,23 @@ public class DaoUtils {
}
/**
* update method.
*
* @param sql
* @param parameters
*/
public
static
int
updateBatch
(
String
sql
,
Collection
parameters
)
{
parameters
.
forEach
(
obj
->{
if
(
obj
instanceof
DaoEPBase
)
{
setRevisor
((
DaoEPBase
)
obj
,
true
);
}
else
if
(
obj
instanceof
Map
)
{
setRevisor
((
Map
)
obj
,
true
);
}
});
return
DaoBase
.
getInstance
().
updateBatch
(
sql
,
parameters
);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻
*
* @param bean
...
...
src/main/java/com/baosight/hggp/hg/constant/HGConstant.java
View file @
f37e2510
...
...
@@ -236,7 +236,7 @@ public class HGConstant {
// 未提交
public
static
final
Integer
WTJ
=
0
;
// 已提交
public
static
final
Integer
YTJ
=
2
;
public
static
final
Integer
YTJ
=
1
;
}
}
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
View file @
f37e2510
...
...
@@ -315,6 +315,30 @@
ORDER BY INVENT_CODE
</select>
<select
id=
"queryProductComboBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
a.ID as "id",
a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName",
b.PAR_INVENT_TYPE as "parInventType"
FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0
AND a.STATUS=1
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventType"
>
a.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parInventType"
>
b.PAR_INVENT_TYPE = #parInventType#
</isNotEmpty>
ORDER BY INVENT_CODE
</select>
<!-- 缺省下拉框 -->
<select
id=
"queryComboBoxAll"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004.java
View file @
f37e2510
...
...
@@ -40,6 +40,7 @@ public class HGSC004 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_del_status
=
"delStatus"
;
/* 数据状态 0:保存,1:删除*/
public
static
final
String
COL_id
=
"id"
;
/* 主键*/
public
static
final
String
COL_blueprint_id
=
"blueprint_id"
;
/* 蓝图id*/
...
...
@@ -60,6 +61,7 @@ public class HGSC004 extends DaoEPBase {
public
static
final
String
COL_updated_by
=
"updated_by"
;
/* 更新人*/
public
static
final
String
COL_updated_name
=
"updated_name"
;
/* 修改人名称*/
public
static
final
String
COL_updated_time
=
"updated_time"
;
/* 更新时间*/
public
static
final
String
COL_del_status
=
"del_status"
;
/* 数据状态 0:保存,1:删除*/
public
static
final
String
QUERY
=
"HGSC004.query"
;
public
static
final
String
COUNT
=
"HGSC004.count"
;
...
...
@@ -67,8 +69,8 @@ public class HGSC004 extends DaoEPBase {
public
static
final
String
UPDATE
=
"HGSC004.update"
;
public
static
final
String
DELETE
=
"HGSC004.delete"
;
public
static
final
String
BATCH_DELETE
=
"HGSC004.batchDelete"
;
public
static
final
String
BATCH_SUBMIT
=
"HGSC004.batchSubmit
"
;
public
static
final
String
UPDATE_DEL
=
"HGSC004.updateDel
"
;
public
static
final
String
UPDATE_MATERIAL_STATUS
=
"HGSC004.updateMaterialStatus"
;
private
Long
id
=
new
Long
(
0
);
/* 主键*/
private
Long
blueprintId
=
new
Long
(
0
);
/* 蓝图id*/
...
...
@@ -89,6 +91,7 @@ public class HGSC004 extends DaoEPBase {
private
String
updatedBy
=
" "
;
/* 更新人*/
private
String
updatedName
=
" "
;
/* 修改人名称*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
Integer
delStatus
=
new
Integer
(
0
);
/* 数据状态 0:保存,1:删除*/
/**
* initialize the metadata.
...
...
@@ -199,7 +202,9 @@ public class HGSC004 extends DaoEPBase {
eiColumn
.
setDescName
(
"更新时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_del_status
);
eiColumn
.
setDescName
(
"数据状态 0:保存,1:删除"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -513,6 +518,15 @@ public class HGSC004 extends DaoEPBase {
public
void
setUpdatedTime
(
String
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
public
Integer
getDelStatus
()
{
return
delStatus
;
}
public
void
setDelStatus
(
Integer
delStatus
)
{
this
.
delStatus
=
delStatus
;
}
/**
* get the value from Map.
*
...
...
@@ -540,6 +554,7 @@ public class HGSC004 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
));
setDelStatus
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_del_status
)),
delStatus
));
}
/**
...
...
@@ -568,6 +583,7 @@ public class HGSC004 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_del_status
,
StringUtils
.
toString
(
delStatus
,
eiMetadata
.
getMeta
(
FIELD_del_status
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC004A.java
View file @
f37e2510
...
...
@@ -31,9 +31,14 @@ public class HGSC004A extends DaoEPBase {
public
static
final
String
FIELD_proj_name
=
"projName"
;
/* 项目名称(预留)*/
public
static
final
String
FIELD_parent_prod_code
=
"parentProdCode"
;
/* 父节点-产品编码*/
public
static
final
String
FIELD_parent_prod_name
=
"parentProdName"
;
/* 父节点-产品名称*/
public
static
final
String
FIELD_leaf
=
"leaf"
;
/* 是否有叶子节点*/
public
static
final
String
FIELD_sort
=
"sort"
;
/* 排序字段*/
public
static
final
String
FIELD_lv
=
"lv"
;
/* 层级*/
public
static
final
String
FIELD_material_id
=
"materialId"
;
/* 物料清单id*/
public
static
final
String
FIELD_product_id
=
"productId"
;
/* 产品id*/
public
static
final
String
FIELD_product_code
=
"productCode"
;
/* 产品编号*/
public
static
final
String
FIELD_product_name
=
"productName"
;
/* 产品名称*/
public
static
final
String
FIELD_product_type
=
"productType"
;
/* 产品type*/
public
static
final
String
FIELD_product_status
=
"productStatus"
;
/* 产品状态 0:未提交,1:已提交*/
public
static
final
String
FIELD_change_type
=
"changeType"
;
/* 变更类型:默认0,1:增加,2:替换,3:删除*/
public
static
final
String
FIELD_quantity
=
"quantity"
;
/* 数量*/
...
...
@@ -57,9 +62,14 @@ public class HGSC004A extends DaoEPBase {
public
static
final
String
COL_proj_name
=
"proj_name"
;
/* 项目名称(预留)*/
public
static
final
String
COL_parent_prod_code
=
"parent_prod_code"
;
/* 父节点-产品编码*/
public
static
final
String
COL_parent_prod_name
=
"parent_prod_name"
;
/* 父节点-产品名称*/
public
static
final
String
COL_leaf
=
"leaf"
;
/* 是否有叶子节点*/
public
static
final
String
COL_sort
=
"sort"
;
/* 排序字段*/
public
static
final
String
COL_lv
=
"lv"
;
/* 层级*/
public
static
final
String
COL_material_id
=
"material_id"
;
/* 物料清单id*/
public
static
final
String
COL_product_id
=
"product_id"
;
/* 产品id*/
public
static
final
String
COL_product_code
=
"product_code"
;
/* 产品编号*/
public
static
final
String
COL_product_name
=
"product_name"
;
/* 产品名称*/
public
static
final
String
COL_product_type
=
"product_type"
;
/* 产品类型*/
public
static
final
String
COL_product_status
=
"product_status"
;
/* 产品状态 0:未提交,1:已提交*/
public
static
final
String
COL_change_type
=
"change_type"
;
/* 变更类型:默认0,1:增加,2:替换,3:删除*/
public
static
final
String
COL_quantity
=
"quantity"
;
/* 数量*/
...
...
@@ -79,6 +89,11 @@ public class HGSC004A extends DaoEPBase {
public
static
final
String
INSERT
=
"HGSC004A.insert"
;
public
static
final
String
UPDATE
=
"HGSC004A.update"
;
public
static
final
String
DELETE
=
"HGSC004A.delete"
;
public
static
final
String
BATCH_DELETE
=
"HGSC004A.batchDelete"
;
public
static
final
String
QUERY_ALL
=
"HGSC004A.queryAll"
;
public
static
final
String
UPDATE_PRODUCT_STATUS
=
"HGSC004A.updateProductStatus"
;
private
Long
id
=
new
Long
(
0
);
/* 主键*/
private
String
companyCode
=
" "
;
/* 公司编码(预留)*/
...
...
@@ -89,9 +104,14 @@ public class HGSC004A extends DaoEPBase {
private
String
projName
=
" "
;
/* 项目名称(预留)*/
private
String
parentProdCode
=
" "
;
/* 父节点-产品编码*/
private
String
parentProdName
=
" "
;
/* 父节点-产品名称*/
private
Integer
leaf
=
new
Integer
(
1
);
/* 是否有叶子节点*/
private
Integer
sort
=
new
Integer
(
1
);
/* 排序字段*/
private
Integer
lv
=
new
Integer
(
0
);;
/* 树的层级*/
private
Long
materialId
=
new
Long
(
0
);
/* 物料清单id*/
private
Long
productId
=
new
Long
(
0
);
/* 产品id*/
private
String
productCode
=
" "
;
/* 产品编号*/
private
String
productName
=
" "
;
/* 产品名称*/
private
String
productType
=
" "
;
/* 产品id*/
private
Integer
productStatus
=
new
Integer
(
0
);
/* 产品状态 0:未提交,1:已提交*/
private
Integer
changeType
=
new
Integer
(
0
);
/* 变更类型:默认0,1:增加,2:替换,3:删除*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
...
...
@@ -159,6 +179,18 @@ public class HGSC004A extends DaoEPBase {
eiColumn
.
setDescName
(
"父节点-产品名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_leaf
);
eiColumn
.
setDescName
(
"是否有叶子节点"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_sort
);
eiColumn
.
setDescName
(
"排序字段"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_lv
);
eiColumn
.
setDescName
(
"层级"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_material_id
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
...
...
@@ -166,6 +198,12 @@ public class HGSC004A extends DaoEPBase {
eiColumn
.
setDescName
(
"物料清单id"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_product_id
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"产品Id"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_product_code
);
eiColumn
.
setFieldLength
(
32
);
eiColumn
.
setDescName
(
"产品编号"
);
...
...
@@ -176,6 +214,11 @@ public class HGSC004A extends DaoEPBase {
eiColumn
.
setDescName
(
"产品名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_product_type
);
eiColumn
.
setFieldLength
(
32
);
eiColumn
.
setDescName
(
"产品类型"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_product_status
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
0
);
...
...
@@ -663,6 +706,47 @@ public class HGSC004A extends DaoEPBase {
public
void
setUpdatedTime
(
String
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
public
Integer
getLeaf
()
{
return
leaf
;
}
public
void
setLeaf
(
Integer
leaf
)
{
this
.
leaf
=
leaf
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
Integer
getLv
()
{
return
lv
;
}
public
void
setLv
(
Integer
lv
)
{
this
.
lv
=
lv
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
String
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
String
productType
)
{
this
.
productType
=
productType
;
}
/**
* get the value from Map.
*
...
...
@@ -680,9 +764,14 @@ public class HGSC004A extends DaoEPBase {
setProjName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_proj_name
)),
projName
));
setParentProdCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_parent_prod_code
)),
parentProdCode
));
setParentProdName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_parent_prod_name
)),
parentProdName
));
setLeaf
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_leaf
)),
leaf
));
setSort
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_sort
)),
sort
));
setLv
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_lv
)),
lv
));
setMaterialId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_material_id
)),
materialId
));
setProductCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_code
)),
productCode
));
setProductName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_name
)),
productName
));
setProductId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_id
)),
productId
));
setProductType
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_type
)),
productType
));
setProductStatus
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_status
)),
productStatus
));
setChangeType
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_change_type
)),
changeType
));
setQuantity
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
...
...
@@ -714,9 +803,14 @@ public class HGSC004A extends DaoEPBase {
map
.
put
(
FIELD_proj_name
,
StringUtils
.
toString
(
projName
,
eiMetadata
.
getMeta
(
FIELD_proj_name
)));
map
.
put
(
FIELD_parent_prod_code
,
StringUtils
.
toString
(
parentProdCode
,
eiMetadata
.
getMeta
(
FIELD_parent_prod_code
)));
map
.
put
(
FIELD_parent_prod_name
,
StringUtils
.
toString
(
parentProdName
,
eiMetadata
.
getMeta
(
FIELD_parent_prod_name
)));
map
.
put
(
FIELD_leaf
,
StringUtils
.
toString
(
leaf
,
eiMetadata
.
getMeta
(
FIELD_leaf
)));
map
.
put
(
FIELD_sort
,
StringUtils
.
toString
(
sort
,
eiMetadata
.
getMeta
(
FIELD_sort
)));
map
.
put
(
FIELD_lv
,
StringUtils
.
toString
(
lv
,
eiMetadata
.
getMeta
(
FIELD_lv
)));
map
.
put
(
FIELD_material_id
,
StringUtils
.
toString
(
materialId
,
eiMetadata
.
getMeta
(
FIELD_material_id
)));
map
.
put
(
FIELD_product_code
,
StringUtils
.
toString
(
productCode
,
eiMetadata
.
getMeta
(
FIELD_product_code
)));
map
.
put
(
FIELD_product_name
,
StringUtils
.
toString
(
productName
,
eiMetadata
.
getMeta
(
FIELD_product_name
)));
map
.
put
(
FIELD_product_id
,
StringUtils
.
toString
(
productId
,
eiMetadata
.
getMeta
(
FIELD_product_id
)));
map
.
put
(
FIELD_product_type
,
StringUtils
.
toString
(
productName
,
eiMetadata
.
getMeta
(
FIELD_product_type
)));
map
.
put
(
FIELD_product_status
,
StringUtils
.
toString
(
productStatus
,
eiMetadata
.
getMeta
(
FIELD_product_status
)));
map
.
put
(
FIELD_change_type
,
StringUtils
.
toString
(
changeType
,
eiMetadata
.
getMeta
(
FIELD_change_type
)));
map
.
put
(
FIELD_quantity
,
StringUtils
.
toString
(
quantity
,
eiMetadata
.
getMeta
(
FIELD_quantity
)));
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC004.java
View file @
f37e2510
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.sc.domain.HGSC003
;
import
com.baosight.hggp.hg.sc.domain.HGSC004
;
import
com.baosight.hggp.hg.sc.domain.HGSC004A
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -58,27 +62,31 @@ public class ServiceHGSC004 extends ServiceBase {
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 蓝图ids
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC004
.
FIELD_id
);
DaoUtils
.
update
(
HGSC004
.
BATCH_DELETE
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
ids
);}});
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
//变更清单里面的公司、项目信息
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"ids"
,
ids
);
List
<
HGSC004
>
hgsc004List
=
this
.
dao
.
query
(
HGSC004
.
QUERY
,
map
,
0
,
-
999999
);
for
(
HGSC004
hgsc004
:
hgsc004List
){
//如果
if
(
hgsc004
.
getMaterialStatus
().
intValue
()
==
HGConstant
.
MaterialStatus
.
WTJ
.
intValue
()){
//变更清单里面的公司、项目信息
Map
<
String
,
Object
>
mapA
=
new
HashMap
<>();
mapA
.
put
(
"materialIds"
,
ids
);
List
<
HGSC004A
>
hgsc004AList
=
dao
.
query
(
HGSC004A
.
QUERY_ALL
,
mapA
,
0
,
-
999999
);
if
(!
CollectionUtils
.
isEmpty
(
hgsc004AList
)){
List
<
Long
>
detailIds
=
hgsc004AList
.
stream
().
map
(
HGSC004A:
:
getId
).
collect
(
Collectors
.
toList
());
DaoUtils
.
update
(
HGSC004A
.
BATCH_DELETE
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
detailIds
);}});
}
DaoUtils
.
update
(
HGSC004
.
DELETE
,
hgsc004
);
}
else
{
DaoUtils
.
update
(
HGSC004
.
UPDATE_DEL
,
hgsc004
);
}
return
inInfo
;
}
public
EiInfo
batchSubmit
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 蓝图ids
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
DaoUtils
.
update
(
HGSC004
.
BATCH_SUBMIT
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
ids
);}});
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据
停用
成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据
删除
成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"
操作
失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"
删除
失败"
);
}
return
inInfo
;
}
...
...
@@ -93,10 +101,24 @@ public class ServiceHGSC004 extends ServiceBase {
this
.
checkSaveData
(
hgsc004
,
hgsc003
);
if
(
Objects
.
nonNull
(
hgsc004
.
getId
())&&
hgsc004
.
getId
()!=
0
){
DaoUtils
.
update
(
HGSC004
.
UPDATE
,
hgsc004
);
//变更清单里面的公司、项目信息
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"materialId"
,
hgsc004
.
getId
());
List
<
HGSC004A
>
hgsc004AList
=
dao
.
query
(
HGSC004A
.
QUERY_ALL
,
map
,
0
,
-
999999
);
hgsc004AList
.
forEach
(
o
->{
o
.
setProjCode
(
hgsc004
.
getProjCode
());
o
.
setProjName
(
hgsc004
.
getProjName
());
o
.
setCompanyCode
(
hgsc004
.
getCompanyCode
());
o
.
setCompanyName
(
hgsc004
.
getCompanyName
());
});
DaoUtils
.
updateBatch
(
HGSC004A
.
UPDATE
,
hgsc004AList
);
}
else
{
hgsc004
.
setMaterialStatus
(
HGConstant
.
MaterialStatus
.
WTJ
);
DaoUtils
.
insert
(
HGSC004
.
INSERT
,
hgsc004
);
this
.
insertTree
(
hgsc004
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"保存成功!"
);
}
catch
(
Exception
e
)
{
...
...
@@ -112,6 +134,7 @@ public class ServiceHGSC004 extends ServiceBase {
*/
private
void
checkSaveData
(
HGSC004
hgsc004
,
HGSC003
hgsc003
)
{
if
(
Objects
.
nonNull
(
hgsc004
.
getId
())&&
hgsc004
.
getId
()>
0
){
AssertUtils
.
isTrue
(
hgsc004
.
getMaterialStatus
().
compareTo
(
HGConstant
.
MaterialStatus
.
WTJ
)
>
0
,
"非未提交不可修改!"
);
AssertUtils
.
isTrue
(
hgsc003
.
getBlueprintStatus
().
compareTo
(
HGConstant
.
EnablingStatus
.
TY
)
==
0
,
"蓝图已停用不可修改!"
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -134,6 +157,46 @@ public class ServiceHGSC004 extends ServiceBase {
}
/**
* 录入树结构
*
* @param hgsc004
*/
private
void
insertTree
(
HGSC004
hgsc004
)
{
//变更清单里面的公司、项目信息
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"companyCode"
,
hgsc004
.
getCompanyCode
());
map
.
put
(
"projCode"
,
hgsc004
.
getProjCode
());
List
<
HGSC004A
>
hgsc004AList
=
dao
.
query
(
HGSC004A
.
QUERY_ALL
,
map
,
0
,
-
999999
);
if
(
CollectionUtils
.
isEmpty
(
hgsc004AList
)){
//录入树结构,公司
HGSC004A
rootHgsc004A
=
new
HGSC004A
();
BeanUtil
.
copyProperties
(
hgsc004
,
rootHgsc004A
,
"id"
);
//因为获取不到id,所以根据公司编号+项目编号得到树结构
rootHgsc004A
.
setMaterialId
(
hgsc004
.
getId
());
rootHgsc004A
.
setParentProdCode
(
"root"
);
rootHgsc004A
.
setParentProdName
(
hgsc004
.
getCompanyName
());
rootHgsc004A
.
setLeaf
(
2
);
//有叶子节点
rootHgsc004A
.
setLv
(
1
);
rootHgsc004A
.
setSort
(
1
);
rootHgsc004A
.
setProductCode
(
hgsc004
.
getCompanyCode
());
rootHgsc004A
.
setProductName
(
hgsc004
.
getCompanyName
());
DaoUtils
.
insert
(
HGSC004A
.
INSERT
,
rootHgsc004A
);
//录入2级目录,项目
HGSC004A
projectHgsc004A
=
new
HGSC004A
();
BeanUtil
.
copyProperties
(
hgsc004
,
projectHgsc004A
,
"id"
);
projectHgsc004A
.
setMaterialId
(
hgsc004
.
getId
());
projectHgsc004A
.
setParentProdCode
(
rootHgsc004A
.
getProductCode
());
projectHgsc004A
.
setParentProdName
(
rootHgsc004A
.
getProductName
());
projectHgsc004A
.
setLeaf
(
2
);
//有叶子节点
projectHgsc004A
.
setLv
(
2
);
projectHgsc004A
.
setSort
(
1
);
projectHgsc004A
.
setProductCode
(
hgsc004
.
getProjCode
());
projectHgsc004A
.
setProductName
(
hgsc004
.
getProjName
());
DaoUtils
.
insert
(
HGSC004A
.
INSERT
,
projectHgsc004A
);
}
}
}
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC004A.java
View file @
f37e2510
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
c
n.hutool.core.bean.BeanUtil
;
import
c
om.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.OrgTypeEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005A
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.hg.sc.domain.HGSC003
;
import
com.baosight.hggp.hg.sc.domain.HGSC004
;
import
com.baosight.hggp.hg.sc.domain.HGSC004A
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.resource.I18nMessages
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.core.util.StringUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
...
...
@@ -33,7 +36,7 @@ public class ServiceHGSC004A extends ServiceBase {
Map
map
=
new
HashMap
();
map
.
put
(
HGSC004A
.
FIELD_account_code
,
UserSessionUtils
.
getAccountCode
());
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_RECORD
_BLOCK_ID
),
map
,
false
Arrays
.
asList
(
DdynamicEnum
.
PRODUCT
_BLOCK_ID
),
map
,
false
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
@@ -47,7 +50,7 @@ public class ServiceHGSC004A extends ServiceBase {
Map
map
=
new
HashMap
();
map
.
put
(
HGSC004A
.
FIELD_account_code
,
UserSessionUtils
.
getAccountCode
());
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_RECORD
_BLOCK_ID
),
map
,
false
Arrays
.
asList
(
DdynamicEnum
.
PRODUCT
_BLOCK_ID
),
map
,
false
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
}
catch
(
PlatException
e
)
{
...
...
@@ -62,7 +65,7 @@ public class ServiceHGSC004A extends ServiceBase {
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 蓝图ids
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
HGSC004A
.
FIELD_id
);
//
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
DaoUtils
.
update
(
HGSC004A
.
BATCH_DELETE
,
new
HashMap
<
String
,
Object
>(){{
put
(
"ids"
,
ids
);}});
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
...
...
@@ -72,28 +75,36 @@ public class ServiceHGSC004A extends ServiceBase {
return
inInfo
;
}
public
EiInfo
batchSubmit
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 蓝图ids
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
"id"
);
// DaoUtils.update(HGSC004A.BATCH_SUBMIT, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据停用成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
}
return
inInfo
;
}
public
EiInfo
save
(
EiInfo
inInfo
){
try
{
Map
resultMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
,
EiConstant
.
resultBlock
);
HGSC004A
hgsc004a
=
new
HGSC004A
();
hgsc004a
.
fromMap
(
resultMap
);
//蓝图信息,用于蓝图状态校验
HGSC003
hgsc003
=
(
HGSC003
)
super
.
dao
.
get
(
HGSC003
.
QUERY
,
HGSC004A
.
FIELD_id
,
hgsc004a
.
getId
());
//主表信息,用于取值
Long
materialId
=
Long
.
valueOf
(
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSC004A
.
FIELD_material_id
));
HGSC004
hgsc004
=
(
HGSC004
)
super
.
dao
.
get
(
HGSC004
.
QUERY
,
HGSC004A
.
FIELD_id
,
materialId
);
if
(
Objects
.
nonNull
(
hgsc004
)){
hgsc004a
.
setCompanyCode
(
hgsc004
.
getCompanyCode
());
hgsc004a
.
setCompanyName
(
hgsc004
.
getCompanyName
());
hgsc004a
.
setProjCode
(
hgsc004
.
getProjCode
());
hgsc004a
.
setProjName
(
hgsc004
.
getProjName
());
hgsc004a
.
setDepCode
(
hgsc004
.
getDepCode
());
hgsc004a
.
setDepName
(
hgsc004
.
getDepName
());
hgsc004a
.
setMaterialId
(
hgsc004
.
getId
());
hgsc004a
.
setLv
(
hgsc004a
.
getLv
()
+
1
);
//不为4级都有叶子节点
if
(
hgsc004a
.
getLv
().
intValue
()
<=
4
){
hgsc004a
.
setLeaf
(
2
);
}
else
{
hgsc004a
.
setLeaf
(
1
);
}
}
this
.
checkSaveData
(
hgsc004a
,
hgsc003
);
if
(
Objects
.
nonNull
(
hgsc004a
.
getId
())&&
hgsc004a
.
getId
()!=
0
){
DaoUtils
.
update
(
HGSC004A
.
UPDATE
,
hgsc004a
);
...
...
@@ -126,72 +137,92 @@ public class ServiceHGSC004A extends ServiceBase {
}
/**
* 指定树节点
* @param inInfo
* @return
*/
public
EiInfo
queryTreeRoot
(
EiInfo
inInfo
)
{
String
orgEname
=
StringUtils
.
toString
(
inInfo
.
get
(
"orgEname"
));
Map
queryMap
=
new
HashMap
();
String
root
=
""
;
if
(
orgEname
!=
null
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"orgEname"
,
orgEname
);
map
.
put
(
"orgType"
,
OrgTypeEnum
.
COMPANY
.
getCode
());
Org
org
=
(
Org
)
dao
.
get
(
"HGSC004A.queryCompany"
,
"id"
,
orgEname
);
root
=
org
.
getOrgEname
()
+
":"
+
org
.
getOrgCname
();
}
inInfo
.
set
(
"root"
,
root
);
return
inInfo
;
}
//树查询服务
public
EiInfo
queryTreeNode
(
EiInfo
inInfo
)
{
//1 获取参数
String
pEname
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
0
,
"node"
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
equals
(
"$"
,
pEname
)){
pEname
=
"root"
;
}
Long
projId
=
NumberUtils
.
toLong
(
inInfo
.
get
(
"projId"
));
String
orgEname
=
StringUtils
.
toString
(
inInfo
.
get
(
"orgEname"
));
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
node
=
MapUtils
.
getString
(
queryRow
,
"node"
);
//获取物料详情数据
String
projCode
=
StringUtils
.
toString
(
inInfo
.
get
(
"projCode"
));
String
companyCode
=
StringUtils
.
toString
(
inInfo
.
get
(
"companyCode"
));
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"companyCode"
,
pEname
);
if
(
orgEname
!=
null
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"orgEname"
,
orgEname
);
List
list
=
dao
.
query
(
"HGSC004A.queryCompany"
,
map
);
if
(
list
.
size
()
>
0
)
{
queryMap
.
put
(
"orgEname"
,
orgEname
);
}
}
queryMap
.
put
(
"companyCode"
,
com
.
baosight
.
hggp
.
util
.
StringUtils
.
isNotBlank
(
companyCode
)
?
companyCode
:
"null"
);
queryMap
.
put
(
"projCode"
,
com
.
baosight
.
hggp
.
util
.
StringUtils
.
isNotBlank
(
projCode
)
?
projCode
:
"null"
);
queryMap
.
put
(
"pEname"
,
"$"
.
equals
(
node
)
?
"root"
:
node
);
//2 查询节点
List
rows
=
dao
.
query
(
"HGSC004A.query"
,
queryMap
);
List
rows
=
dao
.
query
(
"HGSC004A.query
Tree
"
,
queryMap
);
//3 增加节点block块
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
outBlock
=
outInfo
.
addBlock
(
BeanUtil
.
isEmpty
(
pEname
)
?
""
:
pEnam
e
);
EiBlock
outBlock
=
outInfo
.
addBlock
(
nod
e
);
outBlock
.
addRows
(
rows
);
return
outInfo
;
}
/**
*
修改父级节点的LEAF状态为1
*
下拉框
*
* @param id
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"存货档案"
,
operType
=
"查询"
,
operDesc
=
"下拉框"
)
public
EiInfo
queryProductComboBox
(
EiInfo
inInfo
)
{
try
{
List
<
DdynamicEnum
>
list
=
new
ArrayList
<>();
list
.
add
(
DdynamicEnum
.
PRODUCT_BLOCK_ID
);
CommonMethod
.
initBlock
(
inInfo
,
list
,
EiInfoUtils
.
getFirstRow
(
inInfo
),
false
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询存货档案失败"
);
}
return
inInfo
;
}
public
void
checkTreeNodeLeaf
(
Long
id
)
{
EiInfo
eiInfo
=
new
EiInfo
();
//1 获取参数
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"id"
,
id
);
// List rows = this.dao.query("HPSC002.queryTreeNodeByParentPrtdCode", queryMap);
// if(rows.size() > 0){
// queryMap.put("leaf", "0");
// }else{
// queryMap.put("leaf", "1");
// }
// DaoUtils.update("HPSC002.updateTreeNodeLeaf", queryMap);
/**
* 修改提交状态
* @param inInfo
* @return
*/
public
EiInfo
updateProductStatus
(
EiInfo
inInfo
){
int
i
=
0
;
try
{
HGSC004A
hgsc004a
=
new
HGSC004A
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hgsc004a
.
fromMap
(
map
);
DaoUtils
.
update
(
HGSC004A
.
UPDATE_PRODUCT_STATUS
,
hgsc004a
);
}
HGSC004
hgsc004
=
(
HGSC004
)
super
.
dao
.
get
(
HGSC004
.
QUERY
,
HGSC001
.
FIELD_id
,
hgsc004a
.
getMaterialId
());
if
(
Objects
.
nonNull
(
hgsc004
)){
if
(
hgsc004
.
getMaterialStatus
().
intValue
()
==
HGConstant
.
MaterialStatus
.
WTJ
.
intValue
()){
//如果是未提交则修改为部分提交
hgsc004
.
setMaterialStatus
(
HGConstant
.
MaterialStatus
.
BFTJ
);
DaoUtils
.
update
(
HGSC004
.
UPDATE_MATERIAL_STATUS
,
hgsc004
);
}
else
if
(
hgsc004
.
getMaterialStatus
().
intValue
()
==
HGConstant
.
MaterialStatus
.
BFTJ
.
intValue
()){
//如果不存在未提交的,就标记主表为全部提交
Map
<
String
,
Object
>
mapA
=
new
HashMap
<>();
mapA
.
put
(
"materialId"
,
hgsc004a
.
getMaterialId
());
mapA
.
put
(
"productStatus"
,
HGConstant
.
ProductStatus
.
WTJ
);
mapA
.
put
(
"notId"
,
hgsc004a
.
getId
());
List
<
HGSC004A
>
hgsc004AList
=
dao
.
query
(
HGSC004A
.
QUERY_ALL
,
mapA
,
0
,
-
999999
);
if
(!
CollectionUtils
.
isEmpty
(
hgsc004AList
)){
hgsc004
.
setMaterialStatus
(
HGConstant
.
MaterialStatus
.
QBTJ
);
DaoUtils
.
update
(
HGSC004
.
UPDATE_MATERIAL_STATUS
,
hgsc004
);
}
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"修改"
)});
}
catch
(
PlatException
e
)
{
e
.
printStackTrace
();
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
ErrorCodeUtils
.
handleUpdateException
(
inInfo
,
i
,
e
);
logError
(
"修改失败"
,
e
.
getMessage
());
return
inInfo
;
}
return
inInfo
;
}
}
...
...
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC004.xml
View file @
f37e2510
...
...
@@ -60,6 +60,12 @@
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"delStatus"
>
del_status = #delStatus#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
@@ -77,6 +83,7 @@
proj_name as "projName",
<!-- 项目名称 -->
material_status as "materialStatus",
<!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
approval_status as "approvalStatus",
<!-- 审批状态 0:待审;1:审核中;2:已审 -->
del_status as "delStatus",
<!-- 数据状态 0:保存,1:删除 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
...
...
@@ -99,65 +106,6 @@
<include
refid=
"condition"
/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintId">
blueprint_id = #blueprintId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintCode">
blueprint_code = #blueprintCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="blueprintName">
blueprint_name = #blueprintName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialStatus">
material_status = #materialStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGSC004 (id,
<!-- 主键 -->
...
...
@@ -171,6 +119,7 @@
proj_code,
<!-- 项目编码 -->
proj_name,
<!-- 项目名称 -->
material_status,
<!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status,
<!-- 数据状态 0:保存,1:删除 -->
approval_status,
<!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code,
<!-- 帐套 -->
created_by,
<!-- 创建人 -->
...
...
@@ -180,7 +129,7 @@
updated_name,
<!-- 修改人名称 -->
updated_time
<!-- 更新时间 -->
)
VALUES (#id#, #blueprintId#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #materialStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #blueprintId#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #materialStatus#, #
delStatus#, #
approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete
id=
"delete"
>
...
...
@@ -200,6 +149,7 @@
proj_code = #projCode#,
<!-- 项目编码 -->
proj_name = #projName#,
<!-- 项目名称 -->
material_status = #materialStatus#,
<!-- 物料状态 0:未提交,1:部分提交,2:全部提交 -->
del_status = #delStatus#,
<!-- 数据状态 0:保存,1:删除 -->
approval_status = #approvalStatus#,
<!-- 审批状态 0:待审;1:审核中;2:已审 -->
account_code = #accountCode#,
<!-- 帐套 -->
created_by = #createdBy#,
<!-- 创建人 -->
...
...
@@ -215,4 +165,26 @@
DELETE FROM ${hggpSchema}.HGSC004 WHERE
id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</delete>
<update
id=
"updateDel"
>
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
DEL_STATUS = 1
<!-- 数据状态 0:保存,1:删除 -->
WHERE
ID = #id#
</update>
<update
id=
"updateMaterialStatus"
>
UPDATE ${hggpSchema}.HGSC004
SET
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
MATERIAL_STATUS = #materialStatus#
WHERE
ID = #id#
</update>
</sqlMap>
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC004A.xml
View file @
f37e2510
...
...
@@ -2,87 +2,7 @@
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HGSC004A"
>
<sql
id=
"condition"
>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
company_name = #companyName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depCode"
>
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depName"
>
dep_name = #depName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
proj_name = #projName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parentProdCode"
>
parent_prod_code = #parentProdCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parentProdName"
>
parent_prod_name = #parentProdName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"materialId"
>
material_id = #materialId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"productCode"
>
product_code = #productCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"productName"
>
product_name = #productName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"productStatus"
>
product_status = #productStatus#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"changeType"
>
change_type = #changeType#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"quantity"
>
quantity = #quantity#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"singleWeight"
>
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"totalWeight"
>
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"approvalStatus"
>
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdBy"
>
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdName"
>
created_name = #createdName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdTime"
>
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedBy"
>
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedName"
>
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
updated_time = #updatedTime#
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC004A"
>
SELECT
<sql
id=
"column"
>
id as "id",
<!-- 主键 -->
company_code as "companyCode",
<!-- 公司编码(预留) -->
company_name as "companyName",
<!-- 公司名称(预留) -->
...
...
@@ -93,6 +13,8 @@
parent_prod_code as "parentProdCode",
<!-- 父节点-产品编码 -->
parent_prod_name as "parentProdName",
<!-- 父节点-产品名称 -->
material_id as "materialId",
<!-- 物料清单id -->
product_id as "productId",
<!-- 产品id -->
product_type as "productType",
<!-- 产品类别 -->
product_code as "productCode",
<!-- 产品编号 -->
product_name as "productName",
<!-- 产品名称 -->
product_status as "productStatus",
<!-- 产品状态 0:未提交,1:已提交 -->
...
...
@@ -101,6 +23,9 @@
single_weight as "singleWeight",
<!-- 单重 -->
total_weight as "totalWeight",
<!-- 总重 -->
approval_status as "approvalStatus",
<!-- 审批状态 0:待审;1:审核中;2:已审 -->
leaf as "leaf",
<!-- 是否有叶子节点 -->
sort as "sort",
<!-- 排序字段 -->
lv as "lv",
<!-- 层级 -->
account_code as "accountCode",
<!-- 帐套 -->
created_by as "createdBy",
<!-- 创建人 -->
created_name as "createdName",
<!-- 创建人名称 -->
...
...
@@ -108,22 +33,8 @@
updated_by as "updatedBy",
<!-- 更新人 -->
updated_name as "updatedName",
<!-- 修改人名称 -->
updated_time as "updatedTime"
<!-- 更新时间 -->
FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include
refid=
"condition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include
refid=
"condition"
/>
</select>
<!--
</sql>
<sql
id=
"condition"
>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
id = #id#
</isNotEmpty>
...
...
@@ -199,7 +110,54 @@
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
updated_time = #updatedTime#
</isNotEmpty>
-->
<isNotEmpty
prepend=
" AND "
property=
"materialIds"
>
material_Id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"materialIds"
>
#materialIds[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"productId"
>
product_id = #productId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"productType"
>
product_type = #productType#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"notId"
>
id != #notId#
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC004A"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGSC004A WHERE 1=1
AND lv NOT IN (1,2)
<include
refid=
"condition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select
id=
"queryAll"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hggp.hg.sc.domain.HGSC004A"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include
refid=
"condition"
/>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
</dynamic>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include
refid=
"condition"
/>
</select>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGSC004A (id,
<!-- 主键 -->
...
...
@@ -211,7 +169,12 @@
proj_name,
<!-- 项目名称(预留) -->
parent_prod_code,
<!-- 父节点-产品编码 -->
parent_prod_name,
<!-- 父节点-产品名称 -->
leaf,
<!-- 是否有叶子节点 -->
sort,
<!-- 排序字段 -->
lv,
<!-- 层级 -->
material_id,
<!-- 物料清单id -->
product_id,
<!-- 产品id -->
product_type,
<!-- 产品类别 -->
product_code,
<!-- 产品编号 -->
product_name,
<!-- 产品名称 -->
product_status,
<!-- 产品状态 0:未提交,1:已提交 -->
...
...
@@ -228,7 +191,11 @@
updated_name,
<!-- 修改人名称 -->
updated_time
<!-- 更新时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #parentProdCode#, #parentProdName#, #materialId#, #productCode#, #productName#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#,
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#)
</insert>
<delete
id=
"delete"
>
...
...
@@ -246,7 +213,12 @@
proj_name = #projName#,
<!-- 项目名称(预留) -->
parent_prod_code = #parentProdCode#,
<!-- 父节点-产品编码 -->
parent_prod_name = #parentProdName#,
<!-- 父节点-产品名称 -->
leaf = #leaf#,
<!-- 是否有叶子节点 -->
sort = #sort#,
<!-- 排序字段 -->
lv = #lv#,
<!-- 层级 -->
material_id = #materialId#,
<!-- 物料清单id -->
product_id = #productId#,
<!-- 产品id -->
product_type = #productType#,
<!-- 产品类别 -->
product_code = #productCode#,
<!-- 产品编号 -->
product_name = #productName#,
<!-- 产品名称 -->
product_status = #productStatus#,
<!-- 产品状态 0:未提交,1:已提交 -->
...
...
@@ -271,8 +243,8 @@
select
a.ORG_ENAME as "orgEname",
a.ORG_CNAME as "orgCname"
from
iplat_hggp
.txsog01 a
left join
iplat_hggp
.txsog02 b on a.ORG_ID = b.ORG_ID
from
${platSchema}
.txsog01 a
left join
${platSchema}
.txsog02 b on a.ORG_ID = b.ORG_ID
where
a.ACCOUNT_CODE = #accountCode#
and a.ORG_TYPE = #orgType#
...
...
@@ -280,4 +252,60 @@
a.ORG_ENAME = #orgEname#
</isNotEmpty>
</select>
<select
id=
"queryTree"
resultClass=
"java.util.HashMap"
>
SELECT
PRODUCT_CODE as "nodeId",
product_id as "productId",
<!-- 产品id -->
product_type as "productType",
<!-- 产品类别 -->
PRODUCT_CODE as "productCode",
<!-- 产品编码 -->
PROJ_CODE as "projCode",
<!-- 项目编码 -->
PROJ_NAME as "projName",
<!-- 项目名称 -->
PRODUCT_NAME as "productName",
<!-- 产品名称 -->
PRODUCT_CODE as "label",
<!-- 名部件编码-->
case when lv = 3 then concat(PRODUCT_CODE,' ',PRODUCT_NAME) else PRODUCT_NAME end as "text",
<!-- 部件名称 -->
PARENT_PROD_CODE as "pId",
<!-- 父节点编码 -->
PARENT_PROD_NAME as "pName",
<!-- 父节点名称 -->
LEAF as "leaf",
<!-- 是否有叶子节点 -->
SORT as "sort",
<!-- 排序字段 -->
lv as "lv"
FROM
${hggpSchema}.HGSC004A
WHERE 1=1
<isNotEmpty
prepend=
" AND "
property=
"pEname"
>
PARENT_PROD_CODE = #pEname#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"materialId"
>
MATERIAL_ID = #materialId#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
</select>
<delete
id=
"batchDelete"
>
DELETE FROM ${hggpSchema}.HGSC004A WHERE
id IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</delete>
<update
id=
"updateProductStatus"
>
UPDATE ${hggpSchema}.HGSC004A
SET
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
PRODUCT_STATUS = #productStatus#
<!-- 产品状态 0:未提交,1:已提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
src/main/webapp/HG/SC/HGSC004.js
View file @
f37e2510
...
...
@@ -33,7 +33,7 @@ $(function (){
let
template
=
''
;
if
(
item
.
id
){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
',
\'
'
+
item
.
blueprintCode
+
'
\'
,
\'
'
+
item
.
blueprintName
+
'
\'
,
\'
'
+
item
.
companyNam
e
+
'
\'
)" >物料清单</a>'
;
+
'onclick="showDetail('
+
item
.
id
+
',
\'
'
+
item
.
companyCode
+
'
\'
,
\'
'
+
item
.
projCod
e
+
'
\'
)" >物料清单</a>'
;
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showUploadFile('
+
item
.
id
+
')" >附件</a>'
;
}
...
...
@@ -218,9 +218,9 @@ let save = function (btnNode) {
/**
* 显示详情
*/
function
showDetail
(
id
)
{
function
showDetail
(
id
,
companyCode
,
projCode
)
{
JSColorbox
.
open
({
href
:
"HGSC004A?methodName=initLoad&inqu_status-0-materialId="
+
id
,
href
:
"HGSC004A?
companyCode="
+
companyCode
+
"&projCode="
+
projCode
+
"&
methodName=initLoad&inqu_status-0-materialId="
+
id
,
title
:
"<div style='text-align: center;'>蓝图清单详情</div>"
,
width
:
"80%"
,
height
:
"80%"
,
...
...
src/main/webapp/HG/SC/HGSC004A.js
View file @
f37e2510
var
inventNameGlobalData
=
[];
// 传递参数 将附件ID与当前记录ID进行绑定
// let rowId = '';
let
parentId
=
''
;
let
projCode
=
''
;
var
strs
;
var
url
=
location
.
search
;
//获取url中"?"符后的字串
if
(
url
.
indexOf
(
"?"
)
!=
-
1
)
{
//判断是否有参数
var
str
=
url
.
substr
(
1
);
//从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
strs
=
str
.
split
(
"="
);
//用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
// console.log('strs=' + strs) //直接弹出第一个参数 (如果有多个参数 还要进行循环的)
}
var
companyCode
=
''
;
$
(
function
()
{
var
productCodeBox
=
__eiInfo
.
getBlock
(
"product_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
$
(
"#QUERY"
).
on
(
"click"
,
function
()
{
query
();
});
let
inventNameGlobalData
=
[];
let
parentId
=
''
;
var
strs
;
var
url
=
location
.
search
;
//获取url中"?"符后的字串
if
(
url
.
indexOf
(
"?"
)
!=
-
1
)
{
//判断是否有参数
var
str
=
url
.
substr
(
1
);
//从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
strs
=
str
.
split
(
"&"
);
//用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
//完全确定的数据,不能复用,获取公司编码
companyCode
=
strs
[
0
].
split
(
"="
)[
1
];
projCode
=
strs
[
1
].
split
(
"="
)[
1
];
}
IPLATUI
.
EFTree
=
{
"materialTree"
:
{
ROOT
:
"root:公司列表"
,
//
ROOT: "root:公司列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
query
:
function
(
postEiInfo
,
model
)
{
postEiInfo
.
set
(
"companyCode"
,
strs
?
strs
[
1
]
:
null
);
postEiInfo
.
set
(
"companyCode"
,
companyCode
?
companyCode
:
null
);
postEiInfo
.
set
(
"projCode"
,
projCode
?
projCode
:
null
);
return
postEiInfo
;
},
loadComplete
:
function
(
options
)
{
...
...
@@ -40,30 +52,122 @@ $(function () {
*/
select
:
function
(
e
)
{
var
nodeData
=
this
.
dataItem
(
e
.
node
);
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
nodeId
=
nodeData
.
nodeId
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
prdtCode
=
nodeData
.
prdtCode
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
projCode
=
nodeData
.
projCode
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
prdtName
=
nodeData
.
prdtName
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
projName
=
nodeData
.
projName
;
// 重新查询EFGrid
parentId
=
nodeData
.
nodeId
;
// 选择最后一级时,自动点击上一级
if
(
nodeData
.
lv
==
4
)
{
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
nodeId
=
nodeData
.
pId
;
// 刷新树
refreshTree
();
}
else
{
let
eiInfo
=
new
EiInfo
();
if
(
nodeData
.
lv
==
2
)
{
eiInfo
.
set
(
"inqu_status-0-parInventType"
,
"root"
);
}
else
if
(
nodeData
.
lv
==
3
)
{
eiInfo
.
set
(
"inqu_status-0-parInventType"
,
nodeData
.
productType
);
}
var
dataSource
;
EiCommunicator
.
send
(
"HGSC004A"
,
"queryProductComboBox"
,
eiInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"product_block_id"
).
getMappedRows
();
productCodeBox
=
dataSource
;
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
// 设置树节点的值
setTreeNodeValue
(
nodeData
);
}
// 动态显示列名
dynamicColumnName
();
// 刷新列表数据
$
(
"#inqu_status-0-parentProdCode"
).
val
(
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
nodeId
);
query
();
},
selectTreeNode
:
{}
}
};
$
(
"#QUERY"
).
on
(
"click"
,
function
()
{
query
();
});
IPLATUI
.
EFGrid
=
{
result
:
{
pageable
:
{
pageSize
:
10
,
pageSizes
:
[
10
,
20
,
50
,
100
,
200
],
},
columns
:
[
{
field
:
"operator"
,
title
:
"操作"
,
template
:
function
(
item
)
{
let
status
=
item
.
productStatus
;
let
template
=
''
;
if
(
item
.
id
){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
')" >变更详情</a>'
;
if
(
status
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="updateProductStatus('
+
item
.
id
+
',1)" >提交</a>'
;
}
// else if (status == 1) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
// 'onclick="updateProductStatus(' + item.id + ',0)" >取消提交</a>';
// }
}
return
template
;
}
},
{
field
:
"productCode"
,
template
:
function
(
item
)
{
let
template
=
""
;
if
(
item
.
productCode
){
for
(
let
i
=
0
;
i
<
productCodeBox
.
length
;
i
++
){
if
(
item
.
productCode
===
productCodeBox
[
i
][
'valueField'
]){
item
[
'productName'
]
=
productCodeBox
[
i
][
'textField'
];
item
[
'productId'
]
=
productCodeBox
[
i
][
'param1Field'
];
item
[
'productType'
]
=
productCodeBox
[
i
][
'param2Field'
];
console
.
log
(
item
)
template
=
productCodeBox
[
i
][
'valueField'
];
}
}
}
return
template
;
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-companyCode"
,
options
.
model
[
"companyCode"
]);
var
nodeData
=
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
;
if
(
nodeData
.
lv
==
2
)
{
inInfo
.
set
(
"inqu_status-0-parInventType"
,
"root"
);
}
else
if
(
nodeData
.
lv
==
3
)
{
inInfo
.
set
(
"inqu_status-0-parInventType"
,
nodeData
.
productType
);
}
else
if
(
nodeData
.
lv
==
4
)
{
//上方刷新过树结构了
inInfo
.
set
(
"inqu_status-0-parInventType"
,
nodeData
.
productType
);
}
inInfo
.
set
(
"field"
,
options
.
field
);
let
dataSource
=
inventNameGlobalData
;
EiCommunicator
.
send
(
"HGSC004A"
,
"queryProductComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"product_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
dataSource
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"[#:valueField#]#:textField#"
,
valueTemplate
:
"[#:valueField#]#:textField#"
,
template
:
"[#:valueField#]#:textField#"
,
filter
:
"contains"
});
}
}
],
loadComplete
:
function
(
grid
)
{
// 在Grid加载完成后,才能给Grid上的按钮绑定事件
$
(
"#SC02"
).
on
(
"click"
,
function
()
{
if
(
grid
.
getCheckedBlockData
().
rows
.
length
===
0
)
{
...
...
@@ -76,7 +180,17 @@ $(function () {
}
else
{
console
.
log
(
grid
.
getCheckedBlockData
().
rows
[
0
][
10
]);
}
});
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
// 判断父级节点是否发生变化
if
(
e
.
field
==
"productCode"
)
{
loadChange
(
grid
,
e
,
"productId"
);
loadChange
(
grid
,
e
,
"productType"
);
loadChange
(
grid
,
e
,
"productName"
);
}
});
},
onSuccess
:
function
(
e
)
{
...
...
@@ -85,16 +199,6 @@ $(function () {
query
();
}
},
query
:
function
()
{
var
ei
=
new
EiInfo
();
ei
.
set
(
"inqu_status-0-prdtType"
,
$
(
"#inqu_status-0-prdtType"
).
val
());
ei
.
set
(
"inqu_status-0-prdtCode"
,
$
(
"#inqu_status-0-prdtCode"
).
val
());
ei
.
set
(
"inqu_status-0-status"
,
$
(
"#inqu_status-0-status"
).
val
());
ei
.
set
(
"inqu_status-0-parentId"
,
parentId
?
parentId
:
strs
[
1
]);
// ei.set("inqu_status-0-parentId",-1);
return
ei
;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
...
...
@@ -127,6 +231,17 @@ $(function () {
});
e
.
preventDefault
();
}
var
logicLv
=
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
lv
===
'1'
?
true
:
false
;
if
(
logicLv
)
{
// 通过业务逻辑判断, 控制是否进行新增
IPLAT
.
alert
({
message
:
'<b>请选择项目或产品层级</b>'
,
okFn
:
function
(
e
)
{
},
title
:
'提示'
});
e
.
preventDefault
();
}
},
/**
* EFGrid新增行时触发的事件,此时数据行tr元素还未渲染
...
...
@@ -142,8 +257,9 @@ $(function () {
$
.
each
(
e
.
items
,
function
(
index
,
item
)
{
item
[
'projCode'
]
=
selectTreeNode
.
projCode
;
item
[
'projName'
]
=
selectTreeNode
.
projName
;
item
[
'parentId'
]
=
selectTreeNode
.
nodeId
;
item
[
'parentPrdtName'
]
=
selectTreeNode
.
prdtName
;
item
[
'parentProdCode'
]
=
selectTreeNode
.
nodeId
;
item
[
'parentProdName'
]
=
selectTreeNode
.
pName
;
item
[
'lv'
]
=
selectTreeNode
.
lv
;
});
},
/**
...
...
@@ -152,7 +268,13 @@ $(function () {
* e.sender Grid对象
*/
onSave
:
function
(
e
)
{
// 不向后台保存
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
let
btnNode
=
$
(
this
);
//禁用按钮
btnNode
.
attr
(
"disabled"
,
true
);
save
(
btnNode
);
var
tree
=
$
(
"#materialTree"
).
data
(
"kendoTreeView"
);
var
inInfo
=
new
EiInfo
();
EiCommunicator
.
send
(
"HGSC004A"
,
"queryTreeNode"
,
inInfo
,
{
//传入参数
...
...
@@ -176,6 +298,7 @@ $(function () {
tree
.
reload
(
"root"
);
//更新树
}
});
refreshTree
();
},
toolbarConfig
:
{
hidden
:
false
,
// true时,不显示功能按钮,但保留setting导出按钮
...
...
@@ -183,33 +306,6 @@ $(function () {
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete
:
true
,
// 显示删除按钮
},
columns
:
[
{
field
:
"operator"
,
template
:
function
(
item
)
{
console
.
log
(
item
)
let
auditStatus
=
item
.
status
;
let
leaf
=
item
.
leaf
let
template
=
''
;
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showUploadFile('
+
item
.
id
+
')" >附件清单</a>'
;
if
(
leaf
===
'1'
)
{
if
(
auditStatus
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="check('
+
item
.
id
+
',1)" >审核</a>'
;
}
else
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="check('
+
item
.
id
+
',0)" >反审</a>'
;
}
}
return
template
;
}
}
],
loadComplete
:
function
(
grid
)
{
}
},
};
...
...
@@ -250,7 +346,7 @@ $(function () {
inInfo
.
set
(
"inventType"
,
prdtType
);
EiCommunicator
.
send
(
"HPPZ004"
,
"queryComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
var
input
=
$
(
"#inqu_status-0-pr
d
tCode"
);
var
input
=
$
(
"#inqu_status-0-pr
oduc
tCode"
);
dataEdition
=
ei
.
getBlock
(
"invent_name_block_id"
).
getMappedRows
();
input
.
kendoDropDownList
({
valuePrimitive
:
true
,
...
...
@@ -312,3 +408,137 @@ function check(id, auditStatus) {
}
);
}
/**
* 刷新树
*/
let
refreshTree
=
function
()
{
setTimeout
(()
=>
{
// 刷新树节点
const
tree
=
$
(
"#materialTree"
).
data
(
"kendoTreeView"
);
// 选中的节点
const
treeId
=
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
nodeId
;
tree
.
reload
(
treeId
)
// 展开成功后选中对应的树节点
expandTreeNode
(
tree
,
treeId
);
// 展开成功后选中对应的树节点
selectTreeNode
(
tree
,
treeId
);
},
500
);
}
/**
* 展开对应的树节点
*
* @param tree
* @param treeId
*/
let
expandTreeNode
=
function
(
tree
,
treeId
)
{
if
(
!
tree
||
treeId
==
null
)
{
return
}
setTimeout
(()
=>
{
let
barDataItem
=
tree
.
dataSource
.
get
(
treeId
);
if
(
barDataItem
)
{
tree
.
expandPath
([
treeId
])
}
else
{
expandTreeNode
(
tree
,
treeId
)
}
},
300
);
}
/**
* 选中树节点
*
* @param tree
* @param treeId
*/
let
selectTreeNode
=
(
tree
,
treeId
)
=>
{
if
(
!
tree
||
treeId
==
null
)
{
return
}
setTimeout
(()
=>
{
let
barDataItem
=
tree
.
dataSource
.
get
(
treeId
);
if
(
barDataItem
)
{
let
barElement
=
tree
.
findByUid
(
barDataItem
.
uid
);
// 刷新完成后选中对应的树节点
tree
.
select
(
barElement
);
// 赋值
setTreeNodeValue
(
barDataItem
);
}
else
{
selectTreeNode
(
tree
,
treeId
)
}
},
300
)
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let
setTreeNodeValue
=
function
(
nodeData
)
{
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
nodeId
=
nodeData
.
nodeId
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
pId
=
nodeData
.
pId
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
pName
=
nodeData
.
pName
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
productType
=
nodeData
.
productType
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
productCode
=
nodeData
.
productCode
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
productName
=
nodeData
.
productName
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
projCode
=
nodeData
.
projCode
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
projName
=
nodeData
.
projName
;
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
lv
=
nodeData
.
lv
;
}
/**
* 保存
*/
let
save
=
function
(
btnNode
)
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
let
flag
=
true
;
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGSC004A"
,
"save"
,
true
,
function
(
e
)
{
query
();
});
btnNode
.
attr
(
"disabled"
,
false
);
}
});
}
}
/**
* 动态显示列名
*/
let
dynamicColumnName
=
function
()
{
// 根据叶子节点动态设置列名
let
lv
=
IPLATUI
.
EFTree
.
materialTree
.
selectTreeNode
.
lv
;
let
th
=
$
(
"th[data-field='prdtName']"
);
if
(
lv
==
2
)
{
th
.
html
(
"<span class=
\"
i-input-required
\"
>*</span>项目名称"
);
}
else
{
th
.
html
(
"<span class=
\"
i-input-required
\"
>*</span>产品名称"
);
}
}
function
updateProductStatus
(
id
,
status
)
{
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
inEiInfo
.
set
(
"result-0-productStatus"
,
status
);
inEiInfo
.
set
(
"result-0-materialId"
,
$
(
"#inqu_status-0-materialId"
).
val
());
EiCommunicator
.
send
(
'HGSC004A'
,
'updateProductStatus'
,
inEiInfo
,
{
onSuccess
(
response
)
{
NotificationUtil
(
response
.
msg
);
query
();
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
}
src/main/webapp/HG/SC/HGSC004A.jsp
View file @
f37e2510
...
...
@@ -4,11 +4,11 @@
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<head>
<
%
--
<
link
rel=
"stylesheet"
href=
"${ctx}/css/simulatedOperation.css"
/>
--%>
</head>
<EF:EFPage
title=
"物料清单详情"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFInput
ename=
"inqu_status-0-materialId"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-parentProdCode"
type=
"hidden"
/>
<div
class=
"row"
>
<EF:EFInput
ename=
"inqu_status-0-productName"
cname=
"产品名称"
colWidth=
"3"
/>
<EF:EFSelect
cname=
"变更类型"
ename=
"inqu_status-0-changeType"
colWidth=
"3"
filter=
"contains"
>
...
...
@@ -38,27 +38,23 @@
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"no"
checkMode=
"single"
>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"level"
cname=
"层级"
hidden=
"true"
/>
<EF:EFColumn
enable=
"false"
ename=
"projCode"
cname=
"项目编码"
/>
<EF:EFColumn
enable=
"false"
ename=
"projName"
cname=
"项目名称"
/>
<EF:EFComboColumn
cname=
"产品类型"
ename=
"prdtType"
width=
"90"
align=
"center"
required=
"true"
>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
condition=
"ITEM_CODE IN ('3','4')"
/>
<EF:EFColumn
ename=
"lv"
cname=
"层级"
hidden=
"true"
/>
<EF:EFColumn
enable=
"false"
ename=
"parentProdCode"
hidden=
"true"
cname=
"上级产品编号"
/>
<EF:EFColumn
enable=
"false"
ename=
"parentProdName"
hidden=
"true"
cname=
"上级产品名称"
/>
<EF:EFColumn
enable=
"false"
ename=
"productId"
hidden=
"true"
cname=
"产品id"
/>
<EF:EFColumn
enable=
"false"
ename=
"productType"
hidden=
"true"
cname=
"产品类型"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
width=
"140"
enable=
"false"
readonly=
"false"
/>
<EF:EFComboColumn
cname=
"变更类型"
ename=
"changeType"
width=
"90"
align=
"center"
enable=
"false"
required=
"false"
>
<EF:EFCodeOption
codeName=
"hggp.sc.changeType"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"inventRecordId"
required=
"true"
cname=
"产品名称"
/>
<EF:EFColumn
ename=
"prdtCode"
required=
"true"
cname=
"产品编码"
hidden=
"true"
/>
<EF:EFColumn
enable=
"false"
ename=
"parentId"
hidden=
"true"
cname=
"上级产品名称"
/>
<EF:EFColumn
enable=
"false"
ename=
"parentPrdtName"
cname=
"上级产品名称"
/>
<EF:EFColumn
ename=
"num"
required=
"true"
cname=
"数量"
/>
<EF:EFColumn
ename=
"unitWt"
required=
"true"
format=
"{0:N3}"
cname=
"单重"
/>
<EF:EFColumn
enable=
"false"
format=
"{0:N3}"
ename=
"totalWt"
cname=
"总重"
/>
<EF:EFComboColumn
enable=
"false"
ename=
"status"
align=
"center"
columnTemplate=
"#=textField#"
optionLabel=
" "
itemTemplate=
"#=textField#"
textField=
"textField"
valueField=
"valueField"
cname=
"审核状态"
>
<EF:EFOption
label=
"未审核"
value=
"0"
></EF:EFOption>
<EF:EFOption
label=
"已审核"
value=
"1"
></EF:EFOption>
<EF:EFColumn
ename=
"productCode"
required=
"true"
cname=
"产品编号"
/>
<EF:EFColumn
ename=
"productName"
cname=
"产品名称"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"quantity"
required=
"true"
cname=
"数量"
/>
<EF:EFColumn
ename=
"singleWeight"
required=
"true"
format=
"{0:N3}"
cname=
"单重(kg)"
/>
<EF:EFColumn
enable=
"true"
required=
"true"
format=
"{0:N3}"
ename=
"totalWeight"
cname=
"总重(kg)"
/>
<EF:EFComboColumn
cname=
"提交状态"
ename=
"productStatus"
width=
"90"
align=
"center"
required=
"false"
>
<EF:EFCodeOption
codeName=
"hggp.sc.productStatus"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
width=
"200"
enable=
"false"
readonly=
"false"
/>
</EF:EFGrid>
</EF:EFRegion>
</div>
...
...
@@ -68,4 +64,4 @@
let
ctx
=
"${ctx}"
;
</script>
<script
src=
"${ctx}/H
P
/SC/HGSC004A.js"
></script>
<script
src=
"${ctx}/H
G
/SC/HGSC004A.js"
></script>
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