新增开票接口使用post方式
This commit is contained in:
parent
1541e574a6
commit
d814c0f376
@ -121,6 +121,41 @@ public class XhpcInvoiceController extends BaseController {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "用户提交发票状态", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult postInvoiceToUser(@RequestBody InvoiceToUserRequest requestData) {
|
||||
//前置条件
|
||||
if (requestData.getInvoiceId() == null) {
|
||||
return AjaxResult.error("必须上传发票id");
|
||||
}
|
||||
if (requestData.getStatus() == null || requestData.getStatus().equals(InvoiceStatusConst.INVOICING)) {
|
||||
return AjaxResult.error("必须传递发票状态或发票状态不能为0");
|
||||
}
|
||||
//开失败发票
|
||||
if (requestData.getStatus().equals(InvoiceStatusConst.FAIL)) {
|
||||
try {
|
||||
xhpcInvoiceService.failInvoiceToUser(requestData);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("开失败发票失败");
|
||||
}
|
||||
} else {
|
||||
//开成功发票
|
||||
try {
|
||||
//捕获参数异常
|
||||
Boolean flagOfjudge = xhpcInvoiceService.invoiceToUser(requestData);
|
||||
if (!flagOfjudge) {
|
||||
return AjaxResult.error("客户邮箱有误,邮件未发送成功,请通知用户修改邮箱");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于在后台显示所有发票信息,包括待开发票和已开发票的信息
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user