Browse Source

机构分析统计

huangzhiguo 2 years ago
parent
commit
c72f51255b

+ 9 - 3
pom.xml

@@ -50,7 +50,7 @@
 		<webserver.port>8081</webserver.port>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<downloadSources>true</downloadSources>
-
+		<easyexcel.version>2.1.6</easyexcel.version>
 		<!-- 设定编译部署的目标环境 -->
 		<env.type>dev</env.type>
 
@@ -199,7 +199,7 @@
 		<dependency>
 			<groupId>cglib</groupId>
 			<artifactId>cglib</artifactId>
-			<version>3.1</version>
+			<version>2.2.2</version>
 		</dependency>
 		<!-- AOP end -->
 
@@ -697,7 +697,11 @@
 			<artifactId>poi-ooxml-schemas</artifactId>
 			<version>3.16</version>
 		</dependency>
-
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>easyexcel</artifactId>
+			<version>${easyexcel.version}</version>
+		</dependency>
 		<!--<dependency>
 			<groupId>org.apache.poi</groupId>
 			<artifactId>ooxml-schemas</artifactId>
@@ -1002,7 +1006,9 @@
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-resources-plugin</artifactId>
 					<configuration>
+						<encoding>UTF-8</encoding>
 						<nonFilteredFileExtensions>
+							<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
 							<nonFilteredFileExtension>xls</nonFilteredFileExtension>
 						</nonFilteredFileExtensions>
 					</configuration>

+ 4 - 0
src/main/java/com/caimei/modules/user/dao/CmPortraitDao.java

@@ -1,11 +1,13 @@
 package com.caimei.modules.user.dao;
 
 import com.caimei.modules.order.entity.NewOrder;
+import com.caimei.modules.user.entity.ClubStatistics;
 import com.caimei.modules.user.entity.CmBehaviorRecord;
 import com.caimei.modules.user.entity.CmClubRemarks;
 import com.caimei.modules.user.entity.CmPortrait;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -20,6 +22,8 @@ public interface CmPortraitDao extends CrudDao<CmPortrait> {
 
     CmPortrait selTotal(CmPortrait cmPortrait);
 
+    ClubStatistics selClubData(@Param("clubID") Integer ClubID);
+
     List<NewOrder> selOrderList(CmPortrait cmPortrait);
 
     List<CmBehaviorRecord> selBehaviorList(CmPortrait cmPortrait);

+ 60 - 0
src/main/java/com/caimei/modules/user/entity/ClubStatistics.java

@@ -27,6 +27,16 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
     private String yearStartTime;         //近一个年开始时间
     private String yearEndTime;           //近一个年结束时间
 
+
+    // 省
+    private String provinceID;
+    // 市
+    private String cityID;
+
+    private String province;
+    private String city;
+    private String town;
+
     private String name;    // 机构名称
     private String linkMan; //联系人
     private String contractMobile;  //联系手机
@@ -47,6 +57,7 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
     private String clubRank;  // 机构级别
     private String firstClubType;  // 机构一级分类
     private String classify;  // 机构二级分类
+    private String clubType;  // 机构类型
     private String clubDataIntegrity;  // 资料完整度
     private String addTime;  // 注册时间
     private String svipUserFlag;  // vip类别
@@ -179,6 +190,47 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
         this.yearEndTime = yearEndTime;
     }
 
+
+    public String getProvinceID() {
+        return provinceID;
+    }
+
+    public void setProvinceID(String provinceID) {
+        this.provinceID = provinceID;
+    }
+
+    public String getCityID() {
+        return cityID;
+    }
+
+    public void setCityID(String cityID) {
+        this.cityID = cityID;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
     public String getName() {
         return name;
     }
@@ -339,6 +391,14 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
         this.classify = classify;
     }
 
+    public String getClubType() {
+        return clubType;
+    }
+
+    public void setClubType(String clubType) {
+        this.clubType = clubType;
+    }
+
     public String getClubDataIntegrity() {
         return clubDataIntegrity;
     }

+ 18 - 0
src/main/java/com/caimei/modules/user/entity/CmClubinfo.java

@@ -65,6 +65,8 @@ public class CmClubinfo extends DataEntity<CmClubinfo> {
     private String medicalPracticeLicenseImg;  //医美分类必须上传医疗执业许可证
     private String contractEmail;  //邮箱
     private Integer linkManIdentity;    //联系人身份:1老板,2采购,3运营
+    private String userIdentity;  //用户身份
+    private Integer svipUserFlag;   //超级会员用户标识,1是,2不是
 
     public String getContractEmail() {
         return contractEmail;
@@ -442,4 +444,20 @@ public class CmClubinfo extends DataEntity<CmClubinfo> {
     public void setLinkManIdentity(Integer linkManIdentity) {
         this.linkManIdentity = linkManIdentity;
     }
+
+    public String getUserIdentity() {
+        return userIdentity;
+    }
+
+    public void setUserIdentity(String userIdentity) {
+        this.userIdentity = userIdentity;
+    }
+
+    public Integer getSvipUserFlag() {
+        return svipUserFlag;
+    }
+
+    public void setSvipUserFlag(Integer svipUserFlag) {
+        this.svipUserFlag = svipUserFlag;
+    }
 }

+ 19 - 6
src/main/java/com/caimei/modules/user/service/ClubPortraitService.java

@@ -2,10 +2,7 @@ package com.caimei.modules.user.service;
 
 import com.caimei.modules.order.entity.NewOrder;
 import com.caimei.modules.user.dao.CmPortraitDao;
-import com.caimei.modules.user.entity.CmBehaviorRecord;
-import com.caimei.modules.user.entity.CmClubRemarks;
-import com.caimei.modules.user.entity.CmPortrait;
-import com.caimei.modules.user.entity.OrderPortrait;
+import com.caimei.modules.user.entity.*;
 import com.thinkgem.jeesite.common.utils.ObjectUtils;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +35,20 @@ public class ClubPortraitService {
         CmPortrait cmPortraits = cmPortraitDao.selTotal(cmPortrait);
         return cmPortraits;
     }
+    public ClubStatistics clubData(Integer clubID) {
+        ClubStatistics clubStatistics = cmPortraitDao.selClubData(clubID);
+        if (clubStatistics != null) {
+            String type = "" ;
+            if (StringUtils.isNotBlank(clubStatistics.getFirstClubType())) {
+                type += clubStatistics.getFirstClubType();
+            }
+            if (StringUtils.isNotBlank(clubStatistics.getClassify())) {
+                type += "-" + clubStatistics.getClassify();
+            }
+            clubStatistics.setClubType(type);
+        }
+        return clubStatistics;
+    }
     /**
      * 查询机构画像数据
      * @param cmPortrait
@@ -233,6 +244,7 @@ public class ClubPortraitService {
             ArrayList<Integer> integers = new ArrayList<>();
             ArrayList<String> strings = new ArrayList<>();
             ArrayList<String> strRemark = new ArrayList<>();
+            ArrayList<String> remarkAll = new ArrayList<>();
             int number = 0;
             if (remarksList.size() != 0) {
                 for (CmClubRemarks remarks: remarksList) {
@@ -241,11 +253,12 @@ public class ClubPortraitService {
                         if (!strRemark.contains(str)) {
                             strRemark.add(str);
                         }
+                        remarkAll.add(str);
                     }
                 }
                 for (String str : strRemark) {
-                    for (CmClubRemarks remarks: remarksList) {
-                        if (str.equals(remarks.getRemarks())) {
+                    for (int i = 0;i < remarkAll.size(); i++) {
+                        if (str.equals(remarkAll.get(i))) {
                             number++;
                         }
                     }

+ 24 - 2
src/main/java/com/caimei/modules/user/service/NewCmClubService.java

@@ -239,8 +239,30 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
         calendar.add(Calendar.YEAR,-1);
         statistics.setYearStartTime(dateFormat.format(calendar.getTime()));
         List<ClubStatistics> selStatisticsList = newCmClubDao.selStatisticsList(statistics);
+        setListData(selStatisticsList);
+        page.setList(selStatisticsList);
+        return page;
+    }
+
+    public List<ClubStatistics> exportExcel(ClubStatistics statistics) {
+        List<ClubStatistics> statisticsList = newCmClubDao.selStatisticsList(statistics);
+        setListData(statisticsList);
+        return statisticsList;
+    }
+
+    public List<ClubStatistics> setListData(List<ClubStatistics> selStatisticsList) {
         int number = 0;
+        String type = "" ;
         for (ClubStatistics clubStatistics : selStatisticsList) {
+            // 机构类型
+            if (StringUtils.isNotBlank(clubStatistics.getFirstClubType())) {
+                type += clubStatistics.getFirstClubType();
+            }
+            if (StringUtils.isNotBlank(clubStatistics.getClassify())) {
+                type += "-" + clubStatistics.getClassify();
+            }
+            clubStatistics.setClubType(type);
+            // 计算资料完整度
             if (StringUtils.isNotBlank(clubStatistics.getName())) {
                 number += 10;
             }
@@ -285,8 +307,8 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
             }
             clubStatistics.setClubDataIntegrity(number+"%");
             number=0;
+            type = "";
         }
-        page.setList(selStatisticsList);
-        return page;
+        return selStatisticsList;
     }
 }

+ 39 - 0
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -1,5 +1,9 @@
 package com.caimei.modules.user.web.newUser;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.alibaba.excel.write.metadata.WriteSheet;
 import com.caimei.constants.ClubStatus;
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
@@ -26,6 +30,7 @@ import com.google.common.collect.Maps;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.FileUtils;
 import com.thinkgem.jeesite.common.utils.ObjectUtils;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
@@ -33,6 +38,7 @@ import com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.map.HashedMap;
+import org.apache.poi.openxml4j.util.ZipSecureFile;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -46,8 +52,10 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.swing.filechooser.FileSystemView;
 import java.awt.*;
 import java.awt.datatransfer.StringSelection;
+import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.text.ParseException;
@@ -1412,11 +1420,40 @@ public class AgencyController extends BaseController {
         return "modules/userNew/cmAgencyStatisticsList";
     }
 
+    @ResponseBody
+    @RequestMapping(value = "/club/export")
+    public void easyExcel(ClubStatistics statistics) {
+        String fileName = "机构分析统计.xlsx";
+        String template = Global.getConfig("export.template");
+        String templataFileName = template + "/club_analyse_tabulation.xlsx";
+        try {
+            FileSystemView view = FileSystemView.getFileSystemView();
+            File homeDirectory = view.getHomeDirectory();
+            fileName = homeDirectory+"/"+System.currentTimeMillis()+fileName;
+            List<ClubStatistics> statisticsList = newCmClubService.exportExcel(statistics);
+            //得到模板文件路径(线上直接读取服务器位置文件)
+            String config = Global.getConfig("cm.config");
+            if(config.equals("dev")){
+                templataFileName = FileUtils.class.getClassLoader().getResource(templataFileName).getPath();
+            }
+            ExcelWriter excel = EasyExcel.write(fileName).withTemplate(templataFileName).build();
+            WriteSheet writeSheet = EasyExcel.writerSheet().build();
+            excel.fill(statisticsList,writeSheet);
+            excel.finish();
+        } catch (Exception e) {
+//            addMessage(redirectAttributes,"机构分析统计导出失败",e.getMessage());
+            e.printStackTrace();
+        }
+
+    }
+
     @RequestMapping("/clubPortrait")
     public String clubPortrait(CmPortrait cmPortrait, Model model) {
         CmPortrait portrait = portraitService.dataTotal(cmPortrait);
+        ClubStatistics statistics = portraitService.clubData(cmPortrait.getClubID());
         model.addAttribute("cmPortrait",cmPortrait);
         model.addAttribute("portrait",portrait);
+        model.addAttribute("statistics",statistics);
         return "modules/userNew/cmClubPortrait";
     }
 
@@ -1524,6 +1561,8 @@ public class AgencyController extends BaseController {
         cmClubinfo.setMedicalPracticeLicenseImg(newCmClub.getMedicalPracticeLicenseImg());
         cmClubinfo.setContractEmail(newCmClub.getContractEmail());
         cmClubinfo.setLinkManIdentity(newCmClub.getLinkManIdentity());
+        cmClubinfo.setUserIdentity(newCmClub.getUserIdentity());
+        cmClubinfo.setSvipUserFlag(newCmClub.getSvipUserFlag());
 
         String wwwServer = Global.getConfig("wwwServer");
         //营业执照

BIN
src/main/resources/export/club_analyse_tabulation.xlsx


+ 31 - 0
src/main/resources/mappings/modules/user/CmPortraitMapper.xml

@@ -8,6 +8,37 @@
                 (SELECT COUNT(cbr.recordID) FROM cm_behavior_record cbr LEFT JOIN club c ON cbr.userID = c.userID WHERE cbr.pageType IN (8, 9) AND c.clubID = #{clubID} AND cbr.accessDate <![CDATA[ < ]]> now()) AS totalkeywords ,
                 (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubID} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
     </select>
+    <select id="selClubData" resultType="com.caimei.modules.user.entity.ClubStatistics">
+        select
+        c.name,
+        c.linkMan,
+        c.contractMobile,
+        (CASE WHEN c.linkManIdentity=1 THEN '老板'
+              WHEN c.linkManIdentity=2 THEN '采购'
+              WHEN c.linkManIdentity=3 THEN '运营'
+              WHEN c.linkManIdentity=4 THEN '其他'
+            END) AS linkManStatus,
+        c.provinceID,
+        c.cityID,
+        d.name AS province,
+        ct.name AS city,
+        b.name AS  town,
+        (CASE WHEN c.firstClubType=1 THEN '医美'
+              WHEN c.firstClubType=2 THEN '生美'
+              WHEN c.firstClubType=3 THEN '项目公司'
+              WHEN c.firstClubType=4 THEN '个人'
+              ELSE '其他' END) AS firstClubType,
+        (CASE WHEN c.secondClubType=1 THEN '诊所'
+              WHEN c.secondClubType=2 THEN '门诊'
+              WHEN c.secondClubType=3 THEN '医院'
+            END) AS classify,
+        c.addTime AS addTime
+        FROM club c
+                 LEFT JOIN town b ON b.townID=c.townID
+                 LEFT JOIN city ct ON ct.cityID=c.cityID
+                 LEFT JOIN province d ON d.provinceID=c.provinceID
+        where clubID = #{clubID}
+    </select>
     <select id="selOrderList" resultType="com.caimei.modules.order.entity.NewOrder">
         SELECT
                (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubID}) as numbers,

+ 1 - 1
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -891,6 +891,6 @@
                 </if>
             </if>
         </where>
-        GROUP BY c.userID
+        GROUP BY c.userID ORDER BY MAX(cor.orderTime) DESC
     </select>
 </mapper>

+ 41 - 11
src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyStatisticsList.jsp

@@ -47,6 +47,8 @@
         #alertModal .alertModal-btn button{float:right;margin:5px}
         .acticer_span{display: inline-block;width: 14px;height: 14px;border-radius: 50%;box-sizing: border-box;border: 1px solid #999999;text-align: center;color: #333333;font-size: 12px;line-height: 14px;float: none;margin-left: 3px;}
         /*#items{border-bottom: #0d0d0d 1px dashed}*/
+        .viewDiv{position: relative; margin: 0 auto;margin-top: 10px; width: 100%; height: 1px; background-color: #d4d4d4; text-align: center; font-size: 16px; color: rgba(101, 101, 101, 1);}
+        .autoView{position: absolute; left: 90%; background-color: #ffffff;margin-left: 100px; padding: 0 15px; transform: translateX(-30%) translateY(-30%);}
     </style>
 </head>
 <body>
@@ -118,8 +120,13 @@
                 <form:option value="1" label="20%至70%"/>
                 <form:option value="2" label="70%以上"/>
             </form:select>
-        </div>
-<%--        <span style="width: 100%; height: 0; border: #0d0d0d 1px dashed;"/><br/>--%>
+        </div><br/><br/>
+        <div class="viewDiv">
+            <input id="btnSubmit" class="btn autoView btn-primary" type="submit" value="查询" onclick="subClick()"/>
+            <input id="export" class="btn autoView btn-primary" type="button" value="导出"/>
+<%--            <a href="${ctx}/new/user/agency/club/export?" class="btn autoView btn-primary" value="导出"></a>--%>
+<%--            <a id="export" href="${ctx}/new/user/agency/club/export?" class="btn autoView btn-primary" onclick="reExport()">导出</a>--%>
+        </div><br/>
         <div class="flex-wrap">
             <label class="control-label">近一个月购买额:</label>
             <form:select id="payTotalMonth" path="payTotalMonth" class="input-medium">
@@ -154,10 +161,10 @@
                 <form:option value="4" label="大于100万"/>
             </form:select>
         </div>
-        <div class="item">
+        <%--<div class="item">
             <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="subClick()"/>
             <input id="export" class="btn btn-primary" type="button" value="导出"/>
-        </div>
+        </div>--%>
 
     </div>
 </form:form>
@@ -172,7 +179,7 @@
         <th>手机号</th>
         <th>协销人员</th>
         <th>状态</th>
-        <th>机构类</th>
+        <th>机构类</th>
         <th>机构级别</th>
         <th>资料完整度</th>
         <th>注册时间</th>
@@ -267,7 +274,7 @@
     </c:forEach>
     </tbody>
 </table>
-<div class="pagination">${page}</div>nixuel
+<div class="pagination">${page}</div>
 <script type="text/javascript">
 function page(n,s) {
     $('#pageNo').val(n);
@@ -281,20 +288,43 @@ function subClick() {
     const customStartTime = $('#customStartTime').val();
     const customEndTime = $('#customEndTime').val();
     const payTotal = $('#payTotal').val();
-    if ((customStartTime != null || customStartTime != '') && (customEndTime != null || customEndTime != '')) {
-        if (payTotalMonth != null || payTotalMonth != '') {
+    console.log(customStartTime+'----'+customEndTime);
+    if ((customStartTime.length !== 0 || customStartTime !== '') && (customEndTime.length !== 0 || customEndTime !== '')) {
+        if (payTotalMonth.length !== 0 || payTotalMonth !== '') {
             $.jBox.confirm("自定义统计时间不能与近一个月/近一年购买额联动查询", "提示");
+            return;
         }
-        if (payTotalYear != null || payTotalYear != '') {
+        if (payTotalYear.length !== 0 || payTotalYear !== '') {
             $.jBox.confirm("自定义统计时间不能与近一个月/近一年购买额联动查询", "提示");
+            return;
         }
-        if (payTotal == null || payTotal == '') {
+        if (payTotal.length === 0 || payTotal === '') {
             $.jBox.confirm("自定义统计时间需要与总购买额一起联动查询", "提示");
+            return;
         }
     }
     $('#searchForm').submit();
-    return false;
+    return;
 }
+$(function () {
+    $("#export").click(function () {
+        var formData = $('#searchForm').serialize()
+        <%--window.location.href = "${ctx}/new/user/agency/club/export?"+formData;--%>
+        $.ajax({
+            url: "${ctx}/new/user/agency/club/export",
+            type: "post",
+            data: formData,
+            contentType : 'application/json;charset=UTF-8', //contentType很重要
+            success: function (data) {
+                console.log("导出成功");
+            }
+        })
+    })
+})
+/*function reExport() {
+    var formData = $('#searchForm').serialize()
+    this.href()+formData
+}*/
 </script>
 </body>
 </html>

+ 224 - 143
src/main/webapp/WEB-INF/views/modules/userNew/cmClubData.jsp

@@ -95,15 +95,6 @@
             color: #666;
         }
 
-        .med-option {
-            display: block;
-            margin: 10px 0 0 160px;
-        }
-
-        .raw-option {
-            display: block;
-            margin: 10px 0 0 160px;
-        }
 
         .control-group .new-tag {
             display: inline-block;
@@ -126,28 +117,6 @@
             color: #e15616;
         }
 
-        #clubArea {
-            display: inline-block;
-            width: 450px;
-        }
-
-        #clubOther {
-            height: 40px;
-            line-height: 40px;
-            vertical-align: middle
-        }
-
-        #clubInput {
-            width: 159px;
-            margin: 7px;
-            display: inline-block;
-            height: 30px;
-            display: none;
-        }
-
-        .tags-operate {
-            margin-left: 160px;
-        }
 
         .control-group .tags-operate .tag-add {
             height: 40px;
@@ -155,18 +124,31 @@
             vertical-align: middle;
             display: none;
         }
-
-        .top-label {
-            width: 160px;
-            text-align: right;
-            vertical-align: top;
+        .faFlex{
+            max-width:1200px;
+            padding:15px;
+            border: #0d0d0d solid 1px;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+        .flDiv{
+            width: 30%;
+            height: 100%;
+            margin-left: 20px;
+            padding-top: 10px;
+            padding-left: 10px;
+        }
+        .club_group{
             margin-top: 10px;
+
         }
+
     </style>
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/new/user/agency/">机构列表</a></li>
+    <li><a href="${ctx}/new/user/agency/">机构机构基本资料列表</a></li>
     <li class="active"><a href="${ctx}/new/user/agency/clubPortrait?clubID=${newCmClub.clubID}">机构画像</a></li>
 </ul>
 <div class="ul-form">
@@ -181,13 +163,120 @@
 <form:hidden path="clubInfoID"/>
 <form:hidden path="userID"/>
 <form:hidden path="clubID"/>
-<div style="max-width:1200px;padding:15px;">
+<div class="faFlex">
+    <div class="flDiv">
+        <c:if test=""></c:if>
+        <div class="club_group">
+            <label>机构名称:</label>
+            <span>${newCmClub.name}</span>
+        </div>
+        <div class="club_group club_info">
+            <label>联系人:</label>
+            <span>${newCmClub.userName}</span>&nbsp;&nbsp;
+            <label>联系人身份:</label>
+            <span>
+                <c:if test="${newCmClub.linkManIdentity eq '1'}">老板</c:if>
+                <c:if test="${newCmClub.linkManIdentity eq '2'}">采购</c:if>
+                <c:if test="${newCmClub.linkManIdentity eq '3'}">运营</c:if>
+                <c:if test="${newCmClub.linkManIdentity ne '1' || newCmClub.linkManIdentity ne '2' || newCmClub.linkManIdentity ne '3'}">其他</c:if>
+            </span>
+        </div>
+        <div class="club_group">
+            <label>手机号:</label>
+            <span>${newCmClub.bindMobile}</span>
+        </div>
+        <div class="club_group">
+            <label>机构类型:</label>
+            <span>
+                <c:if test="${cmClubinfo.firstClubType == '1'}">医美</c:if>
+                <c:if test="${cmClubinfo.firstClubType == '2'}">生美</c:if>
+                <c:if test="${cmClubinfo.firstClubType == '3'}">项目公司</c:if>
+                <c:if test="${cmClubinfo.firstClubType == '4'}">个人</c:if>
+                <c:if test="${cmClubinfo.firstClubType == '5'}">其他</c:if>
+
+                <c:if test="${cmClubinfo.secondClubType eq '1'}"> - 诊所</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '2'}"> - 门诊</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '3'}"> - 医院</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '4'}"> - 其他</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '5'}"> - 美容院</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '6'}"> - 养生馆</c:if>
+                <c:if test="${cmClubinfo.secondClubType eq '7'}"> - 其他</c:if>
+            </span>
+        </div>
+        <div class="club_group">
+            <label>地址:</label>
+            <span>${newCmClub.province }</span>
+            <span>${newCmClub.city }</span>
+            <span>${newCmClub.town }</span>
+            <span>${newCmClub.address}</span>
+        </div>
+        <div class="club_group club_info">
+            <label>状态:</label>
+            <span>${fns:getDictLabel(newCmClub.status, 'club_status', newCmClub.status)}</span>&nbsp;&nbsp;
+            <label>注册时间:</label>
+            <span><fmt:formatDate value="${newCmClub.registerTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></span>
+        </div>
+    </div>
+    <div class="flDiv">
+        <div class="club_group">
+            <label>机构级别:</label>
+            <span>
+                <c:if test="${cmClubinfo.userIdentity eq 4}">
+                    个人机构
+                </c:if>
+                    <c:if test="${cmClubinfo.userIdentity eq 2}">
+                        资质机构
+                    </c:if>
+                    <c:if test="${cmClubinfo.svipUserFlag eq 1}">
+                        <font color="red">(超级会员)</font>
+                    </c:if>
+                    <c:if test="${cmClubinfo.userIdentity eq 2 and cmClubinfo.svipUserFlag eq 0}">
+                        <font color="red">(普通会员)</font>
+                    </c:if>
+            </span>
+        </div>
+        <div class="control-group">
+            <label class="control-label">营业执照:</label>
+            <img width="100" height="100" src="${newCmClub.businessLicenseImage}"/>
+        </div>
+    </div>
+    <div class="flDiv">
+        <div class="club_group">
+            <label>营业执照编号:</label>
+            <span>${newCmClub.socialCreditCode}</span>
+        </div>
+        <div class="qualification control-group club_group">
+            <label>医疗许可证:</label>
+            <img width="100" height="100" src="${cmClubinfo.medicalPracticeLicenseImg}"/>
+        </div>
+    </div>
+</div>
+<%--<div style="max-width:1200px;padding:15px; border: #0d0d0d solid 1px">
     <table border="0" cellspacing="0" cellpadding="0" width="100%">
         <tr height="28">
-            <th width="12%">状态:</th>
+            <th width="12%">机构名称:</th>
+            <td width="13%">${newCmClub.name}
+            &lt;%&ndash;<th width="12%">状态:</th>
             <td width="13%">${fns:getDictLabel(newCmClub.status, 'club_status', newCmClub.status)}</td>
             <th width="12%">注册时间:</th>
-            <td width="13%"><fmt:formatDate value="${newCmClub.registerTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
+            <td width="13%"><fmt:formatDate value="${newCmClub.registerTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>&ndash;%&gt;
+            <th width="12%">机构级别:</th>
+            <td width="13%">
+                <c:if test="${cmClubinfo.userIdentity eq 4}">
+                    个人机构
+                </c:if>
+                <c:if test="${cmClubinfo.userIdentity eq 2}">
+                    资质机构
+                </c:if>
+                <c:if test="${cmClubinfo.svipUserFlag eq 1}">
+                    <font color="red">(超级会员)</font>
+                </c:if>
+                <c:if test="${cmClubinfo.userIdentity eq 2 and cmClubinfo.svipUserFlag eq 0}">
+                    <font color="red">(普通会员)</font>
+                </c:if>
+            </td>
+            <th width="12%">营业执照编号:</th>
+            <td width="13%">${newCmClub.socialCreditCode}</td>
         </tr>
         <tr height="28">
             <th width="12%">机构名称:</th>
@@ -202,7 +291,7 @@
             <td width="13%">${newCmClub.userName}
             </td>
             <th width="12%">手机号:</th>
-            <td width="13%">${newCmClub.bindMobile}
+            <td width="13%">${newCmClub.bindMobile}</td>
             <th width="12%">联系人身份:</th>
             <td width="13%">
                 <c:if test="${newCmClub.linkManIdentity eq '1'}">老板</c:if>
@@ -210,35 +299,43 @@
                 <c:if test="${newCmClub.linkManIdentity eq '3'}">运营</c:if>
             </td>
         </tr>
+        <tr height="28">
+            <th width="12%">状态:</th>
+            <td width="13%">${fns:getDictLabel(newCmClub.status, 'club_status', newCmClub.status)}</td>
+            <th width="12%">注册时间:</th>
+            <td width="13%"><fmt:formatDate value="${newCmClub.registerTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
+        </tr>
     </table>
-</div>
+</div>--%>
 
 <sys:message content="${message}"/>
 <hr class="detailLine">
 <div>
     <table border="0" cellspacing="0" cellpadding="0" width="100%">
-        <tr>
+        <c:if test="${newCmClub.sname ne null and newCmClub.contractEmail ne null}">
+            <tr>
+                <td colspan="2">
+                    <div class="control-group">
+                        <c:if test="${newCmClub.sname ne null}">
+                            <label class="control-label">机构简称:</label>
+                            <span>${newCmClub.sname}</span>
+                        </c:if>
+                        <c:if test="${newCmClub.contractEmail ne null}">
+                            <lable class="control-label">注册邮箱:</lable>
+                            <span>${newCmClub.contractEmail}</span>
+                        </c:if>
+                    </div>
+                </td>
+            </tr>
+        </c:if>
+        <%--<tr>
             <td colspan="2">
                 <div class="control-group">
                     <label class="control-label"><b>地址:</b></label>
                     <span  id="curProvince" name="curProvince" >${newCmClub.province }</span>
-                    <span  id="curCity" name="curCity" >${newCmClub.province }</span>
+                    <span  id="curCity" name="curCity" >${newCmClub.city }</span>
                     <span  id="curTown" name="curTown" >${newCmClub.town }</span>
                         ${newCmClub.address}
-                    <%--<div class="controls">
-                        <form:select path="provinceID" disabled="true" class="input-xlarge" id="province"
-                                     onchange="loadCity()" style="width:100px;">
-                            <form:option value="" label="省" provinceId=""/>
-                        </form:select>
-                        <form:select path="cityID" disabled="true" class="input-xlarge" id="city" onchange="loadTown()"
-                                     style="width:100px;">
-                            <form:option value="" label="市" cityId=""/>
-                        </form:select>
-                        <form:select path="townID" disabled="true" class="input-xlarge" id="town" style="width:100px;">
-                            <form:option value="" label="区"/>
-                        </form:select>
-                            ${newCmClub.address}
-                    </div>--%>
                 </div>
             </td>
         </tr>
@@ -249,94 +346,78 @@
                     <div class="controls">${newCmClub.socialCreditCode}</div>
                 </div>
             </td>
-        </tr>
-        <tr>
-            <td>
-                <div class="control-group">
-                    <label class="control-label"><b>营业执照:</b></label>
-                    <img width="100" height="100" src="${newCmClub.businessLicenseImage}">
-                </div>
-            </td>
-            <td>
-                <div class="control-group">
-                    <label class="control-label"><b>门头照:</b></label>
-                    <img width="100" height="100" src="${newCmClub.headpic}">
-                </div>
-            </td>
-        </tr>
-        <tr>
-            <td>
-                <div class="control-group">
-                    <label class="control-label" for=""><b>机构类型:</b></label>
-                    <div class="medical-radio the-oradio">
-                        <input value="${cmClubinfo.firstClubType}" class="hide" type="text" id="firstClubType"/>
-                        <div class="med-beauty">
-                            <c:if test="${cmClubinfo.firstClubType == '1'}">医美</c:if>
-                            <c:if test="${cmClubinfo.firstClubType == '2'}">生美</c:if>
-                            <c:if test="${cmClubinfo.firstClubType == '3'}">项目公司</c:if>
-                            <c:if test="${cmClubinfo.firstClubType == '4'}">个人</c:if>
-                            <c:if test="${cmClubinfo.firstClubType == '5'}">其他</c:if>
-
-                            <c:if test="${cmClubinfo.secondClubType eq '1'}"> - 诊所</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '2'}"> - 门诊</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '3'}"> - 医院</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '4'}"> - 其他</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '5'}"> - 美容院</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '6'}"> - 养生馆</c:if>
-                            <c:if test="${cmClubinfo.secondClubType eq '7'}"> - 其他</c:if>
+        </tr>--%>
+        <c:if test="${newCmClub.headpic ne null}">
+            <tr>
+                <td>
+                    <div class="control-group">
+                        <label class="control-label"><b>门头照:</b></label>
+                        <img width="100" height="100" src="${newCmClub.headpic}">
+                    </div>
+                </td>
+            </tr>
+        </c:if>
+        <c:if test="${cmClubinfo.department ne null and cmClubinfo.mainpro ne null}">
+            <tr>
+                <td>
+                    <c:if test="${cmClubinfo.department ne null}">
+                        <div class="control-group epart" style="display: none">
+                            <label class="control-label"><b>科室:</b></label>
+                            <input class="reg-input" type="text" name="department" id="Department"
+                                   placeholder="请填写您的所经营的科室,用逗号隔开。(至少三个)" value="${cmClubinfo.department}"
+                                   style="margin-left: 10px;"/>
+                            <span class="err-tip"></span>
                         </div>
-
+                    </c:if>
+                    <c:if test="${cmClubinfo.mainpro ne null}">
+                        <div class="control-group" >
+                            <label class="control-label"><b>主营内容:</b></label>
+                            <font size="3">${cmClubinfo.mainpro}</font>
+                        </div>
+                    </c:if>
+                </td>
+            </tr>
+        </c:if>
+        <c:if test="${cmClubinfo.contractPhone ne null and cmClubinfo.fax ne null}">
+            <tr>
+                <c:if test="${cmClubinfo.contractPhone ne null}">
+                    <td>
+                        <div class="control-group">
+                            <label class="control-label"><b>固定电话:</b></label>
+                            <div class="controls">${cmClubinfo.contractPhone}</div>
+                        </div>
+                    </td>
+                </c:if>
+                <c:if test="${cmClubinfo.fax ne null}">
+                    <td>
+                        <div class="control-group">
+                            <label class="control-label"><b>传真:</b></label>
+                            <div class="controls">${cmClubinfo.fax}</div>
+                        </div>
+                    </td>
+                </c:if>
+            </tr>
+        </c:if>
+        <c:if test="${cmClubinfo.empnum ne null}">
+            <tr>
+                <td colspan="2">
+                    <div class="control-group">
+                        <label class="control-label"><b>员工人数:</b></label>
+                        <div class="controls">${cmClubinfo.empnum}</div>
                     </div>
-
-                    <div class="qualification control-group" style="display: none">
-                        <label class="control-label"><b>医疗许可证:</b></label>
-                        <img width="100" height="100" src="${cmClubinfo.medicalPracticeLicenseImg}">
-
+                </td>
+            </tr>
+        </c:if>
+        <c:if test="${cmClubinfo.info ne null}">
+            <tr>
+                <td colspan="2">
+                    <div class="control-group">
+                        <label class="control-label"><b>公司简介:</b></label>
+                        <div class="controls">${cmClubinfo.info}</div>
                     </div>
-                </div>
-                <div class="control-group epart" style="display: none">
-                    <label class="control-label"><b>科室:</b></label>
-                    <input class="reg-input" type="text" name="department" id="Department"
-                           placeholder="请填写您的所经营的科室,用逗号隔开。(至少三个)" value="${cmClubinfo.department}"
-                           style="margin-left: 10px;"/>
-                    <span class="err-tip"></span>
-                </div>
-                <div class="control-group" >
-                    <label class="control-label"><b>主营内容:</b></label>
-                    <font size="3">${cmClubinfo.mainpro}</font>
-                </div>
-            </td>
-        </tr>
-        <tr>
-            <td>
-                <div class="control-group">
-                    <label class="control-label"><b>固定电话:</b></label>
-                    <div class="controls">${cmClubinfo.contractPhone}</div>
-                </div>
-            </td>
-            <td>
-                <div class="control-group">
-                    <label class="control-label"><b>传真:</b></label>
-                    <div class="controls">${cmClubinfo.fax}</div>
-                </div>
-            </td>
-        </tr>
-        <tr>
-            <td colspan="2">
-                <div class="control-group">
-                    <label class="control-label"><b>员工人数:</b></label>
-                    <div class="controls">${cmClubinfo.empnum}</div>
-                </div>
-            </td>
-        </tr>
-        <tr>
-            <td colspan="2">
-                <div class="control-group">
-                    <label class="control-label"><b>公司简介:</b></label>
-                    <div class="controls">${cmClubinfo.info}</div>
-                </div>
-            </td>
-        </tr>
+                </td>
+            </tr>
+        </c:if>
     </table>
     <div style="visibility: hidden;">
         <div class="clubInfo">

+ 7 - 7
src/main/webapp/WEB-INF/views/modules/userNew/cmClubPortrait.jsp

@@ -22,13 +22,13 @@
     <div class="main-content">
         <div class="flex-header">
             <div class="flex-header-main">
-                <p><i class="icon i1"></i><span>江津福城医院有限责任公司</span></p>
-                <p><i class="icon i2"></i><span>彭沛琦</span></p>
-                <p><i class="icon i3"></i><span>老板</span></p>
-                <p><i class="icon i4"></i><span>13637832068</span></p>
-                <p><i class="icon i5"></i><span>医美-门诊</span></p>
-                <p><i class="icon i6"></i><span>安徽省合肥市</span></p>
-                <p><i class="icon i7"></i><span>2020-11-30</span></p>
+                <p><i class="icon i1"></i><span>${statistics.name}</span></p>
+                <p><i class="icon i2"></i><span>${statistics.linkMan}</span></p>
+                <p><i class="icon i3"></i><span>${statistics.linkManStatus}</span></p>
+                <p><i class="icon i4"></i><span>${statistics.contractMobile}</span></p>
+                <p><i class="icon i5"></i><span>${statistics.clubType}</span></p>
+                <p><i class="icon i6"></i><span>${statistics.province}</span><span>${statistics.city}</span><span>${statistics.town}</span></p>
+                <p><i class="icon i7"></i><span>${statistics.addTime}</span></p>
             </div>
         </div>
         <div class="flex-content">