Commit e9b4c25b authored by 全洪江's avatar 全洪江

客户主数据sap对接

parent 0f17487c
......@@ -123,25 +123,31 @@ function loadContactListGrid() {
contactGridManager = UICtrl.grid("#contactListGrid", {
columns: [
{
display: "联系人名称", name: "contactName", width: 300, minWidth: 60, type: "string", align: "left",
display: "联系人名称", name: "contactName", width: 150, minWidth: 60, type: "string", align: "left",
editor: {
required: true, type: "text"
}
},
{
display: "联系人电话", name: "contactPhone", width: 300, minWidth: 60, type: "string", align: "left",
display: "职位", name: "contactPosition", width: 150, minWidth: 60, type: "string", align: "left",
editor: {
required: true, type: "text"
}
},
{
display: "传真", name: "contactFax", width: 300, minWidth: 60, type: "string", align: "left",
display: "联系人电话", name: "contactPhone", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
required: true, type: "text"
}
},
{
display: "传真", name: "contactFax", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
required: false, type: "text"
}
},
{
display: "邮箱", name: "contactEmail", width: 300, minWidth: 60, type: "string", align: "left",
display: "邮箱", name: "contactEmail", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
required: true, type: "text"
}
......@@ -593,6 +599,10 @@ function bindEvent() {
saveData();
})
$("#submit").click(function () {//提交给sap
submitToSap();
})
$("#close").click(function () {//关闭
closeDispatchTabItem();
})
......@@ -645,6 +655,18 @@ function saveData() {
);
}
function submitToSap() {
var customerDetail = getCustomerDetail();
if (!customerDetail) {
return;
}
Public.ajax(web_app.name + '/customer/submitCustomerToSAP.ajax', customerDetail,
function () {
Public.successTip("common.tip.success");
}
)
}
function closeDispatchTabItem() {
UICtrl.closeCurrentTab();
}
......
......@@ -22,7 +22,8 @@ function loadCustomerInfoListGrid() {
gridManager = UICtrl.grid("#customerInfoListGrid", {
columns: [
{display: "客户编码", name: "customerCode", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "客户名称", name: "customerShortName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "客户名称", name: "customerName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "客户名称简称", name: "customerShortName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "客户英文名称", name: "customerEnName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "客户英文名称简称", name: "customerEnShortName", width: 160, minWidth: 60, type: "string", align: "left"},
{display: "客户工作时间", name: "customerWorkTime", width: 120, minWidth: 60, type: "datetime", align: "left"},
......
......@@ -20,7 +20,7 @@
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<%--查询表单--%>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="ruleKind" required="false" label="客户名称" labelCol="1"/>
<x:inputC name="customerName" required="false" label="客户名称" labelCol="1"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
......
package com.huigou.topsun.customer.application.Impl;
import com.huigou.topsun.customer.application.SapCustomerApplication;
import com.huigou.topsun.customer.domain.CustomerContact;
import com.huigou.topsun.customer.domain.sap.CustomerDto;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import com.huigou.uasp.bmp.common.application.AbstractApplication;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class SapCustomerApplicationImpl extends AbstractApplication implements SapCustomerApplication {
@Override
public CustomerDto submitCustomerToSAP(CustomerVo customerVo, CustomerContact customerContact) {
CustomerDto customerDto = new CustomerDto();
//账目组
// customerDto.setBU_GROUP();
//sap:客户编号customerCode 金库:客户编码KUNNR
// customerDto.setKUNNR();
//业务伙伴角色
// customerDto.setPLTYP();
//客户名称
String customerName = customerVo.getCustomerName();
customerDto.setNAME1(customerName);
//客户简称
String customerShortName = customerVo.getCustomerShortName();
customerDto.setBU_SORT(customerShortName);
//收货地址
String customerAddress = customerVo.getCustomerAddress();
customerDto.setSTRAS(customerAddress);
//客户送货地址(固定)
// customerDto.setSTR_SUPPL3();
//城市
String city = customerVo.getCity();
customerDto.setCITY1(city);
//国家
// customerDto.setLAND1();
//地区
String province = customerVo.getProvince();
String region = province + city;
customerDto.setREGIO(region);
//语言
// customerDto.setSPRAS();
//邮政编码
String customerZipCode = customerVo.getCustomerZipCode();
customerDto.setPOST_CODE1(customerZipCode);
//公司电话号码
// customerDto.setTELF1();
//公司移动电话
// customerDto.setTEL_NUMBER();
//公司传真
// customerDto.setTELFX();
//公司邮箱
// customerDto.setSMTP_ADDR();
//开户银行代码(?)
String customerBankId = customerVo.getCustomerBankId();
customerDto.setBANKL(customerBankId);
//银行账号
String customerAccountNo = customerVo.getCustomerAccountNo();
customerDto.setBANKN(customerAccountNo);
//做账难度等级
String accountDifficultLevel = customerVo.getAccountDifficultLevel();
customerDto.setKUKLA(accountDifficultLevel);
//要求用客户系统货单(是、否)
String customerSysOrder = customerVo.getCustomerSysOrder();
customerDto.setKATR1(customerSysOrder);
//盖章方式(传key)
String stampMethod = customerVo.getStampMethod();
customerDto.setKATR2(stampMethod);
//请款联(传key,key是sap字典的数字编码)
String paymentRequestForm = customerVo.getPaymentRequestForm();
customerDto.setKATR3(paymentRequestForm);
//客户联(传key,key是sap字典的数字编码)
String customerReceipt = customerVo.getCustomerReceipt();
customerDto.setKATR4(customerReceipt);
//订单要求(sap数据字典)
String orderRequire = customerVo.getOrderRequire();
customerDto.setKATR5(orderRequire);
//验收单要求(sap数据字典)
String acceptanceRequire = customerVo.getAcceptanceRequire();
customerDto.setKATR6(acceptanceRequire);
//客户系统验收要求()
String customerSysAcceptanceRequire = customerVo.getCustomerSysAcceptanceRequire();
customerDto.setKATR7(customerSysAcceptanceRequire);
//要求签回货单
String signedBack = customerVo.getSignedBack();
customerDto.setKATR8(signedBack);
//货单是否打印送货日期
String isPrintDeliveryDate = customerVo.getIsPrintDeliveryDate();
customerDto.setKATR9(isPrintDeliveryDate);
//不开发票
String needInvoice = customerVo.getNeedInvoice();
customerDto.setKATR10(needInvoice);
//请款要求
String paymentRequest = customerVo.getPaymentRequest();
customerDto.setZT01(paymentRequest);
//客户工作时间
Date customerWorkTime = customerVo.getCustomerWorkTime();
customerDto.setZT02(String.valueOf(customerWorkTime));
//收货方签字要求
String receiverSignatureRequire = customerVo.getReceiverSignatureRequire();
customerDto.setZT03(receiverSignatureRequire);
//货单打印要求
String shipPrintRequire = customerVo.getShipPrintRequire();
customerDto.setZT04(shipPrintRequire);
//品牌
String customerBrand = customerVo.getCustomerBrand();
customerDto.setZF01(customerBrand);
//职位
String contactPosition = customerContact.getContactPosition();
customerDto.setZF02(contactPosition);
//联系人
String contactName = customerContact.getContactName();
customerDto.setZF03(contactName);
//电话号码
String contactPhone = customerContact.getContactPhone();
customerDto.setZF04(contactPhone);
//e_Mail
String contactEmail = customerContact.getContactEmail();
customerDto.setZF05(contactEmail);
//经营类型
// customerDto.setZF06();
//工厂代号
String customerFactoryCode = customerVo.getCustomerFactoryCode();
customerDto.setZF07(customerFactoryCode);
//产品检验报告类型
String productInspectionReportType = customerVo.getProductInspectionReportType();
customerDto.setZF08(productInspectionReportType);
//货单签回方式
String signedStyle = customerVo.getSignedStyle();
customerDto.setZF09(signedStyle);
//出货方式
String shipMethod = customerVo.getShipMethod();
customerDto.setZF10(shipMethod);
//路线
String route = customerVo.getRoute();
customerDto.setZF11(route);
//送货单打印默认设置
// customerDto.setZF12();
//送货单统计异常期限
Integer shipAbnormalDeadline = customerVo.getShipAbnormalDeadline();
customerDto.setZF13(String.valueOf(shipAbnormalDeadline));
//生产发货方式
String productionDeliveryMethod = customerVo.getProductionDeliveryMethod();
customerDto.setZF14(productionDeliveryMethod);
//月结方式
String monthlySettlementMethod = customerVo.getMonthlySettlementMethod();
customerDto.setZF15(monthlySettlementMethod);
//请款期限
Integer paymentDeadline = customerVo.getPaymentDeadline();
customerDto.setZF16(String.valueOf(paymentDeadline));
//做账截止日
Integer accountDeadline = customerVo.getAccountDeadline();
customerDto.setZF17(String.valueOf(accountDeadline));
//客户收账截止日
Integer customerCollectionDeadline = customerVo.getCustomerCollectionDeadline();
customerDto.setZF18(String.valueOf(customerCollectionDeadline));
//订单统计异常期限
Integer orderAbnormalDeadline = customerVo.getOrderAbnormalDeadline();
customerDto.setZF19(String.valueOf(orderAbnormalDeadline));
//公司代码
// customerDto.setBUKRS();
//统驭科目
// customerDto.setAKONT();
//销售组织
// customerDto.setVKORG();
//分销渠道
// customerDto.setVTWEG();
//产品组
// customerDto.setSPART();
//客户组
// customerDto.setKDGRP();
//销售办公室
// customerDto.setVKBUR();
//销售小组
// customerDto.setVKGRP();
//客户分类
// customerDto.setKLABC();
//币别
String quotationCurrency = customerVo.getQuotationCurrency();
customerDto.setWAERS(quotationCurrency);
//汇率类型
// customerDto.setKURST();
//价格清单
// customerDto.setPLTYP();
//国际贸易条款
// customerDto.setINCO1();
//国际贸易条款位置
// customerDto.setINCO2();
//付款条件
// customerDto.setZTERM();
//客户科目分配组
// customerDto.setKTGRD();
//税收类别
// customerDto.setTATYP();
//客户税分类
// customerDto.setTAXKD();
return customerDto;
}
}
package com.huigou.topsun.customer.application;
import com.huigou.topsun.customer.domain.CustomerContact;
import com.huigou.topsun.customer.domain.sap.CustomerDto;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
public interface SapCustomerApplication {
CustomerDto submitCustomerToSAP(CustomerVo customerVo, CustomerContact customerContact);
}
......@@ -3,25 +3,25 @@ package com.huigou.topsun.customer.controller;
import com.huigou.topsun.customer.application.CustomerBaseInfoApplication;
import com.huigou.topsun.customer.application.CustomerApplication;
import com.huigou.topsun.customer.application.CustomerOrderApplication;
import com.huigou.topsun.customer.application.SapCustomerApplication;
import com.huigou.topsun.customer.domain.*;
import com.huigou.topsun.customer.domain.query.CustomerQueryRequest;
import com.huigou.topsun.customer.domain.sap.CustomerDto;
import com.huigou.topsun.customer.domain.vo.CustomerListVo;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import com.huigou.topsun.customer.domain.vo.ReturnCustomerListVo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.annotation.SkipAuth;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.JSONUtil;
import com.huigou.util.SDO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
......@@ -32,13 +32,17 @@ public class CustomerController extends CommonController {
@Autowired
private CustomerApplication customerApplication;
@Autowired
private CustomerOrderApplication customerOrderApplication;
private SapCustomerApplication sapCustomerApplication;
@Override
protected String getPagePath() {
return "/biz/topsun/customer/";
}
/**
* 金库查询客户接口
* @return
*/
@SkipAuth
public String getCustomerList() {
List<CustomerListVo> customerListVoList = customerApplication.getCustomerList();
......@@ -138,6 +142,16 @@ public class CustomerController extends CommonController {
}
public String submitCustomerToSAP() {
SDO sdo = getSDO();
CustomerVo customerVo = sdo.toObject(CustomerVo.class);
List<CustomerContact> customerContactList = sdo.getList("contactList", CustomerContact.class);
CustomerContact customerContact = customerContactList.get(0);
CustomerDto customerDto = sapCustomerApplication.submitCustomerToSAP(customerVo, customerContact);
return JSONUtil.toString(customerDto);
}
// /**
// * 展示客户省市数据,如果客户的省份编码是省级行政单位,直接返回省份数据,
// * 如果客户的省份编码是二级或者三级行政单位,则需要返回对应的省级或者市级行政单位
......
......@@ -8,9 +8,10 @@ import org.hibernate.annotations.GenericGenerator;
/**
* 客户联系人信息
*
* @TableName customer_contact
*/
@Table(name="customer_contact")
@Table(name = "customer_contact")
@Data
@Entity
public class CustomerContact implements Serializable {
......@@ -35,6 +36,12 @@ public class CustomerContact implements Serializable {
@Column(name = "contact_name")
private String contactName;
/**
* 职位
*/
@Column(name = "contact_position")
private String contactPosition;
/**
* 联系人电话
*/
......
package com.huigou.topsun.customer.domain.sap;
import lombok.Data;
@Data
public class CustomerDto {
/**
* 账目组
*/
private String BU_GROUP;
/**
* 客户编号
*/
private String KUNNR;
/**
* 业务伙伴角色
*/
private String RLTYP;
/**
* 客户名称
*/
private String NAME1;
/**
* 客户简称
*/
private String BU_SORT;
/**
* 收货地址
*/
private String STRAS;
/**
* 客户送货地址(固定)
*/
private String STR_SUPPL3;
/**
* 城市
*/
private String CITY1;
/**
* 国家
*/
private String LAND1;
/**
* 地区
*/
private String REGIO;
/**
* 语言
*/
private String SPRAS;
/**
* 邮政编码
*/
private String POST_CODE1;
/**
* 电话号码
*/
private String TELF1;
/**
* 移动电话
*/
private String TEL_NUMBER;
/**
* 传真
*/
private String TELFX;
/**
* Email
*/
private String SMTP_ADDR;
/**
* 开户银行代码
*/
private String BANKL;
/**
* 银行账号
*/
private String BANKN;
/**
* 做帐难度等级
*/
private String KUKLA;
/**
* 要求用客户系统货单
*/
private String KATR1;
/**
* 盖章方式
*/
private String KATR2;
/**
* 请款联
*/
private String KATR3;
/**
* 客户联
*/
private String KATR4;
/**
* 订单要求
*/
private String KATR5;
/**
* 验收单要求
*/
private String KATR6;
/**
* 客户系统验收要求
*/
private String KATR7;
/**
* 要求签回货单
*/
private String KATR8;
/**
* 货单是否打印送货日期
*/
private String KATR9;
/**
* 不开发票
*/
private String KATR10;
/**
* 请款要求
*/
private String ZT01;
/**
* 客户工作时间
*/
private String ZT02;
/**
* 收货方签字要求
*/
private String ZT03;
/**
* 货单打印要求
*/
private String ZT04;
/**
* 品牌
*/
private String ZF01;
/**
* 职位
*/
private String ZF02;
/**
* 联系人
*/
private String ZF03;
/**
* 电话号码
*/
private String ZF04;
/**
* e_Mail
*/
private String ZF05;
/**
* 经营类型
*/
private String ZF06;
/**
* 工厂代号
*/
private String ZF07;
/**
* 产品检验报告类型
*/
private String ZF08;
/**
* 货单签回方式
*/
private String ZF09;
/**
* 出货方式
*/
private String ZF10;
/**
* 线路
*/
private String ZF11;
/**
* 送货单打印默认设置
*/
private String ZF12;
/**
* 送货单统计异常期限
*/
private String ZF13;
/**
* 生产发货方式
*/
private String ZF14;
/**
* 月结方式
*/
private String ZF15;
/**
* 请款期限
*/
private String ZF16;
/**
* 做账截止日
*/
private String ZF17;
/**
* 客户收账截止日
*/
private String ZF18;
/**
* 订单统计异常期限
*/
private String ZF19;
/**
* 公司代码
*/
private String BUKRS;
/**
* 统驭科目
*/
private String AKONT;
/**
* 销售组织
*/
private String VKORG;
/**
* 分销渠道
*/
private String VTWEG;
/**
* 产品组
*/
private String SPART;
/**
* 客户组
*/
private String KDGRP;
/**
* 销售办公室
*/
private String VKBUR;
/**
* 销售小组
*/
private String VKGRP;
/**
* 客户分类
*/
private String KLABC;
/**
* 币别
*/
private String WAERS;
/**
* 汇率类型
*/
private String KURST;
/**
* 价格清单
*/
private String PLTYP;
/**
* 国际贸易条款
*/
private String INCO1;
/**
* 国际贸易条款位置
*/
private String INCO2;
/**
* 付款条件
*/
private String ZTERM;
/**
* 客户科目分配组
*/
private String KTGRD;
/**
* 税收类别
*/
private String TATYP;
/**
* 客户税分类
*/
private String TAXKD;
/**
* 装运条件
*/
private String VSBED;
}
......@@ -103,7 +103,7 @@ public class CustomerVo implements Serializable {
private String customerZipCode;
/**
*
* 开户银行id
*/
private String customerBankId;
......@@ -295,7 +295,7 @@ public class CustomerVo implements Serializable {
private String needInvoice;
/**
* 生产货方式(productionDeliveryMethod)
* 生产货方式(productionDeliveryMethod)
*/
private String productionDeliveryMethod;
......
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="deleteCustomerBank" label="删除客户银行信息" table="customer_bank">
<sql-query>
delete
from customer_bank c
where customer_id = ?
</sql-query>
</query>
<query name="customerList" label="客户信息表" table="customer">
<sql-query>
select c.* from customer c where 1=1
</sql-query>
<condition column="customer_name" name="customerName" type="java.lang.String" symbol="like" alias="c"/>
</query>
<query name="getCustomerList" label="对外查询客户信息" table="customer">
<sql-query>
SELECT customer.customer_id,customer.customer_name,customer.province_code,co.quotation_currency,co.monthly_settlement_method,co.order_kind,ccc.contact_name,ccc.contact_phone,ccc.contact_fax,ccc.contact_email,co.remark
FROM customer LEFT JOIN
(SELECT c.customer_id,cc.contact_name,cc.contact_phone,cc.contact_fax,cc.contact_email FROM customer c LEFT JOIN customer_contact cc ON c.customer_id = cc.customer_id) AS ccc
ON customer.customer_id = ccc.customer_id LEFT JOIN customer_order co
ON customer.customer_id = co.customer_id
</sql-query>
</query>
<query name="customerDebtContact" label="催货款通知邮箱表" table="customer_debt_contact">
<sql-query>
select c.*
from customer_debt_contact c
where customer_id = ?
and customer_email_type = ?
</sql-query>
</query>
<query name="deleteCustomerDebtContact" label="删除催货款通知邮箱" table="customer_debt_contact">
<sql-query>
delete
from customer_debt_contact c
where customer_id = ?
</sql-query>
</query>
<query name="customerRelated" label="客户关系关联信息表" table="customer_related">
<sql-query>
select c.*
from customer_related c
where customer_id = ?
</sql-query>
</query>
<query name="deleteCustomerRelated" label="删除客户关系关联信息" table="customer_related">
<sql-query>
delete
from customer_related c
where customer_id = ?
</sql-query>
</query>
<query name="CustomerPayInfo" label="客户付款信息表" table="customer_pay_info">
<sql-query>
select c.*
from customer_pay_info c
where customer_id = ?
</sql-query>
</query>
<query name="deleteCustomerPayInfo" label="删除客户付款信息" table="customer_pay_info">
<sql-query>
delete
from customer_pay_info c
where customer_id = ?
</sql-query>
</query>
<query name="contactList" label="联系人信息表" table="customer_contact">
<sql-query>
select c.* from customer_contact c where c.customer_id = ?
</sql-query>
</query>
<query name="deleteContact" label="删除联系人信息" table="customer_contact">
<sql-query>
delete
from customer_contact c
where customer_id = ?
</sql-query>
</query>
<query name="monthlySettlementMethod" label="月结方式表" table="monthly_settlement_method">
<sql-query>
select t.* from monthly_settlement_method t where 1=1 order by t.sequence
</sql-query>
</query>
</query-mappings>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment