wanghui 7 vuotta sitten
vanhempi
commit
ea679914d3

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

@@ -180,7 +180,7 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 	 * 审核员审核团体用户信息
 	 * 审核员审核团体用户信息
 	 */
 	 */
 	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
 	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
-	public Result diposeOrg(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
+	public Result updateOrgDetail(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
 			String paymentDateFormattedDate, String aid, String mid) {
 			String paymentDateFormattedDate, String aid, String mid) {
 		Result res = new Result();
 		Result res = new Result();
 
 

+ 2 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -141,4 +141,6 @@ public class ErrorConstants {
 	public static final String REFUND_BEYOND_SIGN					= "REFUND_BEYOND_SIGN";
 	public static final String REFUND_BEYOND_SIGN					= "REFUND_BEYOND_SIGN";
 	
 	
 	public static final String BILL_ALREADY_EXPIRE					= "BILL_ALREADY_EXPIRE";
 	public static final String BILL_ALREADY_EXPIRE					= "BILL_ALREADY_EXPIRE";
+	
+	public static final String USER_CONTACT_ALREADY_EXIST           = "USER_CONTACT_ALREADY_EXIST";
 }
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationContactBookExample;
 import com.goafanti.common.model.OrganizationContactBookExample;
+import com.goafanti.user.bo.UserContactBo;
 
 
 import java.util.List;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -81,4 +82,7 @@ public interface OrganizationContactBookMapper {
 	int updateMainContact(@Param("ocbId")String ocbId);
 	int updateMainContact(@Param("ocbId")String ocbId);
 	
 	
 	int updateSubContact(@Param("uid")String uid);
 	int updateSubContact(@Param("uid")String uid);
+
+	List<UserContactBo> selectContactByUid(String uid);
+	
 }
 }

+ 19 - 8
src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml

@@ -410,14 +410,20 @@
   </update>
   </update>
   
   
   <select id="checkContacts" resultType="java.lang.Integer">
   <select id="checkContacts" resultType="java.lang.Integer">
-		select
-			count( 0 )
-		from
-			organization_contact_book
-		where
-			aid = #{aid,jdbcType=VARCHAR}
-			and uid = #{uid,jdbcType=VARCHAR}
-			and mobile = #{mobile,jdbcType=VARCHAR}
+	select
+	count( 0 )
+	from
+	organization_contact_book
+	where 1=1
+	<if test="uid != null">
+		and uid = #{uid,jdbcType=VARCHAR}
+	</if>
+	<if test="aid != null">
+		and aid = #{aid,jdbcType=VARCHAR}
+	</if>
+	<if test="mobile != null">
+		and mobile = #{mobile,jdbcType=VARCHAR}
+	</if>
   </select>
   </select>
   
   
   <update id="updateSubContact">
   <update id="updateSubContact">
@@ -426,4 +432,9 @@
   <update id="updateMainContact">
   <update id="updateMainContact">
   	 update organization_contact_book set major = 1 where id = #{ocbId,jdbcType=VARCHAR}
   	 update organization_contact_book set major = 1 where id = #{ocbId,jdbcType=VARCHAR}
   </update>
   </update>
+  
+  <select id="selectContactByUid" resultType="com.goafanti.user.bo.UserContactBo">
+  	select id,name,mobile,email,qq,wechat,depatrment,position,major from organization_contact_book
+	where uid = #{uid,jdbcType=VARCHAR}
+  </select>
 </mapper>
 </mapper>

+ 32 - 11
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -1210,18 +1210,39 @@
 		where uid = #{uid,jdbcType=VARCHAR}
 		where uid = #{uid,jdbcType=VARCHAR}
 	</select>
 	</select>
 
 
-
 	<select id="selectOrgIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgIdentityBo">
 	<select id="selectOrgIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgIdentityBo">
-		select 
-		t.id,t.uid,t.contacts,t.fixed_tel as fixedTel,
-		t.qq,t.postal_address
-		as postalAddress ,t.postcode,
-		u.email ,t.legal_person
-		as legalPerson
-		from user u LEFT JOIN organization_identity t
-		on t.uid =
-		u.id
-		where t.uid=#{uid,jdbcType=VARCHAR}
+		select
+			a.id as uid,
+			a.identify_name as identifyName,
+			a.mobile,
+			a.email,
+			a.introduction,
+			a.company_logo_url as companyLogoUrl,
+			a.society_tag as societyTag,
+			a.authentication,
+			b.id,
+			b.industry,
+			b.enterprise_scale as enterpriseScale,
+			b.registered_capital as registeredCapital,
+			b.legal_person as legalPerson,
+			b.legal_person_tel as legalPersonTel,
+			b.legal_person_id_card as legalPersonIdCard,
+			b.legal_person_email as legalPersonEmail,
+			b.listed,
+			b.high_tech_zone as highTechZone,
+			b.licence_province as licenceProvince,
+			b.licence_city as licenceCity,
+			b.licence_area as licenceArea,
+			b.postal_address as postalAddress,
+			b.fixed_tel as fixedTel,
+			b.org_code_url as orgCodeUrl,
+			b.org_code as orgCode,
+			b.business_scope as businessScope
+		from
+			user a left join organization_identity b on
+			a.id = b.uid
+		where
+			a.id = #{uid,jdbcType=VARCHAR}
 	</select>
 	</select>
 
 
 	<select id="selectAllOrgIndentity" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgUnitNames">
 	<select id="selectAllOrgIndentity" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgUnitNames">

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

@@ -824,17 +824,20 @@
    
    
   <select id="selectUserIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserIdentityBo">
   <select id="selectUserIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserIdentityBo">
 	 select
 	 select
+	 	a.id as uid,
 		a.identify_name as identifyName,
 		a.identify_name as identifyName,
 		a.mobile,
 		a.mobile,
 		a.email,
 		a.email,
 		a.introduction,
 		a.introduction,
 		a.head_portrait_url as headPortraitUrl,
 		a.head_portrait_url as headPortraitUrl,
 		a.society_tag as societyTag,
 		a.society_tag as societyTag,
+		a.authentication,
+		b.id,
 		b.industry,
 		b.industry,
 		b.sex,
 		b.sex,
 		b.date_of_birth_year as dateOfBirthYear,
 		b.date_of_birth_year as dateOfBirthYear,
 		b.date_of_birth_month as dateOfBirthMonth,
 		b.date_of_birth_month as dateOfBirthMonth,
-		b.id_number,
+		b.id_number as idNumber,
 		b.positive_id_url as positiveIdUrl,
 		b.positive_id_url as positiveIdUrl,
 		b.opposite_id_url as oppositeIdUrl,
 		b.opposite_id_url as oppositeIdUrl,
 		b.province,
 		b.province,

+ 110 - 10
src/main/java/com/goafanti/user/bo/InputOrganizationIdentity.java

@@ -34,8 +34,8 @@ public class InputOrganizationIdentity {
 	@Size(min = 0, max = 8, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 8, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		postcode;
 	private String		postcode;
 
 
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		unitName;
+	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		identifyName;
 
 
 	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
@@ -99,10 +99,16 @@ public class InputOrganizationIdentity {
 
 
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		legalPerson;
 	private String		legalPerson;
-
+	
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String 		legalPersonTel;
+	
 	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		legalPersonIdCard;
 	private String		legalPersonIdCard;
 
 
+	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String 		legalPersonEmail;
+	
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		lastYearTaxReportUrl;
 	private String		lastYearTaxReportUrl;
 
 
@@ -149,12 +155,34 @@ public class InputOrganizationIdentity {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		level;
 	private Integer		level;
 
 
-	/**
-	 * 领域
-	 */
+	@Max(value = 99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer industry;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer enterpriseScale;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer highTechZone;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer authentication;
+	
+	@Size(min = 0, max = 400, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String businessScope;
+	
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		field;
 	private String		field;
 
 
+	@Size(min = 0, max = 127, message = "{" + ErrorConstants.EMAIL_SIZE_ERROR + "}")
+	private String email;
+	
+	@Size(min = 0, max = 127, message = "{" + ErrorConstants.EMAIL_SIZE_ERROR + "}")
+	private String companyLogoUrl;
+	
 	public String getId() {
 	public String getId() {
 		return id;
 		return id;
 	}
 	}
@@ -219,12 +247,12 @@ public class InputOrganizationIdentity {
 		this.postcode = postcode;
 		this.postcode = postcode;
 	}
 	}
 
 
-	public String getUnitName() {
-		return unitName;
+	public String getIdentifyName() {
+		return identifyName;
 	}
 	}
 
 
-	public void setUnitName(String unitName) {
-		this.unitName = unitName;
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
 	}
 	}
 
 
 	public Integer getRegisteredCapital() {
 	public Integer getRegisteredCapital() {
@@ -359,6 +387,14 @@ public class InputOrganizationIdentity {
 		this.legalPerson = legalPerson;
 		this.legalPerson = legalPerson;
 	}
 	}
 
 
+	public String getLegalPersonTel() {
+		return legalPersonTel;
+	}
+
+	public void setLegalPersonTel(String legalPersonTel) {
+		this.legalPersonTel = legalPersonTel;
+	}
+
 	public String getLegalPersonIdCard() {
 	public String getLegalPersonIdCard() {
 		return legalPersonIdCard;
 		return legalPersonIdCard;
 	}
 	}
@@ -367,6 +403,14 @@ public class InputOrganizationIdentity {
 		this.legalPersonIdCard = legalPersonIdCard;
 		this.legalPersonIdCard = legalPersonIdCard;
 	}
 	}
 
 
+	public String getLegalPersonEmail() {
+		return legalPersonEmail;
+	}
+
+	public void setLegalPersonEmail(String legalPersonEmail) {
+		this.legalPersonEmail = legalPersonEmail;
+	}
+
 	public String getLastYearTaxReportUrl() {
 	public String getLastYearTaxReportUrl() {
 		return lastYearTaxReportUrl;
 		return lastYearTaxReportUrl;
 	}
 	}
@@ -491,6 +535,46 @@ public class InputOrganizationIdentity {
 		return locationArea;
 		return locationArea;
 	}
 	}
 
 
+	public Integer getIndustry() {
+		return industry;
+	}
+
+	public void setIndustry(Integer industry) {
+		this.industry = industry;
+	}
+
+	public Integer getEnterpriseScale() {
+		return enterpriseScale;
+	}
+
+	public void setEnterpriseScale(Integer enterpriseScale) {
+		this.enterpriseScale = enterpriseScale;
+	}
+
+	public Integer getHighTechZone() {
+		return highTechZone;
+	}
+
+	public void setHighTechZone(Integer highTechZone) {
+		this.highTechZone = highTechZone;
+	}
+
+	public Integer getAuthentication() {
+		return authentication;
+	}
+
+	public void setAuthentication(Integer authentication) {
+		this.authentication = authentication;
+	}
+
+	public String getBusinessScope() {
+		return businessScope;
+	}
+
+	public void setBusinessScope(String businessScope) {
+		this.businessScope = businessScope;
+	}
+
 	public String getField() {
 	public String getField() {
 		return field;
 		return field;
 	}
 	}
@@ -499,4 +583,20 @@ public class InputOrganizationIdentity {
 		this.field = field;
 		this.field = field;
 	}
 	}
 
 
+	public String getEmail() {
+		return email;
+	}
+
+	public void setEmail(String email) {
+		this.email = email;
+	}
+
+	public String getCompanyLogoUrl() {
+		return companyLogoUrl;
+	}
+
+	public void setCompanyLogoUrl(String companyLogoUrl) {
+		this.companyLogoUrl = companyLogoUrl;
+	}
+
 }
 }

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

@@ -107,6 +107,10 @@ public class InputUserIdentity {
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String qq;
 	private String qq;
 	
 	
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer authentication;
+	
 	public Integer getExpert() {
 	public Integer getExpert() {
 		return expert;
 		return expert;
 	}
 	}
@@ -338,4 +342,12 @@ public class InputUserIdentity {
 	public void setQq(String qq) {
 	public void setQq(String qq) {
 		this.qq = qq;
 		this.qq = qq;
 	}
 	}
+
+	public Integer getAuthentication() {
+		return authentication;
+	}
+
+	public void setAuthentication(Integer authentication) {
+		this.authentication = authentication;
+	}
 }
 }

+ 0 - 14
src/main/java/com/goafanti/user/bo/OrgIdentityBo.java

@@ -1,19 +1,5 @@
 package com.goafanti.user.bo;
 package com.goafanti.user.bo;
 
 
-import javax.validation.constraints.Size;
-
-import com.goafanti.common.constant.ErrorConstants;
-
 public class OrgIdentityBo extends InputOrganizationIdentity {
 public class OrgIdentityBo extends InputOrganizationIdentity {
-	@Size(min = 0, max = 127, message = "{" + ErrorConstants.EMAIL_SIZE_ERROR + "}")
-	private String email;
-
-	public String getEmail() {
-		return email;
-	}
-
-	public void setEmail(String email) {
-		this.email = email;
-	}
 
 
 }
 }

+ 12 - 0
src/main/java/com/goafanti/user/bo/UserContactBo.java

@@ -0,0 +1,12 @@
+package com.goafanti.user.bo;
+
+import com.goafanti.common.model.OrganizationContactBook;
+
+/**
+ * 通讯录
+ * @author Administrator
+ *
+ */
+public class UserContactBo extends  OrganizationContactBook{
+
+}

+ 173 - 68
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -16,7 +16,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import com.alibaba.druid.sql.parser.Token;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.enums.IdentityAuditStatus;
 import com.goafanti.common.enums.IdentityAuditStatus;
@@ -25,6 +27,7 @@ import com.goafanti.common.enums.OrgProFields;
 import com.goafanti.common.enums.OrganizationIdentityFields;
 import com.goafanti.common.enums.OrganizationIdentityFields;
 import com.goafanti.common.enums.OrganizationTechFields;
 import com.goafanti.common.enums.OrganizationTechFields;
 import com.goafanti.common.enums.UserAbilityFields;
 import com.goafanti.common.enums.UserAbilityFields;
+import com.goafanti.common.enums.UserAuthentication;
 import com.goafanti.common.enums.UserCareerFields;
 import com.goafanti.common.enums.UserCareerFields;
 import com.goafanti.common.enums.UserEduFields;
 import com.goafanti.common.enums.UserEduFields;
 import com.goafanti.common.enums.UserIdentityFields;
 import com.goafanti.common.enums.UserIdentityFields;
@@ -42,17 +45,20 @@ import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.user.bo.InputOrgPro;
 import com.goafanti.user.bo.InputOrgPro;
+import com.goafanti.user.bo.InputOrganizationIdentity;
 import com.goafanti.user.bo.InputOrganizationTech;
 import com.goafanti.user.bo.InputOrganizationTech;
 import com.goafanti.user.bo.InputUserAbility;
 import com.goafanti.user.bo.InputUserAbility;
 import com.goafanti.user.bo.InputUserCareer;
 import com.goafanti.user.bo.InputUserCareer;
 import com.goafanti.user.bo.InputUserEdu;
 import com.goafanti.user.bo.InputUserEdu;
 import com.goafanti.user.bo.InputUserIdentity;
 import com.goafanti.user.bo.InputUserIdentity;
 import com.goafanti.user.bo.OrgIdentityBo;
 import com.goafanti.user.bo.OrgIdentityBo;
+import com.goafanti.user.bo.UserContactBo;
 import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.OrganizationTechService;
 import com.goafanti.user.service.OrganizationTechService;
 import com.goafanti.user.service.UserAbilityService;
 import com.goafanti.user.service.UserAbilityService;
 import com.goafanti.user.service.UserCareerService;
 import com.goafanti.user.service.UserCareerService;
+import com.goafanti.user.service.UserContactService;
 import com.goafanti.user.service.UserEduService;
 import com.goafanti.user.service.UserEduService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
 import com.goafanti.user.service.UserService;
@@ -76,6 +82,8 @@ public class UserApiController extends BaseApiController {
 	private OrganizationIdentityService		organizationIdentityService;
 	private OrganizationIdentityService		organizationIdentityService;
 	@Resource
 	@Resource
 	private OrganizationTechService			organizationTechService;
 	private OrganizationTechService			organizationTechService;
+	@Resource
+	private UserContactService 				userContactService;
 	@Autowired
 	@Autowired
 	private EasemobUtils					easemobUtils;
 	private EasemobUtils					easemobUtils;
 
 
@@ -171,40 +179,7 @@ public class UserApiController extends BaseApiController {
 		return res;
 		return res;
 	}
 	}
 
 
-	/**
-	 * 个人会员基本信息
-	 * 
-	 * @param userIdentity
-	 * @param bindingResult
-	 * @return
-	 */
-	@RequestMapping(value = "/userIndentity", method = RequestMethod.POST)
-	public Result basicInfo(@Valid InputUserIdentity userIdentity, BindingResult bindingResult) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-		if (res.getError().isEmpty()) {
-			UserIdentity ui = new UserIdentity();
-			BeanUtils.copyProperties(userIdentity, ui);
-			UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
-			if (null == u && StringUtils.isBlank(ui.getId())) {
-				ui.setId(UUID.randomUUID().toString());
-				ui.setUid(TokenManager.getUserId());
-				userIdentityService.insert(ui);
-			} else {
-				if (StringUtils.isBlank(ui.getId())) {
-					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "认证信息ID"));
-					return res;
-				}
-				userIdentityService.updateByPrimaryKeySelective(ui);
-			}
-		}
-		res.setData(userIdentity);
-		return res;
-	}
+	
 
 
 	/**
 	/**
 	 * 公共
 	 * 公共
@@ -356,25 +331,6 @@ public class UserApiController extends BaseApiController {
 	}
 	}
 
 
 	/**
 	/**
-	 * 团体会员基本信息
-	 * 
-	 * @param orgIdentityBo
-	 * @return
-	 */
-	@RequestMapping(value = "/orgIdentity", method = RequestMethod.POST)
-	public Result groupBasicInfo(@Valid OrgIdentityBo orgIdentityBo, BindingResult bindingResult) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					OrganizationIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-		organizationIdentityService.save(orgIdentityBo);
-		res.setData(orgIdentityBo);
-		return res;
-	}
-
-	/**
 	 * 团体会员单位资料
 	 * 团体会员单位资料
 	 * 
 	 * 
 	 * @param orgInfo
 	 * @param orgInfo
@@ -431,8 +387,8 @@ public class UserApiController extends BaseApiController {
 	 * 
 	 * 
 	 * @return
 	 * @return
 	 */
 	 */
-	@RequestMapping(value = "/personalBase", method = RequestMethod.GET)
-	public Result personalBase() {
+	@RequestMapping(value = "/getUserDetail", method = RequestMethod.GET)
+	public Result getUserDetail() {
 		Result res = new Result();
 		Result res = new Result();
 		UserIdentityBo u = userIdentityService.selectUserIdentityBoByUserId(TokenManager.getUserId());
 		UserIdentityBo u = userIdentityService.selectUserIdentityBoByUserId(TokenManager.getUserId());
 		res.setData(u);
 		res.setData(u);
@@ -440,16 +396,109 @@ public class UserApiController extends BaseApiController {
 	}
 	}
 	
 	
 	/**
 	/**
-	 * 团体会员基本信息
+	 * 个人会员基本信息
+	 * 
+	 * @param userIdentity
+	 * @param bindingResult
 	 * @return
 	 * @return
 	 */
 	 */
-	@RequestMapping(value = "/organizationBase", method = RequestMethod.GET)
-	public Result organizationBase(){
+	@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
+	public Result updateUserDetail(@Valid InputUserIdentity userIdentity, BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		if (StringUtils.isBlank(userIdentity.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "认证信息ID"));
+			return res;
+		}
+		if(StringUtils.isBlank(userIdentity.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
+			return res;
+		}
+		if(userIdentity.getAuthentication() == UserAuthentication.PERSON_AUTHENTICATION.getCode()){
+			res.getError().add(buildError(null, "", "用户已经企业认证"));
+			return res;
+		}
+		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 {	
+				userIdentityService.updateByPrimaryKeySelective(ui);
+			}
+			userService.updateByPrimaryKeySelective(user);
+		}
+		res.setData(userIdentity);
+		return res;
+	}
+	
+	/**
+	 * 企业信息详情
+	 * @return
+	 */
+	@RequestMapping(value = "/getOrganizationDetail", method = RequestMethod.GET)
+	public Result getOrganizationDetail(){
 		Result res = new Result();
 		Result res = new Result();
 		OrgIdentityBo o = organizationIdentityService.selectOrgIdentityBoByUserId(TokenManager.getUserId());
 		OrgIdentityBo o = organizationIdentityService.selectOrgIdentityBoByUserId(TokenManager.getUserId());
 		res.setData(o);
 		res.setData(o);
 		return res;
 		return res;
 	}
 	}
+	
+	/**
+	 * 修改企业信息
+	 * 
+	 * @param userIdentity
+	 * @param bindingResult
+	 * @return
+	 */
+	@RequestMapping(value = "/updateOrganizationDetail", method = RequestMethod.POST)
+	public Result updateOrganizationDetail(@Valid InputOrganizationIdentity organizationIdentity, BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		if (StringUtils.isBlank(organizationIdentity.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "认证信息ID"));
+			return res;
+		}
+		if(StringUtils.isBlank(organizationIdentity.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
+			return res;
+		}
+		if(organizationIdentity.getAuthentication() == UserAuthentication.PERSON_AUTHENTICATION.getCode()){
+			res.getError().add(buildError(null, "", "用户已经个人认证"));
+			return res;
+		}
+		if (res.getError().isEmpty()) {
+			OrganizationIdentity oi = new OrganizationIdentity();
+			User user = new User();
+			BeanUtils.copyProperties(organizationIdentity, oi);
+			BeanUtils.copyProperties(organizationIdentity, user);
+			OrgIdentityBo u = organizationIdentityService.selectOrgIdentityBoByUserId(TokenManager.getUserId());
+			if (null == u) {
+				oi.setId(UUID.randomUUID().toString());
+				oi.setUid(TokenManager.getUserId());
+				organizationIdentityService.insert(oi);
+			} else {	
+				organizationIdentityService.updateByPrimaryKeySelective(oi);
+			}
+			userService.updateByPrimaryKeySelective(user);
+		}
+		res.setData(organizationIdentity);
+		return res;
+	}
+	
 	/**
 	/**
 	 * 个人资料/团体会员资料
 	 * 个人资料/团体会员资料
 	 */
 	 */
@@ -619,16 +668,6 @@ public class UserApiController extends BaseApiController {
 		return dealUserProcess(res, userIdentity, TokenManager.getUserId());
 		return dealUserProcess(res, userIdentity, TokenManager.getUserId());
 	}
 	}
 
 
-	
-	/**
-	 * 获取公司联系人
-	 */
-	@RequestMapping(value = "/getContacts", method = RequestMethod.GET)
-	public Result getContacts() {
-		Result res = new Result();
-		res.setData(organizationIdentityService.selectContactsByUserId(TokenManager.getUserId()));
-		return res;
-	}
 
 
 	// 认证失败清除相关认证信息
 	// 认证失败清除相关认证信息
 	private Result dealFaild(Result res) {
 	private Result dealFaild(Result res) {
@@ -676,4 +715,70 @@ public class UserApiController extends BaseApiController {
 		}
 		}
 		return res;
 		return res;
 	}
 	}
+	
+	/**
+	 * 新增客户联系人
+	 * @param bo
+	 * @return
+	 */
+	@RequestMapping(value = "/addUserContcat", method = RequestMethod.POST)
+	public Result addUserContcat(UserContactBo bo){
+		Result res = new Result();
+		if(StringUtils.isBlank(bo.getMobile())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "手机号码不能为空"));
+			return res;
+		}
+		if(userContactService.checkUserContact(TokenManager.getUserId(), bo.getMobile())){
+			res.getError().add(buildError(ErrorConstants.USER_CONTACT_ALREADY_EXIST,"联系人已存在"));
+		}
+		userContactService.insertSelective(bo);
+		return res;
+	}
+	
+	/**
+	 * 修改客户联系人
+	 * @param bo
+	 * @return
+	 */
+	@RequestMapping(value = "/udpateUserContact", method = RequestMethod.POST)
+	public Result udpateUserContact(UserContactBo bo){
+		Result res = new Result();
+		if(StringUtils.isBlank(bo.getMobile())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "手机号码不能为空"));
+			return res;
+		}
+		if(StringUtils.isBlank(bo.getId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "联系人ID"));
+			return res;
+		}
+		userContactService.updateByPrimaryKeySelective(bo);
+		return res;
+	}
+	
+	/**
+	 * 删除客户联系人
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteUserContact", method = RequestMethod.GET)
+	public Result deleteUserContact(String id){
+		Result res = new Result();
+		if(StringUtils.isBlank(id)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "联系人ID"));
+			return res;
+		}
+		userContactService.deleteUserContact(id);
+		return res;
+	}
+	
+	/**
+	 * 获取用户联系人
+	 * @return
+	 */
+	@RequestMapping(value = "/getUserContacts", method = RequestMethod.GET)
+	public Result getUserContacts(){
+		Result res = new Result();
+		res.setData(userContactService.selectContactByUid(TokenManager.getUserId()));
+		return res;
+	}
 }
 }

+ 0 - 5
src/main/java/com/goafanti/user/service/UserCareerService.java

@@ -9,9 +9,4 @@ public interface UserCareerService {
 	UserCareer insert(UserCareer userCareer);
 	UserCareer insert(UserCareer userCareer);
 
 
 	int updateByPrimaryKeySelective(UserCareer userCareer);
 	int updateByPrimaryKeySelective(UserCareer userCareer);
-
-	
-
-	
-
 }
 }

+ 18 - 0
src/main/java/com/goafanti/user/service/UserContactService.java

@@ -0,0 +1,18 @@
+package com.goafanti.user.service;
+
+import java.util.List;
+
+import com.goafanti.user.bo.UserContactBo;
+
+public interface UserContactService {
+	
+	List<UserContactBo> selectContactByUid(String uid);
+	
+	boolean checkUserContact(String uid,String mobile);
+	
+	int insertSelective(UserContactBo bo);
+	
+	int updateByPrimaryKeySelective(UserContactBo bo);
+
+	int deleteUserContact(String id);
+}

+ 57 - 0
src/main/java/com/goafanti/user/service/impl/UserContactServiceImpl.java

@@ -0,0 +1,57 @@
+package com.goafanti.user.service.impl;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.OrganizationContactBookMapper;
+import com.goafanti.common.model.OrganizationContactBook;
+import com.goafanti.user.bo.UserContactBo;
+import com.goafanti.user.service.UserContactService;
+
+@Service
+public class UserContactServiceImpl implements UserContactService {
+	
+	private OrganizationContactBookMapper organizationContactBookMapper;
+	
+	@Override
+	public List<UserContactBo> selectContactByUid(String uid) {
+		// TODO Auto-generated method stub
+		return organizationContactBookMapper.selectContactByUid(uid);
+	}
+
+	@Override
+	public boolean checkUserContact(String uid,String mobile) {
+		// TODO Auto-generated method stub
+		return organizationContactBookMapper.checkContacts(uid, mobile, null)>0;
+	}
+
+	@Override
+	public int insertSelective(UserContactBo bo) {
+		OrganizationContactBook book = new OrganizationContactBook();
+		if(bo != null){
+			BeanUtils.copyProperties(bo, book);
+			book.setId(UUID.randomUUID().toString());
+			return organizationContactBookMapper.insertSelective(book);
+		}
+		return 0;
+	}
+
+	@Override
+	public int updateByPrimaryKeySelective(UserContactBo bo) {
+		OrganizationContactBook book = new OrganizationContactBook();
+		if(bo != null){
+			BeanUtils.copyProperties(bo, book);
+			return organizationContactBookMapper.updateByPrimaryKeySelective(book);
+		}
+		return 0;
+	}
+
+	@Override
+	public int deleteUserContact(String id) {
+		return organizationContactBookMapper.deleteByPrimaryKey(id);
+	}
+	
+}

+ 3 - 1
src/main/resources/props/error.properties

@@ -127,4 +127,6 @@ PAY_BEYOND_SIGN = \u652F\u4ED8\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683C
 
 
 REFUND_BEYOND_SIGN = \u9000\u6B3E\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683C
 REFUND_BEYOND_SIGN = \u9000\u6B3E\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683C
 
 
-BILL_ALREADY_EXPIRE = \u8BE5\u6D41\u6C34\u5DF2\u8FC7\u671F
+BILL_ALREADY_EXPIRE = \u8BE5\u6D41\u6C34\u5DF2\u8FC7\u671F
+
+USER_CONTACT_ALREADY_EXIST = \u8054\u7CFB\u4EBA\u5DF2\u5B58\u5728