'11211'
This commit is contained in:
parent
a940b1d832
commit
518bf039ef
|
@ -1,5 +1,5 @@
|
||||||
#for tests only !
|
#for tests only !
|
||||||
#Tue Apr 30 14:23:52 CST 2024
|
#Tue Apr 30 16:42:04 CST 2024
|
||||||
jco.destination.pool_capacity=10
|
jco.destination.pool_capacity=10
|
||||||
jco.client.lang=ZH
|
jco.client.lang=ZH
|
||||||
jco.client.ashost=172.19.0.125
|
jco.client.ashost=172.19.0.125
|
||||||
|
@ -7,5 +7,5 @@ jco.client.saprouter=
|
||||||
jco.client.user=RFC
|
jco.client.user=RFC
|
||||||
jco.client.sysnr=00
|
jco.client.sysnr=00
|
||||||
jco.destination.peak_limit=10
|
jco.destination.peak_limit=10
|
||||||
jco.client.passwd=dZ7%0^^S.BC9=76d+x^RaptI:lSr7*7(n*?L**;[-c`$qn-b
|
jco.client.passwd=uD8ely7MSR~%EjN[YVSQi{Uk(g)lY*X:C|ocMpezcUAU:e-g
|
||||||
jco.client.client=800
|
jco.client.client=800
|
||||||
|
|
|
@ -110,6 +110,116 @@ public class SapRfcController
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP 付款条件数据
|
||||||
|
* @param customer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
|
||||||
|
@GetMapping("/getPaymentTerms")
|
||||||
|
public AjaxResult getPaymentTerms(Customer customer)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
|
||||||
|
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("paymentTerms"));
|
||||||
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
|
resCache = SapRfcUtils.getPaymentTerms(null);
|
||||||
|
redisCache.setCacheObject(getSapCacheKey("paymentTerms"),resCache);
|
||||||
|
}
|
||||||
|
log.info("获取付款条件数据条数 - {}", resCache.size());
|
||||||
|
ajax.put("paymentTermsDicts", resCache);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP 销售组织数据
|
||||||
|
* @param customer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
|
||||||
|
@GetMapping("/getSalesOrganization")
|
||||||
|
public AjaxResult getSalesOrganization(Customer customer)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
|
||||||
|
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("salesOrganization"));
|
||||||
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
|
resCache = SapRfcUtils.getSalesOrganization(null);
|
||||||
|
redisCache.setCacheObject(getSapCacheKey("salesOrganization"),resCache);
|
||||||
|
}
|
||||||
|
log.info("获取销售组织数据条数 - {}", resCache.size());
|
||||||
|
ajax.put("salesOrganizationDicts", resCache);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP 分销渠道数据
|
||||||
|
* @param customer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
|
||||||
|
@GetMapping("/getDistributionChannel")
|
||||||
|
public AjaxResult getDistributionChannel(Customer customer)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
|
||||||
|
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("distributionChannel"));
|
||||||
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
|
resCache = SapRfcUtils.getDistributionChannel(null);
|
||||||
|
redisCache.setCacheObject(getSapCacheKey("distributionChannel"),resCache);
|
||||||
|
}
|
||||||
|
log.info("获取销售组织数据条数 - {}", resCache.size());
|
||||||
|
ajax.put("distributionChannelDicts", resCache);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP 销售地区数据
|
||||||
|
* @param customer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
|
||||||
|
@GetMapping("/getSalesTerritory")
|
||||||
|
public AjaxResult getSalesTerritory(Customer customer)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
|
||||||
|
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("salesTerritory"));
|
||||||
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
|
resCache = SapRfcUtils.getSalesTerritory(null);
|
||||||
|
redisCache.setCacheObject(getSapCacheKey("salesTerritory"),resCache);
|
||||||
|
}
|
||||||
|
log.info("获取销售地区数据条数 - {}", resCache.size());
|
||||||
|
ajax.put("salesTerritoryDicts", resCache);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP 销售办公室数据
|
||||||
|
* @param customer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
|
||||||
|
@GetMapping("/getSaleOffice")
|
||||||
|
public AjaxResult getSaleOffice(Customer customer)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
|
||||||
|
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("saleOffice"));
|
||||||
|
if(CollectionUtils.isEmpty(resCache)){
|
||||||
|
resCache = SapRfcUtils.getSaleOffice(null);
|
||||||
|
redisCache.setCacheObject(getSapCacheKey("saleOffice"),resCache);
|
||||||
|
}
|
||||||
|
log.info("获取销售办公室数据条数 - {}", resCache.size());
|
||||||
|
ajax.put("saleOfficeDicts", resCache);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取redis SAP公共数据
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private String getSapCacheKey(String type)
|
private String getSapCacheKey(String type)
|
||||||
{
|
{
|
||||||
return CacheConstants.SAP_COMMON + type;
|
return CacheConstants.SAP_COMMON + type;
|
||||||
|
|
|
@ -105,4 +105,164 @@ public class SapRfcUtils {
|
||||||
}
|
}
|
||||||
return countrys;
|
return countrys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP付款条件数据
|
||||||
|
* @param param 不传查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<RfcResult> getPaymentTerms(String param){
|
||||||
|
JCoFunction function = null;
|
||||||
|
RfcResult rfcResult = null;
|
||||||
|
List<RfcResult> 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("FALG22", StringUtils.isNotNull(param)?param:"X");//输入参数
|
||||||
|
function.execute(destination);
|
||||||
|
JCoTable table = function.getTableParameterList().getTable("T_T052U");
|
||||||
|
for(int i = 0; i<table.getNumRows(); i++){
|
||||||
|
table.setRow(i);
|
||||||
|
rfcResult = new RfcResult();
|
||||||
|
rfcResult.setValue(table.getString("ZTERM"));
|
||||||
|
rfcResult.setLabel(table.getString("TEXT1"));
|
||||||
|
countrys.add(rfcResult);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return countrys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP销售组织数据
|
||||||
|
* @param param 不传查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<RfcResult> getSalesOrganization(String param){
|
||||||
|
JCoFunction function = null;
|
||||||
|
RfcResult rfcResult = null;
|
||||||
|
List<RfcResult> 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("FLAG29", StringUtils.isNotNull(param)?param:"X");//输入参数
|
||||||
|
function.execute(destination);
|
||||||
|
JCoTable table = function.getTableParameterList().getTable("T_TVKOT");
|
||||||
|
for(int i = 0; i<table.getNumRows(); i++){
|
||||||
|
table.setRow(i);
|
||||||
|
rfcResult = new RfcResult();
|
||||||
|
rfcResult.setValue(table.getString("VKORG"));
|
||||||
|
rfcResult.setLabel(table.getString("VTEXT"));
|
||||||
|
countrys.add(rfcResult);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return countrys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP分销渠道数据
|
||||||
|
* @param param 不传查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<RfcResult> getDistributionChannel(String param){
|
||||||
|
JCoFunction function = null;
|
||||||
|
RfcResult rfcResult = null;
|
||||||
|
List<RfcResult> 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("FLAG30", StringUtils.isNotNull(param)?param:"X");//输入参数
|
||||||
|
function.execute(destination);
|
||||||
|
JCoTable table = function.getTableParameterList().getTable("T_TVTWT");
|
||||||
|
for(int i = 0; i<table.getNumRows(); i++){
|
||||||
|
table.setRow(i);
|
||||||
|
rfcResult = new RfcResult();
|
||||||
|
rfcResult.setValue(table.getString("VTWEG"));
|
||||||
|
rfcResult.setLabel(table.getString("VTEXT"));
|
||||||
|
countrys.add(rfcResult);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return countrys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP销售地区数据
|
||||||
|
* @param param 不传查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<RfcResult> getSalesTerritory(String param){
|
||||||
|
JCoFunction function = null;
|
||||||
|
RfcResult rfcResult = null;
|
||||||
|
List<RfcResult> 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("FLAG32", StringUtils.isNotNull(param)?param:"X");//输入参数
|
||||||
|
function.execute(destination);
|
||||||
|
JCoTable table = function.getTableParameterList().getTable("T_T171T");
|
||||||
|
for(int i = 0; i<table.getNumRows(); i++){
|
||||||
|
table.setRow(i);
|
||||||
|
rfcResult = new RfcResult();
|
||||||
|
rfcResult.setValue(table.getString("BZIRK"));
|
||||||
|
rfcResult.setLabel(table.getString("BZTXT"));
|
||||||
|
countrys.add(rfcResult);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return countrys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SAP销售办公室数据
|
||||||
|
* @param param 不传查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<RfcResult> getSaleOffice(String param){
|
||||||
|
JCoFunction function = null;
|
||||||
|
RfcResult rfcResult = null;
|
||||||
|
List<RfcResult> 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("FLAG34", StringUtils.isNotNull(param)?param:"X");//输入参数
|
||||||
|
function.execute(destination);
|
||||||
|
JCoTable table = function.getTableParameterList().getTable("T_TVKBT");
|
||||||
|
for(int i = 0; i<table.getNumRows(); i++){
|
||||||
|
table.setRow(i);
|
||||||
|
rfcResult = new RfcResult();
|
||||||
|
rfcResult.setValue(table.getString("VKBUR"));
|
||||||
|
rfcResult.setLabel(table.getString("BEZEI"));
|
||||||
|
countrys.add(rfcResult);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return countrys;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,31 +314,25 @@ public class Customer extends BaseEntity
|
||||||
this.bankList = bankList;
|
this.bankList = bankList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*=====================================数据组维护信息=====================================*/
|
||||||
public String toString() {
|
private String cusSalesOrganization;
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
private String cusDistributionChannel;
|
||||||
.append("cusId", getCusId())
|
private String cusSalesTerritory;
|
||||||
.append("cusCode", getCusCode())
|
private String cusSaleOffice;
|
||||||
.append("cusName", getCusName())
|
|
||||||
.append("cusSapCode", getCusSapCode())
|
public String getCusSalesOrganization() { return cusSalesOrganization; }
|
||||||
.append("cusStreet", getCusStreet())
|
|
||||||
.append("cusPaymentTerms", getCusPaymentTerms())
|
public void setCusSalesOrganization(String cusSalesOrganization) { this.cusSalesOrganization = cusSalesOrganization; }
|
||||||
.append("cusPhoneNumber", getCusPhoneNumber())
|
|
||||||
.append("cusIndustryCode", getCusIndustryCode())
|
public String getCusDistributionChannel() { return cusDistributionChannel; }
|
||||||
.append("cusGroup", getCusGroup())
|
|
||||||
.append("cusVatNo", getCusVatNo())
|
public void setCusDistributionChannel(String cusDistributionChannel) { this.cusDistributionChannel = cusDistributionChannel; }
|
||||||
.append("cusType", getCusType())
|
|
||||||
.append("cusCountry", getCusCountry())
|
public String getCusSalesTerritory() { return cusSalesTerritory; }
|
||||||
.append("cusLanguage", getCusLanguage())
|
|
||||||
.append("cusLabel", getCusLabel())
|
public void setCusSalesTerritory(String cusSalesTerritory) { this.cusSalesTerritory = cusSalesTerritory; }
|
||||||
.append("cusClassification", getCusClassification())
|
|
||||||
.append("cusReceivingEmail", getCusReceivingEmail())
|
public String getCusSaleOffice() { return cusSaleOffice; }
|
||||||
.append("cusRecipient", getCusRecipient())
|
|
||||||
.append("cusRecipientPhone", getCusRecipientPhone())
|
public void setCusSaleOffice(String cusSaleOffice) { this.cusSaleOffice = cusSaleOffice; }
|
||||||
.append("cusRemark", getCusRemark())
|
|
||||||
.append("cusState", getCusState())
|
|
||||||
.append("cusApprovalStatus", getCusApprovalStatus())
|
|
||||||
.append("bankList", getBankList())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
|
||||||
|
<result property="cusSalesOrganization" column="cus_sales_organization" />
|
||||||
|
<result property="cusDistributionChannel" column="cus_distribution_channel" />
|
||||||
|
<result property="cusSalesTerritory" column="cus_sales_territory" />
|
||||||
|
<result property="cusSaleOffice" column="cus_sale_office" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="CustomerBankResult" type="Customer" extends="CustomerResult">
|
<resultMap id="CustomerBankResult" type="Customer" extends="CustomerResult">
|
||||||
|
@ -52,7 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number,
|
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number,
|
||||||
a.cus_industry_code, a.cus_group, a.cus_vat_no, a.cus_type, a.cus_country, a.cus_language, a.cus_label,
|
a.cus_industry_code, 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_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_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
|
||||||
from customer a
|
from customer a
|
||||||
<include refid="customerJoins"/>
|
<include refid="customerJoins"/>
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -71,8 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCustomerByCusId" parameterType="java.lang.String" resultMap="CustomerBankResult">
|
<select id="selectCustomerByCusId" parameterType="java.lang.String" resultMap="CustomerBankResult">
|
||||||
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number, a.cus_industry_code, 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,
|
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number, a.cus_industry_code,
|
||||||
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_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
|
||||||
from customer a
|
from customer a
|
||||||
left join bank b on b.cus_id = a.cus_id
|
left join bank b on b.cus_id = a.cus_id
|
||||||
where a.cus_id = #{cusId}
|
where a.cus_id = #{cusId}
|
||||||
|
@ -103,8 +114,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="cusState != null">cus_state,</if>
|
<if test="cusState != null">cus_state,</if>
|
||||||
<if test="cusApprovalStatus != null">cus_approval_status,</if>
|
<if test="cusApprovalStatus != null">cus_approval_status,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time,
|
||||||
</trim>
|
<if test="cusSalesOrganization != null and cusSalesOrganization != ''">cus_sales_organization,</if>
|
||||||
|
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">cus_distribution_channel,</if>
|
||||||
|
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">cus_sales_territory,</if>
|
||||||
|
<if test="cusSaleOffice != null and cusSaleOffice != ''">cus_sale_office,</if>
|
||||||
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="cusId != null">#{cusId},</if>
|
<if test="cusId != null">#{cusId},</if>
|
||||||
<if test="cusCode != null">#{cusCode},</if>
|
<if test="cusCode != null">#{cusCode},</if>
|
||||||
|
@ -128,7 +143,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="cusState != null">#{cusState},</if>
|
<if test="cusState != null">#{cusState},</if>
|
||||||
<if test="cusApprovalStatus != null">#{cusApprovalStatus},</if>
|
<if test="cusApprovalStatus != null">#{cusApprovalStatus},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
getdate()
|
getdate(),
|
||||||
|
<if test="cusSalesOrganization != null and cusSalesOrganization != ''">#{cusSalesOrganization},</if>
|
||||||
|
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">#{cusDistributionChannel},</if>
|
||||||
|
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">#{cusSalesTerritory},</if>
|
||||||
|
<if test="cusSaleOffice != null and cusSaleOffice != ''">#{cusSaleOffice},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -156,7 +175,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="cusState != null">cus_state = #{cusState},</if>
|
<if test="cusState != null">cus_state = #{cusState},</if>
|
||||||
<if test="cusApprovalStatus != null">cus_approval_status = #{cusApprovalStatus},</if>
|
<if test="cusApprovalStatus != null">cus_approval_status = #{cusApprovalStatus},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
update_time = getdate()
|
update_time = getdate(),
|
||||||
|
<if test="cusSalesOrganization != null and cusSalesOrganization != ''">cus_sales_organization = #{cusSalesOrganization},</if>
|
||||||
|
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">cus_distribution_channel = #{cusDistributionChannel},</if>
|
||||||
|
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">cus_sales_territory = #{cusSalesTerritory},</if>
|
||||||
|
<if test="cusSaleOffice != null and cusSaleOffice != ''">cus_sale_office = #{cusSaleOffice},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where cus_id = #{cusId}
|
where cus_id = #{cusId}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -24,4 +24,45 @@ export function getLanguage(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询SAP 付款条件数据
|
||||||
|
export function getPaymentTerms(query) {
|
||||||
|
return request({
|
||||||
|
url: '/rfc/rfc/getPaymentTerms',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询SAP 销售组织数据
|
||||||
|
export function getSalesOrganization(query) {
|
||||||
|
return request({
|
||||||
|
url: '/rfc/rfc/getSalesOrganization',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询SAP 分销渠道数据
|
||||||
|
export function getDistributionChannel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/rfc/rfc/getDistributionChannel',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询SAP 销售地区数据
|
||||||
|
export function getSalesTerritory(query) {
|
||||||
|
return request({
|
||||||
|
url: '/rfc/rfc/getSalesTerritory',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询SAP 销售办公室数据
|
||||||
|
export function getSaleOffice(query) {
|
||||||
|
return request({
|
||||||
|
url: '/rfc/rfc/getSaleOffice',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,18 +173,6 @@
|
||||||
<el-input v-model="form.cusStreet" placeholder="请输入街道/门牌号" :disabled="isDis"/>
|
<el-input v-model="form.cusStreet" placeholder="请输入街道/门牌号" :disabled="isDis"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!--<el-col :span="8">
|
|
||||||
<el-form-item label="付款条件" prop="cusPaymentTerms">
|
|
||||||
<el-select v-model="form.cusPaymentTerms" placeholder="请选择付款条件" style="width: 100%;" :disabled="isDis">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.cus_payment_terms"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>-->
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -227,9 +215,6 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--<el-form-item label="行业代码" prop="cusIndustryCode">
|
|
||||||
<el-input v-model="form.cusIndustryCode" placeholder="请输入行业代码" :disabled="isDis"/>
|
|
||||||
</el-form-item>-->
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
|
@ -257,9 +242,6 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
|
||||||
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- <el-row :gutter="8">
|
<!-- <el-row :gutter="8">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -328,6 +310,109 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="维护信息" name="checkInfo">
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="国家" prop="cusCountry">
|
||||||
|
<el-select v-model="form.cusCountry" placeholder="请选择国家" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in countrysDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="语言" prop="cusLanguage">
|
||||||
|
<el-select v-model="form.cusLanguage" placeholder="请选择语言" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in languageDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="付款条件" prop="cusPaymentTerms">
|
||||||
|
<el-select v-model="form.cusPaymentTerms" placeholder="请选择付款条件" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in paymentTermsDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="行业代码" prop="cusIndustryCode">
|
||||||
|
<el-select v-model="form.cusIndustryCode" placeholder="请选择行业代码" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in industryCodeDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="销售组织" prop="cusSalesOrganization">
|
||||||
|
<el-select v-model="form.cusSalesOrganization" placeholder="请选择销售组织" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in salesOrganizationDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="分销渠道" prop="cusDistributionChannel">
|
||||||
|
<el-select v-model="form.cusDistributionChannel" placeholder="请选择分销渠道" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in distributionChannelDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="8">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="销售地区" prop="cusSalesTerritory">
|
||||||
|
<el-select v-model="form.cusSalesTerritory" placeholder="请选择销售地区" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in salesTerritoryDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="销售办公室" prop="cusSaleOffice">
|
||||||
|
<el-select v-model="form.cusSaleOffice" placeholder="请选择销售办公室" style="width: 100%;" :disabled="isDis">
|
||||||
|
<el-option
|
||||||
|
v-for="item in saleOfficeDicts"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -390,11 +475,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, commitCustomer, qccListCustomer } from "@/api/customer/customer";
|
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, commitCustomer, qccListCustomer } from "@/api/customer/customer";
|
||||||
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
||||||
import { getCountrys,getIndustryCode,getLanguage } from "@/api/common/sapRfc";// sap-rfc 函数
|
import { getCountrys,getIndustryCode,getLanguage,getPaymentTerms,getSalesOrganization,getDistributionChannel,getSalesTerritory,getSaleOffice } from "@/api/common/sapRfc";// sap-rfc 函数
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Customer",
|
name: "Customer",
|
||||||
dicts: ['cus_payment_terms', 'cus_group', 'cus_approval_status', 'cus_language', 'cus_type', 'common_state'],
|
dicts: ['cus_group', 'cus_approval_status', 'cus_type', 'common_state'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//选项卡默认
|
//选项卡默认
|
||||||
|
@ -463,6 +548,18 @@ export default {
|
||||||
cusLanguage: [
|
cusLanguage: [
|
||||||
{ required: true, message: "语言不能为空", trigger: "change" }
|
{ required: true, message: "语言不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
|
cusSalesOrganization: [
|
||||||
|
{ required: true, message: "销售组织不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
cusDistributionChannel: [
|
||||||
|
{ required: true, message: "分销渠道不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
cusSalesTerritory: [
|
||||||
|
{ required: true, message: "销售地区不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
cusSaleOffice: [
|
||||||
|
{ required: true, message: "销售办公室不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
},
|
},
|
||||||
// 保存\提交,明细添加、删除 按钮显示
|
// 保存\提交,明细添加、删除 按钮显示
|
||||||
buttonShow: true,
|
buttonShow: true,
|
||||||
|
@ -495,6 +592,11 @@ export default {
|
||||||
countrysDicts: [], // 国家数据列表
|
countrysDicts: [], // 国家数据列表
|
||||||
industryCodeDicts: [], // 行业代码数据列表
|
industryCodeDicts: [], // 行业代码数据列表
|
||||||
languageDicts: [], // 语言数据列表
|
languageDicts: [], // 语言数据列表
|
||||||
|
paymentTermsDicts: [], // 付款条件数据列表
|
||||||
|
salesOrganizationDicts: [], // 销售组织数据列表
|
||||||
|
distributionChannelDicts: [], // 分销渠道数据列表
|
||||||
|
salesTerritoryDicts: [], // 销售地区数据列表
|
||||||
|
saleOfficeDicts: [], // 销售办公室数据列表
|
||||||
/*****************************SAP-RFC查询模块*************************************/
|
/*****************************SAP-RFC查询模块*************************************/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -568,37 +670,23 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加客户信息";
|
this.title = "添加客户信息";
|
||||||
//默认值
|
|
||||||
this.form.cusGroup = 'Z001';
|
|
||||||
this.form.cusCountry = 'CN';
|
|
||||||
this.form.cusLanguage = 'ZH';
|
|
||||||
this.form.cusType = '0';
|
|
||||||
|
|
||||||
//SAP国家数据列表
|
this.setInitF();
|
||||||
this.getCountrys();
|
this.setInitV();
|
||||||
//SAP行业代码数据列表
|
|
||||||
this.getIndustryCode();
|
|
||||||
//SAP语言数据列表
|
|
||||||
this.getLanguage();
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const cusId = row.cusId || this.ids
|
const cusId = row.cusId || this.ids
|
||||||
getCustomer(cusId).then(response => {
|
getCustomer(cusId).then(response => {
|
||||||
|
this.setInitF();
|
||||||
|
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.buttonShow = this.form.cusApprovalStatus == '0'?true:false;
|
this.buttonShow = this.form.cusApprovalStatus == '0'?true:false;
|
||||||
this.isDis = this.form.cusApprovalStatus == '0'?false:true;
|
this.isDis = this.form.cusApprovalStatus == '0'?false:true;
|
||||||
this.bankList = response.data.bankList;
|
this.bankList = response.data.bankList;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改客户信息";
|
this.title = "修改客户信息";
|
||||||
|
|
||||||
//SAP国家数据列表
|
|
||||||
this.getCountrys();
|
|
||||||
//SAP行业代码数据列表
|
|
||||||
this.getIndustryCode();
|
|
||||||
//SAP语言数据列表
|
|
||||||
this.getLanguage();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 保存按钮 */
|
/** 保存按钮 */
|
||||||
|
@ -739,6 +827,30 @@ export default {
|
||||||
},
|
},
|
||||||
/*****************************企查查查询模块*************************************/
|
/*****************************企查查查询模块*************************************/
|
||||||
/*****************************SAP-RFC查询模块*************************************/
|
/*****************************SAP-RFC查询模块*************************************/
|
||||||
|
// 默认值设置
|
||||||
|
setInitV(){
|
||||||
|
this.activeName = 'customerInfo';
|
||||||
|
|
||||||
|
this.form.cusGroup = 'Z001';
|
||||||
|
this.form.cusType = '0';
|
||||||
|
this.form.cusCountry = 'CN';
|
||||||
|
this.form.cusLanguage = 'ZH';
|
||||||
|
this.form.cusSalesOrganization = '1100';
|
||||||
|
this.form.cusDistributionChannel = '10';
|
||||||
|
},
|
||||||
|
// 加载SAP公共数据
|
||||||
|
setInitF(){
|
||||||
|
this.activeName = 'customerInfo';
|
||||||
|
|
||||||
|
this.getCountrys();
|
||||||
|
this.getIndustryCode();
|
||||||
|
this.getLanguage();
|
||||||
|
this.getPaymentTerms();
|
||||||
|
this.getSalesOrganization();
|
||||||
|
this.getDistributionChannel();
|
||||||
|
this.getSalesTerritory();
|
||||||
|
this.getSaleOffice();
|
||||||
|
},
|
||||||
//SAP国家数据列表
|
//SAP国家数据列表
|
||||||
getCountrys(){
|
getCountrys(){
|
||||||
getCountrys(this.queryParams).then(response => {
|
getCountrys(this.queryParams).then(response => {
|
||||||
|
@ -757,6 +869,36 @@ export default {
|
||||||
this.languageDicts = response.languageDicts;
|
this.languageDicts = response.languageDicts;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//SAP付款条件数据列表
|
||||||
|
getPaymentTerms(){
|
||||||
|
getPaymentTerms(this.queryParams).then(response => {
|
||||||
|
this.paymentTermsDicts = response.paymentTermsDicts;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//SAP销售组织数据列表
|
||||||
|
getSalesOrganization(){
|
||||||
|
getSalesOrganization(this.queryParams).then(response => {
|
||||||
|
this.salesOrganizationDicts = response.salesOrganizationDicts;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//SAP分销渠道数据列表
|
||||||
|
getDistributionChannel(){
|
||||||
|
getDistributionChannel(this.queryParams).then(response => {
|
||||||
|
this.distributionChannelDicts = response.distributionChannelDicts;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//SAP销售地区数据列表
|
||||||
|
getSalesTerritory(){
|
||||||
|
getSalesTerritory(this.queryParams).then(response => {
|
||||||
|
this.salesTerritoryDicts = response.salesTerritoryDicts;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//SAP销售办公室数据列表
|
||||||
|
getSaleOffice(){
|
||||||
|
getSaleOffice(this.queryParams).then(response => {
|
||||||
|
this.saleOfficeDicts = response.saleOfficeDicts;
|
||||||
|
});
|
||||||
|
},
|
||||||
/*****************************SAP-RFC查询模块*************************************/
|
/*****************************SAP-RFC查询模块*************************************/
|
||||||
},
|
},
|
||||||
/* computed: {
|
/* computed: {
|
||||||
|
|
Loading…
Reference in New Issue