Commit 781a47fe authored by 高东东's avatar 高东东

修改文件提交

parent d7fb5ebf
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
<artifactId>cxf-spring-boot-starter-jaxws</artifactId> <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.6</version> <version>3.2.6</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>indicators-feign</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
......
package com.yeejoin.amos.avic.controller; package com.yeejoin.amos.avic.controller;
import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.activation.DataHandler; import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import org.apache.cxf.endpoint.Client; import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -28,7 +28,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -28,7 +28,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.avic.face.model.AvicCustomPathModel; import com.yeejoin.amos.avic.face.model.AvicCustomPathModel;
import com.yeejoin.amos.avic.face.model.InputStreamDataSource; import com.yeejoin.amos.avic.face.model.InputStreamDataSource;
import com.yeejoin.amos.avic.face.model.UploadFileModel; import com.yeejoin.indicators.feign.IndicatorsManager;
import com.yeejoin.indicators.feign.request.DataRecordRequest;
import com.yeejoin.indicators.feign.workflow.WorkFlowFeign;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -42,12 +44,21 @@ public class WebServicesFileFransferResource { ...@@ -42,12 +44,21 @@ public class WebServicesFileFransferResource {
@Value("${avic.webservice.path}") @Value("${avic.webservice.path}")
String webserviceUrl; String webserviceUrl;
@Autowired
IndicatorsManager indicatorsManager;
@Autowired
WorkFlowFeign workFlowFeign;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "传输文件") @ApiOperation(value = "传输文件")
@RequestMapping(value = "/file", method = RequestMethod.POST) @RequestMapping(value = "/file", method = RequestMethod.POST)
public ResponseModel postfile(@RequestPart MultipartFile[] files, @RequestParam String code, @RequestParam String path ) { public ResponseModel postfile(
@RequestPart MultipartFile[] files,
@RequestParam String code,
@RequestParam String path,
@RequestParam String processDefinitionId,
@RequestParam String taskId,
@RequestParam String bizId) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(webserviceUrl); Client client = dcf.createClient(webserviceUrl);
try { try {
...@@ -64,6 +75,14 @@ public class WebServicesFileFransferResource { ...@@ -64,6 +75,14 @@ public class WebServicesFileFransferResource {
client.invoke("useCodetransferFile", handler, file.getOriginalFilename(), path, code); client.invoke("useCodetransferFile", handler, file.getOriginalFilename(), path, code);
} }
} }
List<DataRecordRequest> list = new ArrayList<>();
DataRecordRequest dataRecordRequest = new DataRecordRequest();
dataRecordRequest.put("avicCode", code);
dataRecordRequest.put("targetPath", path);
list.add(dataRecordRequest);
indicatorsManager.indicatorClient.saveBizRecord(taskId, bizId, list);
workFlowFeign.startFormByProcess(null, processDefinitionId);
} catch (java.lang.Exception e) { } catch (java.lang.Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment