Commit 2a5b65f2 authored by 覃振观's avatar 覃振观 👶

Merge remote-tracking branch 'origin/dev' into dev

parents 5ca9ee2a 4d77098a
......@@ -6,6 +6,7 @@ var customerPayInfoGridManager = null;
$(document).ready(function () {
initializeTab();
initializeUI();
initializeSelectMethod();
loadContactListGrid();
bindEvent();
loadBaoshenEmailListGrid();
......@@ -24,6 +25,19 @@ function initializeTab() {
$('#emailTab').tab()
}
function initializeSelectMethod() {
$('#selectedMonthlySettlementMethod').searchbox({
type: "monthlySettlementMethod",
name: "monthlySettlementMethodApplyCode",
onChange: function (value, data) {
$('#selectedMonthlySettlementMethod').val(data.method)
}
})
}
function loadContactListGrid() {
//增删改控件
......
......@@ -41,28 +41,82 @@
<div class="layout" id="customerBaseInfoDiv">
<x:hidden name="customerId"/>
<x:hidden name="customerBankId"/>
<x:hidden name="customerOrderId"/>
<x:inputC name="customerCode" label="客户编码" labelCol="1" fieldCol="2"/>
<x:inputC name="customerName" label="客户全称" labelCol="1" fieldCol="2"/>
<x:inputC name="customerShortName" label="客户简称" labelCol="1" fieldCol="2"/>
<x:inputC name="customerName" label="客户全称" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="paymentRequest" label="请款要求" labelCol="1" fieldCol="2"/>
<x:inputC name="customerShortName" label="客户简称" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="customerWorkTime" label="客户工作时间" wrapper="dateTime" labelCol="1" fieldCol="2"/>
<x:inputC name="customerEnName" label="英文名称" labelCol="1" fieldCol="2"/>
<x:inputC name="customerEnName" label="英文名称" labelCol="1" required="true" fieldCol="2"/>
<x:inputC name="customerEnShortName" label="英文名简称" labelCol="1" fieldCol="2"/>
<x:inputC name="provinceInfo" label="所属地区" maxLength="32" labelCol="1" fieldCol="2"
readonly="true"/>
<x:inputC name="provinceInfo" label="所属地区" maxLength="32" labelCol="1" fieldCol="2" readonly="true"/>
<x:hidden name="provinceCode"></x:hidden>
<x:selectC name="customerLevel" label="客户等级" dictionary="customerLevel" labelCol="1" fieldCol="2"/>
<x:inputC name="customerFactoryCode" label="工厂代号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAddress" label="地址" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerGroup" label="所属集团" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerZipCode" label="邮编" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerBankDeposit" label="开户银行" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAccountNo" label="银行账户" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAccountName" label="户名" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerCorporation" label="公司法人" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="businessRegistrationNumber" label="工商注册号" maxLength="32" labelCol="1"
fieldCol="2"/>
<x:inputC name="nationalTaxRegistrationNumber" label="国税注册号" maxLength="32" labelCol="1"
fieldCol="2"/>
<x:inputC name="deduction" label="扣款百分比" maxLength="32" labelCol="1" fieldCol="2"/>
<x:selectC name="signedBack" label="是否要求签回货单" dictionary="signedBack" labelCol="1" fieldCol="2"/>
<x:selectC name="customerSysOrder" label="是否用客户系统货单" dictionary="customerSysOrder" labelCol="1" fieldCol="2"/>
<x:selectC name="quotationCurrency" label="报价币别" dictionary="currency" labelCol="1" fieldCol="2"/>
<x:inputC name="decimalPlaces" label="金额小数位数" labelCol="1" fieldCol="2"/>
<x:inputC name="customerFactoryCode" label="工厂代号" labelCol="1" fieldCol="2"/>
<x:inputC name="signedStyle" label="签回方式" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="monthlySettlementMethod" label="月结方式" id="selectedMonthlySettlementMethod" wrapper="select" labelCol="1" fieldCol="2"/>
<x:inputC name="customerZipCode" label="邮编" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="accountDifficultLevel" label="做账难度等级" labelCol="1" fieldCol="2"/>
<x:inputC name="customerBankDeposit" label="开户银行" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAccountNo" label="银行账户" labelCol="1" fieldCol="2"/>
<x:selectC name="stampMethod" label="盖章方式" required="true" dictionary="stampMethod" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAccountName" label="户名" labelCol="1" fieldCol="2"/>
<x:inputC name="customerCorporation" label="公司法人" labelCol="1" fieldCol="2"/>
<x:selectC name="paymentRequestForm" label="请款联" dictionary="paymentRequestFrom" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="businessRegistrationNumber" label="工商注册号" labelCol="1" fieldCol="2"/>
<x:inputC name="nationalTaxRegistrationNumber" label="国税注册号" labelCol="1" fieldCol="2"/>
<x:selectC name="customerReceipt" label="客户联" required="true" dictionary="customerReceipt" labelCol="1" fieldCol="2"/>
<x:selectC name="orderKind" label="订单性质" dictionary="orderKind" labelCol="1" fieldCol="2"/>
<x:inputC name="customerBrand" label="品牌" labelCol="1" fieldCol="2"/>
<x:inputC name="customerAddress" label="地址" labelCol="1" fieldCol="2"/>
<x:inputC name="customerGroup" label="所属集团" labelCol="1" fieldCol="2"/>
<x:inputC name="receiverSignatureRequire" label="收货方签字要求" required="true" labelCol="1" fieldCol="2"/>
<x:selectC name="shipMethod" label="出货方式" required="true" dictionary="shipMethod" labelCol="1" fieldCol="2"/>
<x:selectC name="route" label="路线" required="true" dictionary="route" labelCol="1" fieldCol="2"/>
<x:inputC name="remark" label="备注" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="orderRequire" label="订单要求" required="true" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="acceptanceRequire" label="验收单要求" required="true" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="customerSysAcceptanceRequire" label="客户系统验收要求" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="accountDeadline" label="做账截止日" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="customerCollectionDeadline" label="客户收账单截止日" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="orderAbnormalDeadline" label="订单统计异常期限" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="shipAbnormalDeadline" label="送货单统计异常期限" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="paymentDeadline" label="请款期限" required="true" labelCol="1" fieldCol="2"/>
<x:selectC name="productInspectionReportType" label="产品检验报告类型" dictionary="productInspectionReportType" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="shipPrintRequire" label="货单打印要求" required="true" labelCol="1" fieldCol="2"/>
<x:selectC name="isPrintDeliveryDate" label="货单是否打印送货日期" dictionary="productInspectionReportType" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="needInvoice" label="是否开发票" labelCol="1" fieldCol="2"/>
<%--后续添加数据字典--%>
<x:inputC name="productionDeliveryMethod" label="生产交货方式" labelCol="1" fieldCol="2"/>
<div id="contact" position="center">
<x:title title="联系人列表" name="group"/>
<div id="contactListGrid" style="margin: 2px;">
......
......@@ -2,6 +2,7 @@ package com.huigou.topsun.customer.application;
import com.huigou.topsun.customer.domain.CustomerBank;
import com.huigou.topsun.customer.domain.CustomerContact;
import com.huigou.topsun.customer.domain.CustomerOrder;
import com.huigou.topsun.customer.domain.Province;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
......@@ -21,4 +22,6 @@ public interface CustomerBaseInfoApplication {
List<CustomerContact> findCustomerContactByCustomerId(String customerId);
void deleteByCustomerId(String customerId);
CustomerOrder findCustomerOrderByCustomerId(String customerId);
}
......@@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -45,6 +45,8 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
private CustomerPayInfoRepository customerPayInfoRepository;
@Autowired
private CustomerPayInfoApplication customerPayInfoApplication;
@Autowired
private CustomerOrderRepository customerOrderRepository;
/**
......@@ -112,10 +114,13 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
public CustomerVo saveCustomer(CustomerVo customerVo, List<CustomerContact> customerContactList, List<CustomerDebtContact> baoshenEmailList, List<CustomerDebtContact> customerEmailList, List<CustomerRelated> customerRelatedList, List<CustomerPayInfo> customerPayInfoList) {
Customer customer = getCustomer(customerVo);
CustomerBank customerBank = getCustomerBank(customerVo);
CustomerOrder customerOrder = getCustomerOrder(customerVo);
Customer saveCustomer = customerRepository.saveAndFlush(customer);
String customerId = saveCustomer.getCustomerId();
customerBank.setCustomerId(customerId);
CustomerBank saveCustomerBank = customerBankRepository.saveAndFlush(customerBank);
customerOrder.setCustomerId(customerId);
CustomerOrder saveCustomerOrder = customerOrderRepository.saveAndFlush(customerOrder);
customerContactList.forEach(customerContact -> {
customerContact.setCustomerId(customerId);
customerContactRepository.saveAndFlush(customerContact);
......@@ -145,6 +150,7 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
CustomerVo saveCustomerVo = new CustomerVo();
BeanUtils.copyProperties(saveCustomer, saveCustomerVo);
BeanUtils.copyProperties(saveCustomerBank, saveCustomerVo);
BeanUtils.copyProperties(saveCustomerOrder, saveCustomerVo);
return saveCustomerVo;
}
......@@ -174,4 +180,10 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
BeanUtils.copyProperties(customerVo, customerBank);
return customerBank;
}
public CustomerOrder getCustomerOrder(CustomerVo customerVo) {
CustomerOrder customerOrder = new CustomerOrder();
BeanUtils.copyProperties(customerVo, customerOrder);
return customerOrder;
}
}
......@@ -4,10 +4,7 @@ import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.topsun.customer.application.CustomerBaseInfoApplication;
import com.huigou.topsun.customer.domain.*;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import com.huigou.topsun.customer.repository.CustomerBankRepository;
import com.huigou.topsun.customer.repository.CustomerContactRepository;
import com.huigou.topsun.customer.repository.CustomerRepository;
import com.huigou.topsun.customer.repository.ProvinceRepository;
import com.huigou.topsun.customer.repository.*;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,6 +25,8 @@ public class CustomerBaseInfoApplicationImpl extends BaseApplication implements
private CustomerBankRepository customerBankRepository;
@Autowired
private CustomerContactRepository customerContactRepository;
@Autowired
private CustomerOrderRepository customerOrderRepository;
@Override
......@@ -89,16 +88,13 @@ public class CustomerBaseInfoApplicationImpl extends BaseApplication implements
this.sqlExecutorDao.executeUpdate(queryDescriptor.getSql(),customerId);
}
// /**
// * @param provinceCode
// * @return provinceList
// */
// @Override
// public Province findByProvinceParentId(String provinceCode) {
//
// Province province = provinceRepository.findByProvinceParentId(provinceCode);
// return province;
// }
@Override
public CustomerOrder findCustomerOrderByCustomerId(String customerId) {
CustomerOrder customerOrder = customerOrderRepository.findCustomerBankByCustomerId(customerId);
return customerOrder;
}
}
......@@ -76,9 +76,13 @@ public class CustomerController extends CommonController {
CustomerVo customerVo = loadCustomerDetail();
CustomerBank customerBank = loadCustomerBank();
CustomerOrder customerOrder = loadCustomerOrder();
if (customerBank != null) {
BeanUtils.copyProperties(customerBank, customerVo);
}
if (customerOrder != null) {
BeanUtils.copyProperties(customerOrder, customerVo);
}
return forward("customerDetail", customerVo);
}
......@@ -91,19 +95,7 @@ public class CustomerController extends CommonController {
return forward("customerDetail");
}
/**
* 根据id列表删除用户
*
* @return
*/
public String deleteCustomer() {
SDO sdo = getSDO();
List<String> ids = sdo.getIds();
//TODO
//删除操作
return success();
}
/**
* 保存客户信息(多表保存,添加事务)
......@@ -168,6 +160,17 @@ public class CustomerController extends CommonController {
return customerBank;
}
/**
* 加载订单信息
* @return
*/
public CustomerOrder loadCustomerOrder() {
SDO sdo = getSDO();
String customerId = sdo.getString("customerId");
CustomerOrder customerOrder = customerBaseInfoApplication.findCustomerOrderByCustomerId(customerId);
return customerOrder;
}
/**
* 根据id列表删除联系人
*
......
package com.huigou.topsun.customer.domain;
import java.io.Serializable;
import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
/**
* 客户订单信息
* @TableName customer_order
*/
@Table(name="customer_order")
@Entity
@Data
public class CustomerOrder implements Serializable {
/**
* 客户订单信息
*/
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "guid")
@Column(name = "customer_order_id")
private String customerOrderId;
/**
* 客户id
*/
@Column(name = "customer_id")
private String customerId;
/**
* 请款要求
*/
@Column(name = "payment_request")
private String paymentRequest;
/**
* 扣款百分比
*/
private Integer deduction;
/**
* 是否要求签回货单
*/
@Column(name = "signed_back")
private String signedBack;
/**
* 是否用客户系统货单
*/
@Column(name = "customer_sys_order")
private String customerSysOrder;
/**
* 报价币别(currency)
*/
@Column(name = "quotation_currency")
private String quotationCurrency;
/**
* 金额小数位数
*/
@Column(name = "decimal_places")
private Integer decimalPlaces;
/**
* 签回方式(signedStyle)
*/
@Column(name = "signed_style")
private String signedStyle;
/**
* 月结方式(monthlySettlementMethod)
*/
@Column(name = "monthly_settlement_method")
private String monthlySettlementMethod;
/**
* 做账难度等级(accountDifficultLevel)
*/
@Column(name = "account_difficult_level")
private String accountDifficultLevel;
/**
* 盖章方式(stampMethod)
*/
@Column(name = "stamp_method")
private String stampMethod;
/**
* 请款联(paymentRequestForm)
*/
@Column(name = "payment_request_form")
private String paymentRequestForm;
/**
* 客户联(customerReceipt)
*/
@Column(name = "customer_receipt")
private String customerReceipt;
/**
* 订单性质(orderKind)
*/
@Column(name = "order_kind")
private String orderKind;
/**
* 品牌
*/
@Column(name = "customer_brand")
private String customerBrand;
/**
* 收货方签字要求
*/
@Column(name = "receiver_signature_require")
private String receiverSignatureRequire;
/**
* 出货方式(shipMethod)
*/
@Column(name = "ship_method")
private String shipMethod;
/**
* 路线(route)
*/
private String route;
/**
* 备注
*/
private String remark;
/**
* 订单要求(orderRequire)
*/
@Column(name = "order_require")
private String orderRequire;
/**
* 验收要求
*/
@Column(name = "acceptance_require")
private String acceptanceRequire;
/**
* 客户系统验收要求
*/
@Column(name = "customer_sys_acceptance_require")
private String customerSysAcceptanceRequire;
/**
* 做账截止日期
*/
@Column(name = "account_deadline")
private Integer accountDeadline;
/**
* 客户收账单截止日
*/
@Column(name = "customer_collection_deadline")
private Integer customerCollectionDeadline;
/**
* 订单统计异常期限
*/
@Column(name = "order_abnormal_deadline")
private Integer orderAbnormalDeadline;
/**
* 送货单统计异常期限
*/
@Column(name = "ship_abnormal_deadline")
private Integer shipAbnormalDeadline;
/**
* 请款期限
*/
@Column(name = "payment_deadline")
private Integer paymentDeadline;
/**
* 产品检验报告类型(productInspectionReportType)
*/
@Column(name = "product_inspection_report_type")
private String productInspectionReportType;
/**
* 货单打印要求(shipPrintRequire)
*/
@Column(name = "ship_print_require")
private String shipPrintRequire;
/**
* 货单是否打印送货日期
*/
@Column(name = "is_print_delivery_date")
private String isPrintDeliveryDate;
/**
* 是否开发票
*/
@Column(name = "need_invoice")
private String needInvoice;
/**
* 生产交货方式(productionDeliveryMethod)
*/
@Column(name = "production_delivery_method")
private String productionDeliveryMethod;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.huigou.topsun.customer.domain.Customer;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;
......@@ -114,6 +115,168 @@ public class CustomerVo implements Serializable {
*/
private String nationalTaxRegistrationNumber;
/**
* 客户订单信息id
*/
private String customerOrderId;
/**
* 请款要求
*/
private String paymentRequest;
/**
* 扣款百分比
*/
private Integer deduction;
/**
* 是否要求签回货单
*/
private String signedBack;
/**
* 是否用客户系统货单
*/
private String customerSysOrder;
/**
* 报价币别(currency)
*/
private String quotationCurrency;
/**
* 金额小数位数
*/
private Integer decimalPlaces;
/**
* 签回方式(signedStyle)
*/
private String signedStyle;
/**
* 月结方式(monthlySettlementMethod)
*/
private String monthlySettlementMethod;
/**
* 做账难度等级(accountDifficultLevel)
*/
private String accountDifficultLevel;
/**
* 盖章方式(stampMethod)
*/
private String stampMethod;
/**
* 请款联(paymentRequestForm)
*/
private String paymentRequestForm;
/**
* 客户联(customerReceipt)
*/
private String customerReceipt;
/**
* 订单性质(orderKind)
*/
private String orderKind;
/**
* 品牌
*/
private String customerBrand;
/**
* 收货方签字要求
*/
private String receiverSignatureRequire;
/**
* 出货方式(shipMethod)
*/
private String shipMethod;
/**
* 路线(route)
*/
private String route;
/**
* 备注
*/
private String remark;
/**
* 订单要求(orderRequire)
*/
private String orderRequire;
/**
* 验收要求
*/
private String acceptanceRequire;
/**
* 客户系统验收要求
*/
private String customerSysAcceptanceRequire;
/**
* 做账截止日期
*/
private Integer accountDeadline;
/**
* 客户收账单截止日
*/
private Integer customerCollectionDeadline;
/**
* 订单统计异常期限
*/
private Integer orderAbnormalDeadline;
/**
* 送货单统计异常期限
*/
private Integer shipAbnormalDeadline;
/**
* 请款期限
*/
private Integer paymentDeadline;
/**
* 产品检验报告类型(productInspectionReportType)
*/
private String productInspectionReportType;
/**
* 货单打印要求(shipPrintRequire)
*/
private String shipPrintRequire;
/**
* 货单是否打印送货日期
*/
private String isPrintDeliveryDate;
/**
* 是否开发票
*/
private String needInvoice;
/**
* 生产交货方式(productionDeliveryMethod)
*/
private String productionDeliveryMethod;
public String getCustomerId() {
return customerId;
}
......
package com.huigou.topsun.customer.repository;
import com.huigou.topsun.customer.domain.CustomerOrder;
import org.springframework.data.jpa.repository.JpaRepository;
public interface CustomerOrderRepository extends JpaRepository<CustomerOrder, String> {
CustomerOrder findCustomerBankByCustomerId(String customerId);
}
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