Explorar el Código

Accept Merge Request #172 merge : (master -> test)

Merge Request: merge
Created By: @Antiloveg
Accepted By: @Antiloveg
URL: https://coding.net/t/aft/p/AFT/git/merge/172
Antiloveg hace 8 años
padre
commit
08247ea3a7

+ 53 - 17
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -93,6 +93,7 @@ import com.goafanti.common.enums.UserAbilityFields;
 import com.goafanti.common.enums.UserFields;
 import com.goafanti.common.enums.UserIdentityFields;
 import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrgActivity;
 import com.goafanti.common.model.OrgActivityCost;
@@ -399,6 +400,17 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 		}
 
+		if (UserType.ORGANIZATION.getCode().equals(inputUser.getType())
+				&& StringUtils.isBlank(inputUser.getUnitName())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "公司名称", "公司名称"));
+			return res;
+		}
+
+		if (UserType.PERSONAL.getCode().equals(inputUser.getType()) && StringUtils.isBlank(inputUser.getUsername())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名称", "用户名称"));
+			return res;
+		}
+
 		User u = new User();
 		u.setId(UUID.randomUUID().toString());
 		u.setMobile(inputUser.getMobile().trim());
@@ -410,7 +422,7 @@ public class AdminApiController extends CertifyApiController {
 		u.setPassword(passwordUtil.getEncryptPwd(u));
 		u.setLvl(UserLevel.GENERAL.getCode());
 		u.setAid(TokenManager.getAdminId());
-		userService.insertRegister(u, "", inputUser.getUnitName());
+		userService.insertRegister(u, "", inputUser.getUnitName(), inputUser.getUsername());
 		return res;
 	}
 
@@ -445,7 +457,7 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
-		res.setData(userIdentityService.selectUserIdentityByUserId(uid));
+		res.setData(userIdentityService.selectUserIdentityByUserIdAdmin(uid));
 		return res;
 	}
 
@@ -464,7 +476,7 @@ public class AdminApiController extends CertifyApiController {
 		}
 
 		if (StringUtils.isBlank(userIdentity.getId())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "找不到用户认证ID"));
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到认证ID", "认证ID"));
 			return res;
 		}
 
@@ -478,10 +490,16 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 		}
 		
+		UserIdentity idd = userIdentityService.selectUserIdentityByUserId(userIdentity.getUid());
+		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())){
+			res.getError().add(buildError("", "审核中,无法保存或提交!"));
+			return res;
+		}
+
 		Integer level = userIdentity.getLevel();
 		if (!UserLevel.GENERAL.getCode().equals(level)) {
 			User u = userService.selectByPrimaryKey(userIdentity.getUid());
-			if (UserLevel.GENERAL.getCode().equals(u.getLvl())){
+			if (UserLevel.GENERAL.getCode().equals(u.getLvl())) {
 				res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
 				return res;
 			}
@@ -504,6 +522,11 @@ public class AdminApiController extends CertifyApiController {
 		BeanUtils.copyProperties(userIdentity, ui);
 
 		if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
+			User u = userService.selectByPrimaryKey(userIdentity.getUid());
+			if (!UserLevel.GENERAL.getCode().equals(u.getLvl())) {
+				res.getError().add(buildError("", "已通过实名认证,无法操作!"));
+				return res;
+			}
 			ui.setProcess(IdentityProcess.COMMITTED.getCode());
 			ui.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
 		}
@@ -541,7 +564,7 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
-		res.setData(organizationIdentityService.selectOrgIdentityDetailByUserId(uid));
+		res.setData(organizationIdentityService.selectOrgIdentityDetailByUserIdAdmin(uid));
 		return res;
 	}
 
@@ -574,11 +597,16 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "保存提交方式"));
 			return res;
 		}
-
+		
+		OrganizationIdentity idd = organizationIdentityService.selectOrgIdentityByUserId(orgIdentity.getUid());
+		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())){
+			res.getError().add(buildError("", "审核中,无法保存或提交!"));
+			return res;
+		}
 		Integer level = orgIdentity.getLevel();
 		if (!UserLevel.GENERAL.getCode().equals(level)) {
 			User u = userService.selectByPrimaryKey(orgIdentity.getUid());
-			if (UserLevel.GENERAL.getCode().equals(u.getLvl())){
+			if (UserLevel.GENERAL.getCode().equals(u.getLvl())) {
 				res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
 				return res;
 			}
@@ -593,7 +621,15 @@ public class AdminApiController extends CertifyApiController {
 
 		OrganizationIdentity oi = new OrganizationIdentity();
 		BeanUtils.copyProperties(orgIdentity, oi);
-
+		if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
+			User u = userService.selectByPrimaryKey(oi.getUid());
+			if (!UserLevel.GENERAL.getCode().equals(u.getLvl())) {
+				res.getError().add(buildError("", "已通过实名认证,无法操作!"));
+				return res;
+			}
+			oi.setProcess(IdentityProcess.COMMITTED.getCode());
+			oi.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
+		}
 		res.setData(organizationIdentityService.updateOrgDetail(oi, saveSign, level));
 		return res;
 	}
@@ -750,7 +786,7 @@ public class AdminApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 删除团体人力资源
 	 * 
@@ -766,8 +802,7 @@ public class AdminApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
-	
+
 	/**
 	 * 企业参与国家标准或行业标准制定情况明细列表
 	 */
@@ -947,11 +982,11 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
 			return res;
 		}
-		if (IntellectualPropertyType.PATENT.getCode() == type) {
+		if (IntellectualPropertyType.PATENT.getCode().equals(type)) {
 			res.setData(orgIntellectualPropertyService.selectPatentTypeDetail(id));
-		} else if (IntellectualPropertyType.COPYRIGHT.getCode() == type) {
+		} else if (IntellectualPropertyType.COPYRIGHT.getCode().equals(type)) {
 			res.setData(orgIntellectualPropertyService.selectCopyrightTypeDetail(id));
-		} else if (IntellectualPropertyType.COMMON.getCode() == type) {
+		} else if (IntellectualPropertyType.COMMON.getCode().equals(type)) {
 			OrgIntellectualPropertyDetailBo oipdb = new OrgIntellectualPropertyDetailBo();
 			BeanUtils.copyProperties(oip, oipdb);
 			res.setData(oipdb);
@@ -1173,7 +1208,7 @@ public class AdminApiController extends CertifyApiController {
 		if (StringUtils.isBlank(otp.getId())) {
 			OrgTechProduct product = orgTechProductService.findBySerialNumberAndUid(otp.getSerialNumber(),
 					otp.getUid());
-			if (null != product){
+			if (null != product) {
 				res.getError().add(buildError("", "产品编号重复,无法保存!"));
 				return res;
 			}
@@ -2220,7 +2255,7 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
-		
+
 		if (!checkCertify(res, orgTechCenter.getUid()).getError().isEmpty()) {
 			return res;
 		}
@@ -2860,7 +2895,8 @@ public class AdminApiController extends CertifyApiController {
 	 * 高企培育列表
 	 */
 	@RequestMapping(value = "/cultivate", method = RequestMethod.POST)
-	public Result cultivationList(String uid, Integer locationProvince, String unitName, String pageNo, String pageSize) {
+	public Result cultivationList(String uid, Integer locationProvince, String unitName, String pageNo,
+			String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;

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

@@ -125,10 +125,10 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (null == userIdentity.getLevel()) {
+		/*if (null == userIdentity.getLevel()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
 			return res;
-		}
+		}*/
 
 		if (!UserLevel.GENERAL.getCode().equals(userIdentity.getLevel())
 				|| IdentityAuditStatus.PASSED.getCode().equals(userIdentity.getAuditStatus())) {
@@ -204,10 +204,10 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 			return res;
 		}
 		
-		if (null == orgIdentity.getLevel()) {
+		/*if (null == orgIdentity.getLevel()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
 			return res;
-		}
+		}*/
 
 		if (!UserLevel.GENERAL.getCode().equals(orgIdentity.getLevel())
 				|| IdentityAuditStatus.PASSED.getCode().equals(orgIdentity.getAuditStatus())) {

+ 2 - 1
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -1614,7 +1614,7 @@ public class CognizanceApiController extends CertifyApiController {
 		if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
 			try {
 				orgIntellectualProperty.setAuthorizationDate(
-						DateUtils.parseDate(authorizationDateFormattedDate, AFTConstants.YYYYMMDDHHMMSS));
+						DateUtils.parseDate(authorizationDateFormattedDate, AFTConstants.YYYYMMDD));
 			} catch (ParseException e) {
 			}
 		}
@@ -1626,6 +1626,7 @@ public class CognizanceApiController extends CertifyApiController {
 			oip.setUid(TokenManager.getUserId());
 			oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
 			oip.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+			oip.setType(IntellectualPropertyType.COMMON.getCode());
 			res.setData(orgIntellectualPropertyService.insert(oip));
 		} else {
 			oip.setEvaluationCategory(oip.getCatagory() <= 2 ? 1 : 0);

+ 6 - 5
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -281,7 +281,7 @@
   
   <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
   select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , o.aft_username as aftUsername, o.audit_status as auditStatus, a.name as adminName,
+  	       u.number , o.aft_username as aftUsername, o.audit_status as orgAuditStatus, a.name as adminName,
   	       o.unit_name as unitName, ad.name as managerName
     from user u  
     LEFT JOIN admin a on a.id = u.aid 
@@ -353,12 +353,13 @@
   
    <select id="selectUserByAid" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
     select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , o.aft_username as aftUsername, o.audit_status as auditStatus, a.name as adminName, u.type,
-  	       o.unit_name as unitName
+  	       u.number , o.aft_username as aftUsername, o.audit_status as orgAuditStatus, a.name as adminName, u.type,
+  	       o.unit_name as unitName, i.username, i.audit_status as userAuditStatus
     from user u  
     LEFT JOIN admin a on a.id = u.aid 
-	LEFT JOIN organization_identity o 
-    ON u.id = o.uid 
+	LEFT JOIN organization_identity o  ON u.id = o.uid 
+	LEFT JOIN user_identity i on u.id = i.uid
+   
     where u.aid = #{aid,jdbcType=VARCHAR}
   </select>
   

+ 18 - 12
src/main/java/com/goafanti/user/bo/InputUser.java

@@ -7,19 +7,22 @@ import javax.validation.constraints.Size;
 import com.goafanti.common.constant.ErrorConstants;
 
 public class InputUser {
-	
+
 	@Size(min = 0, max = 11, message = "{" + ErrorConstants.MOBILE_SIZE_ERROR + "}")
-	private String mobile;
-	
+	private String	mobile;
+
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer type;
-	
+	private Integer	type;
+
 	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String unitName;
-	
+	private String	unitName;
+
 	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String password;
+	private String	password;
+
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	username;
 
 	public String getMobile() {
 		return mobile;
@@ -53,9 +56,12 @@ public class InputUser {
 		this.password = password;
 	}
 
-	
-	
-	
-	
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
 
 }

+ 18 - 0
src/main/java/com/goafanti/user/bo/OrgIdentityDetailAdmin.java

@@ -0,0 +1,18 @@
+package com.goafanti.user.bo;
+
+import com.goafanti.common.model.OrganizationIdentity;
+
+public class OrgIdentityDetailAdmin extends OrganizationIdentity {
+	private String level;
+
+	public String getLevel() {
+		return level;
+	}
+
+	public void setLevel(String level) {
+		this.level = level;
+	}
+
+	
+	
+}

+ 62 - 46
src/main/java/com/goafanti/user/bo/OrgListBo.java

@@ -9,29 +9,39 @@ import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.constant.AFTConstants;
 
 public class OrgListBo {
-    private String id;
-	
-    private	String mobile;
-    
-    private String email;
-    
-    private Date createTime;
-    
-    private Integer number;
-    
-    private String aftUsername;
-    
-    private Integer auditStatus;
-    
-    private String adminName;
-    
-    private String unitName;
-    
-    private Integer type;
-    
-    private String managerName;
-    
-    
+	private String	id;
+
+	private String	mobile;
+
+	private String	email;
+
+	private Date	createTime;
+
+	private Integer	number;
+
+	private String	aftUsername;
+
+	private Integer	orgAuditStatus;
+
+	private String	adminName;
+
+	private String	unitName;
+
+	private Integer	type;
+
+	private String	managerName;
+
+	private String	username;
+
+	private Integer	userAuditStatus;
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
 
 	public String getManagerName() {
 		return managerName;
@@ -89,15 +99,6 @@ public class OrgListBo {
 		this.aftUsername = aftUsername;
 	}
 
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getAuditStatus() {
-		return auditStatus;
-	}
-
-	public void setAuditStatus(Integer auditStatus) {
-		this.auditStatus = auditStatus;
-	}
-	
 	public String getAdminName() {
 		return adminName;
 	}
@@ -105,8 +106,6 @@ public class OrgListBo {
 	public void setAdminName(String adminName) {
 		this.adminName = adminName;
 	}
-	
-	
 
 	public String getUnitName() {
 		return unitName;
@@ -115,8 +114,7 @@ public class OrgListBo {
 	public void setUnitName(String unitName) {
 		this.unitName = unitName;
 	}
-	
-	
+
 	@JsonFormat(shape = Shape.STRING)
 	public Integer getType() {
 		return type;
@@ -125,18 +123,36 @@ public class OrgListBo {
 	public void setType(Integer type) {
 		this.type = type;
 	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getOrgAuditStatus() {
+		return orgAuditStatus;
+	}
 
-	//注册时间
-	public String getCreateTimeFormattedDate(){
+	public void setOrgAuditStatus(Integer orgAuditStatus) {
+		this.orgAuditStatus = orgAuditStatus;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getUserAuditStatus() {
+		return userAuditStatus;
+	}
+
+	public void setUserAuditStatus(Integer userAuditStatus) {
+		this.userAuditStatus = userAuditStatus;
+	}
+
+	// 注册时间
+	public String getCreateTimeFormattedDate() {
 		if (this.createTime == null) {
-			 return null;
-		   } else {
-			 return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDD);
-		   }
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDD);
+		}
 	}
-			
-	public void setCreateTimeFormattedDate(String createTimeFormattedDate){
-				
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
 	}
-    
+
 }

+ 18 - 0
src/main/java/com/goafanti/user/bo/UserIdentityDetailAdminBo.java

@@ -0,0 +1,18 @@
+package com.goafanti.user.bo;
+
+import com.goafanti.common.model.UserIdentity;
+
+public class UserIdentityDetailAdminBo extends UserIdentity {
+	private String level;
+
+	public String getLevel() {
+		return level;
+	}
+
+	public void setLevel(String level) {
+		this.level = level;
+	}
+
+	
+	
+}

+ 1 - 1
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -98,7 +98,7 @@ public class UserRegisterController extends BaseController {
 			}
 			*/
 			us.setAid("2");//ID为"2"的管理员
-			userService.insertRegister(us, contacts, companyName);
+			userService.insertRegister(us, contacts, companyName, null);
 		}
 
 		return res;

+ 3 - 0
src/main/java/com/goafanti/user/service/OrganizationIdentityService.java

@@ -11,6 +11,7 @@ import com.goafanti.portal.bo.OrgSubscriberListBo;
 import com.goafanti.user.bo.AuditorOrgIdentityDetailBo;
 import com.goafanti.user.bo.OrgBasicInfoBo;
 import com.goafanti.user.bo.OrgIdentityBo;
+import com.goafanti.user.bo.OrgIdentityDetailAdmin;
 import com.goafanti.user.bo.OrgIdentityDetailBo;
 import com.goafanti.user.bo.OrgUnitNames;
 
@@ -47,4 +48,6 @@ public interface OrganizationIdentityService {
 	Pagination<OrgSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province, Integer city,
 			Integer area, Integer pNo, Integer pSize);
 
+	OrgIdentityDetailAdmin selectOrgIdentityDetailByUserIdAdmin(String uid);
+
 }

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

@@ -6,6 +6,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.portal.bo.UserSubscriberListBo;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
 import com.goafanti.user.bo.UserIdentityBo;
+import com.goafanti.user.bo.UserIdentityDetailAdminBo;
 
 public interface UserIdentityService {
 
@@ -32,4 +33,6 @@ public interface UserIdentityService {
 	Pagination<UserSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province, Integer city,
 			Integer area, Integer pNo, Integer pSize);
 
+	UserIdentityDetailAdminBo selectUserIdentityByUserIdAdmin(String uid);
+
 }

+ 1 - 1
src/main/java/com/goafanti/user/service/UserService.java

@@ -26,7 +26,7 @@ public interface UserService {
 
 	User selectByMobieAndType(String mobile, Integer type);
 
-	User insertRegister(User user, String companyName, String contacts);
+	User insertRegister(User user, String companyName, String contacts, String username);
 
 	UserPageHomeBo selectUserPageHomeBoByUserId(String userId);
 

+ 23 - 10
src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java

@@ -9,6 +9,7 @@ import java.util.TreeMap;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -38,6 +39,7 @@ import com.goafanti.portal.bo.OrgSubscriberListBo;
 import com.goafanti.user.bo.AuditorOrgIdentityDetailBo;
 import com.goafanti.user.bo.OrgBasicInfoBo;
 import com.goafanti.user.bo.OrgIdentityBo;
+import com.goafanti.user.bo.OrgIdentityDetailAdmin;
 import com.goafanti.user.bo.OrgIdentityDetailBo;
 import com.goafanti.user.bo.OrgUnitNames;
 import com.goafanti.user.service.OrganizationIdentityService;
@@ -180,9 +182,11 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			createNotice(user, oi.getAuditStatus());
 		}
 		if (IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())) {
-			if (UserLevel.GENERAL.getCode().equals(level)) {
-				user.setLvl(UserLevel.CERTIFIED.getCode());
-			}
+			/*
+			 * if (UserLevel.GENERAL.getCode().equals(level)) {
+			 * user.setLvl(UserLevel.CERTIFIED.getCode()); }
+			 */
+			user.setLvl(UserLevel.CERTIFIED.getCode());
 			user.setAid(aid);
 			user.setMid(mid);
 			userMapper.updateByPrimaryKeySelective(user);
@@ -229,10 +233,10 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<OrgSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province, Integer city,
-			Integer area, Integer pNo, Integer pSize) {
+	public Pagination<OrgSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province,
+			Integer city, Integer area, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
-		
+
 		if (StringUtils.isNotBlank(name)) {
 			params.put("name", name);
 		}
@@ -248,16 +252,15 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		if (null != province) {
 			params.put("province", province);
 		}
-		
+
 		if (null != city) {
 			params.put("city", city);
 		}
-		
+
 		if (null != area) {
 			params.put("area", area);
 		}
-		
-		
+
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -343,4 +346,14 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		noticeMapper.insert(n);
 	}
 
+	@Override
+	public OrgIdentityDetailAdmin selectOrgIdentityDetailByUserIdAdmin(String uid) {
+		OrganizationIdentity o = organizationIdentityMapper.selectOrgIdentityByUserId(uid);
+		User u = userMapper.selectByPrimaryKey(uid);
+		OrgIdentityDetailAdmin bo = new OrgIdentityDetailAdmin();
+		BeanUtils.copyProperties(o, bo);
+		bo.setLevel(u.getLvl().toString());
+		return bo;
+	}
+
 }

+ 27 - 10
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -31,6 +32,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.portal.bo.UserSubscriberListBo;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
 import com.goafanti.user.bo.UserIdentityBo;
+import com.goafanti.user.bo.UserIdentityDetailAdminBo;
 import com.goafanti.user.service.UserIdentityService;
 
 @Service
@@ -94,11 +96,15 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 	@Override
 	public int updateUserDetail(UserIdentity u, String saveSign, Integer level) {
 		User user = userMapper.selectByPrimaryKey(u.getUid());
-		user.setLvl(level);
-		userMapper.updateByPrimaryKey(user);
+		if (!UserLevel.GENERAL.getCode().equals(user.getLvl())
+				&& !CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
+			user.setLvl(level);
+			userMapper.updateByPrimaryKey(user);
+		}
 		if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
 			createAuditorNotice(user);
 		}
+			
 		return userIdentityMapper.updateByPrimaryKeySelective(u);
 
 	}
@@ -113,9 +119,10 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 			createNotice(user, ui.getAuditStatus());
 		}
 		if (IdentityAuditStatus.PASSED.getCode().equals(ui.getAuditStatus())) {
-			if (UserLevel.GENERAL.getCode().equals(level)) {
+			/*if (UserLevel.GENERAL.getCode().equals(level)) {
 				user.setLvl(UserLevel.CERTIFIED.getCode());
-			}
+			}*/
+			user.setLvl(UserLevel.CERTIFIED.getCode());
 			user.setAid(aid);
 			user.setMid(mid);
 			userMapper.updateByPrimaryKeySelective(user);
@@ -139,10 +146,10 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<UserSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province, Integer city,
-			Integer area, Integer pNo, Integer pSize) {
+	public Pagination<UserSubscriberListBo> listSubscriber(String name, Integer level, String field, Integer province,
+			Integer city, Integer area, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
-		
+
 		if (StringUtils.isNotBlank(name)) {
 			params.put("name", name);
 		}
@@ -158,15 +165,15 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		if (null != province) {
 			params.put("province", province);
 		}
-		
+
 		if (null != city) {
 			params.put("city", city);
 		}
-		
+
 		if (null != area) {
 			params.put("area", area);
 		}
-		
+
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -256,4 +263,14 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		noticeMapper.insert(n);
 	}
 
+	@Override
+	public UserIdentityDetailAdminBo selectUserIdentityByUserIdAdmin(String uid) {
+		UserIdentity ui =  userIdentityMapper.selectUserIdentityByUserId(uid);
+		User u = userMapper.selectByPrimaryKey(uid);
+		UserIdentityDetailAdminBo bo = new UserIdentityDetailAdminBo();
+		BeanUtils.copyProperties(ui, bo);
+		bo.setLevel(u.getLvl().toString());
+		return bo;
+	}
+
 }

+ 14 - 1
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -23,6 +23,7 @@ import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -57,7 +58,7 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	private OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 
 	@Override
-	public User insertRegister(User user, String contacts, String unitName) {
+	public User insertRegister(User user, String contacts, String unitName, String username) {
 		userMapper.insert(user);
 		if (null != user.getType() && UserType.ORGANIZATION.getCode().equals(user.getType())) {
 			if (!StringUtils.isBlank(unitName) || !StringUtils.isBlank(contacts)) {
@@ -75,6 +76,18 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 				organizationIdentityMapper.insert(organizationIdentity);
 			}
 		}
+
+		if (null != user.getType() && UserType.PERSONAL.getCode().equals(user.getType())
+				&& StringUtils.isNotBlank(username)) {
+			UserIdentity ui = new UserIdentity();
+			ui.setId(UUID.randomUUID().toString());
+			ui.setUid(user.getId());
+			ui.setAuditStatus(0);
+			ui.setProcess(0);
+			ui.setWrongCount(0);
+			userIdentityMapper.insert(ui);
+		}
+
 		return user;
 	}
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 10 - 10
src/main/webapp/WEB-INF/views/common.html