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
5ec3b11d
Commit
5ec3b11d
authored
Apr 07, 2022
by
chenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
22274799
d9b03ee7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
153 additions
and
17 deletions
+153
-17
InputStreamDataSource.java
...m/yeejoin/amos/avic/face/model/InputStreamDataSource.java
+45
-0
UploadFileModel.java
...ava/com/yeejoin/amos/avic/face/model/UploadFileModel.java
+9
-0
FileFransferService.java
...eejoin/amos/avic/face/webservice/FileFransferService.java
+13
-2
AlertFormValueMapper.xml
...zs-api/src/main/resources/mapper/AlertFormValueMapper.xml
+0
-0
AvicCustomPathResource.java
.../yeejoin/amos/avic/controller/AvicCustomPathResource.java
+4
-2
WebServicesFileFransferResource.java
...amos/avic/controller/WebServicesFileFransferResource.java
+31
-4
FileFransferServiceImpl.java
...ejoin/amos/avic/service/impl/FileFransferServiceImpl.java
+47
-5
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+1
-1
DispatchPaperServiceImpl.java
...module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
+1
-1
pom.xml
pom.xml
+2
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/InputStreamDataSource.java
0 → 100644
View file @
5ec3b11d
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
javax.activation.DataSource
;
public
class
InputStreamDataSource
implements
DataSource
{
private
InputStream
inputStream
;
public
InputStreamDataSource
(
InputStream
inputStream
)
{
this
.
inputStream
=
inputStream
;
}
@Override
public
InputStream
getInputStream
()
throws
IOException
{
return
inputStream
;
}
@Override
public
OutputStream
getOutputStream
()
throws
IOException
{
return
parse
(
inputStream
);
}
private
ByteArrayOutputStream
parse
(
final
InputStream
in
)
throws
IOException
{
final
ByteArrayOutputStream
swapStream
=
new
ByteArrayOutputStream
();
int
ch
;
while
((
ch
=
in
.
read
())
!=
-
1
)
{
swapStream
.
write
(
ch
);
}
return
swapStream
;
}
@Override
public
String
getContentType
()
{
return
"application/octet-stream"
;
}
@Override
public
String
getName
()
{
return
"InputStreamDataSource"
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/UploadFileModel.java
0 → 100644
View file @
5ec3b11d
package
com
.
yeejoin
.
amos
.
avic
.
face
.
model
;
import
lombok.Data
;
@Data
public
class
UploadFileModel
{
String
path
;
String
avicCode
;
}
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 @
5ec3b11d
...
...
@@ -2,7 +2,9 @@ package com.yeejoin.amos.avic.face.webservice;
import
javax.activation.DataHandler
;
import
javax.jws.WebMethod
;
import
javax.jws.WebParam
;
import
javax.jws.WebService
;
import
javax.xml.bind.annotation.XmlMimeType
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
...
...
@@ -17,7 +19,12 @@ public interface FileFransferService {
* @param path
*/
@WebMethod
public
void
useCodetransferFile
(
DataHandler
handler
,
String
fileName
,
String
path
,
String
code
);
public
void
useCodetransferFile
(
@WebParam
(
name
=
"dataHandler"
)
@XmlMimeType
(
value
=
"application/octet-stream"
)
DataHandler
handler
,
@WebParam
(
name
=
"fileName"
)
String
fileName
,
@WebParam
(
name
=
"path"
)
String
path
,
@WebParam
(
name
=
"code"
)
String
code
);
/**
* 传输文件
* @param handler
...
...
@@ -25,7 +32,11 @@ public interface FileFransferService {
* @param path
*/
@WebMethod
public
void
transferFile
(
DataHandler
handler
,
String
fileName
,
String
path
);
public
void
transferFile
(
@WebParam
(
name
=
"dataHandler"
)
@XmlMimeType
(
value
=
"application/octet-stream"
)
DataHandler
handler
,
@WebParam
(
name
=
"fileName"
)
String
fileName
,
@WebParam
(
name
=
"path"
)
String
path
);
/**
* 传输目录配置
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/AlertFormValueMapper.xml
View file @
5ec3b11d
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/AvicCustomPathResource.java
View file @
5ec3b11d
...
...
@@ -47,16 +47,17 @@ public class AvicCustomPathResource {
@ApiOperation
(
value
=
"创建"
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
AvicCustomPathModel
>
create
(
@RequestBody
AvicCustomPathModel
model
)
{
postConfig
(
model
);
model
=
simpleService
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
public
void
postConfig
()
{
public
void
postConfig
(
AvicCustomPathModel
model
)
{
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
try
{
// invoke("方法名",参数1,参数2,参数3....);
client
.
invoke
(
"transferPathConfig"
,
"张三"
);
client
.
invoke
(
"transferPathConfig"
,
model
);
}
catch
(
java
.
lang
.
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -68,6 +69,7 @@ public class AvicCustomPathResource {
public
ResponseModel
<
AvicCustomPathModel
>
update
(
@RequestBody
AvicCustomPathModel
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
postConfig
(
model
);
return
ResponseHelper
.
buildResponse
(
simpleService
.
updateWithModel
(
model
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/WebServicesFileFransferResource.java
View file @
5ec3b11d
package
com
.
yeejoin
.
amos
.
avic
.
controller
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.util.List
;
import
javax.activation.DataHandler
;
import
javax.activation.FileDataSource
;
import
org.apache.cxf.endpoint.Client
;
import
org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
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.RequestPart
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
...
...
@@ -16,6 +27,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.model.InputStreamDataSource
;
import
com.yeejoin.amos.avic.face.model.UploadFileModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -29,21 +42,35 @@ public class WebServicesFileFransferResource {
@Value
(
"${avic.webservice.path}"
)
String
webserviceUrl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"传输文件"
)
@RequestMapping
(
value
=
"/file"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
postfile
()
{
public
ResponseModel
postfile
(
@RequestPart
MultipartFile
[]
files
,
@RequestParam
String
code
,
@RequestParam
String
path
)
{
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
try
{
// invoke("方法名",参数1,参数2,参数3....);
client
.
invoke
(
"transferFile"
,
"张三"
);
if
(
ObjectUtils
.
isEmpty
(
code
))
{
for
(
MultipartFile
file
:
files
)
{
InputStream
is
=
file
.
getInputStream
();
DataHandler
handler
=
new
DataHandler
(
new
InputStreamDataSource
(
is
));
client
.
invoke
(
"transferFile"
,
handler
,
file
.
getOriginalFilename
(),
path
);
}
}
else
{
for
(
MultipartFile
file
:
files
)
{
InputStream
is
=
file
.
getInputStream
();
DataHandler
handler
=
new
DataHandler
(
new
InputStreamDataSource
(
is
));
client
.
invoke
(
"useCodetransferFile"
,
handler
,
file
.
getOriginalFilename
(),
path
,
code
);
}
}
}
catch
(
java
.
lang
.
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"传输目录配置"
)
@RequestMapping
(
value
=
"/config"
,
method
=
RequestMethod
.
POST
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/service/impl/FileFransferServiceImpl.java
View file @
5ec3b11d
package
com
.
yeejoin
.
amos
.
avic
.
service
.
impl
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
javax.activation.DataHandler
;
import
javax.jws.WebService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.service.AvicCustomPathService
;
import
com.yeejoin.amos.avic.face.webservice.FileFransferService
;
@WebService
(
serviceName
=
"FileFransferService"
,
...
...
@@ -17,32 +22,69 @@ import com.yeejoin.amos.avic.face.webservice.FileFransferService;
@Component
public
class
FileFransferServiceImpl
implements
FileFransferService
{
@Autowired
AvicCustomPathService
avicCustomPathService
;
@Override
public
void
useCodetransferFile
(
DataHandler
handler
,
String
fileName
,
String
path
,
String
code
)
{
saveFile
(
handler
,
fileName
,
path
);
sendEmail
(
code
,
fileName
);
}
@Override
public
void
transferFile
(
DataHandler
handler
,
String
fileName
,
String
path
)
{
private
void
saveFile
(
DataHandler
handler
,
String
fileName
,
String
path
)
{
InputStream
is
=
null
;
FileOutputStream
os
=
null
;
try
{
is
=
handler
.
getInputStream
();
File
file
=
new
File
(
String
.
format
(
"%s%s%s"
,
path
,
File
.
separator
,
fileName
));
File
dir
=
new
File
(
String
.
format
(
"%s%s"
,
path
,
File
.
separator
));
if
(!
dir
.
exists
())
{
dir
.
mkdirs
();
}
if
(!
file
.
exists
())
{
file
.
createNewFile
();
}
os
=
new
FileOutputStream
(
file
);
int
ch
;
while
((
ch
=
is
.
read
())
!=
-
1
)
{
os
.
write
(
ch
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
is
!=
null
)
{
is
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
if
(
os
!=
null
)
{
try
{
os
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
private
void
sendEmail
(
String
userCode
,
String
fileName
)
{
}
@Override
public
void
transferPathConfig
(
AvicCustomPathModel
model
)
{
public
void
transferFile
(
DataHandler
handler
,
String
fileName
,
String
path
)
{
saveFile
(
handler
,
fileName
,
path
);
}
@Override
public
void
transferPathConfig
(
AvicCustomPathModel
model
)
{
if
(
ObjectUtils
.
isEmpty
(
model
.
getSequenceNbr
()))
{
avicCustomPathService
.
createWithModel
(
model
);
}
else
{
avicCustomPathService
.
updateWithModel
(
model
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
5ec3b11d
...
...
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
...
...
@@ -30,6 +29,7 @@ import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.utils.RelationRedisUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchPaperServiceImpl.java
View file @
5ec3b11d
...
...
@@ -181,7 +181,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 根据类型创建动态表单信息
String
dynamicCode
=
DispatchPaperEnums
.
getEnumById
(
alertCode
).
getDynamicCode
();
List
<
AlertFormInitDto
>
alertFormInitDtoList
=
alertFormServiceImpl
.
getFormlist
(
dynamicCode
);
List
<
AlertFormValue
>
paperFormValuelist
=
new
ArrayList
<
AlertFormValue
>(
alertFormInitDtoList
.
size
());
List
<
AlertFormValue
>
paperFormValuelist
=
new
ArrayList
<>(
alertFormInitDtoList
.
size
());
// 填充警情主键
alertFormInitDtoList
.
stream
().
forEach
(
initDto
->
{
initDto
.
getFormItemDescr
().
setAlertCalledId
(
dispatchPaper
.
getSequenceNbr
());
...
...
pom.xml
View file @
5ec3b11d
...
...
@@ -241,12 +241,12 @@
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-generator
</artifactId>
<version>
3.
4
.0
</version>
<version>
3.
2
.0
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.
4
.0
</version>
<version>
3.
2
.0
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
...
...
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