|
@@ -10,6 +10,7 @@ import cn.kdan.compdf.dto.UserBillingUpInfoDTO;
|
|
|
import cn.kdan.compdf.entity.UserBillingInformation;
|
|
|
import cn.kdan.compdf.enums.ResponseEnum;
|
|
|
import cn.kdan.compdf.exception.BusinessException;
|
|
|
+import cn.kdan.compdf.exception.CommonException;
|
|
|
import cn.kdan.compdf.mapper.UserBillingInformationMapper;
|
|
|
import cn.kdan.compdf.service.OrderCashFlowService;
|
|
|
import cn.kdan.compdf.service.OrdersService;
|
|
@@ -153,7 +154,7 @@ public class UserBillingInformationServiceImpl extends ServiceImpl<UserBillingIn
|
|
|
UserBillingInfoVO userBillingInfo = this.getUserBillingInfo(compdfkitId);
|
|
|
// 发送邮箱是否填写
|
|
|
if (StringUtils.isEmpty(userBillingInfo.getEmail())) {
|
|
|
- throw new BusinessException(ResponseEnum.ACCOUNT_PASSWORD_WRONG);
|
|
|
+ throw new CommonException(ResponseEnum.ERROR_BILL_EMAIL_NULL);
|
|
|
}
|
|
|
// 验证信息是否完整
|
|
|
for (Field field : userBillingInfo.getClass().getDeclaredFields()) {
|
|
@@ -181,6 +182,7 @@ public class UserBillingInformationServiceImpl extends ServiceImpl<UserBillingIn
|
|
|
Map postForObjectMap = restTemplate.postForObject(invoiceUrl, request, Map.class);
|
|
|
String billUrl = postForObjectMap.get("url").toString();
|
|
|
// TODO 上传资源服务器
|
|
|
+
|
|
|
// 持久化发票数据
|
|
|
orderCashFlowService.updateBillInfo(applyInvoiceDTO.getOrderId(), billUrl, billNo, JSONObject.toJSONString(userBillingInfo));
|
|
|
// 返回结果
|
|
@@ -234,11 +236,11 @@ public class UserBillingInformationServiceImpl extends ServiceImpl<UserBillingIn
|
|
|
try {
|
|
|
Object value = field.get(obj);
|
|
|
if (value == null || value.toString().isEmpty()) {
|
|
|
- throw new BusinessException(ResponseEnum.ACCOUNT_PASSWORD_WRONG);
|
|
|
+ throw new CommonException(ResponseEnum.ERROR_INCOMPLETE_BILLING_INFORMATION);
|
|
|
}
|
|
|
} catch (IllegalAccessException e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- throw new BusinessException(ResponseEnum.ACCOUNT_PASSWORD_WRONG);
|
|
|
+ throw new CommonException(ResponseEnum.ERROR_INCOMPLETE_BILLING_INFORMATION);
|
|
|
}
|
|
|
}
|
|
|
|