فهرست منبع

发票接口(管理端)

jz.kai 5 سال پیش
والد
کامیت
07e1da761f
1فایلهای تغییر یافته به همراه52 افزوده شده و 0 حذف شده
  1. 52 0
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/CompanyInvoiceController.java

+ 52 - 0
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/CompanyInvoiceController.java

@@ -0,0 +1,52 @@
+package com.jpsoft.picc.modules.base.controller;
+
+import com.jpsoft.picc.modules.base.entity.CompanyInvoice;
+import com.jpsoft.picc.modules.base.service.CompanyInvoiceService;
+import com.jpsoft.picc.modules.common.dto.MessageResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/companyInvoice")
+@Api(description = "发票信息")
+public class CompanyInvoiceController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private CompanyInvoiceService companyInvoiceService;
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "companyId",value = "企业编号", required = true, paramType = "query")
+    })
+    public MessageResult<CompanyInvoice> detail(String companyId){
+        MessageResult<CompanyInvoice> msgResult = new MessageResult<>();
+
+        try {
+            CompanyInvoice company = companyInvoiceService.getByCompanyId(companyId);
+
+            if (company != null) {
+                msgResult.setResult(true);
+                msgResult.setData(company);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}