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
05a6d7dd
Commit
05a6d7dd
authored
Sep 11, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-11 采购收票修复删除功能和优化
parent
37cf42bb
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
268 additions
and
55 deletions
+268
-55
ContractTypeEnum.java
src/main/java/com/baosight/hggp/common/ContractTypeEnum.java
+74
-0
HGCG003B.java
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG003B.java
+32
-0
HGCG003A.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG003A.xml
+2
-0
HGCGTools.java
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
+20
-11
HGCW013.java
src/main/java/com/baosight/hggp/hg/cw/domain/HGCW013.java
+46
-0
ServiceHGCW012.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
+23
-12
HGCW012.xml
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW012.xml
+1
-1
HGCW012A.xml
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW012A.xml
+9
-0
HGCW013.xml
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW013.xml
+22
-4
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+11
-11
HGCW010.js
src/main/webapp/HG/CW/HGCW010.js
+2
-2
HGCW012.js
src/main/webapp/HG/CW/HGCW012.js
+10
-0
HGCW012.jsp
src/main/webapp/HG/CW/HGCW012.jsp
+6
-6
HGCW012A.js
src/main/webapp/HG/CW/HGCW012A.js
+5
-4
HGCW012C.js
src/main/webapp/HG/CW/HGCW012C.js
+1
-0
HGCW012C.jsp
src/main/webapp/HG/CW/HGCW012C.jsp
+4
-4
No files found.
src/main/java/com/baosight/hggp/common/ContractTypeEnum.java
0 → 100644
View file @
05a6d7dd
package
com
.
baosight
.
hggp
.
common
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author LiuYang
* @version 1.0 2024/9/11
* @description 合同类型
*/
public
enum
ContractTypeEnum
{
CGSH
(
1
,
"采购收货"
),
LZHT
(
2
,
"劳务合同"
),
ZLHT
(
3
,
"租赁合同"
);
private
Integer
code
;
private
String
value
;
ContractTypeEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
static
EiBlock
generatorEiBlock
()
{
EiBlock
block
=
new
EiBlock
(
"contract_type_block_id"
);
List
<
Map
<
String
,
Object
>>
rows
=
new
ArrayList
<
Map
<
String
,
Object
>>()
{{
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
CGSH
.
code
+
"-"
+
CGSH
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
CGSH
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
LZHT
.
code
+
"-"
+
LZHT
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
LZHT
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
ZLHT
.
code
+
"-"
+
ZLHT
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
ZLHT
.
code
);
}});
}};
block
.
setRows
(
rows
);
return
block
;
}
public
static
ContractTypeEnum
getEnumByCode
(
Integer
code
){
for
(
ContractTypeEnum
en
:
ContractTypeEnum
.
values
()){
if
(
code
.
compareTo
(
en
.
code
)==
0
){
return
en
;
}
}
return
null
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
src/main/java/com/baosight/hggp/hg/cg/domain/HGCG003B.java
View file @
05a6d7dd
...
...
@@ -65,6 +65,8 @@ public class HGCG003B extends DaoEPBase {
public
static
final
String
FIELD_IS_INVOICING
=
"isInvoicing"
;
/* 是否开票 0否 1是*/
public
static
final
String
FIELD_PROJ_CODE
=
"projCode"
;
/* 项目编码*/
public
static
final
String
FIELD_PROJ_NAME
=
"projName"
;
/* 项目名称*/
public
static
final
String
FIELD_SUP_CODE
=
"supCode"
;
/* 供应商编码*/
public
static
final
String
FIELD_SUP_NAME
=
"supName"
;
/* 供应商名称*/
public
static
final
String
FIELD_CALCULATION_METHOD
=
"calculationMethod"
;
/* 计算方式 0-数量乘单价 1-重量乘单价*/
public
static
final
String
FIELD_CANCEL_AMOUNT
=
"cancelAmount"
;
/* 核销金额*/
public
static
final
String
FIELD_UN_CANCEL_AMOUNT
=
"unCancelAmount"
;
/* 未核销金额*/
...
...
@@ -163,6 +165,8 @@ public class HGCG003B extends DaoEPBase {
private
Integer
isInvoicing
=
0
;
/* 是否开票 0否 1是*/
private
String
projCode
=
" "
;
/* 项目编码*/
private
String
projName
=
" "
;
/* 项目名称*/
private
String
supCode
=
" "
;
/* 供应商编码*/
private
String
supName
=
" "
;
/* 供应商名称*/
private
Integer
calculationMethod
=
0
;
/* 计算方式 0-数量乘单价 1-重量乘单价*/
private
BigDecimal
cancelAmount
=
new
BigDecimal
(
"0"
);
/* 核销金额*/
private
BigDecimal
unCancelAmount
=
new
BigDecimal
(
"0"
);
/* 未核销金额*/
...
...
@@ -385,6 +389,14 @@ public class HGCG003B extends DaoEPBase {
eiColumn
.
setDescName
(
"项目名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_SUP_CODE
);
eiColumn
.
setDescName
(
"供应商编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_SUP_NAME
);
eiColumn
.
setDescName
(
"供应商名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CALCULATION_METHOD
);
eiColumn
.
setDescName
(
"计算方式 0-数量乘单价 1-重量乘单价"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -1132,6 +1144,22 @@ public class HGCG003B extends DaoEPBase {
this
.
unCancelAmount
=
unCancelAmount
;
}
public
String
getSupCode
()
{
return
supCode
;
}
public
void
setSupCode
(
String
supCode
)
{
this
.
supCode
=
supCode
;
}
public
String
getSupName
()
{
return
supName
;
}
public
void
setSupName
(
String
supName
)
{
this
.
supName
=
supName
;
}
/**
* get the value from Map.
*
...
...
@@ -1183,6 +1211,8 @@ public class HGCG003B extends DaoEPBase {
setIsInvoicing
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_IS_INVOICING
)),
isInvoicing
));
setProjCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_CODE
)),
projCode
));
setProjName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_PROJ_NAME
)),
projName
));
setSupCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUP_CODE
)),
supCode
));
setSupName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SUP_NAME
)),
supName
));
setCalculationMethod
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CALCULATION_METHOD
)),
calculationMethod
));
setCancelAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CANCEL_AMOUNT
)),
cancelAmount
));
setUnCancelAmount
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UN_CANCEL_AMOUNT
)),
unCancelAmount
));
...
...
@@ -1238,6 +1268,8 @@ public class HGCG003B extends DaoEPBase {
map
.
put
(
FIELD_IS_INVOICING
,
StringUtils
.
toString
(
isInvoicing
,
eiMetadata
.
getMeta
(
FIELD_IS_INVOICING
)));
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_SUP_CODE
,
StringUtils
.
toString
(
supCode
,
eiMetadata
.
getMeta
(
FIELD_SUP_CODE
)));
map
.
put
(
FIELD_SUP_NAME
,
StringUtils
.
toString
(
supName
,
eiMetadata
.
getMeta
(
FIELD_SUP_NAME
)));
map
.
put
(
FIELD_CALCULATION_METHOD
,
StringUtils
.
toString
(
calculationMethod
,
eiMetadata
.
getMeta
(
FIELD_CALCULATION_METHOD
)));
map
.
put
(
FIELD_CANCEL_AMOUNT
,
StringUtils
.
toString
(
cancelAmount
,
eiMetadata
.
getMeta
(
FIELD_CANCEL_AMOUNT
)));
map
.
put
(
FIELD_UN_CANCEL_AMOUNT
,
StringUtils
.
toString
(
unCancelAmount
,
eiMetadata
.
getMeta
(
FIELD_UN_CANCEL_AMOUNT
)));
...
...
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG003A.xml
View file @
05a6d7dd
...
...
@@ -329,6 +329,8 @@
UPDATE ${hggpSchema}.HGCG003A
SET
IS_INVOICING = #isInvoicing#,
CANCEL_AMOUNT = #cancelAmount#,
UN_CANCEL_AMOUNT = #unCancelAmount#,
<include
refid=
"updateRevise"
/>
WHERE RECEIVE_NO = #receiveNo#
</update>
...
...
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
View file @
05a6d7dd
...
...
@@ -6,6 +6,7 @@ import com.baosight.hggp.core.enums.DeleteFlagEnum;
import
com.baosight.hggp.hg.cg.domain.*
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.cw.domain.HGCW013
;
import
com.baosight.hggp.hg.kc.tools.HGKCTools
;
import
com.baosight.hggp.hg.zl.domain.HGZL001
;
import
com.baosight.hggp.util.AssertUtils
;
...
...
@@ -696,17 +697,25 @@ public class HGCGTools {
/**
* 修改是否开票
*
* @param receiveNo
* @param isInvoicing
*/
public
static
void
updateIsInvoicing
(
String
receiveNo
,
Integer
isInvoicing
)
{
AssertUtils
.
isEmpty
(
receiveNo
,
"收货单号不能为空!"
);
AssertUtils
.
isNull
(
isInvoicing
,
"是否开票不能为空!"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"receiveNo"
,
receiveNo
);
paramMap
.
put
(
"isInvoicing"
,
isInvoicing
);
DaoUtils
.
update
(
HGSqlConstant
.
HgCg003A
.
UPDATE_IS_INVOICING
,
paramMap
);
* @param hgcw013
*/
public
static
void
updateIsInvoicing
(
HGCW013
hgcw013
)
{
AssertUtils
.
isNull
(
hgcw013
,
"采购收货详情不能为空!"
);
List
<
HGCG003B
>
hgcg003Bs
=
DaoBase
.
getInstance
().
query
(
HGCG003B
.
QUERY
,
new
HashMap
<
String
,
Object
>(){{
put
(
HGCG003B
.
FIELD_RECEIVE_NO
,
hgcw013
.
getSettlementNumber
());
}});
List
<
HGCG003B
>
hgcg003BList
=
hgcg003Bs
.
stream
().
filter
(
item
->
item
.
getInventCode
().
equals
(
hgcw013
.
getInventCode
())
&&
item
.
getSpec
().
equals
(
hgcw013
.
getSpec
())
).
collect
(
Collectors
.
toList
());
if
(
hgcg003BList
.
size
()
>
0
){
HGCG003B
hgcg003B
=
hgcg003BList
.
get
(
0
);
hgcg003B
.
setIsInvoicing
(
HGConstant
.
CgIsInvoicing
.
S_0
);
hgcg003B
.
setCancelAmount
(
hgcg003B
.
getCancelAmount
().
subtract
(
hgcw013
.
getTotalContractPriceIncluding
()));
hgcg003B
.
setUnCancelAmount
(
hgcg003B
.
getUnCancelAmount
().
add
(
hgcw013
.
getTotalContractPriceIncluding
()));
DaoUtils
.
update
(
HGCG003B
.
UPDATE
,
hgcg003B
);
}
}
/**
...
...
src/main/java/com/baosight/hggp/hg/cw/domain/HGCW013.java
View file @
05a6d7dd
...
...
@@ -46,6 +46,9 @@ public class HGCW013 extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 记录修改时间*/
public
static
final
String
FIELD_DEP_CODE
=
"depCode"
;
/* 部门编码*/
public
static
final
String
FIELD_COMPANY_CODES
=
"companyCodes"
;
/*用户角色权限*/
public
static
final
String
FIELD_INVENT_CODE
=
"inventCode"
;
/* 存货编码*/
public
static
final
String
FIELD_INVENT_NAME
=
"inventName"
;
/* 存货名称*/
public
static
final
String
FIELD_SPEC
=
"spec"
;
/* 规格*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_MAIN_ID
=
"MAIN_ID"
;
/* 主表ID*/
...
...
@@ -95,6 +98,9 @@ public class HGCW013 extends DaoEPBase {
private
String
updatedName
=
" "
;
/* 记录修改名称*/
private
String
updatedTime
=
" "
;
/* 记录修改时间*/
private
String
depCode
=
" "
;
/* 部门编码*/
private
String
inventCode
=
" "
;
/* 存货编码*/
private
String
inventName
=
" "
;
/* 存货名称*/
private
String
spec
=
" "
;
/* 规格*/
/**
* initialize the metadata.
...
...
@@ -190,7 +196,17 @@ public class HGCW013 extends DaoEPBase {
eiColumn
.
setDescName
(
"部门编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_CODE
);
eiColumn
.
setDescName
(
"存货编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_INVENT_NAME
);
eiColumn
.
setDescName
(
"存货名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_SPEC
);
eiColumn
.
setDescName
(
"规格"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -522,6 +538,30 @@ public class HGCW013 extends DaoEPBase {
this
.
depCode
=
depCode
;
}
public
String
getInventCode
()
{
return
inventCode
;
}
public
void
setInventCode
(
String
inventCode
)
{
this
.
inventCode
=
inventCode
;
}
public
String
getInventName
()
{
return
inventName
;
}
public
void
setInventName
(
String
inventName
)
{
this
.
inventName
=
inventName
;
}
public
String
getSpec
()
{
return
spec
;
}
public
void
setSpec
(
String
spec
)
{
this
.
spec
=
spec
;
}
/**
* get the value from Map.
*
...
...
@@ -551,6 +591,9 @@ public class HGCW013 extends DaoEPBase {
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_NAME
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setDepCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DEP_CODE
)),
depCode
));
setInventCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_CODE
)),
inventCode
));
setInventName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_INVENT_NAME
)),
inventName
));
setSpec
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_SPEC
)),
spec
));
}
/**
...
...
@@ -581,6 +624,9 @@ public class HGCW013 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_DEP_CODE
,
StringUtils
.
toString
(
depCode
,
eiMetadata
.
getMeta
(
FIELD_DEP_CODE
)));
map
.
put
(
FIELD_INVENT_CODE
,
StringUtils
.
toString
(
inventCode
,
eiMetadata
.
getMeta
(
FIELD_INVENT_CODE
)));
map
.
put
(
FIELD_INVENT_NAME
,
StringUtils
.
toString
(
inventName
,
eiMetadata
.
getMeta
(
FIELD_INVENT_NAME
)));
map
.
put
(
FIELD_SPEC
,
StringUtils
.
toString
(
spec
,
eiMetadata
.
getMeta
(
FIELD_SPEC
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
View file @
05a6d7dd
...
...
@@ -2,11 +2,13 @@ package com.baosight.hggp.hg.cw.service;
import
com.baosight.eplat.utils.StringUtils
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.ContractTypeEnum
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.ReviewStatusEnum
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.cg.constant.HgCgConst
;
import
com.baosight.hggp.hg.cg.domain.HGCG003
;
import
com.baosight.hggp.hg.cg.domain.HGCG003B
;
import
com.baosight.hggp.hg.cg.tools.HGCGTools
;
...
...
@@ -135,6 +137,8 @@ public class ServiceHGCW012 extends ServiceBase {
}}
);
AssertUtils
.
isEmpty
(
hgcg003BList
,
"未找到匹配的采购收货"
);
hgcw012
.
setRemainingAmount
(
hgcw012
.
getTotalContractPriceIncluding
());
hgcw012
.
setContractType
(
ContractTypeEnum
.
CGSH
.
getCode
());
DaoUtils
.
insert
(
HGCW012
.
INSERT
,
hgcw012
);
BigDecimal
taxPoints
=
new
BigDecimal
(
hgcw012
.
getTaxPoints
());
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率 转换为小数形式
...
...
@@ -142,10 +146,10 @@ public class ServiceHGCW012 extends ServiceBase {
BigDecimal
unCancelAmount
=
hgcg003BList
.
stream
().
map
(
HGCG003B:
:
getUnCancelAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
AssertUtils
.
isGt
(
totalContractPriceIncluding
,
unCancelAmount
,
"发票金额大于供应商未开票金额!"
);
boolean
flag
=
true
;
StringBuffer
settlementNumber
=
new
StringBuffer
();
List
<
String
>
settlementNumber
=
new
ArrayList
<>
();
//生成明细表
for
(
HGCG003B
hgcg003B
:
hgcg003BList
)
{
settlementNumber
.
a
ppend
(
hgcg003B
.
getReceiveNo
()).
append
(
","
);
settlementNumber
.
a
dd
(
hgcg003B
.
getReceiveNo
()
);
HGCW013
hgcw013
=
new
HGCW013
();
BeanUtils
.
copyProperties
(
hgcg003B
,
hgcw013
,
"id"
,
"accountCode"
,
"depCode"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
);
...
...
@@ -182,7 +186,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
//跟新采购收票状态
if
(
ObjectUtils
.
isEmpty
(
hgcg003B
.
getCalculationMethod
())){
hgcg003B
.
setCalculationMethod
(
0
);
hgcg003B
.
setCalculationMethod
(
HgCgConst
.
CalculationMethod
.
S
0
);
}
DaoUtils
.
update
(
HGCG003B
.
UPDATE
,
hgcg003B
);
...
...
@@ -195,7 +199,7 @@ public class ServiceHGCW012 extends ServiceBase {
break
;
}
}
hgcw012
.
setSettlementNumber
(
settlementNumber
.
toString
().
substring
(
0
,
settlementNumber
.
length
()
-
1
));
hgcw012
.
setSettlementNumber
(
settlementNumber
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
","
)
));
DaoUtils
.
update
(
HGCW012
.
UPDATE
,
hgcw012
);
}
...
...
@@ -228,11 +232,13 @@ public class ServiceHGCW012 extends ServiceBase {
}
String
[]
settlementNumbers
=
hgcw012
.
getSettlementNumber
().
split
(
","
);
List
<
HGCW013
>
results
=
HGCWTools
.
HgCw013
.
getMainId
(
hgcw012
.
getId
());
Map
<
String
,
HGCW013
>
hgcw013Map
=
results
.
stream
().
collect
(
Collectors
.
toMap
(
HGCW013:
:
getSettlementNumber
,
item
->
item
));
for
(
String
settlementNumber
:
settlementNumbers
)
{
Map
<
String
,
BigDecimal
>
parmap
=
results
.
stream
().
filter
(
item
->
Objects
.
equals
(
item
.
getSettlementNumber
(),
settlementNumber
)).
collect
(
Collectors
.
toMap
(
HGCW013:
:
getSettlementNumber
,
HGCW013:
:
getTotalContractPriceIncluding
,(
v1
,
v2
)
->
v2
));
if
(
hgcw012
.
getContractType
()
==
1
)
{
// 更新采购收票状态
HGCGTools
.
HgCg003
.
updateIsInvoicing
(
settlementNumber
,
HGConstant
.
CgIsInvoicing
.
S_0
);
HGCGTools
.
HgCg003
.
updateIsInvoicing
(
hgcw013Map
.
get
(
settlementNumber
));
DaoUtils
.
update
(
HGCW013
.
DELETE_MAIN
,
hgcw012
);
}
else
if
(
hgcw012
.
getContractType
()
==
2
){
...
...
@@ -275,7 +281,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setReviewStatus
(
0
);
hgcw012
.
setBillState
(
0
);
hgcw012
.
setBillTybe
(
1
);
hgcw012
.
setContractType
(
2
);
hgcw012
.
setContractType
(
ContractTypeEnum
.
LZHT
.
getCode
()
);
//hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012
.
setReceiveDate
(
DateUtils
.
shortDate
());
BigDecimal
totalContractPriceIncluding
=
BigDecimal
.
ZERO
;
...
...
@@ -300,7 +306,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setRemainingAmount
(
new
BigDecimal
(
decimalFormat
.
format
(
totalContractPriceIncluding
)));
hgcw012
.
setProjCode
(
hgcw013List
.
get
(
0
).
getProjCode
());
hgcw012
.
setProjName
(
hgcw013List
.
get
(
0
).
getProjName
());
this
.
add
(
hgcw012
);
DaoUtils
.
insert
(
HGCW012
.
INSERT
,
hgcw012
);
//生成明细表
for
(
HGCW013
hgcw013
:
hgcw013List
)
{
...
...
@@ -376,7 +382,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setReviewStatus
(
0
);
hgcw012
.
setBillState
(
0
);
hgcw012
.
setBillTybe
(
1
);
hgcw012
.
setContractType
(
1
);
hgcw012
.
setContractType
(
ContractTypeEnum
.
CGSH
.
getCode
()
);
//hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012
.
setReceiveDate
(
DateUtils
.
shortDate
());
hgcw012
.
setPartyA
(
hgcw013List
.
get
(
0
).
getPartyA
());
...
...
@@ -403,14 +409,19 @@ public class ServiceHGCW012 extends ServiceBase {
//hgcw012.setSettlementNumber(settlementNumber.toString().substring(0, settlementNumber.length() - 1));
//hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
this
.
add
(
hgcw012
);
DaoUtils
.
insert
(
HGCW012
.
INSERT
,
hgcw012
);
//生成明细表
for
(
HGCW013
hgcw013
:
hgcw013List
)
{
hgcw013
.
setMainId
(
hgcw012
.
getId
());
hgcw013
.
setId
(
null
);
//跟新采购收票状态
HGCGTools
.
HgCg003
.
updateIsInvoicing
(
hgcw013
.
getSettlementNumber
(),
HGConstant
.
CgIsInvoicing
.
S_1
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
HGCG003B
.
FIELD_RECEIVE_NO
,
hgcw013
.
getSettlementNumber
());
paramMap
.
put
(
HGCG003B
.
FIELD_IS_INVOICING
,
HGConstant
.
CgIsInvoicing
.
S_1
);
paramMap
.
put
(
HGCG003B
.
FIELD_CANCEL_AMOUNT
,
hgcw013
.
getTotalContractPriceIncluding
());
paramMap
.
put
(
HGCG003B
.
FIELD_UN_CANCEL_AMOUNT
,
0
);
DaoUtils
.
update
(
HGSqlConstant
.
HgCg003A
.
UPDATE_IS_INVOICING
,
paramMap
);
this
.
addHGCW013
(
hgcw013
);
}
}
else
{
...
...
@@ -475,7 +486,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setReviewStatus
(
0
);
hgcw012
.
setBillState
(
0
);
hgcw012
.
setBillTybe
(
1
);
hgcw012
.
setContractType
(
3
);
hgcw012
.
setContractType
(
ContractTypeEnum
.
ZLHT
.
getCode
()
);
//hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012
.
setReceiveDate
(
DateUtils
.
shortDate
());
BigDecimal
totalContractPriceIncluding
=
BigDecimal
.
ZERO
;
...
...
@@ -500,7 +511,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setRemainingAmount
(
new
BigDecimal
(
decimalFormat
.
format
(
totalContractPriceIncluding
)));
hgcw012
.
setProjCode
(
hgcw013List
.
get
(
0
).
getProjCode
());
hgcw012
.
setProjName
(
hgcw013List
.
get
(
0
).
getProjName
());
this
.
add
(
hgcw012
);
DaoUtils
.
insert
(
HGCW012
.
INSERT
,
hgcw012
);
//生成明细表
for
(
HGCW013
hgcw013
:
hgcw013List
)
{
...
...
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW012.xml
View file @
05a6d7dd
...
...
@@ -189,7 +189,7 @@
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
RECEIVE_DATE desc
,SIGNING_DATE desc
, ID desc
RECEIVE_DATE desc, ID desc
</isEmpty>
</dynamic>
...
...
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW012A.xml
View file @
05a6d7dd
...
...
@@ -570,6 +570,15 @@
<isNotEmpty
prepend=
" AND "
property=
"isUnCancelAmount"
>
A.UN_CANCEL_AMOUNT > #isUnCancelAmount#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
A.PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
A.PROJ_NAME LIKE CONCAT('%', #projName# ,'%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"supCode"
>
B.SUP_CODE = #supCode#
</isNotEmpty>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
...
...
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW013.xml
View file @
05a6d7dd
...
...
@@ -47,7 +47,10 @@
UPDATED_BY as "updatedBy",
<!-- 记录修改者 -->
UPDATED_NAME as "updatedName",
<!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime",
<!-- 记录修改时间 -->
DEP_CODE as "depCode"
<!-- 部门编码 -->
DEP_CODE as "depCode",
<!-- 部门编码 -->
INVENT_CODE as "inventCode",
INVENT_NAME as "inventName",
SPEC as "spec"
</sql>
<sql
id=
"condition"
>
<include
refid=
"HGXSDataAuth.authCondition"
/>
...
...
@@ -117,6 +120,15 @@
<isNotEmpty
prepend=
" AND "
property=
"companyCodes"
>
COMPANY_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"companyCodes"
>
#companyCodes[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventCode"
>
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"inventName"
>
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"spec"
>
SPEC = #spec#
</isNotEmpty>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
@@ -222,9 +234,12 @@
UPDATED_BY,
<!-- 记录修改者 -->
UPDATED_NAME,
<!-- 记录修改名称 -->
UPDATED_TIME,
<!-- 记录修改时间 -->
DEP_CODE
<!-- 部门编码 -->
DEP_CODE,
<!-- 部门编码 -->
INVENT_CODE,
<!-- 存货编码 -->
INVENT_NAME,
<!-- 存货名称 -->
SPEC
<!-- 规格 -->
)
VALUES (#id#, #mainId#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #settlementNumber#, #billNumber#, #partyA#, #taxPoints#, #thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #mainId#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #settlementNumber#, #billNumber#, #partyA#, #taxPoints#, #thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#
, #inventCode#, #inventName#, #spec#
)
</insert>
<delete
id=
"delete"
>
...
...
@@ -257,7 +272,10 @@
UPDATED_BY = #updatedBy#,
<!-- 记录修改者 -->
UPDATED_NAME = #updatedName#,
<!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 记录修改时间 -->
DEP_CODE = #depCode#
<!-- 部门编码 -->
DEP_CODE = #depCode#,
<!-- 部门编码 -->
INVENT_CODE = #inventCode#,
<!-- 存货编码 -->
INVENT_NAME = #inventName#,
<!-- 存货名称 -->
SPEC = #spec#
<!-- 规格 -->
WHERE
ID = #id#
</update>
...
...
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
05a6d7dd
...
...
@@ -932,26 +932,26 @@ public class HGCWTools {
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
HGCW
013
=
new
HGCW013
();
HGCW
013
.
fromMap
(
row
);
HGCW013
hgcw
013
=
new
HGCW013
();
hgcw
013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"receiveNo"
).
toString
();
String
partA
=
row
.
get
(
"sup
Nam
e"
).
toString
();
String
partA
=
row
.
get
(
"sup
Cod
e"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisSettlementAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
"13"
);
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisSettlementAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW
013
.
setPartyA
(
partA
);
HGCW
013
.
setTaxPoints
(
new
Integer
(
String
.
valueOf
(
taxPoints
)));
HGCW
013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW
013
.
setSettlementNumber
(
settlementNumber
);
HGCW
013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW
013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
hgcw
013
.
setPartyA
(
partA
);
hgcw
013
.
setTaxPoints
(
new
Integer
(
String
.
valueOf
(
taxPoints
)));
hgcw
013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
hgcw
013
.
setSettlementNumber
(
settlementNumber
);
hgcw
013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
hgcw
013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
HGCW
013
.
setMainId
(
mainId
);
hgcw
013
.
setMainId
(
mainId
);
}
HGCW013List
.
add
(
HGCW
013
);
HGCW013List
.
add
(
hgcw
013
);
});
}
return
HGCW013List
;
...
...
src/main/webapp/HG/CW/HGCW010.js
View file @
05a6d7dd
...
...
@@ -188,8 +188,8 @@ function contractDetailFunc(id) {
JSColorbox
.
open
({
href
:
"HGCW010B?methodName=initLoad&inqu_status-0-mainId="
+
id
+
"&efParentFormEname=HGCW010"
,
title
:
"<div style='text-align: center;'>开票清单</div>"
,
width
:
"
90
%"
,
height
:
"
90
%"
,
width
:
"
75
%"
,
height
:
"
75
%"
,
callbackName
:
windowCallback
});
}
...
...
src/main/webapp/HG/CW/HGCW012.js
View file @
05a6d7dd
...
...
@@ -47,6 +47,16 @@ $(function() {
defaultValue
:
function
()
{
return
currShortDate
();
}
},{
field
:
"thisSettlementAmount"
,
template
:
function
(
item
)
{
return
kendo
.
format
(
"{0:C3}"
,
parseFloat
(
item
.
thisSettlementAmount
));
}
},{
field
:
"thisSettlementTax"
,
template
:
function
(
item
)
{
return
kendo
.
format
(
"{0:C3}"
,
parseFloat
(
item
.
thisSettlementTax
));
}
}],
loadComplete
:
function
(
grid
)
{
$
(
"#SELECT_BILL"
).
on
(
"click"
,
addFunc
);
...
...
src/main/webapp/HG/CW/HGCW012.jsp
View file @
05a6d7dd
...
...
@@ -70,16 +70,16 @@
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
enable=
"true"
>
<EF:EFCodeOption
codeName=
"hggp.cw.taxPoints"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"totalContractPriceIncluding"
cname=
"发票总额"
width=
"120"
enable=
"true"
format=
"{0:
N
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
readonly=
"true"
<EF:EFColumn
ename=
"totalContractPriceIncluding"
cname=
"发票总额"
width=
"120"
enable=
"true"
format=
"{0:
C
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
readonly=
"true"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
maxLength=
"15"
required=
"true"
data-errorprompt=
"请输入数字,该值最大可设置15位整数和3位小数!"
/>
<EF:EFColumn
ename=
"thisSettlementAmount"
cname=
"不含税金额"
width=
"120"
enable=
"false"
format=
"{0:
N
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
<EF:EFColumn
ename=
"thisSettlementAmount"
cname=
"不含税金额"
width=
"120"
enable=
"false"
format=
"{0:
C
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
maxLength=
"15"
required=
"false"
data-errorprompt=
"请输入数字,该值最大可设置15位整数和3位小数!"
/>
<EF:EFColumn
ename=
"thisSettlementTax"
cname=
"税额"
width=
"120"
enable=
"false"
format=
"{0:
N
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
<EF:EFColumn
ename=
"thisSettlementTax"
cname=
"税额"
width=
"120"
enable=
"false"
format=
"{0:
C
3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
maxLength=
"15"
required=
"false"
data-errorprompt=
"请输入数字,该值最大可设置15位整数和3位小数!"
/>
<EF:EFComboColumn
ename=
"reviewStatus"
cname=
"审批状态"
width=
"100"
align=
"center"
required=
"true"
defaultValue=
"0"
...
...
src/main/webapp/HG/CW/HGCW012A.js
View file @
05a6d7dd
...
...
@@ -166,6 +166,7 @@ $(function () {
field
:
"projCode"
,
title
:
"项目编号"
,
headerTemplate
:
"<span style='color: '>项目编号 </span>"
,
width
:
140
,
enable
:
false
,
locked
:
false
},
...
...
@@ -173,6 +174,7 @@ $(function () {
field
:
"projName"
,
title
:
"项目名称"
,
headerTemplate
:
"<span style='color: '>项目名称 </span>"
,
width
:
200
,
enable
:
false
,
locked
:
false
},
...
...
@@ -250,11 +252,10 @@ $(function () {
locked
:
false
,
template
:
function
(
item
)
{
if
(
isBlank
(
item
.
thisSettlementAmount
)){
item
.
thisSettlementAmount
=
item
.
a
mount
;
resultGrid
.
setCellValue
(
item
,
"thisSettlementAmount"
,
item
.
a
mount
)
item
.
thisSettlementAmount
=
item
.
taxIncludeA
mount
;
resultGrid
.
setCellValue
(
item
,
"thisSettlementAmount"
,
item
.
taxIncludeA
mount
)
}
return
item
.
thisSettlementAmount
return
kendo
.
format
(
"{0:C3}"
,
parseFloat
(
item
.
thisSettlementAmount
));
}
}],
loadComplete
:
function
(
grid
)
{
...
...
src/main/webapp/HG/CW/HGCW012C.js
View file @
05a6d7dd
...
...
@@ -85,6 +85,7 @@ function saveFunc() {
}
});
}
function
deleteFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
...
...
src/main/webapp/HG/CW/HGCW012C.jsp
View file @
05a6d7dd
...
...
@@ -11,17 +11,17 @@
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"no"
isFloat=
"true"
autoBind=
"false"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"
12
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"
12
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"
20
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"
20
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFComboColumn
ename=
"partyA"
cname=
"供应商名称"
blockName=
"sup_record_block_id"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
textField=
"textField"
valueField=
"valueField"
maxLength=
"16"
readonly=
"false"
width=
"2
1
0"
required=
"true"
maxLength=
"16"
readonly=
"false"
width=
"2
0
0"
required=
"true"
align=
"center"
filter=
"contains"
sort=
"true"
>
</EF:EFComboColumn>
<
%
--
<
EF:EFColumn
ename=
"partyA"
cname=
"供应商名称"
width=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
--%>
<EF:EFColumn
ename=
"settlementNumber"
cname=
"来源单号"
width=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"totalContractPriceIncluding"
cname=
"收款总额"
width=
"120"
format=
"{0:
N
3}"
align=
"right"
enable=
"false"
readonly=
"true"
/>
<EF:EFColumn
ename=
"totalContractPriceIncluding"
cname=
"收款总额"
width=
"120"
format=
"{0:
C
3}"
align=
"right"
enable=
"false"
readonly=
"true"
/>
</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