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
1519bf01
Commit
1519bf01
authored
Nov 14, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
d2e9d3e7
fd4a320a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
413 additions
and
263 deletions
+413
-263
CustomExceptionHandler.java
...taxtech/atms/common/exception/CustomExceptionHandler.java
+0
-34
ApprovalController.java
.../java/pwc/taxtech/atms/controller/ApprovalController.java
+9
-3
AtmsExceptionHandler.java
...ava/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
+24
-1
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+7
-6
WrapPeriodJobDto.java
...in/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
+57
-2
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+1
-0
PreconditionFailedException.java
...c/taxtech/atms/exception/PreconditionFailedException.java
+28
-0
EnterpriseAccountServiceImpl.java
...xtech/atms/service/impl/EnterpriseAccountServiceImpl.java
+5
-5
ApprovalService.java
...va/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
+28
-11
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+0
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+33
-33
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+9
-9
PeriodApproveMapper.java
...in/java/pwc/taxtech/atms/vat/dao/PeriodApproveMapper.java
+11
-0
PeriodReportMapper.java
...ain/java/pwc/taxtech/atms/vat/dao/PeriodReportMapper.java
+4
-3
subject-corresponding.ctrl.js
...ration/subjectCorresponding/subject-corresponding.ctrl.js
+12
-12
vat-report-view.ctrl.js
...p/common/controls/vat-report-view/vat-report-view.ctrl.js
+34
-22
vat-report-view.html
.../app/common/controls/vat-report-view/vat-report-view.html
+5
-3
vatApproveService.js
...c/main/webapp/app/common/vatservices/vatApproveService.js
+5
-104
vatReportService.js
...rc/main/webapp/app/common/vatservices/vatReportService.js
+8
-4
common.svc.js
...-web/src/main/webapp/app/common/webservices/common.svc.js
+104
-0
app-approve.ctrl.js
...main/webapp/app/framework/app-approve/app-approve.ctrl.js
+19
-6
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+10
-5
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/exception/CustomExceptionHandler.java
deleted
100644 → 0
View file @
d2e9d3e7
package
pwc
.
taxtech
.
atms
.
common
.
exception
;
import
com.alibaba.fastjson.JSON
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
pwc.taxtech.atms.common.ServiceException
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
@ControllerAdvice
public
class
CustomExceptionHandler
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CustomExceptionHandler
.
class
);
@ExceptionHandler
(
value
=
Throwable
.
class
)
public
ApiResultDto
handle
(
HttpServletResponse
response
)
{
return
ApiResultDto
.
fail
(
"error."
);
}
@ExceptionHandler
(
value
=
ServiceException
.
class
)
public
void
customHandle
(
ServiceException
exception
,
HttpServletResponse
response
)
{
try
{
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/json; charset=UTF-8"
);
response
.
getWriter
().
write
(
JSON
.
toJSONString
(
ApiResultDto
.
fail
(
exception
.
getMessage
())));
}
catch
(
IOException
e
)
{
logger
.
error
(
"customHandle error."
,
e
);
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ApprovalController.java
View file @
1519bf01
...
...
@@ -65,9 +65,15 @@ public class ApprovalController {
}
@ResponseBody
@RequestMapping
(
value
=
"/check/{taskId}"
)
public
void
check
(
@PathVariable
String
taskId
,
@RequestParam
String
decide
)
{
//only for manager role
approvalService
.
checkTask
(
taskId
,
decide
);
@RequestMapping
(
value
=
"/check/{taskId}"
,
method
=
RequestMethod
.
PUT
)
public
void
check
(
@PathVariable
String
taskId
,
@RequestParam
String
decide
,
@RequestParam
String
comment
)
{
//only for manager role
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}"
)
//获取流程图
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/AtmsExceptionHandler.java
View file @
1519bf01
package
pwc
.
taxtech
.
atms
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
pwc.taxtech.atms.exception.ApiException
;
import
pwc.taxtech.atms.exception.ApplicationException
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
@EnableWebMvc
@ControllerAdvice
public
class
AtmsExceptionHandler
extends
ResponseEntityExceptionHandler
{
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AtmsExceptionHandler
.
class
);
@ExceptionHandler
(
value
=
{
ApplicationException
.
class
,
Service
Exception
.
class
Api
Exception
.
class
})
protected
ResponseEntity
<
Object
>
handleExceptions
(
Exception
ex
)
throws
ServiceException
{
LOGGER
.
error
(
"Rest Exception!"
,
ex
);
...
...
@@ -42,6 +49,22 @@ public class AtmsExceptionHandler extends ResponseEntityExceptionHandler {
}
}
@ExceptionHandler
(
value
=
Throwable
.
class
)
public
ApiResultDto
handle
(
HttpServletResponse
response
)
{
return
ApiResultDto
.
fail
(
"error."
);
}
@ExceptionHandler
(
value
=
ServiceException
.
class
)
public
void
customHandle
(
pwc
.
taxtech
.
atms
.
common
.
ServiceException
exception
,
HttpServletResponse
response
)
{
try
{
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/json; charset=UTF-8"
);
response
.
getWriter
().
write
(
JSON
.
toJSONString
(
ApiResultDto
.
fail
(
exception
.
getMessage
())));
}
catch
(
IOException
e
)
{
logger
.
error
(
"customHandle error."
,
e
);
}
}
private
ResponseEntity
<
Object
>
handleApplicationException
(
ApplicationException
ex
)
{
throw
ex
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
1519bf01
...
...
@@ -38,10 +38,11 @@ public class ReportController {
return
reportService
.
getFilterReportTemplate
(
projectId
,
EnumServiceType
.
getEnumByCode
(
serviceType
),
period
);
}
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{mergeManual}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
generateAllData
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@RequestParam
Optional
<
String
>
generator
,
@PathVariable
Boolean
mergeManual
)
{
return
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
mergeManual
,
period
,
null
,
generator
);
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{mergeManual}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseEntity
generateAllData
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@RequestParam
Optional
<
String
>
generator
,
@PathVariable
Boolean
mergeManual
)
{
return
ResponseEntity
.
ok
(
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
mergeManual
,
period
,
null
,
generator
));
}
@RequestMapping
(
value
=
"getRunningJob/{projectId}/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
@@ -110,12 +111,12 @@ public class ReportController {
}
@RequestMapping
(
value
=
"addCellManualData"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
addCellManualDataSource
(
@RequestBody
ManualDataSourceDto
data
,
@RequestHeader
String
from
)
{
public
ResponseEntity
addCellManualDataSource
(
@RequestBody
ManualDataSourceDto
data
,
@RequestHeader
String
from
)
{
String
projectId
=
StringUtils
.
EMPTY
;
if
(
StringUtils
.
isNotBlank
(
from
)
&&
from
.
split
(
"@"
).
length
>
0
)
{
projectId
=
from
.
split
(
"@"
)[
0
];
}
return
reportService
.
addCellManualDataSource
(
data
,
from
);
return
ResponseEntity
.
ok
(
reportService
.
addCellManualDataSource
(
data
,
from
)
);
}
@RequestMapping
(
value
=
"addDataSource"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
View file @
1519bf01
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Select
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.Template
;
...
...
@@ -27,9 +34,8 @@ public class WrapPeriodJobDto {
job
.
setProjectId
(
projectId
);
job
.
setPeriod
(
period
);
job
.
setId
(
UUID
.
randomUUID
().
toString
());
job
.
setStatus
(
STATUS_BEGIN
);
job
.
setCurrentStep
(
STEP_UPDATE_CONFIG
);
setStatus
(
job
,
STEP_UPDATE_CONFIG
,
STATUS_BEGIN
);
StringBuilder
builder
=
new
StringBuilder
(
STEP_UPDATE_CONFIG
);
templates
.
forEach
(
m
->
{
builder
.
append
(
","
).
append
(
m
.
getCode
());
...
...
@@ -38,4 +44,53 @@ public class WrapPeriodJobDto {
job
.
setStepsCode
(
builder
.
toString
());
return
job
;
}
@Getter
@Setter
public
static
class
Task
{
String
code
;
String
status
;
}
public
static
List
<
Task
>
fromJson
(
String
taskJson
)
{
return
JSON
.
parseObject
(
taskJson
,
new
TypeReference
<
List
<
Task
>>()
{});
}
public
static
String
toJson
(
List
<
Task
>
tasks
)
{
return
JSON
.
toJSONString
(
tasks
);
}
public
static
void
setStatus
(
PeriodJob
periodJob
,
String
code
,
String
status
)
{
List
<
Task
>
list
;
if
(
StringUtils
.
isBlank
(
periodJob
.
getStatus
()))
{
list
=
new
ArrayList
<>();
}
else
{
list
=
fromJson
(
periodJob
.
getStatus
());
}
Task
t
=
new
Task
();
t
.
code
=
code
;
t
.
status
=
status
;
boolean
contains
=
false
;
for
(
Task
m
:
list
)
{
if
(
m
.
code
.
equals
(
t
.
code
))
{
m
.
status
=
status
;
contains
=
true
;
break
;
}
}
if
(!
contains
)
list
.
add
(
t
);
periodJob
.
setStatus
(
toJson
(
list
));
}
public
static
void
setStatus
(
PeriodJob
periodJob
,
String
status
)
{
List
<
Task
>
list
;
if
(
StringUtils
.
isBlank
(
periodJob
.
getStatus
()))
{
list
=
new
ArrayList
<>();
}
else
{
list
=
fromJson
(
periodJob
.
getStatus
());
}
list
.
get
(
list
.
size
()-
1
).
status
=
status
;
periodJob
.
setStatus
(
toJson
(
list
));
}
}
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
1519bf01
...
...
@@ -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 @
1519bf01
package
pwc
.
taxtech
.
atms
.
exception
;
import
org.springframework.http.HttpStatus
;
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
.
status
(
HttpStatus
.
PRECONDITION_FAILED
).
build
();
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/impl/EnterpriseAccountServiceImpl.java
View file @
1519bf01
...
...
@@ -988,7 +988,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
//endregion
//1. 如果将标准科目对应到企业科目的父级,那么该企业科目的子级都对应到该标准科目
updateManualMapChildAccount
(
eaList
,
eAccount
,
stdAccount
,
accountSetId
,
industryId
,
organization
.
getId
());
//
updateManualMapChildAccount(eaList, eAccount, stdAccount, accountSetId, industryId, organization.getId());
//region 添加日志
OperationLogDto
operationLogDto
=
new
OperationLogDto
();
...
...
@@ -1009,13 +1009,13 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
//region 手动对应当前的所有父级科目
//清空ParentAccountMapResult
this
.
mapParentAccountResult
=
Maps
.
newHashMap
();
mapAccountUpdateParent
(
Lists
.
newArrayList
(
accountMapDto
.
getEnterpriseAccountCodes
()),
accountSetId
,
industryId
,
organization
.
getId
(),
true
);
//
this.mapParentAccountResult = Maps.newHashMap();
//
mapAccountUpdateParent(Lists.newArrayList(accountMapDto.getEnterpriseAccountCodes()), accountSetId, industryId,
//
organization.getId(), true);
//endregion
AccountMapDto
mapDto
=
new
AccountMapDto
();
mapDto
.
setParentAccountMappingResult
(
this
.
mapParentAccountResult
);
mapDto
.
setParentAccountMappingResult
(
this
.
mapParentAccountResult
);
//todo 此处有线程安全问题
return
OperationResultDto
.
success
(
mapDto
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ApprovalService.java
View file @
1519bf01
...
...
@@ -125,7 +125,7 @@ public class ApprovalService {
@Transactional
public
void
checkTask
(
String
taskId
,
String
decide
)
{
public
void
checkTask
(
String
instanceId
,
String
decide
,
String
comment
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
PeriodApprove
pa
=
new
PeriodApprove
();
switch
(
decide
)
{
...
...
@@ -140,23 +140,40 @@ public class ApprovalService {
default
:
throw
new
BadParameterException
(
"not support decide param type"
);
}
List
<
Attachment
>
attachments
=
taskService
.
getTaskAttachments
(
taskId
);
if
(
attachments
!=
null
&&
attachments
.
size
()
==
1
)
{
String
uuid
=
attachments
.
get
(
0
).
getDescription
();
taskService
.
complete
(
taskId
,
map
);
pa
.
setId
(
uuid
);
periodApproveMapper
.
updateByPrimaryKeySelective
(
pa
);
PeriodApprove
result
=
periodApproveMapper
.
selectByPrimaryKey
(
uuid
);
//save report on service
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
taskAssignee
(
Constant
.
ASSIGNEE_MANAGER
).
processInstanceId
(
instanceId
).
list
();
if
(
tasks
!=
null
&&
tasks
.
size
()
==
1
)
{
Task
task
=
tasks
.
get
(
0
);
List
<
Attachment
>
attachments
=
taskService
.
getTaskAttachments
(
task
.
getId
());
if
(
attachments
!=
null
&&
attachments
.
size
()
==
1
)
{
String
uuid
=
attachments
.
get
(
0
).
getDescription
();
taskService
.
complete
(
task
.
getId
(),
map
);
pa
.
setId
(
uuid
);
pa
.
setApprovalBy
(
authUserHelper
.
getCurrentUserId
()
==
null
?
"Admin"
:
authUserHelper
.
getCurrentUserId
());
pa
.
setApprovalTime
(
new
Date
());
pa
.
setApprovalResualt
(
comment
);
periodApproveMapper
.
updateByPrimaryKeySelective
(
pa
);
}
else
{
logger
.
warn
(
"task must not null or size gt 1"
);
}
}
else
{
logger
.
warn
(
"task must not null or size
gt
1"
);
logger
.
warn
(
"task must not null or size
eq
1"
);
}
}
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/ReportGeneratorImpl.java
View file @
1519bf01
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
1519bf01
...
...
@@ -17,6 +17,7 @@ import pwc.taxtech.atms.common.CommonUtils;
import
pwc.taxtech.atms.common.util.BeanUtil
;
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
;
...
...
@@ -43,6 +44,8 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
dto
.
vatdto
.
WrapPeriodJobDto
.*;
@Component
public
class
ReportServiceImpl
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ReportServiceImpl
.
class
);
...
...
@@ -103,6 +106,8 @@ public class ReportServiceImpl {
private
DistributedIdService
distributedIdService
;
@Autowired
private
PeriodJobMapper
periodJobMapper
;
@Autowired
private
PeriodApproveMapper
periodApprovalMapper
;
public
OperationResultDto
<
List
<
ReportDto
>>
getFilterReportTemplate
(
String
projectId
,
EnumServiceType
serviceType
,
Integer
periodParam
)
{
OperationResultDto
<
List
<
ReportDto
>>
result
=
new
OperationResultDto
<>();
...
...
@@ -265,23 +270,16 @@ public class ReportServiceImpl {
}
@Transactional
private
void
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
,
List
<
Template
>
templates
,
PeriodJob
job
)
{
try
{
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
,
isMergeManualData
);
setStatus
(
job
,
STATUS_BEGIN
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
copyTemplateAndConfigFromAdmin
(
projectId
,
templates
,
period
);
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
,
isMergeManualData
);
copyTemplateAndConfigFromAdmin
(
projectId
,
templates
,
period
);
}
catch
(
Exception
ex
)
{
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
job
.
setErrorMsg
(
"error update config with projectId "
+
projectId
+
" period"
+
period
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
}
finally
{
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
setStatus
(
job
,
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
private
List
<
Template
>
getTemplatesByProjectId
(
String
projectId
)
{
...
...
@@ -473,19 +471,20 @@ public class ReportServiceImpl {
public
OperationResultDto
generateData
(
String
projectId
,
EnumServiceType
serviceType
,
Boolean
isMergeManualData
,
Integer
periodParam
,
Integer
reportType
,
Optional
<
String
>
generator
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
MyAsserts
.
assertEq
(
serviceType
,
EnumServiceType
.
VAT
,
new
NotFoundException
());
PeriodJobExample
example
=
new
PeriodJobExample
();
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
);
try
{
if
(
serviceType
.
equals
(
EnumServiceType
.
VAT
)
&&
(
periodParam
==
null
||
periodParam
<=
0
))
{
operationResultDto
.
setResultMsg
(
"PeriodRequiredForVAT"
);
return
operationResultDto
;
}
MyAsserts
.
assertEq
(
serviceType
,
EnumServiceType
.
VAT
,
new
NotFoundException
());
PeriodJobExample
example
=
new
PeriodJobExample
();
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
periodParam
)
.
andStatusEqualTo
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
MyAsserts
.
assertEmpty
(
periodJobMapper
.
selectByExample
(
example
),
Exceptions
.
TASK_HAS_BEGINNING
);
List
<
Template
>
templates
=
getTemplatesByProjectId
(
projectId
);
PeriodJob
genJob
=
WrapPeriodJobDto
.
createReportGenJob
(
projectId
,
periodParam
,
templates
);
...
...
@@ -508,14 +507,10 @@ public class ReportServiceImpl {
FormulaEvaluator
evaluator
=
workbook
.
getCreationHelper
().
createFormulaEvaluator
();
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
catch
(
Exception
e
){
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error"
);
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
}
catch
(
Exception
e
)
{
setStatus
(
genJob
,
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error "
+
e
.
getMessage
());
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
e
.
printStackTrace
();
}
...
...
@@ -729,7 +724,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
();
...
...
@@ -739,9 +734,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
();
}
}
...
...
@@ -859,6 +855,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
)
{
...
...
@@ -881,7 +880,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-api/src/main/resources/conf/conf_profile_dev.properties
View file @
1519bf01
jdbc_url
=
jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc_user
=
TAX_ADMIN
jdbc_password
=
taxadmin2018
#jdbc_password=111111
jdbc_admin_db
=
tax_admin
#jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
#jdbc_user=
tax_admin_longi
#jdbc_password=tax
_admin_longi
#jdbc_user=
TAX_ADMIN
#jdbc_password=tax
admin2018
##jdbc_password=111111
#jdbc_admin_db=tax_admin_longi
#jdbc_admin_db=tax_admin
jdbc_url
=
jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc_user
=
tax_admin_longi
jdbc_password
=
tax_admin_longi
#jdbc_password=111111
jdbc_admin_db
=
tax_admin_longi
jdbc2_url
=
jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc2_user
=
pwc_invoice
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodApproveMapper.java
View file @
1519bf01
...
...
@@ -133,4 +133,14 @@ public interface PeriodApproveMapper extends MyVatMapper {
"</where>"
+
"</script>"
)
List
<
ApprovalTaskInfo
>
queryApprovalList
(
@Param
(
"createId"
)
String
createId
);
@Select
(
""
+
"SELECT "
+
" STATUS AS status "
+
"FROM "
+
" ( SELECT * FROM PERIOD_APPROVE WHERE PROJECT_ID = #{projectId} AND PERIOD = #{period} ORDER BY CREATE_TIME DESC ) "
+
"WHERE "
+
" ROWNUM = 1"
+
""
)
String
getStatusByProjectIdAndPeriod
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodReportMapper.java
View file @
1519bf01
...
...
@@ -126,10 +126,10 @@ public interface PeriodReportMapper extends MyVatMapper {
" PERIOD_REPORT r "
+
" LEFT JOIN PERIOD_TEMPLATE pt ON r.TEMPLATE_ID = pt.TEMPLATE_ID "
+
"WHERE "
+
" r.PROJECT_ID =
'1'
"
+
" AND r.PERIOD =
10
"
+
" r.PROJECT_ID =
#{projectId}
"
+
" AND r.PERIOD =
#{period}
"
+
"ORDER BY "
+
" pt.ORDER_INDEX"
+
""
)
List
<
PeriodReport
>
selectOrderReportIds
(
String
projectId
,
Integer
period
);
List
<
PeriodReport
>
selectOrderReportIds
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
);
}
\ No newline at end of file
atms-web/src/main/webapp/app/admin/systemConfiguration/subjectCorresponding/subject-corresponding.ctrl.js
View file @
1519bf01
...
...
@@ -511,18 +511,18 @@
v
[
'stdCode'
]
=
codeToUpdate
;
v
[
'stdName'
]
=
nameToUpdate
;
v
[
'stdResult'
]
=
getStdResult
(
codeToUpdate
,
nameToUpdate
);
//todo 需求不需要覆盖子节点
//找出该选中节点的所有子节点,然后复制,避免再次从数据库获取数据
$scope
.
gridApiSubject
.
grid
.
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
entity
.
parentCode
===
v
.
code
)
{
row
.
entity
[
'stdCode'
]
=
codeToUpdate
;
row
.
entity
[
'stdName'
]
=
nameToUpdate
;
row
.
entity
[
'stdResult'
]
=
getStdResult
(
codeToUpdate
,
nameToUpdate
);
//再次更新该row下面的子节点如果存在的话
updateChildrenMappedCodeNameRecursive
(
$scope
.
gridApiSubject
.
grid
.
rows
,
row
.
entity
[
'code'
],
codeToUpdate
,
nameToUpdate
);
}
});
//
$scope.gridApiSubject.grid.rows.forEach(function (row) {
//
if (row.entity.parentCode === v.code) {
//
row.entity['stdCode'] = codeToUpdate;
//
row.entity['stdName'] = nameToUpdate;
//
row.entity['stdResult'] = getStdResult(codeToUpdate, nameToUpdate);
//
//
//再次更新该row下面的子节点如果存在的话
//
updateChildrenMappedCodeNameRecursive($scope.gridApiSubject.grid.rows, row.entity['code'], codeToUpdate, nameToUpdate);
//
}
//
});
});
};
...
...
@@ -855,7 +855,7 @@
if
(
newVal
!==
oldVal
)
{
//初始化右侧标准科目的树,使用jquery fancytree的方式来显示树,所以需要用到ajax的方式
var
stdAccountUrl
=
'/stdAccount/stdAccountHierarchy?orgID='
+
$scope
.
selectedOrgID
;
commonWebService
.
initFancyTreeAjax
(
'treetable'
,
stdAccountUrl
,
mapStdAccount
);
commonWebService
.
init
All
FancyTreeAjax
(
'treetable'
,
stdAccountUrl
,
mapStdAccount
);
$scope
.
LoadEtsSubjectBySelectedOrg
();
}
...
...
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.ctrl.js
View file @
1519bf01
...
...
@@ -1036,7 +1036,7 @@
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
// here is excel IO API
excelIo
.
save
(
mainSpread
.
toJSON
(),
function
(
blob
)
{
saveAs
(
blob
,
'ttt
.xlsx'
);
saveAs
(
blob
,
vatSessionService
.
project
.
name
+
'-'
+
vatSessionService
.
month
+
'-纳税申报
.xlsx'
);
},
function
(
e
)
{
alert
(
e
);
});
...
...
@@ -1721,7 +1721,6 @@
}
});
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
'CompleteDeclarationStatusCheck'
));
}
}
...
...
@@ -2539,26 +2538,33 @@
};
$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
.
month
).
success
(
function
(
result
){
if
(
result
&&
result
==
'committed'
){
SweetAlert
.
error
(
'报表提审中或审核已通过!'
);
}
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
(){
...
...
@@ -2566,11 +2572,17 @@
}
$scope
.
rejectApproval
=
function
(){
$
(
"#ApprovalComment"
).
modal
(
'hide'
);
vatApproveService
.
checkTask
(
vatSessionService
.
approvalInfo
.
instanceId
,
'disagreed'
,
$scope
.
comment
).
success
(
function
(){
$
(
"#ApprovalComment"
).
modal
(
'hide'
);
});
}
$scope
.
agreeApproval
=
function
(){
$
(
"#ApprovalComment"
).
modal
(
'hide'
);
vatApproveService
.
checkTask
(
vatSessionService
.
approvalInfo
.
instanceId
,
'agreed'
,
$scope
.
comment
).
success
(
function
(){
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Completed
,
constant
.
DictionaryDictKey
.
WFDataProcess
,
enums
.
FinishStatusEnum
.
Finished
);
$
(
"#ApprovalComment"
).
modal
(
'hide'
);
});
}
//排序
...
...
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.html
View file @
1519bf01
...
...
@@ -6,6 +6,8 @@
class=
"fa fa-floppy-o"
></i>
{{'报表提审'}}
</span>
<span
ng-if=
"!isBSPL"
ng-click=
"doApprove();"
><i
class=
"fa fa-floppy-o"
></i>
{{'报表审批'}}
</span>
<span
ng-if=
"!isBSPL"
ng-click=
"saveReportCache();"
><i
class=
"fa fa-floppy-o"
></i>
{{'Save' | translate}}
</span>
</div>
<div
class=
'report-container'
id=
"reportContainer"
>
...
...
@@ -164,15 +166,15 @@
<table
class=
"table"
>
<caption>
审核意见
</caption>
<tr>
<td><textarea
rows=
"3"
class=
"form-control"
ng-model=
"
voucherComments"
>
{{approvalC
omment}}
</textarea>
<td><textarea
rows=
"3"
class=
"form-control"
ng-model=
"
comment"
>
{{c
omment}}
</textarea>
</td>
</tr>
<tr>
<td
style=
"float:right;border-top:none;"
>
<button
class=
"btn btn-sm"
ng-click=
"rejectApproval()"
>
审核通过
<button
class=
"btn btn-sm"
ng-click=
"rejectApproval()"
>
驳回
</button>
<button
class=
"btn btn-sm"
ng-click=
"agreeApproval()"
>
审核拒绝
<button
class=
"btn btn-sm"
ng-click=
"agreeApproval()"
>
通过
</button>
</td>
</tr>
...
...
atms-web/src/main/webapp/app/common/vatservices/vatApproveService.js
View file @
1519bf01
...
...
@@ -21,112 +21,12 @@
return
$http
.
get
(
'/approval/templateInfo/'
+
templateId
,
apiConfig
.
createVat
());
},
getExportOutputInvoiceList
:
function
(
param
)
{
return
$http
.
post
(
'/outputInvoiceImport/getExportOutputInvoiceList'
,
{
PageInfo
:
param
.
pageInfo
,
PeriodStart
:
param
.
periodStart
,
PeriodEnd
:
param
.
periodEnd
,
InvoiceType
:
param
.
invoiceType
,
StartInvoiceDate
:
param
.
invoiceDateStart
,
EndInvoiceDate
:
param
.
invoiceDateEnd
,
ClassCode
:
param
.
classCode
,
InvoiceNumber
:
param
.
invoiceNumber
,
BuyerName
:
param
.
buyerName
,
ProductName
:
param
.
productName
,
AmountStart
:
param
.
amountStart
,
AmountEnd
:
param
.
amountEnd
,
TaxAmountStart
:
param
.
taxAmountStart
,
TaxAmountEnd
:
param
.
taxAmountEnd
,
},
apiConfig
.
createVat
({
responseType
:
'arraybuffer'
}));
checkTask
:
function
(
taskId
,
decide
,
comment
){
return
$http
.
put
(
'/approval/check/'
+
taskId
+
'?decide='
+
decide
+
'&comment='
+
comment
,
{},
apiConfig
.
createVat
());
},
queryInputInvoiceList
:
function
(
param
)
{
return
$http
.
post
(
'/inputInvoiceImport/inputInvoicePreviewList'
,
{
PageInfo
:
param
.
pageInfo
,
PeriodStart
:
param
.
periodStart
,
PeriodEnd
:
param
.
periodEnd
,
CertificationDateStart
:
param
.
certificationDateStart
,
CertificationDateEnd
:
param
.
certificationDateEnd
,
InvoiceCode
:
param
.
invoiceCode
,
InvoiceNumber
:
param
.
invoiceNumber
,
SellerTaxNumber
:
param
.
sellerTaxNumber
,
AmountStart
:
param
.
amountStart
,
AmountEnd
:
param
.
amountEnd
,
InvoiceType
:
param
.
invoiceType
,
TaxAmountStart
:
param
.
taxAmountStart
,
TaxAmountEnd
:
param
.
taxAmountEnd
,
CertificationStatus
:
param
.
certificationStatus
},
apiConfig
.
createVat
());
},
queryInputInvoiceItemList
:
function
(
inputInvoiceID
)
{
return
$http
.
get
(
'/inputInvoiceImport/inputInvoiceItemPreviewList/'
+
inputInvoiceID
,
apiConfig
.
createVat
());
},
//导出进项发票数据
getExportInputInvoiceList
:
function
(
param
)
{
return
$http
.
post
(
'/inputInvoiceImport/exportQueryData/get'
,
{
PageInfo
:
param
.
pageInfo
,
PeriodStart
:
param
.
periodStart
,
PeriodEnd
:
param
.
periodEnd
,
CertificationDateStart
:
param
.
certificationDateStart
,
CertificationDateEnd
:
param
.
certificationDateEnd
,
InvoiceCode
:
param
.
invoiceCode
,
InvoiceNumber
:
param
.
invoiceNumber
,
SellerTaxNumber
:
param
.
sellerTaxNumber
,
AmountStart
:
param
.
amountStart
,
AmountEnd
:
param
.
amountEnd
,
InvoiceType
:
param
.
invoiceType
,
TaxAmountStart
:
param
.
taxAmountStart
,
TaxAmountEnd
:
param
.
taxAmountEnd
,
CertificationStatus
:
param
.
certificationStatus
},
apiConfig
.
createVat
({
responseType
:
'arraybuffer'
}));
},
voucherSelectAdvancedByEntry
:
function
(
mainRelation
,
allJe
,
pagingInfo
,
listQueryCondition
)
{
return
$http
.
post
(
'/voucher/voucherSelectAdvancedByEntry'
,
{
MainRelation
:
mainRelation
,
AllJe
:
allJe
,
PagingInfo
:
pagingInfo
,
ListQueryCondition
:
listQueryCondition
},
apiConfig
.
create
());
},
voucherSelectAdvancedByVoucher
:
function
(
mainRelation
,
allJe
,
pagingInfo
,
listQueryCondition
)
{
return
$http
.
post
(
'/voucher/voucherSelectAdvancedByVoucher'
,
{
MainRelation
:
mainRelation
,
AllJe
:
allJe
,
PagingInfo
:
pagingInfo
,
ListQueryCondition
:
listQueryCondition
},
apiConfig
.
create
());
},
voucherSelectAdvancedCount
:
function
(
mainRelation
,
isEntryShow
,
allJe
,
listQueryCondition
)
{
return
$http
.
post
(
'/voucher/voucherSelectAdvancedCount'
,
{
MainRelation
:
mainRelation
,
AllJe
:
allJe
,
IsEntryShow
:
isEntryShow
,
ListQueryCondition
:
listQueryCondition
},
apiConfig
.
create
());
},
getVoucherByConditon
:
function
(
mainRelation
,
allJe
,
period
,
vID
,
group
,
listQueryCondition
)
{
return
$http
.
post
(
'/voucher/getVoucherByConditon'
,
{
MainRelation
:
mainRelation
,
AllJe
:
allJe
,
Period
:
period
,
VID
:
vID
,
Group
:
group
,
ListQueryCondition
:
listQueryCondition
},
apiConfig
.
create
());
},
getSelectWhereString
:
function
(
mainRelation
,
allJe
,
listQueryCondition
)
{
return
$http
.
post
(
'/voucher/getSelectWhereString'
,
{
MainRelation
:
mainRelation
,
AllJe
:
allJe
,
ListQueryCondition
:
listQueryCondition
},
apiConfig
.
create
());
},
getEnterpriseAccount
:
function
()
{
return
$http
.
get
(
'/voucher/getEnterpriseAccount'
,
apiConfig
.
create
());
approvalStatus
:
function
(
projectId
,
period
){
return
$http
.
get
(
'/approval/status/'
+
projectId
+
'/'
+
period
,
apiConfig
.
createVat
({
ignoreLoadingBar
:
true
}))
}
};
}]);
\ No newline at end of file
atms-web/src/main/webapp/app/common/vatservices/vatReportService.js
View file @
1519bf01
...
...
@@ -95,10 +95,14 @@
vatOperationLogService
.
addOperationLog
(
logInfo
);
data
.
dataSourceType
=
enums
.
cellDataSourceType
.
KeyIn
;
return
$q
.
when
(
data
);
},
function
()
{
logInfo
.
UpdateState
=
$translate
.
instant
(
'ManualInputFail'
);
SweetAlert
.
error
(
$translate
.
instant
(
'PleaseContactAdministrator'
));
return
vatOperationLogService
.
addOperationLog
(
logInfo
);
},
function
(
data
)
{
if
(
data
.
status
==
412
){
SweetAlert
.
error
(
'报表提审中或审核已通过!'
);
}
else
{
logInfo
.
UpdateState
=
$translate
.
instant
(
'ManualInputFail'
);
SweetAlert
.
error
(
$translate
.
instant
(
'PleaseContactAdministrator'
));
return
vatOperationLogService
.
addOperationLog
(
logInfo
);
}
});
},
deleteCellVoucher
:
function
(
voucherId
,
datasourceId
)
{
...
...
atms-web/src/main/webapp/app/common/webservices/common.svc.js
View file @
1519bf01
...
...
@@ -252,6 +252,109 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', '
node
.
setExpanded
(
false
);
});
}
},
initAllFancyTreeAjax
:
function
(
treeID
,
ajaxUrl
,
dblFn
)
{
var
prefixUrl
=
loginContext
.
apiHost
+
constant
.
webapi
.
prefix
;
var
ajaxUrl
=
prefixUrl
+
ajaxUrl
;
var
ajaxSource
=
$
.
ajax
({
url
:
ajaxUrl
,
beforeSend
:
function
(
xhr
)
{
xhr
.
setRequestHeader
(
'Authorization'
,
tokenType
+
' '
+
apiToken
);
}
});
var
treeOptions
=
{
extensions
:
[
"edit"
,
"glyph"
,
"table"
,
"filter"
],
quicksearch
:
true
,
checkbox
:
false
,
glyph
:
glyph_opts
,
source
:
ajaxSource
,
table
:
{
checkboxColumnIdx
:
1
,
nodeColumnIdx
:
2
},
dblclick
:
function
(
event
,
data
)
{
var
node
=
data
.
node
.
data
;
var
code
=
node
.
code
;
var
name
=
node
.
fullName
;
var
acctProp
=
node
.
acctProp
;
var
direction
=
node
.
direction
;
var
hasChildren
=
node
.
hasChildren
;
if
(
code
!=
null
)
{
dblFn
(
code
,
name
,
acctProp
,
direction
);
}
},
renderColumns
:
function
(
event
,
data
)
{
var
node
=
data
.
node
,
$tdList
=
$
(
node
.
tr
).
find
(
">td"
);
$tdList
.
eq
(
3
).
text
(
!!
node
.
folder
);
},
filter
:
{
autoApply
:
true
,
// Re-apply last filter if lazy data is loaded
autoExpand
:
true
,
// Expand all branches that contain matches while filtered
counter
:
true
,
// Show a badge with number of matching child nodes near parent icons
fuzzy
:
false
,
// Match single characters in order, e.g. 'fb' will match 'FooBar'
hideExpandedCounter
:
false
,
// Hide counter badge if parent is expanded
hideExpanders
:
false
,
// Hide expanders if all child nodes are hidden by filter
highlight
:
true
,
// Highlight matches by wrapping inside <mark> tags
leavesOnly
:
false
,
// Match end nodes only
nodata
:
true
,
// Display a 'no data' status node if result is empty
mode
:
"hide"
,
// Grayout unmatched nodes (pass "hide" to remove unmatched node instead)
regularExpression
:
false
,
matchWholeBranch
:
false
}
};
///由于fancyTree第一次ajax请求加载的时候,只需要把发送ajax option即可,不需要使用callback去赋值
///但是第二次ajax请求重新渲染fancytree的话,需要ajax.done获取返回的数据并做为参数传递给fancytree去重新渲染
///所以使用了tick来判断是否是首次请求
var
tree
=
$
.
ui
.
fancytree
.
getTree
(
"#"
+
treeID
);
if
(
tree
)
{
ajaxSource
.
done
(
function
(
data
)
{
tree
.
reload
(
data
).
done
(
function
()
{
console
.
log
(
'reloaded'
);
});
}).
fail
(
function
(
err
)
{
console
.
log
(
err
);
});
}
else
{
$
(
"#"
+
treeID
).
fancytree
(
treeOptions
);
}
$
(
"input[name=fancytree-search]"
).
keyup
(
function
(
e
)
{
var
n
,
tree
=
$
.
ui
.
fancytree
.
getTree
(
"#"
+
treeID
),
opts
=
{},
filterFunc
=
tree
.
options
.
filter
.
matchWholeBranch
?
tree
.
filterBranches
:
tree
.
filterNodes
,
match
=
$
(
this
).
val
();
opts
.
nodata
=
tree
.
options
.
filter
.
nodata
;
opts
.
leavesOnly
=
tree
.
options
.
filter
.
leavesOnly
;
opts
.
highlight
=
tree
.
options
.
filter
.
highlight
;
opts
.
hideExpanders
=
tree
.
options
.
filter
.
hideExpanders
;
opts
.
fuzzy
=
tree
.
options
.
filter
.
fuzzy
;
opts
.
autoApply
=
tree
.
options
.
filter
.
autoApply
;
opts
.
mode
=
tree
.
options
.
filter
.
mode
;
opts
.
autoExpand
=
tree
.
options
.
filter
.
autoExpand
;
opts
.
counter
=
tree
.
options
.
filter
.
counter
;
if
(
e
&&
e
.
which
===
$
.
ui
.
keyCode
.
ESCAPE
||
$
.
trim
(
match
)
===
""
)
{
$
(
"input[name=fancytree-search]"
).
val
(
""
);
tree
.
clearFilter
();
return
;
}
//opts.
if
(
tree
.
options
.
filter
.
regularExpression
)
{
// Pass function to perform match
n
=
filterFunc
.
call
(
tree
,
function
(
node
)
{
return
new
RegExp
(
match
,
"i"
).
test
(
node
.
title
);
},
opts
);
}
else
{
// Pass a string to perform case insensitive matching
n
=
filterFunc
.
call
(
tree
,
match
,
opts
);
}
}).
focus
();
}
};
}]);
\ No newline at end of file
atms-web/src/main/webapp/app/framework/app-approve/app-approve.ctrl.js
View file @
1519bf01
...
...
@@ -586,9 +586,20 @@
{
caption
:
'期间'
,
width
:
'7%'
,
dataField
:
"period"
},
{
caption
:
'提审人'
,
width
:
'10%'
,
dataField
:
"createBy"
},
{
caption
:
'审批人'
,
width
:
'10%'
,
dataField
:
"approvalBy"
},
{
caption
:
'审批状态'
,
width
:
'10%'
,
dataField
:
"status"
},
{
caption
:
'审批状态'
,
width
:
'10%'
,
calculateCellValue
:
function
(
data
)
{
if
(
data
.
status
==
'disagreed'
){
return
'驳回'
;
}
else
if
(
data
.
status
==
'agreed'
){
return
'通过'
;
}
else
if
(
data
.
status
==
'committed'
){
return
'审核中'
;
}
}
},
{
caption
:
'审批意见'
,
width
:
'15%'
,
dataField
:
"approvalResult"
},
{
caption
:
'创建时间'
,
width
:
'7.5%'
,
dataField
:
"createTime"
}
{
caption
:
'提审时间'
,
width
:
'7.5%'
,
dataField
:
"createTime"
},
{
caption
:
'审批时间'
,
width
:
'7.5%'
,
dataField
:
"approvalTime"
}
],
onRowClick
:
function
(
e
)
{
$scope
.
goToService
(
e
.
data
);
...
...
@@ -602,12 +613,14 @@
$scope
.
goToService
=
function
(
approvalInfo
)
{
projectService
.
getProjectByID
(
approvalInfo
.
projectId
).
success
(
function
(
result
){
vatSessionService
.
project
=
result
;
vatSessionService
.
project
.
projectName
=
approvalInfo
.
projectName
;
vatSessionService
.
project
.
month
=
approvalInfo
.
period
;
vatSessionService
.
month
=
approvalInfo
.
period
;
vatApproveService
.
getApprovalTemplateInfo
(
approvalInfo
.
templateIds
.
split
(
","
)[
0
]).
success
(
function
(
template
){
vatSessionService
.
project
=
result
;
vatSessionService
.
project
.
projectName
=
approvalInfo
.
projectName
;
vatSessionService
.
project
.
month
=
approvalInfo
.
period
;
vatSessionService
.
month
=
approvalInfo
.
period
;
vatSessionService
.
approvalInfo
=
approvalInfo
;
$state
.
go
(
'vat.generateReport.reportView'
,
{
id
:
approvalInfo
.
reportIds
.
split
(
","
)[
0
],
templateid
:
template
.
id
,
...
...
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
1519bf01
...
...
@@ -293,9 +293,10 @@
},
1000
);
}
}).
error
(
function
()
{
$log
.
debug
(
"generate all report may be some error"
);
// taskError(_this);
}).
error
(
function
(
data
,
status
,
config
,
statusText
)
{
if
(
status
==
412
){
SweetAlert
.
error
(
'报表提审中或审核已通过!'
);
}
});
}
...
...
@@ -350,7 +351,6 @@
}
};
var
startCaculate2
=
function
()
{
if
(
vatSessionService
.
project
.
projectStatusList
[
vatSessionService
.
month
]
>=
constant
.
ProjectStatusEnum
.
Generated
)
{
swal
({
...
...
@@ -570,6 +570,8 @@
item
.
status
=
'completed'
;
if
(
$scope
.
timer
){
$interval
.
cancel
(
$scope
.
timer
);
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Generated
,
constant
.
DictionaryDictKey
.
WFDataProcess
,
enums
.
FinishStatusEnum
.
Finished
);
}
}
else
if
(
job
.
status
==
'Begin'
){
item
.
status
=
'processing'
;
...
...
@@ -587,10 +589,13 @@
updateTasksStatus
(
result
.
data
);
if
(
result
.
data
.
status
==
'Begin'
){
$scope
.
timer
=
$interval
(
function
(){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
result
.
data
.
id
).
then
(
function
(
result
){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
result
.
data
.
id
)
.
success
(
function
(
result
){
if
(
result
.
data
&&
result
.
status
==
200
){
updateTasksStatus
(
result
.
data
);
}
}).
error
(
function
(
result
){
$interval
.
cancel
(
$scope
.
timer
);
});
},
1000
);
...
...
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