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
a2da757d
Commit
a2da757d
authored
Jul 17, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add attachment file upload function -- frank
parent
22d6151f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
271 additions
and
26 deletions
+271
-26
FileExcelUtil.java
...main/java/pwc/taxtech/atms/common/util/FileExcelUtil.java
+34
-2
OrganizationHKController.java
...pwc/taxtech/atms/controller/OrganizationHKController.java
+22
-5
OrganizationHKServiceImpl.java
.../taxtech/atms/service/impl/OrganizationHKServiceImpl.java
+49
-8
conf.properties
atms-api/src/main/resources/conf/conf.properties
+2
-0
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+3
-2
conf_profile_pub.properties
atms-api/src/main/resources/conf/conf_profile_pub.properties
+4
-2
conf_profile_staging.properties
...i/src/main/resources/conf/conf_profile_staging.properties
+4
-2
conf_profile_test.properties
...-api/src/main/resources/conf/conf_profile_test.properties
+4
-2
conf_profile_uat.properties
atms-api/src/main/resources/conf/conf_profile_uat.properties
+4
-2
pom.xml
atms-dao/pom.xml
+42
-1
OrganizationAttachmentDto.java
...tech/atms/organization/dpo/OrganizationAttachmentDto.java
+17
-0
OrganizationHKDto.java
.../pwc/taxtech/atms/organization/dpo/OrganizationHKDto.java
+2
-0
UploadAttachmentDto.java
...wc/taxtech/atms/organization/dpo/UploadAttachmentDto.java
+14
-0
OrganizationAttachmentTMapper.java
...ms/organization/mapper/OrganizationAttachmentTMapper.java
+16
-0
OrganizationDirectorTMapper.java
...atms/organization/mapper/OrganizationDirectorTMapper.java
+15
-0
OrganizationHKTMapper.java
...xtech/atms/organization/mapper/OrganizationHKTMapper.java
+17
-0
OrganizationShareholderTMapper.java
...s/organization/mapper/OrganizationShareholderTMapper.java
+15
-0
organization-manage.ctrl.js
...astructure/organizationManage/organization-manage.ctrl.js
+0
-0
organizationHK.svc.js
.../main/webapp/app/common/webservices/organizationHK.svc.js
+7
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/FileExcelUtil.java
View file @
a2da757d
...
...
@@ -8,6 +8,7 @@ package pwc.taxtech.atms.common.util;
* Version 1.0
**/
import
org.apache.commons.io.IOUtils
;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.ss.usermodel.*
;
import
org.slf4j.Logger
;
...
...
@@ -128,6 +129,23 @@ public class FileExcelUtil {
}
}
public
static
void
setFileHeadInfo
(
HttpServletResponse
response
,
HttpServletRequest
request
,
String
fileName
)
{
try
{
// 获取客户端浏览器的类型
String
agent
=
request
.
getHeader
(
"User-Agent"
);
// 对文件名重新编码
String
encodingFileName
=
FileExcelUtil
.
encodeDownloadFilename
(
fileName
,
agent
);
// 告诉客户端允许断点续传多线程连接下载
response
.
setHeader
(
"Accept-Ranges"
,
"bytes"
);
//文件后缀
response
.
setContentType
(
"application/force-download"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
encodingFileName
);
}
catch
(
IOException
e
)
{
logger
.
error
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getMethodName
()
+
"发生的异常是: "
,
e
);
throw
new
RuntimeException
(
e
);
}
}
/**
* 设置下载zip的响应头信息
*
...
...
@@ -188,6 +206,20 @@ public class FileExcelUtil {
}
}
public
static
void
downloadFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
fileName
,
String
filePathToBeServed
)
{
FileExcelUtil
.
setFileHeadInfo
(
response
,
request
,
fileName
);
try
{
File
fileToDownload
=
new
File
(
filePathToBeServed
);
InputStream
inputStream
=
new
FileInputStream
(
fileToDownload
);
IOUtils
.
copy
(
inputStream
,
response
.
getOutputStream
());
response
.
flushBuffer
();
inputStream
.
close
();
}
catch
(
Exception
exception
)
{
logger
.
error
(
exception
.
getMessage
());
}
}
/**
* 生成excel到指定路径
*
...
...
@@ -277,7 +309,7 @@ public class FileExcelUtil {
public
static
void
deleteColumn
(
Sheet
sheet
,
int
columnToDelete
,
List
<
Integer
>
cols
)
{
for
(
int
rId
=
0
;
rId
<=
sheet
.
getLastRowNum
();
rId
++)
{
Row
row
=
sheet
.
getRow
(
rId
);
if
(
row
==
null
)
if
(
row
==
null
)
continue
;
for
(
int
cID
=
columnToDelete
;
cID
<=
row
.
getLastCellNum
();
cID
++)
{
Cell
cOld
=
row
.
getCell
(
cID
);
...
...
@@ -309,7 +341,7 @@ public class FileExcelUtil {
*/
public
static
void
cloneCell
(
Cell
cNew
,
Cell
cOld
)
{
try
{
if
(
cOld
==
null
||
cNew
==
null
)
if
(
cOld
==
null
||
cNew
==
null
)
return
;
cNew
.
setCellComment
(
cOld
.
getCellComment
());
cNew
.
setCellStyle
(
cOld
.
getCellStyle
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OrganizationHKController.java
View file @
a2da757d
...
...
@@ -17,6 +17,8 @@ import pwc.taxtech.atms.organization.entity.OrganizationDirector;
import
pwc.taxtech.atms.organization.entity.OrganizationShareholder
;
import
pwc.taxtech.atms.service.impl.OrganizationHKServiceImpl
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@RestController
...
...
@@ -121,7 +123,7 @@ public class OrganizationHKController {
@RequestMapping
(
value
=
"upload"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
OperationResultDto
<
Object
>
uploadOrgAttach
(
@RequestParam
(
value
=
"file"
)
CommonsMultipartFile
[]
files
,
@RequestParam
(
value
=
"entityId"
)
String
org
Id
)
{
OperationResultDto
<
Object
>
uploadOrgAttach
(
@RequestParam
(
value
=
"file"
)
CommonsMultipartFile
[]
files
,
@RequestParam
String
entity
Id
)
{
logger
.
info
(
"POST /api/v1/orgHK/upload"
);
logger
.
debug
(
"enter upload file method"
);
OperationResultDto
<
Object
>
resultDto
=
new
OperationResultDto
<>();
...
...
@@ -140,20 +142,35 @@ public class OrganizationHKController {
}
}
logger
.
debug
(
"validate entityId"
);
if
(
StringUtils
.
isEmpty
(
orgId
)
||
!
organizationHKService
.
checkOrgExist
(
org
Id
))
{
if
(
StringUtils
.
isEmpty
(
entityId
)
||
!
organizationHKService
.
checkOrgExist
(
entity
Id
))
{
resultDto
.
setResult
(
false
);
logger
.
warn
(
"organization [{}] not exist"
,
org
Id
);
resultDto
.
setResultMsg
(
"organization "
+
org
Id
+
" not exist"
);
logger
.
warn
(
"organization [{}] not exist"
,
entity
Id
);
resultDto
.
setResultMsg
(
"organization "
+
entity
Id
+
" not exist"
);
return
resultDto
;
}
logger
.
debug
(
"start upload"
);
try
{
resultDto
=
organizationHKService
.
uploadAttachs
(
files
,
org
Id
);
resultDto
=
organizationHKService
.
uploadAttachs
(
files
,
entity
Id
);
}
catch
(
ApplicationException
ex
)
{
resultDto
.
setResult
(
false
);
}
return
resultDto
;
}
@RequestMapping
(
value
=
"downloadAttachment"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
OperationResultDto
<
Object
>
downloadAttachment
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"attachmentId"
)
Long
attachmentId
)
{
logger
.
info
(
"POST /api/v1/orgHK/downloadAttachment"
);
return
organizationHKService
.
downloadAttachment
(
request
,
response
,
attachmentId
);
}
@RequestMapping
(
value
=
"deleteAttachment"
,
method
=
RequestMethod
.
DELETE
)
public
@ResponseBody
OperationResultDto
<
Object
>
deleteAttachment
(
@RequestParam
(
"attachmentId"
)
Long
attachmentId
)
{
logger
.
info
(
"POST /api/v1/orgHK/deleteAttachment"
);
return
organizationHKService
.
deleteAttachment
(
attachmentId
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationHKServiceImpl.java
View file @
a2da757d
...
...
@@ -16,6 +16,7 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
import
pwc.taxtech.atms.common.*
;
import
pwc.taxtech.atms.common.message.LogMessage
;
import
pwc.taxtech.atms.common.message.OrganizationMessage
;
import
pwc.taxtech.atms.common.util.FileExcelUtil
;
import
pwc.taxtech.atms.dto.OperationLogDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.UpdateLogParams
;
...
...
@@ -26,12 +27,19 @@ import pwc.taxtech.atms.organization.dao.OrganizationAttachmentMapper;
import
pwc.taxtech.atms.organization.dao.OrganizationDirectorMapper
;
import
pwc.taxtech.atms.organization.dao.OrganizationHKMapper
;
import
pwc.taxtech.atms.organization.dao.OrganizationShareholderMapper
;
import
pwc.taxtech.atms.organization.dpo.OrganizationAttachmentDto
;
import
pwc.taxtech.atms.organization.dpo.OrganizationDirectorDto
;
import
pwc.taxtech.atms.organization.dpo.OrganizationHKDto
;
import
pwc.taxtech.atms.organization.dpo.OrganizationShareholderDto
;
import
pwc.taxtech.atms.organization.entity.*
;
import
pwc.taxtech.atms.organization.mapper.OrganizationAttachmentTMapper
;
import
pwc.taxtech.atms.organization.mapper.OrganizationDirectorTMapper
;
import
pwc.taxtech.atms.organization.mapper.OrganizationHKTMapper
;
import
pwc.taxtech.atms.organization.mapper.OrganizationShareholderTMapper
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
...
...
@@ -74,6 +82,18 @@ public class OrganizationHKServiceImpl {
@Resource
private
OrganizationAttachmentMapper
organizationAttachmentMapper
;
@Autowired
private
OrganizationShareholderTMapper
organizationShareholderTMapper
;
@Autowired
private
OrganizationAttachmentTMapper
organizationAttachmentTMapper
;
@Autowired
private
OrganizationDirectorTMapper
organizationDirectorTMapper
;
@Autowired
private
OrganizationHKTMapper
organizationHKTMapper
;
@Value
(
"${orgaization.file.location}"
)
private
String
fileDirectory
;
...
...
@@ -82,12 +102,15 @@ public class OrganizationHKServiceImpl {
List
<
OrganizationHK
>
organizationHKS
=
organizationHKMapper
.
selectByExample
(
null
);
List
<
OrganizationShareholder
>
organizationShareholders
=
organizationShareholderMapper
.
selectByExample
(
null
);
List
<
OrganizationDirector
>
organizationDirectors
=
organizationDirectorMapper
.
selectByExample
(
null
);
List
<
OrganizationAttachment
>
organizationAttachments
=
organizationAttachmentMapper
.
selectByExample
(
null
);
organizationHKS
.
forEach
(
a
->
{
OrganizationHKDto
organizationHKDto
=
CommonUtils
.
copyProperties
(
a
,
new
OrganizationHKDto
());
List
<
OrganizationShareholderDto
>
tempShareholders
=
organizationShareholders
.
stream
().
filter
(
b
->
b
.
getEntityId
().
equals
(
a
.
getId
())).
map
(
b
->
CommonUtils
.
copyProperties
(
b
,
new
OrganizationShareholderDto
())).
collect
(
Collectors
.
toList
());
List
<
OrganizationDirectorDto
>
tempDirectors
=
organizationDirectors
.
stream
().
filter
(
c
->
c
.
getEntityId
().
equals
(
a
.
getId
())).
map
(
c
->
CommonUtils
.
copyProperties
(
c
,
new
OrganizationDirectorDto
())).
collect
(
Collectors
.
toList
());
OrganizationHKDto
organizationHKDto
=
organizationHKTMapper
.
toOrganizationHKDto
(
a
);
List
<
OrganizationShareholderDto
>
tempShareholders
=
organizationShareholders
.
stream
().
filter
(
b
->
b
.
getEntityId
().
equals
(
a
.
getId
())).
map
(
organizationShareholderTMapper:
:
toOrgShareholder
).
collect
(
Collectors
.
toList
());
List
<
OrganizationDirectorDto
>
tempDirectors
=
organizationDirectors
.
stream
().
filter
(
c
->
c
.
getEntityId
().
equals
(
a
.
getId
())).
map
(
organizationDirectorTMapper:
:
toOrganizationDirectorDto
).
collect
(
Collectors
.
toList
());
List
<
OrganizationAttachmentDto
>
tempAttachments
=
organizationAttachments
.
stream
().
filter
(
d
->
d
.
getEntityId
().
equals
(
a
.
getId
())).
map
(
organizationAttachmentTMapper:
:
toOrganizationAttachmentDto
).
collect
(
Collectors
.
toList
());
organizationHKDto
.
setShareholders
(
tempShareholders
);
organizationHKDto
.
setDirectors
(
tempDirectors
);
organizationHKDto
.
setAttachments
(
tempAttachments
);
organizationHKDtos
.
add
(
organizationHKDto
);
});
return
organizationHKDtos
;
...
...
@@ -232,8 +255,7 @@ public class OrganizationHKServiceImpl {
return
organizationDto
;
}
private
OrganizationHKDto
genarateSubOrgs
(
OrganizationHKDto
parentOrg
,
List
<
OrganizationHK
>
orgs
,
List
<
ServiceType
>
serviceList
,
Integer
useType
)
{
private
OrganizationHKDto
genarateSubOrgs
(
OrganizationHKDto
parentOrg
,
List
<
OrganizationHK
>
orgs
,
List
<
ServiceType
>
serviceList
,
Integer
useType
)
{
if
(
parentOrg
.
getParentId
()
>
0
)
{
OrganizationHK
organization
=
orgs
.
stream
().
filter
(
x
->
x
.
getId
().
equals
(
parentOrg
.
getParentId
()))
.
collect
(
Collectors
.
toList
()).
get
(
0
);
...
...
@@ -519,7 +541,7 @@ public class OrganizationHKServiceImpl {
final
String
fileNameToSave
=
(
fileNameYearMonthDay
+
"_"
+
fileNameWithoutExtension
+
"_"
+
CommonUtils
.
getUUID
().
substring
(
0
,
6
)
+
"."
+
fileExtension
).
toLowerCase
();
// relatedDirectory:相对路径目录,以/结尾
final
String
relatedDirectory
=
pathYearMonth
+
"/"
+
"organization attachments"
+
"/"
;
final
String
relatedDirectory
=
pathYearMonth
+
"/"
;
// generatedFileDirectory:绝对路径目录
final
String
generatedFileDirectory
=
fileDirectory
+
relatedDirectory
;
...
...
@@ -548,7 +570,7 @@ public class OrganizationHKServiceImpl {
result
.
setResultMsg
(
"output file is empty"
);
return
result
;
}
result
.
setData
(
organizationAttachments
);
result
.
setResult
(
true
);
logger
.
debug
(
"output file size: {}"
,
organizationAttachments
.
size
());
logger
.
debug
(
"OrganizationHKServiceImpl uploadAttachs end"
);
...
...
@@ -581,7 +603,26 @@ public class OrganizationHKServiceImpl {
throw
new
ApplicationException
(
e
.
getMessage
());
}
OperationResultDto
<
Object
>
saveResult
=
fileService
.
saveFile
(
inputStream
,
filePath
);
return
saveResult
;
}
public
OperationResultDto
<
Object
>
downloadAttachment
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Long
attachmentId
)
{
OperationResultDto
<
Object
>
resultDto
=
new
OperationResultDto
<>();
OrganizationAttachment
attachment
=
organizationAttachmentMapper
.
selectByPrimaryKey
(
attachmentId
);
Assert
.
notNull
(
attachment
,
"attachemtn is null"
);
String
fileName
=
attachment
.
getDocumentName
();
String
filePath
=
fileDirectory
+
attachment
.
getDocumentPath
();
FileExcelUtil
.
downloadFile
(
request
,
response
,
fileName
,
filePath
);
resultDto
.
setResult
(
true
);
return
resultDto
;
}
public
OperationResultDto
<
Object
>
deleteAttachment
(
Long
attachmentId
)
{
OperationResultDto
<
Object
>
resultDto
=
new
OperationResultDto
<>();
OrganizationAttachmentExample
example
=
new
OrganizationAttachmentExample
();
example
.
createCriteria
().
andIdEqualTo
(
attachmentId
);
organizationAttachmentMapper
.
deleteByExample
(
example
);
resultDto
.
setResult
(
true
);
return
resultDto
;
}
}
atms-api/src/main/resources/conf/conf.properties
View file @
a2da757d
...
...
@@ -69,3 +69,5 @@ email.store.protocol=${email.store.protocol}
email.address
=
${email.address}
email.password
=
${email.password}
email.aesKey
=
${email.aesKey}
orgaization.file.location
=
${orgaization.file.location}
atms-api/src/main/resources/conf/conf_profile_dev.properties
View file @
a2da757d
...
...
@@ -64,4 +64,6 @@ org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token
=
174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.201.201:8020/ebs-proxy-test/dts
\ No newline at end of file
ebs_call_url
=
http://172.20.201.201:8020/ebs-proxy-test/dts
orgaization.file.location
=
C:/TEMP/organization/upload
atms-api/src/main/resources/conf/conf_profile_pub.properties
View file @
a2da757d
...
...
@@ -63,4 +63,6 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.3.109:8010/ebs-proxy-test/dts
\ No newline at end of file
ebs_call_url
=
http://172.20.3.109:8010/ebs-proxy-test/dts
orgaization.file.location
=
/mnt/organization/upload/
\ No newline at end of file
atms-api/src/main/resources/conf/conf_profile_staging.properties
View file @
a2da757d
...
...
@@ -63,4 +63,6 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.3.109:8020/ebs-proxy-test/dts
\ No newline at end of file
ebs_call_url
=
http://172.20.3.109:8020/ebs-proxy-test/dts
orgaization.file.location
=
/mnt/organization/upload/
\ No newline at end of file
atms-api/src/main/resources/conf/conf_profile_test.properties
View file @
a2da757d
...
...
@@ -63,4 +63,6 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.2.220:8080/ebs-proxy-stage/dts
\ No newline at end of file
ebs_call_url
=
http://172.20.2.220:8080/ebs-proxy-stage/dts
orgaization.file.location
=
/mnt/organization/upload/
\ No newline at end of file
atms-api/src/main/resources/conf/conf_profile_uat.properties
View file @
a2da757d
...
...
@@ -64,4 +64,6 @@ org_sync_token=174af08f
dd_pubkey
=
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url
=
http://172.20.201.98:8020/ebs-proxy-test/dts
\ No newline at end of file
ebs_call_url
=
http://172.20.201.98:8020/ebs-proxy-test/dts
orgaization.file.location
=
/mnt/organization/upload/
\ No newline at end of file
atms-dao/pom.xml
View file @
a2da757d
...
...
@@ -13,6 +13,11 @@
<version>
0.1.1
</version>
</parent>
<properties>
<org.mapstruct.version>
1.3.0.Final
</org.mapstruct.version>
<lombok.version>
1.18.8
</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
@@ -95,8 +100,44 @@
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.8
</version>
<version>
${lombok.version}
</version>
<scope>
provided
</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor -->
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-jdk8
</artifactId>
<version>
${org.mapstruct.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.6.0
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<annotationProcessorPaths>
<path>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
${lombok.version}
</version>
</path>
<path>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${org.mapstruct.version}
</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins></build>
</project>
atms-dao/src/main/java/pwc/taxtech/atms/organization/dpo/OrganizationAttachmentDto.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
dpo
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
@Getter
@Setter
@ToString
public
class
OrganizationAttachmentDto
{
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
String
id
;
String
entityId
;
String
documentName
;
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/dpo/OrganizationHKDto.java
View file @
a2da757d
...
...
@@ -53,4 +53,6 @@ public class OrganizationHKDto {
private
List
<
OrganizationDirectorDto
>
directors
;
@JsonProperty
(
"shareholders"
)
private
List
<
OrganizationShareholderDto
>
shareholders
;
@JsonProperty
(
"attachments"
)
private
List
<
OrganizationAttachmentDto
>
attachments
;
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/dpo/UploadAttachmentDto.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
dpo
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
@Getter
@Setter
@ToString
public
class
UploadAttachmentDto
{
CommonsMultipartFile
[]
files
;
String
entityId
;
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/mapper/OrganizationAttachmentTMapper.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.factory.Mappers
;
import
pwc.taxtech.atms.organization.dpo.OrganizationAttachmentDto
;
import
pwc.taxtech.atms.organization.entity.OrganizationAttachment
;
@Mapper
(
componentModel
=
"spring"
)
public
interface
OrganizationAttachmentTMapper
{
OrganizationAttachmentTMapper
ORGANIZATION_ATTACHMENT_MAPPER
=
Mappers
.
getMapper
(
OrganizationAttachmentTMapper
.
class
);
@Mapping
(
source
=
"id"
,
target
=
"id"
)
OrganizationAttachmentDto
toOrganizationAttachmentDto
(
OrganizationAttachment
organizationAttachment
);
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/mapper/OrganizationDirectorTMapper.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.factory.Mappers
;
import
pwc.taxtech.atms.organization.dpo.OrganizationDirectorDto
;
import
pwc.taxtech.atms.organization.entity.OrganizationDirector
;
@Mapper
(
componentModel
=
"spring"
)
public
interface
OrganizationDirectorTMapper
{
OrganizationDirectorTMapper
ORGANIZATION_DIRECTOR_T_MAPPER
=
Mappers
.
getMapper
(
OrganizationDirectorTMapper
.
class
);
@Mapping
(
source
=
"id"
,
target
=
"id"
)
OrganizationDirectorDto
toOrganizationDirectorDto
(
OrganizationDirector
organizationDirector
);
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/mapper/OrganizationHKTMapper.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.factory.Mappers
;
import
pwc.taxtech.atms.organization.dpo.OrganizationHKDto
;
import
pwc.taxtech.atms.organization.entity.OrganizationHK
;
@Mapper
(
componentModel
=
"spring"
)
public
interface
OrganizationHKTMapper
{
OrganizationHKTMapper
ORGANIZATION_HK_MAPPER
=
Mappers
.
getMapper
(
OrganizationHKTMapper
.
class
);
@Mapping
(
source
=
"createTime"
,
target
=
"createTime"
,
dateFormat
=
"yyyy/MM/dd"
)
@Mapping
(
source
=
"updateTime"
,
target
=
"updateTime"
,
dateFormat
=
"yyyy/MM/dd"
)
@Mapping
(
source
=
"dateOfIncorporation"
,
target
=
"dateOfIncorporation"
,
dateFormat
=
"yyyy/MM/dd"
)
OrganizationHKDto
toOrganizationHKDto
(
OrganizationHK
organizationHK
);
}
atms-dao/src/main/java/pwc/taxtech/atms/organization/mapper/OrganizationShareholderTMapper.java
0 → 100644
View file @
a2da757d
package
pwc
.
taxtech
.
atms
.
organization
.
mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.factory.Mappers
;
import
pwc.taxtech.atms.organization.dpo.OrganizationShareholderDto
;
import
pwc.taxtech.atms.organization.entity.OrganizationShareholder
;
@Mapper
(
componentModel
=
"spring"
)
public
interface
OrganizationShareholderTMapper
{
OrganizationShareholderTMapper
ORGANIZATION_SHAREHOLDER_T_MAPPER
=
Mappers
.
getMapper
(
OrganizationShareholderTMapper
.
class
);
@Mapping
(
source
=
"id"
,
target
=
"id"
)
OrganizationShareholderDto
toOrgShareholder
(
OrganizationShareholder
organizationShareholder
);
}
atms-web/src/main/webapp/app/admin/infrastructure/organizationManage/organization-manage.ctrl.js
View file @
a2da757d
This diff is collapsed.
Click to expand it.
atms-web/src/main/webapp/app/common/webservices/organizationHK.svc.js
View file @
a2da757d
...
...
@@ -40,6 +40,12 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC
},
updateShareholders
:
function
(
orgShareholders
)
{
return
$http
.
post
(
'/orgHK/updateShareholders'
,
orgShareholders
,
apiConfig
.
create
());
},
attachmentDownload
:
function
(
attachmentId
)
{
return
$http
.
get
(
'/orgHK/downloadAttachment?attachmentId='
+
attachmentId
,
apiConfig
.
create
({
responseType
:
'arraybuffer'
}));
},
attachmentDelete
:
function
(
attachmentId
)
{
return
$http
.
delete
(
'/orgHK/downloadAttachment?attachmentId='
+
attachmentId
,
apiConfig
.
create
());
}
}
}]);
\ No newline at end of file
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