浏览代码

用户列表

huangxiao 1 月之前
父节点
当前提交
ed719b8bc3

+ 4 - 3
src/main/java/net/mingsoft/people/action/PeopleUserAction.java

@@ -28,6 +28,7 @@ import net.mingsoft.basic.util.FileUtil;
 import net.mingsoft.basic.util.StringUtil;
 import net.mingsoft.mdiy.util.ConfigUtil;
 import net.mingsoft.people.bean.PeopleBean;
+import net.mingsoft.people.bean.PeopleBeanExtension;
 import net.mingsoft.people.biz.IPeopleBiz;
 import net.mingsoft.people.biz.IPeopleUserBiz;
 import net.mingsoft.people.constant.e.PeopleEnum;
@@ -116,14 +117,14 @@ public class PeopleUserAction extends BaseAction{
 	@GetMapping("/auditList")
 	@ResponseBody
 	@RequiresPermissions("people:user:view")
-	public ResultData auditList(@ModelAttribute @Parameter(hidden = true) PeopleBean peoplebean, HttpServletResponse response, HttpServletRequest request, @Parameter(hidden = true) ModelMap model) {
+	public ResultData auditList(@ModelAttribute @Parameter(hidden = true) PeopleBeanExtension peoplebean, HttpServletResponse response, HttpServletRequest request, @Parameter(hidden = true) ModelMap model) {
 		if(peoplebean == null){
-			peoplebean = new PeopleBean();
+			peoplebean = new PeopleBeanExtension();
 		}
 		peoplebean.setPeopleStateEnum(PeopleEnum.STATE_CHECK);
 		BasicUtil.startPage();
 		// 注册时间处理
-		List<PeopleBean> peopleUserList = peopleBiz.query(peoplebean);
+		List<PeopleBeanExtension> peopleUserList = peopleBiz.query2(peoplebean);
 		EUListBean list = new EUListBean(peopleUserList,(int) BasicUtil.endPage(peopleUserList).getTotal());
 		return ResultData.build().success( list);
 	}

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

@@ -0,0 +1,39 @@
+package net.mingsoft.people.bean;
+
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PeopleBeanExtension extends PeopleBean {
+    /**
+     * 公司名称
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String companyName;
+    /**
+     * 职位
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String position;
+    /**
+     * 展商邀请码
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String invitationCode;
+    /**
+     * 邀请用户ID
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String invitationUserId;
+    /**
+     * 了解渠道
+     */
+    private String channel;
+    /**
+     * 参观目的
+     */
+    private String purpose;
+}

+ 2 - 0
src/main/java/net/mingsoft/people/biz/IPeopleBiz.java

@@ -11,6 +11,7 @@ package net.mingsoft.people.biz;
 
 import net.mingsoft.base.biz.IBaseBiz;
 import net.mingsoft.people.bean.PeopleBean;
+import net.mingsoft.people.bean.PeopleBeanExtension;
 import net.mingsoft.people.constant.e.LoginTypeEnum;
 import net.mingsoft.people.entity.PeopleEntity;
 import net.mingsoft.people.entity.PeopleUserEntity;
@@ -35,6 +36,7 @@ public interface IPeopleBiz  extends IBaseBiz<PeopleEntity>{
 	 * @return
 	 */
 	List<PeopleBean> query(PeopleBean peopleBean);
+	List<PeopleBeanExtension> query2(PeopleBeanExtension peopleBean);
 
 	/**
 	 * 根据会员ID获取用户基本、详细信息

+ 9 - 13
src/main/java/net/mingsoft/people/biz/impl/PeopleBizImpl.java

@@ -21,6 +21,7 @@ import net.mingsoft.basic.util.StringUtil;
 import net.mingsoft.mdiy.biz.IModelBiz;
 import net.mingsoft.mdiy.entity.ModelEntity;
 import net.mingsoft.people.bean.PeopleBean;
+import net.mingsoft.people.bean.PeopleBeanExtension;
 import net.mingsoft.people.biz.IPeopleBiz;
 import net.mingsoft.people.constant.e.LoginTypeEnum;
 import net.mingsoft.people.constant.e.PeopleEnum;
@@ -86,11 +87,11 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 		people.setId(peopleEntity.getId());
 		return peopleUserDao.insert(peopleUserEntity);
 	}
-	
+
 	/**
 	 * 根据用户ID进行用户实体的更新,用于有子类的更新操作
 	 * @param people
-	 */	
+	 */
 	@Override
 	public void updatePeople(PeopleBean people) {
 		//修改子类子类时,people中没有参数,保证执行updateSQL语句是一定正确
@@ -105,8 +106,6 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 		peopleUserDao.update(peopleUserEntity, wrapper);
 	}
 
-
-	
 	/**
 	 * 根据用户用户名查询用户实体</br>
 	 * @param userName 用户名(注:手机号,邮箱,用户名称都可作为用户名登录)
@@ -114,8 +113,7 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 	 */
 	public PeopleEntity getEntityByUserName(String userName){
 		return this.peopleDao.getEntityByUserName(userName);
-	}	
-	
+	}
 
 	@Override
 	public PeopleEntity getEntityByCode(String userName, String peopleCode) {
@@ -130,6 +128,11 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 	}
 
 	@Override
+	public List<PeopleBeanExtension> query2(PeopleBeanExtension peopleBean) {
+		return peopleDao.query2(peopleBean);
+	}
+
+	@Override
 	public PeopleBean getPeopleById(String id) {
 		return  peopleDao.getPeopleById(id);
 	}
@@ -161,8 +164,6 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 		return peopleDao.getByPeople(people);
 	}
 
-
-
 	@Override
 	public PeopleEntity getEntityByMailOrPhone(String userName) {
 		// TODO Auto-generated method stub
@@ -185,17 +186,14 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 		if (!StringUtils.isBlank(peopleUser.getPeopleMail()) && !StringUtil.isEmail(peopleUser.getPeopleMail())) {
 			return false;
 		}
-
 		// 邮箱或手机号绑定   验证用户名可以为空
 		if(peopleUser.getPeoplePhoneCheck()== PeopleEnum.PHONE_NO_CHECK.toInt() && peopleUser.getPeopleMailCheck()==PeopleEnum.MAIL_NO_CHECK.toInt() && StringUtils.isBlank(peopleUser.getPeopleName())){
 			return false;
 		}
-
 		//如果填写了手机号码,则验证手机号码填写是否正确
 		if (!StringUtils.isBlank(peopleUser.getPeoplePhone()) && !StringUtil.isMobile(peopleUser.getPeoplePhone())) {
 			return false;
 		}
-
 		//当用户名进行修改时验证用户名是否是唯一的
 		if (!StringUtils.isBlank(peopleUser.getPeopleName())) {
 			// 验证用户名是否唯一
@@ -213,7 +211,6 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 					}
 				}
 			}
-
 		}
 		if(!StringUtils.isBlank(peopleUser.getPeoplePhone())){
 			PeopleEntity peoplePhone = peopleDao.getEntityByMailOrPhone(peopleUser.getPeoplePhone());
@@ -262,7 +259,6 @@ public class PeopleBizImpl  extends BaseBizImpl<IPeopleDao,PeopleEntity> impleme
 		}else {
 			peopleUser.setPeoplePhone(loginName);
 		}
-
 		return isExists(peopleUser);
 	}
 }

+ 2 - 0
src/main/java/net/mingsoft/people/dao/IPeopleDao.java

@@ -12,6 +12,7 @@ package net.mingsoft.people.dao;
 
 import net.mingsoft.base.dao.IBaseDao;
 import net.mingsoft.people.bean.PeopleBean;
+import net.mingsoft.people.bean.PeopleBeanExtension;
 import net.mingsoft.people.entity.PeopleEntity;
 import org.apache.ibatis.annotations.Param;
 
@@ -67,6 +68,7 @@ public interface IPeopleDao extends IBaseDao<PeopleEntity>{
 	 * @return 集合
 	 */
 	List<PeopleBean> query(@Param("where")PeopleBean peopleBean);
+	List<PeopleBeanExtension> query2(@Param("where")PeopleBeanExtension peopleBean);
 
 	/**
 	 * 根据会员id 查询用户的基础、详细信息

+ 116 - 0
src/main/java/net/mingsoft/people/dao/IPeopleDao.xml

@@ -46,6 +46,43 @@
 		<result column="PU_BIRTHDAY" property="puBirthday"/><!--用户生日 -->
 		<result column="PU_CARD" property="puCard"/><!-- 用户身份证号码 -->
 	</resultMap>
+	<!-- 将实体属性与表字段对接开始 -->
+	<resultMap id="resultMap2" type="net.mingsoft.people.bean.PeopleBeanExtension">
+		<id column="id" property="id"/><!-- 将实体的ID属性与表的ID字段对接 -->
+		<result column="PEOPLE_PHONE" property="peoplePhone"/><!-- 将实体的peoplePhone属性与表的peoplePhone字段对接 -->
+		<result column="PEOPLE_NAME" property="peopleName"/><!-- 将实体的peopleName属性与表的peopleName字段对接 -->
+		<result column="PEOPLE_PASSWORD" property="peoplePassword"/><!--
+			将实体的PEOPLE_PASSWORD属性与表的peoplePwd字段对接 -->
+		<result column="PEOPLE_DATETIME" property="peopleDateTime"/><!--
+			将实体的peopleDateTime属性与表的peopleDateTime字段对接 -->
+		<result column="PEOPLE_MAIL" property="peopleMail"/><!-- 用户邮箱 -->
+		<result column="PEOPLE_IP" property="peopleIp"/><!-- 用户ip -->
+		<result column="PEOPLE_STATE" property="peopleState"/><!-- 用户状态 -->
+		<result column="PEOPLE_CODE" property="peopleCode"/><!-- 用户随机码 -->
+		<result column="PEOPLE_CODESENDDATE" property="peopleCodeSendDate"/><!--
+			用户随机码发送时间 -->
+		<result column="PEOPLE_MAILLCHECK" property="peopleMailCheck"/><!--
+			用户是否通过邮箱验证 -->
+		<result column="PEOPLE_PHONECHECK" property="peoplePhoneCheck"/><!--
+			用户是否通过电话验证 -->
+		<result column="PU_REAL_NAME" property="puRealName"/><!--用户的真实名称 -->
+		<result column="PU_ADDRESS" property="puAddress"/><!--用户地址 -->
+		<result column="PU_ICON" property="puIcon"/><!-- 用户头像 -->
+		<result column="PU_LEVEL" property="puLevel"/><!-- 用户等级 -->
+		<result column="PU_LEVEL_NAME" property="puLevelName"/><!-- 等级名称 -->
+		<result column="PU_ICON" property="puIcon"/><!-- 用户头像 -->
+		<result column="PU_NICKNAME" property="puNickname"/><!--用户昵称 -->
+		<result column="PU_SEX" property="puSex"/><!-- 用户性别0.未知;1.男;2.女 -->
+		<result column="PU_BIRTHDAY" property="puBirthday"/><!--用户生日 -->
+		<result column="PU_CARD" property="puCard"/><!-- 用户身份证号码 -->
+
+		<result column="COMPANY_NAME" property="companyName" /><!--公司名称 -->
+		<result column="POSITION" property="position" /><!--职位 -->
+		<result column="INVITATION_CODE" property="invitationCode" /><!--展商邀请码 -->
+		<result column="INVITATION_USER_ID" property="invitationUserId" /><!--邀请用户ID -->
+		<result column="CHANNEL" property="channel" /><!--了解渠道 -->
+		<result column="PURPOSE" property="purpose" /><!--参观目的 -->
+	</resultMap>
 
 	<!-- 将实体属性与表字段对接结束 -->
 	<sql id="insertColumns">
@@ -256,6 +293,85 @@
 	</select>
 	<!-- 查询用户列表结束 -->
 
+	<!-- 查询用户列表开始 -->
+	<select id="query2" resultMap="resultMap2">
+		select
+		<include refid="column_list" />
+		,p.id,<include refid="user_column_list" />
+		,e.INVITATION_CODE,
+		e.CHANNEL,
+		e.INVITATION_USER_ID,
+		e.POSITION,
+		e.COMPANY_NAME,
+		e.PURPOSE
+		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
+		<where>
+			<if test="where!=null">
+				<if test="where.peopleName != null and where.peopleName!=''">
+					and PEOPLE_NAME like CONCAT(CONCAT('%',#{where.peopleName}),'%')
+				</if>
+				<!-- 用户审核状态 -->
+				<if test="where.peopleState!=null and where.peopleState &gt; -1">
+					and PEOPLE_STATE=#{where.peopleState}
+				</if>
+				<!-- 根据用户注册时间 <if test="people.peopleDateStartTime !=null "> </if> -->
+
+
+				<!-- 根据用户昵称 -->
+				<if test="where.puNickname !=null and where.puNickname!=''">
+					and PU_NICKNAME like CONCAT(CONCAT('%',#{where.puNickname}),'%')
+				</if>
+				<!-- 根据用户性别 -->
+				<if
+						test="where.puSex != null and  where.puSex &gt; -1 ">
+					and PU_SEX=#{where.puSex}
+				</if>
+				<!-- 根据用户真实姓名 -->
+				<if
+						test="where.puRealName != null and where.puRealName !=''">
+					and PU_REAL_NAME like CONCAT(CONCAT('%',#{where.puRealName}),'%')
+				</if>
+				<if test="where.peopleDateStartTime != null and where.peopleDateEndTime !=null ">
+					<if test="_databaseId == 'mysql'">
+						and (PEOPLE_DATETIME between
+						#{where.peopleDateStartTime} and #{where.peopleDateEndTime})
+					</if>
+					<if test="_databaseId == 'oracle'">
+						and PEOPLE_DATETIME &gt; to_date(#{where.peopleDateStartTime}, 'yyyy-mm-dd hh24:mi:ss')
+						and PEOPLE_DATETIME &lt; to_date(#{where.peopleDateEndTime}, 'yyyy-mm-dd hh24:mi:ss')
+					</if>
+				</if>
+				<if test="where.peopleId != null and where.peopleId !=''">
+					and p.id=#{where.peopleId}
+				</if>
+				<if test="where.peopleMail != null and where.peopleMail !=''">
+					and p.PEOPLE_MAIL=#{where.peopleMail}
+				</if>
+				<if test="where.peoplePhone != null and where.peoplePhone !=''">
+					and p.PEOPLE_PHONE=#{where.peoplePhone}
+				</if>
+--
+				<if test="where.companyName != null and where.companyName !=''">
+					and e.COMPANY_NAME like CONCAT(CONCAT('%',#{where.companyName}),'%')
+				</if>
+				<if test="where.position != null and where.position !=''">
+					and e.POSITION like CONCAT(CONCAT('%',#{where.position}),'%')
+				</if>
+				<if test="where.channel != null and where.channel !=''">
+					and e.CHANNEL=#{where.channel}
+				</if>
+				<if test="where.purpose != null and where.purpose !=''">
+					and e.PURPOSE=#{where.purpose}
+				</if>
+
+
+			</if>
+		</where>
+		order by p.PEOPLE_DATETIME desc
+	</select>
+	<!-- 查询用户列表结束 -->
+
 	<!-- 根据应用ID查询用户总数结束 -->
 
 	<!-- 根据用户名(帐号,手机,邮箱)和验证码查询用户信息开始 -->

+ 8 - 8
src/main/webapp/WEB-INF/manager/people/people-user/form.ftl

@@ -414,14 +414,14 @@
                     if (level === 1){
                         formData.provinceId  = id;
                     }
-                    else  if (level === 2){
-                        formData.cityId  = id;
-                    }
+                    // else  if (level === 2){
+                    //     formData.cityId  = id;
+                    // }
                 }
-                ms.http.get(ms.manager+'/basic/city/list.do',formData).then(function (res){
+                ms.http.get(ms.manager+'/basic/city/list.do?pageNo=1&pageSize=100000',formData).then(function (res){
                     if (res.result){
                         if (level === 0){
-                            res.data.forEach(function (item){
+                            res.data.rows.forEach(function (item){
                                 item.name = item.provinceName;
                                 item.id = item.provinceId;
                                 // 判断是否是叶子节点
@@ -429,7 +429,7 @@
                             })
                         }
                         else if (level === 1){
-                            res.data.forEach(function (item){
+                            res.data.rows.forEach(function (item){
                                 item.name = item.cityName;
                                 item.id = item.cityId;
                                 // 判断是否是叶子节点
@@ -437,14 +437,14 @@
                             })
                         }
                         else if (level === 2){
-                            res.data.forEach(function (item){
+                            res.data.rows.forEach(function (item){
                                 item.name = item.countyName;
                                 item.id = item.countyId;
                                 // 判断是否是叶子节点
                                 item.leaf = level >= 2
                             })
                         }
-                        resolve(res.data)
+                        resolve(res.data.rows)
                     }
                 })
             },

+ 0 - 0
src/main/webapp/favicon.ico → src/main/webapp/static/favicon.ico