Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
82f7792c
Commit
82f7792c
authored
Apr 19, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购砂单位系统和场站系统中使用附件,上传人需要特殊处理
parent
7ff77771
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
14 deletions
+40
-14
SandAttachmentController.java
...java/com/xyst/dinas/biz/web/SandAttachmentController.java
+20
-7
WarehouseAttachmentController.java
...com/xyst/dinas/biz/web/WarehouseAttachmentController.java
+20
-7
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/SandAttachmentController.java
View file @
82f7792c
...
...
@@ -42,6 +42,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.beecode.bap.attachment.AttachmentConstants.FileCheck
;
...
...
@@ -50,8 +52,9 @@ import com.beecode.bap.attachment.common.Utils;
import
com.beecode.bap.attachment.exception.AttachmentDataDownLoadException
;
import
com.beecode.bap.attachment.exception.AttachmentDataUploadException
;
import
com.beecode.bap.attachment.exception.AttachmentException
;
import
com.beecode.bap.attachment.internal.CreatorAdapterService
;
import
com.beecode.bap.attachment.service.AttachmentService
;
import
com.beecode.inz.basis.pojo.SandUser
;
import
com.beecode.inz.basis.service.SandUserService
;
import
com.jiuqi.np.tenant.spring.TenantRuntime
;
@RestController
...
...
@@ -72,6 +75,9 @@ public class SandAttachmentController {
@Autowired
private
AttachmentService
attachmentService
;
@Autowired
private
SandUserService
sandUserService
;
@RequestMapping
(
value
=
"files"
,
method
=
RequestMethod
.
POST
)
@Transactional
...
...
@@ -148,7 +154,7 @@ public class SandAttachmentController {
}
attachmentInfo
.
setFileType
(
Utils
.
getFileType
(
file
.
getOriginalFilename
()));
attachmentInfo
.
setSize
(
file
.
getSize
());
UUID
currentCreatorId
=
getCurrent
Creato
rId
();
UUID
currentCreatorId
=
getCurrent
SandUse
rId
();
if
(
currentCreatorId
!=
null
)
{
attachmentInfo
.
setCreatorId
(
currentCreatorId
);
}
...
...
@@ -483,15 +489,22 @@ public class SandAttachmentController {
return
false
;
}
@Autowired
private
CreatorAdapterService
creatorAdapterService
;
//
@Autowired
//
private CreatorAdapterService creatorAdapterService;
private
UUID
getCurrentCreatorId
()
{
return
creatorAdapterService
.
getCurrentCreatorId
();
// private UUID getCurrentCreatorId() {
// return creatorAdapterService.getCurrentCreatorId();
// }
private
UUID
getCurrentSandUserId
()
{
ServletRequestAttributes
attr
=
(
ServletRequestAttributes
)
RequestContextHolder
.
currentRequestAttributes
();
return
(
UUID
)
attr
.
getRequest
().
getSession
().
getAttribute
(
"userId"
);
}
private
String
getCreatorName
(
UUID
id
)
{
return
creatorAdapterService
.
getCreatorName
(
id
);
// return creatorAdapterService.getCreatorName(id);
SandUser
user
=
sandUserService
.
getById
(
id
);
return
user
.
getTitle
();
}
private
Map
<
String
,
Object
>
toMap
(
AttachmentInfo
info
)
{
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/WarehouseAttachmentController.java
View file @
82f7792c
...
...
@@ -42,6 +42,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.beecode.bap.attachment.AttachmentConstants.FileCheck
;
...
...
@@ -50,8 +52,9 @@ import com.beecode.bap.attachment.common.Utils;
import
com.beecode.bap.attachment.exception.AttachmentDataDownLoadException
;
import
com.beecode.bap.attachment.exception.AttachmentDataUploadException
;
import
com.beecode.bap.attachment.exception.AttachmentException
;
import
com.beecode.bap.attachment.internal.CreatorAdapterService
;
import
com.beecode.bap.attachment.service.AttachmentService
;
import
com.beecode.inz.basis.pojo.WarehouseUser
;
import
com.beecode.inz.basis.service.WarehouseUserService
;
import
com.jiuqi.np.tenant.spring.TenantRuntime
;
@RestController
...
...
@@ -72,6 +75,9 @@ public class WarehouseAttachmentController {
@Autowired
private
AttachmentService
attachmentService
;
@Autowired
private
WarehouseUserService
warehouseUserService
;
@RequestMapping
(
value
=
"files"
,
method
=
RequestMethod
.
POST
)
@Transactional
...
...
@@ -148,7 +154,7 @@ public class WarehouseAttachmentController {
}
attachmentInfo
.
setFileType
(
Utils
.
getFileType
(
file
.
getOriginalFilename
()));
attachmentInfo
.
setSize
(
file
.
getSize
());
UUID
currentCreatorId
=
getCurrent
Creato
rId
();
UUID
currentCreatorId
=
getCurrent
WarehouseUse
rId
();
if
(
currentCreatorId
!=
null
)
{
attachmentInfo
.
setCreatorId
(
currentCreatorId
);
}
...
...
@@ -483,15 +489,22 @@ public class WarehouseAttachmentController {
return
false
;
}
@Autowired
private
CreatorAdapterService
creatorAdapterService
;
//
@Autowired
//
private CreatorAdapterService creatorAdapterService;
private
UUID
getCurrentCreatorId
()
{
return
creatorAdapterService
.
getCurrentCreatorId
();
// private UUID getCurrentCreatorId() {
// return creatorAdapterService.getCurrentCreatorId();
// }
private
UUID
getCurrentWarehouseUserId
()
{
ServletRequestAttributes
attr
=
(
ServletRequestAttributes
)
RequestContextHolder
.
currentRequestAttributes
();
return
(
UUID
)
attr
.
getRequest
().
getSession
().
getAttribute
(
"userId"
);
}
private
String
getCreatorName
(
UUID
id
)
{
return
creatorAdapterService
.
getCreatorName
(
id
);
// return creatorAdapterService.getCreatorName(id);
WarehouseUser
user
=
warehouseUserService
.
getById
(
id
);
return
user
.
getTitle
();
}
private
Map
<
String
,
Object
>
toMap
(
AttachmentInfo
info
)
{
...
...
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