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
30f3cf35
Commit
30f3cf35
authored
Mar 30, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
4fdea1d5
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
247 additions
and
422 deletions
+247
-422
FileServiceConfig.java
...ava/pwc/taxtech/atms/common/config/FileServiceConfig.java
+7
-18
FileUploadUtil.java
...ain/java/pwc/taxtech/atms/common/util/FileUploadUtil.java
+77
-32
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+17
-0
HttpFileService.java
...n/java/pwc/taxtech/atms/service/impl/HttpFileService.java
+4
-4
TemplateGroupServiceImpl.java
...c/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
+7
-1
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+1
-1
table-report-sheet.js
...ain/webapp/app/analysis/table/sheet/table-report-sheet.js
+46
-344
tb-ebit-form.ctrl.js
...b/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
+43
-6
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+11
-14
tax-report-cell-detail-modal.html
...eport-cell-detail-modal/tax-report-cell-detail-modal.html
+1
-1
pwc-util.js
atms-web/src/main/webapp/app/common/utils/pwc-util.js
+30
-1
vatReportService.js
...rc/main/webapp/app/common/vatservices/vatReportService.js
+3
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/config/FileServiceConfig.java
View file @
30f3cf35
...
...
@@ -5,29 +5,18 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public
class
FileServiceConfig
{
@Value
(
"${file.server.url}"
)
private
String
serverUrl
;
@Value
(
"${file.server.upload}"
)
private
String
uploadUrl
;
@Value
(
"${file_upload_post_url}"
)
private
String
upload_post_url
;
public
String
getUpload_post_url
()
{
return
upload_post_url
;
}
public
void
setUpload_post_url
(
String
upload_post_url
)
{
this
.
upload_post_url
=
upload_post_url
;
}
private
String
uploadUrl
;
@Value
(
"${file_upload_query_url}"
)
private
String
downloadUrl
;
public
String
get
Server
Url
()
{
return
server
Url
;
public
String
get
Download
Url
()
{
return
download
Url
;
}
public
void
set
ServerUrl
(
String
server
Url
)
{
this
.
serverUrl
=
server
Url
;
public
void
set
DownloadUrl
(
String
download
Url
)
{
this
.
downloadUrl
=
download
Url
;
}
public
String
getUploadUrl
()
{
return
uploadUrl
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/util/FileUploadUtil.java
View file @
30f3cf35
...
...
@@ -7,9 +7,14 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpHeaders
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.entity.mime.MultipartEntityBuilder
;
import
org.apache.http.entity.mime.content.ByteArrayBody
;
import
org.apache.http.entity.mime.content.StringBody
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.slf4j.Logger
;
...
...
@@ -18,11 +23,14 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.multipart.MultipartFile
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.config.FileServiceConfig
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.security.MessageDigest
;
/**
* author kevin
...
...
@@ -34,59 +42,58 @@ public class FileUploadUtil implements ApplicationContextAware {
// Spring应用上下文环境
private
static
ApplicationContext
applicationContext
;
private
static
FileServiceConfig
config
;
private
static
final
String
USER_TEMPLATE_PATH
=
"pwc/userTemplate/"
;
private
static
final
String
HTTP_HEADER
=
"application/json;charset=UTF-8"
;
private
static
final
String
HTTP_SUCCESS_CODE
=
"200"
;
public
static
String
upload
(
MultipartFile
file
)
throws
ServiceException
{
return
upload
(
file
,
false
);
}
protected
static
char
hexDigits
[]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
public
static
String
serverPath
(
boolean
newUrl
){
config
=
(
FileServiceConfig
)
applicationContext
.
getBean
(
"fileServiceConfig"
);
if
(
newUrl
)
return
config
.
getUpload_post_url
();
return
config
.
getServerUrl
()
+
config
.
getUploadUrl
();
public
static
String
getUploadUrl
()
{
config
=
(
FileServiceConfig
)
applicationContext
.
getBean
(
"fileServiceConfig"
);
return
config
.
getUploadUrl
();
}
public
static
String
serverPath
(){
return
serverPath
(
true
);
public
static
String
downLoadUrl
()
{
config
=
(
FileServiceConfig
)
applicationContext
.
getBean
(
"fileServiceConfig"
);
return
config
.
getDownloadUrl
();
}
/**
* 上传模板
*
* @param file MultipartFile
* @param fullPath 是否返回全路径 默认false ,如果为true返回的路径直接可以用于下载
* @return Boolean
*/
public
static
String
upload
(
MultipartFile
file
,
boolean
fullPath
)
throws
ServiceException
{
public
static
String
upload
(
MultipartFile
file
,
String
fileName
)
throws
ServiceException
{
if
(
StringUtils
.
isBlank
(
file
.
getOriginalFilename
())
||
null
==
file
)
{
throw
new
IllegalArgumentException
(
"上传参数为空"
);
}
if
(
fileName
==
null
)
{
fileName
=
file
.
getOriginalFilename
();
}
CloseableHttpClient
httpClient
=
null
;
String
filePath
=
USER_TEMPLATE_PATH
+
file
.
getOriginalFilename
();
String
requestKey
=
CommonUtils
.
getUUID
();
String
requestUrl
=
getUploadUrl
()
+
"/"
+
requestKey
;
try
{
String
serverPath
=
serverPath
();
/*
String serverPath = serverPath();
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(serverPath);
httpPost
.
addHeader
(
HttpHeaders
.
CONTENT_TYPE
,
ContentType
.
APPLICATION_JSON
.
getMimeType
());
JSONObject
param
=
new
JSONObject
(
);
param
.
put
(
"path"
,
filePath
);
param
.
put
(
"file"
,
file
.
getBytes
(
));
HttpEntity
httpEntity
=
new
StringEntity
(
param
.
toJSONString
(),
ContentType
.
APPLICATION_JSON
);
httpPost.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
*/
httpClient
=
HttpClients
.
createDefault
();
HttpPost
httpPost
=
new
HttpPost
(
requestUrl
);
String
md5Str
=
getFileMD5String
(
file
);
ByteArrayBody
byteBody
=
new
ByteArrayBody
(
file
.
getBytes
(),
ContentType
.
MULTIPART_FORM_DATA
,
StringUtils
.
isBlank
(
fileName
)
?
URLEncoder
.
encode
(
file
.
getOriginalFilename
(),
"UTF-8"
)
:
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
StringBody
md5
=
new
StringBody
(
md5Str
,
ContentType
.
create
(
"text/plain"
));
HttpEntity
httpEntity
=
MultipartEntityBuilder
.
create
().
addPart
(
"filecontent"
,
byteBody
).
addPart
(
"md5"
,
md5
).
build
(
);
httpPost
.
setEntity
(
httpEntity
);
HttpResponse
httpResponse
=
httpClient
.
execute
(
httpPost
);
ApiResultDto
resultDto
=
JSON
.
parseObject
(
IOUtils
.
toString
(
httpResponse
.
getEntity
().
getContent
(),
"UTF-8"
),
ApiResultDto
.
class
);
if
(
resultDto
.
getCode
()
==
ApiResultDto
.
SUCCESS
)
{
if
(
fullPath
)
return
config
.
getServerUrl
()
+
"/"
+
filePath
;
return
filePath
;
}
JSONObject
resultDto
=
JSON
.
parseObject
(
IOUtils
.
toString
(
httpResponse
.
getEntity
().
getContent
(),
"UTF-8"
));
if
(
HTTP_SUCCESS_CODE
.
equals
(
resultDto
.
getString
(
"status_code"
)))
return
requestKey
;
return
null
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"uploadTemplate error."
,
e
);
return
null
;
}
finally
{
if
(
null
!=
httpClient
)
{
try
{
...
...
@@ -96,10 +103,23 @@ public class FileUploadUtil implements ApplicationContextAware {
}
}
}
throw
new
ServiceException
(
"uploadTemplate error."
);
}
public
static
boolean
downLoad
(
String
download_url
)
{
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
HttpGet
httpGet
=
new
HttpGet
(
downLoadUrl
()
+
"/"
+
download_url
);
HttpResponse
httpResponse
=
null
;
try
{
httpResponse
=
httpClient
.
execute
(
httpGet
);
JSONObject
resultDto
=
JSON
.
parseObject
(
IOUtils
.
toString
(
httpResponse
.
getEntity
().
getContent
(),
"UTF-8"
));
if
(
resultDto
.
getString
(
"status_code"
).
equals
(
HTTP_SUCCESS_CODE
))
return
true
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
false
;
}
/**
...
...
@@ -110,10 +130,35 @@ public class FileUploadUtil implements ApplicationContextAware {
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
{
this
.
applicationContext
=
applicationContext
;
}
/**
* @return ApplicationContext
*/
public
static
ApplicationContext
getApplicationContext
()
{
return
applicationContext
;
}
public
static
String
getFileMD5String
(
MultipartFile
file
)
throws
Exception
{
MessageDigest
messagedigest
=
MessageDigest
.
getInstance
(
"MD5"
);
messagedigest
.
update
(
file
.
getBytes
());
byte
bytes
[]
=
messagedigest
.
digest
();
return
bufferToHex
(
bytes
,
0
,
bytes
.
length
);
}
private
static
String
bufferToHex
(
byte
bytes
[],
int
m
,
int
n
)
{
StringBuffer
stringbuffer
=
new
StringBuffer
(
2
*
n
);
int
k
=
m
+
n
;
for
(
int
l
=
m
;
l
<
k
;
l
++)
{
appendHexPair
(
bytes
[
l
],
stringbuffer
);
}
return
stringbuffer
.
toString
();
}
private
static
void
appendHexPair
(
byte
bt
,
StringBuffer
stringbuffer
)
{
char
c0
=
hexDigits
[(
bt
&
0xf0
)
>>
4
];
char
c1
=
hexDigits
[
bt
&
0xf
];
stringbuffer
.
append
(
c0
);
stringbuffer
.
append
(
c1
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
30f3cf35
...
...
@@ -6,6 +6,7 @@ import org.springframework.http.MediaType;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
pwc.taxtech.atms.common.util.FileUploadUtil
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
...
...
@@ -16,6 +17,7 @@ import pwc.taxtech.atms.entity.OrganizationExample;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.ProjectExample
;
import
pwc.taxtech.atms.service.impl.DataImportService
;
import
pwc.taxtech.atms.vat.dao.PwcReportAttachMapper
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.ReportServiceImpl
;
...
...
@@ -224,6 +226,21 @@ public class ReportController {
return
reportService
.
deleteAttach
(
id
);
}
@Autowired
private
PwcReportAttachMapper
pwcReportAttachMapper
;
@RequestMapping
(
""
)
public
OperationResultDto
downLoadAttach
(
Long
id
){
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
PwcReportAttachExample
example
=
new
PwcReportAttachExample
();
PwcReportAttachExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdEqualTo
(
id
);
if
(
FileUploadUtil
.
downLoad
(
pwcReportAttachMapper
.
selectByExample
(
example
).
get
(
0
).
getFileUrl
())
==
true
){
return
operationResultDto
.
success
();
};
operationResultDto
.
setResultMsg
(
"附件导出失败"
);
return
operationResultDto
;
}
@Autowired
private
OrganizationMapper
organizationMapper
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/HttpFileService.java
View file @
30f3cf35
...
...
@@ -52,7 +52,7 @@ public class HttpFileService extends BaseService {
CloseableHttpClient
httpClient
=
null
;
String
filePath
=
USER_TEMPLATE_PATH
+
fileName
;
try
{
String
serverPath
=
config
.
get
ServerUrl
()
+
config
.
get
UploadUrl
();
String
serverPath
=
config
.
getUploadUrl
();
httpClient
=
HttpClients
.
createDefault
();
HttpPost
httpPost
=
new
HttpPost
(
serverPath
);
httpPost
.
addHeader
(
HttpHeaders
.
CONTENT_TYPE
,
ContentType
.
APPLICATION_JSON
.
getMimeType
());
...
...
@@ -68,7 +68,7 @@ public class HttpFileService extends BaseService {
ApiResultDto
resultDto
=
JSON
.
parseObject
(
IOUtils
.
toString
(
httpResponse
.
getEntity
().
getContent
(),
"UTF-8"
),
ApiResultDto
.
class
);
if
(
resultDto
.
getCode
()
==
ApiResultDto
.
SUCCESS
)
{
if
(
fullPath
){
return
config
.
get
Server
Url
()
+
"/"
+
filePath
;
return
config
.
get
Upload
Url
()
+
"/"
+
filePath
;
}
return
filePath
;
}
...
...
@@ -101,14 +101,14 @@ public class HttpFileService extends BaseService {
if
(
StringUtils
.
isBlank
(
filePath
))
{
return
null
;
}
if
(
StringUtils
.
isNotBlank
(
config
.
get
Server
Url
()))
{
if
(
StringUtils
.
isNotBlank
(
config
.
get
Download
Url
()))
{
CloseableHttpClient
client
=
HttpClients
.
createDefault
();
//先判断下是否是全域名 全域名代表是didi服务器url
String
url
;
if
(
filePath
.
indexOf
(
"http"
)>=
0
){
url
=
filePath
;
}
else
{
url
=
StringUtils
.
appendIfMissing
(
config
.
get
Server
Url
(),
"/"
)
+
filePath
;
url
=
StringUtils
.
appendIfMissing
(
config
.
get
Download
Url
(),
"/"
)
+
filePath
;
}
HttpGet
httpGet
=
new
HttpGet
(
url
);
CloseableHttpResponse
response
=
null
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
View file @
30f3cf35
...
...
@@ -238,8 +238,14 @@ public class TemplateGroupServiceImpl extends AbstractService {
ebitCellData
.
setRow
(
m
);
ebitCellData
.
setCreateTime
(
now
);
try
{
if
(
sheet
.
getRow
(
m
).
getCell
(
j
)
!=
null
)
if
(
sheet
.
getRow
(
m
).
getCell
(
j
)
!=
null
){
if
(
CellType
.
STRING
==
sheet
.
getRow
(
m
).
getCell
(
j
).
getCellTypeEnum
()){
ebitCellData
.
setData
(
sheet
.
getRow
(
m
).
getCell
(
j
).
getStringCellValue
());
}
else
if
(
CellType
.
NUMERIC
==
sheet
.
getRow
(
m
).
getCell
(
j
).
getCellTypeEnum
()){
ebitCellData
.
setData
(
String
.
valueOf
(
sheet
.
getRow
(
m
).
getCell
(
j
).
getNumericCellValue
()));
}
}
}
catch
(
Exception
e
){
//遇到空行,略过
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
30f3cf35
...
...
@@ -2096,7 +2096,7 @@ public class ReportServiceImpl extends BaseService {
fileDto
.
setRemarks
(
remarks
);
}
fileDto
.
setFileUrl
(
FileUploadUtil
.
upload
(
file
,
true
));
fileDto
.
setFileUrl
(
FileUploadUtil
.
upload
(
file
,
null
));
//绑定
fileDto
.
setSize
(
String
.
valueOf
(
file
.
getSize
()
/
1024
)
+
"KB"
);
fileDto
.
setUploadUser
(
authUserHelper
.
getCurrentAuditor
().
get
());
...
...
atms-web/src/main/webapp/app/analysis/table/sheet/table-report-sheet.js
View file @
30f3cf35
...
...
@@ -19,7 +19,7 @@
initRow
:
'=?'
,
initCol
:
'=?'
,
reportApi
:
'=?'
,
// In: onCellClick, onCellDoubleClick; Out: refreshReport,
relation
:
'='
relation
:
'='
},
link
:
function
(
scope
,
element
)
{
$log
.
debug
(
'vatReportSheet.link()...'
);
...
...
@@ -34,7 +34,7 @@
var
profileList
=
[
"EBIT考虑资产减值损失"
,
"加:特殊因素考虑"
,
"EBIT(考虑特殊因素)"
,
"EBIT rate"
,
"关联交易金额"
,
"6%增值税"
,
"价税合计金额"
];
// 首次进入页面时,通过promise模式保证在加载完成后再调用locateCell以focus在特定单元格
// 如果是在当前页面要focus在特定单元格,通过watch行列号来完成
scope
.
$watchGroup
([
'initRow'
,
'initCol'
],
function
(
newVal
,
oldVal
)
{
/*
scope.$watchGroup(['initRow', 'initCol'], function (newVal, oldVal) {
if (_.isNumber(scope.initRow) && _.isNumber(scope.initCol)) {
var spreadCtrl = getSpreadControl();
if (spreadCtrl) {
...
...
@@ -42,9 +42,9 @@
}
spreadCtrl = null;
}
});
});*/
var
locateCell
=
function
(
spread
,
forceCloseModal
)
{
/*
var locateCell = function (spread, forceCloseModal) {
if (_.isNumber(scope.initRow) && _.isNumber(scope.initCol)) {
var sheet;
if (constant.regesterInformation.active) {
...
...
@@ -72,42 +72,37 @@
sheet = null;
return $q.when();
}
};
};*/
scope
.
$watchGroup
([
'relation.period'
,
'relation.orgId'
,
'relation.data'
],
function
(
newValue
,
oldValue
)
{
if
(
scope
.
relation
.
orgId
!=
null
&&
scope
.
relation
.
period
!=
null
&&
scope
.
spread
!=
undefined
)
{
setTimeout
(
function
()
{
if
(
scope
.
relation
.
broadcast
&&
scope
.
relation
.
broadcast
==
true
)
{
scope
.
$watchGroup
([
'relation.period'
,
'relation.orgId'
,
'relation.data'
],
function
(
newValue
,
oldValue
)
{
if
(
scope
.
relation
.
orgId
!=
null
&&
scope
.
relation
.
period
!=
null
)
{
setTimeout
(
function
()
{
if
((
scope
.
relation
.
broadcast
&&
scope
.
relation
.
broadcast
==
true
)
||
scope
.
spread
!=
undefined
)
{
loadSheet
(
scope
.
templateId
,
false
)
}
else
{
loadSheet
(
scope
.
templateId
,
true
)
}
else
{
loadSheet
(
scope
.
templateId
,
true
)
;
}
},
200
);
}
});
scope
.
$watch
(
'relation.broadcast'
,
function
(
newValue
,
oldValue
)
{
if
(
scope
.
relation
.
orgId
!=
null
&&
scope
.
relation
.
period
!=
null
&&
scope
.
spread
!=
undefined
)
{
scope
.
$watch
(
'relation.broadcast'
,
function
(
newValue
,
oldValue
)
{
if
(
scope
.
relation
.
orgId
!=
null
&&
scope
.
relation
.
period
!=
null
)
{
loadSheet
(
scope
.
templateId
,
false
)
}
});
var
loadSheet
=
function
(
templateId
,
init
)
{
//var prokjectId = vatSessionService.project.id;
//var period = vatSessionService.month;
if
(
!
init
)
{
if
(
!
init
)
{
addEbitRow
();
setData
(
init
)
return
;
}
return
templateService
.
getPeriodTemplateJsonByOrg
(
templateId
,
scope
.
relation
.
period
,
scope
.
relation
.
orgId
).
then
(
function
(
reportSpread
)
{
var
spreadCtrl
=
getSpreadControl
();
if
(
spreadCtrl
)
{
spreadCtrl
.
destroy
();
}
spreadCtrl
=
null
;
if
(
!
_
.
isEmpty
(
reportSpread
))
{
initSpreadExcel
(
reportSpread
).
then
(
function
(
spread
)
{
return
locateCell
(
spread
,
true
);
/* return locateCell(spread, true);*/
});
}
},
function
(
data
)
{
...
...
@@ -150,40 +145,37 @@
if
(
sheet
!=
null
)
{
sheet
.
options
.
rowHeaderVisible
=
true
;
sheet
.
options
.
colHeaderVisible
=
true
;
sheet
.
options
.
gridline
.
showVerticalGridline
=
fals
e
;
sheet
.
options
.
gridline
.
showHorizontalGridline
=
fals
e
;
sheet
.
options
.
gridline
.
showVerticalGridline
=
tru
e
;
sheet
.
options
.
gridline
.
showHorizontalGridline
=
tru
e
;
sheet
.
options
.
isProtected
=
true
;
if
(
scope
.
isReadOnly
)
{
setEditable
(
spread
,
true
,
false
);
}
sheet
.
clearSelection
();
}
spread
.
resumePaint
();
scope
.
spread
=
spread
;
addEbitRow
(
sheet
)
if
(
scope
.
templateId
&&
scope
.
reportSource
)
{
if
(
scope
.
templateId
&&
scope
.
reportSource
)
{
setData
(
true
);
}
spread
.
resumePaint
();
return
$q
.
when
(
spread
);
};
var
addEbitRow
=
function
(
sheet
)
{
if
(
sheet
==
undefined
||
sheet
==
null
)
var
addEbitRow
=
function
(
sheet
)
{
if
(
sheet
==
undefined
||
sheet
==
null
)
sheet
=
scope
.
spread
.
getActiveSheet
();
sheet
.
setColumnWidth
(
0
,
400
)
//添加单元格
if
(
sheet
.
getRowCount
>
43
)
return
;
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
for
(
var
i
=
0
;
i
<=
7
;
i
++
)
{
for
(
var
i
=
0
;
i
<=
7
;
i
++
)
{
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
setValue
(
i
+
37
,
0
,
profileList
[
i
]);
sheet
.
setValue
(
i
+
37
,
0
,
profileList
[
i
]);
}
}
var
setEditable
=
function
(
spread
,
isReadOnly
,
ifSuspend
)
{
var
setEditable
=
function
(
spread
)
{
//todo:注册之后这里去掉注释
var
sheet
;
if
(
constant
.
regesterInformation
.
active
)
{
...
...
@@ -192,54 +184,9 @@
else
{
sheet
=
spread
.
getSheet
(
1
);
}
if
(
sheet
!=
null
)
{
if
(
ifSuspend
)
{
spread
.
suspendPaint
();
}
}
// isReadOnly为true时,设置整个sheet不可编辑
if
(
isReadOnly
)
{
for
(
var
row
=
0
;
row
<
sheet
.
getRowCount
();
row
++
)
{
for
(
var
column
=
0
;
column
<
sheet
.
getColumnCount
();
column
++
)
{
try
{
if
((
row
==
39
&&
col
==
1
)
||
(
row
==
41
&&
col
==
1
)
){
///设置指定单元格不锁定
}
else
{
sheet
.
getCell
(
row
,
column
).
locked
(
true
);
}
}
catch
(
e
)
{
}
}
}
}
else
{
// isReadOnly为false时,设置无配置单元格不可编辑,有配置单元格可编辑
for
(
var
i
=
0
;
i
<
scope
.
reportSource
.
length
;
i
++
)
{
var
cell
=
scope
.
reportSource
[
i
];
sheet
.
getCell
(
cell
.
rowIndex
,
cell
.
columnIndex
).
locked
(
false
);
}
for
(
var
x
=
0
;
x
<
sheet
.
getRowCount
();
x
++
)
{
for
(
var
y
=
0
;
y
<
sheet
.
getColumnCount
();
y
++
)
{
var
idx
=
_
.
findIndex
(
scope
.
reportSource
,
{
rowIndex
:
x
,
columnIndex
:
y
});
if
(
idx
<
0
)
{
sheet
.
getCell
(
x
,
y
).
locked
(
true
);
}
}
}
}
sheet
.
options
.
isProtected
=
true
;
sheet
.
options
.
protectionOptions
=
{
allowEditObjects
:
false
};
if
(
sheet
!=
null
)
{
if
(
ifSuspend
)
{
spread
.
resumePaint
();
for
(
var
i
=
0
;
i
<=
36
;
i
++
)
{
for
(
var
j
=
0
;
j
<=
5
;
j
++
)
{
sheet
.
getCell
(
i
,
j
).
locked
(
true
);
}
}
};
...
...
@@ -288,64 +235,10 @@
return
0
;
};
//var sumAllFunc = function () { };
//sumAllFunc.prototype = new GcSpread.Sheets.Calc.Functions.Function("_SumAll", 1, 255);
//sumAllFunc.prototype.evaluate = function (args) {
// if (args.length < 1) {
// return "";
// }
// var rtn = args[0];
// if (args.length === 1 && (_.isNull(rtn) || _.isUndefined(rtn))) {
// rtn = "";
// }
// else {
// // 下面这种奇怪的写法是为了保证在reduce过程中累计值的类型正确
// rtn = _.reduce(args.slice(1), function (memo, x) {
// return memo + x;
// }, rtn);
// }
// return rtn;
//};
spread
.
clearCustomFunctions
();
//spread.addCustomFunction(new interFunc());
activeSheet
.
addCustomFunction
(
new
manualFunc
());
//spread.addCustomFunction(new sumAllFunc());
};
var
layoutChangedFunc
=
scope
.
$on
(
enums
.
vatEvent
.
layoutChanged
,
function
()
{
repaintSpread
();
});
// TODO: 手工修改单元格值之后,更新单元格状态
var
cellValueModifiedFunc
=
$rootScope
.
$on
(
'cellValueModified'
,
function
(
event
,
args
)
{
var
modifiedReportCell
=
args
.
modifiedReportCell
;
var
cell
=
scope
.
reportSource
.
filter
(
function
(
data
)
{
return
data
.
rowIndex
===
modifiedReportCell
.
row
&&
data
.
columnIndex
===
modifiedReportCell
.
col
;
})[
0
];
cell
.
value
=
modifiedReportCell
.
value
;
cell
.
isModified
=
true
;
cell
.
modifiedReportCell
=
modifiedReportCell
;
setData
(
true
);
});
var
cellValueResetFunc
=
$rootScope
.
$on
(
'cellValueReset'
,
function
(
event
,
args
)
{
var
cell
=
scope
.
reportSource
.
filter
(
function
(
data
)
{
return
data
.
rowIndex
===
args
.
row
&&
data
.
columnIndex
===
args
.
col
;
})[
0
];
cell
.
value
=
cell
.
modifiedReportCell
?
cell
.
modifiedReportCell
.
originalValue
:
cell
.
value
;
cell
.
isModified
=
false
;
cell
.
modifiedReportCell
=
null
;
setData
(
true
);
});
scope
.
$on
(
'$destroy'
,
function
()
{
layoutChangedFunc
();
cellValueModifiedFunc
();
cellValueResetFunc
();
});
// Get spreadJS control.
var
getSpreadControl
=
function
()
{
...
...
@@ -367,148 +260,41 @@
return
elem
;
};
var
repaintSpread
=
function
()
{
return
$timeout
(
function
()
{
var
spread
=
getSpreadControl
();
if
(
spread
&&
spread
.
refresh
)
{
spread
.
refresh
();
}
},
50
);
};
// 根据已有信息通过spreadJS计算各单元格的值
var
setData
=
function
(
init
)
{
var
sheet
=
scope
.
spread
.
sheets
[
0
];
if
(
!
init
)
{
if
(
!
init
&&
scope
.
relation
.
broadcast
==
true
)
{
loadEbitCell
(
sheet
);
return
;
}
var
isExportData
=
false
;
if
(
angular
.
isArray
(
scope
.
reportSource
))
{
spreadJsTipService
.
initialize
(
sheet
);
if
(
!
scope
.
isReadOnly
)
{
//spreadJsTipService.initialize(sheet);
/*if (!scope.isReadOnly) {
setEditable(scope.spread, false, true);
}*/
scope
.
spread
.
suspendPaint
();
scope
.
relation
.
loadEbitCell
(
sheet
);
if
(
scope
.
reportSource
.
length
==
0
&&
scope
.
relation
.
emptyData
&&
scope
.
relation
.
emptyData
==
true
)
{
loadSheet
(
sheet
,
true
);
///如果没有数据,需要重新加载
setEditable
(
scope
.
spread
);
return
;
}
scope
.
reportSource
.
forEach
(
function
(
data
)
{
scope
.
relation
.
emptyData
==
true
;
//fix bug11737 导出需要显示千分位
// 避免直接使用data.value = parseFloat(data.value)导致非数字型value无法显示
data
.
value
=
PWC
.
tryParseStringToNum
(
data
.
value
);
if
(
data
.
isExportData
)
{
//导出报表时,设置单元格的公式信息
isExportData
=
true
;
if
(
data
.
isFormula
)
{
//获取单元格除公式值之外的剩余值
var
subValue
=
0
;
if
(
data
.
dataSourceList
&&
data
.
dataSourceList
.
length
>
0
)
{
data
.
dataSourceList
.
forEach
(
function
(
dataSource
)
{
var
cellName
=
PWC
.
numToExcelChar
(
dataSource
.
rowIndex
,
dataSource
.
columnIndex
);
if
(
dataSource
.
type
!=
enums
.
formulaDataSourceType
.
Report
&&
dataSource
.
amount
)
{
subValue
+=
parseFloat
(
dataSource
.
amount
+
''
);
}
});
}
sheet
.
setFormula
(
data
.
rowIndex
,
data
.
columnIndex
,
'='
+
data
.
formula
+
(
subValue
?
(
'+'
+
subValue
)
:
''
));
}
else
{
sheet
.
setValue
(
data
.
rowIndex
,
data
.
columnIndex
,
data
.
value
);
}
}
else
{
// 显示报表时,设置单元格的值或公式
var
cell
=
sheet
.
getCell
(
data
.
rowIndex
,
data
.
columnIndex
);
if
(
data
.
isModified
||
(
data
.
dataVoucherList
&&
data
.
dataVoucherList
.
length
)
||
(
data
.
dataInvoiceList
&&
data
.
dataInvoiceList
.
length
)
||
(
data
.
dataSourceList
&&
data
.
dataSourceList
.
length
&&
_
.
some
(
data
.
dataSourceList
,
function
(
dataSource
)
{
return
dataSource
.
dataSourceType
===
6
&&
dataSource
.
amount
}))
)
{
// 存在用户手工输入值,需要改变底色
cell
.
backColor
(
'#fbe8cc'
);
}
if
(
!
_
.
isEmpty
(
data
.
dataSourceList
))
{
var
reports
=
_
.
chain
(
data
.
dataSourceList
)
.
where
({
type
:
enums
.
formulaDataSourceType
.
Report
})
.
map
(
function
(
x
)
{
return
{
reportCode
:
x
.
reportCode
,
year
:
x
.
year
,
period
:
x
.
period
};
}).
uniq
(
function
(
x
)
{
return
x
.
reportCode
+
','
+
x
.
year
+
','
+
x
.
period
;
}).
value
();
if
(
reports
.
length
===
1
)
{
var
drillDownArgs
=
_
.
findWhere
(
data
.
dataSourceList
,
{
type
:
enums
.
formulaDataSourceType
.
Report
});
if
(
drillDownArgs
.
period
===
scope
.
projectPeriod
&&
drillDownArgs
.
year
===
scope
.
projectYear
)
{
// cell.textDecoration(GcSpread.Sheets.TextDecorationType.Underline);
cell
.
foreColor
(
'blue'
);
}
}
}
// 设置顺序: 非数值字符串 -> 单元格值覆盖修改 -> 公式或手工数据源 -> 数值
var
ifShowParseFloat
=
true
;
// 用于标识单元格是否设置成数值
if
(
data
.
dataSourceList
&&
data
.
dataSourceList
.
length
>
0
&&
data
.
dataSourceList
[
0
].
keyinData
){
// sheet.getCell(data.rowIndex, data.columnIndex).cellType(new GC.Spread.Sheets.CellTypes.Text());
sheet
.
setValue
(
data
.
rowIndex
,
data
.
columnIndex
,
data
.
dataSourceList
[
0
].
keyinData
+
" "
);
ifShowParseFloat
=
false
;
// 非数值字符串,单元格设置为字符串
// data.value = data.dataSourceList[0].keyinData;
}
// else if(_.isString(data.keyinData) && data.keyinData.length > 0 && isNaN(Number(data.keyinData))){
// sheet.setValue(data.rowIndex, data.columnIndex, data.keyinData);
// ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串
// data.value = data.keyinData;
// }
else
if
(
_
.
isString
(
data
.
value
)
&&
data
.
value
.
length
>
0
&&
isNaN
(
Number
(
data
.
value
)))
{
sheet
.
setValue
(
data
.
rowIndex
,
data
.
columnIndex
,
data
.
value
);
ifShowParseFloat
=
false
;
// 非数值字符串,单元格设置为字符串
}
else
if
(
data
.
isModified
)
{
// 覆盖修改,且新值是数字
//var cell = sheet.getCell(data.rowIndex, data.columnIndex);
if
(
_
.
isNumber
(
data
.
value
)
&&
!
isNaN
(
data
.
value
))
{
data
.
value
=
data
.
value
.
toFixed
(
4
);
}
sheet
.
setValue
(
data
.
rowIndex
,
data
.
columnIndex
,
data
.
value
);
ifShowParseFloat
=
false
;
// 单元格值覆盖修改
}
else
if
(
!
data
.
isReadOnly
&&
!
scope
.
isReadOnly
)
{
// 非只读report(资料清单)且非只读单元格
ifShowParseFloat
=
true
;
}
else
if
(
data
.
cellTemplateConfig
)
{
var
parsedFormula
=
data
.
cellTemplateConfig
.
parsedFormula
;
if
(
data
.
cellTemplateConfig
.
hasInvoice
||
data
.
cellTemplateConfig
.
hasKeyIn
||
data
.
cellTemplateConfig
.
hasModel
||
data
.
cellTemplateConfig
.
hasVoucher
)
{
if
(
!
_
.
isEmpty
(
parsedFormula
))
{
parsedFormula
=
parsedFormula
+
'+_Manual("'
+
data
.
cellTemplateID
+
'")'
;
}
else
{
parsedFormula
=
'_Manual("'
+
data
.
cellTemplateID
+
'")'
;
}
}
if
(
!
_
.
isEmpty
(
parsedFormula
))
{
parsedFormula
=
'IFERROR('
+
parsedFormula
+
', "")'
;
sheet
.
setFormula
(
data
.
rowIndex
,
data
.
columnIndex
,
'='
+
parsedFormula
);
ifShowParseFloat
=
false
;
// 有公式或手工数据源,单元格设置为公式
}
}
if
(
ifShowParseFloat
)
{
if
(
_
.
isNumber
(
data
.
value
)
&&
!
isNaN
(
data
.
value
))
{
data
.
value
=
data
.
value
.
toFixed
(
4
);
}
sheet
.
setValue
(
data
.
rowIndex
,
data
.
columnIndex
,
data
.
value
);
// 只有数值,设置为数值
}
}
sheet
.
setTag
(
data
.
rowIndex
,
data
.
columnIndex
,
JSON
.
stringify
(
data
));
//设置 tooltip 和 图标信息
spreadJsTipService
.
setCellTipByCellData
(
sheet
.
getCell
(
data
.
rowIndex
,
data
.
columnIndex
),
data
);
});
// 设置破折号单元格的值和显示格式,将其替换为带破折号格式的0值,这样引用到的其他单元格才能正常计算
var
rowCount
=
sheet
.
getRowCount
();
var
columnCount
=
sheet
.
getColumnCount
();
...
...
@@ -521,96 +307,12 @@
}
}
}
loadEbitCell
(
sheet
,
false
);
s
preadJsTipService
.
paintSheet
(
sheet
);
setEditable
(
scope
.
spread
);
s
cope
.
spread
.
resumePaint
(
);
}
};
//加载Ebit数据
var
loadEbitCell
=
function
(
sheet
){
for
(
var
r
=
37
;
r
<=
43
;
r
++
){
sheet
.
setFormatter
(
r
,
1
,
'# ??/??'
);
//设置格式
if
(
r
==
37
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
ebitSubtraction
));
}
if
(
r
==
38
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
specialConsiderations
));
}
if
(
r
==
39
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
specialFactors
));
}
if
(
r
==
40
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
ebitRate
));
}
if
(
r
==
41
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
transactionAmount
));
}
if
(
r
==
42
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
sixAddTa
));
}
if
(
r
==
43
){
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
totalAmountTax
));
}
}
}
// 更新数据源后,通过调用该方法计算所有当前sheet单元格,并通过比较原数据列表与spreadJS计算的新值列表,获取保存时需要修改库中Value的单元格信息列表
var
updateCells
=
function
()
{
var
sheet
=
getSpreadControl
().
sheets
[
0
];
var
cells
=
[];
var
reportDataSources
=
_
.
chain
(
scope
.
reportSource
)
.
pluck
(
'dataSourceList'
)
.
flatten
(
true
).
value
();
angular
.
forEach
(
scope
.
reportSource
,
function
(
x
)
{
// 比较刷新前后报表中的值的变化
// 优先将单元格转换成数值比较,如果不能则转换为字符串比较
var
cell
=
sheet
.
getCell
(
x
.
rowIndex
,
x
.
columnIndex
);
var
newVal
=
cell
.
value
();
newVal
=
PWC
.
tryParseStringToNum
(
newVal
);
if
(
_
.
isBoolean
(
newVal
))
{
newVal
=
newVal
.
toString
();
}
else
if
(
_
.
isNumber
(
newVal
)
&&
!
isNaN
(
newVal
))
{
newVal
=
newVal
.
toFixed
(
4
);
}
if
(
x
.
keyinData
){
sheet
.
setValue
(
x
.
rowIndex
,
x
.
columnIndex
,
x
.
keyinData
);
}
var
oldVal
=
x
.
value
;
oldVal
=
PWC
.
tryParseStringToNum
(
oldVal
);
if
(
_
.
isBoolean
(
oldVal
))
{
oldVal
=
oldVal
.
toString
();
}
else
if
(
_
.
isNumber
(
oldVal
)
&&
!
isNaN
(
oldVal
))
{
oldVal
=
oldVal
.
toFixed
(
4
);
}
if
(
newVal
!==
oldVal
)
{
cells
.
push
({
id
:
x
.
cellID
,
oldVal
:
oldVal
,
newVal
:
newVal
});
x
.
value
=
newVal
;
x
.
isDirty
=
true
;
var
dirtyDataSources
=
_
.
filter
(
reportDataSources
,
{
cellDataID
:
x
.
cellID
,
name
:
'ReportDataSource'
});
angular
.
forEach
(
dirtyDataSources
,
function
(
ds
)
{
newVal
=
PWC
.
tryParseStringToNum
(
newVal
);
ds
.
amount
=
newVal
;
});
sheet
.
setTag
(
x
.
rowIndex
,
x
.
columnIndex
,
JSON
.
stringify
(
x
));
}
});
loadSheet
(
scope
.
templateId
);
return
cells
;
};
(
function
initialize
()
{
loadSheet
(
scope
.
templateId
,
true
);
if
(
scope
.
internalApi
)
{
scope
.
internalApi
.
refreshReport
=
updateCells
;
}
})();
}
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
View file @
30f3cf35
analysisModule
.
controller
(
'tableReportSheetController'
,
[
'$scope'
,
'$rootScope'
,
'$log'
,
'$translate'
,
'$timeout'
,
'$q'
,
'$compile'
,
'$state'
,
'$stateParams'
,
'apiInterceptor'
,
'vatExportService'
,
'SweetAlert'
,
'BSPLService'
,
'vatReportService'
,
'vatReportCacheService'
,
'vatSessionService'
,
'loginContext'
,
'enums'
,
'vatCommonService'
,
'vatWorkflowService'
,
'projectService'
,
'$uibModal'
,
'$cookies'
,
'Upload'
,
'vatImportService'
,
'vatApproveService'
,
'region'
,
'loginContext'
,
'enums'
,
'vatCommonService'
,
'vatWorkflowService'
,
'projectService'
,
'$uibModal'
,
'$cookies'
,
'Upload'
,
'vatImportService'
,
'vatApproveService'
,
'region'
,
'$http'
,
function
(
$scope
,
$rootScope
,
$log
,
$translate
,
$timeout
,
$q
,
$compile
,
$state
,
$stateParams
,
apiInterceptor
,
vatExportService
,
SweetAlert
,
BSPLService
,
vatReportService
,
vatReportCacheService
,
vatSessionService
,
loginContext
,
enums
,
vatCommonService
,
vatWorkflowService
,
projectService
,
$uibModal
,
$cookies
,
Upload
,
vatImportService
,
vatApproveService
,
region
)
{
$uibModal
,
$cookies
,
Upload
,
vatImportService
,
vatApproveService
,
region
,
$http
)
{
'use strict'
;
$log
.
debug
(
'VatReportViewController.ctor()...'
);
...
...
@@ -2883,7 +2883,7 @@
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
var
mon
=
date
.
getMonth
()
+
1
;
$scope
.
selectedDate
=
new
Date
(
year
,
date
.
getMonth
()
+
1
,
1
);
$scope
.
selectedDate
=
new
Date
(
year
,
date
.
getMonth
()
,
1
);
$scope
.
startDate
=
new
Date
(
year
-
20
,
1
,
1
);
$scope
.
endDate
=
new
Date
(
year
+
20
,
1
,
1
);
var
ele1
=
$
(
"#ebitDatepacker"
);
...
...
@@ -2925,6 +2925,8 @@
}).
error
(
function
(
error
){
});
}
//将spread保存到数据库
$scope
.
$watch
(
'file'
,
function
(
file
)
{
$scope
.
upload
(
$scope
.
file
);
...
...
@@ -2952,7 +2954,6 @@
.
progress
(
function
(
evt
)
{
})
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
debugger
;
if
(
data
.
result
){
frontImport
(
file
);
//前端导入
$
(
'#busy-indicator-container'
).
hide
();
...
...
@@ -2971,6 +2972,40 @@
SweetAlert
.
error
(
status
+
"上传失败"
)
})
};
//加载Ebit数据
$scope
.
relation
.
loadEbitCell
=
function
(
sheet
)
{
if
((
$scope
.
relation
.
data
==
null
))
return
;
for
(
var
r
=
37
;
r
<=
43
;
r
++
)
{
//sheet.setFormatter(r, 1, '# ??/??');//设置格式
if
(
r
==
37
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
ebitSubtraction
!=
null
?
$scope
.
relation
.
data
.
ebitSubtraction
:
""
));
}
if
(
r
==
38
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
specialConsiderations
!=
null
?
$scope
.
relation
.
data
.
specialConsiderations
:
""
));
}
if
(
r
==
39
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
specialFactors
!=
null
?
$scope
.
relation
.
data
.
specialFactors
:
""
));
}
if
(
r
==
40
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
ebitRate
!=
null
?
$scope
.
relation
.
data
.
ebitRate
:
""
));
}
if
(
r
==
41
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
transactionAmount
!=
null
?
$scope
.
relation
.
data
.
transactionAmount
:
""
));
}
if
(
r
==
42
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
sixAddTa
!=
null
?
$scope
.
relation
.
data
.
sixAddTa
:
""
));
}
if
(
r
==
43
)
{
sheet
.
setValue
(
r
,
1
,
PWC
.
tryParseStringToNum
(
$scope
.
relation
.
data
.
totalAmountTax
!=
null
?
$scope
.
relation
.
data
.
totalAmountTax
:
""
));
}
sheet
.
setFormatter
(
r
,
1
,
'# ?/?'
);
}
}
//前端导入
var
frontImport
=
function
(
file
){
...
...
@@ -3000,7 +3035,7 @@
// here is excel IO API
excelIo
.
save
(
json
,
function
(
blob
)
{
saveAs
(
blob
,
$scope
.
relation
.
orgName
!=
undefined
?
$scope
.
relation
.
orgName
:
""
+
$scope
.
relation
.
period
+
fileName
);
saveAs
(
blob
,
(
$scope
.
relation
.
orgName
!=
undefined
?
$scope
.
relation
.
orgName
:
""
+
$scope
.
relation
.
period
)
+
fileName
);
},
function
(
e
)
{
// process error
console
.
log
(
e
);
...
...
@@ -3069,7 +3104,8 @@
searchEnabled
:
true
,
noDataText
:
$translate
.
instant
(
'RevenueNoOrgData'
),
showSelectionControls
:
false
,
onInitialized
:
function
(){
onInitialized
:
function
(
e
){
},
onItemClick
:
function
(
e
)
{
loadCellData
(
$scope
.
relation
.
period
,
e
.
itemData
.
id
,
function
(){
...
...
@@ -3079,6 +3115,7 @@
}
};
$scope
.
$watch
(
'relation._orgId'
,
function
(
n
,
o
){
if
(
n
!=
undefined
)
$scope
.
relation
.
orgId
=
n
.
pop
();
});
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
30f3cf35
...
...
@@ -2487,7 +2487,7 @@
{
caption
:
'文件名'
,
dataField
:
"fileName"
,
cellTemplate
:
function
(
container
,
options
)
{
try
{
$
(
'<a href="
'
+
options
.
data
.
fileUrl
+
'
" target="_blank" style="cursor: pointer">"'
+
options
.
data
.
fileName
+
'"</a> '
)
$
(
'<a href="
javascript:;" onClick = "downLoadAttach('
+
options
.
data
.
id
+
')
" target="_blank" style="cursor: pointer">"'
+
options
.
data
.
fileName
+
'"</a> '
)
.
appendTo
(
container
);
}
catch
(
e
)
{
...
...
@@ -2526,26 +2526,23 @@
dataSource
:
'_gridData'
}
};
window
.
downLoadAttach
=
function
(
id
){
vatReportService
.
downLoadAttach
(
id
).
success
(
function
(
res
)
{
if
(
res
.
result
){
//导出成功
}
else
{
SweetAlert
.
error
(
res
.
resultMsg
);
}
}).
error
();
}
window
.
deleteAttach
=
function
(
id
,
data
)
{
swal
({
title
:
"warning!"
,
text
:
"确定删除该附件?"
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
$translate
.
instant
(
'Yes'
),
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
function
(
tmpConfirm
)
{
PWC
.
warning
(
"警告"
,
"确定删除该附件?"
,
function
(
tmpConfirm
)
{
if
(
tmpConfirm
)
{
vatReportService
.
deleteAttach
(
id
).
success
(
function
(
res
)
{
if
(
res
.
resultMsg
==
"success"
)
{
$scope
.
loadAttach
();
}
});
}
});
}
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html
View file @
30f3cf35
...
...
@@ -23,7 +23,7 @@
<span
ng-show=
"detail.validationErrorList && detail.validationErrorList.length > 0"
ng-model=
"tabType"
uib-btn-radio=
"3"
><i
class=
"fa fa-exclamation-circle red-color"
></i>
{{'ReportCheckResult' | translate}}
</span>
<span
ng-model=
"tabType"
uib-btn-radio=
"4"
>
{{'cellComment'|translate}}
</span>
<span
ng-model=
"tabType"
uib-btn-radio=
"5"
ng-click =
"loadAttach()"
>
{{'RelatedAttach'|translate}}
</span>
<span
ng-model=
"tabType"
uib-btn-radio=
"5"
ng-click =
"loadAttach()"
>
{{'RelatedAttach'|translate}}
dsdsdsdssd
</span>
</div>
<div
class=
"content-info"
ng-show=
"tabType === 1"
>
...
...
atms-web/src/main/webapp/app/common/utils/pwc-util.js
View file @
30f3cf35
...
...
@@ -1128,7 +1128,36 @@
},
{});
}
});
}
};
PWC
.
warning
=
function
(
title
,
text
,
callback
){
swal
({
title
:
title
,
text
:
text
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
$translate
.
instant
(
'Yes'
),
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
callback
);
};
PWC
.
alert
=
function
(
title
,
text
,
callback
){
swal
({
title
:
title
,
text
:
text
,
type
:
"info"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
$translate
.
instant
(
'Yes'
),
cancelButtonText
:
$translate
.
instant
(
'No'
),
closeOnConfirm
:
true
,
closeOnCancel
:
true
},
callback
);
};
/------------------------------------------------kevin insert -----------------------------------/
...
...
atms-web/src/main/webapp/app/common/vatservices/vatReportService.js
View file @
30f3cf35
...
...
@@ -242,6 +242,9 @@
},
saveEbitModule
:
function
()
{
},
downLoadAttach
:
function
(
id
){
return
$http
.
get
(
'/Report/downLoadAttach?id='
+
id
);
}
};
...
...
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