Commit 71231c18 authored by 全洪江's avatar 全洪江

客户详细信息展示

parent 67d165ce
var sizeGroupGridManager = null;
$(document).ready(function () {
initializateUI();
loadSizeGroupListGrid();
//bindQueryEvent();
bindEvent();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8" language="java"%> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x"%> <%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<x:base include="layout,dialog,grid,dateTime,tree,combox,attachment" />
<html> <html>
<head> <head>
<title>Title</title> <x:base include="layout,dialog,grid,tree,combox,commonTree"/>
<x:script src='/system/opm/js/OpmUtil.js'/>
<x:script src='/biz/topsun/common/purchaseCommon.js'/>
<x:script src='/biz/topsun/customer/customerDetail.js'/>
</head> </head>
<body> <body>
<x:billTitle title="客户信息详情" needStatus="false" needPerson="true"/>
<div class="blank_div clearfix"></div>
<button class="btn btn-default" type="button" id="close" style="left: 200px;float:right;bottom: 10px;">关闭</button>
<button class="btn btn-success" type="button" id="save" style="left: 200px;float:right;bottom: 10px;">保存</button>
<div class="blank_div clearfix"></div>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<div><h3>客户基本信息</h3></div>
<div style="margin: 10px;">
<div class="hg-form-cols">
<x:hidden name="customerId"/>
<x:inputC name="customerCode" label="客户编码" labelCol="1" fieldCol="2"/>
<x:inputC name="customerName" label="客户全称" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="customerShortName" label="客户简称" labelCol="1" fieldCol="2"/>
<x:inputC name="customerWorkTime" label="客户工作时间" wrapper="date" labelCol="1" fieldCol="2"/>
<x:inputC name="customerEnName" label="英文名称" labelCol="1" 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="customerLevel" label="客户等级" maxLength="32" 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"/>
</div>
</div>
<div class="blank_div clearfix"></div>
<div><h3>催货通知邮箱</h3></div>
<div class="blank_div clearfix"></div>
<div><h3>其他信息</h3></div>
</form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -46,7 +46,7 @@ function loadCustomerInfoListGrid() { ...@@ -46,7 +46,7 @@ function loadCustomerInfoListGrid() {
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) { onDblClickRow: function (data, rowindex, rowobj) {
doView(data); updateHandler(data);
} }
}); });
UICtrl.setSearchAreaToggle(gridManager); UICtrl.setSearchAreaToggle(gridManager);
...@@ -75,28 +75,28 @@ function deleteHandler() { ...@@ -75,28 +75,28 @@ function deleteHandler() {
} }
}); });
} }
// parms: {
// page: 0,
// size: 30
// },
function doView(data) {
var id = data.customerId;
if (!id) { /**
id = DataUtil.getUpdateRowId(gridManager); * 刷新表格
if (!id) { */
function reloadGrid(obj) {
sizeGroupGridManager.loadData();
}
function updateHandler(data) {
if (!data) {
data = DataUtil.getUpdateRow(gridManager);
if(!data) {
return; return;
} }
} }
var url = DataUtil.composeURLByParam('/customer/forwardCustomerDetail.do', {id: JSON.stringify(id)}); UICtrl.addTabItem({
UICtrl.addTabItem({tabid: 'viewFlowChart' + id, text: "客户详细信息", url: url}); tabid: 'customerDetail',
// debugger; text: '客户详细信息',
// UICtrl.addTabItem({ url: web_app.name + '/customer/forwardCustomerDetail.do?customerId=' + data.customerId
// tabid: 'viewFlowChart' + id, })
// text: "产品信息",
// url: web_app.name + '/bizFlowChart/showViewFlowchart.load?businessProcessId=' + id
// });
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html> <html>
<head> <head>
<title>Title</title>
<x:base include="layout,dialog,grid,tree,combox,commonTree" /> <x:base include="layout,dialog,grid,tree,combox,commonTree" />
<x:script src='/system/opm/js/OpmUtil.js'/> <x:script src='/system/opm/js/OpmUtil.js'/>
<x:script src='/biz/topsun/common/purchaseCommon.js'/> <x:script src='/biz/topsun/common/purchaseCommon.js'/>
......
package com.huigou.topsun.customer.application; package com.huigou.topsun.customer.application;
import com.huigou.topsun.customer.domain.vo.Province; import com.huigou.topsun.customer.domain.Province;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import java.util.List; import java.util.List;
public interface CustomerBaseInfoApplication { public interface CustomerBaseInfoApplication {
Province findByProvinceParentId(String provinceCode); // Province findByProvinceParentId(String provinceCode);
List<Province> findByProvinceCode(String provinceCode); List<Province> findByProvinceCode(String provinceCode);
CustomerVo findCustomerByCustomerId(String customerId);
} }
package com.huigou.topsun.customer.application.Impl; package com.huigou.topsun.customer.application.Impl;
import com.huigou.topsun.customer.application.CustomerBaseInfoApplication; import com.huigou.topsun.customer.application.CustomerBaseInfoApplication;
import com.huigou.topsun.customer.domain.vo.Province; import com.huigou.topsun.customer.domain.Customer;
import com.huigou.topsun.customer.domain.Province;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import com.huigou.topsun.customer.repository.CustomerRepository;
import com.huigou.topsun.customer.repository.ProvinceRepository; import com.huigou.topsun.customer.repository.ProvinceRepository;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,6 +17,8 @@ import java.util.List; ...@@ -13,6 +17,8 @@ import java.util.List;
public class CustomerBaseInfoApplicationImpl implements CustomerBaseInfoApplication { public class CustomerBaseInfoApplicationImpl implements CustomerBaseInfoApplication {
@Autowired @Autowired
private ProvinceRepository provinceRepository; private ProvinceRepository provinceRepository;
@Autowired
private CustomerRepository customerRepository;
@Override @Override
...@@ -23,29 +29,48 @@ public class CustomerBaseInfoApplicationImpl implements CustomerBaseInfoApplicat ...@@ -23,29 +29,48 @@ public class CustomerBaseInfoApplicationImpl implements CustomerBaseInfoApplicat
if (province != null) { if (province != null) {
String provinceParentId = province.getProvinceParentId(); String provinceParentId = province.getProvinceParentId();
//获取上一级信息 //获取上一级信息
Province parentProvince = findByProvinceParentId(provinceParentId); Province parentProvince = provinceRepository.findByProvinceCode(provinceParentId);
if (parentProvince != null || !parentProvince.getProvinceParentId().equals(0)) { if (parentProvince != null && !provinceParentId.equals(0)) {
//获取上一级信息 //获取上一级信息
Province grandParentProvince = findByProvinceParentId(parentProvince.getProvinceParentId()); Province grandParentProvince = provinceRepository.findByProvinceCode(parentProvince.getProvinceParentId());
if (grandParentProvince != null) {
provinceList.add(grandParentProvince);
}
provinceList.add(parentProvince); provinceList.add(parentProvince);
provinceList.add(grandParentProvince);
} }
provinceList.add(parentProvince);
} }
provinceList.add(province); provinceList.add(province);
return provinceList; return provinceList;
} }
/**
* @param provinceParentId
* @return provinceList
*/
@Override @Override
public Province findByProvinceParentId(String provinceParentId) { public CustomerVo findCustomerByCustomerId(String customerId) {
Province province = provinceRepository.findByProvinceParentId(provinceParentId); Customer customer = customerRepository.findCustomerByCustomerId(customerId);
return province; String provinceCode = customer.getProvinceCode();
List<Province> provinceList = findByProvinceCode(provinceCode);
StringBuffer provinceInfoList = new StringBuffer();
for (Province province : provinceList) {
provinceInfoList.append(province.getProvinceName());
}
String provinceInfo = provinceInfoList.toString();
CustomerVo customerVo = new CustomerVo();
BeanUtils.copyProperties(customer, customerVo);
customerVo.setProvinceInfo(provinceInfo);
return customerVo;
} }
// /**
// * @param provinceCode
// * @return provinceList
// */
// @Override
// public Province findByProvinceParentId(String provinceCode) {
//
// Province province = provinceRepository.findByProvinceParentId(provinceCode);
// return province;
// }
} }
...@@ -3,7 +3,8 @@ package com.huigou.topsun.customer.controller; ...@@ -3,7 +3,8 @@ package com.huigou.topsun.customer.controller;
import com.huigou.topsun.customer.application.CustomerBaseInfoApplication; import com.huigou.topsun.customer.application.CustomerBaseInfoApplication;
import com.huigou.topsun.customer.application.CustomerApplication; import com.huigou.topsun.customer.application.CustomerApplication;
import com.huigou.topsun.customer.domain.query.CustomerQueryRequest; import com.huigou.topsun.customer.domain.query.CustomerQueryRequest;
import com.huigou.topsun.customer.domain.vo.Province; import com.huigou.topsun.customer.domain.Province;
import com.huigou.topsun.customer.domain.vo.CustomerVo;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO; import com.huigou.util.SDO;
...@@ -58,7 +59,8 @@ public class CustomerController extends CommonController { ...@@ -58,7 +59,8 @@ public class CustomerController extends CommonController {
*/ */
public String forwardCustomerDetail() { public String forwardCustomerDetail() {
return forward("customerDetail"); CustomerVo customerVo = loadProductDetail();
return forward("customerDetail", customerVo);
} }
/** /**
* 展示客户省市数据,如果客户的省份编码是省级行政单位,直接返回省份数据, * 展示客户省市数据,如果客户的省份编码是省级行政单位,直接返回省份数据,
...@@ -83,9 +85,12 @@ public class CustomerController extends CommonController { ...@@ -83,9 +85,12 @@ public class CustomerController extends CommonController {
* 客户详细信息展示 * 客户详细信息展示
* @return * @return
*/ */
// public String loadProductDetail() { public CustomerVo loadProductDetail() {
// SDO sdo = getSDO();
// } String customerId = sdo.getString("customerId");
CustomerVo customerVo = customerBaseInfoApplication.findCustomerByCustomerId(customerId);
return customerVo;
}
} }
package com.huigou.topsun.customer.domain.vo; package com.huigou.topsun.customer.domain;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -21,7 +21,7 @@ public class Customer implements Serializable { ...@@ -21,7 +21,7 @@ public class Customer implements Serializable {
@Id @Id
@GeneratedValue(generator = "system-uuid") @GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "guid") @GenericGenerator(name = "system-uuid", strategy = "guid")
@Column(name = "province_id") @Column(name = "customer_id")
private String customerId; private String customerId;
/** /**
......
package com.huigou.topsun.customer.domain.vo; package com.huigou.topsun.customer.domain;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.customer.domain.vo;
import com.alibaba.fastjson.JSON;
import com.huigou.topsun.customer.domain.Customer;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CustomerVo implements Serializable {
/**
* 客户id
*/
private String customerId;
/**
* 客户编码
*/
private String customerCode;
/**
* 客户全称
*/
private String customerName;
/**
* 客户简称
*/
private String customerShortName;
/**
* 客户工作时间
*/
private Date customerWorkTime;
/**
* 客户英文名称
*/
private String customerEnName;
/**
* 客户英文名称简称
*/
private String customerEnShortName;
/**
* 省份编码
*/
private String provinceCode;
/**
* 省份信息
*/
private String provinceInfo;
/**
* 客户等级
*/
private String customerLevel;
/**
* 工厂代号
*/
private String customerFactoryCode;
/**
* 地址
*/
private String customerAddress;
/**
* 所属集团
*/
private String customerGroup;
/**
* 邮编
*/
private String customerZipCode;
public String getCustomerId() {
return customerId;
}
public static CustomerVo getCustomerVo(CustomerVo customerVo){
return JSON.parseObject(JSON.toJSONString(customerVo), CustomerVo.class);
}
public static Customer getCustomer(Customer customer){
return JSON.parseObject(JSON.toJSONString(customer),Customer.class);
}
}
package com.huigou.topsun.customer.repository; package com.huigou.topsun.customer.repository;
import com.huigou.topsun.customer.domain.vo.Customer; import com.huigou.topsun.customer.domain.Customer;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface CustomerRepository extends JpaRepository<Customer,String> { public interface CustomerRepository extends JpaRepository<Customer,String> {
Customer findCustomerByCustomerId(String customerId);
} }
package com.huigou.topsun.customer.repository; package com.huigou.topsun.customer.repository;
import com.huigou.topsun.customer.domain.vo.Province; import com.huigou.topsun.customer.domain.Province;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
......
...@@ -29,5 +29,12 @@ ...@@ -29,5 +29,12 @@
</sql-query> </sql-query>
<condition column="proofing_make_technology_id" name="proofingMakeTechnologyId" type="java.lang.String" symbol="=" alias="t"/> <condition column="proofing_make_technology_id" name="proofingMakeTechnologyId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<!-- <query name="slicedWorkInstructionApplyList" table="work_instruction_apply">-->
<!-- <sql-query>-->
<!-- SELECT-->
<!-- wa.*-->
<!-- FROM-->
<!-- work_instruction_apply wa-->
<!-- </sql-query>-->
<!-- </query>-->
</query-mappings> </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