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
d842a6d1
Commit
d842a6d1
authored
Aug 23, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
21b0ee32
d2f87c38
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
19 deletions
+82
-19
HGCG003B.java
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG003B.java
+17
-0
ServiceHGCG002.java
.../java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
+4
-1
HGCG003A.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG003A.xml
+11
-1
HGCG002B.jsp
src/main/webapp/HG/CG/HGCG002B.jsp
+5
-0
HGCG003B.js
src/main/webapp/HG/CG/HGCG003B.js
+36
-11
HGCG003B.jsp
src/main/webapp/HG/CG/HGCG003B.jsp
+9
-6
No files found.
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG003B.java
View file @
d842a6d1
...
...
@@ -61,6 +61,8 @@ public class HGCG003B extends DaoEPBase {
public
static
final
String
FIELD_CONTRACT_DETAIL_ID
=
"contractDetailId"
;
/* 合同明细id*/
public
static
final
String
FIELD_PROJ_CODE
=
"projCode"
;
/* 项目编码*/
public
static
final
String
FIELD_PROJ_NAME
=
"projName"
;
/* 项目名称*/
public
static
final
String
FIELD_CALCULATION_METHOD
=
"calculationMethod"
;
/* 计算方式 0-数量乘单价 1-重量乘单价*/
//页面要展示主表信息
public
static
final
String
FIELD_SUP_CODE
=
"supCode"
;
/* 供应商编码*/
...
...
@@ -164,6 +166,7 @@ public class HGCG003B extends DaoEPBase {
private
Integer
isInvoicing
=
0
;
/*是否开票 0-否 1-是*/
private
Integer
source
;
/* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
private
Integer
calculationMethod
;
/* 状态:0-未审批,1-审核通过,2-审核未通过*/
/**
* initialize the metadata.
*/
...
...
@@ -380,6 +383,10 @@ public class HGCG003B extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_PROJ_NAME
);
eiColumn
.
setDescName
(
"项目名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CALCULATION_METHOD
);
eiColumn
.
setDescName
(
"计算方式 0-数量乘单价 1-重量乘单价"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -1039,6 +1046,14 @@ public class HGCG003B extends DaoEPBase {
this
.
projName
=
projName
;
}
public
Integer
getCalculationMethod
()
{
return
calculationMethod
;
}
public
void
setCalculationMethod
(
Integer
calculationMethod
)
{
this
.
calculationMethod
=
calculationMethod
;
}
/**
* get the value from Map.
*
...
...
@@ -1092,6 +1107,7 @@ public class HGCG003B extends DaoEPBase {
setSource
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SOURCE
)),
source
));
setProjCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_CODE
)),
projCode
));
setProjName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_NAME
)),
projName
));
setCalculationMethod
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CALCULATION_METHOD
)),
calculationMethod
));
}
/**
...
...
@@ -1146,6 +1162,7 @@ public class HGCG003B extends DaoEPBase {
map
.
put
(
FIELD_SOURCE
,
StringUtils
.
toString
(
source
,
eiMetadata
.
getMeta
(
FIELD_SOURCE
)));
map
.
put
(
FIELD_PROJ_CODE
,
StringUtils
.
toString
(
projCode
,
eiMetadata
.
getMeta
(
FIELD_PROJ_CODE
)));
map
.
put
(
FIELD_PROJ_NAME
,
StringUtils
.
toString
(
projName
,
eiMetadata
.
getMeta
(
FIELD_PROJ_NAME
)));
map
.
put
(
FIELD_CALCULATION_METHOD
,
StringUtils
.
toString
(
calculationMethod
,
eiMetadata
.
getMeta
(
FIELD_CALCULATION_METHOD
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
View file @
d842a6d1
...
...
@@ -196,23 +196,26 @@ public class ServiceHGCG002 extends ServiceBase {
private
void
removeData
(
List
<
HGCG002
>
fCg002s
,
Map
<
String
,
HGCG002A
>
dbCg002AMap
)
{
//需要改变状态的采购计划主表
List
<
String
>
planNos
=
fCg002s
.
stream
().
map
(
HGCG002:
:
getPlanNo
).
collect
(
Collectors
.
toList
());
List
<
HGCG001
>
hgcg001List
=
HGCGTools
.
HgCg001
.
list
(
planNos
);
for
(
HGCG002
fCg002
:
fCg002s
)
{
String
contractNo
=
fCg002
.
getContractNo
();
HGCG002
dbCg002
=
dbCg002AMap
.
get
(
contractNo
);
dbCg002
.
setDeleteFlag
(
DeleteFlagEnum
.
REMOVE
.
getCode
());
DaoUtils
.
update
(
HGCG002
.
DELETE
,
dbCg002
);
if
(
StringUtils
.
isNotBlank
(
dbCg002
.
getPlanNo
())){
// 更新计划状态
HGCGTools
.
HgCg001
.
updateStatus
(
dbCg002
.
getPlanNo
(),
HGConstant
.
CgContractStatus
.
S_2
);
}
}
List
<
Long
>
primaryIds
=
fCg002s
.
stream
().
map
(
o
->
o
.
getId
()).
collect
(
Collectors
.
toList
());
List
<
HGCG002B
>
queryHgcg002BList
=
HGCGTools
.
HgCg002B
.
listByPrimaryIds
(
primaryIds
);
for
(
HGCG002B
hgcg002B
:
queryHgcg002BList
){
// 更新计划明细状态
if
(
hgcg002B
.
getPlanDetailId
()
!=
null
&&
hgcg002B
.
getPlanDetailId
().
intValue
()
!=
0
){
HGCGTools
.
HgCg001A
.
updateStatus
(
hgcg002B
.
getPlanDetailId
(),
HGConstant
.
CgPlanStatus
.
S_2
);
}
}
}
...
...
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG003A.xml
View file @
d842a6d1
...
...
@@ -119,6 +119,9 @@
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
PROJ_NAME LIKE CONCAT('%', #projName# ,'%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"calculationMethod"
>
CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
</sql>
<sql
id=
"idCondition"
>
...
...
@@ -180,6 +183,7 @@
PRIMARY_ID as "primaryId",
<!-- 主表id -->
PROJ_CODE as "projCode",
<!-- 项目编码 -->
PROJ_NAME as "projName",
<!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod",
<!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CONTRACT_DETAIL_ID as "contractDetailId",
<!-- 合同明细id -->
IS_INVOICING as "isInvoicing"
FROM ${hggpSchema}.HGCG003A WHERE 1=1
...
...
@@ -240,13 +244,14 @@
CONTRACT_DETAIL_ID,
<!-- 合同明细id -->
PROJ_CODE,
<!-- 项目编码 -->
PROJ_NAME,
<!-- 项目名称 -->
CALCULATION_METHOD,
IS_INVOICING
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #planNo#, #contractNo#,
#inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#inventTypeDetail#, #primaryId#, #contractDetailId#,#projCode#,#projName#,#isInvoicing#)
#inventTypeDetail#, #primaryId#, #contractDetailId#,#projCode#,#projName#,#
calculationMethod#,#
isInvoicing#)
</insert>
<delete
id=
"delete"
>
...
...
@@ -295,6 +300,7 @@
CONTRACT_DETAIL_ID = #contractDetailId#,
<!-- 合同明细id -->
PROJ_CODE = #projCode#,
<!-- 项目编码 -->
PROJ_NAME = #projName#,
<!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing#
WHERE
ID = #id#
...
...
@@ -390,6 +396,7 @@
a.CONTRACT_DETAIL_ID as "contractDetailId",
<!-- 合同明细id -->
a.PROJ_CODE as "projCode",
<!-- 项目编码 -->
a.PROJ_NAME as "projName",
<!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod",
<!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
b.STATUS as "status",
<!-- 状态 -->
b.SUP_CODE as "supCode",
<!-- 供应商编码 -->
b.SUP_NAME as "supName",
<!-- 供应商名称 -->
...
...
@@ -439,6 +446,9 @@
<isNotEmpty
prepend=
" AND "
property=
"receiveDate"
>
a.RECEIVE_DATE = replace(#receiveDate#,'-','')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"calculationMethod"
>
a.CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"supCode"
>
b.SUP_CODE = #supCode#
</isNotEmpty>
...
...
src/main/webapp/HG/CG/HGCG002B.jsp
View file @
d842a6d1
...
...
@@ -35,6 +35,11 @@
</EF:EFComboColumn>
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型大类"
hidden=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"80"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"已收货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
...
...
src/main/webapp/HG/CG/HGCG003B.js
View file @
d842a6d1
...
...
@@ -82,22 +82,19 @@ $(function () {
loadComplete
:
function
(
grid
)
{
// 此grid对象
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
var
item
=
e
.
items
[
0
];
//数量发生变化进行计算
if
(
e
.
field
===
"receiveQty"
){
if
(
e
.
items
[
0
].
receiveUnitWeight
!=
null
){
let
receiveWeight
=
e
.
items
[
0
].
receiveQty
*
e
.
items
[
0
].
receiveUnitWeight
;
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'receiveWeight'
,
receiveWeight
);
}
if
(
e
.
items
[
0
].
price
!=
null
){
let
amount
=
e
.
items
[
0
].
receiveQty
*
e
.
items
[
0
].
price
;
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'amount'
,
amount
);
}
calAmount
(
item
)
}
if
(
e
.
field
===
"price"
){
if
(
e
.
items
[
0
].
receiveQty
!=
null
){
let
amount
=
e
.
items
[
0
].
receiveQty
*
e
.
items
[
0
].
price
;
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'amount'
,
amount
);
calAmount
(
item
)
}
if
(
e
.
field
===
"receiveWeight"
){
calAmount
(
item
)
}
if
(
e
.
field
===
"calculationMethod"
){
calAmount
(
item
)
}
if
(
e
.
field
===
"inventCode"
)
{
for
(
let
i
=
0
;
i
<
inventRecordBoxBlockId
.
length
;
i
++
)
{
...
...
@@ -165,6 +162,34 @@ $(window).load(function () {
});
/**
* 计算金额
* @param item
* @param length
* @param width
* @param thick
* @param coefficient
*/
let
calAmount
=
function
(
item
)
{
//计算方式为重量乘单价
if
(
item
.
calculationMethod
==
1
){
if
(
item
.
receiveWeight
&&
item
.
price
){
// 重量*单价金额
let
totalAmount
=
item
.
receiveWeight
*
item
.
price
;
resultGrid
.
setCellValue
(
item
,
'amount'
,
totalAmount
)
}
}
else
{
if
(
item
.
receiveQty
&&
item
.
price
){
if
(
item
.
receiveQty
&&
item
.
price
){
// 重量*单价金额
let
totalAmount
=
item
.
receiveQty
*
item
.
price
;
resultGrid
.
setCellValue
(
item
,
'amount'
,
totalAmount
)
}
}
}
}
/**
* 查询
*/
let
query
=
function
()
{
...
...
src/main/webapp/HG/CG/HGCG003B.jsp
View file @
d842a6d1
...
...
@@ -35,18 +35,21 @@
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型大类"
hidden=
"true"
/>
<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=
"material"
cname=
"材质"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"收货数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"receiveWeight"
cname=
"收货重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"deliverQty"
cname=
"退货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"depositQty"
cname=
"入库数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"receiveWeight"
cname=
"收货重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"receiveUnitWeight"
cname=
"收货单重"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"calculationMethod"
cname=
"计算方式"
enable=
"true"
width=
"100"
align=
"center"
required=
"true"
>
<EF:EFCodeOption
codeName=
"hggp.cg.calculationMethod"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"price"
cname=
"单价"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"amount"
cname=
"金额"
enable=
"false"
width=
"80"
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=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hggp.hgcg.receiveStatus"
/>
</EF:EFComboColumn>
...
...
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