You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
4.2 KiB
Java
104 lines
4.2 KiB
Java
|
6 years ago
|
package com.gszc.controller;
|
||
|
|
|
||
|
|
import com.alibaba.fastjson.JSONObject;
|
||
|
|
import com.gszc.build.Result;
|
||
|
|
import com.gszc.build.ResultBuilder;
|
||
|
|
import com.gszc.entity.Custom;
|
||
|
|
import com.gszc.entity.CustomSupport;
|
||
|
|
import com.gszc.entity.Invoice;
|
||
|
|
import com.gszc.entity.InvoiceHeader;
|
||
|
|
import com.gszc.service.impl.CustomServiceImpl;
|
||
|
|
import com.gszc.service.impl.InvoiceServiceImpl;
|
||
|
|
import io.swagger.annotations.Api;
|
||
|
|
import io.swagger.annotations.ApiImplicitParam;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.validation.Valid;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Api(value = "工商注册 API", tags = {"小程序开票api"})
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/mini/invoice")
|
||
|
|
public class MiniInvoiceController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
InvoiceServiceImpl invoiceService;
|
||
|
|
|
||
|
|
@PostMapping("/addInvoice")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "开票", notes = "开票")
|
||
|
|
@ResponseBody
|
||
|
|
public Result addInvoice(@ModelAttribute @Valid Invoice invoice) {
|
||
|
|
invoiceService.addInvoice(invoice);
|
||
|
|
return ResultBuilder.success().build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/invoiceList")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "开票记录", notes = "开票记录")
|
||
|
|
public Result invoiceList(String userId) {
|
||
|
|
|
||
|
|
List<Invoice> invoiceList = invoiceService.invoiceList(userId);
|
||
|
|
return ResultBuilder.withPayload(invoiceList).build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/invoiceDetail")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "开票详情", notes = "开票详情")
|
||
|
|
public Result invoiceDetail(String invoiceId) {
|
||
|
|
|
||
|
|
JSONObject jsonObject = invoiceService.invoiceDetail(invoiceId);
|
||
|
|
return ResultBuilder.withPayload(jsonObject).build();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@PostMapping("/invoiceHeaderList")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "发票抬头列表", notes = "发票抬头列表")
|
||
|
|
public Result invoiceHeaderList(String userId) {
|
||
|
|
|
||
|
|
List<InvoiceHeader> invoiceHeaderList = invoiceService.invoiceHeaderList(userId);
|
||
|
|
return ResultBuilder.withPayload(invoiceHeaderList).build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/addInvoiceHeader")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "添加发票抬头", notes = "添加发票抬头")
|
||
|
|
@ResponseBody
|
||
|
|
public Result addInvoiceHeader(@ModelAttribute @Valid InvoiceHeader invoiceHeader) {
|
||
|
|
invoiceService.addInvoiceHeader(invoiceHeader);
|
||
|
|
return ResultBuilder.success().build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/updateInvoiceHeader")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "编辑发票抬头", notes = "编辑发票抬头")
|
||
|
|
@ResponseBody
|
||
|
|
public Result updateInvoiceHeader(@ModelAttribute @Valid InvoiceHeader invoiceHeader) {
|
||
|
|
invoiceService.updateInvoiceHeader(invoiceHeader);
|
||
|
|
return ResultBuilder.success().build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/deleteInvoiceHeader")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "删除发票抬头", notes = "删除发票抬头")
|
||
|
|
@ResponseBody
|
||
|
|
public Result deleteInvoiceHeader(String invoiceHeaderId) {
|
||
|
|
invoiceService.deleteInvoiceHeader(invoiceHeaderId);
|
||
|
|
return ResultBuilder.success().build();
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/invoiceHeaderDetail")
|
||
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
|
||
|
|
@ApiOperation(value = "发票抬头详情", notes = "发票抬头详情")
|
||
|
|
public Result invoiceHeaderDetail(String invoiceHeaderId) {
|
||
|
|
|
||
|
|
InvoiceHeader invoiceHeader = invoiceService.invoiceHeaderDetail(invoiceHeaderId);
|
||
|
|
return ResultBuilder.withPayload(invoiceHeader).build();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|