Bladeren bron

个人认证

limin 7 jaren geleden
bovenliggende
commit
50aeb68636

+ 4 - 0
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -20,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;
@@ -409,6 +410,9 @@ public class AdminApiController extends CertifyApiController {
 	@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;
 	}

+ 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("redirect:/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;
 	}
 }

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

@@ -111,5 +111,5 @@ public interface UserIdentityMapper {
     
 	UserIdentity getUserIdentityByUid(String uid);
 	
-	Integer updateauditing(UserIdentity identity);
+	Integer updateAuditing(UserIdentity identity);
 }

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

@@ -1420,7 +1420,7 @@ from
 </select>
 
 <!-- 更改用户认证(专家/顾问审核状态) -->
-<update id="updateauditing" parameterType="com.goafanti.common.model.UserIdentity">
+<update id="updateAuditing" parameterType="com.goafanti.common.model.UserIdentity">
 	update user_identity 
 	set audit_status = #{auditStatus,jdbcType=VARCHAR}
 	<if test="auditInfo != null">

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

@@ -425,39 +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.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);
-				}
+			if(userIdentityService.updateUserIdentityDetail(userIdentity) < 0){
+				userIdentity.setAuditInfo("系统提示:修改用户的基本信息,没有修改认证信息");
 			}
-			user.setId(TokenManager.getUserId());
-			userService.updateByPrimaryKeySelective(user);
 		}
 		res.setData(userIdentity);
 		return res;

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

@@ -92,4 +92,11 @@ public interface UserIdentityService {
 	 * @return
 	 */
 	Integer updateAuditing(UserIdentity identity);
+	
+	/**
+	 * 个人资料修改以及认证插入或者修改
+	 * @param identity
+	 * @return
+	 */
+	Integer updateUserIdentityDetail(InputUserIdentity identity);
 }

+ 51 - 5
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -2,7 +2,6 @@ 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;
@@ -35,7 +34,6 @@ 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;
@@ -512,8 +510,6 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		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.getIdentifyName());
-		System.out.println("查询审核列表");
-		System.out.println(params);
 		return (Pagination<MyInterestedBo>) findPage("getExpertAuditList", "getExpertAuditListCount", params, pageNo, pageSize);
 	}
 
@@ -580,7 +576,57 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		}
 		else auditStatus=AchievementAuditStatus.AUDITED.getCode().intValue();
 		identity.setAuditStatus(auditStatus);*/
-		return userIdentityMapper.updateByPrimaryKeySelective(identity);
+		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