Browse Source

调整小图跳转逻辑

liangbo.huang 1 week ago
parent
commit
b39f80b6d3

+ 3 - 12
trade-admin/src/main/java/com/trade/admin/trade/exportrebate/controller/ExportTaxRebateController.java

@@ -10,7 +10,6 @@ import com.trade.service.trade.exportrebate.dto.search.TaxRebateExportAbstractIn
 import com.trade.service.trade.exportrebate.dto.search.TaxRebatePurchaseAbstractInfoSearchDto;
 import com.trade.service.trade.exportrebate.dto.search.TaxRebateSummarySearchDto;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import com.trade.admin.trade.exportrebate.service.ExportTaxRebateService;
 
@@ -24,7 +23,7 @@ import java.util.List;
  * @author hlb
  * @since 2024-10-22 15:46:46
  */
-@Controller
+@RestController
 @RequestMapping("/exportTaxRebate")
 public class ExportTaxRebateController extends BaseController {
 
@@ -41,7 +40,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return 出口退税明细汇总数据
      */
     @GetMapping("/summaryData")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.pages')")
     public ResponseResult<GridPage<TaxRebateSummaryDataDto>> getSummaryDataByPage(TaxRebateSummarySearchDto search) {
         return success(exportTaxRebateService.getTaxRebateSummaryDataPagesBySearch(search));
@@ -54,7 +52,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return 出口退税明细合计数据
      */
     @GetMapping("/totalData")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.pages')")
     public ResponseResult<TaxRebateTotalDataDto> queryTotalData(TaxRebateSummarySearchDto search) {
         return success(exportTaxRebateService.getTaxRebateTotalDataBySearch(search));
@@ -67,7 +64,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return 口退税出口明细摘要信息
      */
     @GetMapping("/exportPages")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.exportPages')")
     public ResponseResult<GridPage<TaxRebateExportAbstractInfo>> getTaxRebateExportPages(
             TaxRebateExportAbstractInfoSearchDto search) {
@@ -81,7 +77,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return 出口退税进货明细摘要信息
      */
     @GetMapping("/puchasePages")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.puchasePages')")
     public ResponseResult<GridPage<TaxRebatePurchaseAbstractInfo>> getTaxRebatePurchasePages(
             TaxRebatePurchaseAbstractInfoSearchDto search) {
@@ -93,9 +88,9 @@ public class ExportTaxRebateController extends BaseController {
      */
     @GetMapping("/doTaxRebate")
     @PreAuthorize("@ss.hasRole('EXPORT_TAX_REFUNDER')")
-    public String doTaxRebate(String xtUserId, String xtEid) {
+    public ResponseResult<String> doTaxRebate(String xtUserId, String xtEid) {
         String taxRebateUrl = exportTaxRebateService.getTaxRebateUrl(xtUserId, xtEid);
-        return "redirect:" + taxRebateUrl;
+        return ResponseResult.success(taxRebateUrl);
     }
 
     /**
@@ -105,7 +100,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return
      */
     @GetMapping("/declarationBatch/refundAmount")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.exportTaxRefund')")
     public ResponseResult<BigDecimal> getRefundAmountForDeclarationBatch(ExportTaxRefundBatchRequest request) {
         return success(exportTaxRebateService.getRefundAmountForDeclarationBatch(request));
@@ -118,7 +112,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return
      */
     @PostMapping("/declarationBatch/exportTaxRefund")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.exportTaxRefund')")
     public ResponseResult<Boolean> refundExportTaxForDeclarationBatch(ExportTaxRefundBatchRequest request) {
         return success(exportTaxRebateService.refundExportTaxForDeclarationBatch(request));
@@ -131,7 +124,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return
      */
     @GetMapping("/exportDetails/refundAmount")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.exportTaxRefund')")
     public ResponseResult<BigDecimal> getRefundAmountForExportDetails(List<TaxRebateExportAbstractInfo> request) {
         return success(exportTaxRebateService.getRefundAmountForExportDetails(request));
@@ -144,7 +136,6 @@ public class ExportTaxRebateController extends BaseController {
      * @return
      */
     @PostMapping("/exportDetails/exportTaxRefund")
-    @ResponseBody
     @PreAuthorize("@ss.hasPermi('trade:exportTaxRebate.exportTaxRefund')")
     public ResponseResult<Boolean> refundExportTaxForExportDetails(ExportTaxRefundDetailsRequest request) {
         return success(exportTaxRebateService.refundExportTaxForExportDetails(request));

+ 3 - 10
trade-admin/src/main/java/com/trade/admin/trade/purchaseorder/controller/BPurchaseOrderController.java

@@ -10,7 +10,6 @@ import com.trade.service.trade.purchaseorder.dto.PurchaseOrderInvoiceSearchDto;
 import com.trade.service.trade.purchaseorder.dto.PurchaseOrderLogisticsSearchDto;
 import com.trade.service.trade.purchaseorder.vo.*;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
 import com.trade.common.core.domain.ResponseResult;
@@ -32,7 +31,7 @@ import java.util.List;
  * @time 2024-09-12
  */
 @Api(tags = "采购订单信息", value = "采购订单信息")
-@Controller
+@RestController
 @RequestMapping("/purchaseOrder")
 public class BPurchaseOrderController {
 
@@ -48,7 +47,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "获取采购订单", notes = "获取采购订单")
     @PostMapping("/get/page")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:pages')")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderVo>> getPurchaseOrderPage(
             @RequestBody PurchaseSearchDto purchaseSearch) {
         return ResponseResult.success(purchaseOrderService.queryListByPage(purchaseSearch));
@@ -63,7 +61,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "获取采购订单详情", notes = "获取采购订单详情")
     @GetMapping("/get/{orderId}")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:details')")
-    @ResponseBody
     public ResponseResult<PurchaseOrderDetailsVo> getSalesContractDetails(@PathVariable Long orderId) {
         return ResponseResult.success(purchaseOrderService.getDetailsById(orderId));
     }
@@ -77,7 +74,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "获取采购订单物流信息", notes = "获取采购订单物流信息")
     @PostMapping("/get/logisticsPage")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:logisticsPage')")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderLogisticsPageVo>> getOrderLogisticsByPage(
             @RequestBody PurchaseOrderLogisticsSearchDto orderLogisticsSearch) {
         return ResponseResult.success(purchaseOrderService.queryOrderLogisticsByPage(orderLogisticsSearch));
@@ -92,7 +88,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "拉取采购订单发票", notes = "拉取采购订单发票")
     @PostMapping("/pull/purchaseInvoice")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:pullInvoice')")
-    @ResponseBody
     public ResponseResult<Boolean> pullPurchaseInvoice(@RequestBody List<Long> orderIds) {
         return ResponseResult.success(purchaseOrderService.pullPurchaseInvoice(orderIds));
     }
@@ -106,7 +101,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "获取采购订单发票", notes = "获取采购订单发票")
     @PostMapping("/get/invoicePage")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:invoicePage')")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderInvoiceVo>> getInvoicePage(
             @RequestBody PurchaseOrderInvoiceSearchDto invoiceSearchDto) {
         return ResponseResult.success(purchaseOrderService.queryInvoiceListByPage(invoiceSearchDto));
@@ -121,7 +115,6 @@ public class BPurchaseOrderController {
     @ApiOperation(value = "获取采购订单发票详情", notes = "获取采购订单发票详情")
     @GetMapping("/get/invoiceDetail")
     @PreAuthorize("@ss.hasPermi('trade:purchaseOrder:invoiceDetail')")
-    @ResponseBody
     public ResponseResult<PurchaseOrderInvoiceDetailsVo> getInvoiceDetails(Long invoiceId) {
         return ResponseResult.success(purchaseOrderService.getInvoiceDetails(invoiceId));
     }
@@ -131,8 +124,8 @@ public class BPurchaseOrderController {
      */
     @GetMapping("/download/invoice")
     @PreAuthorize("@ss.hasRole('EXPORT_TAX_REFUNDER')")
-    public String getDownloadPurchaseInvoiceUrl(String xtUserId, String xtEid) {
+    public ResponseResult<String> getDownloadPurchaseInvoiceUrl(String xtUserId, String xtEid) {
         String taxRebateUrl = purchaseOrderService.getDownloadPurchaseInvoiceUrl(xtUserId, xtEid);
-        return "redirect:" + taxRebateUrl;
+        return ResponseResult.success(taxRebateUrl);
     }
 }

+ 4 - 7
trade-admin/src/main/java/com/trade/admin/trade/salesorder/CustomsDeclarationController.java

@@ -4,10 +4,9 @@ import com.trade.common.core.domain.ResponseResult;
 import com.trade.service.trade.salesorder.service.ICustomsDeclarationService;
 import com.trade.service.trade.salesorder.vo.CustomsDeclarationSearch;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.validation.constraints.NotNull;
@@ -20,7 +19,7 @@ import javax.validation.constraints.NotNull;
  * @author zhangchenm
  * @since 2024-09-19
  */
-@Controller
+@RestController
 @RequestMapping("/customsDeclaration")
 public class CustomsDeclarationController {
 
@@ -32,7 +31,6 @@ public class CustomsDeclarationController {
      */
     @RequestMapping("/queryList")
     @PreAuthorize("@ss.hasPermi('trade:salesBgd:list')")
-    @ResponseBody
     public Object queryList(CustomsDeclarationSearch search) {
         return ResponseResult.success(customsDeclarationService.queryListBySearch(search));
     }
@@ -42,7 +40,6 @@ public class CustomsDeclarationController {
      */
     @RequestMapping("/getDetailById")
     @PreAuthorize("@ss.hasPermi('trade:salesBgd:detail')")
-    @ResponseBody
     public Object getDetailById(@NotNull(message = "ID不能为空") Long id) {
         return ResponseResult.success(customsDeclarationService.getDetailById(id));
     }
@@ -52,8 +49,8 @@ public class CustomsDeclarationController {
      */
     @GetMapping("/download")
     @PreAuthorize("@ss.hasRole('EXPORT_TAX_REFUNDER')")
-    public String getDownloadCustomsDeclarationUrl(String xtUserId, String xtEid) {
+    public ResponseResult<String> getDownloadCustomsDeclarationUrl(String xtUserId, String xtEid) {
         String taxRebateUrl = customsDeclarationService.getDownloadCustomsDeclarationUrl(xtUserId, xtEid);
-        return "redirect:" + taxRebateUrl;
+        return ResponseResult.success(taxRebateUrl);
     }
 }

+ 3 - 5
trade-client/src/main/java/com/trade/client/trade/exportrebate/controller/ExportTaxRebateController.java

@@ -4,7 +4,6 @@ import com.trade.common.core.domain.ResponseResult;
 import com.trade.common.core.page.GridPage;
 import com.trade.service.trade.exportrebate.dto.ExportTaxRebateStatisticDto;
 import com.trade.service.trade.exportrebate.dto.search.TaxRebateSearchDto;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 import com.trade.client.trade.exportrebate.service.ExportTaxRebateService;
 
@@ -16,7 +15,7 @@ import javax.annotation.Resource;
  * @author hlb
  * @since 2024-10-22 15:46:16
  */
-@Controller
+@RestController
 @RequestMapping("/taxRebate")
 public class ExportTaxRebateController {
 
@@ -33,7 +32,6 @@ public class ExportTaxRebateController {
      * @return 所有数据
      */
     @GetMapping("/pages")
-    @ResponseBody
     public ResponseResult<GridPage<ExportTaxRebateStatisticDto>> getPages(TaxRebateSearchDto search) {
         return ResponseResult.success(exportTaxRebateService.getPagesBySearch(search));
     }
@@ -42,8 +40,8 @@ public class ExportTaxRebateController {
      * 重定向小图进行退税
      */
     @GetMapping("/doTaxRebate")
-    public String doTaxRebate() {
+    public ResponseResult<String> doTaxRebate() {
         String taxRebateUrl = exportTaxRebateService.getTaxRebateUrl();
-        return "redirect:" + taxRebateUrl;
+        return ResponseResult.success(taxRebateUrl);
     }
 }

+ 9 - 4
trade-client/src/main/java/com/trade/client/trade/exportrebate/service/impl/ExportTaxRebateServiceImpl.java

@@ -60,6 +60,15 @@ public class ExportTaxRebateServiceImpl implements ExportTaxRebateService {
 
     @Override
     public String getTaxRebateUrl() {
+        CustomerUser customerUser = UserUtils.getLoginUser().getCustomerUser();
+        Enterprise enterprise = enterpriseBaseService.getEnterpriseByCustomerId(customerUser.getId());
+        if (enterprise == null) {
+            throw new ServiceException("用户没有企业认证", HttpStatus.BAD_REQUEST);
+        }
+        if (!DictConstants.CONTRACT_STATUS_DONE.equals(enterprise.getTaxRebateAgreementSignStatus())
+                || !DictConstants.EXPORT_TYPE_SELF.equals(enterprise.getExportType())) {
+            throw new ServiceException("无退税操作权限", HttpStatus.BAD_REQUEST);
+        }
         return getXiaotuUrl("/02/0202/020204");
     }
 
@@ -82,10 +91,6 @@ public class ExportTaxRebateServiceImpl implements ExportTaxRebateService {
         if (StrUtil.isEmpty(enterprise.getXtEid()) || StrUtil.isEmpty(customerUser.getXtUid())) {
             throw new ServiceException("用户没有退税认证", HttpStatus.BAD_REQUEST);
         }
-        if (!DictConstants.CONTRACT_STATUS_DONE.equals(enterprise.getTaxRebateAgreementSignStatus())
-                || !DictConstants.EXPORT_TYPE_SELF.equals(enterprise.getExportType())) {
-            throw new ServiceException("无退税操作权限", HttpStatus.BAD_REQUEST);
-        }
         return xiaotuRequestService.getExportRebateUrl(customerUser.getXtUid(), enterprise.getXtEid(), jumpUrl);
     }
 }

+ 3 - 10
trade-client/src/main/java/com/trade/client/trade/purchaseorder/controller/PurchaseOrderController.java

@@ -15,7 +15,6 @@ import com.trade.service.trade.purchaseorder.dto.PurchaseSearchDto;
 import com.trade.service.trade.purchaseorder.vo.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -32,7 +31,7 @@ import javax.validation.Valid;
  * @time 2024-09-11
  */
 @Api(tags = "采购订单信息", value = "采购订单信息")
-@Controller
+@RestController
 @RequestMapping("/purchaseOrder")
 public class PurchaseOrderController {
 
@@ -50,7 +49,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "保存物流信息", notes = "保存物流信息")
     @PostMapping("/save/logistics")
-    @ResponseBody
     public ResponseResult<Boolean> saveOrderLogistics(
             @Valid @RequestBody PurchaseOrderLogisticsDto purchaseOrderLogisticsDto, HttpServletRequest request) {
         return ResponseResult.success(cPurchaseOrderService.saveOrderLogistics(purchaseOrderLogisticsDto));
@@ -64,7 +62,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "获取采购订单", notes = "获取采购订单")
     @PostMapping("/get/page")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderVo>> getPurchaseOrderPage(
             @RequestBody PurchaseSearchDto purchaseSearch) {
         return ResponseResult.success(cPurchaseOrderService.queryListByPage(purchaseSearch));
@@ -78,7 +75,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "获取采购订单详情", notes = "获取采购订单详情")
     @GetMapping("/get/{orderId}")
-    @ResponseBody
     public ResponseResult<PurchaseOrderDetailsVo> getSalesContractDetails(@PathVariable Long orderId) {
         return ResponseResult.success(cPurchaseOrderService.getDetailsById(orderId));
     }
@@ -91,7 +87,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "获取采购订单物流信息", notes = "获取采购订单物流信息")
     @PostMapping("/get/logisticsPage")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderLogisticsPageVo>> getOrderLogisticsByPage(
             @RequestBody PurchaseOrderLogisticsSearchDto orderLogisticsSearch) {
         return ResponseResult.success(cPurchaseOrderService.queryOrderLogisticsByPage(orderLogisticsSearch));
@@ -105,7 +100,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "获取采购订单发票", notes = "获取采购订单发票")
     @PostMapping("/get/invoicePage")
-    @ResponseBody
     public ResponseResult<GridPage<PurchaseOrderInvoiceVo>> getInvoicePage(
             @RequestBody PurchaseOrderInvoiceSearchDto invoiceSearchDto) {
         return ResponseResult.success(cPurchaseOrderService.queryInvoiceListByPage(invoiceSearchDto));
@@ -119,7 +113,6 @@ public class PurchaseOrderController {
      */
     @ApiOperation(value = "获取采购订单发票详情", notes = "获取采购订单发票详情")
     @GetMapping("/get/invoiceDetail")
-    @ResponseBody
     public ResponseResult<PurchaseOrderInvoiceDetailsVo> getInvoiceDetails(Long invoiceId) {
         return ResponseResult.success(cPurchaseOrderService.getInvoiceDetails(invoiceId));
     }
@@ -128,8 +121,8 @@ public class PurchaseOrderController {
      * 重定向小图进行发票下载
      */
     @GetMapping("/download/invoice")
-    public String getDownloadPurchaseInvoiceUrl() {
+    public ResponseResult<String> getDownloadPurchaseInvoiceUrl() {
         String url = exportTaxRebateService.getDownloadPurchaseInvoiceUrl();
-        return "redirect:" + url;
+        return ResponseResult.success(url);
     }
 }

+ 5 - 8
trade-client/src/main/java/com/trade/client/trade/salesorder/controller/CustomsDeclarationController.java

@@ -5,14 +5,13 @@ import javax.validation.constraints.NotNull;
 
 import com.trade.client.security.utils.UserUtils;
 import com.trade.client.trade.exportrebate.service.ExportTaxRebateService;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.trade.common.core.domain.ResponseResult;
 import com.trade.service.trade.salesorder.service.ICustomsDeclarationService;
 import com.trade.service.trade.salesorder.vo.CustomsDeclarationSearch;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
@@ -22,7 +21,7 @@ import com.trade.service.trade.salesorder.vo.CustomsDeclarationSearch;
  * @author zhangchenm
  * @since 2024-09-19
  */
-@Controller
+@RestController
 @RequestMapping("/customsDeclaration")
 public class CustomsDeclarationController {
 
@@ -35,7 +34,6 @@ public class CustomsDeclarationController {
      * 获取报关单列表
      */
     @RequestMapping("/queryList")
-    @ResponseBody
     public Object queryList(CustomsDeclarationSearch search) {
         search.setCustomerUserId(UserUtils.getCustomerUserId());
         return ResponseResult.success(customsDeclarationService.queryListBySearch(search));
@@ -45,7 +43,6 @@ public class CustomsDeclarationController {
      * 根据订单id获取报关单详情
      */
     @RequestMapping("/getDetailById")
-    @ResponseBody
     public Object getDetailById(@NotNull(message = "ID不能为空") Long id) {
         return ResponseResult.success(customsDeclarationService.getDetailById(id));
     }
@@ -54,8 +51,8 @@ public class CustomsDeclarationController {
      * 重定向小图进行报关单下载
      */
     @GetMapping("/download")
-    public String getDownloadCustomsDeclarationUrl(String xtUserId, String xtEid) {
-        String url = customsDeclarationService.getDownloadCustomsDeclarationUrl(xtUserId, xtEid);
-        return "redirect:" + url;
+    public ResponseResult<String> getDownloadCustomsDeclarationUrl() {
+        String url = exportTaxRebateService.getDownloadCustomsDeclarationUrl();
+        return ResponseResult.success(url);
     }
 }

+ 1 - 2
trade-service/src/main/resources/data.init/v1.1/20241022.sql

@@ -142,10 +142,9 @@ CREATE TABLE `enterprise_change_record_i18n`
 (
     `id`               bigint(20)                                                    NOT NULL,
     `language`         varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci   NOT NULL,
-    `platform_name`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    `name`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
     `register_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
     `business_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-    `contact_name`     varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NULL DEFAULT NULL,
     PRIMARY KEY (`id`, `language`) USING BTREE,
     UNIQUE INDEX `id_idx` (`id`, `language`) USING BTREE
 ) ENGINE = InnoDB