Commit 2734290c authored by huangcb's avatar huangcb

word转pdf异步模式bug对应、linux中文乱码问题对应

parent 424a169e
......@@ -56,7 +56,7 @@ public class BaseDataComponent {
redisComponent.set(this.getAllRegionMapCacheKey(), allRegionMap.toJSONString(), ALL_REGION_MAP_CACHE_TIME);
}
} catch (Exception e) {
log.error("调用[基础服务]获取全国省市行政区划(键值对)失败:" + e.getMessage());
log.error("调用[基础服务]获取全国省市行政区划(键值对)失败:{}", e.getMessage(), e);
}
}
......
......@@ -84,20 +84,20 @@ public class RestLogFilter implements Filter {
bodyStr = sb.toString();
}
} catch (IOException e) {
log.error("解析post参数时发生错误:{}", e.getMessage());
log.error("解析post参数时发生错误:{}", e.getMessage(), e);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
}
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
}
}
......
......@@ -22,6 +22,9 @@ public class ReqUtils {
public static String getRequestHeader(String headerKey) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (null == servletRequestAttributes) {
return null;
}
HttpServletRequest request = servletRequestAttributes.getRequest();
return request.getHeader(headerKey);
}
......
......@@ -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.CarrierInfoService;
import com.esv.freight.customer.module.carrier.vo.CarrierInfoListVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,7 +30,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service("carrierAccountService")
public class CarrierAccountServiceImpl extends ServiceImpl<CarrierAccountDao, CarrierAccountEntity> implements CarrierAccountService {
......@@ -103,7 +104,7 @@ public class CarrierAccountServiceImpl extends ServiceImpl<CarrierAccountDao, Ca
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成承运商编号失败:" + e.getMessage());
log.error("调用[基础服务]生成承运商编号失败:{}", e.getMessage(), e);
throw new EException("生成承运商编号时发生错误");
}
String carrierNumber = batchIdResJson.getString("batchId");
......
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);
}
package com.esv.freight.customer.module.contract.service.impl;
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.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -11,7 +9,6 @@ import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData;
import com.esv.freight.customer.common.component.ErrorMessageComponent;
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.response.ECode;
import com.esv.freight.customer.common.util.DateUtils;
......@@ -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.ContractOnlineRecordService;
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.ContractOnlineRecordSignDriverVO;
import com.esv.freight.customer.module.contract.vo.ContractOnlineRecordSignGoodsOwnerVO;
......@@ -52,14 +50,15 @@ import org.slf4j.MDC;
import org.springframework.beans.BeanUtils;
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 org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Date;
import java.util.List;
@Service("contractOnlineRecordService")
......@@ -92,6 +91,9 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
private DriverAccountService driverAccountService;
private ContractOnlinePlatformDataService contractOnlinePlatformDataService;
@Autowired
private PdfService pdfService;
@Autowired
public ContractOnlineRecordServiceImpl(ErrorMessageComponent errorMessageComponent, FeignFileService feignFileService,
FeignBaseService feignBaseService, RedisComponent redisComponent,
......@@ -135,7 +137,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream.flush();
signBytes = byteArrayOutputStream.toByteArray();
} catch (IOException e) {
log.error("填充电子合同模板失败:" + e.getMessage());
log.error("填充电子合同模板失败:{}", e.getMessage(), e);
throw new EException(ECode.SERVER_ERROR.code(), "生成电子合同失败[填充电子合同模板失败]");
} finally {
if (null != template) {
......@@ -158,7 +160,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.uploadSingleFile(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]上传货主签名合同文件数据失败:" + e.getMessage());
log.error("调用[文件服务]上传货主签名合同文件数据失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[上传货主签名合同文件数据失败]");
}
......@@ -175,7 +177,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
this.baseMapper.insert(onlineRecordEntity);
// 6:异步保存线上合同目标文件(PDF)及信息
this.asyncSaveTargetFileInfo(MDC.get("traceId"), onlineRecordEntity, signBytes);
this.pdfService.asyncSaveTargetFileInfo(MDC.get("traceId"), onlineRecordEntity, signBytes);
// 7:返回
ContractOnlineRecordSignGoodsOwnerVO vo = new ContractOnlineRecordSignGoodsOwnerVO();
......@@ -208,7 +210,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream.flush();
signBytes = byteArrayOutputStream.toByteArray();
} catch (IOException e) {
log.error("填充电子合同模板失败:" + e.getMessage());
log.error("填充电子合同模板失败:{}", e.getMessage(), e);
throw new EException(ECode.SERVER_ERROR.code(), "生成电子合同失败[填充电子合同模板失败]");
} finally {
if (null != template) {
......@@ -231,7 +233,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.uploadSingleFile(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]上传货主签名合同文件数据失败:" + e.getMessage());
log.error("调用[文件服务]上传货主签名合同文件数据失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[上传司机签名合同文件数据失败]");
}
......@@ -248,7 +250,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
this.baseMapper.insert(onlineRecordEntity);
// 6:异步保存线上合同目标文件(PDF)及信息
this.asyncSaveTargetFileInfo(MDC.get("traceId"), onlineRecordEntity, signBytes);
this.pdfService.asyncSaveTargetFileInfo(MDC.get("traceId"), onlineRecordEntity, signBytes);
// 7:返回
ContractOnlineRecordSignDriverVO vo = new ContractOnlineRecordSignDriverVO();
......@@ -314,7 +316,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
feignResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(feignReqJson));
pojo.setContactNumber(feignResJson.getString("batchId"));
} catch (Exception e) {
log.error("调用[基础服务]获取合同编号失败:" + e.getMessage());
log.error("调用[基础服务]获取合同编号失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[获取合同编号失败]");
}
......@@ -356,7 +358,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
feignResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(feignReqJson));
pojo.setContactNumber(feignResJson.getString("batchId"));
} catch (Exception e) {
log.error("调用[基础服务]获取合同编号失败:" + e.getMessage());
log.error("调用[基础服务]获取合同编号失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[获取合同编号失败]");
}
......@@ -389,7 +391,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.getFileData(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]获取合同数据失败:" + e.getMessage());
log.error("调用[文件服务]获取合同数据失败:{}", e.getMessage(), e);
throw new EException("平台签订电子合同失败[获取合同数据失败]");
}
String contractFileData = feignResJson.getString("fileData");
......@@ -412,7 +414,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
byteArrayOutputStream.flush();
signBytes = byteArrayOutputStream.toByteArray();
} catch (IOException e) {
log.error("平台签订电子合同失败:" + e.getMessage());
log.error("平台签订电子合同失败:{}", e.getMessage(), e);
throw new EException(ECode.SERVER_ERROR.code(), "平台签订电子合同失败[填充平台签名失败]");
} finally {
if (null != template) {
......@@ -433,7 +435,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.uploadSingleFile(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]上传平台签名合同文件数据失败:" + e.getMessage());
log.error("调用[文件服务]上传平台签名合同文件数据失败:{}", e.getMessage(), e);
throw new EException("平台签订电子合同失败[上传平台签名合同文件数据失败]");
}
......@@ -448,7 +450,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
int flag = this.baseMapper.updateById(onlineRecordEntity);
// 7:异步保存线上合同目标文件(PDF)及信息
this.asyncSaveTargetFileInfo(MDC.get("traceId"), contractOnlineRecordEntity, signBytes);
this.pdfService.asyncSaveTargetFileInfo(MDC.get("traceId"), contractOnlineRecordEntity, signBytes);
return flag;
}
......@@ -471,7 +473,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.getFileData(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]获取合同模板数据失败:" + e.getMessage());
log.error("调用[文件服务]获取合同模板数据失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[获取合同模板数据失败]");
}
contractTemplateData = feignResJson.getString("fileData");
......@@ -498,7 +500,7 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
try {
feignResJson = FeignUtils.getFeignResultData(feignFileService.getFileData(feignReqJson));
} catch (Exception e) {
log.error("调用[文件服务]获取合同平台数据失败:" + e.getMessage());
log.error("调用[文件服务]获取合同平台数据失败:{}", e.getMessage(), e);
throw new EException("生成电子合同失败[获取合同平台数据失败]");
}
String fileData = feignResJson.getString("fileData");
......@@ -515,65 +517,6 @@ public class ContractOnlineRecordServiceImpl extends ServiceImpl<ContractOnlineR
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
public PageResultVO getContractList(ContractOnlineRecordQueryForm queryForm) {
IPage<ContractOnlineRecordEntity> page = new Page<>(queryForm.getPageNum(), queryForm.getPageSize());
......
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);
}
}
......@@ -248,7 +248,7 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
JSONObject resultJson = feignAppService.blockDriverAccount(bodyJson);
log.info("停用帐号Feign通知APP后台响应结果:{}", resultJson.toJSONString());
} catch (Exception e) {
log.error("停用帐号Feign通知APP后台发生错误:" + e.getMessage(), e);
log.error("停用帐号Feign通知APP后台发生错误:{}", e.getMessage(), e);
}
return flag;
......
......@@ -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.VehicleService;
import com.esv.freight.customer.module.vehicle.vo.VehicleDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
......@@ -45,6 +46,7 @@ import java.util.Map;
* @version:1.0
*/
@Service("driverVehicleService")
@Slf4j
public class DriverVehicleServiceImpl implements DriverVehicleService {
private ErrorMessageComponent errorMessageComponent;
......
......@@ -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.DeliveryAddressVO;
import com.esv.freight.customer.module.goodsowner.vo.account4address.ReceiveAddressVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -31,6 +32,7 @@ import org.springframework.stereotype.Service;
* @version:1.0
*/
@Service("accountAndAddressService")
@Slf4j
public class AccountAndAddressServiceIpml implements AccountAndAddressService {
private ErrorMessageComponent errorMessageComponent;
......
......@@ -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.DeliveryAddressListVO;
import com.esv.freight.customer.module.goodsowner.vo.DeliveryAddressVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -31,6 +32,7 @@ import java.util.*;
@Service("deliveryAddressService")
@Slf4j
public class DeliveryAddressServiceImpl extends ServiceImpl<DeliveryAddressDao, DeliveryAddressEntity> implements DeliveryAddressService {
private FeignBaseService feignBaseService;
......@@ -64,7 +66,7 @@ public class DeliveryAddressServiceImpl extends ServiceImpl<DeliveryAddressDao,
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成发货地址编号失败:" + e.getMessage());
log.error("调用[基础服务]生成发货地址编号失败:{}", e.getMessage(), e);
throw new EException("生成发货地址编号时发生错误");
}
String addressNumber = batchIdResJson.getString("batchId");
......
......@@ -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.AccountListVO;
import com.esv.gateway.common.GatewayHeaders;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -41,6 +42,7 @@ import java.util.List;
@Service("goodsOwnerAccountService")
@Slf4j
public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsOwnerAccountEntity> implements GoodsOwnerAccountService {
private FeignBaseService feignBaseService;
......@@ -99,7 +101,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成客户编号失败:" + e.getMessage());
log.error("调用[基础服务]生成客户编号失败:{}", e.getMessage(), e);
throw new EException("生成客户编号时发生错误");
}
String ownerNumber = batchIdResJson.getString("batchId");
......@@ -300,7 +302,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成客户编号失败:" + e.getMessage());
log.error("调用[基础服务]生成客户编号失败:{}", e.getMessage(), e);
throw new EException("生成客户编号时发生错误");
}
String ownerNumber = batchIdResJson.getString("batchId");
......
......@@ -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.ReceiveAddressListVO;
import com.esv.freight.customer.module.goodsowner.vo.ReceiveAddressVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -31,6 +32,7 @@ import java.util.*;
@Service("receiveAddressService")
@Slf4j
public class ReceiveAddressServiceImpl extends ServiceImpl<ReceiveAddressDao, ReceiveAddressEntity> implements ReceiveAddressService {
private FeignBaseService feignBaseService;
......@@ -64,7 +66,7 @@ public class ReceiveAddressServiceImpl extends ServiceImpl<ReceiveAddressDao, Re
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成收货地址编号失败:" + e.getMessage());
log.error("调用[基础服务]生成收货地址编号失败:{}", e.getMessage(), e);
throw new EException("生成收货地址编号时发生错误");
}
String addressNumber = batchIdResJson.getString("batchId");
......
......@@ -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.RouteListVO;
import com.esv.freight.customer.module.goodsowner.vo.RouteOwnerVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -37,6 +38,7 @@ import java.util.List;
@Service("regularlyRouteService")
@Slf4j
public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, RegularlyRouteEntity> implements RegularlyRouteService {
private ErrorMessageComponent errorMessageComponent;
......@@ -94,7 +96,7 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
try {
batchIdResJson = FeignUtils.getFeignResultData(feignBaseService.getBatchId(batchIdReqJson));
} catch (Exception e) {
log.error("调用[基础服务]生成路线编号失败");
log.error("调用[基础服务]生成路线编号失败:{}", e.getMessage(), e);
throw new EException("生成路线编号时发生错误");
}
String routeNumber = batchIdResJson.getString("batchId");
......
......@@ -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.VehicleListVO;
import com.esv.gateway.common.GatewayHeaders;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,6 +44,7 @@ import java.util.List;
@Service("vehicleService")
@Slf4j
public class VehicleServiceImpl extends ServiceImpl<VehicleDao, VehicleEntity> implements VehicleService {
private ErrorMessageComponent errorMessageComponent;
......
......@@ -64,6 +64,9 @@ ribbon:
eager-load:
enabled: true
clients: freight-base-service,freight-file-service,freight-app-service
font:
windows:
dir: /usr/share/fonts/windows
error-message:
goodsowner:
account:
......
......@@ -64,6 +64,9 @@ ribbon:
eager-load:
enabled: true
clients: freight-base-service,freight-file-service,freight-app-service
font:
windows:
dir: /usr/share/fonts/windows
error-message:
goodsowner:
account:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment