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
45800e0d
Commit
45800e0d
authored
Aug 25, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产领料增加选择库存数据进行勾选
parent
ecbe68db
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
371 additions
and
3 deletions
+371
-3
ServiceHGKC008B.java
...java/com/baosight/hggp/hg/kc/service/ServiceHGKC008B.java
+147
-0
HGKCUtils.java
src/main/java/com/baosight/hggp/hg/kc/utils/HGKCUtils.java
+47
-0
HGKC008.js
src/main/webapp/HG/KC/HGKC008.js
+4
-2
HGKC008A.js
src/main/webapp/HG/KC/HGKC008A.js
+26
-1
HGKC008B.js
src/main/webapp/HG/KC/HGKC008B.js
+90
-0
HGKC008B.jsp
src/main/webapp/HG/KC/HGKC008B.jsp
+57
-0
No files found.
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008B.java
0 → 100644
View file @
45800e0d
package
com
.
baosight
.
hggp
.
hg
.
kc
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.InventTypeDetailEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.cg.domain.HGCG002
;
import
com.baosight.hggp.hg.cg.domain.HGCG002B
;
import
com.baosight.hggp.hg.cg.domain.HGCG003
;
import
com.baosight.hggp.hg.cg.tools.HGCGTools
;
import
com.baosight.hggp.hg.cg.utils.HGCGUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.kc.domain.HGKC008
;
import
com.baosight.hggp.hg.kc.domain.HGKC008A
;
import
com.baosight.hggp.hg.kc.domain.HGKC010
;
import
com.baosight.hggp.hg.kc.utils.HGKCUtils
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.domain.HGPZ007
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.hg.yx.domain.HGYX001A
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.contants.ACConstants
;
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
com.baosight.iplat4j.core.service.soa.XLocalManager
;
import
com.baosight.iplat4j.core.util.DateUtils
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.math.BigDecimal
;
import
java.util.*
;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public
class
ServiceHGKC008B
extends
ServiceBase
{
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation
(
operModul
=
"综合库存"
,
operType
=
"查询"
,
operDesc
=
"初始化"
)
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"inventTypeDetails"
,
InventTypeDetailEnum
.
getInentTypeTwo
());
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
COMPANY_CODE_BLOCK_ID
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BLOCK_ID
),
paramMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_RECORD_BLOCK_ID
),
paramMap
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
paramMap
);
EiInfoUtils
.
addBlock
(
inInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGKC010
().
eiMetadata
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation
(
operModul
=
"综合库存"
,
operType
=
"查询"
,
operDesc
=
"查询"
)
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
"inventTypeDetails"
,
InventTypeDetailEnum
.
getInentTypeTwo
());
inInfo
=
super
.
query
(
inInfo
,
HGKC010
.
QUERY
,
new
HGKC010
());
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"实时库存"
,
operType
=
"查询"
,
operDesc
=
"确认"
)
public
EiInfo
confirm
(
EiInfo
inInfo
)
{
try
{
String
receiveId
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGKC008A
.
FIELD_RECEIVE_ID
);
List
<
HGKC010
>
hgkc010s
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGKC010
.
class
);
// db数据
Map
<
Long
,
HGKC010
>
dbHgkc010Map
=
HGKCUtils
.
HgKc010
.
lockGetDataEp
(
hgkc010s
);
List
<
HGKC008A
>
hgkc008AList
=
HGKCUtils
.
HgKc008A
.
listByPrimaryId
(
receiveId
);
HGKC008
hgkc008
=
HGKCUtils
.
HgKc008
.
get
(
receiveId
);
// 数据校验
this
.
checkConfirmData
(
hgkc008AList
,
dbHgkc010Map
,
hgkc008
);
// 保存数据
this
.
confirmData
(
dbHgkc010Map
,
hgkc008
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hgkc010s
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
return
inInfo
;
}
private
void
confirmData
(
Map
<
Long
,
HGKC010
>
dbHgkc010Map
,
HGKC008
hgkc008
)
{
List
<
HGKC008A
>
hgkc008AList
=
new
LinkedList
<>();
dbHgkc010Map
.
forEach
((
k
,
v
)
->{
HGKC008A
hgkc008A
=
new
HGKC008A
();
BeanUtils
.
copyProperties
(
hgkc008
,
hgkc008A
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
);
hgkc008A
.
setReceiveId
(
hgkc008
.
getId
());
hgkc008A
.
setInvLength
(
v
.
getLength
());
hgkc008A
.
setInvThick
(
v
.
getThick
());
hgkc008A
.
setInvUnitWeight
(
v
.
getInvUnitWeight
());
hgkc008A
.
setInvWeight
(
v
.
getInvWeight
());
hgkc008A
.
setInvWidth
(
v
.
getWidth
());
hgkc008A
.
setInvSpec
(
v
.
getSpec
());
hgkc008A
.
setInventType
(
v
.
getInventType
());
hgkc008A
.
setInventTypeDetail
(
v
.
getInventTypeDetail
());
hgkc008A
.
setInventCode
(
v
.
getInventCode
());
hgkc008A
.
setInventName
(
v
.
getInventName
());
hgkc008A
.
setInvQty
(
v
.
getInvQty
());
hgkc008AList
.
add
(
hgkc008A
);
});
DaoUtils
.
insertBatch
(
HGKC008A
.
INSERT
,
hgkc008AList
);
}
private
void
checkConfirmData
(
List
<
HGKC008A
>
hgkc008AList
,
Map
<
Long
,
HGKC010
>
dbHgkc010Map
,
HGKC008
hgkc008
)
{
AssertUtils
.
isTrue
(
hgkc008
.
getStatus
().
compareTo
(
HGConstant
.
ProductStatus
.
YTJ
)
==
0
,
"领料单已提交,不可修改"
);
hgkc008AList
.
forEach
(
o
->
{
dbHgkc010Map
.
forEach
((
k
,
v
)
->{
AssertUtils
.
isTrue
(
o
.
getInventCode
().
equals
(
v
.
getInventCode
()),
"此领料单已选择存货:"
+
v
.
getInventCode
());
});
});
}
}
src/main/java/com/baosight/hggp/hg/kc/utils/HGKCUtils.java
View file @
45800e0d
...
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.kc.utils;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.hg.cg.domain.HGCG003B
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.kc.domain.*
;
import
com.baosight.hggp.hg.kc.tools.HGKCTools
;
...
...
@@ -204,6 +205,52 @@ public class HGKCUtils {
queryRow
.
put
(
HGKC007
.
FIELD_OTHER_OUT_DATE
,
DateUtils
.
formatShort
(
otherOutDate
));
}
}
/**
* 查询
*
* @param primaryId
* @return
*/
public
static
List
<
HGCG003B
>
listByPrimaryId
(
Long
primaryId
)
{
AssertUtils
.
isNull
(
primaryId
,
"收货单id不能为空"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"primaryId"
,
primaryId
);
return
DaoBase
.
getInstance
().
query
(
HGCG003B
.
QUERY
,
paramMap
);
}
}
public
static
class
HgKc008
{
/**
* 查询
*
* @param receiveId
* @return
*/
public
static
HGKC008
get
(
String
receiveId
)
{
AssertUtils
.
isNull
(
receiveId
,
"领料单id不能为空"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"id"
,
receiveId
);
List
<
HGKC008
>
hgkc008List
=
DaoBase
.
getInstance
().
query
(
HGKC008
.
QUERY
,
paramMap
);
return
hgkc008List
.
get
(
0
);
}
}
public
static
class
HgKc008A
{
/**
* 查询
*
* @param receiveId
* @return
*/
public
static
List
<
HGKC008A
>
listByPrimaryId
(
String
receiveId
)
{
AssertUtils
.
isEmpty
(
receiveId
,
"领料单id不能为空"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"receiveId"
,
receiveId
);
return
DaoBase
.
getInstance
().
query
(
HGKC008A
.
QUERY
,
paramMap
);
}
}
/**
* HGKC010 工具类
...
...
src/main/webapp/HG/KC/HGKC008.js
View file @
45800e0d
...
...
@@ -264,11 +264,13 @@ function showDetail(id,whCode,companyCode,status) {
JSColorbox
.
open
({
href
:
"HGKC008A?methodName=initLoad&inqu_status-0-receiveId="
+
id
+
"&inqu_status-0-whCode="
+
whCode
+
"&inqu_status-0-companyCode="
+
companyCode
+
"&inqu_status-0-status="
+
status
,
title
:
"<div style='text-align: center;'>领料详情</div>"
,
width
:
"
8
0%"
,
height
:
"
8
0%"
,
width
:
"
9
0%"
,
height
:
"
9
0%"
,
});
}
function
loadChange
(
grid
,
e
,
field
)
{
var
cell_label
=
field
,
that
=
grid
;
// locked 表示是否为固定列
...
...
src/main/webapp/HG/KC/HGKC008A.js
View file @
45800e0d
...
...
@@ -142,7 +142,8 @@ $(function (){
},
}
}
// 选择合同
$
(
"#SELECT_INVENT"
).
on
(
"click"
,
selectInvent
);
downKeyUp
();
})
...
...
@@ -217,6 +218,30 @@ let save = function (btnNode) {
}
}
/**
* 选择
*/
let
selectInvent
=
function
()
{
JSColorbox
.
open
({
href
:
"HGKC008B?methodName=initLoad&inqu_status-0-receiveId="
+
$
(
"#inqu_status-0-receiveId"
).
val
()
+
"&inqu_status-0-companyCode="
+
$
(
"#inqu_status-0-companyCode"
).
val
(),
title
:
"<div style='text-align: center;'>综合实时库存</div>"
,
width
:
"90%"
,
height
:
"90%"
,
callbackName
:
selectInventCallback
});
}
/**
* 选择回调
*/
let
selectInventCallback
=
function
()
{
// 刷新页面
query
();
// 关闭弹窗
JSColorbox
.
close
();
}
function
loadChange
(
grid
,
e
,
field
)
{
var
cell_label
=
field
,
that
=
grid
;
// locked 表示是否为固定列
...
...
src/main/webapp/HG/KC/HGKC008B.js
0 → 100644
View file @
45800e0d
$
(
function
()
{
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
columns
:
[]
},
};
// 查询
$
(
"#QUERY"
).
on
(
"click"
,
query
);
// 确认
$
(
"#CONFIRM"
).
on
(
"click"
,
confirm
);
});
/**
* 页面加载时执行
*/
$
(
window
).
load
(
function
()
{
// 查询
query
();
//存货编号查询条件
initInventCode
();
});
/**
* 查询
*/
let
query
=
function
()
{
resultGrid
.
dataSource
.
page
(
1
);
// 点击查询按钮,从第1页开始查询
}
/**
* 选择
*/
let
confirm
=
function
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
)
return
;
}
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
let
invQty
=
rows
[
i
][
'invQty'
];
let
invWeight
=
rows
[
i
][
'invWeight'
];
if
(
!
isPositiveNumber
(
invQty
))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行库存数量必须大于0"
);
return
;
}
if
(
!
isPositiveNumber
(
invWeight
))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行库存总重必须大于0"
);
return
;
}
}
JSUtils
.
confirm
(
"确定对勾选的["
+
rows
.
length
+
"]条数据生成
\"
采购收货
\"
吗? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGKC008B"
,
"confirm"
,
true
,
function
(
e
)
{
var
status
=
e
.
getStatus
();
if
(
status
!==
-
1
)
{
parent
.
JSColorbox
.
setValueCallback
();
}
}
);
}
});
}
/**
* 存货编号
*/
let
initInventCode
=
function
()
{
//物料信息下拉
var
inInfo
=
new
EiInfo
();
EiCommunicator
.
send
(
"HGPZ005"
,
"queryComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
let
dataSource
;
var
input
=
$
(
"#inqu_status-0-inventCode"
);
dataSource
=
ei
.
getBlock
(
"invent_record_block_id"
).
getMappedRows
();
input
.
kendoDropDownList
({
valuePrimitive
:
true
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabel
:
"请选择"
,
dataSource
:
dataSource
,
template
:
"[#:valueField#]#:textField#|#:param2Field#"
,
filter
:
"contains"
});
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
}
src/main/webapp/HG/KC/HGKC008B.jsp
0 → 100644
View file @
45800e0d
<!DOCTYPE html>
<
%@
page
contentType=
"text/html; charset=UTF-8"
%
>
<
%@
taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%
>
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"综合库存管理"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFInput
ename=
"inqu_status-0-companyCode"
cname=
"公司编号"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-receiveId"
cname=
"领料单id"
colWidth=
"3"
type=
"hidden"
/>
<div
class=
"row"
>
<EF:EFSelect
cname=
"仓库名称"
blockId=
"inqu_status"
ename=
"whCode"
row=
"0"
colWidth=
"3"
optionLabel=
"全部"
defultValue=
""
filter=
"contains"
>
<EF:EFOptions
blockId=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFSelect
cname=
"存货类型"
blockId=
"inqu_status"
ename=
"inventType"
row=
"0"
colWidth=
"3"
optionLabel=
"全部"
defultValue=
""
filter=
"contains"
>
<EF:EFOptions
blockId=
"invent_type_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
<EF:EFSelect
cname=
"存货编号"
blockId=
"inqu_status"
ename=
"inventCode"
row=
"0"
colWidth=
"3"
filter=
"contains"
optionLabel=
"全部"
defultValue=
""
template=
"[#=valueField#]#=textField#"
>
<EF:EFOptions
blockId=
"invent_record_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyCode"
cname=
"公司编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"false"
width=
"130"
align=
"center"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"whCode"
cname=
"仓库名称"
enable=
"false"
width=
"120"
align=
"center"
blockName=
"wh_record_block_id"
textField=
"textField"
valueField=
"valueField"
>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
enable=
"false"
width=
"100"
align=
"center"
blockName=
"invent_type_block_id"
textField=
"textField"
valueField=
"valueField"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货编码"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"specId"
cname=
"规格ID"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"invQty"
cname=
"库存数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"invUnitWeight"
cname=
"单重(KG)"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"invWeight"
cname=
"库存总重(KG)"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时刻"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
<EF:EFColumn
ename=
"updatedName"
cname=
"更新人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"updatedTime"
cname=
"更新时刻"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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