From 7a8b42574195d431c7b0f63a336e25c56b38155f Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Mon, 6 May 2024 15:45:11 +0800 Subject: [PATCH] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../controller/common/SapRfcController.java | 85 +++- .../web/utils/SapFunction/SapRfcUtils.java | 101 +++++ .../java/com/ruoyi/customer/domain/Bank.java | 20 +- .../com/ruoyi/customer/domain/BankCode.java | 49 +++ .../com/ruoyi/customer/domain/Customer.java | 15 + .../mapper/customer/CustomerMapper.xml | 26 +- ruoyi-ui/src/api/common/sapRfc.js | 26 ++ .../src/views/customer/customer/index.vue | 414 ++++++++++++++---- ruoyi-ui/src/views/quot/quot/index.vue | 4 + 10 files changed, 642 insertions(+), 102 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/customer/domain/BankCode.java diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index a60bbeb..e7778db 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Apr 30 16:42:04 CST 2024 +#Mon May 06 14:44:29 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.125 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=uD8ely7MSR~%EjN[YVSQi{Uk(g)lY*X:C|ocMpezcUAU:e-g +jco.client.passwd=654321 jco.client.client=800 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SapRfcController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SapRfcController.java index 2f1c7ae..3e0b737 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SapRfcController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SapRfcController.java @@ -1,21 +1,34 @@ package com.ruoyi.web.controller.common; +import com.alibaba.fastjson2.JSON; +import com.github.pagehelper.PageInfo; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisLock; +import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.MinioUtil; +import com.ruoyi.customer.domain.Bank; +import com.ruoyi.customer.domain.BankCode; import com.ruoyi.customer.domain.Customer; +import com.ruoyi.customer.domain.qcc.FuzzySearch; +import com.ruoyi.customer.domain.qcc.QccFuzzySearchJsonResult; import com.ruoyi.framework.config.ServerConfig; import com.ruoyi.materialType.domain.CMaterialType; import com.ruoyi.web.utils.SapFunction.RfcResult; import com.ruoyi.web.utils.SapFunction.SapRfcUtils; +import com.ruoyi.web.utils.qcc.HttpHelper; +import com.ruoyi.web.utils.qcc.QiChaChaUtil; import org.apache.commons.collections.CollectionUtils; +import org.apache.http.client.methods.HttpHead; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -58,10 +71,10 @@ public class SapRfcController { AjaxResult ajax = AjaxResult.success(); - List resCache = redisCache.getCacheObject(getSapCacheKey("country")); + List resCache = redisCache.getCacheObject(getSapCacheKey("countrys")); if(CollectionUtils.isEmpty(resCache)){ resCache = SapRfcUtils.getCountrys(null); - redisCache.setCacheObject(getSapCacheKey("country"),resCache); + redisCache.setCacheObject(getSapCacheKey("countrys"),resCache); } log.info("获取国家数据条数 - {}", resCache.size()); ajax.put("countrysDicts", resCache); @@ -215,6 +228,48 @@ public class SapRfcController return ajax; } + /** + * 获取客户税分类数据 + * @param customer + * @return + */ + @PreAuthorize("@ss.hasPermi('customer:customer:list')") + @GetMapping("/getTax") + public AjaxResult getTax(Customer customer) + { + AjaxResult ajax = AjaxResult.success(); + + List resCache = redisCache.getCacheObject(getSapCacheKey("tax")); + if(CollectionUtils.isEmpty(resCache)){ + resCache = SapRfcUtils.getTax(null); + redisCache.setCacheObject(getSapCacheKey("tax"),resCache); + } + log.info("获取客户税分类数据条数 - {}", resCache.size()); + ajax.put("taxDicts", resCache); + return ajax; + } + + /** + * 获取统驭科目数据 + * @param customer + * @return + */ + @PreAuthorize("@ss.hasPermi('customer:customer:list')") + @GetMapping("/getReconciliationAccount") + public AjaxResult getReconciliationAccount(Customer customer) + { + AjaxResult ajax = AjaxResult.success(); + + List resCache = redisCache.getCacheObject(getSapCacheKey("reconciliationAccount")); + if(CollectionUtils.isEmpty(resCache)){ + resCache = SapRfcUtils.getReconciliationAccount(null); + redisCache.setCacheObject(getSapCacheKey("reconciliationAccount"),resCache); + } + log.info("获取统驭科目数据条数 - {}", resCache.size()); + ajax.put("reconciliationAccountDicts", resCache); + return ajax; + } + /** * 获取redis SAP公共数据 * @param type @@ -224,4 +279,30 @@ public class SapRfcController { return CacheConstants.SAP_COMMON + type; } + + + + /*=======================================查询SAP银行代码信息=================================================*/ + /** + * 查询银行代码列表 + */ + @PreAuthorize("@ss.hasPermi('customer:customer:bankCodeList')") + @Log(title = "银行代码信息查询", businessType = BusinessType.OTHER) + @GetMapping("/bankCodeList") + public TableDataInfo bankCodeList(BankCode bank) + { + String bankName = bank.getBankName(); + List resCache = new ArrayList(); + try { + resCache = SapRfcUtils.getBankCodeList(bankName); + } catch (Exception e1) { + e1.printStackTrace(); + } + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(resCache); + rspData.setTotal(new PageInfo(resCache).getTotal()); + return rspData; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/SapFunction/SapRfcUtils.java b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/SapFunction/SapRfcUtils.java index 39bc3d6..8aa6040 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/SapFunction/SapRfcUtils.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/SapFunction/SapRfcUtils.java @@ -1,6 +1,7 @@ package com.ruoyi.web.utils.SapFunction; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.customer.domain.BankCode; import com.sap.conn.jco.JCoDestination; import com.sap.conn.jco.JCoFunction; import com.sap.conn.jco.JCoParameterList; @@ -10,6 +11,7 @@ import java.util.ArrayList; import java.util.List; public class SapRfcUtils { + /** * 获取SAP国家数据 * @param param 不传查询全部 @@ -265,4 +267,103 @@ public class SapRfcUtils { } return countrys; } + + /** + * 获取客户税分类数据 + * @param param 不传查询全部 + * @return + */ + public static List getTax(String param){ + JCoFunction function = null; + RfcResult rfcResult = null; + List countrys = new ArrayList<>(); + + JCoDestination destination = ConnectToSAP.connect(); + try { + function = destination.getRepository().getFunctionTemplate("ZRFC_BASIC_DATA").getFunction(); + if (function == null) + throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP."); + JCoParameterList input = function.getImportParameterList(); + input.setValue("FLAG40", StringUtils.isNotNull(param)?param:"X");//输入参数 + function.execute(destination); + JCoTable table = function.getTableParameterList().getTable("T_TSKDT"); + for(int i = 0; i getReconciliationAccount(String param){ + JCoFunction function = null; + RfcResult rfcResult = null; + List countrys = new ArrayList<>(); + + JCoDestination destination = ConnectToSAP.connect(); + try { + function = destination.getRepository().getFunctionTemplate("ZRFC_BASIC_DATA").getFunction(); + if (function == null) + throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP."); + JCoParameterList input = function.getImportParameterList(); + input.setValue("FLAG28", StringUtils.isNotNull(param)?param:"X");//输入参数 + function.execute(destination); + JCoTable table = function.getTableParameterList().getTable("T_HKONT"); + for(int i = 0; i getBankCodeList(String param){ + JCoFunction function = null; + BankCode rfcResult = null; + List countrys = new ArrayList<>(); + + JCoDestination destination = ConnectToSAP.connect(); + try { + function = destination.getRepository().getFunctionTemplate("ZSRM_GET_BANKKEY").getFunction(); + if (function == null) + throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP."); + JCoParameterList input = function.getImportParameterList(); + input.setValue("DESCRIPTION", StringUtils.isNotNull(param)?param:"X");//输入参数 + function.execute(destination); + JCoTable table = function.getTableParameterList().getTable("T_DATA"); + for(int i = 0; i + + + @@ -46,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -59,7 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.cus_classification, a.cus_receiving_email, a.cus_recipient, a.cus_recipient_phone, a.cus_remark, a.cus_state, a.cus_approval_status,a.create_time,u.nick_name create_name, - a.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office + a.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office, + a.cus_currency,a.cus_tax,a.cus_reconciliation_account from customer a @@ -82,8 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.cus_group, a.cus_vat_no, a.cus_type, a.cus_country, a.cus_language, a.cus_label, a.cus_classification, a.cus_receiving_email, a.cus_recipient, a.cus_recipient_phone, a.cus_remark, a.cus_state, a.cus_approval_status, a.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office, - - b.bank_id as sub_bank_id, b.bank_name as sub_bank_name, b.bank_account as sub_bank_account, b.cus_id as sub_cus_id + a.cus_currency,a.cus_tax,a.cus_reconciliation_account, + b.bank_id as sub_bank_id, b.bank_name as sub_bank_name, b.bank_account as sub_bank_account, b.cus_id as sub_cus_id, + b.bank_code as sub_bank_code,b.bank_country as sub_bank_country from customer a left join bank b on b.cus_id = a.cus_id where a.cus_id = #{cusId} @@ -119,6 +126,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" cus_distribution_channel, cus_sales_territory, cus_sale_office, + cus_currency, + cus_tax, + cus_reconciliation_account, #{cusId}, @@ -148,6 +158,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{cusDistributionChannel}, #{cusSalesTerritory}, #{cusSaleOffice}, + #{cusCurrency}, + #{cusTax}, + #{cusReconciliationAccount}, @@ -180,6 +193,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" cus_distribution_channel = #{cusDistributionChannel}, cus_sales_territory = #{cusSalesTerritory}, cus_sale_office = #{cusSaleOffice}, + cus_currency = #{cusCurrency}, + cus_tax = #{cusTax}, + cus_reconciliation_account = #{cusReconciliationAccount}, where cus_id = #{cusId} @@ -207,9 +223,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into bank(bank_id, bank_name, bank_account, cus_id) values + insert into bank(bank_id, bank_name, bank_account, cus_id,bank_code,bank_country) values - ( #{item.bankId}, #{item.bankName}, #{item.bankAccount}, #{item.cusId}) + ( #{item.bankId}, #{item.bankName}, #{item.bankAccount}, #{item.cusId}, #{item.bankCode}, #{item.bankCountry}) diff --git a/ruoyi-ui/src/api/common/sapRfc.js b/ruoyi-ui/src/api/common/sapRfc.js index 7a65899..01ca1ab 100644 --- a/ruoyi-ui/src/api/common/sapRfc.js +++ b/ruoyi-ui/src/api/common/sapRfc.js @@ -64,5 +64,31 @@ export function getSaleOffice(query) { params: query }) } +// 查询客户税分类数据 +export function getTax(query) { + return request({ + url: '/rfc/rfc/getTax', + method: 'get', + params: query + }) +} +// 查询统驭科目数据 +export function getReconciliationAccount(query) { + return request({ + url: '/rfc/rfc/getReconciliationAccount', + method: 'get', + params: query + }) +} + +// 查询银行代码数据 +export function bankCodeList(query) { + return request({ + url: '/rfc/rfc/bankCodeList', + method: 'get', + params: query + }) +} + diff --git a/ruoyi-ui/src/views/customer/customer/index.vue b/ruoyi-ui/src/views/customer/customer/index.vue index 725d79d..12a4eb9 100644 --- a/ruoyi-ui/src/views/customer/customer/index.vue +++ b/ruoyi-ui/src/views/customer/customer/index.vue @@ -170,14 +170,14 @@ - + - + @@ -189,12 +189,12 @@ - + - + - + - + - + - + - + - + - + - + --> - + @@ -286,18 +286,30 @@
- 添加 + 添加
- 删除 + 删除
- + + + + + + +