Prechádzať zdrojové kódy

用户和展商查邀请

huangxiao 2 týždňov pred
rodič
commit
59bd7a8cc9

+ 4 - 0
src/main/java/net/mingsoft/people/bean/PeopleBeanExtension.java

@@ -36,4 +36,8 @@ public class PeopleBeanExtension extends PeopleBean {
      * 参观目的
      */
     private String purpose;
+    /**
+     * 邀请数
+     */
+    private Integer invNum;
 }

+ 4 - 1
src/main/java/net/mingsoft/people/dao/IPeopleDao.xml

@@ -82,6 +82,7 @@
 		<result column="INVITATION_USER_ID" property="invitationUserId" /><!--邀请用户ID -->
 		<result column="CHANNEL" property="channel" /><!--了解渠道 -->
 		<result column="PURPOSE" property="purpose" /><!--参观目的 -->
+		<result column="INV_NUM" property="invNum" /><!--邀请数 -->
 	</resultMap>
 
 	<!-- 将实体属性与表字段对接结束 -->
@@ -303,9 +304,11 @@
 		e.INVITATION_USER_ID,
 		e.POSITION,
 		e.COMPANY_NAME,
-		e.PURPOSE
+		e.PURPOSE,
+		n.num as INV_NUM
 		from people p left join people_user on p.id=PEOPLE_ID
 		left join mdiy_model_people_info e on e.LINK_ID=p.id
+		left join (select exhibitor,count(1) num from people_exhibitor group by exhibitor) n on n.exhibitor=PEOPLE_ID
 		<where>
 			<if test="where!=null">
 				<if test="where.peopleName != null and where.peopleName!=''">

+ 42 - 39
src/main/java/net/mingsoft/tf/action/ExhibitorAction.java

@@ -1,49 +1,34 @@
 package net.mingsoft.tf.action;
 
-import java.util.List;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import cn.hutool.core.util.ObjectUtil;
-import java.util.*;
-
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.swagger.v3.oas.annotations.Hidden;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import net.mingsoft.base.entity.ResultData;
+import net.mingsoft.basic.annotation.LogAnn;
+import net.mingsoft.basic.bean.EUListBean;
+import net.mingsoft.basic.constant.e.BusinessTypeEnum;
+import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.StringUtil;
+import net.mingsoft.tf.biz.IExhibitorBiz;
+import net.mingsoft.tf.entity.ExhibitorEntity;
+import net.mingsoft.tf.entity.ExhibitorEntityExtension;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import java.util.stream.Collectors;
-
 import org.springframework.web.bind.annotation.*;
-import net.mingsoft.tf.biz.IExhibitorBiz;
-import net.mingsoft.tf.entity.ExhibitorEntity;
-import net.mingsoft.base.entity.BaseEntity;
-import net.mingsoft.basic.util.BasicUtil;
-import net.mingsoft.basic.util.StringUtil;
-import net.mingsoft.basic.bean.EUListBean;
-import net.mingsoft.basic.annotation.LogAnn;
-import net.mingsoft.basic.constant.e.BusinessTypeEnum;
-import org.apache.commons.lang3.StringUtils;
-
-
 
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.Parameters;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.Hidden;
-import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
 * 展商管理控制层
@@ -103,14 +88,32 @@ public class ExhibitorAction extends net.mingsoft.tf.action.BaseAction{
     @RequiresPermissions("tf:exhibitor:view")
     public ResultData list(@ModelAttribute @Parameter(hidden = true) ExhibitorEntity exhibitor) {
         BasicUtil.startPage();
-        List exhibitorList = null;
+        List<ExhibitorEntity> exhibitorList;
         if ( exhibitor.getSqlWhere() != null){
             exhibitorList = exhibitorBiz.query(exhibitor);
         } else {
             LambdaQueryWrapper<ExhibitorEntity> wrapper = new LambdaQueryWrapper<>(exhibitor).orderByDesc(ExhibitorEntity::getCreateDate);
             exhibitorList = exhibitorBiz.list(wrapper);
         }
-        return ResultData.build().success(new EUListBean(exhibitorList,(int)BasicUtil.endPage(exhibitorList).getTotal()));
+        String ids = exhibitorList.stream().map(ExhibitorEntity::getExhibitorUser).map(item -> "'" + item + "'").collect(Collectors.joining(","));
+        String sql = "select exhibitor,count(1) num from people_exhibitor where exhibitor in (" + ids + ") group by exhibitor";
+        Map<String, Object> nums = StrUtil.isNotBlank(ids) ? exhibitorBiz.queryForList(sql)
+                .stream()
+                .collect(Collectors.toMap(
+                        map -> map.getOrDefault("exhibitor", "").toString(),
+                        map -> NumberUtil.parseInt(map.get("num").toString()))
+                ) : new HashMap<>();
+
+        List<ExhibitorEntityExtension> responses = exhibitorList.stream().map(p -> {
+            ExhibitorEntityExtension res = new ExhibitorEntityExtension();
+            BeanUtil.copyProperties(p, res);
+            Object o = nums.get(res.getExhibitorUser());
+            if (o != null) {
+                res.setInvNum((Integer) o);
+            }
+            return res;
+        }).collect(Collectors.toList());
+        return ResultData.build().success(new EUListBean(responses,(int)BasicUtil.endPage(exhibitorList).getTotal()));
     }
 
 

+ 13 - 0
src/main/java/net/mingsoft/tf/entity/ExhibitorEntityExtension.java

@@ -0,0 +1,13 @@
+package net.mingsoft.tf.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ExhibitorEntityExtension extends ExhibitorEntity{
+    /**
+     * 邀请数
+     */
+    private Integer invNum;
+}

+ 2 - 0
src/main/webapp/WEB-INF/manager/people/people-user/index.ftl

@@ -205,6 +205,8 @@
                     {{scope.row.peopleState==0?'未审':'已审'}}
                 </template>
             </el-table-column>
+            <el-table-column label="邀请数"   align="left" prop="invNum">
+            </el-table-column>
             <el-table-column label="用户等级"   align="left" prop="puLevelName">
             </el-table-column>
             <el-table-column label="公司名称"   align="left" prop="companyName">

+ 7 - 7
src/main/webapp/WEB-INF/manager/tf/enterprise/form.ftl

@@ -187,7 +187,7 @@ placeholder="请选择入驻时间"                    :readonly="false"
              <el-upload
                     :file-list="form.enterpriseLogo"
                     :action="ms.manager+'/file/upload.do'"
-                    :limit="1"
+                    :limit="5"
                     multiple
                     :disabled="false"
                     :data="{uploadPath:'/tf/','isRename':true,'appId':true}"
@@ -201,7 +201,7 @@ placeholder="请选择入驻时间"                    :readonly="false"
                     list-type="picture-card">
                 <i class="el-icon-plus"></i>
                 <template #tip>
-                  <div class="el-upload__tip">最多上传1张图片</div>
+                  <div class="el-upload__tip">最多上传5张图片</div>
                </template>
             </el-upload>
         </el-form-item>
@@ -236,7 +236,7 @@ placeholder="请选择入驻时间"                    :readonly="false"
                     // 展位号
                     enterpriseBooth:'',
                     // 访问量
-                    enterpriseVisits:'',
+                    enterpriseVisits:null,
                     // 联系人
                     enterpriseContact:'',
                     // 联系电话
@@ -351,9 +351,9 @@ placeholder="请选择入驻时间"                    :readonly="false"
                     if(res.result&&res.data) {
                                                                             
                    // 自定义模型需要根据控件配置转换
-                     if(res.data.enterpriseVisits){
-                     	res.data.enterpriseVisits=String(res.data.enterpriseVisits);
-                     }
+                   //   if(res.data.enterpriseVisits){
+                   //   	res.data.enterpriseVisits=String(res.data.enterpriseVisits);
+                   //   }
                                                                                if (res.data.enterpriseLogo) {
                           res.data.enterpriseLogo = JSON.parse(res.data.enterpriseLogo);
                           res.data.enterpriseLogo.forEach(function (value) {
@@ -437,7 +437,7 @@ placeholder="请选择入驻时间"                    :readonly="false"
         enterpriseLogoHandleExceed: function (files, fileList) {
         	this.$notify({
         		title: '失败',
-        		message: '当前最多上传1个文件',
+        		message: '当前最多上传5个文件',
         		type: 'warning'
         	});
         },

+ 3 - 3
src/main/webapp/WEB-INF/manager/tf/exhibitor/form.ftl

@@ -70,7 +70,7 @@
              <el-upload
                     :file-list="form.exhibitorLogo"
                     :action="ms.manager+'/file/upload.do'"
-                    :limit="1"
+                    :limit="5"
                     multiple
                     :disabled="false"
                     :data="{uploadPath:'/tf/','isRename':true,'appId':true}"
@@ -84,7 +84,7 @@
                     list-type="picture-card">
                 <i class="el-icon-plus"></i>
                 <template #tip>
-                  <div class="el-upload__tip">最多上传1张图片</div>
+                  <div class="el-upload__tip">最多上传5张图片</div>
                </template>
             </el-upload>
         </el-form-item>
@@ -258,7 +258,7 @@
         exhibitorLogoHandleExceed: function (files, fileList) {
         	this.$notify({
         		title: '失败',
-        		message: '当前最多上传1个文件',
+        		message: '当前最多上传5个文件',
         		type: 'warning'
         	});
         },

+ 79 - 22
src/main/webapp/WEB-INF/manager/tf/exhibitor/index.ftl

@@ -80,15 +80,17 @@
                     {{emptyText}}
                 </template>
                     <el-table-column type="selection" width="40" :selectable="isChecked"></el-table-column>
-                            <el-table-column label="公司名称"   align="left" prop="exhibitorName">
+                            <el-table-column label="公司名称"   min-width="250"   align="left" prop="exhibitorName">
                             </el-table-column>
                             <el-table-column label="展位号"   align="left" prop="exhibitorBooth">
                             </el-table-column>
                             <el-table-column label="联系人"   align="left" prop="exhibitorContact">
                             </el-table-column>
-                            <el-table-column label="联系电话"   align="left" prop="exhibitorPhone">
+                            <el-table-column label="联系电话"  min-width="100"  align="left" prop="exhibitorPhone">
                             </el-table-column>
-                    <el-table-column min-width="80" label="公司LOGO"  align="left">
+                            <el-table-column label="邀请数" align="left" prop="invNum">
+                            </el-table-column>
+                    <el-table-column min-width="100" label="公司LOGO" align="left">
                         <template #default="scope">
                             <template v-if="scope.row.exhibitorLogo&&scope.row.exhibitorLogo !=''&&JSON.parse(scope.row.exhibitorLogo).length">
                                 <div class="block" v-for="src in JSON.parse(scope.row.exhibitorLogo)">
@@ -116,10 +118,10 @@
                     <el-table-column label="操作"  width="180" align="center" fixed="right">
                             <template #default="scope">
                                 <@shiro.hasPermission name="tf:exhibitor:update">
-                                    <el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
+                                    <el-link type="primary" @click="save(scope.row.id)">编辑</el-link>
                                 </@shiro.hasPermission>
                             <@shiro.hasPermission name="tf:exhibitor:del">
-                                <el-link type="primary" :underline="false" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
+                                <el-link type="primary" @click="del([scope.row])" v-if="scope.row.del!=3">删除</el-link>
                             </@shiro.hasPermission>
                 </template>
                 </el-table-column>
@@ -152,22 +154,77 @@
         data:function() {
             return {
 				        searchJson:[
-        //公司名称
-        {'isSearch':'true','action':'and', 'field': 'EXHIBITOR_NAME', 'el': 'eq', 'model': 'exhibitorName', 'name': '公司名称', 'type': 'input'},
-        //展位号
-        {'isSearch':'true','action':'and', 'field': 'EXHIBITOR_BOOTH', 'el': 'eq', 'model': 'exhibitorBooth', 'name': '展位号', 'type': 'input'},
-        //联系人
-        {'isSearch':'true','action':'and', 'field': 'EXHIBITOR_CONTACT', 'el': 'eq', 'model': 'exhibitorContact', 'name': '联系人', 'type': 'input'},
-        //联系电话
-        {'isSearch':'','action':'and', 'field': 'EXHIBITOR_PHONE', 'el': 'eq', 'model': 'exhibitorPhone', 'name': '联系电话', 'type': 'input'},
-		// 公司LOGO
-    {'action':'and', 'field': 'EXHIBITOR_LOGO', 'el': 'empty', 'model': 'exhibitorLogo', 'name': '公司LOGO', 'type': 'imgupload'},
-        //用户ID
-        {'isSearch':'','action':'and', 'field': 'EXHIBITOR_USER', 'el': 'eq', 'model': 'exhibitorUser', 'name': '用户ID', 'type': 'input'},
-        //展会ID
-        {'isSearch':'','action':'and', 'field': 'EXHIBITOR_ACTIVITIES', 'el': 'eq', 'model': 'exhibitorActivities', 'name': '展会ID', 'type': 'input'},
-        //邀请码
-        {'isSearch':'','action':'and', 'field': 'EXHIBITOR_CODE', 'el': 'eq', 'model': 'exhibitorCode', 'name': '邀请码', 'type': 'input'},
+    {
+    "isSearch": "true",
+    "action": "and",
+    "field": "EXHIBITOR_NAME",
+    "el": "eq",
+    "model": "exhibitorName",
+    "name": "公司名称",
+    "type": "input"
+    },
+    {
+    "isSearch": "true",
+    "action": "and",
+    "field": "EXHIBITOR_BOOTH",
+    "el": "eq",
+    "model": "exhibitorBooth",
+    "name": "展位号",
+    "type": "input"
+    },
+    {
+    "isSearch": "true",
+    "action": "and",
+    "field": "EXHIBITOR_CONTACT",
+    "el": "eq",
+    "model": "exhibitorContact",
+    "name": "联系人",
+    "type": "input"
+    },
+    {
+    "isSearch": "",
+    "action": "and",
+    "field": "EXHIBITOR_PHONE",
+    "el": "eq",
+    "model": "exhibitorPhone",
+    "name": "联系电话",
+    "type": "input"
+    },
+    {
+    "action":"and",
+    "field": "EXHIBITOR_LOGO",
+    "el": "empty",
+    "model": "exhibitorLogo",
+    "name": "公司LOGO",
+    "type": "imgupload"
+    },
+    {
+    "isSearch": "",
+    "action": "and",
+    "field": "EXHIBITOR_USER",
+    "el": "eq",
+    "model": "exhibitorUser",
+    "name": "用户ID",
+    "type": "input"
+    },
+    {
+    "isSearch": "",
+    "action": "and",
+    "field": "EXHIBITOR_ACTIVITIES",
+    "el": "eq",
+    "model": "exhibitorActivities",
+    "name": "展会ID",
+    "type": "input"
+    },
+    {
+    "isSearch": "",
+    "action": "and",
+    "field": "EXHIBITOR_CODE",
+    "el": "eq",
+    "model": "exhibitorCode",
+    "name": "邀请码",
+    "type": "input"
+    },
                 ],
                 dataList: [], //展商列表
                 selectionList:[],//展商列表选中
@@ -324,7 +381,7 @@
         exhibitorLogoHandleExceed: function (files, fileList) {
         	this.$notify({
         		title: '失败',
-        		message: '当前最多上传1个文件',
+        		message: '当前最多上传5个文件',
         		type: 'warning'
         	});
         },