Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
54ac9b08
Commit
54ac9b08
authored
Mar 05, 2024
by
yukang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://gitlab.baocloud.cn/bggf/smart/hp-smart
into dev
# Conflicts: # src/main/webapp/HP/SC/HPSC003.js
parents
9d2b2972
e168f4a4
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
321 additions
and
89 deletions
+321
-89
ServiceHPKC001.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC001.java
+1
-1
ServiceHPKC002.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
+3
-3
HPPZ006.xml
src/main/java/com/baosight/hpjx/hp/pz/sql/HPPZ006.xml
+3
-0
HPPZTools.java
src/main/java/com/baosight/hpjx/hp/pz/tools/HPPZTools.java
+89
-2
ServiceHPSC003.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
+1
-0
HPXSOrg.xml
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
+37
-9
HPXSTools.java
src/main/java/com/baosight/hpjx/hp/xs/tools/HPXSTools.java
+33
-0
ServiceXSOG0801A.java
...om/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
+15
-3
XSOG01.xml
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
+4
-2
ServiceXSOrgManage.java
...com/baosight/xservices/xs/service/ServiceXSOrgManage.java
+2
-0
HPKC001.js
src/main/webapp/HP/KC/HPKC001.js
+41
-5
HPKC001.jsp
src/main/webapp/HP/KC/HPKC001.jsp
+7
-3
HPSC003.js
src/main/webapp/HP/SC/HPSC003.js
+85
-61
No files found.
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC001.java
View file @
54ac9b08
...
...
@@ -153,7 +153,7 @@ public class ServiceHPKC001 extends ServiceBase {
fKc001
.
fromMap
(
resultRow
);
AssertUtils
.
isEmpty
(
fKc001
.
getWhCode
(),
"仓库名称不能为空"
);
AssertUtils
.
isEmpty
(
fKc001
.
getInventCode
(),
"存货名称不能为空"
);
AssertUtils
.
isNull
(
fKc001
.
getInventRecordId
(),
"规格不能为空"
);
//
AssertUtils.isNull(fKc001.getInventRecordId(), "规格不能为空");
AssertUtils
.
isGt
(
BigDecimal
.
ZERO
,
fKc001
.
getAmount
(),
"数量必须大于0"
);
AssertUtils
.
isGt
(
BigDecimal
.
ZERO
,
fKc001
.
getWeight
(),
"重量必须大于0"
);
}
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
View file @
54ac9b08
...
...
@@ -104,14 +104,14 @@ public class ServiceHPKC002 extends ServiceBase {
HPKC002
dbKc002
=
dbMapKc002
.
get
(
fKc002
.
getReqNo
());
HPKC002
newKc002
=
BeanUtils
.
copy
(
dbKc002
,
HPKC002
.
class
);
newKc002
.
setReqNo
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
newKc002
.
setAmount
(
dbKc002
.
getAmount
()
.
negate
()
);
newKc002
.
setWeight
(
dbKc002
.
getWeight
()
.
negate
()
);
newKc002
.
setAmount
(
dbKc002
.
getAmount
());
newKc002
.
setWeight
(
dbKc002
.
getWeight
());
newKc002
.
setOldReqNo
(
dbKc002
.
getReqNo
());
newKc002
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
insert
(
HPKC002
.
INSERT
,
newKc002
);
// 修改库存
HPKCTools
.
updateStock
(
dbKc002
.
getWhCode
(),
dbKc002
.
getInventRecordId
(),
dbKc002
.
getAmount
()
.
negate
(),
dbKc002
.
getUnitWeight
(),
dbKc002
.
getWeight
().
negate
());
dbKc002
.
getAmount
()
,
dbKc002
.
getUnitWeight
(),
dbKc002
.
getWeight
());
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
src/main/java/com/baosight/hpjx/hp/pz/sql/HPPZ006.xml
View file @
54ac9b08
...
...
@@ -76,6 +76,9 @@
</sql>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"ids"
>
#ids[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventTypes"
>
INVENT_TYPE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"inventTypes"
>
#inventTypes[]#
</iterate>
</isNotEmpty>
...
...
src/main/java/com/baosight/hpjx/hp/pz/tools/HPPZTools.java
View file @
54ac9b08
...
...
@@ -12,8 +12,14 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import
com.baosight.hpjx.hp.pz.domain.HPPZ009
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ011
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
import
com.baosight.hpjx.util.StringUtils
;
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
;
...
...
@@ -23,10 +29,13 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @author:songx
* @date:2024/1/16,10:48
*/
@Slf4j
public
class
HPPZTools
{
/**
...
...
@@ -274,14 +283,41 @@ public class HPPZTools {
* @return
*/
public
static
HPPZ006
get
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"
仓库编码
不能为空"
);
AssertUtils
.
isNull
(
id
,
"
规格ID
不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"id"
,
id
);
List
<
HPPZ006
>
results
=
DaoBase
.
getInstance
().
query
(
HPPZ006
.
QUERY
,
queryMap
);
AssertUtils
.
isNull
(
results
,
String
.
format
(
"规格[%s]不存在"
,
id
));
return
results
.
get
(
0
);
}
/**
* 查询
*
* @param ids
* @return
*/
public
static
List
<
HPPZ006
>
list
(
List
<
Long
>
ids
)
{
AssertUtils
.
isNull
(
ids
,
"规格ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"ids"
,
ids
);
return
DaoBase
.
getInstance
().
query
(
HPPZ006
.
QUERY
,
queryMap
);
}
/**
* 查询
*
* @param ids
* @return
*/
public
static
Map
<
Long
,
HPPZ006
>
map
(
List
<
Long
>
ids
)
{
List
<
HPPZ006
>
results
=
list
(
ids
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
return
null
;
}
return
results
.
stream
().
collect
(
Collectors
.
toMap
(
HPPZ006:
:
getId
,
item
->
item
));
}
/**
* 计算单重
*
...
...
@@ -388,6 +424,57 @@ public class HPPZTools {
return
newPz006
;
}
}
/**
* 设置用户信息
*
* @param inInfo
* @param idName
*/
public
static
void
setSpecInfo
(
EiInfo
inInfo
,
String
idName
)
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
if
(
CollectionUtils
.
isEmpty
(
resultRows
))
{
return
;
}
List
<
Long
>
ids
=
ObjectUtils
.
listKey
(
resultRows
,
idName
);
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
;
}
Map
<
Long
,
HPPZ006
>
resultMap
=
map
(
ids
);
if
(
MapUtils
.
isEmpty
(
resultMap
))
{
return
;
}
for
(
Map
resultRow
:
resultRows
)
{
Long
id
=
MapUtils
.
getLong
(
resultRow
,
idName
);
HPPZ006
dbPz006
=
resultMap
.
get
(
id
);
resultRow
.
put
(
HPPZ006
.
FIELD_SPEC
,
dbPz006
==
null
?
""
:
dbPz006
.
getSpec
());
resultRow
.
put
(
HPPZ006
.
FIELD_LENGTH
,
dbPz006
==
null
?
""
:
dbPz006
.
getLength
());
resultRow
.
put
(
HPPZ006
.
FIELD_WIDTH
,
dbPz006
==
null
?
""
:
dbPz006
.
getWidth
());
resultRow
.
put
(
HPPZ006
.
FIELD_THICK
,
dbPz006
==
null
?
""
:
dbPz006
.
getThick
());
}
}
/**
* 设置规格
*
* @param bean
* @param keyName
*/
public
static
void
setSpecInfo
(
DaoEPBase
bean
,
String
keyName
)
{
try
{
String
inventRecordId
=
BeanUtils
.
getProperty
(
bean
,
keyName
);
if
(
StringUtils
.
isBlank
(
inventRecordId
))
{
return
;
}
HPPZ006
dbPz06
=
get
(
Long
.
parseLong
(
inventRecordId
));
BeanUtils
.
setProperty
(
bean
,
HPPZ006
.
FIELD_SPEC
,
dbPz06
.
getSpec
());
BeanUtils
.
setProperty
(
bean
,
HPPZ006
.
FIELD_LENGTH
,
dbPz06
.
getLength
());
BeanUtils
.
setProperty
(
bean
,
HPPZ006
.
FIELD_WIDTH
,
dbPz06
.
getWidth
());
BeanUtils
.
setProperty
(
bean
,
HPPZ006
.
FIELD_THICK
,
dbPz06
.
getThick
());
}
catch
(
Throwable
e
)
{
log
.
warn
(
"设置规格失败:{}"
,
e
.
getMessage
(),
e
);
}
}
}
/**
...
...
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
View file @
54ac9b08
...
...
@@ -121,6 +121,7 @@ public class ServiceHPSC003 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HPSC003
.
fromMap
(
map
);
HPSC003
.
setPlanCompletionDate
(
DateUtils
.
formatShort
(
HPSC003
.
getPlanCompletionDate
()));
DaoUtils
.
update
(
"HPSC003.update"
,
HPSC003
.
toMap
());
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
...
...
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
View file @
54ac9b08
...
...
@@ -65,6 +65,33 @@
<include
refid=
"customCondition"
/>
</select>
<!-- 查询父级信息(递归) -->
<select
id=
"queryParent"
resultClass=
"com.baosight.hpjx.hp.xs.domain.Org"
>
SELECT
T3.ORG_ID as "orgId", T3.ORG_CNAME as "orgCname",
T3.PARENT_ORG_ID as "parentOrgId", T3.ORG_TYPE as "orgType"
FROM (
SELECT
@CODES as CODES,
(SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM IPLAT.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND IS_DELETED = 0
) as T1,
@LEVEL:=@LEVEL+1 as level
FROM IPLAT.TXSOG01,
(select @CODES:=#orgId#, @LEVEL:= 0) T4
where @CODES is not null
) T2,
IPLAT.TXSOG01 T3
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
<isNotEmpty
prepend=
" AND "
property=
"orgType"
>
ORG_TYPE = #orgType#
</isNotEmpty>
AND COMPANY_CODE = #companyCode#
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
<!-- 查询组织信息 -->
<select
id=
"queryComboBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
...
...
@@ -90,31 +117,32 @@
<include
refid=
"order"
/>
</select>
<!-- 查询
组信息
(递归) -->
<!-- 查询
子集组信息,包括生产组和下料组
(递归) -->
<select
id=
"queryGroupComboBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname"
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", T3.ORG_CNAME AS "orgCname",
T3.FACTORY_CODE AS "factoryCode", T5.FACTORY_NAME AS "factoryName"
FROM (
SELECT
@CODES AS CODES,
(SELECT @CODES
:=
GROUP_CONCAT(ORG_ID)
(SELECT @CODES
:=
GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND IS_DELETED = 0
) AS T1,
@LEVEL:=
@LEVEL+1 AS LEVEL
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND
ORG_TYPE IN ('prodGroup', 'cutGroup
')
AND
T3.ORG_TYPE IN ('prodGroup', 'cutGroup', 'factory
')
<isNotEmpty
prepend=
" AND "
property=
"orgType"
>
ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
COMPANY_CODE = #companyCode#
T3.ORG_TYPE = #orgType#
</isNotEmpty>
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
...
...
src/main/java/com/baosight/hpjx/hp/xs/tools/HPXSTools.java
View file @
54ac9b08
package
com
.
baosight
.
hpjx
.
hp
.
xs
.
tools
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.enums.OrgTypeEnum
;
import
com.baosight.hpjx.hp.xs.domain.Org
;
import
com.baosight.hpjx.hp.xs.domain.User
;
import
com.baosight.hpjx.util.AssertUtils
;
...
...
@@ -80,6 +81,38 @@ public class HPXSTools {
List
<
Org
>
results
=
DaoBase
.
getInstance
().
query
(
"HPXSOrg.query"
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
.
get
(
0
);
}
/**
* 查询
*
* @param orgId
* @return
*/
public
static
List
<
Org
>
queryParent
(
String
orgId
)
{
AssertUtils
.
isNull
(
orgId
,
"组织ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"orgId"
,
orgId
);
List
<
Org
>
results
=
DaoBase
.
getInstance
().
query
(
"HPXSOrg.queryParent"
,
queryMap
);
AssertUtils
.
isNull
(
results
,
String
.
format
(
"组织[%s]不存在父级信息"
,
orgId
));
return
results
;
}
/**
* 查询所属厂区
*
* @param orgId
* @return
*/
public
static
Org
queryFactory
(
String
orgId
)
{
AssertUtils
.
isNull
(
orgId
,
"组织ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"orgId"
,
orgId
);
queryMap
.
put
(
"orgType"
,
OrgTypeEnum
.
FACTORY
.
getCode
());
List
<
Org
>
results
=
DaoBase
.
getInstance
().
query
(
"HPXSOrg.queryParent"
,
queryMap
);
AssertUtils
.
isNull
(
results
,
String
.
format
(
"组织[%s]不存在厂区信息"
,
orgId
));
return
results
.
get
(
0
);
}
}
}
src/main/java/com/baosight/xservices/xs/og/service/ServiceXSOG0801A.java
View file @
54ac9b08
...
...
@@ -7,6 +7,8 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import
com.baosight.hpjx.core.tools.CodeValueTools
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC010
;
import
com.baosight.hpjx.hp.xs.domain.Org
;
import
com.baosight.hpjx.hp.xs.tools.HPXSTools
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
...
...
@@ -96,13 +98,23 @@ public class ServiceXSOG0801A extends ServiceEPBase {
// 非管理员组织机构编码前缀增加企业编码 added by songx at 2024-01-15
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
resultRows
.
forEach
((
row
)
->
{
String
org
Code
=
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
ORG_CODE
);
row
.
put
(
"orgId"
,
org
Code
);
row
.
put
(
"orgEname"
,
org
Code
);
String
org
Id
=
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
ORG_CODE
);
row
.
put
(
"orgId"
,
org
Id
);
row
.
put
(
"orgEname"
,
org
Id
);
row
.
put
(
"companyCode"
,
companyCode
);
row
.
put
(
"establishDate"
,
DateUtils
.
formatShort
(
MapUtils
.
getString
(
row
,
"establishDate"
)));
row
.
put
(
"parentOrgId"
,
queryRow
.
get
(
"parentOrgId"
));
row
.
put
(
"recCreator"
,
UserSession
.
getLoginName
());
// 厂区代码
if
(
OrgTypeEnum
.
FACTORY
.
getCode
().
equals
(
row
.
get
(
"orgType"
)))
{
row
.
put
(
"factoryCode"
,
orgId
);
row
.
put
(
"factoryName"
,
row
.
get
(
"orgCname"
));
}
else
{
// 查询所属厂
Org
factoryOrg
=
HPXSTools
.
XsOrg
.
queryFactory
(
queryRow
.
get
(
"parentOrgId"
).
toString
());
row
.
put
(
"factoryCode"
,
factoryOrg
.
getOrgId
());
row
.
put
(
"factoryName"
,
factoryOrg
.
getOrgCname
());
}
});
EiInfo
call
=
new
EiInfo
();
call
.
set
(
"list"
,
resultRows
);
...
...
src/main/java/com/baosight/xservices/xs/og/sql/XSOG01.xml
View file @
54ac9b08
...
...
@@ -286,12 +286,14 @@
REC_REVISE_TIME,
<!-- 记录修改时刻 -->
ARCHIVE_FLAG,
<!-- 归档标记 -->
IS_DELETED,
<!-- 逻辑删除(1-已删除|0-正常状态) -->
COMPANY_CODE
<!-- 企业编码 -->
COMPANY_CODE,
<!-- 企业编码 -->
FACTORY_CODE,
FACTORY_NAME
) VALUES (
#orgId#, #orgEname#, #orgCname#, #orgBriefName#, #orgType#, #parentOrgId#,
#establishDate#, #orgLevel#, #orgNodeType#, #sortIndex#, #recCreator#,
#recCreateTime#, #recRevisor#, #recReviseTime#, #archiveFlag#, #isDeleted#,
#companyCode#
#companyCode#
, #factoryCode#, #factoryName#
)
</insert>
...
...
src/main/java/com/baosight/xservices/xs/service/ServiceXSOrgManage.java
View file @
54ac9b08
...
...
@@ -269,6 +269,8 @@ public class ServiceXSOrgManage extends ServiceEPBase {
insertMap
.
put
(
"archiveFlag"
,
" "
);
insertMap
.
put
(
"isDeleted"
,
"0"
);
insertMap
.
put
(
"companyCode"
,
inInfoRowMap
.
get
(
"companyCode"
));
insertMap
.
put
(
"factoryCode"
,
inInfoRowMap
.
get
(
"factoryCode"
));
insertMap
.
put
(
"factoryName"
,
inInfoRowMap
.
get
(
"factoryName"
));
if
(
insertFlag
)
{
this
.
dao
.
insert
(
"XSOG01.insert"
,
insertMap
);
}
else
{
...
...
src/main/webapp/HP/KC/HPKC001.js
View file @
54ac9b08
...
...
@@ -62,14 +62,17 @@ $(function() {
refreshSelect
(
container
,
inInfo
);
}
},
{
field
:
"
inventRecordId
"
,
field
:
"
spec
"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
inventAllGlobalData
.
length
;
i
++
)
{
if
(
inventAllGlobalData
[
i
][
'valueField'
]
===
dataItem
[
'inventRecordId'
])
{
return
inventAllGlobalData
[
i
][
'textField'
];
}
if
(
inventAllGlobalData
[
i
][
'textField'
]
===
dataItem
[
'spec'
])
{
dataItem
[
'inventRecordId'
]
=
inventAllGlobalData
[
i
][
'valueField'
]
return
inventAllGlobalData
[
i
][
'textField'
];
}
else
{
dataItem
[
'inventRecordId'
]
=
''
;
}
}
return
""
;
return
dataItem
[
'spec'
]
;
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
...
...
@@ -83,6 +86,36 @@ $(function() {
refreshSelect
(
container
,
inInfo
);
}
},
{
field
:
"length"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
inventAllGlobalData
.
length
;
i
++
)
{
if
(
inventAllGlobalData
[
i
][
'valueField'
]
===
dataItem
[
'inventRecordId'
])
{
return
inventAllGlobalData
[
i
][
'param3Field'
];
}
}
return
""
;
}
},
{
field
:
"width"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
inventAllGlobalData
.
length
;
i
++
)
{
if
(
inventAllGlobalData
[
i
][
'valueField'
]
===
dataItem
[
'inventRecordId'
])
{
return
inventAllGlobalData
[
i
][
'param4Field'
];
}
}
return
""
;
}
},
{
field
:
"thick"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
inventAllGlobalData
.
length
;
i
++
)
{
if
(
inventAllGlobalData
[
i
][
'valueField'
]
===
dataItem
[
'inventRecordId'
])
{
return
inventAllGlobalData
[
i
][
'param5Field'
];
}
}
return
""
;
}
},
{
field
:
"material"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
inventAllGlobalData
.
length
;
i
++
)
{
...
...
@@ -114,6 +147,9 @@ $(function() {
if
(
inventAllGlobalData
[
i
][
'valueField'
]
===
item
.
inventRecordId
)
{
resultGrid
.
setCellValue
(
item
,
'material'
,
inventAllGlobalData
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
item
,
'unit'
,
inventAllGlobalData
[
i
][
'param2Field'
])
resultGrid
.
setCellValue
(
item
,
'length'
,
inventAllGlobalData
[
i
][
'param3Field'
])
resultGrid
.
setCellValue
(
item
,
'width'
,
inventAllGlobalData
[
i
][
'param4Field'
])
resultGrid
.
setCellValue
(
item
,
'thick'
,
inventAllGlobalData
[
i
][
'param5Field'
])
}
}
}
...
...
src/main/webapp/HP/KC/HPKC001.jsp
View file @
54ac9b08
...
...
@@ -55,13 +55,17 @@
</EF:EFComboColumn>
<EF:EFColumn
ename=
"whCode"
cname=
"仓库名称"
width=
"120"
align=
"center"
required=
"true"
readonly=
"true"
/>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货名称"
width=
"120"
align=
"center"
required=
"true"
readonly=
"true"
/>
<EF:EFColumn
ename=
"inventRecordId"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
readonly=
"true"
/>
<EF:EFColumn
ename=
"inventRecordId"
cname=
"规格ID"
width=
"120"
align=
"center"
readonly=
"true"
hidden=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"amount"
cname=
"数量"
format=
"{0:N0}"
maxLength=
"20"
width=
"100"
align=
"right"
required=
"true"
readonly=
"true"
/>
<EF:EFColumn
ename=
"unitWeight"
cname=
"单重"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"weight"
cname=
"重量"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"unitWeight"
cname=
"单重
(KG)
"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"weight"
cname=
"重量
(KG)
"
enable=
"false"
width=
"100"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"remark"
cname=
"备注"
width=
"150"
readonly=
"true"
/>
<EF:EFColumn
ename=
"oldPurchaseNo"
cname=
"原采购单号"
enable=
"false"
width=
"140"
align=
"center"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
...
...
src/main/webapp/HP/SC/HPSC003.js
View file @
54ac9b08
...
...
@@ -40,6 +40,14 @@ $(function () {
return
template
;
}
}],
onSave
:
function
(
e
)
{
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
let
btnNode
=
$
(
this
);
//禁用按钮
btnNode
.
attr
(
"disabled"
,
true
);
saveResult
(
btnNode
);
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'update'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'insert'
)
{
...
...
@@ -72,69 +80,12 @@ $(function () {
// delete: true, // 显示删除按钮
},
onSave
:
function
(
e
)
{
var
rowCount
=
detailGrid
.
getCheckedRows
();
// 检验是否选中数据
if
(
rowCount
==
null
||
rowCount
==
""
)
{
NotificationUtil
({
msg
:
'请选择一条或多条数据'
},
"warning"
);
}
let
flag
=
false
;
for
(
let
i
=
0
;
i
<
rowCount
.
length
;
i
++
)
{
let
startT
=
new
Date
(
rowCount
[
i
].
planCommentDate
).
getTime
();
let
endT
=
new
Date
(
rowCount
[
i
].
planCompletionDate
).
getTime
();
if
(
startT
>
endT
)
{
flag
=
true
;
break
}
}
if
(
flag
){
e
.
preventDefault
();
NotificationUtil
({
msg
:
'计划结束时间不能小于计划开始时间'
},
"warning"
);
return
;
}
var
btnNode
=
$
(
this
);
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
let
btnNode
=
$
(
this
);
//禁用按钮
btnNode
.
attr
(
"disabled"
,
true
);
IPLAT
.
submitNode
(
$
(
"#HPSC003"
),
"HPSC003"
,
"updatePlanDetail"
,
{
onSuccess
:
function
(
ei
)
{
if
(
ei
[
"status"
]
==
-
1
)
{
NotificationUtil
(
ei
,
"error"
);
}
else
{
NotificationUtil
({
msg
:
'修改成功'
});
// 绑定grid
detailGrid
.
setEiInfo
(
ei
);
resultGrid
.
dataSource
.
page
(
resultGrid
.
dataSource
.
_page
);
}
//释放禁用按钮
btnNode
.
attr
(
"disabled"
,
false
);
},
onFail
:
function
(
ei
)
{
// onFail 表示失败回调函数
// 发生异常
console
.
log
(
ei
);
//释放禁用按钮
btnNode
.
attr
(
"disabled"
,
false
);
}
});
},
afterEdit
:
function
(
e
)
{
if
(
e
.
field
===
"planCompletionDate"
)
{
let
startT
=
new
Date
(
e
.
model
.
planCommentDate
).
getTime
();
let
endT
=
new
Date
(
e
.
model
.
planCompletionDate
).
getTime
();
if
(
startT
>
endT
)
{
e
.
preventDefault
();
NotificationUtil
({
msg
:
'计划结束时间不能小于计划开始时间'
},
"warning"
);
}
}
saveDetail
(
btnNode
);
},
columns
:
[{
field
:
"operator"
,
...
...
@@ -283,3 +234,76 @@ function check_time(model,rows){
}
return
true
;
}
/**
* 保存汇总
*/
function
saveResult
(
btn
)
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
planCompletionDate
=
item
.
get
(
"planCompletionDate"
);
if
(
isBlank
(
planCompletionDate
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划结束时间
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
});
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HPSC003"
,
"update"
,
true
);
//释放禁用按钮
btn
.
attr
(
"disabled"
,
false
);
}
});
}
}
/**
* 保存明细
*/
function
saveDetail
(
btn
)
{
let
rows
=
detailGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
planCommentDate
=
item
.
get
(
"planCommentDate"
);
let
planCompletionDate
=
item
.
get
(
"planCompletionDate"
);
if
(
isBlank
(
planCommentDate
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划开始时间
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
planCompletionDate
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划结束时间
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
let
startT
=
new
Date
(
planCommentDate
).
getTime
();
let
endT
=
new
Date
(
planCompletionDate
).
getTime
();
if
(
startT
>
endT
)
{
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划开始时间
\"
不能大于
\"
计划结束时间
\"
!"
);
flag
=
false
;
return
false
;
}
});
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"detail"
,
"HPSC003"
,
"updatePlanDetail"
,
true
);
//释放禁用按钮
btn
.
attr
(
"disabled"
,
false
);
}
});
}
}
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