Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
customer-service
Commits
2734290c
Commit
2734290c
authored
May 28, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
word转pdf异步模式bug对应、linux中文乱码问题对应
parent
424a169e
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
187 additions
and
91 deletions
+187
-91
BaseDataComponent.java
.../freight/customer/common/component/BaseDataComponent.java
+1
-1
RestLogFilter.java
...com/esv/freight/customer/common/filter/RestLogFilter.java
+3
-3
ReqUtils.java
...n/java/com/esv/freight/customer/common/util/ReqUtils.java
+3
-0
CarrierAccountServiceImpl.java
...odule/carrier/service/impl/CarrierAccountServiceImpl.java
+3
-2
PdfService.java
.../freight/customer/module/contract/service/PdfService.java
+24
-0
ContractOnlineRecordServiceImpl.java
...ontract/service/impl/ContractOnlineRecordServiceImpl.java
+22
-79
PdfServiceImpl.java
...customer/module/contract/service/impl/PdfServiceImpl.java
+105
-0
DriverAccountServiceImpl.java
.../module/driver/service/impl/DriverAccountServiceImpl.java
+1
-1
DriverVehicleServiceImpl.java
.../module/driver/service/impl/DriverVehicleServiceImpl.java
+2
-0
AccountAndAddressServiceIpml.java
...goodsowner/service/impl/AccountAndAddressServiceIpml.java
+2
-0
DeliveryAddressServiceImpl.java
...e/goodsowner/service/impl/DeliveryAddressServiceImpl.java
+3
-1
GoodsOwnerAccountServiceImpl.java
...goodsowner/service/impl/GoodsOwnerAccountServiceImpl.java
+4
-2
ReceiveAddressServiceImpl.java
...le/goodsowner/service/impl/ReceiveAddressServiceImpl.java
+3
-1
RegularlyRouteServiceImpl.java
...le/goodsowner/service/impl/RegularlyRouteServiceImpl.java
+3
-1
VehicleServiceImpl.java
...tomer/module/vehicle/service/impl/VehicleServiceImpl.java
+2
-0
application-dev.yml
src/main/resources/application-dev.yml
+3
-0
application-test.yml
src/main/resources/application-test.yml
+3
-0
No files found.
src/main/java/com/esv/freight/customer/common/component/BaseDataComponent.java
View file @
2734290c
...
@@ -56,7 +56,7 @@ public class BaseDataComponent {
...
@@ -56,7 +56,7 @@ public class BaseDataComponent {
redisComponent
.
set
(
this
.
getAllRegionMapCacheKey
(),
allRegionMap
.
toJSONString
(),
ALL_REGION_MAP_CACHE_TIME
);
redisComponent
.
set
(
this
.
getAllRegionMapCacheKey
(),
allRegionMap
.
toJSONString
(),
ALL_REGION_MAP_CACHE_TIME
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]获取全国省市行政区划(键值对)失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]获取全国省市行政区划(键值对)失败:
{}"
,
e
.
getMessage
(),
e
);
}
}
}
}
...
...
src/main/java/com/esv/freight/customer/common/filter/RestLogFilter.java
View file @
2734290c
...
@@ -84,20 +84,20 @@ public class RestLogFilter implements Filter {
...
@@ -84,20 +84,20 @@ public class RestLogFilter implements Filter {
bodyStr
=
sb
.
toString
();
bodyStr
=
sb
.
toString
();
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"解析post参数时发生错误:{}"
,
e
.
getMessage
());
log
.
error
(
"解析post参数时发生错误:{}"
,
e
.
getMessage
()
,
e
);
}
finally
{
}
finally
{
if
(
inputStream
!=
null
)
{
if
(
inputStream
!=
null
)
{
try
{
try
{
inputStream
.
close
();
inputStream
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
if
(
reader
!=
null
)
{
if
(
reader
!=
null
)
{
try
{
try
{
reader
.
close
();
reader
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
}
}
...
...
src/main/java/com/esv/freight/customer/common/util/ReqUtils.java
View file @
2734290c
...
@@ -22,6 +22,9 @@ public class ReqUtils {
...
@@ -22,6 +22,9 @@ public class ReqUtils {
public
static
String
getRequestHeader
(
String
headerKey
)
{
public
static
String
getRequestHeader
(
String
headerKey
)
{
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
null
==
servletRequestAttributes
)
{
return
null
;
}
HttpServletRequest
request
=
servletRequestAttributes
.
getRequest
();
HttpServletRequest
request
=
servletRequestAttributes
.
getRequest
();
return
request
.
getHeader
(
headerKey
);
return
request
.
getHeader
(
headerKey
);
}
}
...
...
src/main/java/com/esv/freight/customer/module/carrier/service/impl/CarrierAccountServiceImpl.java
View file @
2734290c
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.carrier.form.CarrierQueryForm;
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.carrier.form.CarrierQueryForm;
import
com.esv.freight.customer.module.carrier.service.CarrierAccountService
;
import
com.esv.freight.customer.module.carrier.service.CarrierAccountService
;
import
com.esv.freight.customer.module.carrier.service.CarrierInfoService
;
import
com.esv.freight.customer.module.carrier.service.CarrierInfoService
;
import
com.esv.freight.customer.module.carrier.vo.CarrierInfoListVO
;
import
com.esv.freight.customer.module.carrier.vo.CarrierInfoListVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -29,7 +30,7 @@ import org.springframework.stereotype.Service;
...
@@ -29,7 +30,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Service
(
"carrierAccountService"
)
@Service
(
"carrierAccountService"
)
public
class
CarrierAccountServiceImpl
extends
ServiceImpl
<
CarrierAccountDao
,
CarrierAccountEntity
>
implements
CarrierAccountService
{
public
class
CarrierAccountServiceImpl
extends
ServiceImpl
<
CarrierAccountDao
,
CarrierAccountEntity
>
implements
CarrierAccountService
{
...
@@ -103,7 +104,7 @@ public class CarrierAccountServiceImpl extends ServiceImpl<CarrierAccountDao, Ca
...
@@ -103,7 +104,7 @@ public class CarrierAccountServiceImpl extends ServiceImpl<CarrierAccountDao, Ca
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成承运商编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]生成承运商编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成承运商编号时发生错误"
);
throw
new
EException
(
"生成承运商编号时发生错误"
);
}
}
String
carrierNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
carrierNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
...
src/main/java/com/esv/freight/customer/module/contract/service/PdfService.java
0 → 100644
View file @
2734290c
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
;
import
com.esv.freight.customer.module.contract.entity.ContractOnlineRecordEntity
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.service.PdfService
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/28 20:16
* @version:1.0
*/
public
interface
PdfService
{
/**
* description 异步保存线上合同目标文件(PDF)及信息
* param [traceId, entity, fileBytes]
* return void
* author HuangChaobin
* createTime 2020/05/28 20:17
**/
public
void
asyncSaveTargetFileInfo
(
String
traceId
,
ContractOnlineRecordEntity
entity
,
byte
[]
fileBytes
);
}
src/main/java/com/esv/freight/customer/module/contract/service/impl/ContractOnlineRecordServiceImpl.java
View file @
2734290c
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
.
impl
;
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.Document
;
import
com.aspose.words.SaveFormat
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -11,7 +9,6 @@ import com.deepoove.poi.XWPFTemplate;
...
@@ -11,7 +9,6 @@ import com.deepoove.poi.XWPFTemplate;
import
com.deepoove.poi.data.PictureRenderData
;
import
com.deepoove.poi.data.PictureRenderData
;
import
com.esv.freight.customer.common.component.ErrorMessageComponent
;
import
com.esv.freight.customer.common.component.ErrorMessageComponent
;
import
com.esv.freight.customer.common.component.RedisComponent
;
import
com.esv.freight.customer.common.component.RedisComponent
;
import
com.esv.freight.customer.common.constants.CommonConstants
;
import
com.esv.freight.customer.common.exception.EException
;
import
com.esv.freight.customer.common.exception.EException
;
import
com.esv.freight.customer.common.response.ECode
;
import
com.esv.freight.customer.common.response.ECode
;
import
com.esv.freight.customer.common.util.DateUtils
;
import
com.esv.freight.customer.common.util.DateUtils
;
...
@@ -35,6 +32,7 @@ import com.esv.freight.customer.module.contract.pojo.ContractOnlinePlatformPojo;
...
@@ -35,6 +32,7 @@ import com.esv.freight.customer.module.contract.pojo.ContractOnlinePlatformPojo;
import
com.esv.freight.customer.module.contract.service.ContractOnlinePlatformDataService
;
import
com.esv.freight.customer.module.contract.service.ContractOnlinePlatformDataService
;
import
com.esv.freight.customer.module.contract.service.ContractOnlineRecordService
;
import
com.esv.freight.customer.module.contract.service.ContractOnlineRecordService
;
import
com.esv.freight.customer.module.contract.service.ContractOnlineTemplateService
;
import
com.esv.freight.customer.module.contract.service.ContractOnlineTemplateService
;
import
com.esv.freight.customer.module.contract.service.PdfService
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordListVO
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordListVO
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordSignDriverVO
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordSignDriverVO
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordSignGoodsOwnerVO
;
import
com.esv.freight.customer.module.contract.vo.ContractOnlineRecordSignGoodsOwnerVO
;
...
@@ -52,14 +50,15 @@ import org.slf4j.MDC;
...
@@ -52,14 +50,15 @@ import org.slf4j.MDC;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
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.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Base64
;
import
java.util.Date
;
import
java.util.List
;
@Service
(
"contractOnlineRecordService"
)
@Service
(
"contractOnlineRecordService"
)
...
@@ -92,6 +91,9 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -92,6 +91,9 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
private
DriverAccountService
driverAccountService
;
private
DriverAccountService
driverAccountService
;
private
ContractOnlinePlatformDataService
contractOnlinePlatformDataService
;
private
ContractOnlinePlatformDataService
contractOnlinePlatformDataService
;
@Autowired
private
PdfService
pdfService
;
@Autowired
@Autowired
public
ContractOnlineRecordServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
FeignFileService
feignFileService
,
public
ContractOnlineRecordServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
FeignFileService
feignFileService
,
FeignBaseService
feignBaseService
,
RedisComponent
redisComponent
,
FeignBaseService
feignBaseService
,
RedisComponent
redisComponent
,
...
@@ -135,7 +137,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -135,7 +137,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream
.
flush
();
byteArrayOutputStream
.
flush
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"填充电子合同模板失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"填充电子合同模板失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"生成电子合同失败[填充电子合同模板失败]"
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"生成电子合同失败[填充电子合同模板失败]"
);
}
finally
{
}
finally
{
if
(
null
!=
template
)
{
if
(
null
!=
template
)
{
...
@@ -158,7 +160,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -158,7 +160,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]上传货主签名合同文件数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]上传货主签名合同文件数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[上传货主签名合同文件数据失败]"
);
throw
new
EException
(
"生成电子合同失败[上传货主签名合同文件数据失败]"
);
}
}
...
@@ -175,7 +177,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -175,7 +177,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
this
.
baseMapper
.
insert
(
onlineRecordEntity
);
this
.
baseMapper
.
insert
(
onlineRecordEntity
);
// 6:异步保存线上合同目标文件(PDF)及信息
// 6:异步保存线上合同目标文件(PDF)及信息
this
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
onlineRecordEntity
,
signBytes
);
this
.
pdfService
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
onlineRecordEntity
,
signBytes
);
// 7:返回
// 7:返回
ContractOnlineRecordSignGoodsOwnerVO
vo
=
new
ContractOnlineRecordSignGoodsOwnerVO
();
ContractOnlineRecordSignGoodsOwnerVO
vo
=
new
ContractOnlineRecordSignGoodsOwnerVO
();
...
@@ -208,7 +210,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -208,7 +210,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream
.
flush
();
byteArrayOutputStream
.
flush
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"填充电子合同模板失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"填充电子合同模板失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"生成电子合同失败[填充电子合同模板失败]"
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"生成电子合同失败[填充电子合同模板失败]"
);
}
finally
{
}
finally
{
if
(
null
!=
template
)
{
if
(
null
!=
template
)
{
...
@@ -231,7 +233,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -231,7 +233,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]上传货主签名合同文件数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]上传货主签名合同文件数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[上传司机签名合同文件数据失败]"
);
throw
new
EException
(
"生成电子合同失败[上传司机签名合同文件数据失败]"
);
}
}
...
@@ -248,7 +250,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -248,7 +250,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
this
.
baseMapper
.
insert
(
onlineRecordEntity
);
this
.
baseMapper
.
insert
(
onlineRecordEntity
);
// 6:异步保存线上合同目标文件(PDF)及信息
// 6:异步保存线上合同目标文件(PDF)及信息
this
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
onlineRecordEntity
,
signBytes
);
this
.
pdfService
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
onlineRecordEntity
,
signBytes
);
// 7:返回
// 7:返回
ContractOnlineRecordSignDriverVO
vo
=
new
ContractOnlineRecordSignDriverVO
();
ContractOnlineRecordSignDriverVO
vo
=
new
ContractOnlineRecordSignDriverVO
();
...
@@ -314,7 +316,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -314,7 +316,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
feignReqJson
));
pojo
.
setContactNumber
(
feignResJson
.
getString
(
"batchId"
));
pojo
.
setContactNumber
(
feignResJson
.
getString
(
"batchId"
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]获取合同编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]获取合同编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[获取合同编号失败]"
);
throw
new
EException
(
"生成电子合同失败[获取合同编号失败]"
);
}
}
...
@@ -356,7 +358,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -356,7 +358,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
feignReqJson
));
pojo
.
setContactNumber
(
feignResJson
.
getString
(
"batchId"
));
pojo
.
setContactNumber
(
feignResJson
.
getString
(
"batchId"
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]获取合同编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]获取合同编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[获取合同编号失败]"
);
throw
new
EException
(
"生成电子合同失败[获取合同编号失败]"
);
}
}
...
@@ -389,7 +391,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -389,7 +391,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]获取合同数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]获取合同数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"平台签订电子合同失败[获取合同数据失败]"
);
throw
new
EException
(
"平台签订电子合同失败[获取合同数据失败]"
);
}
}
String
contractFileData
=
feignResJson
.
getString
(
"fileData"
);
String
contractFileData
=
feignResJson
.
getString
(
"fileData"
);
...
@@ -412,7 +414,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -412,7 +414,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream
.
flush
();
byteArrayOutputStream
.
flush
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
signBytes
=
byteArrayOutputStream
.
toByteArray
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"平台签订电子合同失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"平台签订电子合同失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"平台签订电子合同失败[填充平台签名失败]"
);
throw
new
EException
(
ECode
.
SERVER_ERROR
.
code
(),
"平台签订电子合同失败[填充平台签名失败]"
);
}
finally
{
}
finally
{
if
(
null
!=
template
)
{
if
(
null
!=
template
)
{
...
@@ -433,7 +435,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -433,7 +435,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]上传平台签名合同文件数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]上传平台签名合同文件数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"平台签订电子合同失败[上传平台签名合同文件数据失败]"
);
throw
new
EException
(
"平台签订电子合同失败[上传平台签名合同文件数据失败]"
);
}
}
...
@@ -448,7 +450,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -448,7 +450,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
int
flag
=
this
.
baseMapper
.
updateById
(
onlineRecordEntity
);
int
flag
=
this
.
baseMapper
.
updateById
(
onlineRecordEntity
);
// 7:异步保存线上合同目标文件(PDF)及信息
// 7:异步保存线上合同目标文件(PDF)及信息
this
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
contractOnlineRecordEntity
,
signBytes
);
this
.
pdfService
.
asyncSaveTargetFileInfo
(
MDC
.
get
(
"traceId"
),
contractOnlineRecordEntity
,
signBytes
);
return
flag
;
return
flag
;
}
}
...
@@ -471,7 +473,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -471,7 +473,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]获取合同模板数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]获取合同模板数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[获取合同模板数据失败]"
);
throw
new
EException
(
"生成电子合同失败[获取合同模板数据失败]"
);
}
}
contractTemplateData
=
feignResJson
.
getString
(
"fileData"
);
contractTemplateData
=
feignResJson
.
getString
(
"fileData"
);
...
@@ -498,7 +500,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -498,7 +500,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try
{
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
getFileData
(
feignReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]获取合同平台数据失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[文件服务]获取合同平台数据失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成电子合同失败[获取合同平台数据失败]"
);
throw
new
EException
(
"生成电子合同失败[获取合同平台数据失败]"
);
}
}
String
fileData
=
feignResJson
.
getString
(
"fileData"
);
String
fileData
=
feignResJson
.
getString
(
"fileData"
);
...
@@ -515,65 +517,6 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
...
@@ -515,65 +517,6 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
return
pojo
;
return
pojo
;
}
}
/**
* description 异步保存线上合同目标文件(PDF)及信息
* param traceId:logback日志ID
* param entity:线上合同记录
* param fileBytes:线上合同源文件数据
* return void
* author Administrator
* createTime 2020/05/26 9:34
**/
@Async
public
void
asyncSaveTargetFileInfo
(
String
traceId
,
ContractOnlineRecordEntity
entity
,
byte
[]
fileBytes
)
{
String
contractNumber
=
entity
.
getContractNumber
();
if
(
StringUtils
.
isEmpty
(
traceId
)
||
CommonConstants
.
NULL_STRING
.
equalsIgnoreCase
(
traceId
))
{
traceId
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
}
MDC
.
put
(
"traceId"
,
traceId
);
log
.
info
(
"------异步保存合同[{}]目标文件及信息开始------"
,
contractNumber
);
// 转换源文件为PDF
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
InputStream
inputStream
=
InputStreamUtils
.
byte2InputStream
(
fileBytes
);
byte
[]
targetFileBytes
;
try
{
Document
document
=
new
Document
(
inputStream
);
document
.
save
(
outputStream
,
SaveFormat
.
PDF
);
targetFileBytes
=
outputStream
.
toByteArray
();
}
catch
(
Exception
e
)
{
log
.
error
(
"合同[{}]转换为PDF时失败:{}"
,
contractNumber
,
e
.
getMessage
());
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
return
;
}
finally
{
IOUtils
.
closeQuietly
(
inputStream
);
IOUtils
.
closeQuietly
(
outputStream
);
}
// 保存PDF文件
JSONObject
feignReqJson
=
new
JSONObject
();
feignReqJson
.
put
(
"fileType"
,
"pdf"
);
feignReqJson
.
put
(
"fileName"
,
"电子合同-"
+
contractNumber
+
".pdf"
);
feignReqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
targetFileBytes
));
JSONObject
feignResJson
;
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]上传目标合同[{}]文件数据失败:{}"
,
contractNumber
,
e
.
getMessage
());
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
return
;
}
// 更新合同记录信息
ContractOnlineRecordEntity
onlineRecordEntity
=
new
ContractOnlineRecordEntity
();
onlineRecordEntity
.
setId
(
entity
.
getId
());
onlineRecordEntity
.
setTargetFileId
(
feignResJson
.
getString
(
"id"
));
onlineRecordEntity
.
setTargetFileUrl
(
feignResJson
.
getString
(
"url"
));
this
.
baseMapper
.
updateById
(
onlineRecordEntity
);
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
}
@Override
@Override
public
PageResultVO
getContractList
(
ContractOnlineRecordQueryForm
queryForm
)
{
public
PageResultVO
getContractList
(
ContractOnlineRecordQueryForm
queryForm
)
{
IPage
<
ContractOnlineRecordEntity
>
page
=
new
Page
<>(
queryForm
.
getPageNum
(),
queryForm
.
getPageSize
());
IPage
<
ContractOnlineRecordEntity
>
page
=
new
Page
<>(
queryForm
.
getPageNum
(),
queryForm
.
getPageSize
());
...
...
src/main/java/com/esv/freight/customer/module/contract/service/impl/PdfServiceImpl.java
0 → 100644
View file @
2734290c
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.Document
;
import
com.aspose.words.FontSettings
;
import
com.aspose.words.SaveFormat
;
import
com.esv.freight.customer.common.constants.CommonConstants
;
import
com.esv.freight.customer.common.util.FeignUtils
;
import
com.esv.freight.customer.common.util.InputStreamUtils
;
import
com.esv.freight.customer.feign.FeignFileService
;
import
com.esv.freight.customer.module.contract.entity.ContractOnlineRecordEntity
;
import
com.esv.freight.customer.module.contract.service.ContractOnlineRecordService
;
import
com.esv.freight.customer.module.contract.service.PdfService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.MDC
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InputStream
;
import
java.util.Base64
;
import
java.util.UUID
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.service.impl.PdfServiceImpl
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/28 20:17
* @version:1.0
*/
@Service
(
"pdfService"
)
@Slf4j
public
class
PdfServiceImpl
implements
PdfService
{
@Autowired
private
FeignFileService
feignFileService
;
@Autowired
private
ContractOnlineRecordService
contractOnlineRecordService
;
@Value
(
"${font.windows.dir}"
)
private
String
fontWindowsDir
;
@Override
@Async
public
void
asyncSaveTargetFileInfo
(
String
traceId
,
ContractOnlineRecordEntity
entity
,
byte
[]
fileBytes
)
{
String
contractNumber
=
entity
.
getContractNumber
();
if
(
StringUtils
.
isEmpty
(
traceId
)
||
CommonConstants
.
NULL_STRING
.
equalsIgnoreCase
(
traceId
))
{
traceId
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
}
MDC
.
put
(
"traceId"
,
traceId
);
log
.
info
(
"------异步保存合同[{}]目标文件及信息开始------"
,
contractNumber
);
// 转换源文件为PDF
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
InputStream
inputStream
=
InputStreamUtils
.
byte2InputStream
(
fileBytes
);
byte
[]
targetFileBytes
;
try
{
String
os
=
System
.
getProperty
(
"os.name"
).
toLowerCase
();
if
(!
os
.
contains
(
"windows"
))
{
FontSettings
fontSettings
=
new
FontSettings
();
fontSettings
.
setFontsFolder
(
fontWindowsDir
,
false
);
}
Document
document
=
new
Document
(
inputStream
);
document
.
save
(
outputStream
,
SaveFormat
.
PDF
);
targetFileBytes
=
outputStream
.
toByteArray
();
}
catch
(
Exception
e
)
{
log
.
error
(
"合同[{}]转换为PDF时失败:{}"
,
contractNumber
,
e
.
getMessage
());
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
return
;
}
finally
{
IOUtils
.
closeQuietly
(
inputStream
);
IOUtils
.
closeQuietly
(
outputStream
);
}
// 保存PDF文件
JSONObject
feignReqJson
=
new
JSONObject
();
feignReqJson
.
put
(
"fileType"
,
"pdf"
);
feignReqJson
.
put
(
"fileName"
,
"电子合同-"
+
contractNumber
+
".pdf"
);
feignReqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
targetFileBytes
));
JSONObject
feignResJson
;
try
{
feignResJson
=
FeignUtils
.
getFeignResultData
(
feignFileService
.
uploadSingleFile
(
feignReqJson
));
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[文件服务]上传目标合同[{}]文件数据失败:{}"
,
contractNumber
,
e
.
getMessage
(),
e
);
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
return
;
}
// 更新合同记录信息
ContractOnlineRecordEntity
onlineRecordEntity
=
new
ContractOnlineRecordEntity
();
onlineRecordEntity
.
setId
(
entity
.
getId
());
onlineRecordEntity
.
setTargetFileId
(
feignResJson
.
getString
(
"id"
));
onlineRecordEntity
.
setTargetFileUrl
(
feignResJson
.
getString
(
"url"
));
contractOnlineRecordService
.
getBaseMapper
().
updateById
(
onlineRecordEntity
);
log
.
info
(
"------异步保存合同[{}]目标文件及信息结束------"
,
contractNumber
);
}
}
src/main/java/com/esv/freight/customer/module/driver/service/impl/DriverAccountServiceImpl.java
View file @
2734290c
...
@@ -248,7 +248,7 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
...
@@ -248,7 +248,7 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
JSONObject
resultJson
=
feignAppService
.
blockDriverAccount
(
bodyJson
);
JSONObject
resultJson
=
feignAppService
.
blockDriverAccount
(
bodyJson
);
log
.
info
(
"停用帐号Feign通知APP后台响应结果:{}"
,
resultJson
.
toJSONString
());
log
.
info
(
"停用帐号Feign通知APP后台响应结果:{}"
,
resultJson
.
toJSONString
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"停用帐号Feign通知APP后台发生错误:
"
+
e
.
getMessage
(),
e
);
log
.
error
(
"停用帐号Feign通知APP后台发生错误:
{}"
,
e
.
getMessage
(),
e
);
}
}
return
flag
;
return
flag
;
...
...
src/main/java/com/esv/freight/customer/module/driver/service/impl/DriverVehicleServiceImpl.java
View file @
2734290c
...
@@ -26,6 +26,7 @@ import com.esv.freight.customer.module.vehicle.entity.VehicleEntity;
...
@@ -26,6 +26,7 @@ import com.esv.freight.customer.module.vehicle.entity.VehicleEntity;
import
com.esv.freight.customer.module.vehicle.service.VehicleDriverService
;
import
com.esv.freight.customer.module.vehicle.service.VehicleDriverService
;
import
com.esv.freight.customer.module.vehicle.service.VehicleService
;
import
com.esv.freight.customer.module.vehicle.service.VehicleService
;
import
com.esv.freight.customer.module.vehicle.vo.VehicleDetailVO
;
import
com.esv.freight.customer.module.vehicle.vo.VehicleDetailVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -45,6 +46,7 @@ import java.util.Map;
...
@@ -45,6 +46,7 @@ import java.util.Map;
* @version:1.0
* @version:1.0
*/
*/
@Service
(
"driverVehicleService"
)
@Service
(
"driverVehicleService"
)
@Slf4j
public
class
DriverVehicleServiceImpl
implements
DriverVehicleService
{
public
class
DriverVehicleServiceImpl
implements
DriverVehicleService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/AccountAndAddressServiceIpml.java
View file @
2734290c
...
@@ -17,6 +17,7 @@ import com.esv.freight.customer.module.goodsowner.vo.account4address.AccountAndA
...
@@ -17,6 +17,7 @@ import com.esv.freight.customer.module.goodsowner.vo.account4address.AccountAndA
import
com.esv.freight.customer.module.goodsowner.vo.account4address.AccountVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.AccountVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.DeliveryAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.DeliveryAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.ReceiveAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.ReceiveAddressVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -31,6 +32,7 @@ import org.springframework.stereotype.Service;
...
@@ -31,6 +32,7 @@ import org.springframework.stereotype.Service;
* @version:1.0
* @version:1.0
*/
*/
@Service
(
"accountAndAddressService"
)
@Service
(
"accountAndAddressService"
)
@Slf4j
public
class
AccountAndAddressServiceIpml
implements
AccountAndAddressService
{
public
class
AccountAndAddressServiceIpml
implements
AccountAndAddressService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/DeliveryAddressServiceImpl.java
View file @
2734290c
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
import
com.esv.freight.customer.module.goodsowner.vo.AddressBriefVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AddressBriefVO
;
import
com.esv.freight.customer.module.goodsowner.vo.DeliveryAddressListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.DeliveryAddressListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.DeliveryAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.DeliveryAddressVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -31,6 +32,7 @@ import java.util.*;
...
@@ -31,6 +32,7 @@ import java.util.*;
@Service
(
"deliveryAddressService"
)
@Service
(
"deliveryAddressService"
)
@Slf4j
public
class
DeliveryAddressServiceImpl
extends
ServiceImpl
<
DeliveryAddressDao
,
DeliveryAddressEntity
>
implements
DeliveryAddressService
{
public
class
DeliveryAddressServiceImpl
extends
ServiceImpl
<
DeliveryAddressDao
,
DeliveryAddressEntity
>
implements
DeliveryAddressService
{
private
FeignBaseService
feignBaseService
;
private
FeignBaseService
feignBaseService
;
...
@@ -64,7 +66,7 @@ public class DeliveryAddressServiceImpl extends ServiceImpl<DeliveryAddressDao,
...
@@ -64,7 +66,7 @@ public class DeliveryAddressServiceImpl extends ServiceImpl<DeliveryAddressDao,
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成发货地址编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]生成发货地址编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成发货地址编号时发生错误"
);
throw
new
EException
(
"生成发货地址编号时发生错误"
);
}
}
String
addressNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
addressNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/GoodsOwnerAccountServiceImpl.java
View file @
2734290c
...
@@ -29,6 +29,7 @@ import com.esv.freight.customer.module.goodsowner.service.InfoService;
...
@@ -29,6 +29,7 @@ import com.esv.freight.customer.module.goodsowner.service.InfoService;
import
com.esv.freight.customer.module.goodsowner.vo.AccountAvailableVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AccountAvailableVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AccountListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AccountListVO
;
import
com.esv.gateway.common.GatewayHeaders
;
import
com.esv.gateway.common.GatewayHeaders
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -41,6 +42,7 @@ import java.util.List;
...
@@ -41,6 +42,7 @@ import java.util.List;
@Service
(
"goodsOwnerAccountService"
)
@Service
(
"goodsOwnerAccountService"
)
@Slf4j
public
class
GoodsOwnerAccountServiceImpl
extends
ServiceImpl
<
AccountDao
,
GoodsOwnerAccountEntity
>
implements
GoodsOwnerAccountService
{
public
class
GoodsOwnerAccountServiceImpl
extends
ServiceImpl
<
AccountDao
,
GoodsOwnerAccountEntity
>
implements
GoodsOwnerAccountService
{
private
FeignBaseService
feignBaseService
;
private
FeignBaseService
feignBaseService
;
...
@@ -99,7 +101,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
...
@@ -99,7 +101,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成客户编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]生成客户编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成客户编号时发生错误"
);
throw
new
EException
(
"生成客户编号时发生错误"
);
}
}
String
ownerNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
ownerNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
@@ -300,7 +302,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
...
@@ -300,7 +302,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成客户编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]生成客户编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成客户编号时发生错误"
);
throw
new
EException
(
"生成客户编号时发生错误"
);
}
}
String
ownerNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
ownerNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/ReceiveAddressServiceImpl.java
View file @
2734290c
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService;
...
@@ -21,6 +21,7 @@ import com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService;
import
com.esv.freight.customer.module.goodsowner.vo.AddressBriefVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AddressBriefVO
;
import
com.esv.freight.customer.module.goodsowner.vo.ReceiveAddressListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.ReceiveAddressListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.ReceiveAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.ReceiveAddressVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -31,6 +32,7 @@ import java.util.*;
...
@@ -31,6 +32,7 @@ import java.util.*;
@Service
(
"receiveAddressService"
)
@Service
(
"receiveAddressService"
)
@Slf4j
public
class
ReceiveAddressServiceImpl
extends
ServiceImpl
<
ReceiveAddressDao
,
ReceiveAddressEntity
>
implements
ReceiveAddressService
{
public
class
ReceiveAddressServiceImpl
extends
ServiceImpl
<
ReceiveAddressDao
,
ReceiveAddressEntity
>
implements
ReceiveAddressService
{
private
FeignBaseService
feignBaseService
;
private
FeignBaseService
feignBaseService
;
...
@@ -64,7 +66,7 @@ public class ReceiveAddressServiceImpl extends ServiceImpl<ReceiveAddressDao, Re
...
@@ -64,7 +66,7 @@ public class ReceiveAddressServiceImpl extends ServiceImpl<ReceiveAddressDao, Re
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成收货地址编号失败:
"
+
e
.
getMessage
()
);
log
.
error
(
"调用[基础服务]生成收货地址编号失败:
{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成收货地址编号时发生错误"
);
throw
new
EException
(
"生成收货地址编号时发生错误"
);
}
}
String
addressNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
addressNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/RegularlyRouteServiceImpl.java
View file @
2734290c
...
@@ -27,6 +27,7 @@ import com.esv.freight.customer.module.goodsowner.service.RegularlyRouteService;
...
@@ -27,6 +27,7 @@ import com.esv.freight.customer.module.goodsowner.service.RegularlyRouteService;
import
com.esv.freight.customer.module.goodsowner.vo.RouteDetailVO
;
import
com.esv.freight.customer.module.goodsowner.vo.RouteDetailVO
;
import
com.esv.freight.customer.module.goodsowner.vo.RouteListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.RouteListVO
;
import
com.esv.freight.customer.module.goodsowner.vo.RouteOwnerVO
;
import
com.esv.freight.customer.module.goodsowner.vo.RouteOwnerVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -37,6 +38,7 @@ import java.util.List;
...
@@ -37,6 +38,7 @@ import java.util.List;
@Service
(
"regularlyRouteService"
)
@Service
(
"regularlyRouteService"
)
@Slf4j
public
class
RegularlyRouteServiceImpl
extends
ServiceImpl
<
RegularlyRouteDao
,
RegularlyRouteEntity
>
implements
RegularlyRouteService
{
public
class
RegularlyRouteServiceImpl
extends
ServiceImpl
<
RegularlyRouteDao
,
RegularlyRouteEntity
>
implements
RegularlyRouteService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
...
@@ -94,7 +96,7 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
...
@@ -94,7 +96,7 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
try
{
try
{
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
batchIdResJson
=
FeignUtils
.
getFeignResultData
(
feignBaseService
.
getBatchId
(
batchIdReqJson
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用[基础服务]生成路线编号失败
"
);
log
.
error
(
"调用[基础服务]生成路线编号失败
:{}"
,
e
.
getMessage
(),
e
);
throw
new
EException
(
"生成路线编号时发生错误"
);
throw
new
EException
(
"生成路线编号时发生错误"
);
}
}
String
routeNumber
=
batchIdResJson
.
getString
(
"batchId"
);
String
routeNumber
=
batchIdResJson
.
getString
(
"batchId"
);
...
...
src/main/java/com/esv/freight/customer/module/vehicle/service/impl/VehicleServiceImpl.java
View file @
2734290c
...
@@ -31,6 +31,7 @@ import com.esv.freight.customer.module.vehicle.service.VehicleService;
...
@@ -31,6 +31,7 @@ import com.esv.freight.customer.module.vehicle.service.VehicleService;
import
com.esv.freight.customer.module.vehicle.vo.VehicleAllVO
;
import
com.esv.freight.customer.module.vehicle.vo.VehicleAllVO
;
import
com.esv.freight.customer.module.vehicle.vo.VehicleListVO
;
import
com.esv.freight.customer.module.vehicle.vo.VehicleListVO
;
import
com.esv.gateway.common.GatewayHeaders
;
import
com.esv.gateway.common.GatewayHeaders
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -43,6 +44,7 @@ import java.util.List;
...
@@ -43,6 +44,7 @@ import java.util.List;
@Service
(
"vehicleService"
)
@Service
(
"vehicleService"
)
@Slf4j
public
class
VehicleServiceImpl
extends
ServiceImpl
<
VehicleDao
,
VehicleEntity
>
implements
VehicleService
{
public
class
VehicleServiceImpl
extends
ServiceImpl
<
VehicleDao
,
VehicleEntity
>
implements
VehicleService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
...
...
src/main/resources/application-dev.yml
View file @
2734290c
...
@@ -64,6 +64,9 @@ ribbon:
...
@@ -64,6 +64,9 @@ ribbon:
eager-load
:
eager-load
:
enabled
:
true
enabled
:
true
clients
:
freight-base-service,freight-file-service,freight-app-service
clients
:
freight-base-service,freight-file-service,freight-app-service
font
:
windows
:
dir
:
/usr/share/fonts/windows
error-message
:
error-message
:
goodsowner
:
goodsowner
:
account
:
account
:
...
...
src/main/resources/application-test.yml
View file @
2734290c
...
@@ -64,6 +64,9 @@ ribbon:
...
@@ -64,6 +64,9 @@ ribbon:
eager-load
:
eager-load
:
enabled
:
true
enabled
:
true
clients
:
freight-base-service,freight-file-service,freight-app-service
clients
:
freight-base-service,freight-file-service,freight-app-service
font
:
windows
:
dir
:
/usr/share/fonts/windows
error-message
:
error-message
:
goodsowner
:
goodsowner
:
account
:
account
:
...
...
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