浏览代码

客户信息系统

liujiankang 7 年之前
父节点
当前提交
080b2be649

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

@@ -11,7 +11,6 @@ public class ChannelSaleInfo implements Serializable{
     private Integer channelSaleId;//主键
     private Integer customerId;//客户id(外键)
     private Integer channelDivisionId;//渠道id(外键)
-    private String channelName;//渠道/平台名称
     private String promotingProducts;//销售产品
     private Integer supplyPrice;//供货价格
     private Integer accountPeriod;//账期 1:先款 2:月结 3:两个月
@@ -43,14 +42,6 @@ public class ChannelSaleInfo implements Serializable{
         this.channelDivisionId = channelDivisionId;
     }
 
-    public String getChannelName() {
-        return channelName;
-    }
-
-    public void setChannelName(String channelName) {
-        this.channelName = channelName;
-    }
-
     public String getPromotingProducts() {
         return promotingProducts;
     }

+ 5 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java

@@ -43,4 +43,9 @@ public interface CustomerBasicService {
      *  根据客户id渠道销售信息集合
      */
     List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo);
+
+    /**
+     *  根据客户id渠道划分信息集合
+     */
+    List<ChannelDivisionInfo> listChannelDivisionInfo(Integer coustomerId);
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -56,4 +56,9 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
     public List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo) {
         return customerBasicMapper.listChannelSaleInfo(channelSaleInfo);
     }
+
+    @Override
+    public List<ChannelDivisionInfo> listChannelDivisionInfo(Integer coustomerId) {
+        return customerBasicMapper.listChannelDivisionInfo(coustomerId);
+    }
 }

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

@@ -22,4 +22,6 @@ public interface CustomerBasicMapper {
     List<DockedContactInfo> listDockedContactInfo(DockedContactInfo dockedContactInfo);
     /*根据客户id渠道销售信息集合*/
     List<ChannelSaleInfo> listChannelSaleInfo(ChannelSaleInfo channelSaleInfo);
+    /*根据客户id渠道划分信息集合*/
+    List<ChannelDivisionInfo> listChannelDivisionInfo(Integer coustomerId);
 }

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

@@ -49,7 +49,7 @@
         <if test="customerStatus != null and customerStatus!='' ">
           AND bi.customer_status = #{customerStatus}
         </if>
-        <if test="idCreateBy != null and idCreateBy!='' ">
+        <if test="isLookAll != null and isLookAll!='' and isLookAll == 2 ">
           AND bi.id_create_by = #{idCreateBy}
         </if>
         <if test="contactPhone != null and contactPhone!='' ">
@@ -58,9 +58,9 @@
         <if test="contactEmail != null and contactEmail!='' ">
           AND ci.contact_email = #{contactEmail}
         </if>
-        <if test="isSelectAll != null and isSelectAll!='' ">
+        <!--<if test="isSelectAll != null and isSelectAll == 2 ">
           AND bi.customer_status = #{isSelectAll}
-        </if>
+        </if>-->
       </where>
   </select>
 
@@ -163,19 +163,35 @@
         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
+        si.create_date as createDate
         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>
+        where
+            si.channel_division_id  = #{channelDivisionId}
+    </select>
+
+    <resultMap type="ChannelDivisionInfo" id="listChannelDivisionMap">
+        <id property="channelDivisionId" column="channel_division_id"/>
+        <result property="channelCategory" column="channel_category" />
+        <result property="channelType" column="channel_type" />
+        <result property="channelName" column="channel_name" />
+        <result property="channelCode" column="channel_code" />
+        <result property="receivablesPhone" column="receivables_phone" />
+        <result property="createDate" column="create_date" />
+        <collection property="listChannelSaleInfo" column="channel_division_id" ofType="ChannelDivisionInfo" select="listChannelSaleInfo"/>
+    </resultMap>
+    <select id="listChannelDivisionInfo" resultMap="listChannelDivisionMap" parameterType="ChannelDivisionInfo">
+        SELECT
+        channel_division_id,
+        channel_category,
+        channel_type,
+        channel_name,
+        channel_code,
+        create_date
+        FROM tb_rst_channel_division_info
+        WHERE
+        customer_id = #{customerId}
     </select>
 </mapper>

+ 8 - 7
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicController.java

@@ -63,9 +63,10 @@ public class CustomerBasicController {
         }else if(admin.getAdminDept() == 2){//销售部(业务员)
             customerBasicInfo.setIsSelectAll(2);
         }
-        if(customerBasicInfo.getIsLookAll() == null || customerBasicInfo.getIsLookAll() == 2){
+        customerBasicInfo.setIdCreateBy(adminId);
+       /* if(customerBasicInfo.getIsLookAll() != null || !customerBasicInfo.getIsLookAll().equals("")){
             customerBasicInfo.setIdCreateBy(adminId);
-        }
+        }*/
         // 封装请求数据
         PageRequest<CustomerBasicInfo> pageRequest = new PageRequest<>(customerBasicInfo, pageNO, pageSize, totalNum == 0);
         // 查询订单列表
@@ -142,11 +143,11 @@ public class CustomerBasicController {
         ticketOpeningInfo.setCustomerId(Integer.valueOf(customerId));
         ticketOpeningInfo = customerBasicService.getOpeningInfo(ticketOpeningInfo);
         /*渠道销售信息*/
-        ChannelSaleInfo channelSaleInfo = new ChannelSaleInfo();
-        channelSaleInfo.setCustomerId(Integer.valueOf(customerId));
-        List<ChannelSaleInfo> listChannelSaleInfo = customerBasicService.listChannelSaleInfo(channelSaleInfo);
+        /*ChannelSaleInfo channelSaleInfo = new ChannelSaleInfo();
+        channelSaleInfo.setCustomerId(Integer.valueOf(customerId));*/
+        List<ChannelDivisionInfo> listChannelDivisionInfo = customerBasicService.listChannelDivisionInfo(Integer.valueOf(customerId));
         //渠道销售信息封装
-        List<ChannelDivisionInfo> listChannelDivisionInfo = new ArrayList<ChannelDivisionInfo>();
+       /* List<ChannelDivisionInfo> listChannelDivisionInfo = new ArrayList<ChannelDivisionInfo>();
         for (int i=0;i<listChannelSaleInfo.size();i++){
             boolean isContinue = true;
             if(listChannelDivisionInfo.size() > 0){
@@ -180,7 +181,7 @@ public class CustomerBasicController {
 
             }
             listChannelDivisionInfo.add(channelDivisionInfo);
-        }
+        }*/
         mv.addObject("customerBasicInfo",customerBasicInfo);
         mv.addObject("listDockedContactInfo",listDockedContactInfo);
         mv.addObject("billingInfo",billingInfo);

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

@@ -188,7 +188,7 @@
                                         <tr>
                                             <td>${list.promotingProducts}</td>
                                             <td>${list.supplyPrice}</td>
-                                            <td>${list.accountPeriod}
+                                            <td>
                                             <#if list.accountPeriod == 1>先款</#if>
                                             <#if list.accountPeriod == 2>月结 </#if>
                                             <#if list.accountPeriod == 3>两个月</#if>
@@ -220,30 +220,37 @@
             <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>${billingInfo.accountOpeningBranch!''}</label>
-            </div>
-            <label class="form-label col-2 col-sm-2">账户名称:</label>
-            <div class="formControls col-1 col-sm-1">
-                <label>${billingInfo.accountName!''}</label>
+        <#if billingInfo??>
+            <div class="row cl">
+                <label class="form-label col-2 col-sm-2">开户支行:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <label>${billingInfo.accountOpeningBranch!''}</label>
+                </div>
+                <label class="form-label col-2 col-sm-2">账户名称:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <label>${billingInfo.accountName!''}</label>
+                </div>
+                <label class="form-label col-2 col-sm-2">账号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <label>${billingInfo.accountNum!''}</label>
+                </div>
             </div>
-            <label class="form-label col-2 col-sm-2">账号:</label>
-            <div class="formControls col-2 col-sm-2">
-                <label>${billingInfo.accountNum!''}</label>
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-2 col-sm-2">收款人姓名:</label>
-            <div class="formControls col-4 col-sm-4">
-                <label>${billingInfo.receivablesName!''}</label>
+            <div class="row cl">
+                <label class="form-label col-2 col-sm-2">收款人姓名:</label>
+                <div class="formControls col-4 col-sm-4">
+                    <label>${billingInfo.receivablesName!''}</label>
+                </div>
+                <label class="form-label col-2 col-sm-2">收款人电话:</label>
+                <div class="formControls col-4 col-sm-4">
+                    <label>${billingInfo.receivablesPhone!''}</label>
+                </div>
             </div>
-            <label class="form-label col-2 col-sm-2">收款人电话:</label>
-            <div class="formControls col-4 col-sm-4">
-                <label>${billingInfo.receivablesPhone!''}</label>
+        <#else>
+            <div class="row cl">
+                <label class="form-label col-2 col-sm-2">无付款/退款信息</label>
             </div>
-        </div>
+        </#if>
+
 
         <div class="row cl">
             <label class="form-label col-3">
@@ -252,6 +259,7 @@
             <div class="formControls col-9">
             </div>
         </div>
+        <#if ticketOpeningInfo??>
         <div class="row cl">
             <label class="form-label col-2 col-sm-2">发票类型:</label>
             <div class="formControls col-2 col-sm-2">
@@ -261,7 +269,7 @@
                 </label>
             </div>
             <label class="form-label col-2 col-sm-2">开户支行:</label>
-            <div class="formControls col-1 col-sm-1">
+            <div class="formControls col-2 col-sm-2">
                 <label>${ticketOpeningInfo.accountOpeningBranch!''}</label>
             </div>
             <label class="form-label col-2 col-sm-2">开票账号:</label>
@@ -276,7 +284,7 @@
                 <label>${ticketOpeningInfo.enterpriseName!''}</label>
             </div>
             <label class="form-label col-2 col-sm-2">纳税人识别号:</label>
-            <div class="formControls col-1 col-sm-1">
+            <div class="formControls col-2 col-sm-2">
                 <label>${ticketOpeningInfo.taxpayerIdentificationNum!''}</label>
             </div>
             <label class="form-label col-2 col-sm-2">开票电话:</label>
@@ -290,6 +298,11 @@
                 <label>${ticketOpeningInfo.enterpriseAddress!''}</label>
             </div>
         </div>
+        <#else>
+            <div class="row cl">
+                <label class="form-label col-2 col-sm-2"> 不需开票</label>
+            </div>
+        </#if>
         <div class="row cl">
             <label class="form-label col-3">
                 <div class="tit-2">客户备注</div>
@@ -298,6 +311,7 @@
             </div>
         </div>
         <div class="row cl">
+            <label class="form-label col-1 col-sm-1"></label>
             <div class="formControls col-4 col-sm-4">
                 <label>${customerBasicInfo.customerRemarks!''}</label>
             </div>

+ 3 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/customer/customer_basic_list.ftl

@@ -127,7 +127,9 @@
                                         <a href="#" onclick="deleteState(${list.customerId!''})">删除</a>
                                     </#if>
                                 </#if>
-                                <a href="#" onclick="customerDetail(${list.customerId!''})">详情</a>
+                                <#if !isSelectAll?? ||(isSelectAll != 2) || (adminId == list.idCreateBy)>
+                                        <a href="#" onclick="customerDetail(${list.customerId!''})">详情</a>
+                                </#if>
                             </td>
 						</tr>
 					</#list>