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
ec1c4a50
Commit
ec1c4a50
authored
Aug 27, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-08-27 添加收票单和付款单
parent
be86a227
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
479 additions
and
127 deletions
+479
-127
BillStatusEnum.java
src/main/java/com/baosight/hpjx/common/BillStatusEnum.java
+61
-0
ServiceHPCW001.java
.../java/com/baosight/hpjx/hp/cw/service/ServiceHPCW001.java
+5
-5
ServiceHPCW002.java
.../java/com/baosight/hpjx/hp/cw/service/ServiceHPCW002.java
+5
-11
ServiceHPCW003.java
.../java/com/baosight/hpjx/hp/cw/service/ServiceHPCW003.java
+13
-15
ServiceHPCW003A.java
...java/com/baosight/hpjx/hp/cw/service/ServiceHPCW003A.java
+94
-1
ServiceHPCW004.java
.../java/com/baosight/hpjx/hp/cw/service/ServiceHPCW004.java
+18
-18
ServiceHPCW004A.java
...java/com/baosight/hpjx/hp/cw/service/ServiceHPCW004A.java
+95
-4
HPCW004.xml
src/main/java/com/baosight/hpjx/hp/cw/sql/HPCW004.xml
+1
-1
HPCWTools.java
src/main/java/com/baosight/hpjx/hp/cw/tools/HPCWTools.java
+74
-16
HPCW001.js
src/main/webapp/HP/CW/HPCW001.js
+15
-10
HPCW003.js
src/main/webapp/HP/CW/HPCW003.js
+24
-13
HPCW003.jsp
src/main/webapp/HP/CW/HPCW003.jsp
+5
-1
HPCW003A.js
src/main/webapp/HP/CW/HPCW003A.js
+13
-12
HPCW003A.jsp
src/main/webapp/HP/CW/HPCW003A.jsp
+2
-1
HPCW004.js
src/main/webapp/HP/CW/HPCW004.js
+42
-17
HPCW004.jsp
src/main/webapp/HP/CW/HPCW004.jsp
+5
-1
HPCW004A.js
src/main/webapp/HP/CW/HPCW004A.js
+5
-0
HPCW004A.jsp
src/main/webapp/HP/CW/HPCW004A.jsp
+2
-1
No files found.
src/main/java/com/baosight/hpjx/common/BillStatusEnum.java
0 → 100644
View file @
ec1c4a50
package
com
.
baosight
.
hpjx
.
common
;
/**
* @author LiuYang
* @version 1.0 2024/8/27
* @description 开票状态
*/
public
enum
BillStatusEnum
{
/**
* 0:未开票
*/
UNBILL
(
1
,
"未开票"
),
/**
* 1:已开票
*/
BILL
(
2
,
"已开票"
)
;
private
Integer
code
;
private
String
desc
;
BillStatusEnum
(
Integer
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
static
String
getDesc
(
Integer
code
)
{
for
(
BillStatusEnum
billStatusEnum
:
BillStatusEnum
.
values
())
{
if
(
billStatusEnum
.
getCode
().
equals
(
code
))
{
return
billStatusEnum
.
getDesc
();
}
}
return
null
;
}
public
static
Integer
getCode
(
String
desc
)
{
for
(
BillStatusEnum
billStatusEnum
:
BillStatusEnum
.
values
())
{
if
(
billStatusEnum
.
getDesc
().
equals
(
desc
))
{
return
billStatusEnum
.
getCode
();
}
}
return
null
;
}
}
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW001.java
View file @
ec1c4a50
...
@@ -2,11 +2,13 @@ package com.baosight.hpjx.hp.cw.service;
...
@@ -2,11 +2,13 @@ package com.baosight.hpjx.hp.cw.service;
import
com.baosight.eplat.utils.StringUtils
;
import
com.baosight.eplat.utils.StringUtils
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.common.BillStatusEnum
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.ReviewStatusEnum
;
import
com.baosight.hpjx.common.ReviewStatusEnum
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.cw.domain.HPCW001
;
import
com.baosight.hpjx.hp.cw.domain.HPCW001
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
@@ -131,12 +133,10 @@ public class ServiceHPCW001 extends ServiceEPBase {
...
@@ -131,12 +133,10 @@ public class ServiceHPCW001 extends ServiceEPBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPCW001
hpcw001
=
new
HPCW001
();
HPCW001
hpcw001
=
new
HPCW001
();
hpcw001
.
fromMap
(
resultRows
.
get
(
i
));
hpcw001
.
fromMap
(
resultRows
.
get
(
i
));
if
(
hpcw001
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()))
{
AssertUtils
.
isTrue
(
hpcw001
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()),
"该数据已审核,不能删除!"
);
throw
new
PlatException
(
"该数据已审核,不能删除!"
);
AssertUtils
.
isTrue
(
hpcw001
.
getBillState
().
equals
(
BillStatusEnum
.
BILL
.
getCode
()),
"该数据已开票,不能删除!"
);
}
DaoUtils
.
update
(
HPCW001
.
DELETE
,
hpcw001
);
DaoUtils
.
update
(
HPCW001
.
DELETE
,
hpcw001
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -176,7 +176,7 @@ public class ServiceHPCW001 extends ServiceEPBase {
...
@@ -176,7 +176,7 @@ public class ServiceHPCW001 extends ServiceEPBase {
for
(
Map
resultRow
:
resultRows
)
{
for
(
Map
resultRow
:
resultRows
)
{
HPCW001
hpcw001
=
new
HPCW001
();
HPCW001
hpcw001
=
new
HPCW001
();
hpcw001
.
fromMap
(
resultRow
);
hpcw001
.
fromMap
(
resultRow
);
hpcw001
.
setBillState
(
2
);
//1未开票2已开票
hpcw001
.
setBillState
(
BillStatusEnum
.
BILL
.
getCode
()
);
//1未开票2已开票
DaoUtils
.
update
(
HPCW001
.
BILLING
,
hpcw001
);
DaoUtils
.
update
(
HPCW001
.
BILLING
,
hpcw001
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW002.java
View file @
ec1c4a50
...
@@ -7,9 +7,7 @@ import com.baosight.hpjx.common.ReviewStatusEnum;
...
@@ -7,9 +7,7 @@ import com.baosight.hpjx.common.ReviewStatusEnum;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.cw.domain.HPCW002
;
import
com.baosight.hpjx.hp.cw.domain.HPCW002
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.*
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
...
@@ -125,18 +123,14 @@ public class ServiceHPCW002 extends ServiceEPBase {
...
@@ -125,18 +123,14 @@ public class ServiceHPCW002 extends ServiceEPBase {
@Override
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
HPCW002
>
hpcw002List
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPCW002
.
class
);
for
(
Map
resultRow
:
resultRows
)
{
for
(
HPCW002
hpcw002
:
hpcw002List
)
{
HPCW002
hpcw002
=
new
HPCW002
();
AssertUtils
.
isTrue
(
hpcw002
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()),
"该数据已审核,不能删除!"
);
hpcw002
.
fromMap
(
resultRow
);
if
(
hpcw002
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()))
{
throw
new
PlatException
(
"该数据已审核,不能删除!"
);
}
DaoUtils
.
update
(
HPCW002
.
DELETE
,
hpcw002
);
DaoUtils
.
update
(
HPCW002
.
DELETE
,
hpcw002
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hpcw002List
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
}
...
...
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW003.java
View file @
ec1c4a50
...
@@ -7,13 +7,11 @@ import com.baosight.hpjx.common.DdynamicEnum;
...
@@ -7,13 +7,11 @@ import com.baosight.hpjx.common.DdynamicEnum;
import
com.baosight.hpjx.common.ReviewStatusEnum
;
import
com.baosight.hpjx.common.ReviewStatusEnum
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.cw.domain.HPCW001
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003A
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003A
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.*
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
...
@@ -129,11 +127,11 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -129,11 +127,11 @@ public class ServiceHPCW003 extends ServiceEPBase {
@Override
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
(
);
List
<
HPCW003
>
hpcw003List
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPCW003
.
class
);
for
(
Map
resultRow
:
resultRows
)
{
for
(
HPCW003
hpcw003
:
hpcw003List
)
{
HPCW003
hpcw003
=
new
HPCW003
(
);
AssertUtils
.
isTrue
(
hpcw003
.
getCancelStatus
().
equals
(
CancelStatusEnum
.
CANCEL
.
getCode
()),
"付款单["
+
hpcw003
.
getIncomeNumber
()
+
"]已核销,不能删除!"
);
hpcw003
.
fromMap
(
resultRow
);
AssertUtils
.
isTrue
(
hpcw003
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()),
"付款单["
+
hpcw003
.
getIncomeNumber
()
+
"]已审核,不能删除!"
);
List
<
HPCW003A
>
hpcw003AList
=
HPCWTools
.
Hp
C
w003a
.
getMainId
(
hpcw003
.
getId
());
List
<
HPCW003A
>
hpcw003AList
=
HPCWTools
.
Hp
c
w003a
.
getMainId
(
hpcw003
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003AList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003AList
))
{
for
(
HPCW003A
hpcw003A
:
hpcw003AList
)
{
for
(
HPCW003A
hpcw003A
:
hpcw003AList
)
{
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
...
@@ -144,7 +142,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -144,7 +142,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
DaoUtils
.
update
(
HPCW003
.
DELETE
,
hpcw003
);
DaoUtils
.
update
(
HPCW003
.
DELETE
,
hpcw003
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hpcw003List
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
}
...
@@ -161,7 +159,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -161,7 +159,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
mainId
=
queryRows
.
get
(
0
).
get
(
"mainId"
).
toString
();
mainId
=
queryRows
.
get
(
0
).
get
(
"mainId"
).
toString
();
}
}
//获取相应的数据
//获取相应的数据
List
<
HPCW003A
>
hpcw003AList
=
HPCWTools
.
Hp
C
w003a
.
mapToList
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
List
<
HPCW003A
>
hpcw003AList
=
HPCWTools
.
Hp
c
w003a
.
mapToList
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003AList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003AList
))
{
if
(
StringUtils
.
isEmpty
(
mainId
))
{
if
(
StringUtils
.
isEmpty
(
mainId
))
{
...
@@ -202,7 +200,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -202,7 +200,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
DaoUtils
.
insert
(
HPCW003A
.
INSERT
,
hpcw003A
);
DaoUtils
.
insert
(
HPCW003A
.
INSERT
,
hpcw003A
);
}
}
}
else
{
}
else
{
HPCW003
hpcw003
=
HPCWTools
.
Hpcw003
.
getId
(
mainId
);
HPCW003
hpcw003
=
HPCWTools
.
Hpcw003
.
getId
(
NumberUtils
.
toLong
(
mainId
)
);
//Map<String, BigDecimal> rowMap = hpcw003AList.stream().collect(Collectors.toMap(HPCW003A::getContractNumber, HPCW003A::getTotalContractPriceIncluding));
//Map<String, BigDecimal> rowMap = hpcw003AList.stream().collect(Collectors.toMap(HPCW003A::getContractNumber, HPCW003A::getTotalContractPriceIncluding));
/*for (Map m : resultRows) {
/*for (Map m : resultRows) {
...
@@ -217,7 +215,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -217,7 +215,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
hpcw003A
.
getTotalContractPriceIncluding
());
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
hpcw003A
.
getTotalContractPriceIncluding
());
DaoUtils
.
insert
(
HPCW003A
.
INSERT
,
hpcw003A
);
DaoUtils
.
insert
(
HPCW003A
.
INSERT
,
hpcw003A
);
}
}
List
<
HPCW003A
>
hpcw003s
=
HPCWTools
.
Hp
C
w003a
.
getMainId
(
hpcw003
.
getId
());
List
<
HPCW003A
>
hpcw003s
=
HPCWTools
.
Hp
c
w003a
.
getMainId
(
hpcw003
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003s
))
{
if
(
CollectionUtils
.
isNotEmpty
(
hpcw003s
))
{
// 更新主表
// 更新主表
BigDecimal
totalContractPriceIncluding
=
hpcw003AList
.
stream
().
map
(
HPCW003A:
:
getTotalContractPriceIncluding
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
totalContractPriceIncluding
=
hpcw003AList
.
stream
().
map
(
HPCW003A:
:
getTotalContractPriceIncluding
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
...
@@ -256,7 +254,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -256,7 +254,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPCW003
hpcw003
=
new
HPCW003
();
HPCW003
hpcw003
=
new
HPCW003
();
hpcw003
.
fromMap
(
resultRows
.
get
(
i
));
hpcw003
.
fromMap
(
resultRows
.
get
(
i
));
hpcw003
.
setReviewStatus
(
1
);
hpcw003
.
setReviewStatus
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()
);
DaoUtils
.
update
(
HPCW003
.
SUBMIT
,
hpcw003
);
DaoUtils
.
update
(
HPCW003
.
SUBMIT
,
hpcw003
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
@@ -273,7 +271,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
...
@@ -273,7 +271,7 @@ public class ServiceHPCW003 extends ServiceEPBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPCW003
hpcw003
=
new
HPCW003
();
HPCW003
hpcw003
=
new
HPCW003
();
hpcw003
.
fromMap
(
resultRows
.
get
(
i
));
hpcw003
.
fromMap
(
resultRows
.
get
(
i
));
hpcw003
.
setCancelStatus
(
2
);
hpcw003
.
setCancelStatus
(
CancelStatusEnum
.
CANCEL
.
getCode
()
);
DaoUtils
.
update
(
"HPCW003.writeoff"
,
hpcw003
);
DaoUtils
.
update
(
"HPCW003.writeoff"
,
hpcw003
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW003A.java
View file @
ec1c4a50
...
@@ -2,15 +2,20 @@ package com.baosight.hpjx.hp.cw.service;
...
@@ -2,15 +2,20 @@ package com.baosight.hpjx.hp.cw.service;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.
hp.cw.domain.HPCW001
;
import
com.baosight.hpjx.
core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003A
;
import
com.baosight.hpjx.hp.cw.domain.HPCW003A
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author LiuYang
* @author LiuYang
...
@@ -56,4 +61,92 @@ public class ServiceHPCW003A extends ServiceEPBase {
...
@@ -56,4 +61,92 @@ public class ServiceHPCW003A extends ServiceEPBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"收款单"
,
operType
=
"保存"
,
operDesc
=
"保存"
)
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
List
<
HPCW003A
>
hpcw003AList
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPCW003A
.
class
);
// 写入数据
Long
parentId
=
null
;
for
(
HPCW003A
hpcw003A:
hpcw003AList
)
{
parentId
=
hpcw003A
.
getParentId
();
if
(
hpcw003A
.
getId
()
==
null
||
hpcw003A
.
getId
()
==
0
)
{
this
.
add
(
hpcw003A
);
}
else
{
// 回写数据
HPCW003A
oldHGCW015
=
HPCWTools
.
Hpcw003a
.
getId
(
hpcw003A
.
getId
());
//先加再扣
HPCWTools
.
Hpcw001
.
cutAmount
(
oldHGCW015
.
getContractNumber
(),
oldHGCW015
.
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(-
1
))
);
this
.
modify
(
hpcw003A
);
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
hpcw003A
.
getTotalContractPriceIncluding
());
}
}
// 更新主表
HPCWTools
.
Hpcw003
.
updateAmount
(
parentId
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hpcw003AList
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
return
inInfo
;
}
/**
* 新增操作
*
* @param hpcw003A
* @return
*/
public
void
add
(
HPCW003A
hpcw003A
)
{
DaoUtils
.
insert
(
HPCW003A
.
INSERT
,
hpcw003A
);
}
/**
* 修改操作
*
* @param hpcw003A
* @return
*/
public
void
modify
(
HPCW003A
hpcw003A
)
{
DaoUtils
.
update
(
HPCW003A
.
UPDATE
,
hpcw003A
);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"收款单"
,
operType
=
"删除"
,
operDesc
=
"删除"
)
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
HPCW003A
>
hpcw003AList
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPCW003A
.
class
);
Long
parentId
=
null
;
for
(
HPCW003A
hpcw003A:
hpcw003AList
)
{
parentId
=
hpcw003A
.
getParentId
();
DaoUtils
.
update
(
HPCW003A
.
DELETE
,
hpcw003A
);
HPCWTools
.
Hpcw001
.
cutAmount
(
hpcw003A
.
getContractNumber
(),
hpcw003A
.
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(-
1
))
);
}
// 更新主表
HPCWTools
.
Hpcw003
.
updateAmount
(
parentId
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hpcw003AList
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
}
}
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW004.java
View file @
ec1c4a50
...
@@ -11,9 +11,7 @@ import com.baosight.hpjx.hp.cw.domain.HPCW002;
...
@@ -11,9 +11,7 @@ import com.baosight.hpjx.hp.cw.domain.HPCW002;
import
com.baosight.hpjx.hp.cw.domain.HPCW004
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004A
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004A
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.*
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
...
@@ -129,11 +127,11 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -129,11 +127,11 @@ public class ServiceHPCW004 extends ServiceEPBase {
@Override
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
(
);
List
<
HPCW004
>
hpcw004List
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HPCW004
.
class
);
for
(
Map
resultRow
:
resultRows
)
{
for
(
HPCW004
hpcw004
:
hpcw004List
)
{
HPCW004
hgcw016
=
new
HPCW004
(
);
AssertUtils
.
isTrue
(
hpcw004
.
getCancelStatus
().
equals
(
CancelStatusEnum
.
CANCEL
.
getCode
()),
"付款单["
+
hpcw004
.
getIncomeNumber
()
+
"]已核销,不能删除!"
);
hgcw016
.
fromMap
(
resultRow
);
AssertUtils
.
isTrue
(
hpcw004
.
getReviewStatus
().
equals
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()),
"付款单["
+
hpcw004
.
getIncomeNumber
()
+
"]已审核,不能删除!"
);
List
<
HPCW004A
>
hpcw004AList
=
HPCWTools
.
Hpcw004a
.
getMainId
(
h
gcw016
.
getId
());
List
<
HPCW004A
>
hpcw004AList
=
HPCWTools
.
Hpcw004a
.
getMainId
(
h
pcw004
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hpcw004AList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
hpcw004AList
))
{
for
(
HPCW004A
hpcw004A
:
hpcw004AList
)
{
for
(
HPCW004A
hpcw004A
:
hpcw004AList
)
{
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
...
@@ -141,10 +139,10 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -141,10 +139,10 @@ public class ServiceHPCW004 extends ServiceEPBase {
DaoUtils
.
update
(
HPCW004A
.
DELETE
,
hpcw004A
);
DaoUtils
.
update
(
HPCW004A
.
DELETE
,
hpcw004A
);
}
}
}
}
DaoUtils
.
update
(
HPCW004
.
DELETE
,
h
gcw016
);
DaoUtils
.
update
(
HPCW004
.
DELETE
,
h
pcw004
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hpcw004List
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
}
...
@@ -194,7 +192,7 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -194,7 +192,7 @@ public class ServiceHPCW004 extends ServiceEPBase {
DaoUtils
.
insert
(
HPCW004A
.
INSERT
,
hpcw004A
);
DaoUtils
.
insert
(
HPCW004A
.
INSERT
,
hpcw004A
);
}
}
}
else
{
}
else
{
HPCW004
hpcw004
=
HPCWTools
.
Hpcw004
.
getId
(
mainId
);
HPCW004
hpcw004
=
HPCWTools
.
Hpcw004
.
getId
(
NumberUtils
.
toLong
(
mainId
)
);
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
/*for (Map m : resultRows) {
/*for (Map m : resultRows) {
...
@@ -208,7 +206,6 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -208,7 +206,6 @@ public class ServiceHPCW004 extends ServiceEPBase {
// 反写金额
// 反写金额
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
hpcw004A
.
getTotalContractPriceIncluding
());
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
hpcw004A
.
getTotalContractPriceIncluding
());
DaoUtils
.
insert
(
HPCW004A
.
INSERT
,
hpcw004A
);
DaoUtils
.
insert
(
HPCW004A
.
INSERT
,
hpcw004A
);
//this.addHGCW017(hgcw017);
}
}
List
<
HPCW004A
>
hpcw004AS
=
HPCWTools
.
Hpcw004a
.
getMainId
(
hpcw004
.
getId
());
List
<
HPCW004A
>
hpcw004AS
=
HPCWTools
.
Hpcw004a
.
getMainId
(
hpcw004
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hpcw004AS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
hpcw004AS
))
{
...
@@ -247,7 +244,7 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -247,7 +244,7 @@ public class ServiceHPCW004 extends ServiceEPBase {
for
(
Map
resultRow
:
resultRows
)
{
for
(
Map
resultRow
:
resultRows
)
{
HPCW004
hpcw004
=
new
HPCW004
();
HPCW004
hpcw004
=
new
HPCW004
();
hpcw004
.
fromMap
(
resultRow
);
hpcw004
.
fromMap
(
resultRow
);
hpcw004
.
setReviewStatus
(
1
);
hpcw004
.
setReviewStatus
(
ReviewStatusEnum
.
REVIEWED
.
getCode
()
);
DaoUtils
.
update
(
HPCW004
.
SUBMIT
,
hpcw004
);
DaoUtils
.
update
(
HPCW004
.
SUBMIT
,
hpcw004
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
@@ -258,21 +255,24 @@ public class ServiceHPCW004 extends ServiceEPBase {
...
@@ -258,21 +255,24 @@ public class ServiceHPCW004 extends ServiceEPBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 核销操作
* @param inInfo
* @return
*/
public
EiInfo
writeoff
(
EiInfo
inInfo
){
public
EiInfo
writeoff
(
EiInfo
inInfo
){
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
Map
resultRow
:
resultRows
)
{
for
(
Map
resultRow
:
resultRows
)
{
HPCW004
hpcw004
=
new
HPCW004
();
HPCW004
hpcw004
=
new
HPCW004
();
hpcw004
.
fromMap
(
resultRow
);
hpcw004
.
fromMap
(
resultRow
);
hpcw004
.
setCancelStatus
(
2
);
hpcw004
.
setCancelStatus
(
CancelStatusEnum
.
CANCEL
.
getCode
());
if
(
hpcw004
.
getReviewStatus
()
==
0
)
{
AssertUtils
.
isTrue
(
hpcw004
.
getCancelStatus
()
==
0
,
"请先审批!"
);
throw
new
PlatException
(
"请先审核!"
);
}
DaoUtils
.
update
(
"HPCW004.writeoff"
,
hpcw004
);
DaoUtils
.
update
(
"HPCW004.writeoff"
,
hpcw004
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据核销成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据核销成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Plat
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
return
inInfo
;
return
inInfo
;
...
...
src/main/java/com/baosight/hpjx/hp/cw/service/ServiceHPCW004A.java
View file @
ec1c4a50
...
@@ -2,18 +2,20 @@ package com.baosight.hpjx.hp.cw.service;
...
@@ -2,18 +2,20 @@ package com.baosight.hpjx.hp.cw.service;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.common.ReviewStatusEnum
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.cw.domain.HPCW002
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004A
;
import
com.baosight.hpjx.hp.cw.domain.HPCW004A
;
import
com.baosight.hpjx.hp.cw.tools.HPCWTools
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.
contants.ACConstant
s
;
import
com.baosight.hpjx.util.
MapUtil
s
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author LiuYang
* @author LiuYang
...
@@ -58,4 +60,93 @@ public class ServiceHPCW004A extends ServiceEPBase {
...
@@ -58,4 +60,93 @@ public class ServiceHPCW004A extends ServiceEPBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"付款单"
,
operType
=
"保存"
,
operDesc
=
"保存"
)
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 写入数据
Long
parentId
=
null
;
for
(
Map
resultRow
:
resultRows
)
{
HPCW004A
hpcw004A
=
new
HPCW004A
();
hpcw004A
.
fromMap
(
resultRow
);
parentId
=
hpcw004A
.
getParentId
();
if
(
hpcw004A
.
getId
()
==
null
||
hpcw004A
.
getId
()
==
0
)
{
this
.
add
(
hpcw004A
);
}
else
{
// 回写数据
HPCW004A
oldHgcw017
=
HPCWTools
.
Hpcw004a
.
getId
(
hpcw004A
.
getId
());
//先加再扣
HPCWTools
.
Hpcw002
.
cutAmount
(
oldHgcw017
.
getContractNumber
(),
oldHgcw017
.
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(-
1
)));
this
.
modify
(
hpcw004A
);
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
hpcw004A
.
getTotalContractPriceIncluding
());
}
}
// 更新主表
HPCWTools
.
Hpcw004
.
updateAmount
(
parentId
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
return
inInfo
;
}
/**
* 新增操作
*
* @param hgcw017
* @return
*/
public
void
add
(
HPCW004A
hgcw017
)
{
DaoUtils
.
insert
(
HPCW004A
.
INSERT
,
hgcw017
);
}
/**
* 修改操作
*
* @param hgcw017
* @return
*/
public
void
modify
(
HPCW004A
hgcw017
)
{
DaoUtils
.
update
(
HPCW004A
.
UPDATE
,
hgcw017
);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation
(
operModul
=
"付款单"
,
operType
=
"删除"
,
operDesc
=
"删除"
)
@Override
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
HPCW004A
>
hpcw004As
=
MapUtils
.
toDaoEPBases
(
resultRows
,
HPCW004A
.
class
);
Long
parentId
=
null
;
for
(
HPCW004A
hpcw004A:
hpcw004As
)
{
parentId
=
hpcw004A
.
getParentId
();
DaoUtils
.
update
(
HPCW004A
.
UPDATE
,
hpcw004A
);
HPCWTools
.
Hpcw002
.
cutAmount
(
hpcw004A
.
getContractNumber
(),
hpcw004A
.
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(-
1
))
);
}
// 更新主表
HPCWTools
.
Hpcw004
.
updateAmount
(
parentId
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
}
}
src/main/java/com/baosight/hpjx/hp/cw/sql/HPCW004.xml
View file @
ec1c4a50
...
@@ -211,7 +211,7 @@
...
@@ -211,7 +211,7 @@
)
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #factoryCode#, #factoryName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #factoryCode#, #factoryName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#)
<selectKey
resultClass=
"long"
keyProperty=
"id"
>
<selectKey
resultClass=
"long"
keyProperty=
"id"
>
SELECT MAX(ID) AS "id" FROM ${hpjxSchema}.T_HPCW00
3
SELECT MAX(ID) AS "id" FROM ${hpjxSchema}.T_HPCW00
4
</selectKey>
</selectKey>
</insert>
</insert>
...
...
src/main/java/com/baosight/hpjx/hp/cw/tools/HPCWTools.java
View file @
ec1c4a50
...
@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
...
@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.cw.domain.*
;
import
com.baosight.hpjx.hp.cw.domain.*
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.iplat4j.core.ProjectInfo
;
import
com.baosight.iplat4j.core.ProjectInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -33,18 +34,23 @@ public class HPCWTools {
...
@@ -33,18 +34,23 @@ public class HPCWTools {
public
static
HPCW001
getId
(
String
id
)
{
public
static
HPCW001
getId
(
String
id
)
{
AssertUtils
.
isNull
(
id
,
"销售开票单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"销售开票单ID不能为空!"
);
List
<
HPCW001
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW001
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW001
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW001
.
QUERY
,
new
HashMap
<
String
,
Object
>()
{
{
put
(
"id"
,
id
);}
{
put
(
"id"
,
id
);
}
});
});
return
results
.
get
(
0
);
return
results
.
get
(
0
);
}
}
public
static
void
cutAmount
(
String
billNumber
,
BigDecimal
cutAmount
)
{
public
static
void
cutAmount
(
String
billNumber
,
BigDecimal
cutAmount
)
{
AssertUtils
.
isNull
(
billNumber
,
"
来源单
号不能为空!"
);
AssertUtils
.
isNull
(
billNumber
,
"
发票
号不能为空!"
);
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// throw new PlatException("扣款金额不能小于等于0!");
// }
// }
List
<
HPCW001
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW001
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW001
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW001
.
QUERY
,
new
HashMap
<
String
,
Object
>()
{
{
put
(
HPCW001
.
FIELD_BILL_NUMBER
,
billNumber
);}
{
put
(
HPCW001
.
FIELD_BILL_NUMBER
,
billNumber
);
}
});
});
if
(
CollectionUtils
.
isEmpty
(
results
))
{
if
(
CollectionUtils
.
isEmpty
(
results
))
{
throw
new
PlatException
(
"找不到对应的销售开票记录!"
);
throw
new
PlatException
(
"找不到对应的销售开票记录!"
);
...
@@ -64,8 +70,10 @@ public class HPCWTools {
...
@@ -64,8 +70,10 @@ public class HPCWTools {
public
static
class
Hpcw002
{
public
static
class
Hpcw002
{
public
static
HPCW002
getId
(
String
id
)
{
public
static
HPCW002
getId
(
String
id
)
{
AssertUtils
.
isNull
(
id
,
"采购收票单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"采购收票单ID不能为空!"
);
List
<
HPCW002
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW002
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW002
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW002
.
QUERY
,
new
HashMap
<
String
,
Object
>()
{
{
put
(
"id"
,
id
);}
{
put
(
"id"
,
id
);
}
});
});
return
results
.
get
(
0
);
return
results
.
get
(
0
);
}
}
...
@@ -75,8 +83,10 @@ public class HPCWTools {
...
@@ -75,8 +83,10 @@ public class HPCWTools {
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// throw new PlatException("扣款金额不能小于等于0!");
// }
// }
List
<
HPCW002
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW002
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW002
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW002
.
QUERY
,
new
HashMap
<
String
,
Object
>()
{
{
put
(
HPCW002
.
FIELD_BILL_NUMBER
,
billNumber
);}
{
put
(
HPCW002
.
FIELD_BILL_NUMBER
,
billNumber
);
}
});
});
if
(
CollectionUtils
.
isEmpty
(
results
))
{
if
(
CollectionUtils
.
isEmpty
(
results
))
{
throw
new
PlatException
(
"找不到对应的采购收票记录!"
);
throw
new
PlatException
(
"找不到对应的采购收票记录!"
);
...
@@ -91,6 +101,7 @@ public class HPCWTools {
...
@@ -91,6 +101,7 @@ public class HPCWTools {
DaoUtils
.
update
(
"HPCW002.updateDeductionAmount"
,
hpcw002
);
DaoUtils
.
update
(
"HPCW002.updateDeductionAmount"
,
hpcw002
);
}
}
public
static
List
<
HPCW002
>
checkList
(
Map
paramMap
)
{
public
static
List
<
HPCW002
>
checkList
(
Map
paramMap
)
{
AssertUtils
.
isEmpty
(
paramMap
,
"数据检查参数不能为空"
);
AssertUtils
.
isEmpty
(
paramMap
,
"数据检查参数不能为空"
);
return
DaoBase
.
getInstance
().
query
(
"HGCW012.queryCheckList"
,
paramMap
);
return
DaoBase
.
getInstance
().
query
(
"HGCW012.queryCheckList"
,
paramMap
);
...
@@ -98,13 +109,14 @@ public class HPCWTools {
...
@@ -98,13 +109,14 @@ public class HPCWTools {
/**
/**
* 根据收货号查询
* 根据收货号查询
*
* @param receiveNo 收货单号
* @param receiveNo 收货单号
* @return Map
* @return Map
*/
*/
public
static
Map
getReceiveNo
(
String
receiveNo
){
public
static
Map
getReceiveNo
(
String
receiveNo
)
{
AssertUtils
.
isEmpty
(
receiveNo
,
"发票号不能为空"
);
AssertUtils
.
isEmpty
(
receiveNo
,
"发票号不能为空"
);
Map
queryMap
=
new
HashMap
<>();
Map
queryMap
=
new
HashMap
<>();
queryMap
.
put
(
HPCW002
.
FIELD_SETTLEMENT_NUMBER
,
receiveNo
);
queryMap
.
put
(
HPCW002
.
FIELD_SETTLEMENT_NUMBER
,
receiveNo
);
List
<
Map
>
list
=
DaoBase
.
getInstance
().
query
(
"HPCW002.queryInvoicing"
,
queryMap
);
List
<
Map
>
list
=
DaoBase
.
getInstance
().
query
(
"HPCW002.queryInvoicing"
,
queryMap
);
return
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
;
return
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
;
}
}
...
@@ -112,16 +124,41 @@ public class HPCWTools {
...
@@ -112,16 +124,41 @@ public class HPCWTools {
public
static
class
Hpcw003
{
public
static
class
Hpcw003
{
public
static
HPCW003
getId
(
Stri
ng
id
)
{
public
static
HPCW003
getId
(
Lo
ng
id
)
{
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
List
<
HPCW003
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW003
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW003
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW003
.
QUERY
,
new
HashMap
<
String
,
Object
>()
{
{
put
(
"id"
,
id
);}
{
put
(
"id"
,
id
);
}
});
});
return
results
.
get
(
0
);
return
results
.
get
(
0
);
}
}
public
static
void
updateAmount
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
HPCW003
hpcw003
=
getId
(
id
);
List
<
HPCW003A
>
hgcw015s
=
Hpcw003a
.
getMainId
(
hpcw003
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hgcw015s
))
{
// 更新主表
BigDecimal
totalContractPriceIncluding
=
BigDecimal
.
ZERO
;
StringBuffer
contractNumber
=
new
StringBuffer
();
for
(
HPCW003A
hgcw015
:
hgcw015s
)
{
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
hgcw015
.
getTotalContractPriceIncluding
());
contractNumber
.
append
(
hgcw015
.
getContractNumber
()).
append
(
","
);
}
hpcw003
.
setTotalContractPriceIncluding
(
totalContractPriceIncluding
);
hpcw003
.
setPartyA
(
hgcw015s
.
get
(
0
).
getPartyA
());
hpcw003
.
setProjCode
(
hgcw015s
.
get
(
0
).
getProjCode
());
hpcw003
.
setProjName
(
hgcw015s
.
get
(
0
).
getProjName
());
hpcw003
.
setContractNumber
(
contractNumber
.
toString
().
substring
(
0
,
contractNumber
.
length
()
-
1
));
DaoUtils
.
update
(
HPCW003
.
UPDATE
,
hpcw003
);
}
}
}
}
public
static
class
Hp
C
w003a
{
public
static
class
Hp
c
w003a
{
public
static
HPCW003A
getId
(
Long
id
)
{
public
static
HPCW003A
getId
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
List
<
HPCW003A
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW003A
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW003A
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW003A
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
@@ -137,6 +174,7 @@ public class HPCWTools {
...
@@ -137,6 +174,7 @@ public class HPCWTools {
HPCW003A
hpcw003A
=
new
HPCW003A
();
HPCW003A
hpcw003A
=
new
HPCW003A
();
hpcw003A
.
fromMap
(
row
);
hpcw003A
.
fromMap
(
row
);
hpcw003A
.
setId
(
null
);
hpcw003A
.
setId
(
null
);
hpcw003A
.
setCompanyCode
(
null
);
hpcw003A
.
setDepCode
(
null
);
hpcw003A
.
setDepCode
(
null
);
hpcw003A
.
setCreatedBy
(
null
);
hpcw003A
.
setCreatedBy
(
null
);
hpcw003A
.
setCreatedName
(
null
);
hpcw003A
.
setCreatedName
(
null
);
...
@@ -167,13 +205,32 @@ public class HPCWTools {
...
@@ -167,13 +205,32 @@ public class HPCWTools {
}
}
public
static
class
Hpcw004
{
public
static
class
Hpcw004
{
public
static
HPCW004
getId
(
Stri
ng
id
)
{
public
static
HPCW004
getId
(
Lo
ng
id
)
{
AssertUtils
.
isNull
(
id
,
"付款单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"付款单ID不能为空!"
);
List
<
HPCW004
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW004
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HPCW004
>
results
=
DaoBase
.
getInstance
().
query
(
HPCW004
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"id"
,
id
);}
{
put
(
"id"
,
id
);}
});
});
return
results
.
get
(
0
);
return
results
.
get
(
0
);
}
}
public
static
void
updateAmount
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"收款单ID不能为空!"
);
HPCW004
hpcw004
=
getId
(
id
);
List
<
HPCW004A
>
hpcw004AS
=
HPCWTools
.
Hpcw004a
.
getMainId
(
hpcw004
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
hpcw004AS
))
{
// 更新主表
BigDecimal
totalContractPriceIncluding
=
BigDecimal
.
ZERO
;
StringBuffer
contractNumber
=
new
StringBuffer
();
for
(
HPCW004A
hgcw017
:
hpcw004AS
)
{
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
hgcw017
.
getTotalContractPriceIncluding
());
contractNumber
.
append
(
hgcw017
.
getContractNumber
()).
append
(
","
);
}
hpcw004
.
setTotalContractPriceIncluding
(
totalContractPriceIncluding
);
hpcw004
.
setPartyA
(
hpcw004AS
.
get
(
0
).
getPartyA
());
hpcw004
.
setContractNumber
(
contractNumber
.
toString
().
substring
(
0
,
contractNumber
.
length
()
-
1
));
DaoUtils
.
update
(
HPCW004
.
UPDATE
,
hpcw004
);
}
}
}
}
public
static
class
Hpcw004a
{
public
static
class
Hpcw004a
{
...
@@ -192,6 +249,7 @@ public class HPCWTools {
...
@@ -192,6 +249,7 @@ public class HPCWTools {
HPCW004A
hpcw004A
=
new
HPCW004A
();
HPCW004A
hpcw004A
=
new
HPCW004A
();
hpcw004A
.
fromMap
(
row
);
hpcw004A
.
fromMap
(
row
);
hpcw004A
.
setId
(
null
);
hpcw004A
.
setId
(
null
);
hpcw004A
.
setCompanyCode
(
null
);
hpcw004A
.
setDepCode
(
null
);
hpcw004A
.
setDepCode
(
null
);
hpcw004A
.
setCreatedBy
(
null
);
hpcw004A
.
setCreatedBy
(
null
);
hpcw004A
.
setCreatedName
(
null
);
hpcw004A
.
setCreatedName
(
null
);
...
...
src/main/webapp/HP/CW/HPCW001.js
View file @
ec1c4a50
...
@@ -185,7 +185,7 @@ function saveFunc(btn) {
...
@@ -185,7 +185,7 @@ function saveFunc(btn) {
JSUtils
.
submitGridsData
(
"result"
,
"HPCW001"
,
"save"
,
true
,
JSUtils
.
submitGridsData
(
"result"
,
"HPCW001"
,
"save"
,
true
,
function
(
e
)
{
function
(
e
)
{
//detailGrid.setEiInfo(e);
//detailGrid.setEiInfo(e);
//
query();
query
();
});
});
//释放禁用按钮
//释放禁用按钮
btn
.
attr
(
"disabled"
,
false
);
btn
.
attr
(
"disabled"
,
false
);
...
@@ -211,6 +211,9 @@ function fileDetailFunc(id) {
...
@@ -211,6 +211,9 @@ function fileDetailFunc(id) {
});
});
}
}
/**
* 审核
*/
function
submitFunc
()
{
function
submitFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
!=
1
)
{
if
(
rows
.
length
!=
1
)
{
...
@@ -245,6 +248,9 @@ function submitFunc() {
...
@@ -245,6 +248,9 @@ function submitFunc() {
}
}
}
}
/**
* 开票
*/
function
billFunc
()
{
function
billFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
!=
1
)
{
if
(
rows
.
length
!=
1
)
{
...
@@ -253,16 +259,15 @@ function billFunc() {
...
@@ -253,16 +259,15 @@ function billFunc() {
}
}
var
flag
=
true
;
var
flag
=
true
;
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
billState
==
"2"
)
{
if
(
row
.
billState
==
"2"
)
{
message
(
"勾选的数据中有已经开票的票据!"
);
message
(
"勾选的数据中有已经开票的票据!"
);
flag
=
false
;
flag
=
false
;
}
if
(
row
.
billNumber
==
" "
)
{
message
(
"勾选的数据中发票号为空"
);
flag
=
false
;
}
}
}
)
if
(
isBlank
(
row
.
billNumber
))
{
message
(
"勾选的数据中发票号为空"
);
flag
=
false
;
}
})
if
(
flag
)
{
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
开票
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
开票
\"
操作? "
,
{
...
...
src/main/webapp/HP/CW/HPCW003.js
View file @
ec1c4a50
...
@@ -112,11 +112,15 @@ function updateFunc() {
...
@@ -112,11 +112,15 @@ function updateFunc() {
message
(
"已经核销的单据不能修改"
);
message
(
"已经核销的单据不能修改"
);
return
;
return
;
}
}
if
(
rows
[
0
].
reviewStatus
==
"1"
)
{
message
(
"已经审批的单据不能修改"
);
return
;
}
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HPCW00
1B?methodName=initLoad&inqu_status-0-main
Id="
+
rows
[
0
].
id
+
"&efParentFormEname=HPCW003"
,
href
:
"HPCW00
3A?methodName=initLoad&inqu_status-0-operType=update&inqu_status-0-parent
Id="
+
rows
[
0
].
id
+
"&efParentFormEname=HPCW003"
,
title
:
"<div style='text-align: center;'>收款清单</div>"
,
title
:
"<div style='text-align: center;'>收款清单</div>"
,
width
:
"
9
0%"
,
width
:
"
8
0%"
,
height
:
"
9
0%"
,
height
:
"
8
0%"
,
callbackName
:
windowCallback
callbackName
:
windowCallback
});
});
}
}
...
@@ -132,13 +136,14 @@ function saveResult1Func() {
...
@@ -132,13 +136,14 @@ function saveResult1Func() {
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"save"
,
true
,
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"save"
,
true
,
function
(
e
)
{
function
(
e
)
{
//detailGrid.setEiInfo(e);
//detailGrid.setEiInfo(e);
//
query();
query
();
});
});
}
}
});
});
}
}
function
windowCallback
()
{
function
windowCallback
()
{
// 刷新列表
// 刷新列表
resultGrid
.
dataSource
.
page
(
1
);
resultGrid
.
dataSource
.
page
(
1
);
...
@@ -154,13 +159,13 @@ function submitFunc() {
...
@@ -154,13 +159,13 @@ function submitFunc() {
}
}
var
flag
=
true
;
var
flag
=
true
;
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
cancelStatus
==
"
1
"
)
{
if
(
row
.
cancelStatus
==
"
0
"
)
{
message
(
"勾选的数据中有未核销的单据!"
);
message
(
"勾选的数据中有未核销的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
}
}
if
(
row
.
reviewStatus
==
"
3
"
)
{
if
(
row
.
reviewStatus
==
"
1
"
)
{
message
(
"勾选的数据中有已经
提交
的单据!"
);
message
(
"勾选的数据中有已经
审批
的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
}
}
...
@@ -172,7 +177,7 @@ function submitFunc() {
...
@@ -172,7 +177,7 @@ function submitFunc() {
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"submit"
,
true
,
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"submit"
,
true
,
function
(
e
)
{
function
(
e
)
{
//detailGrid.setEiInfo(e);
//detailGrid.setEiInfo(e);
//
query();
query
();
});
});
}
}
});
});
...
@@ -188,7 +193,7 @@ function writeoffFunc() {
...
@@ -188,7 +193,7 @@ function writeoffFunc() {
}
}
var
flag
=
true
;
var
flag
=
true
;
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
cancelStatus
==
"1"
)
{
if
(
row
.
get
(
"cancelStatus"
)
==
"1"
)
{
message
(
"勾选的数据中有已经核销的单据!"
);
message
(
"勾选的数据中有已经核销的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
...
@@ -201,7 +206,7 @@ function writeoffFunc() {
...
@@ -201,7 +206,7 @@ function writeoffFunc() {
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"writeoff"
,
true
,
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003"
,
"writeoff"
,
true
,
function
(
e
)
{
function
(
e
)
{
//detailGrid.setEiInfo(e);
//detailGrid.setEiInfo(e);
//
query();
query
();
});
});
/*var info = new EiInfo();
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("result"));
...
@@ -242,8 +247,14 @@ function deleteFunc() {
...
@@ -242,8 +247,14 @@ function deleteFunc() {
let
flag
=
true
;
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
cancelStatus
=
item
.
get
(
"cancelStatus"
);
let
cancelStatus
=
item
.
get
(
"cancelStatus"
);
if
(
cancelStatus
===
"2"
){
let
reviewStatus
=
item
.
get
(
"reviewStatus"
);
message
(
"选中的第"
+
(
index
+
1
)
+
"行记录为核销状态,不能删除!"
);
if
(
cancelStatus
==
"1"
){
message
(
"选中的第"
+
(
index
+
1
)
+
"行记录为已核销,不能删除!"
);
flag
=
false
;
return
;
}
if
(
reviewStatus
==
"1"
)
{
message
(
"选中的第"
+
(
index
+
1
)
+
"行记录为已审批,不能删除!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
}
}
...
@@ -259,7 +270,7 @@ function deleteFunc() {
...
@@ -259,7 +270,7 @@ function deleteFunc() {
function
contractDetailFunc
(
id
)
{
function
contractDetailFunc
(
id
)
{
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HPCW003A?methodName=initLoad&inqu_status-0-parentId="
+
id
+
"&efParentFormEname=HPCW003"
,
href
:
"HPCW003A?methodName=initLoad&inqu_status-0-
operType=query&inqu_status-0-
parentId="
+
id
+
"&efParentFormEname=HPCW003"
,
title
:
"<div style='text-align: center;'>收款详情</div>"
,
title
:
"<div style='text-align: center;'>收款详情</div>"
,
width
:
"80%"
,
width
:
"80%"
,
height
:
"80%"
,
height
:
"80%"
,
...
...
src/main/webapp/HP/CW/HPCW003.jsp
View file @
ec1c4a50
...
@@ -33,6 +33,10 @@
...
@@ -33,6 +33,10 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition="ITEM_CODE IN ('1', '0')"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
</EF:EFRegion>
...
@@ -70,7 +74,7 @@
...
@@ -70,7 +74,7 @@
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" readonly="true"
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"
condition="ITEM_CODE IN ('1', '0')"
/>
</EF:EFComboColumn>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFRegion>
...
...
src/main/webapp/HP/CW/HPCW003A.js
View file @
ec1c4a50
...
@@ -9,6 +9,11 @@ $(function() {
...
@@ -9,6 +9,11 @@ $(function() {
pageSize
:
20
,
pageSize
:
20
,
pageSizes
:
[
10
,
20
,
30
,
50
,
100
,
200
],
pageSizes
:
[
10
,
20
,
30
,
50
,
100
,
200
],
},
},
loadComplete
:
function
(
grid
)
{
if
(
$
(
"#inqu_status-0-operType"
).
val
()
===
"query"
){
$
(
"#save-changes"
).
hide
();
}
},
onSave
:
function
(
e
)
{
onSave
:
function
(
e
)
{
// 阻止默认请求,使用自定义保存
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -20,16 +25,7 @@ $(function() {
...
@@ -20,16 +25,7 @@ $(function() {
deleteFunc
();
deleteFunc
();
}
}
}
}
downKeyUp
();
window
.
document
.
addEventListener
(
"keyup"
,
function
(
event
)
{
if
(
event
.
keyCode
===
13
){
var
grid
=
$
(
"#ef_grid_result"
).
data
(
"kendoGrid"
);
// 回填
//grid.addRows(returnRows);
grid
.
closeCell
();
}
})
});
});
$
(
window
).
load
(
function
()
{
$
(
window
).
load
(
function
()
{
...
@@ -56,7 +52,12 @@ function saveFunc() {
...
@@ -56,7 +52,12 @@ function saveFunc() {
}
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
ok
:
function
()
{
var
info
=
new
EiInfo
();
JSUtils
.
submitGridsData
(
"result"
,
"HPCW003A"
,
"save"
,
true
,
function
(
e
)
{
//detailGrid.setEiInfo(e);
query
();
});
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW003A", "save", info, {
EiCommunicator.send("HPCW003A", "save", info, {
onSuccess: function (ei) {
onSuccess: function (ei) {
...
@@ -79,7 +80,7 @@ function saveFunc() {
...
@@ -79,7 +80,7 @@ function saveFunc() {
// 发生异常
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
});
});
*/
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
}
...
...
src/main/webapp/HP/CW/HPCW003A.jsp
View file @
ec1c4a50
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="收款清单">
<EF:EFPage title="收款清单">
<EF:EFInput cname="隐藏条件" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="隐藏条件" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="operType" cname="隐藏条件" type="hidden"/>
<EF:EFRegion id="result" title="记录集">
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
...
...
src/main/webapp/HP/CW/HPCW004.js
View file @
ec1c4a50
...
@@ -84,7 +84,7 @@ let query = function () {
...
@@ -84,7 +84,7 @@ let query = function () {
}
}
/**
/**
*
结算单
选择
*
采购发票
选择
*/
*/
function
choiceFunc
()
{
function
choiceFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
let
rows
=
resultGrid
.
getCheckedRows
();
...
@@ -119,15 +119,19 @@ function updateFunc() {
...
@@ -119,15 +119,19 @@ function updateFunc() {
message
(
"请选择一条数据"
);
message
(
"请选择一条数据"
);
return
;
return
;
}
}
if
(
rows
[
0
].
cancelStatus
==
"
2
"
)
{
if
(
rows
[
0
].
cancelStatus
==
"
1
"
)
{
message
(
"已经核销的单据不能修改"
);
message
(
"已经核销的单据不能修改"
);
return
;
return
;
}
}
if
(
rows
[
0
].
reviewStatus
==
"1"
)
{
message
(
"已经审批的单据不能修改"
);
return
;
}
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HPCW00
2B?methodName=initLoad&inqu_status-0-mainId="
+
rows
[
0
].
id
+
"&efParentFormEname=HPCW002
"
,
href
:
"HPCW00
4A?methodName=initLoad&inqu_status-0-operType=update&inqu_status-0-parentId="
+
rows
[
0
].
id
+
"&efParentFormEname=HPCW004
"
,
title
:
"<div style='text-align: center;'>付款清单</div>"
,
title
:
"<div style='text-align: center;'>付款清单</div>"
,
width
:
"
9
0%"
,
width
:
"
7
0%"
,
height
:
"
9
0%"
,
height
:
"
7
0%"
,
callbackName
:
windowCallback
callbackName
:
windowCallback
});
});
}
}
...
@@ -140,7 +144,12 @@ function saveResult1Func() {
...
@@ -140,7 +144,12 @@ function saveResult1Func() {
}
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
ok
:
function
()
{
var
info
=
new
EiInfo
();
JSUtils
.
submitGridsData
(
"result"
,
"HPCW004"
,
"save"
,
true
,
function
(
e
)
{
//detailGrid.setEiInfo(e);
//query();
});
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW004", "save", info, {
EiCommunicator.send("HPCW004", "save", info, {
onSuccess: function (ei) {
onSuccess: function (ei) {
...
@@ -163,12 +172,13 @@ function saveResult1Func() {
...
@@ -163,12 +172,13 @@ function saveResult1Func() {
// 发生异常
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
});
});
*/
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
}
});
});
}
}
function
windowCallback
()
{
function
windowCallback
()
{
// 刷新列表
// 刷新列表
resultGrid
.
dataSource
.
page
(
1
);
resultGrid
.
dataSource
.
page
(
1
);
...
@@ -176,6 +186,9 @@ function windowCallback() {
...
@@ -176,6 +186,9 @@ function windowCallback() {
JSColorbox
.
close
();
JSColorbox
.
close
();
}
}
/**
* 审批
*/
function
submitFunc
()
{
function
submitFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
if
(
rows
.
length
<
1
)
{
...
@@ -184,13 +197,13 @@ function submitFunc() {
...
@@ -184,13 +197,13 @@ function submitFunc() {
}
}
var
flag
=
true
;
var
flag
=
true
;
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
/* if (row.cancelStatus == "1
") {
if
(
row
.
cancelStatus
==
"0
"
)
{
message
(
"勾选的数据中有未核销的单据!"
);
message
(
"勾选的数据中有未核销的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
}
*/
}
if
(
row
.
reviewStatus
==
"1"
)
{
if
(
row
.
reviewStatus
==
"1"
)
{
message
(
"勾选的数据中有已经
提交
的单据!"
);
message
(
"勾选的数据中有已经
审核
的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
}
}
...
@@ -199,7 +212,12 @@ function submitFunc() {
...
@@ -199,7 +212,12 @@ function submitFunc() {
if
(
flag
)
{
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
提交
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
提交
\"
操作? "
,
{
ok
:
function
()
{
ok
:
function
()
{
var
info
=
new
EiInfo
();
JSUtils
.
submitGridsData
(
"result"
,
"HPCW004"
,
"submit"
,
true
,
function
(
e
)
{
//detailGrid.setEiInfo(e);
query
();
});
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW004", "submit", info, {
EiCommunicator.send("HPCW004", "submit", info, {
onSuccess: function (ei) {
onSuccess: function (ei) {
...
@@ -222,13 +240,15 @@ function submitFunc() {
...
@@ -222,13 +240,15 @@ function submitFunc() {
// 发生异常
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
});
});
*/
}
}
});
});
}
}
}
}
/**
* 核销
*/
function
writeoffFunc
()
{
function
writeoffFunc
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
if
(
rows
.
length
<
1
)
{
...
@@ -237,7 +257,7 @@ function writeoffFunc() {
...
@@ -237,7 +257,7 @@ function writeoffFunc() {
}
}
var
flag
=
true
;
var
flag
=
true
;
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
cancelStatus
==
"
2
"
)
{
if
(
row
.
cancelStatus
==
"
1
"
)
{
message
(
"勾选的数据中有已经核销的单据!"
);
message
(
"勾选的数据中有已经核销的单据!"
);
flag
=
false
;
flag
=
false
;
return
;
return
;
...
@@ -247,7 +267,12 @@ function writeoffFunc() {
...
@@ -247,7 +267,12 @@ function writeoffFunc() {
if
(
flag
)
{
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
核销
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
核销
\"
操作? "
,
{
ok
:
function
()
{
ok
:
function
()
{
var
info
=
new
EiInfo
();
JSUtils
.
submitGridsData
(
"result"
,
"HPCW004"
,
"writeoff"
,
true
,
function
(
e
)
{
//detailGrid.setEiInfo(e);
query
();
});
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW004", "writeoff", info, {
EiCommunicator.send("HPCW004", "writeoff", info, {
onSuccess: function (ei) {
onSuccess: function (ei) {
...
@@ -270,7 +295,7 @@ function writeoffFunc() {
...
@@ -270,7 +295,7 @@ function writeoffFunc() {
// 发生异常
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
});
});
*/
}
}
});
});
...
@@ -303,7 +328,7 @@ function deleteFunc() {
...
@@ -303,7 +328,7 @@ function deleteFunc() {
function
contractDetailFunc
(
id
)
{
function
contractDetailFunc
(
id
)
{
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HPCW004A?methodName=initLoad&inqu_status-0-
parentId="
+
id
+
"&efParentFormEname=HPCW002
"
,
href
:
"HPCW004A?methodName=initLoad&inqu_status-0-
operType=query&inqu_status-0-parentId="
+
id
+
"&efParentFormEname=HPCW004
"
,
title
:
"<div style='text-align: center;'>付款详情</div>"
,
title
:
"<div style='text-align: center;'>付款详情</div>"
,
width
:
"70%"
,
width
:
"70%"
,
height
:
"70%"
,
height
:
"70%"
,
...
...
src/main/webapp/HP/CW/HPCW004.jsp
View file @
ec1c4a50
...
@@ -33,6 +33,10 @@
...
@@ -33,6 +33,10 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.cancelStatus"/>
<EF:EFCodeOption codeName="hpjx.hpcw.cancelStatus"/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition="ITEM_CODE IN ('1', '0')"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
</EF:EFRegion>
...
@@ -65,7 +69,7 @@
...
@@ -65,7 +69,7 @@
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审核状态" width="100" align="center" readonly="true"
<EF:EFComboColumn ename="reviewStatus" cname="审核状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"
condition="ITEM_CODE IN ('1', '0')"
/>
</EF:EFComboColumn>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFRegion>
...
...
src/main/webapp/HP/CW/HPCW004A.js
View file @
ec1c4a50
...
@@ -10,6 +10,11 @@ $(function() {
...
@@ -10,6 +10,11 @@ $(function() {
pageSize
:
20
,
pageSize
:
20
,
pageSizes
:
[
10
,
20
,
30
,
50
,
100
,
200
],
pageSizes
:
[
10
,
20
,
30
,
50
,
100
,
200
],
},
},
loadComplete
:
function
(
grid
)
{
if
(
$
(
"#inqu_status-0-operType"
).
val
()
===
"query"
){
$
(
"#save-changes"
).
hide
();
}
},
onSave
:
function
(
e
)
{
onSave
:
function
(
e
)
{
// 阻止默认请求,使用自定义保存
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
e
.
preventDefault
();
...
...
src/main/webapp/HP/CW/HPCW004A.jsp
View file @
ec1c4a50
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="付款清单">
<EF:EFPage title="付款清单">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="operType" cname="隐藏条件" type="hidden"/>
<EF:EFRegion id="result" title="记录集">
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
...
...
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