Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
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
gavelinfo
kwell-mes
Commits
12c9ac3d
Commit
12c9ac3d
authored
Apr 02, 2022
by
yff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件修改中间为工艺路线,右边为标准工序
parent
ab9c06a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
191 additions
and
0 deletions
+191
-0
BzgxFjController.java
...ain/java/com/gavel/kwell/controller/BzgxFjController.java
+95
-0
GylxFjController.java
...ain/java/com/gavel/kwell/controller/GylxFjController.java
+96
-0
No files found.
gavel/src/main/java/com/gavel/kwell/controller/BzgxFjController.java
0 → 100644
View file @
12c9ac3d
package
com
.
gavel
.
kwell
.
controller
;
import
java.io.FileInputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
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.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gavel.common.SystemOperation
;
import
com.gavel.common.annotation.ResourcePermissions
;
import
com.gavel.common.attachment.persistent.Attachment
;
import
com.gavel.common.base.controller.BaseController
;
import
com.gavel.common.utils.ThreadContext
;
import
com.gavel.gygl.service.BzgxService
;
import
com.gavel.kwell.service.GpfkfjService
;
@Controller
@RequestMapping
(
"gygl/bzgx"
)
public
class
BzgxFjController
extends
BaseController
{
private
static
final
String
ATTACHMENT_FOLDER
=
"bzgx"
;
@Autowired
private
BzgxService
bzgxService
;
@Autowired
private
GpfkfjService
gpfkfjService
;
@RequestMapping
(
value
=
"attachment/list"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
attachmentListSub
(
@RequestBody
JSONObject
param
)
{
return
buildReturnData
(
getAttachmentListSub
(
ATTACHMENT_FOLDER
,
param
),
Attachment
.
class
);
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
EDIT
})
@PostMapping
(
value
=
"attachment/upload"
)
@ResponseBody
public
Object
attachmentUpload
(
HttpServletRequest
request
,
@RequestParam
(
"groupid"
)
String
groupid
,
@RequestParam
(
"folder"
)
String
folder
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
MultiValueMap
<
String
,
MultipartFile
>
multiValueMap
=
multipartRequest
.
getMultiFileMap
();
for
(
MultipartFile
multipartFile
:
multiValueMap
.
toSingleValueMap
().
values
())
{
gpfkfjService
.
checkGxfjIfFitRule
(
multipartFile
,
getFolder
(
folder
,
ATTACHMENT_FOLDER
),
groupid
);
bzgxService
.
attachmentUpload
(
multipartFile
,
getFolder
(
folder
,
ATTACHMENT_FOLDER
),
groupid
);
}
return
ThreadContext
.
getReturnData
();
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
EDIT
})
@PostMapping
(
value
=
"attachment/upload/update"
)
@ResponseBody
public
Object
attachmentUploadUpdate
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"message"
)
String
message
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
MultiValueMap
<
String
,
MultipartFile
>
multiValueMap
=
multipartRequest
.
getMultiFileMap
();
for
(
MultipartFile
multipartFile
:
multiValueMap
.
toSingleValueMap
().
values
())
{
bzgxService
.
attachmentUploadUpdate
(
multipartFile
,
id
,
message
);
}
return
ThreadContext
.
getReturnData
();
}
@RequestMapping
(
value
=
"attachment/download/{id}"
)
public
void
attachmentDownLoad
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
id
)
{
FileInputStream
fileInputStream
=
bzgxService
.
attachmentDownload
(
id
);
doAttachmentDownLoad
(
id
,
request
,
response
,
fileInputStream
);
}
@RequestMapping
(
value
=
"attachment/preview/{id}"
)
public
void
attachmentPreview
(
HttpServletResponse
response
,
@PathVariable
String
id
)
{
FileInputStream
fileInputStream
=
bzgxService
.
attachmentDownload
(
id
);
doAttachmentPreview
(
id
,
response
,
fileInputStream
);
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
DELETE
})
@PostMapping
(
value
=
"attachment/delete"
)
@ResponseBody
public
Object
attachmentDelete
(
@RequestBody
JSONObject
param
)
{
JSONArray
idArray
=
param
.
getJSONArray
(
"id"
);
for
(
int
i
=
0
;
i
<
idArray
.
size
();
i
++)
{
String
id
=
idArray
.
getString
(
i
);
bzgxService
.
attachmentDelete
(
id
);
}
return
ThreadContext
.
getReturnData
();
}
}
gavel/src/main/java/com/gavel/kwell/controller/GylxFjController.java
0 → 100644
View file @
12c9ac3d
package
com
.
gavel
.
kwell
.
controller
;
import
java.io.FileInputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
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.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gavel.common.SystemOperation
;
import
com.gavel.common.annotation.ResourcePermissions
;
import
com.gavel.common.attachment.persistent.Attachment
;
import
com.gavel.common.base.controller.BaseController
;
import
com.gavel.common.utils.ThreadContext
;
import
com.gavel.gygl.service.GylxService
;
import
com.gavel.kwell.service.GpfkfjService
;
@Controller
@RequestMapping
(
"gygl/gylx"
)
public
class
GylxFjController
extends
BaseController
{
private
static
final
String
ATTACHMENT_FOLDER
=
"gylx"
;
@Autowired
private
GylxService
gylxService
;
@Autowired
private
GpfkfjService
gpfkfjService
;
@RequestMapping
(
value
=
"attachment/list"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
attachmentListSub
(
@RequestBody
JSONObject
param
)
{
return
buildReturnData
(
getAttachmentListSub
(
ATTACHMENT_FOLDER
,
param
),
Attachment
.
class
);
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
EDIT
})
@PostMapping
(
value
=
"attachment/upload"
)
@ResponseBody
public
Object
attachmentUpload
(
HttpServletRequest
request
,
@RequestParam
(
"groupid"
)
String
groupid
,
@RequestParam
(
"folder"
)
String
folder
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
MultiValueMap
<
String
,
MultipartFile
>
multiValueMap
=
multipartRequest
.
getMultiFileMap
();
for
(
MultipartFile
multipartFile
:
multiValueMap
.
toSingleValueMap
().
values
())
{
gpfkfjService
.
checkGxfjIfFitRule
(
multipartFile
,
getFolder
(
folder
,
ATTACHMENT_FOLDER
),
groupid
);
gylxService
.
attachmentUpload
(
multipartFile
,
getFolder
(
folder
,
ATTACHMENT_FOLDER
),
groupid
);
}
return
ThreadContext
.
getReturnData
();
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
EDIT
})
@PostMapping
(
value
=
"attachment/upload/update"
)
@ResponseBody
public
Object
attachmentUploadUpdate
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"message"
)
String
message
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
MultiValueMap
<
String
,
MultipartFile
>
multiValueMap
=
multipartRequest
.
getMultiFileMap
();
for
(
MultipartFile
multipartFile
:
multiValueMap
.
toSingleValueMap
().
values
())
{
gylxService
.
attachmentUploadUpdate
(
multipartFile
,
id
,
message
);
}
return
ThreadContext
.
getReturnData
();
}
@RequestMapping
(
value
=
"attachment/download/{id}"
)
public
void
attachmentDownLoad
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
id
)
{
FileInputStream
fileInputStream
=
gylxService
.
attachmentDownload
(
id
);
doAttachmentDownLoad
(
id
,
request
,
response
,
fileInputStream
);
}
@RequestMapping
(
value
=
"attachment/preview/{id}"
)
public
void
attachmentPreview
(
HttpServletResponse
response
,
@PathVariable
String
id
)
{
FileInputStream
fileInputStream
=
gylxService
.
attachmentDownload
(
id
);
doAttachmentPreview
(
id
,
response
,
fileInputStream
);
}
@ResourcePermissions
({
SystemOperation
.
BottonResource
.
ADD
,
SystemOperation
.
BottonResource
.
DELETE
})
@PostMapping
(
value
=
"attachment/delete"
)
@ResponseBody
public
Object
attachmentDelete
(
@RequestBody
JSONObject
param
)
{
JSONArray
idArray
=
param
.
getJSONArray
(
"id"
);
for
(
int
i
=
0
;
i
<
idArray
.
size
();
i
++)
{
String
id
=
idArray
.
getString
(
i
);
gylxService
.
attachmentDelete
(
id
);
}
return
ThreadContext
.
getReturnData
();
}
}
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