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
6e56a112
Commit
6e56a112
authored
May 16, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-05-16 存货档案添加导入和流程关联
parent
aebb67c0
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
298 additions
and
22 deletions
+298
-22
DdynamicEnum.java
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
+2
-0
HGPZ005.java
src/main/java/com/baosight/hggp/hg/pz/domain/HGPZ005.java
+17
-0
ServiceHGPZ005.java
.../java/com/baosight/hggp/hg/pz/service/ServiceHGPZ005.java
+66
-1
HGPZ005.xml
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
+21
-4
HGPZTools.java
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
+33
-5
HGSJ002.java
src/main/java/com/baosight/hggp/hg/sj/domain/HGSJ002.java
+3
-3
HGSJ002.xml
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ002.xml
+5
-5
HGSJTools.java
src/main/java/com/baosight/hggp/hg/sj/tools/HGSJTools.java
+21
-1
ExcelUtils.java
src/main/java/com/baosight/hggp/util/ExcelUtils.java
+7
-0
sqlmap-config.xml
src/main/resources/resources/ibatis/sqlmap-config.xml
+3
-0
HGPZ005.js
src/main/webapp/HG/PZ/HGPZ005.js
+109
-0
HGPZ005.jsp
src/main/webapp/HG/PZ/HGPZ005.jsp
+11
-3
HGPZ005_存货档案.xls
src/main/webapp/common/template/PZ/HGPZ005_存货档案.xls
+0
-0
No files found.
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
View file @
6e56a112
...
...
@@ -219,6 +219,8 @@ public enum DdynamicEnum {
*/
PROJ_RECORD_BLOCK_ID
(
"proj_record_block_id"
,
"projCode"
,
"projName"
,
"HGSC001.queryComboBox"
),
ITEM_CODE_BOX_BLOCK_ID
(
"item_code_box_block_id"
,
"itemCode"
,
"itemCname"
,
"HGPZ005A.queryEdcm01"
),
;
...
...
src/main/java/com/baosight/hggp/hg/pz/domain/HGPZ005.java
View file @
6e56a112
...
...
@@ -43,6 +43,7 @@ public class HGPZ005 extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_NAME
=
"updatedName"
;
/* 更新人名称*/
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 更新时间*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 是否删除0.否1.是*/
public
static
final
String
FIELD_FLOW_ID
=
"flowId"
;
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_ACCOUNT_CODE
=
"ACCOUNT_CODE"
;
/* 帐套编码*/
...
...
@@ -70,6 +71,7 @@ public class HGPZ005 extends DaoEPBase {
public
static
final
String
COUNT
=
"HGPZ005.count"
;
public
static
final
String
INSERT
=
"HGPZ005.insert"
;
public
static
final
String
UPDATE
=
"HGPZ005.update"
;
public
static
final
String
UPDATE_FLOW_ID
=
"HGPZ005.updateFlowId"
;
public
static
final
String
DELETE
=
"HGPZ005.delete"
;
private
Long
id
=
new
Long
(
0
);
...
...
@@ -93,6 +95,7 @@ public class HGPZ005 extends DaoEPBase {
private
String
updatedName
=
" "
;
/* 更新人名称*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
Integer
deleteFlag
=
0
;
/* 是否删除0.否1.是*/
private
Long
flowId
=
new
Long
(
0
);
/*工艺流程ID*/
/**
* initialize the metadata.
...
...
@@ -197,6 +200,9 @@ public class HGPZ005 extends DaoEPBase {
eiColumn
.
setDescName
(
"是否删除0.否1.是"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_FLOW_ID
);
eiColumn
.
setDescName
(
"工艺流程ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
...
...
@@ -543,6 +549,15 @@ public class HGPZ005 extends DaoEPBase {
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Long
getFlowId
()
{
return
flowId
;
}
public
void
setFlowId
(
Long
flowId
)
{
this
.
flowId
=
flowId
;
}
/**
* get the value from Map.
*
...
...
@@ -572,6 +587,7 @@ public class HGPZ005 extends DaoEPBase {
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_NAME
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setDeleteFlag
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
setFlowId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_FLOW_ID
)),
flowId
));
}
/**
...
...
@@ -602,6 +618,7 @@ public class HGPZ005 extends DaoEPBase {
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_DELETE_FLAG
,
StringUtils
.
toString
(
deleteFlag
,
eiMetadata
.
getMeta
(
FIELD_DELETE_FLAG
)));
map
.
put
(
FIELD_FLOW_ID
,
StringUtils
.
toString
(
flowId
,
eiMetadata
.
getMeta
(
FIELD_FLOW_ID
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ005.java
View file @
6e56a112
...
...
@@ -4,9 +4,17 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
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.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005A
;
import
com.baosight.hggp.hg.sb.domain.HGSB002
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sj.domain.HGSJ002
;
import
com.baosight.hggp.hg.sj.domain.HGSJ002A
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.hg.sj.tools.HGSJTools
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.contants.ACConstants
;
...
...
@@ -19,6 +27,7 @@ import com.baosight.iplat4j.core.service.soa.XLocalManager;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
java.math.BigDecimal
;
import
java.util.*
;
/**
...
...
@@ -238,7 +247,6 @@ public class ServiceHGPZ005 extends ServiceBase {
return
inInfo
;
}
/**
* 下拉框
*
...
...
@@ -257,4 +265,61 @@ public class ServiceHGPZ005 extends ServiceBase {
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"存货档案"
,
operType
=
"导入"
,
operDesc
=
"导入操作"
)
public
EiInfo
importDate
(
EiInfo
inInfo
)
{
try
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
10
);
String
fileName
=
inInfo
.
getString
(
"fileName"
);
params
.
put
(
HGPZ005
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
//解析文件,将文件中数据传入到inInfo中
ExcelUtils
.
importFromExcel
(
inInfo
,
fileName
,
params
,
new
HGPZ005
());
}
catch
(
Exception
e
){
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"导入失败"
);
}
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"存货档案"
,
operType
=
"修改"
,
operDesc
=
"绑定流程"
)
public
EiInfo
updateFlowId
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
Map
resultRow
:
resultRows
)
{
HGPZ005
hgpz005
=
new
HGPZ005
();
hgpz005
.
fromMap
(
resultRow
);
HGSJ002
hgsj002
=
new
HGSJ002
();
hgsj002
.
fromMap
((
Map
)
resultRow
.
get
(
"flow"
));
hgpz005
.
setFlowId
(
hgsj002
.
getId
());
DaoUtils
.
update
(
HGPZ005
.
UPDATE_FLOW_ID
,
hgpz005
);
addHgpz005a
(
hgpz005
,
hgsj002
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据修改成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"修改失败"
);
}
return
inInfo
;
}
/**
* 添加流程详情
* @param hppz005
*/
public
void
addHgpz005a
(
HGPZ005
hppz005
,
HGSJ002
hgsj002
){
DaoUtils
.
update
(
HGPZ005A
.
DELETE_PARENT_ID
,
new
HashMap
<
String
,
Object
>(){{
put
(
HGPZ005A
.
FIELD_PARENT_ID
,
hppz005
.
getId
());}});
//流程详情
List
<
HGSJ002A
>
hgsb002AList
=
HGSJTools
.
Hgsj002a
.
list
(
hgsj002
.
getId
());
for
(
HGSJ002A
hgsj002a:
hgsb002AList
)
{
HGPZ005A
hgpz005A
=
new
HGPZ005A
();
hgpz005A
.
setCompanyCode
(
hgsj002
.
getFactoryCode
());
hgpz005A
.
setCompanyName
(
hgsj002
.
getFactoryName
());
hgpz005A
.
setProcessCode
(
hgsj002a
.
getProcessCode
());
hgpz005A
.
setProcessName
(
hgsj002a
.
getProcessName
());
hgpz005A
.
setUnitCoeff
(
BigDecimal
.
ONE
);
hgpz005A
.
setComposingCoeff
(
BigDecimal
.
ONE
);
hgpz005A
.
setParentId
(
hppz005
.
getId
());
DaoUtils
.
insert
(
HGPZ005A
.
INSERT
,
hgpz005A
.
toMap
());
}
}
}
src/main/java/com/baosight/hggp/hg/pz/sql/HGPZ005.xml
View file @
6e56a112
...
...
@@ -92,6 +92,9 @@
<isNotEmpty
prepend=
" AND "
property=
"deleteFlag"
>
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"flowId"
>
FLOW_ID = #flowId#
</isNotEmpty>
</sql>
<sql
id=
"authCondition"
>
...
...
@@ -137,7 +140,8 @@
UPDATED_BY as "updatedBy",
<!-- 更新人 -->
UPDATED_NAME as "updatedName",
<!-- 更新人名称 -->
UPDATED_TIME as "updatedTime",
<!-- 更新时间 -->
DELETE_FLAG as "deleteFlag"
<!-- 是否删除0.否1.是 -->
DELETE_FLAG as "deleteFlag",
<!-- 是否删除0.否1.是 -->
FLOW_ID as "flowId"
FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
<include
refid=
"condition"
/>
<include
refid=
"authCondition"
/>
...
...
@@ -245,9 +249,10 @@
UPDATED_BY,
<!-- 更新人 -->
UPDATED_NAME,
<!-- 更新人名称 -->
UPDATED_TIME,
<!-- 更新时间 -->
DELETE_FLAG
<!-- 是否删除0.否1.是 -->
DELETE_FLAG,
<!-- 是否删除0.否1.是 -->
FLOW_ID
)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#
,#flowId#
)
</insert>
<delete
id=
"delete"
>
...
...
@@ -276,7 +281,19 @@
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#
<!-- 是否删除0.否1.是 -->
DELETE_FLAG = #deleteFlag#,
<!-- 是否删除0.否1.是 -->
FLOW_ID = #flowId#
WHERE
ID = #id#
</update>
<update
id=
"updateFlowId"
>
UPDATE ${hggpSchema}.HGPZ005
SET
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
FLOW_ID = #flowId#
WHERE
ID = #id#
</update>
...
...
src/main/java/com/baosight/hggp/hg/pz/tools/HGPZTools.java
View file @
6e56a112
package
com
.
baosight
.
hggp
.
hg
.
pz
.
tools
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.ValidFlagEnum
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ004
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ007
;
import
com.baosight.hggp.hg.pz.domain.HGPZ009
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.common.ed.domain.TEDCM01
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -360,7 +364,31 @@ public class HGPZTools {
log
.
warn
(
"设置规格失败:{}"
,
e
.
getMessage
(),
e
);
}
}
}
/**
* 导入添加存货档案
* @param list
*/
public
static
void
add
(
List
<
Map
>
list
){
List
<
HGPZ004
>
hgpz004s
=
DaoBase
.
getInstance
().
query
(
HGPZ004
.
QUERY
,
new
HashMap
<>());
Map
parmap
=
hgpz004s
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ004:
:
getInventTypeName
,
HGPZ004:
:
getInventType
));
for
(
Map
map:
list
)
{
String
inventType
=
MapUtils
.
getString
(
parmap
,
StringUtils
.
trimToEmpty
(
map
.
get
(
HGPZ005
.
FIELD_INVENT_TYPE
).
toString
()));
AssertUtils
.
isEmpty
(
inventType
,
String
.
format
(
"存货类型[%s]代码不存在,添加失败!"
,
inventType
));
HGPZ005
hgpz005
=
new
HGPZ005
();
hgpz005
.
fromMap
(
map
);
hgpz005
.
setInventType
(
inventType
);
hgpz005
.
setStatus
(
1
);
//默认启用
hgpz005
.
setInventCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
INVENT_CODE
));
// 设置规格
if
(
StringUtils
.
isBlank
(
hgpz005
.
getSpec
()))
{
hgpz005
.
setSpec
(
HGPZTools
.
HgPz005
.
jointSpec
(
hgpz005
.
getLength
(),
hgpz005
.
getWidth
(),
hgpz005
.
getThick
()));
}
// 去除空格
hgpz005
.
setSpec
(
StringUtils
.
trimToEmpty
(
hgpz005
.
getSpec
()));
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
hgpz005
);
}
}
}
}
src/main/java/com/baosight/hggp/hg/sj/domain/HGSJ002.java
View file @
6e56a112
...
...
@@ -36,7 +36,7 @@ public class HGSJ002 extends DaoEPBase {
public
static
final
String
FIELD_FACTORY_NAME
=
"factoryName"
;
/* 厂区名称*/
public
static
final
String
FIELD_FLOW_CODE
=
"flowCode"
;
/* 流程编码*/
public
static
final
String
FIELD_FLOW_NAME
=
"flowName"
;
/* 流程名称*/
public
static
final
String
FIELD_STATUS
=
"status"
;
/* 状态
0.启用 1
.停止*/
public
static
final
String
FIELD_STATUS
=
"status"
;
/* 状态
1.启用 0
.停止*/
public
static
final
String
COL_ID
=
"ID"
;
/* 主键id*/
public
static
final
String
COL_ACCOUNT_CODE
=
"ACCOUNT_CODE"
;
/* 企业编码 预留*/
...
...
@@ -76,7 +76,7 @@ public class HGSJ002 extends DaoEPBase {
private
String
factoryName
=
" "
;
/* 厂区名称*/
private
String
flowCode
=
" "
;
/* 流程编码*/
private
String
flowName
=
" "
;
/* 流程名称*/
private
Integer
status
=
0
;
/* 状态
0.启用 1
.停止*/
private
Integer
status
=
0
;
/* 状态
1.启用 0
.停止*/
/**
* initialize the metadata.
...
...
@@ -142,7 +142,7 @@ public class HGSJ002 extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_STATUS
);
eiColumn
.
setDescName
(
"状态
0.启用 1
.停止"
);
eiColumn
.
setDescName
(
"状态
1.启用 0
.停止"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
src/main/java/com/baosight/hggp/hg/sj/sql/HGSJ002.xml
View file @
6e56a112
...
...
@@ -33,7 +33,7 @@
UPDATED_BY as "updatedBy",
<!-- 更新人 -->
UPDATED_NAME as "updatedName",
<!-- 更新人名称 -->
UPDATED_TIME as "updatedTime",
<!-- 更新时间 -->
DELETE_FLAG as "deleteFlag",
<!--
是否删除:0-否 1-是
-->
DELETE_FLAG as "deleteFlag",
<!--
状态 1.启用 0.停止
-->
FACTORY_CODE as "factoryCode",
<!-- 厂区编码 -->
FACTORY_NAME as "factoryName",
<!-- 厂区名称 -->
FLOW_CODE as "flowCode",
<!-- 流程编码 -->
...
...
@@ -190,12 +190,12 @@
UPDATED_BY,
<!-- 更新人 -->
UPDATED_NAME,
<!-- 更新人名称 -->
UPDATED_TIME,
<!-- 更新时间 -->
DELETE_FLAG,
<!--
是否删除:0-否 1-是
-->
DELETE_FLAG,
<!--
状态 1.启用 0.停止
-->
FACTORY_CODE,
<!-- 厂区编码 -->
FACTORY_NAME,
<!-- 厂区名称 -->
FLOW_CODE,
<!-- 流程编码 -->
FLOW_NAME,
<!-- 流程名称 -->
STATUS
<!-- 状态
0.启用 1
.停止 -->
STATUS
<!-- 状态
1.启用 0
.停止 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #flowCode#, #flowName#, #status#)
</insert>
...
...
@@ -211,7 +211,7 @@
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#
<!--
是否删除:0-否 1-是
-->
DELETE_FLAG = #deleteFlag#
<!--
状态 1.启用 0.停止
-->
WHERE
ID = #id#
</update>
...
...
@@ -238,7 +238,7 @@
UPDATED_BY = #updatedBy#,
<!-- 更新人 -->
UPDATED_NAME = #updatedName#,
<!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#,
<!--
是否删除:0-否 1-是
-->
DELETE_FLAG = #deleteFlag#,
<!--
状态 1.启用 0.停止
-->
FACTORY_CODE = #factoryCode#,
<!-- 厂区编码 -->
FACTORY_NAME = #factoryName#,
<!-- 厂区名称 -->
FLOW_CODE = #flowCode#,
<!-- 流程编码 -->
...
...
src/main/java/com/baosight/hggp/hg/sj/tools/HGSJTools.java
View file @
6e56a112
...
...
@@ -2,6 +2,8 @@ package com.baosight.hggp.hg.sj.tools;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.sb.domain.HGSB002A
;
import
com.baosight.hggp.hg.sj.domain.HGSJ002A
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.iplat4j.common.ed.domain.TEDCM01
;
...
...
@@ -21,8 +23,26 @@ import java.util.stream.Collectors;
public
class
HGSJTools
{
/**
* Hgsj002a公共DAO方法定义
*/
public
static
class
Hgsj002a
{
/**
* 查询
* @param parentId
* @return
*/
public
static
List
<
HGSJ002A
>
list
(
Long
parentId
){
AssertUtils
.
isNull
(
parentId
,
"parentId不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGSJ002A
.
FIELD_PAREND_ID
,
parentId
);
List
<
HGSJ002A
>
results
=
DaoBase
.
getInstance
().
query
(
HGSJ002A
.
QUERY
,
queryMap
);
AssertUtils
.
isEmpty
(
results
,
String
.
format
(
"流程ID[%s]没有添加流程详情不存在"
,
parentId
));
return
results
;
}
}
/**
* Hgsj003公共DAO方法定义
*
*/
public
static
class
Hgsj003
{
/**
...
...
src/main/java/com/baosight/hggp/util/ExcelUtils.java
View file @
6e56a112
package
com
.
baosight
.
hggp
.
util
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sj.domain.HGSJ003
;
import
com.baosight.hggp.hg.sj.tools.HGSJTools
;
import
com.baosight.hggp.util.importer.Importer
;
...
...
@@ -238,6 +240,11 @@ public class ExcelUtils {
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"导入成功"
+
arrayList
.
size
()
+
"条"
);
break
;
case
"HGPZ005"
:
HGPZTools
.
HgPz005
.
add
(
arrayList
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"导入成功"
+
arrayList
.
size
()
+
"条"
);
break
;
default
:
}
...
...
src/main/resources/resources/ibatis/sqlmap-config.xml
View file @
6e56a112
...
...
@@ -29,4 +29,7 @@
<sqlMap
resource=
"com/baosight/hggp/hg/sc/sql/HGSC001A.xml"
/>
<sqlMap
resource=
"com/baosight/hggp/hg/sc/sql/HGSC002.xml"
/>
<!--配置-->
<sqlMap
resource=
"com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"
/>
</sqlMapConfig>
src/main/webapp/HG/PZ/HGPZ005.js
View file @
6e56a112
...
...
@@ -9,6 +9,22 @@ $(function() {
pageSizes
:
[
10
,
20
,
30
,
50
,
100
,
200
]
},
columns
:
[{
field
:
"operator"
,
title
:
"操作"
,
template
:
function
(
item
)
{
let
status
=
item
.
status
;
let
template
=
''
;
if
(
item
.
id
){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showFlowDetail('
+
item
.
id
+
')" >工艺流程</a>'
;
if
(
item
.
flowId
>
0
){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
')" >工艺流程详情</a>'
;
}
}
return
template
;
}
},
{
field
:
"spec"
,
template
:
function
(
options
)
{
return
$
.
trim
(
options
.
spec
)
==
""
?
"无规格"
:
options
.
spec
;
...
...
@@ -56,6 +72,56 @@ $(function() {
deleteFunc
();
}
}
/*$("#DOWNLOAD").on("click", function (e) {
var href = ${ctx} + "\\common\\template\\PZ\\HGPZ005_存货档案.xls";
window.location.href = href;
});*/
grush
.
openImportBox
();
IPLATUI
.
EFUpload
=
{
fileUpload
:
{
showFileList
:
false
,
upload
:
function
(
e
)
{
openFileWindow
.
close
();
IPLAT
.
progress
(
$
(
"body"
),
true
);
},
success
:
function
(
e
)
{
var
src
=
e
.
response
.
docUrl
;
var
eiInfo
=
new
EiInfo
();
let
notIsExcelFile
=
isExcelFile
(
src
);
eiInfo
.
set
(
"fileName"
,
src
);
EiCommunicator
.
send
(
"HGPZ005"
,
"importDate"
,
eiInfo
,
{
onSuccess
(
ei
)
{
if
(
notIsExcelFile
)
{
NotificationUtil
(
"请导入xls或xlsx文件"
,
"error"
);
return
;
}
if
(
ei
.
status
==
"-1"
)
{
NotificationUtil
(
{
msg
:
ei
.
msg
,
detailMsg
:
ei
.
detailMsg
},
"error"
);
}
else
{
NotificationUtil
(
ei
.
msg
);
query
();
}
},
onFail
(
ei
)
{
NotificationUtil
(
"调用失败,原因["
+
ei
+
"]"
,
"error"
);
}
},
{
async
:
false
});
IPLAT
.
progress
(
$
(
"body"
),
false
);
},
fail
(
e
)
{
IPLAT
.
NotificationUtil
(
'导入失败!'
,
"error"
);
}
}
}
grush
.
downloadFile
(
`
${
ctx
}
\\common\\template\\PZ\\HGPZ005_存货档案.xls`
);
downKeyUp
();
});
...
...
@@ -147,3 +213,46 @@ let deleteFunc = function () {
}
});
}
function
showDetail
(
id
)
{
JSColorbox
.
open
({
href
:
"HGPZ005A?methodName=initLoad&inqu_status-0-parentId="
+
id
,
title
:
"<div style='text-align: center;'>工艺流程详情</div>"
,
width
:
"75%"
,
height
:
"80%"
,
});
}
function
showFlowDetail
(
id
)
{
JSColorbox
.
open
({
href
:
"HGPZ005B?methodName=initLoad&inqu_status-0-parentId="
+
id
,
title
:
"<div style='text-align: center;'>工艺流程</div>"
,
width
:
"75%"
,
height
:
"80%"
,
callbackName
:
cllback
});
}
/**
* 回调
*/
function
cllback
(
result
)
{
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
result
.
id
);
inEiInfo
.
set
(
"result-0-flow"
,
result
.
rows
);
EiCommunicator
.
send
(
'HGPZ005'
,
'updateFlowId'
,
inEiInfo
,
{
onSuccess
(
ei
)
{
if
(
ei
.
status
==
"-1"
)
{
NotificationUtil
({
msg
:
ei
.
msg
,
detailMsg
:
ei
.
detailMsg
},
"error"
);
}
else
{
NotificationUtil
(
ei
.
msg
);
query
();
}
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
});
}
src/main/webapp/HG/PZ/HGPZ005.jsp
View file @
6e56a112
...
...
@@ -4,6 +4,9 @@
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<script>
var
ctx
=
"${ctx}"
;
</script>
<EF:EFPage
title=
"存货档案"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
...
...
@@ -22,6 +25,7 @@
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"160"
align=
"center"
/>
<EF:EFColumn
cname=
"存货编码"
ename=
"inventCode"
width=
"140"
align=
"center"
enable=
"false"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"true"
blockName=
"invent_type_block_id"
textField=
"textField"
valueField=
"valueField"
...
...
@@ -34,8 +38,7 @@
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"100"
align=
"right"
format=
"{0:N2}"
maxLength=
"10"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"100"
align=
"right"
format=
"{0:N2}"
maxLength=
"10"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"coefficient"
cname=
"系数"
width=
"80"
align=
"right"
format=
"{0:N2}"
maxLength=
"10"
defaultValue=
"1"
/>
<EF:EFColumn
ename=
"coefficient"
cname=
"系数"
width=
"80"
align=
"right"
format=
"{0:N2}"
maxLength=
"10"
defaultValue=
"1"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
width=
"80"
align=
"center"
/>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
align=
"center"
width=
"80"
required=
"true"
defaultValue=
"1"
>
<EF:EFCodeOption
codeName=
"hpjx.hpjx.status"
/>
...
...
@@ -49,7 +52,12 @@
</EF:EFGrid>
</EF:EFRegion>
<EF:EFWindow
id=
"openFile"
>
<EF:EFRegion
id=
"upload"
title=
"文件导入区"
>
<div
id=
"button"
></div>
<EF:EFUpload
ename=
"fileUpload"
cname=
"导入"
docTag=
"HGPZ005"
path=
"pz"
/>
</EF:EFRegion>
</EF:EFWindow>
</EF:EFPage>
src/main/webapp/common/template/PZ/HGPZ005_存货档案.xls
0 → 100644
View file @
6e56a112
File added
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