Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
000f3fd4
Commit
000f3fd4
authored
Nov 12, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add some conditon for approval protect
parent
8605405b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
27 deletions
+107
-27
ApprovalController.java
.../java/pwc/taxtech/atms/controller/ApprovalController.java
+6
-0
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+1
-0
PreconditionFailedException.java
...c/taxtech/atms/exception/PreconditionFailedException.java
+27
-0
ApprovalService.java
...va/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
+4
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+17
-8
PeriodApproveMapper.java
...in/java/pwc/taxtech/atms/vat/dao/PeriodApproveMapper.java
+15
-0
vat-report-view.ctrl.js
...p/common/controls/vat-report-view/vat-report-view.ctrl.js
+32
-18
vatApproveService.js
...c/main/webapp/app/common/vatservices/vatApproveService.js
+5
-0
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+0
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ApprovalController.java
View file @
000f3fd4
...
...
@@ -70,6 +70,12 @@ public class ApprovalController {
approvalService
.
checkTask
(
taskId
,
decide
,
comment
);
}
@ResponseBody
@RequestMapping
(
value
=
"/status/{projectId}/{period}"
)
public
String
getApprovalStatus
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
){
return
approvalService
.
getApprovalStatus
(
projectId
,
period
);
}
@RequestMapping
(
value
=
"/show/{procDefId}"
)
//获取流程图
public
void
showImg
(
@PathVariable
String
procDefId
,
HttpServletResponse
response
)
{
try
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
000f3fd4
...
...
@@ -18,4 +18,5 @@ public class Exceptions {
public
static
final
ApiException
PROJECT_PROJECT_EXCEPTION
=
new
NotFoundException
(
"not found project"
);
public
static
final
ApiException
NOT_FOUND_TEMPLATE_GROUP_EXCEPTION
=
new
NotFoundException
(
"not found template group"
);
public
static
final
ApiException
NOT_FOUND_EXCEPTION
=
new
NotFoundException
(
"not found resources"
);
public
static
final
ApiException
REPORT_IN_PROCESS_OR_AGREED_EXCEPTION
=
new
PreconditionFailedException
(
"report in approval or agreed result"
);
}
atms-api/src/main/java/pwc/taxtech/atms/exception/PreconditionFailedException.java
0 → 100644
View file @
000f3fd4
package
pwc
.
taxtech
.
atms
.
exception
;
import
org.springframework.http.ResponseEntity
;
public
class
PreconditionFailedException
extends
ApiException
{
public
PreconditionFailedException
()
{
super
();
}
public
PreconditionFailedException
(
String
message
)
{
super
(
message
);
}
public
PreconditionFailedException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
PreconditionFailedException
(
Throwable
cause
)
{
super
(
cause
);
}
@Override
public
<
Object
>
ResponseEntity
handle
()
{
return
ResponseEntity
.
notFound
().
build
();
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
View file @
000f3fd4
...
...
@@ -172,4 +172,8 @@ public class ApprovalService {
public
Template
getTemplateInfo
(
Long
templateId
)
{
return
templateMapper
.
selectByPrimaryKey
(
templateId
);
}
public
String
getApprovalStatus
(
String
projectId
,
Integer
period
)
{
return
periodApproveMapper
.
getStatusByProjectIdAndPeriod
(
projectId
,
period
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
000f3fd4
...
...
@@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.*
;
import
pwc.taxtech.atms.dao.*
;
import
pwc.taxtech.atms.dpo.ReportDto
;
...
...
@@ -30,7 +31,6 @@ import pwc.taxtech.atms.vat.dpo.DataSourceCellDataDto;
import
pwc.taxtech.atms.vat.dpo.DataSourceExtendDto
;
import
pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper
;
import
java.io.File
;
...
...
@@ -102,6 +102,8 @@ public class ReportServiceImpl {
private
DistributedIdService
distributedIdService
;
@Autowired
private
PeriodJobMapper
periodJobMapper
;
@Autowired
private
PeriodApproveMapper
periodApprovalMapper
;
public
OperationResultDto
<
List
<
ReportDto
>>
getReportTemplate
(
String
projectId
,
EnumServiceType
serviceType
,
Integer
periodParam
)
{
int
period
=
periodParam
!=
null
?
periodParam
:
0
;
...
...
@@ -256,7 +258,7 @@ public class ReportServiceImpl {
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
job
.
setErrorMsg
(
"error update config with projectId "
+
projectId
+
" period"
+
period
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
}
finally
{
}
finally
{
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
}
...
...
@@ -461,6 +463,8 @@ public class ReportServiceImpl {
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
periodParam
)
.
andStatusEqualTo
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
MyAsserts
.
assertEmpty
(
periodJobMapper
.
selectByExample
(
example
),
Exceptions
.
TASK_HAS_BEGINNING
);
String
status
=
periodApprovalMapper
.
getStatusByProjectIdAndPeriod
(
projectId
,
periodParam
);
MyAsserts
.
assertTrue
(
status
==
null
||
status
.
equals
(
Constant
.
APPROVAL_DISAGREED
),
Exceptions
.
REPORT_IN_PROCESS_OR_AGREED_EXCEPTION
);
List
<
Template
>
templates
=
getTemplatesByProjectId
(
projectId
);
...
...
@@ -485,12 +489,12 @@ public class ReportServiceImpl {
FormulaEvaluator
evaluator
=
workbook
.
getCreationHelper
().
createFormulaEvaluator
();
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error"
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
...
...
@@ -706,7 +710,7 @@ public class ReportServiceImpl {
private
Integer
convertType
(
Integer
dataSourceType
)
{
if
(
dataSourceType
.
equals
(
FormulaDataSourceDetailType
.
InputInvoiceDataSourceDto
.
getCode
()))
{
return
CellDataSourceType
.
InputInvoice
.
getCode
();
}
else
if
(
dataSourceType
.
equals
(
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
.
getCode
()))
{
}
else
if
(
dataSourceType
.
equals
(
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
.
getCode
()))
{
return
CellDataSourceType
.
OutputInvoice
.
getCode
();
}
else
{
return
CellDataSourceType
.
Formula
.
getCode
();
...
...
@@ -716,9 +720,10 @@ public class ReportServiceImpl {
private
Integer
convetToFType
(
Integer
cellDataSourceType
)
{
if
(
cellDataSourceType
.
equals
(
CellDataSourceType
.
InputInvoice
.
getCode
()))
{
return
FormulaDataSourceType
.
InputInvoice
.
getCode
();
}
if
(
cellDataSourceType
.
equals
(
CellDataSourceType
.
OutputInvoice
.
getCode
())){
}
if
(
cellDataSourceType
.
equals
(
CellDataSourceType
.
OutputInvoice
.
getCode
()))
{
return
FormulaDataSourceType
.
OutputInvoice
.
getCode
();
}
else
{
}
else
{
return
FormulaDataSourceType
.
Other
.
getCode
();
}
}
...
...
@@ -836,6 +841,9 @@ public class ReportServiceImpl {
public
OperationResultDto
addCellManualDataSource
(
ManualDataSourceDto
data
,
String
projectId
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
String
status
=
periodApprovalMapper
.
getStatusByProjectIdAndPeriod
(
projectId
,
data
.
getPeriod
());
MyAsserts
.
assertTrue
(
status
==
null
||
status
.
equals
(
Constant
.
APPROVAL_DISAGREED
),
Exceptions
.
REPORT_IN_PROCESS_OR_AGREED_EXCEPTION
);
try
{
if
(
data
.
getCellId
()
==
null
)
{
...
...
@@ -858,7 +866,8 @@ public class ReportServiceImpl {
PeriodCellData
cellData
=
periodCellDataMapper
.
selectByPrimaryKey
(
data
.
getCellId
());
if
(
cellData
.
getData
()
!=
data
.
getAmount
().
toString
())
{
cellData
.
setData
(
data
.
getAmount
().
toString
());
if
(
StringUtils
.
isEmpty
(
cellData
.
getFormulaExp
()))
cellData
.
setFormulaExp
(
data
.
getAmount
().
toString
());
if
(
StringUtils
.
isEmpty
(
cellData
.
getFormulaExp
()))
cellData
.
setFormulaExp
(
data
.
getAmount
().
toString
());
periodCellDataMapper
.
updateByPrimaryKeySelective
(
cellData
);
}
}
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodApproveMapper.java
View file @
000f3fd4
...
...
@@ -133,4 +133,18 @@ public interface PeriodApproveMapper extends MyVatMapper {
"</where>"
+
"</script>"
)
List
<
ApprovalTaskInfo
>
queryApprovalList
(
@Param
(
"createId"
)
String
createId
);
@Select
(
""
+
"SELECT "
+
" STATUS AS status "
+
"FROM "
+
" PERIOD_APPROVE "
+
"WHERE "
+
" PROJECT_ID = #{projectId} "
+
" AND PERIOD = #{period} "
+
" AND ROWNUM = 1 "
+
"ORDER BY "
+
" CREATE_TIME DESC"
+
""
)
String
getStatusByProjectIdAndPeriod
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
);
}
\ No newline at end of file
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.ctrl.js
View file @
000f3fd4
...
...
@@ -2539,26 +2539,40 @@
};
$scope
.
commitApprove
=
function
(){
SweetAlert
.
swal
({
title
:
"warning!"
,
text
:
$translate
.
instant
(
'报表提审后不能手工录入和重新生成!'
),
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
$translate
.
instant
(
'Yes'
),
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
if
(
isConfirm
)
{
var
approveParam
=
{};
approveParam
.
projectId
=
vatSessionService
.
project
.
id
;
approveParam
.
periodDate
=
vatSessionService
.
project
.
periodDate
;
vatApproveService
.
commitNewApproval
(
approveParam
);
vatApproveService
.
approvalStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
project
.
month
).
success
(
function
(
result
){
if
(
result
&&
result
==
'committed'
){
SweetAlert
.
swal
({
title
:
"warning!"
,
text
:
$translate
.
instant
(
'报表提审中'
),
type
:
"warning"
,
showCancelButton
:
true
,
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnCancel
:
true
});
}
else
{
SweetAlert
.
swal
({
title
:
"warning!"
,
text
:
$translate
.
instant
(
'报表提审后不能手工录入和重新生成!'
),
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
$translate
.
instant
(
'Yes'
),
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
isConfirm
)
{
if
(
isConfirm
)
{
var
approveParam
=
{};
approveParam
.
projectId
=
vatSessionService
.
project
.
id
;
approveParam
.
periodDate
=
vatSessionService
.
project
.
periodDate
;
vatApproveService
.
commitNewApproval
(
approveParam
);
}
});
}
});
});
}
$scope
.
doApprove
=
function
(){
...
...
atms-web/src/main/webapp/app/common/vatservices/vatApproveService.js
View file @
000f3fd4
...
...
@@ -23,6 +23,10 @@
checkTask
:
function
(
taskId
,
decide
,
comment
){
return
$http
.
put
(
'/approval/check/'
+
taskId
+
'?decide='
+
decide
+
'&comment='
+
comment
,
{},
apiConfig
.
createVat
());
},
approvalStatus
:
function
(
projectId
,
period
){
return
$http
.
get
(
'/approval/'
+
projectId
+
'/'
+
period
,
apiConfig
.
createVat
({
ignoreLoadingBar
:
true
}))
}
};
}]);
\ No newline at end of file
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
000f3fd4
...
...
@@ -350,7 +350,6 @@
}
};
var
startCaculate2
=
function
()
{
if
(
vatSessionService
.
project
.
projectStatusList
[
vatSessionService
.
month
]
>=
constant
.
ProjectStatusEnum
.
Generated
)
{
swal
({
...
...
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