Commit 906e0a3f by jianan

前端对接问题修复69

parent 34843699
......@@ -202,10 +202,9 @@ public class ApiFortuneController {
if (CollectionUtils.isEmpty(fortuneDownloadRequest.getFortuneBizIdList())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "请选择要出账的发佣数据");
}
try {
fortuneService.downloadAccount(fortuneDownloadRequest, response);
return Result.success(true);
} catch (Exception e) {
fortuneService.downloadAccount(fortuneDownloadRequest, response);
// // 设置响应类型为 JSON,而不是文件流
// response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
// response.setContentType(MediaType.APPLICATION_JSON_VALUE);
......@@ -218,11 +217,10 @@ public class ApiFortuneController {
//
// response.getWriter().write(new ObjectMapper().writeValueAsString(errorResult));
log.error("生成出账清单失败", e);
return Result.success(false);
}
return Result.success(true);
}
/**
* 分页获取出账列表
*
......
......@@ -187,6 +187,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (currentPaymentAmount.compareTo(expectedFortune.getAmount()) > 0) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账金额不能大于应付款金额");
}
if (StringUtils.isBlank(fortuneUpdateRequest.getCurrency())) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账币种不能为空");
}
}
// 获取当前登录用户
......@@ -319,6 +322,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (!StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.CHECKED.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("未检核,不能生成出账记录; ");
}
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.SENT.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("已完成出账,不能生成出账记录; ");
}
}
if (StringUtils.isNotBlank(validateMsg.toString())) {
throw new BusinessException(ResultCode.FAIL.getCode(), validateMsg.toString());
......
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