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

修改文件提交

parent d7fb5ebf
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-biz</artifactId> <artifactId>amos-boot-module-biz</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-avic-biz</artifactId> <artifactId>amos-boot-module-avic-biz</artifactId>
<dependencies> <dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-avic-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId> <artifactId>amos-boot-module-avic-api</artifactId>
<version>3.2.6</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
</dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>indicators-feign</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
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