Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
3e75a58e
Commit
3e75a58e
authored
Apr 19, 2022
by
高东东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加西飞接口
parent
5bc6f759
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
280 additions
and
62 deletions
+280
-62
AvicCustomPathModel.java
...com/yeejoin/amos/avic/face/model/AvicCustomPathModel.java
+21
-3
FileItem.java
.../main/java/com/yeejoin/amos/avic/face/model/FileItem.java
+12
-0
TransferModel.java
.../java/com/yeejoin/amos/avic/face/model/TransferModel.java
+15
-0
AvicCustomPath.java
...com/yeejoin/amos/avic/face/orm/entity/AvicCustomPath.java
+5
-3
AvicCustomPathService.java
...yeejoin/amos/avic/face/service/AvicCustomPathService.java
+9
-7
FileFransferService.java
...eejoin/amos/avic/face/webservice/FileFransferService.java
+1
-1
pom.xml
...le/amos-boot-module-biz/amos-boot-module-avic-biz/pom.xml
+6
-0
AvicCustomPathResource.java
.../yeejoin/amos/avic/controller/AvicCustomPathResource.java
+37
-18
WebServicesFileFransferResource.java
...amos/avic/controller/WebServicesFileFransferResource.java
+164
-29
AmoAVICApplication.java
...ic/src/main/java/com/yeejoin/amos/AmoAVICApplication.java
+1
-0
application-dev.properties
...system-avic/src/main/resources/application-dev.properties
+3
-1
application.properties
...oot-system-avic/src/main/resources/application.properties
+6
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/AvicCustomPathModel.java
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
import
javax.xml.bind.annotation.XmlType
;
import
org.typroject.tyboot.core.rdbms.model.BaseModel
;
import
org.typroject.tyboot.core.rdbms.model.BaseModel
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -11,21 +19,31 @@ import lombok.EqualsAndHashCode;
...
@@ -11,21 +19,31 @@ import lombok.EqualsAndHashCode;
* @author 子杨
* @author 子杨
* @since 2022-03-28
* @since 2022-03-28
*/
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Data
public
class
AvicCustomPathModel
extends
BaseModel
{
@XmlRootElement
(
name
=
"AvicCustomPathModel"
)
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlType
(
propOrder
=
{
"id"
,
"agencyCode"
,
"pathName"
,
"path"
,
"pathDesc"
,
"sequenceNbr"
,
"recDate"
,
"recUserId"
})
public
class
AvicCustomPathModel
implements
Serializable
{
/**
/**
*
*
*/
*/
private
static
final
long
serialVersionUID
=
6756323320498708828L
;
private
static
final
long
serialVersionUID
=
6756323320498708828L
;
private
Long
sequenceNbr
;
private
Date
recDate
;
private
String
recUserId
;
private
String
agencyCode
;
private
String
agencyCode
;
private
String
pathName
;
private
String
pathName
;
private
String
path
;
private
String
path
;
/**
/**
* 分类编码
* 分类编码
*/
*/
private
String
desc
;
private
String
pathDesc
;
private
String
id
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/FileItem.java
0 → 100644
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
import
lombok.Data
;
@Data
public
class
FileItem
{
private
String
uid
;
private
String
name
;
private
String
status
;
private
String
reponse
;
private
String
url
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/TransferModel.java
0 → 100644
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
import
java.util.List
;
import
lombok.Data
;
@Data
public
class
TransferModel
extends
UploadFileModel
{
private
List
<
FileItem
>
files
;
private
String
taskId
;
private
String
bizId
;
private
String
processDefinitionId
;
private
String
result
;
private
String
comment
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/orm/entity/AvicCustomPath.java
View file @
3e75a58e
...
@@ -16,7 +16,7 @@ import lombok.EqualsAndHashCode;
...
@@ -16,7 +16,7 @@ import lombok.EqualsAndHashCode;
*/
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Data
@TableName
(
"
avic_custom_path
"
)
@TableName
(
"
idx_biz_c82t
"
)
public
class
AvicCustomPath
extends
BaseEntity
{
public
class
AvicCustomPath
extends
BaseEntity
{
...
@@ -29,7 +29,9 @@ public class AvicCustomPath extends BaseEntity {
...
@@ -29,7 +29,9 @@ public class AvicCustomPath extends BaseEntity {
/**
/**
* 分类编码
* 分类编码
*/
*/
@TableField
(
"DESC"
)
@TableField
(
"PATH_DESC"
)
private
String
desc
;
private
String
pathDesc
;
@TableField
(
"id"
)
private
String
id
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/service/AvicCustomPathService.java
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
avic
.
face
.
service
;
import
java.util.List
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.orm.dao.AvicCustomPathMapper
;
import
com.yeejoin.amos.avic.face.orm.dao.AvicCustomPathMapper
;
import
com.yeejoin.amos.avic.face.orm.entity.AvicCustomPath
;
import
com.yeejoin.amos.avic.face.orm.entity.AvicCustomPath
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -25,9 +28,10 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
...
@@ -25,9 +28,10 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
/**
/**
* 分页查询
* 分页查询
* @param string
*/
*/
public
Page
<
AvicCustomPathModel
>
queryForAvicCustomPathPage
(
Page
pag
e
,
String
agencyCode
)
{
public
Page
<
AvicCustomPathModel
>
queryForAvicCustomPathPage
(
Page
<
AvicCustomPathModel
>
page
,
@Condition
(
Operator
.
like
)
String
pathNam
e
,
String
agencyCode
)
{
return
this
.
queryForPage
(
page
,
null
,
fals
e
,
agencyCode
);
return
this
.
queryForPage
(
page
,
null
,
false
,
pathNam
e
,
agencyCode
);
}
}
/**
/**
...
@@ -36,6 +40,4 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
...
@@ -36,6 +40,4 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
public
List
<
AvicCustomPathModel
>
queryForAvicCustomPathList
(
String
agencyCode
)
{
public
List
<
AvicCustomPathModel
>
queryForAvicCustomPathList
(
String
agencyCode
)
{
return
this
.
queryForList
(
""
,
false
,
agencyCode
);
return
this
.
queryForList
(
""
,
false
,
agencyCode
);
}
}
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/webservice/FileFransferService.java
View file @
3e75a58e
...
@@ -45,5 +45,5 @@ public interface FileFransferService {
...
@@ -45,5 +45,5 @@ public interface FileFransferService {
* @param desc
* @param desc
*/
*/
@WebMethod
@WebMethod
public
void
transferPathConfig
(
AvicCustomPathModel
model
);
public
void
transferPathConfig
(
@WebParam
(
name
=
"model"
)
AvicCustomPathModel
model
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/pom.xml
View file @
3e75a58e
...
@@ -28,6 +28,12 @@
...
@@ -28,6 +28,12 @@
<artifactId>
indicators-feign
</artifactId>
<artifactId>
indicators-feign
</artifactId>
<version>
1.0.4-SNAPSHOT
</version>
<version>
1.0.4-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
1.7.4-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/AvicCustomPathResource.java
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
controller
;
package
com
.
yeejoin
.
amos
.
avic
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Arrays
;
import
com.yeejoin.amos.avic.controller.AvicCustomPathResource
;
import
java.util.Date
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.service.AvicCustomPathService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
import
org.apache.cxf.endpoint.Client
;
import
org.apache.cxf.endpoint.Client
;
import
org.apache.cxf.jaxws.JaxWsProxyFactoryBean
;
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.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
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.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.service.AvicCustomPathService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
/**
* <p>
* <p>
* 前端控制器
* 前端控制器
...
@@ -49,13 +58,20 @@ public class AvicCustomPathResource {
...
@@ -49,13 +58,20 @@ public class AvicCustomPathResource {
@ApiOperation
(
value
=
"创建"
)
@ApiOperation
(
value
=
"创建"
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
AvicCustomPathModel
>
create
(
@RequestBody
AvicCustomPathModel
model
)
{
public
ResponseModel
<
AvicCustomPathModel
>
create
(
@RequestBody
AvicCustomPathModel
model
)
{
postConfig
(
model
);
model
.
setAgencyCode
(
RequestContext
.
getAgencyCode
());
model
.
setRecDate
(
new
Date
());
model
.
setRecUserId
(
RequestContext
.
getExeUserId
());
model
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
().
getLeastSignificantBits
()));
// postConfig(model);
model
=
simpleService
.
createWithModel
(
model
);
model
=
simpleService
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
}
public
void
postConfig
(
AvicCustomPathModel
model
)
{
public
void
postConfig
(
AvicCustomPathModel
model
)
{
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
// JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
// factoryBean.setServiceClass(AvicCustomPathModel.class);
// factoryBean.setAddress(webserviceUrl);
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
try
{
try
{
client
.
invoke
(
"transferPathConfig"
,
model
);
client
.
invoke
(
"transferPathConfig"
,
model
);
...
@@ -76,9 +92,12 @@ public class AvicCustomPathResource {
...
@@ -76,9 +92,12 @@ public class AvicCustomPathResource {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除"
)
@ApiOperation
(
value
=
"删除"
)
@RequestMapping
(
value
=
"/{ids}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/{ids}"
,
method
=
RequestMethod
.
DELETE
)
public
ResponseModel
<
Boolean
>
delete
(
@PathVariable
(
value
=
"ids"
)
List
<
Long
>
ids
)
{
public
ResponseModel
<
Boolean
>
delete
(
@PathVariable
(
"ids"
)
String
[]
ids
)
{
return
ResponseHelper
.
buildResponse
(
simpleService
.
deleteBatchSeq
(
ids
));
for
(
String
id:
ids
)
{
simpleService
.
deleteBySeq
(
Long
.
parseLong
(
id
));
}
return
ResponseHelper
.
buildResponse
(
true
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -91,19 +110,19 @@ public class AvicCustomPathResource {
...
@@ -91,19 +110,19 @@ public class AvicCustomPathResource {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"分页查询"
)
@ApiOperation
(
value
=
"分页查询"
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Page
>
queryForPage
(
@RequestParam
(
value
=
"
agencyCode"
)
String
agencyCod
e
,
public
ResponseModel
<
Page
>
queryForPage
(
@RequestParam
(
value
=
"
searchValue"
)
String
pathNam
e
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
page
=
new
Page
();
Page
page
=
new
Page
();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
simpleService
.
queryForAvicCustomPathPage
(
page
,
agencyCode
));
return
ResponseHelper
.
buildResponse
(
simpleService
.
queryForAvicCustomPathPage
(
page
,
pathName
,
RequestContext
.
getAgencyCode
()
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"列表查询"
)
@ApiOperation
(
value
=
"列表查询"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
selectForList
(
@RequestParam
(
value
=
"agencyCode"
)
String
agencyCode
)
{
public
ResponseModel
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
simpleService
.
queryForAvicCustomPathList
(
agencyCode
));
return
ResponseHelper
.
buildResponse
(
simpleService
.
queryForAvicCustomPathList
(
RequestContext
.
getAgencyCode
()
));
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/WebServicesFileFransferResource.java
View file @
3e75a58e
package
com
.
yeejoin
.
amos
.
avic
.
controller
;
package
com
.
yeejoin
.
amos
.
avic
.
controller
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
javax.activation.DataHandler
;
import
javax.activation.DataHandler
;
import
javax.activation.FileDataSource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
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
;
...
@@ -12,12 +25,15 @@ import org.apache.logging.log4j.LogManager;
...
@@ -12,12 +25,15 @@ 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.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
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.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
@@ -26,10 +42,14 @@ import org.typroject.tyboot.core.restful.doc.TycloudResource;
...
@@ -26,10 +42,14 @@ import org.typroject.tyboot.core.restful.doc.TycloudResource;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
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.
TransferModel
;
import
com.yeejoin.indicators.feign.IndicatorsManager
;
import
com.yeejoin.indicators.feign.IndicatorsManager
;
import
com.yeejoin.indicators.feign.request.DataFetchRequest
;
import
com.yeejoin.indicators.feign.request.DataRecordRequest
;
import
com.yeejoin.indicators.feign.request.DataRecordRequest
;
import
com.yeejoin.indicators.feign.request.DataReportAuditRequest
;
import
com.yeejoin.indicators.feign.workflow.WorkflowManager
;
import
com.yeejoin.indicators.feign.workflow.WorkflowManager
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -43,52 +63,167 @@ public class WebServicesFileFransferResource {
...
@@ -43,52 +63,167 @@ public class WebServicesFileFransferResource {
private
final
Logger
logger
=
LogManager
.
getLogger
(
WebServicesFileFransferResource
.
class
);
private
final
Logger
logger
=
LogManager
.
getLogger
(
WebServicesFileFransferResource
.
class
);
@Value
(
"${avic.webservice.path}"
)
@Value
(
"${avic.webservice.path}"
)
String
webserviceUrl
;
String
webserviceUrl
;
@Autowired
@Autowired
IndicatorsManager
indicatorsManager
;
IndicatorsManager
indicatorsManager
;
@Autowired
@Autowired
WorkflowManager
workflowManager
;
WorkflowManager
workflowManager
;
@Value
(
value
=
"${upload.temp.dir}"
)
String
tempDir
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"传输文件"
)
@ApiOperation
(
value
=
"文件下载"
)
@RequestMapping
(
value
=
"/file"
,
method
=
RequestMethod
.
POST
)
@GetMapping
(
"/download"
)
public
ResponseModel
postfile
(
public
void
downlaodFile
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestPart
MultipartFile
[]
files
,
@RequestParam
(
"url"
)
String
path
)
{
@RequestParam
String
code
,
// 根路径加上传参数的路径构成文件路径地址
@RequestParam
String
path
,
String
realPath
=
tempDir
+
path
;
@RequestParam
String
processDefinitionId
,
File
file
=
new
File
(
realPath
);
@RequestParam
String
taskId
,
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
@RequestParam
String
bizId
)
{
InputStream
is
=
null
;
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
OutputStream
os
=
null
;
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
try
{
try
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
is
=
new
FileInputStream
(
file
);
for
(
MultipartFile
file
:
files
)
{
os
=
response
.
getOutputStream
();
InputStream
is
=
file
.
getInputStream
();
DataHandler
handler
=
new
DataHandler
(
new
InputStreamDataSource
(
is
));
for
(
int
b
=
-
1
;
(
b
=
is
.
read
())
!=
-
1
;)
{
client
.
invoke
(
"transferFile"
,
handler
,
file
.
getOriginalFilename
(),
path
);
os
.
write
(
b
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
is
!=
null
)
{
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
else
{
}
for
(
MultipartFile
file
:
files
)
{
if
(
os
!=
null
)
{
InputStream
is
=
file
.
getInputStream
();
try
{
DataHandler
handler
=
new
DataHandler
(
new
InputStreamDataSource
(
is
));
os
.
flush
();
client
.
invoke
(
"useCodetransferFile"
,
handler
,
file
.
getOriginalFilename
(),
path
,
code
);
os
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
return
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"文件上传"
)
@PostMapping
(
value
=
"/fileUpload"
)
public
ResponseModel
fileUpload
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
HttpServletRequest
request
)
throws
Exception
{
if
(
file
.
isEmpty
())
{
throw
new
Exception
(
"上传文件为空"
);
}
String
fileName
=
file
.
getOriginalFilename
();
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
String
filePath
=
tempDir
;
fileName
=
UUID
.
randomUUID
()
+
suffixName
;
File
dest
=
new
File
(
filePath
+
fileName
);
if
(!
dest
.
getParentFile
().
exists
())
{
dest
.
getParentFile
().
mkdirs
();
}
try
{
file
.
transferTo
(
dest
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
fileName
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"发起文件传输流程"
)
@RequestMapping
(
value
=
"/detail/{taskId}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
startPostfile
(
@PathVariable
(
"taskId"
)
String
taskId
)
throws
Exception
{
DataFetchRequest
request
=
new
DataFetchRequest
();
Map
<
String
,
Object
>
task
=
indicatorsManager
.
indicatorClient
.
getTaskByTaskId
(
taskId
).
getResult
();
Map
<
String
,
Object
>
bizTable
=
indicatorsManager
.
indicatorClient
.
getBizTableBySubjectId
(
task
.
get
(
"bizTableId"
).
toString
()).
getResult
();
request
.
setTaskId
(
taskId
);
request
.
setPage
(
1
);
request
.
setSize
(
20
);
request
.
setTableId
(
bizTable
.
get
(
"id"
).
toString
());
return
ResponseHelper
.
buildResponse
(
indicatorsManager
.
indicatorClient
.
queryPage
(
request
).
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"发起文件传输流程"
)
@RequestMapping
(
value
=
"/transfer"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
startPostfile
(
@RequestBody
TransferModel
transferModel
)
{
Map
<
String
,
Object
>
task
=
indicatorsManager
.
indicatorClient
.
getTaskByTaskId
(
transferModel
.
getTaskId
())
.
getResult
();
Map
<
String
,
Object
>
tmpl
=
indicatorsManager
.
indicatorClient
.
getTaskTemplateById
(
task
.
get
(
"templateId"
).
toString
()).
getResult
();
try
{
List
<
DataRecordRequest
>
list
=
new
ArrayList
<>();
List
<
DataRecordRequest
>
list
=
new
ArrayList
<>();
DataRecordRequest
dataRecordRequest
=
new
DataRecordRequest
();
DataRecordRequest
dataRecordRequest
=
new
DataRecordRequest
();
dataRecordRequest
.
put
(
"avicCode"
,
code
);
dataRecordRequest
.
put
(
"avicCode"
,
transferModel
.
getAvicCode
());
dataRecordRequest
.
put
(
"targetPath"
,
path
);
dataRecordRequest
.
put
(
"targetPath"
,
transferModel
.
getPath
());
dataRecordRequest
.
put
(
"files"
,
JSONArray
.
toJSON
(
transferModel
.
getFiles
()).
toString
());
list
.
add
(
dataRecordRequest
);
list
.
add
(
dataRecordRequest
);
indicatorsManager
.
indicatorClient
.
saveBizRecord
(
taskId
,
bizId
,
list
);
Map
<
String
,
Object
>
bizTable
=
indicatorsManager
.
indicatorClient
workflowManager
.
workflowClient
.
startFormByProcess
(
null
,
processDefinitionId
);
.
getBizTableBySubjectId
(
task
.
get
(
"bizTableId"
).
toString
()).
getResult
();
indicatorsManager
.
indicatorClient
.
saveBizRecord
(
transferModel
.
getTaskId
(),
bizTable
.
get
(
"id"
).
toString
(),
list
);
workflowManager
.
workflowClient
.
startFormByProcess
(
null
,
tmpl
.
get
(
"processDefinition"
).
toString
());
indicatorsManager
.
indicatorClient
.
adopt
(
transferModel
.
getTaskId
());
}
catch
(
java
.
lang
.
Exception
e
)
{
}
catch
(
java
.
lang
.
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"传输"
)
@RequestMapping
(
value
=
"/confirm"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
postfile
(
@RequestBody
TransferModel
transferModel
)
{
Map
<
String
,
Object
>
task
=
indicatorsManager
.
indicatorClient
.
getTaskByTaskId
(
transferModel
.
getTaskId
())
.
getResult
();
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
try
{
if
(
ObjectUtils
.
isEmpty
(
transferModel
.
getAvicCode
()))
{
for
(
String
file
:
transferModel
.
getFiles
().
stream
().
map
(
m
->
m
.
getUrl
())
.
collect
(
Collectors
.
toList
()))
{
String
filePath
=
tempDir
;
File
dest
=
new
File
(
filePath
+
file
);
DataHandler
handler
=
new
DataHandler
(
new
FileDataSource
(
dest
));
client
.
invoke
(
"transferFile"
,
handler
,
dest
.
getName
(),
transferModel
.
getPath
());
}
}
else
{
for
(
String
file
:
transferModel
.
getFiles
().
stream
().
map
(
m
->
m
.
getUrl
())
.
collect
(
Collectors
.
toList
()))
{
String
filePath
=
tempDir
;
File
dest
=
new
File
(
filePath
+
file
);
DataHandler
handler
=
new
DataHandler
(
new
FileDataSource
(
dest
));
client
.
invoke
(
"useCodetransferFile"
,
handler
,
dest
.
getName
(),
transferModel
.
getPath
(),
transferModel
.
getAvicCode
());
}
}
// JSONObject actTask = workflowManager.workflowClient.getTask(task.get("processInstanceId").toString());
// workflowManager.workflowClient.pickupAndCompleteTask(actTask.getJSONObject("data").getString("id"), new HashMap<>());
DataReportAuditRequest
dataReportAuditRequest
=
new
DataReportAuditRequest
();
dataReportAuditRequest
.
setTaskId
(
transferModel
.
getTaskId
());
dataReportAuditRequest
.
setInstanceId
(
task
.
get
(
"processInstanceId"
).
toString
());
dataReportAuditRequest
.
setRemark
(
transferModel
.
getComment
());
dataReportAuditRequest
.
setCondition
(
"0"
);
indicatorsManager
.
indicatorClient
.
auditWorkFlow
(
dataReportAuditRequest
);
}
catch
(
java
.
lang
.
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"传输目录配置"
)
@ApiOperation
(
value
=
"传输目录配置"
)
...
...
amos-boot-system-avic/src/main/java/com/yeejoin/amos/AmoAVICApplication.java
View file @
3e75a58e
package
com
.
yeejoin
.
amos
;
package
com
.
yeejoin
.
amos
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
...
amos-boot-system-avic/src/main/resources/application-dev.properties
View file @
3e75a58e
## DB properties:
## DB properties:
spring.datasource.url
=
jdbc:mysql://172.16.3.18:3306/amos_
avic
_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://172.16.3.18:3306/amos_
idx
_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.password
=
Yeejoin@2020
## eureka properties:
## eureka properties:
...
@@ -11,4 +11,5 @@ spring.redis.host=172.16.3.18
...
@@ -11,4 +11,5 @@ spring.redis.host=172.16.3.18
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.redis.password
=
yeejoin@2020
upload.temp.dir
=
E:
\\
ftp
\\
avic.webservice.path
=
http://localhost:8808/avic/services/fileFransfer?wsdl
avic.webservice.path
=
http://localhost:8808/avic/services/fileFransfer?wsdl
\ No newline at end of file
amos-boot-system-avic/src/main/resources/application.properties
View file @
3e75a58e
...
@@ -39,3 +39,8 @@ spring.redis.lettuce.pool.max-idle=10
...
@@ -39,3 +39,8 @@ spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.lettuce.pool.min-idle
=
0
## redis失效时间
## redis失效时间
redis.cache.failure.time
=
10800
redis.cache.failure.time
=
10800
spring.servlet.multipart.maxFileSize
=
100MB
spring.servlet.multipart.maxRequestSize
=
100MB
spring.main.allow-bean-definition-overriding
=
true
\ No newline at end of file
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