Bladeren bron

Merge remote-tracking branch 'origin/master' into test

Conflicts:
	src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
limin 7 jaren geleden
bovenliggende
commit
d6a5009336

+ 27 - 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;
@@ -21,6 +20,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AdminFields;
 import com.goafanti.common.enums.CertifySubmitType;
 import com.goafanti.common.enums.IdentityAuditStatus;
@@ -390,4 +390,30 @@ 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();
+		if(AchievementAuditStatus.UNAUDITED.getCode().intValue() == identity.getAuditStatus() && null == identity.getAuditInfo()){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","审核不通过时必须填写原因"));
+		}
+		res.setData(userIdentityService.updateAuditing(identity));
+		return res;
+	}
 }

+ 4 - 3
src/main/java/com/goafanti/business/controller/AdminJtBusinessController.java

@@ -83,15 +83,16 @@ public class AdminJtBusinessController extends CertifyApiController{
 	 * 修改
 	 * */
 	@RequestMapping(value="/category/update",method=RequestMethod.POST)
-	private Result updateCategory(JtBusinessCategory jtBusinessCategory) {
+	private Result updateCategory(JtBusinessCategory jtBusinessCategory, Integer nextModule) {
 		Result result=new Result();
 		//只允许修改3种字段
-		JtBusinessCategory jtBusinessCategory2=new JtBusinessCategory();
+		JtBusinessCategory jtBusinessCategory2=new JtBusinessCategory();   
 		jtBusinessCategory2.setId(jtBusinessCategory.getId());
 		jtBusinessCategory2.setImgUrl(jtBusinessCategory.getImgUrl());
 		jtBusinessCategory2.setName(jtBusinessCategory.getName());
 		jtBusinessCategory2.setSummary(jtBusinessCategory.getSummary());
-		 result.setData(jtBusinessService.updateCategory(jtBusinessCategory2));
+		//jtBusinessCategory.setModule(nextModule);
+		 result.setData(jtBusinessService.updateCategory(jtBusinessCategory));
 		 return result;
 	}
 	

+ 76 - 1
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -22,7 +22,9 @@ import com.goafanti.common.dao.JtBusinessCategoryMapper;
 import com.goafanti.common.dao.JtBusinessProjectMapper;
 import com.goafanti.common.dao.JtCommodityCommentMapper;
 import com.goafanti.common.dao.JtTagMapper;
+import com.goafanti.common.enums.BusinessCategoryModule;
 import com.goafanti.common.enums.ProjectAuditStatus;
+import com.goafanti.common.enums.UserAuthentication;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.JtTag;
@@ -209,8 +211,81 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 
 	@Override
 	public int updateCategory(JtBusinessCategory jtBusinessCategory) {
+		// 层级不会变
 		// TODO Auto-generated method stub
-		return jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
+		//修改不影响结构的数据
+		JtBusinessCategory category = new JtBusinessCategory();
+		category.setId(jtBusinessCategory.getId());
+		category.setImgUrl(jtBusinessCategory.getImgUrl());
+		category.setName(jtBusinessCategory.getName());
+		category.setSummary(jtBusinessCategory.getSummary());
+		jtBusinessCategoryMapper.updateByPrimaryKeySelective(category);
+		//是否修改了模块类别
+		boolean moduleChange = null != jtBusinessCategory.getModule() ? !jtBusinessCategory.getModule().equals(jtBusinessCategory.getNextModule()) : false;
+		//是否有上级id
+		boolean existSuperId = StringUtils.isNotBlank(jtBusinessCategory.getSuperId());
+		//一级更换模块
+		if(moduleChange && !existSuperId){
+			//根据模块获得字母前缀
+			String prefix = BusinessCategoryModule.getStatus(jtBusinessCategory.getNextModule()).toString();
+			//获得当前更改后模块的最大值
+			
+			//将最大值加一
+			//得到sort
+			//将模块前面字母替换
+		}
+		//存在上级说明是二级修改到不同模块的某品类中
+		if(existSuperId){
+			
+			//根据更改后的上级id获得模块,得到对应的字母
+			//获得当前更改后模块的最大值
+			//将最大值加一
+			//得到sort
+			//将模块前面字母替换
+		}
+		
+		
+		
+		
+		//获得上级id
+		//只修改基本数据
+		//jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
+		if(StringUtils.isNotBlank(jtBusinessCategory.getSuperId()) && StringUtils.isNotBlank(jtBusinessCategory.getOldSuperId())){
+			//获得修改前品类id
+			//获得修改后品类id
+			//修改前后id不相等执行以下操作
+			if(!jtBusinessCategory.getSuperId().equals(jtBusinessCategory.getOldSuperId())){
+				//获得修改前品类number1
+				String oldNumber = jtBusinessCategoryMapper.selectByPrimaryKey(jtBusinessCategory.getOldSuperId()).getNumber();
+				//获得修改后品类number2
+				String number = jtBusinessCategoryMapper.selectByPrimaryKey(jtBusinessCategory.getSuperId()).getNumber();
+				//根据修改后的品类id获得最大同级number
+				String newNumber = jtBusinessCategoryMapper.getCurrentMaxNumber(number);
+				Integer n = null != newNumber ? Integer.valueOf(newNumber.substring(newNumber.length() - 2)) : 0;
+				if(n < 99){
+					n += 1;
+					newNumber = newNumber.substring(0,newNumber.length() - 3) + (n<10? "0"+ n : n);
+				} else {
+					newNumber = jtBusinessCategoryMapper.getCurrentMinNumber(number);
+					n = Integer.valueOf(newNumber.substring(newNumber.length() - 2));
+					if(n == 1 || n == 01){
+						return -1;
+					}
+					n -= 1;
+					newNumber = newNumber.substring(0,newNumber.length() - 3) + (n<10? "0"+ n : n);
+					
+				}  
+				//更新数据
+				jtBusinessCategory.setNumber(oldNumber);
+				jtBusinessCategory.setSort(number.length() + 1);
+				jtBusinessCategory.setName(newNumber);
+				//jtBusinessCategoryMapper.updateNumberPrefix(jtBusinessCategory);
+			}
+			
+		}
+		
+		
+		return 1;//jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
 	}
 
 	

+ 40 - 1
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -408,7 +408,6 @@ public class WebpageController extends BaseController {
 	@RequestMapping(value = "/portal/service/serviceDetail", method = RequestMethod.GET)
 	public ModelAndView portalServiceServiceDetail(HttpServletRequest request, ModelAndView modelview, String id) {
 		modelview.setViewName("/portal/service/serviceDetails");
-		//id = ""
 		JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
 		if (jtBusinessProject != null) {
 			if (jtBusinessProject.getMaxImgUrl() != null && jtBusinessProject.getMaxImgUrl().length() <= 0)
@@ -1185,5 +1184,45 @@ public class WebpageController extends BaseController {
 		}
 		res.setData(policyService.searchPolicy(keyword, 2, null, null, null, pNo, pSize, provinceId));
 		return res;
+	}
+	
+	/*
+	 * 服务预览详情
+	 * 
+	 * @param id String
+	 */
+	@RequestMapping(value = "/portal/service/serviceDetailPreview", method = RequestMethod.GET)
+	public ModelAndView portalServiceServiceDetailPreview(HttpServletRequest request, ModelAndView modelview, String id) {
+		modelview.setViewName("/portal/service/serviceDetails");
+		JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
+		if (jtBusinessProject != null) {
+			if (jtBusinessProject.getMaxImgUrl() != null && jtBusinessProject.getMaxImgUrl().length() <= 0)
+				jtBusinessProject.setMaxImgUrl(null);
+		}
+		if (jtBusinessProject.getCreateTime() != null
+				&& 7 >= differentDaysByMillisecond(jtBusinessProject.getCreateTime(), new Date())) {
+			modelview.addObject("newly", true);
+		} else
+			modelview.addObject("newly", false);
+		String owner = "平台管理员";
+		if (jtBusinessProject.getOwnerId() != null) {
+			User user = userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
+			if (user != null && user.getIdentifyName() != null) {
+				owner = user.getIdentifyName();
+			}
+		}
+		modelview.addObject("owner", owner);
+		modelview.addObject("pj", jtBusinessProject);
+		if (jtBusinessProject != null) {
+			JtBusinessCategoryTree tree = jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
+			modelview.addObject("tree", tree);
+		}
+		JtBusinessCategory jtBusinessCategory = jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
+		if (jtBusinessCategory != null && jtBusinessCategory.getModule() != null)
+			modelview.addObject("module", jtBusinessCategory.getModule());
+		else
+			modelview.addObject("module", 0);
+
+		return modelview;
 	}
 }

+ 5 - 0
src/main/java/com/goafanti/common/dao/JtBusinessCategoryMapper.java

@@ -90,4 +90,9 @@ public interface JtBusinessCategoryMapper {
     
     int autoIncreaseSort(Integer layer,Integer sort);
     
+    String getCurrentMaxNumber(String number);
+    String getCurrentMinNumber(String number);
+    
+    Integer updateNumberPrefix(JtBusinessCategory jtBusinessCategory);
+    
 }

+ 4 - 1
src/main/java/com/goafanti/common/dao/UserIdentityMapper.java

@@ -112,4 +112,7 @@ public interface UserIdentityMapper {
 
 	CommentDetailResult expertsCommentByUid(String id);
     
-}
+	UserIdentity getUserIdentityByUid(String uid);
+	
+	Integer updateAuditing(UserIdentity identity);
+}

+ 19 - 0
src/main/java/com/goafanti/common/mapper/JtBusinessCategoryMapper.xml

@@ -488,4 +488,23 @@ and layer=#{0}
     and bc1.module =#{module,jdbcType=INTEGER}
     </if>
     </select>
+    
+    <!-- 根据修改后的品类id获得最大同级number -->
+    <select id="getCurrentMaxNumber" resultType="java.lang.String" parameterType="java.lang.String">
+    	<bind name="n" value="_parameter + '__'"/>
+    	select max(`number`) maxnum from jt_business_category where `number` like #{n, jdbcType=VARCHAR}
+    </select>
+    <!-- 根据修改后的品类id获得最小同级number -->
+    <select id="getCurrentMinNumber" resultType="java.lang.String" parameterType="java.lang.String">
+    	<bind name="n" value="_parameter + '__'"/>
+    	select min(`number`) minnum from jt_business_category where `number` like #{n, jdbcType=VARCHAR}
+    </select>
+    
+    <!-- 修改品类前缀  -->
+    <update id="updateNumberPrefix" parameterType="com.goafanti.common.model.JtBusinessCategory">
+    	<bind name="n" value="number + '__%'"/>
+    	update jt_business_category 
+		set `number` = concat(#{name, jdbcType=VARCHAR},substring(`number`,#{sort, jdbcType=INTEGER}))
+		where `number` like "#{n, jdbcType=VARCHAR}
+    </update>
 </mapper>

+ 31 - 9
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
@@ -1367,7 +1369,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}
@@ -1381,7 +1383,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>
@@ -1415,7 +1417,16 @@ 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}
@@ -1433,4 +1444,15 @@ select a.create_time as createTime,
   limit 1
 
 </select>
-</mapper>
+
+<!-- 更改用户认证(专家/顾问审核状态) -->
+<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>
+>>>>>>> refs/remotes/origin/master
+</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">
     <!--

+ 19 - 0
src/main/java/com/goafanti/common/model/JtBusinessCategory.java

@@ -234,4 +234,23 @@ public class JtBusinessCategory {
 	public void setModule(Integer module) {
 		this.module = module;
 	}
+	
+	private String oldSuperId; //修改前的上级id
+	private Integer nextModule; //修改后的模块
+
+	public String getOldSuperId() {
+		return oldSuperId;
+	}
+
+	public void setOldSuperId(String oldSuperId) {
+		this.oldSuperId = oldSuperId;
+	}
+
+	public Integer getNextModule() {
+		return nextModule;
+	}
+
+	public void setNextModule(Integer nextModule) {
+		this.nextModule = nextModule;
+	}
 }

+ 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;
 	}

+ 2 - 35
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -425,26 +425,9 @@ public class UserApiController extends BaseApiController {
 			userIdentity.setAuthentication(UserAuthentication.AUTHENTICATION.getCode());
 		}
 		if (res.getError().isEmpty()) {
-			UserIdentity ui = new UserIdentity();
-			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());
-				ui.setUid(TokenManager.getUserId());
-				userIdentityService.insert(ui);
-			} else {
-				//判断审核状态 当未审核或者审核不通过时
-				if (userIdentity.getAuditStatus() == 0 || userIdentity.getAuditStatus() == 3) {
-					ui.setAuditStatus(1);
-					ui.setId(u.getId());
-					userIdentityService.updateByPrimaryKeySelective(ui);
-				}
+			if(userIdentityService.updateUserIdentityDetail(userIdentity) < 0){
+				userIdentity.setAuditInfo("系统提示:修改用户的基本信息,没有修改认证信息");
 			}
-			user.setId(TokenManager.getUserId());
-			userService.updateByPrimaryKeySelective(user);
 		}
 		res.setData(userIdentity);
 		return res;
@@ -908,22 +891,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

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

@@ -86,4 +86,17 @@ 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);
+	
+	/**
+	 * 个人资料修改以及认证插入或者修改
+	 * @param identity
+	 * @return
+	 */
+	Integer updateUserIdentityDetail(InputUserIdentity identity);
 }

+ 68 - 7
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -28,6 +28,7 @@ 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;
@@ -505,21 +506,20 @@ 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());
-		System.out.println("查询审核列表");
+		if(StringUtils.isBlank(identity.getUsername())) params.put("username", identity.getIdentifyName());
 		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
@@ -570,6 +570,67 @@ 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.updateAuditing(identity);
+	}
+
+	@Override
+	public Integer updateUserIdentityDetail(InputUserIdentity identity) {
+		Integer count = 0;
+		//修改用户信息
+		User user = new User();
+		BeanUtils.copyProperties(identity, user);
+		user.setId(TokenManager.getUserId());
+		count += userMapper.updateByPrimaryKeySelective(user);
+		
+		//获得用户的认证信信息
+		UserIdentity u = userIdentityMapper.selectUserIdentityByUserId(user.getId());
+		
+		UserIdentity ui = new UserIdentity();
+		BeanUtils.copyProperties(identity, ui);
+		if (null == u) {
+			ui.setId(UUID.randomUUID().toString());
+			ui.setUid(user.getId());
+			count += userIdentityMapper.insert(ui);
+		} else {
+			//暂不认证 或者认证审核中/通过,只修改认证信息中的用户信息 1, 2
+			if(identity.getExpert() == 0 || u.getAuditStatus() == AchievementAuditStatus.SUBMIT.getCode().intValue() || u.getAuditStatus() == AchievementAuditStatus.AUDITED.getCode().intValue()){
+				UserIdentity ui1 = new UserIdentity();
+				ui1.setId(u.getId());// 认证表id
+				//允许修改为空字符但是不能是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());
+				if(null != ui.getProvince()) ui1.setProvince(ui.getProvince());
+				if(null != ui.getCity()) ui1.setCity(ui.getCity());
+				if(null != ui.getArea()) ui1.setArea(ui.getArea());
+				if(null != ui.getIndustry()) ui1.setIndustry(ui.getIndustry());
+				count += userIdentityMapper.updateByPrimaryKeySelective(ui1);
+			}
+			//判断审核状态 当未审核或者审核不通过时 0, 3
+			if (identity.getExpert() > 0 && (identity.getAuditStatus() == AchievementAuditStatus.CREATE.getCode().intValue() || identity.getAuditStatus() == AchievementAuditStatus.UNAUDITED.getCode().intValue())) {
+				ui.setId(u.getId());
+				ui.setAuditStatus(AchievementAuditStatus.SUBMIT.getCode().intValue());
+				count += userIdentityMapper.updateByPrimaryKeySelective(ui);
+			}else{// 正在审核中或者审核通过
+				count = -1;
+			}
+		}
+		return count;
+	}
 	
 
 }

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/patenteDetails.html


File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceDetails.html