From bc4f6588b92d207bef56edf3b5b38d8e4e2b8236 Mon Sep 17 00:00:00 2001
From: 6c <420680616@qq.com>
Date: 星期四, 12 六月 2025 16:34:11 +0800
Subject: [PATCH] 合同管理

---
 src/main/java/com/product/contract/controller/ContractInfoController.java |   87 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/product/contract/controller/ContractInfoController.java b/src/main/java/com/product/contract/controller/ContractInfoController.java
index 0f1bd79..cfb5237 100644
--- a/src/main/java/com/product/contract/controller/ContractInfoController.java
+++ b/src/main/java/com/product/contract/controller/ContractInfoController.java
@@ -1,5 +1,6 @@
 package com.product.contract.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.product.common.lang.StringUtils;
 import com.product.contract.config.CmnConst;
 import com.product.contract.config.SystemCode;
@@ -13,6 +14,7 @@
 import com.product.core.exception.BaseException;
 import com.product.core.spring.context.SpringMVCContextHolder;
 import com.product.module.sys.version.ApiVersion;
+import com.product.util.BaseUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -206,7 +208,9 @@
                 return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
             }
             FieldSetEntity fs = contractInfoService.findContractInfo(fse);
-            return OK_List(fs);
+            JSONObject resultObj = BaseUtil.fieldSetEntityToJson(fs);
+            resultObj.put("~showType~", fse.getString("showType"));
+            return OK(resultObj);
         } catch (BaseException e) {
             e.printStackTrace();
             SpringMVCContextHolder.getSystemLogger().error(e);
@@ -662,4 +666,85 @@
                     SystemCode.SYSTEM_SAVE_CONTRACT_FILE_FAIL.getText());
         }
     }
+
+    /**
+     * 楠岃瘉鍙戠エ鍙凤紝涓嶅悓娆℃暟鐨勫紑绁ㄤ腑涓嶈兘鏈夌浉鍚岀殑鍙戠エ鍙凤紙鍚屾鐨勫彲浠ワ級
+     * @param request
+     * @return
+     */
+    @RequestMapping(value="/check-invoice-number/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String checkInvoiceNumber(HttpServletRequest request) {
+        try {
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_PROJECT_CONTRACT_INVOICE_INFO);
+            // 鍒ゆ柇鍙傛暟鏄惁涓虹┖
+            if (fse == null) {
+                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+            }
+            return OK(contractInfoService.checkInvoiceNumber(fse));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(SystemCode.CHECK_INVOICE_NUMBER_FAIL.getValue(), SystemCode.CHECK_INVOICE_NUMBER_FAIL.getText());
+        }
+    }
+
+    /**
+     * 楠岃瘉鍙戠エ鍙凤紝鍗曚釜鍙戠エ鐨勫洖娆炬�婚涓嶈兘瓒呰繃寮�绁ㄩ噾棰�
+     * @param request
+     * @return
+     */
+    @RequestMapping(value="/check-invoice-payment/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String checkInvoicePayment(HttpServletRequest request) {
+        try {
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_PROJECT_CONTRACT_INVOICE_INFO);
+            // 鍒ゆ柇鍙傛暟鏄惁涓虹┖
+            if (fse == null) {
+                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+            }
+            return OK(contractInfoService.checkInvoicePayment(fse));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(SystemCode.CHECK_INVOICE_NUMBER_FAIL.getValue(), SystemCode.CHECK_INVOICE_NUMBER_FAIL.getText());
+        }
+    }
+
+    /**
+     * 鏌ヨ鍚堝悓涓嬬殑寮�绁ㄥ拰鍥炴璁板綍
+     * @param request
+     * @return
+     */
+    @RequestMapping(value="/list-contract-invoice-and-collection/{version}", method = RequestMethod.POST)
+    @ApiVersion(1)
+    public String listContractInvoiceAndCollection(HttpServletRequest request) {
+        try {
+            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.LX_PROJECT_CONTRACT_INFO);
+            // 鍒ゆ柇鍙傛暟鏄惁涓虹┖
+            if (fse == null) {
+                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
+            }
+            return OK(contractInfoService.listContractInvoiceAndCollection(fse));
+        } catch (BaseException e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            SpringMVCContextHolder.getSystemLogger().error(e);
+            return this.error(SystemCode.LIST_CONTRACT_INVOICE_AND_COLLECTION_FAIL.getValue(), SystemCode.LIST_CONTRACT_INVOICE_AND_COLLECTION_FAIL.getText());
+        }
+    }
 }

--
Gitblit v1.9.2