Преглед на файлове

认证审核列表数据,服务员端审核()

limin преди 7 години
родител
ревизия
43cffb74e6

+ 23 - 1
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -1,6 +1,5 @@
 package com.goafanti.admin.controller;
 
-import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.Calendar;
 import java.util.UUID;
@@ -390,4 +389,27 @@ public class AdminApiController extends CertifyApiController {
 		return res;
 	}
 	
+	//获得专家顾问审核数据
+	@RequestMapping(value="/getExpertAuditList", method = RequestMethod.GET )
+	public Result getExpertAuditList(InputUserIdentity identity, Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(userIdentityService.getExpertAuditList(identity, pageNo, pageSize));
+		return res;
+	}
+	
+	//获得某个人认证的详情信息
+	@RequestMapping(value="/getUserIdentityByUid" , method = RequestMethod.GET)
+	public Result getUserIdentityByUid(String uid){
+		Result res = new Result();
+		res.setData(userIdentityService.getUserIdentityByUid(uid));
+		return res;
+	}
+		
+	//管理员更改审核状态
+	@RequestMapping(value="/auditing", method = RequestMethod.POST)
+	public Result auditing(UserIdentity identity){
+		Result res = new Result();
+		res.setData(userIdentityService.updateAuditing(identity));
+		return res;
+	}
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/UserIdentityMapper.java

@@ -109,4 +109,7 @@ public interface UserIdentityMapper {
 
 	ExpertsListBo selectAppExpertsDetail(@Param("id")String id, @Param("uid")String uid);
     
+	UserIdentity getUserIdentityByUid(String uid);
+	
+	Integer updateauditing(UserIdentity identity);
 }

+ 29 - 8
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -47,8 +47,12 @@
     <result column="consultant" jdbcType="INTEGER" property="consultant" />
     <result column="consultation_price" jdbcType="DECIMAL" property="consultationPrice" />
     <result column="expert_audit" jdbcType="INTEGER" property="expertAudit" />
-    <result column="identify_name" jdbcType="INTEGER" property="identifyName" />
+    <result column="identify_name" jdbcType="VARCHAR" property="identifyName" />
     <result column="consultant_type" jdbcType="INTEGER" property="consultantType" />
+    <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
+    <result column="society_tag" jdbcType="VARCHAR" property="societyTag" />
+    <result column="introduction" jdbcType="VARCHAR" property="introduction" />
+    <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -765,9 +769,6 @@
       <if test="consultantType != null">
         consultant_type = #{consultantType,jdbcType=DECIMAL},
       </if>
-      <if test="auditStatus != null">
-        audit_status = #{auditStatus,jdbcType=DECIMAL},
-      </if>
       <if test="releaseStatus != null">
         release_status = #{releaseStatus,jdbcType=DECIMAL},
       </if>
@@ -860,7 +861,8 @@
 		b.audit_status as auditStatus,
 		b.expert as expert,
 		b.work_unit as workUnit,
-		b.consultant_type as consultantType
+		b.consultant_type as consultantType,
+		b.audit_info as auditInfo
 	from
 		user a left join user_identity b on
 		a.id = b.uid
@@ -1354,7 +1356,7 @@ from
     u.mobile as contact_mobile, c.name as contacts, identify_name 
 	from user_identity i 
 	inner join user u on i.uid = u.id
-	inner join industry_category c on c.id = i.industry
+	left join industry_category c on c.id = i.industry
 	where 1 = 1
 	<if test="auditStatus != null ">
 	and  i.audit_status = #{auditStatus,jdbcType=VARCHAR}
@@ -1368,7 +1370,7 @@ from
 	<if test="expert == null ">
 	and expert &gt; 0
 	</if>
-	<if test="username != null">
+	<if test='username != null and username != ""'>
 	<bind name="un" value="'%' + username + '%'"/>
 	and (i.username like #{un,jdbcType=VARCHAR} or u.identify_name like #{un,jdbcType=VARCHAR} or u.nickname like #{un,jdbcType=VARCHAR} or u.username like #{un,jdbcType=VARCHAR})
 	</if>
@@ -1402,9 +1404,28 @@ from
 
 <!-- 获得用户认证信息数据  -->
 <select id="getUserIdentityByUid" parameterType="java.lang.String" resultMap="BaseResultMap">
-	select * 
+	select 
+	u.identify_name as identify_name, i.industry as industry, 
+	u.society_tag as society_tag, 
+	i.sex, i.date_of_birth_year, i.date_of_birth_month,
+	i.id_number, i.province, i.city, i.area, i.postal_address, i.fixed_tel, i.email, i.qq, 
+	u.mobile as contact_mobile, 
+	u.introduction, u.audit_opinion, 
+	i.expert, i.audit_status, i.positive_id_url, i.opposite_id_url, u.head_portrait_url, 
+	i.education, i.major_category, i.consultant_type, i.graduate_school, i.work_unit, 
+	i.qualification, i.professional_title, i.process, i.id, i.uid, i.audit_info
 	from `user` u
 	inner join user_identity i on u.id = i.uid
 	where u.id = #{uid,jdbcType=VARCHAR}
 </select>
+
+<!-- 更改用户认证(专家/顾问审核状态) -->
+<update id="updateauditing" parameterType="com.goafanti.common.model.UserIdentity">
+	update user_identity 
+	set audit_status = #{auditStatus,jdbcType=VARCHAR}
+	<if test="auditInfo != null">
+	 , audit_info = #{auditInfo,jdbcType=VARCHAR}
+	</if>
+	where id = #{id,jdbcType=VARCHAR}
+</update>
 </mapper>

+ 1 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -35,6 +35,7 @@
     <result column="transfer_time" jdbcType="TIMESTAMP" property="transferTime" />
     <result column="username" jdbcType="VARCHAR" property="username" />
     <result column="authentication" jdbcType="INTEGER" property="authentication" />
+    <result column="introduction" jdbcType="VARCHAR" property="introduction" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--

+ 37 - 4
src/main/java/com/goafanti/common/model/UserIdentity.java

@@ -3,10 +3,6 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
-import javax.validation.constraints.Size;
-
-import com.goafanti.common.constant.ErrorConstants;
-
 public class UserIdentity {
 
 	/**
@@ -996,4 +992,41 @@ public class UserIdentity {
 		this.identifyName = identifyName;
 	}
 	
+	private String auditInfo;
+	private String societyTag;
+	private String introduction;
+	private String headPortraitUrl;
+	
+	public String getAuditInfo() {
+		return auditInfo;
+	}
+
+	public void setAuditInfo(String auditInfo) {
+		this.auditInfo = auditInfo;
+	}
+
+	public String getSocietyTag() {
+		return societyTag;
+	}
+
+	public void setSocietyTag(String societyTag) {
+		this.societyTag = societyTag;
+	}
+
+	public String getIntroduction() {
+		return introduction;
+	}
+
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+
+	public String getHeadPortraitUrl() {
+		return headPortraitUrl;
+	}
+
+	public void setHeadPortraitUrl(String headPortraitUrl) {
+		this.headPortraitUrl = headPortraitUrl;
+	}
+	
 }

+ 10 - 0
src/main/java/com/goafanti/user/bo/InputUserIdentity.java

@@ -140,6 +140,16 @@ public class InputUserIdentity {
 	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String consultantCertificateUrl;
 	
+	private String auditInfo;
+	
+	public String getAuditInfo() {
+		return auditInfo;
+	}
+
+	public void setAuditInfo(String auditInfo) {
+		this.auditInfo = auditInfo;
+	}
+
 	public String getConsultantCertificateUrl() {
 		return consultantCertificateUrl;
 	}

+ 15 - 18
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -429,7 +429,7 @@ public class UserApiController extends BaseApiController {
 			User user = new User();
 			BeanUtils.copyProperties(userIdentity, ui);
 			BeanUtils.copyProperties(userIdentity, user);
-			//获得用户的认证信�?
+			//获得用户的认证信信息
 			UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
 			if (null == u) {
 				ui.setId(UUID.randomUUID().toString());
@@ -438,9 +438,22 @@ public class UserApiController extends BaseApiController {
 			} else {
 				//判断审核状态 当未审核或者审核不通过时
 				if (userIdentity.getAuditStatus() == 0 || userIdentity.getAuditStatus() == 3) {
-					ui.setAuditStatus(1);
 					ui.setId(u.getId());
+					ui.setAuditStatus(1);
 					userIdentityService.updateByPrimaryKeySelective(ui);
+				}else{
+					UserIdentity ui1 = new UserIdentity();
+					ui1.setId(u.getId());
+					//允许修改为空字符但是不能是null(以防引发空指针异常)
+					if(null != ui.getQq()) ui1.setQq(ui.getQq());
+					if(null != ui.getSex()) ui1.setSex(ui.getSex());
+					if(null != ui.getIdNumber()) ui1.setIdNumber(ui.getIdNumber());
+					if(null != ui.getPostalAddress()) ui1.setPostalAddress(ui.getPostalAddress());
+					if(null != ui.getFixedTel()) ui1.setFixedTel(ui.getFixedTel());
+					if(null != ui.getEmail()) ui1.setEmail(ui.getEmail());
+					if(null != ui.getDateOfBirthYear()) ui1.setDateOfBirthYear(ui.getDateOfBirthYear());
+					if(null != ui.getDateOfBirthMonth()) ui1.setDateOfBirthMonth(ui.getDateOfBirthMonth());
+					userIdentityService.updateByPrimaryKeySelective(ui1);
 				}
 			}
 			user.setId(TokenManager.getUserId());
@@ -908,22 +921,6 @@ public class UserApiController extends BaseApiController {
 		return res;
 	}
 	
-	//获得专家顾问审核数据
-	@RequestMapping(value="/getExpertAuditList", method = RequestMethod.GET )
-	public Result getExpertAuditList(InputUserIdentity identity, Integer pageNo, Integer pageSize){
-		Result res = new Result();
-		res.setData(userIdentityService.getExpertAuditList(identity, pageNo, pageSize));
-		return res;
-	}
-	
-	//获得某个人认证的详情信息
-	@RequestMapping(value="/getUserIdentityByUid" , method = RequestMethod.POST)
-	public Result getUserIdentityByUid(String uid){
-		Result res = new Result();
-		res.setData(userIdentityService.getUserIdentityByUid(uid));
-		return res;
-	}
-	
 	/**
 	 *	顾问专家审核列表 
 	 * @return

+ 6 - 0
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -86,4 +86,10 @@ public interface UserIdentityService {
 
 	Pagination<ExpertsListBo> appConsultantList(String name, Integer sortType, Integer consultantType, Integer province, Integer city,
 			Integer area, Integer pageNo, Integer pageSize);
+	/**
+	 * 更改用户认证(顾问/专家)审核状态
+	 * @param identity
+	 * @return
+	 */
+	Integer updateAuditing(UserIdentity identity);
 }

+ 21 - 6
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.user.service.impl;
 
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -28,11 +29,13 @@ import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserInterestMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.dao.UserRoleMapper;
+import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.CertifySubmitType;
 import com.goafanti.common.enums.IdentityAuditStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserIdentity;
@@ -504,21 +507,22 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		if(pageNo==null || pageNo<1)pageNo=1;
 		if(pageSize==null ||pageSize<1)pageSize=10; 
 		Map<String, Object> params=new HashMap<String,Object>();
-		//将查询参数弄到map中?
-		if(null != identity.getExpertAudit()) params.put("auditStatus", identity.getAuditStatus());
+		//将查询参数弄到map中
+		if(null != identity.getAuditStatus()) params.put("auditStatus", identity.getAuditStatus());
 		if(null != identity.getIndustry()) params.put("industry", identity.getIndustry());
 		if(null != identity.getExpert())  params.put("expert", identity.getExpert());
-		if(StringUtils.isBlank(identity.getUsername())) params.put("username", identity.getUsername());
+		if(StringUtils.isBlank(identity.getUsername())) params.put("username", identity.getIdentifyName());
 		System.out.println("查询审核列表");
+		System.out.println(params);
 		return (Pagination<MyInterestedBo>) findPage("getExpertAuditList", "getExpertAuditListCount", params, pageNo, pageSize);
 	}
 
 	@Override
 	public UserIdentity getUserIdentityByUid(String uid) {
-		//获得用户的认证信�?
-		UserIdentity u = userIdentityMapper.selectUserIdentityByUserId(uid);
+		//获得用户的认证信
+		UserIdentity u = userIdentityMapper.getUserIdentityByUid(uid);
 		return u;
-	}
+	} 
 	
 	@SuppressWarnings("unchecked")
 	@Override
@@ -567,6 +571,17 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		 if(StringUtils.isNotBlank(TokenManager.getUserId()))params.put("uid", TokenManager.getUserId());
 		 return (Pagination<ExpertsListBo>) findPage("appConsultantList", "appConsultantCount", params, pageNo, pageSize);
 	}
+
+	@Override
+	public Integer updateAuditing(UserIdentity identity) {
+		/*int auditStatus = AchievementAuditStatus.AUDITED.getCode().intValue();
+		if(identity.getAuditStatus().intValue() == 0) {
+			auditStatus=AchievementAuditStatus.UNAUDITED.getCode().intValue();
+		}
+		else auditStatus=AchievementAuditStatus.AUDITED.getCode().intValue();
+		identity.setAuditStatus(auditStatus);*/
+		return userIdentityMapper.updateByPrimaryKeySelective(identity);
+	}
 	
 
 }