浏览代码

客户信息系统

liujiankang 7 年之前
父节点
当前提交
23a73c0fa2

+ 19 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/customer/ChannelDivisionInfo.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.core.customer;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * Created by Administrator on 2018/4/19.
@@ -12,7 +13,9 @@ public class ChannelDivisionInfo implements Serializable{
     private Integer channelCategory;//渠道类别 1:电商 2:特殊渠道 3:线下 4:海外
     private String channelType;//渠道类型
     private String channelCode;//渠道编码
+    private String channelName;//渠道、平台名称
     private Date createDate;//创建时间
+    private List<ChannelSaleInfo> listChannelSaleInfo;//销售信息集合
 
     public Integer getChannelDivisionId() {
         return channelDivisionId;
@@ -53,4 +56,20 @@ public class ChannelDivisionInfo implements Serializable{
     public void setCreateDate(Date createDate) {
         this.createDate = createDate;
     }
+
+    public List<ChannelSaleInfo> getListChannelSaleInfo() {
+        return listChannelSaleInfo;
+    }
+
+    public void setListChannelSaleInfo(List<ChannelSaleInfo> listChannelSaleInfo) {
+        this.listChannelSaleInfo = listChannelSaleInfo;
+    }
+
+    public String getChannelName() {
+        return channelName;
+    }
+
+    public void setChannelName(String channelName) {
+        this.channelName = channelName;
+    }
 }

+ 18 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/customer/ChannelSaleInfo.java

@@ -16,6 +16,8 @@ public class ChannelSaleInfo implements Serializable{
     private Integer supplyPrice;//供货价格
     private Integer accountPeriod;//账期 1:先款 2:月结 3:两个月
     private Date create_date;//创建时间
+    private Integer channelCategory;//渠道类别 1:电商 2:特殊渠道 3:线下 4:海外
+    private String channelType;//渠道类型
 
     public Integer getChannelSaleId() {
         return channelSaleId;
@@ -80,4 +82,20 @@ public class ChannelSaleInfo implements Serializable{
     public void setCreate_date(Date create_date) {
         this.create_date = create_date;
     }
+
+    public Integer getChannelCategory() {
+        return channelCategory;
+    }
+
+    public void setChannelCategory(Integer channelCategory) {
+        this.channelCategory = channelCategory;
+    }
+
+    public String getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(String channelType) {
+        this.channelType = channelType;
+    }
 }

+ 6 - 4
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java

@@ -1,9 +1,6 @@
 package com.iamberry.rst.faces.customer;
 
-import com.iamberry.rst.core.customer.BillingInfo;
-import com.iamberry.rst.core.customer.CustomerBasicInfo;
-import com.iamberry.rst.core.customer.DockedContactInfo;
-import com.iamberry.rst.core.customer.TicketOpeningInfo;
+import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 
@@ -41,4 +38,9 @@ public interface CustomerBasicService {
      *  根据客户id查询联系人集合
      */
     List<DockedContactInfo> listDockedContactInfo(DockedContactInfo dockedContactInfo);
+
+    /**
+     *  根据客户id渠道销售信息集合
+     */
+    List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo);
 }

+ 6 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -1,10 +1,7 @@
 package com.iamberry.rst.service.customer;
 
 import com.github.pagehelper.PageHelper;
-import com.iamberry.rst.core.customer.BillingInfo;
-import com.iamberry.rst.core.customer.CustomerBasicInfo;
-import com.iamberry.rst.core.customer.DockedContactInfo;
-import com.iamberry.rst.core.customer.TicketOpeningInfo;
+import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.customer.CustomerBasicService;
@@ -54,4 +51,9 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
     public List<DockedContactInfo> listDockedContactInfo(DockedContactInfo dockedContactInfo) {
         return customerBasicMapper.listDockedContactInfo(dockedContactInfo);
     }
+
+    @Override
+    public List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo) {
+        return customerBasicMapper.listChannelSaleInfo(channelSaleInfo);
+    }
 }

+ 3 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.java

@@ -1,9 +1,6 @@
 package com.iamberry.rst.service.customer.mapper;
 
-import com.iamberry.rst.core.customer.BillingInfo;
-import com.iamberry.rst.core.customer.CustomerBasicInfo;
-import com.iamberry.rst.core.customer.DockedContactInfo;
-import com.iamberry.rst.core.customer.TicketOpeningInfo;
+import com.iamberry.rst.core.customer.*;
 
 import java.util.List;
 
@@ -23,4 +20,6 @@ public interface CustomerBasicMapper {
     TicketOpeningInfo getOpeningInfo(TicketOpeningInfo ticketOpeningInfo);
     /*根据客户id查询联系人集合*/
     List<DockedContactInfo> listDockedContactInfo(DockedContactInfo dockedContactInfo);
+    /*根据客户id渠道销售信息集合*/
+    List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo);
 }

+ 21 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml

@@ -157,4 +157,25 @@
             </if>
         </where>
     </select>
+
+    <select id="listChannelSaleInfo" resultType="ChannelSaleInfo" parameterType="ChannelSaleInfo">
+        SELECT
+        si.channel_sale_id as channelSaleId,
+        si.customer_id as customerId,
+        si.channel_division_id as channelDivisionId,
+        si.channel_name as channelName,
+        si.promoting_products as promotingProducts,
+        si.supply_price as supplyPrice,
+        si.account_period as account_period,
+        si.create_date as createDate,
+        di.channel_category as channelCategory,
+        di.channel_type as channelType
+        from tb_rst_channel_sale_info si
+        LEFT JOIN tb_rst_channel_division_info di on si.channel_division_id = di.channel_division_id
+        <where>
+            <if test="customerId != null and customerId !='' ">
+                customer_id  = #{customerId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 47 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicController.java

@@ -2,10 +2,7 @@ package com.iamberry.rst.controllers.customer;
 
 import com.iamberry.rst.controllers.cm.AdminCustomerController;
 import com.iamberry.rst.core.cm.CustomerInfo;
-import com.iamberry.rst.core.customer.BillingInfo;
-import com.iamberry.rst.core.customer.CustomerBasicInfo;
-import com.iamberry.rst.core.customer.DockedContactInfo;
-import com.iamberry.rst.core.customer.TicketOpeningInfo;
+import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
@@ -26,6 +23,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.List;
 
 
@@ -113,6 +111,11 @@ public class CustomerBasicController {
         }
     }
 
+    /**
+     * 查询客户详情
+     * @param request
+     * @return
+     */
     @ResponseBody
     @RequiresPermissions("customerBasic:select:customerBasic")
     @RequestMapping("/customer_Basic_Detail")
@@ -138,11 +141,51 @@ public class CustomerBasicController {
         TicketOpeningInfo ticketOpeningInfo = new TicketOpeningInfo();
         ticketOpeningInfo.setCustomerId(Integer.valueOf(customerId));
         ticketOpeningInfo = customerBasicService.getOpeningInfo(ticketOpeningInfo);
+        /*渠道销售信息*/
+        ChannelSaleInfo channelSaleInfo = new ChannelSaleInfo();
+        channelSaleInfo.setCustomerId(Integer.valueOf(customerId));
+        List<ChannelSaleInfo> listChannelSaleInfo = customerBasicService.listChannelSaleInfo(channelSaleInfo);
+        //渠道销售信息封装
+        List<ChannelDivisionInfo> listChannelDivisionInfo = new ArrayList<ChannelDivisionInfo>();
+        for (int i=0;i<listChannelSaleInfo.size();i++){
+            boolean isContinue = true;
+            if(listChannelDivisionInfo.size() > 0){
+                for(ChannelDivisionInfo channelDivisionInfo : listChannelDivisionInfo){
+                    List<ChannelSaleInfo> listChannel = channelDivisionInfo.getListChannelSaleInfo();
+                    for (ChannelSaleInfo Info : listChannel){
+                        if(Info.getChannelDivisionId().intValue() == listChannelSaleInfo.get(i).getChannelDivisionId().intValue()
+                                && Info.getChannelName().equals(listChannelSaleInfo.get(i).getChannelName())){
+                            isContinue = false;
+                        }
+                    }
+
+                }
+            }
+            if(!isContinue){
+                continue;//数据已保存不需要再循环
+            }
+            ChannelDivisionInfo channelDivisionInfo = new ChannelDivisionInfo();
+            channelDivisionInfo.setChannelCategory(listChannelSaleInfo.get(i).getChannelCategory());
+            channelDivisionInfo.setChannelType(listChannelSaleInfo.get(i).getChannelType());
+            channelDivisionInfo.setChannelName(listChannelSaleInfo.get(i).getChannelName());
+                List<ChannelSaleInfo> listChannelSale = new ArrayList<ChannelSaleInfo>();
+            for (int j=0;j<listChannelSaleInfo.size();j++){
+                if(listChannelSaleInfo.get(i).getChannelDivisionId().intValue() == listChannelSaleInfo.get(j).getChannelDivisionId().intValue()
+                  && listChannelSaleInfo.get(i).getChannelName().equals(listChannelSaleInfo.get(j).getChannelName())){
+                    listChannelSale.add(listChannelSaleInfo.get(j));
+                }
+                if(j == listChannelSaleInfo.size()-1){
+                    channelDivisionInfo.setListChannelSaleInfo(listChannelSale);
+                }
 
+            }
+            listChannelDivisionInfo.add(channelDivisionInfo);
+        }
         mv.addObject("customerBasicInfo",customerBasicInfo);
         mv.addObject("listDockedContactInfo",listDockedContactInfo);
         mv.addObject("billingInfo",billingInfo);
         mv.addObject("ticketOpeningInfo",ticketOpeningInfo);
+        mv.addObject("listChannelDivisionInfo",listChannelDivisionInfo);
         return mv;
     }
 }

+ 100 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/customer/custome_basic_detail.ftl

@@ -120,18 +120,20 @@
                     </tr>
                     </thead>
                     <tbody id="salesOrderHtml">
-                    <tr>
+
                     <#if listDockedContactInfo?? &&  (listDockedContactInfo?size > 0) >
                         <#list listDockedContactInfo as list>
+                        <tr>
                             <td>${list.contactName!''}</td>
                             <td>${list.contactPhone!''}</td>
                             <td>${list.contactType!''}</td>
                             <td>${list.contactEmail!''}</td>
+                        </tr>
                         </#list>
                     <#else>
                     <tr><td colspan="4" class="td-manage text-c" >暂时没有对接人信息,请添加!</td></tr>
                     </#if>
-                    </tr>
+
                     </tbody>
                 </table>
             </div>
@@ -157,13 +159,56 @@
                         <th>销售产品</th>
                     </tr>
                     </thead>
-                    <tbody id="salesOrderHtml">
-                    <tr>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                    </tr>
+                    <tbody>
+
+                        <#if listChannelDivisionInfo?? &&  (listChannelDivisionInfo?size > 0) >
+                            <#list listChannelDivisionInfo as list>
+                        <tr>
+                        <td>
+                            <#if list.channelCategory == 1 >电商</#if>
+                            <#if list.channelCategory == 2 >特殊渠道</#if>
+                            <#if list.channelCategory == 3 >线下</#if>
+                            <#if list.channelCategory == 4 >海外</#if>
+                        </td>
+                        <td>${list.channelType}</td>
+                        <td>${list.channelName}</td>
+                        <td>
+
+                            <table class="table table-border table-bg table-bordered">
+                                <thead>
+                                <tr>
+                                    <th>销售产品型号</th>
+                                    <th>供货价(元,含17%税)</th>
+                                    <th>账期</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                    <#if list.listChannelSaleInfo?? &&  (list.listChannelSaleInfo?size > 0) >
+                                        <#list list.listChannelSaleInfo as list>
+                                        <tr>
+                                            <td>${list.promotingProducts}</td>
+                                            <td>${list.supplyPrice}</td>
+                                            <td>${list.accountPeriod}
+                                            <#if list.accountPeriod == 1>先款</#if>
+                                            <#if list.accountPeriod == 2>月结 </#if>
+                                            <#if list.accountPeriod == 3>两个月</#if>
+                                            </td>
+                                        </tr>
+                                        </#list>
+                                    <#else>
+                                    <tr><td colspan="3" class="td-manage text-c" >暂时没有销售信息,请添加!</td></tr>
+                                    </#if>
+
+                                </tbody>
+                            </table>
+
+                        </td>
+                        </tr>
+                            </#list>
+                        <#else>
+                        <tr><td colspan="4" class="td-manage text-c" >暂时没有渠道信息,请添加!</td></tr>
+                        </#if>
+
                     </tbody>
                 </table>
             </div>
@@ -199,6 +244,52 @@
                 <label>${billingInfo.receivablesPhone!''}</label>
             </div>
         </div>
+
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">开票信息</div>
+            </label>
+            <div class="formControls col-9">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-2 col-sm-2">发票类型:</label>
+            <div class="formControls col-2 col-sm-2">
+                <label>
+                <#if ticketOpeningInfo.ticketType == 1>专票</#if>
+                <#if ticketOpeningInfo.ticketType == 2>普票</#if>
+                </label>
+            </div>
+            <label class="form-label col-2 col-sm-2">开户支行:</label>
+            <div class="formControls col-1 col-sm-1">
+                <label>${ticketOpeningInfo.accountOpeningBranch!''}</label>
+            </div>
+            <label class="form-label col-2 col-sm-2">开票账号:</label>
+            <div class="formControls col-2 col-sm-2">
+                <label>${ticketOpeningInfo.ticketOpeningAccount!''}</label>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-2 col-sm-2">企业名称:</label>
+            <div class="formControls col-2 col-sm-2">
+                <label>${ticketOpeningInfo.enterpriseName!''}</label>
+            </div>
+            <label class="form-label col-2 col-sm-2">纳税人识别号:</label>
+            <div class="formControls col-1 col-sm-1">
+                <label>${ticketOpeningInfo.taxpayerIdentificationNum!''}</label>
+            </div>
+            <label class="form-label col-2 col-sm-2">开票电话:</label>
+            <div class="formControls col-2 col-sm-2">
+                <label>${ticketOpeningInfo.ticketOpeningPhone!''}</label>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-2 col-sm-2">企业地址:</label>
+            <div class="formControls col-2 col-sm-2">
+                <label>${ticketOpeningInfo.enterpriseAddress!''}</label>
+            </div>
+        </div>
         <div class="row cl">
             <label class="form-label col-3">
                 <div class="tit-2">客户备注</div>