|
|
@@ -18,6 +18,12 @@ import javax.ws.rs.container.Suspended;
|
|
|
import javax.ws.rs.core.Context;
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
|
|
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
|
|
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
|
|
+import org.glassfish.jersey.media.multipart.FormDataParam;
|
|
|
+
|
|
|
import com.google.gson.JsonElement;
|
|
|
import com.x.base.core.project.annotation.JaxrsDescribe;
|
|
|
import com.x.base.core.project.annotation.JaxrsMethodDescribe;
|
|
|
@@ -30,12 +36,6 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
|
|
|
import com.x.base.core.project.logger.Logger;
|
|
|
import com.x.base.core.project.logger.LoggerFactory;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
|
|
-import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
|
|
-import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
|
|
-import org.glassfish.jersey.media.multipart.FormDataParam;
|
|
|
-
|
|
|
@Path("attachment")
|
|
|
@JaxrsDescribe("附件操作")
|
|
|
public class AttachmentAction extends StandardJaxrsAction {
|
|
|
@@ -85,8 +85,8 @@ public class AttachmentAction extends StandardJaxrsAction {
|
|
|
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
public void getWithWorkCompleted(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
- @JaxrsParameterDescribe("已完成工作标识") @PathParam("workCompletedId") String workCompletedId,
|
|
|
- @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
+ @JaxrsParameterDescribe("已完成工作标识") @PathParam("workCompletedId") String workCompletedId,
|
|
|
+ @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
ActionResult<ActionGetWithWorkCompleted.Wo> result = new ActionResult<>();
|
|
|
EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
try {
|
|
|
@@ -103,9 +103,10 @@ public class AttachmentAction extends StandardJaxrsAction {
|
|
|
@Path("{id}/workorworkcompleted/{workOrWorkCompleted}")
|
|
|
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
- public void getWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
- @JaxrsParameterDescribe("工作或已完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted,
|
|
|
- @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
+ public void getWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
|
|
|
+ @Context HttpServletRequest request,
|
|
|
+ @JaxrsParameterDescribe("工作或已完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted,
|
|
|
+ @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
ActionResult<ActionGetWithWorkOrWorkCompleted.Wo> result = new ActionResult<>();
|
|
|
EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
try {
|
|
|
@@ -604,7 +605,8 @@ public class AttachmentAction extends StandardJaxrsAction {
|
|
|
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
public void copyToWorkCompleted(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
- @JaxrsParameterDescribe("已完成工作标识") @PathParam("workCompletedId") String workCompletedId, JsonElement jsonElement) {
|
|
|
+ @JaxrsParameterDescribe("已完成工作标识") @PathParam("workCompletedId") String workCompletedId,
|
|
|
+ JsonElement jsonElement) {
|
|
|
ActionResult<List<ActionCopyToWorkCompleted.Wo>> result = new ActionResult<>();
|
|
|
EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
try {
|
|
|
@@ -932,6 +934,40 @@ public class AttachmentAction extends StandardJaxrsAction {
|
|
|
asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
|
|
|
}
|
|
|
|
|
|
+ @JaxrsMethodDescribe(value = "管理员角色下载附件", action = ActionManageDownload.class)
|
|
|
+ @GET
|
|
|
+ @Path("download/{id}/manage")
|
|
|
+ @Consumes(MediaType.APPLICATION_JSON)
|
|
|
+ public void manageDownload(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
+ @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
+ ActionResult<ActionManageDownload.Wo> result = new ActionResult<>();
|
|
|
+ EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
+ try {
|
|
|
+ result = new ActionManageDownload().execute(effectivePerson, id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e, effectivePerson, request, null);
|
|
|
+ result.error(e);
|
|
|
+ }
|
|
|
+ asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
|
|
|
+ }
|
|
|
+
|
|
|
+ @JaxrsMethodDescribe(value = "管理员角色下载附件,stream", action = ActionManageDownloadStream.class)
|
|
|
+ @GET
|
|
|
+ @Path("download/{id}/manage/stream")
|
|
|
+ @Consumes(MediaType.APPLICATION_JSON)
|
|
|
+ public void manageDownloadStream(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
+ @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
|
|
|
+ ActionResult<ActionManageDownloadStream.Wo> result = new ActionResult<>();
|
|
|
+ EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
+ try {
|
|
|
+ result = new ActionManageDownloadStream().execute(effectivePerson, id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e, effectivePerson, request, null);
|
|
|
+ result.error(e);
|
|
|
+ }
|
|
|
+ asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
|
|
|
+ }
|
|
|
+
|
|
|
@JaxrsMethodDescribe(value = "html转pdf工具类,转换后通过downloadTransfer接口下载", action = ActionHtmlToPdf.class)
|
|
|
@POST
|
|
|
@Path("html/to/pdf")
|