Selaa lähdekoodia

Merge branch 'test' of jishutao/jitao-server into prod

liliang4869 7 vuotta sitten
vanhempi
commit
35c0c6eea1
28 muutettua tiedostoa jossa 471 lisäystä ja 164 poistoa
  1. 18 0
      src/main/java/com/goafanti/achievement/bo/AchievementEntity.java
  2. 25 3
      src/main/java/com/goafanti/app/controller/AppUserController.java
  3. 1 1
      src/main/java/com/goafanti/app/controller/OpenAppHomeController.java
  4. 111 1
      src/main/java/com/goafanti/app/controller/OpenAppUserController.java
  5. 1 1
      src/main/java/com/goafanti/business/bo/JtBusinessCategoryBo.java
  6. 9 0
      src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java
  7. 1 1
      src/main/java/com/goafanti/business/service/JtTagService.java
  8. 2 1
      src/main/java/com/goafanti/business/service/impl/JtTagServiceImpl.java
  9. 1 1
      src/main/java/com/goafanti/common/controller/WebpageController.java
  10. 1 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  11. 2 1
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  12. 7 6
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  13. 3 1
      src/main/java/com/goafanti/common/mapper/JtBusinessCategoryMapper.xml
  14. 4 4
      src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml
  15. 1 1
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  16. 5 1
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  17. 2 1
      src/main/java/com/goafanti/common/utils/FileUtils.java
  18. 34 6
      src/main/java/com/goafanti/common/utils/InvitationCodeUtils.java
  19. 1 1
      src/main/java/com/goafanti/core/shiro/token/UserRealm.java
  20. 15 0
      src/main/java/com/goafanti/demand/bo/AppDemandBo.java
  21. 2 0
      src/main/java/com/goafanti/user/controller/UserApiController.java
  22. 65 9
      src/main/java/com/goafanti/user/controller/UserLoginController.java
  23. 5 6
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  24. 64 39
      src/main/webapp/WEB-INF/views/common.html
  25. 1 1
      src/main/webapp/WEB-INF/views/portal/facilitator.html
  26. 3 2
      src/main/webapp/WEB-INF/views/portal/invRegister.html
  27. 28 9
      src/main/webapp/WEB-INF/views/portal/invitation.html
  28. 59 66
      src/main/webapp/WEB-INF/views/user/signIn.html

+ 18 - 0
src/main/java/com/goafanti/achievement/bo/AchievementEntity.java

@@ -32,6 +32,8 @@ public class AchievementEntity {
     private Integer interest;//是否感兴趣
     private Integer interest;//是否感兴趣
     private Integer orderCount;//订单数
     private Integer orderCount;//订单数
 	private String pictureUrlMin;//APP图片
 	private String pictureUrlMin;//APP图片
+	private String  ownerName;//所有人名称
+	private String ownerMobile;//所有人电话
 
 
     public String getField2() {
     public String getField2() {
 		return field2;
 		return field2;
@@ -256,4 +258,20 @@ public class AchievementEntity {
 	public void setPictureUrlMin(String pictureUrlMin) {
 	public void setPictureUrlMin(String pictureUrlMin) {
 		this.pictureUrlMin = pictureUrlMin;
 		this.pictureUrlMin = pictureUrlMin;
 	}
 	}
+
+	public String getOwnerName() {
+		return ownerName;
+	}
+
+	public void setOwnerName(String ownerName) {
+		this.ownerName = ownerName;
+	}
+
+	public String getOwnerMobile() {
+		return ownerMobile;
+	}
+
+	public void setOwnerMobile(String ownerMobile) {
+		this.ownerMobile = ownerMobile;
+	}
 }
 }

+ 25 - 3
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -5,6 +5,9 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.UUID;
 import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import javax.validation.Valid;
@@ -113,9 +116,19 @@ public class AppUserController extends CertifyApiController {
 	@RequestMapping(value = "/updateUser",method = RequestMethod.POST)
 	@RequestMapping(value = "/updateUser",method = RequestMethod.POST)
 	public Result updateUser(User u){
 	public Result updateUser(User u){
 		Result res = new Result();
 		Result res = new Result();
-		if(StringUtils.isBlank(u.getNickname())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"用户昵称不能为空"));
-			return res;
+		if(u!=null&&StringUtils.isNotEmpty(u.getMobile())){
+			//验证手机号码格式是否正确
+			Pattern p = Pattern.compile("^(1[1-9][0-9])\\d{8}$"); // 验证手机号           
+			Matcher m = p.matcher(u.getMobile());   
+			if(!m.matches()){
+				res.getError().add(buildError("电话号码格式不对","电话号码格式不对"));
+			}else{
+				//验证手机是否存在
+				int i = userService.getCountByMobile(u.getId(),u.getMobile(),u.getType());
+				if(i>0){
+					res.getError().add(buildError("电话号码重复","电话号码重复"));
+				}
+			}
 		}
 		}
 		u.setId(TokenManager.getUserId());
 		u.setId(TokenManager.getUserId());
 		userServiceImpl.updateByPrimaryKeySelective(u);
 		userServiceImpl.updateByPrimaryKeySelective(u);
@@ -862,4 +875,13 @@ public class AppUserController extends CertifyApiController {
 		result.setData(messageService.updateAppReadMessage(id));
 		result.setData(messageService.updateAppReadMessage(id));
 		return result;
 		return result;
 	}
 	}
+	
+	/** 图片上传 **/
+	@RequestMapping(value = "/uploadHeadPortrait", method = RequestMethod.POST)
+	public Result uploadCustomerImg(HttpServletRequest req,String sign){
+		Result res = new Result();
+		res.setData(handleFile(res, "/customer_head_portrait/", false, req, sign));
+		return res;
+	}
+	
 }
 }

+ 1 - 1
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -206,7 +206,7 @@ public class OpenAppHomeController extends BaseApiController{
 	@RequestMapping(value = "/getApplicationData" , method = RequestMethod.GET)
 	@RequestMapping(value = "/getApplicationData" , method = RequestMethod.GET)
 	public Result getApplicationData() {
 	public Result getApplicationData() {
 		Result result=new Result();
 		Result result=new Result();
-		Map<String, Object> map=jtTagService.getApplicationData(3,1,3,3,3,1,2);
+		Map<String, Object> map=jtTagService.getApplicationData(3,1,3,3,3,1,2,2);
 		map.put("technologyProject", jtBusinessService.getCategoryByModule(5,2,6));
 		map.put("technologyProject", jtBusinessService.getCategoryByModule(5,2,6));
 		result.setData(map);
 		result.setData(map);
 		return result;
 		return result;

+ 111 - 1
src/main/java/com/goafanti/app/controller/OpenAppUserController.java

@@ -1,9 +1,16 @@
 package com.goafanti.app.controller;
 package com.goafanti.app.controller;
 
 
+import java.util.Calendar;
+import java.util.UUID;
+
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import javax.validation.Valid;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 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.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementInterestService;
@@ -13,12 +20,22 @@ import com.goafanti.banners.service.BannersService;
 import com.goafanti.comment.bo.CommentResult;
 import com.goafanti.comment.bo.CommentResult;
 import com.goafanti.comment.service.CommentService;
 import com.goafanti.comment.service.CommentService;
 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.UserAuthentication;
+import com.goafanti.common.enums.UserFields;
+import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.PasswordUtil;
+import com.goafanti.common.utils.TimeUtils;
+import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.news.service.NewsService;
 import com.goafanti.news.service.NewsService;
+import com.goafanti.user.bo.InputUser;
 import com.goafanti.user.service.UserCareerService;
 import com.goafanti.user.service.UserCareerService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserInterestService;
 import com.goafanti.user.service.UserInterestService;
@@ -50,7 +67,11 @@ public class OpenAppUserController extends BaseApiController {
 	@Resource
 	@Resource
 	private UserIdentityService	userIdentityService;
 	private UserIdentityService	userIdentityService;
 	@Resource
 	@Resource
-	AchievementInterestService achievementInterestService;
+	private AchievementInterestService achievementInterestService;
+	@Resource
+	private UserService	userService;
+	@Resource(name = "passwordUtil")
+	private PasswordUtil	passwordUtil;
 	
 	
 	/**
 	/**
 	 * 成果详情
 	 * 成果详情
@@ -122,4 +143,93 @@ public class OpenAppUserController extends BaseApiController {
 		res.setData(messageService.selectMessageWithGroup());
 		res.setData(messageService.selectMessageWithGroup());
 		return res;
 		return res;
 	}
 	}
+	
+	/**
+	 * APP用户注册检查
+	 * 
+	 * @param user
+	 * @return
+	 */
+	@RequestMapping(value = "/registerCheck", method = RequestMethod.GET)
+	@ResponseBody
+	public Result registerCheck(@Valid InputUser user, String mobileCode,String uuid,BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		
+		if (StringUtils.isBlank(user.getMobile())) {
+			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
+			return res;
+		}
+		User u = userService.selectByMobieAndType(user.getMobile().trim(),null);
+		if (null != u) {
+			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
+		}
+		if (TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME) ==null||!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode.toLowerCase())) {
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码错误"));
+			return res;
+		}
+		// 验证码15分钟有效
+		if (TimeUtils.checkOverTime("register")) {
+			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "手机验证码超时失效"));
+			return res;
+		}
+		
+		return res.data(1);
+	}
+	/**
+	 * APP用户注册
+	 * 
+	 * @param user
+	 * @return
+	 */
+	@RequestMapping(value = "/appRegister", method = RequestMethod.POST)
+	@ResponseBody
+	public Result AppRegister(@Valid InputUser user, String mobileCode,String uuid,BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		if (StringUtils.isBlank(user.getUnitName())) {
+			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户名不能为空"));
+			return res;
+		}
+		if (StringUtils.isBlank(user.getMobile())) {
+			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
+			return res;
+		}
+		if (user.getBeInviteCode()!=null&&!user.getBeInviteCode().equals("")&&userService.checkeToInviteCode(user.getBeInviteCode())) {
+			res.getError().add(buildError("邀请码不存在", "邀请码不存在"));
+			return res;
+		}
+		if (res.getError().isEmpty()) {
+			User us = new User();
+			us.setId(UUID.randomUUID().toString());
+			us.setMobile(user.getMobile().trim());
+			us.setPassword(user.getPassword());
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			us.setCreateTime(now.getTime());
+			us.setUpdateTime(now.getTime());
+			us.setPassword(passwordUtil.getEncryptPwd(us));
+			us.setNickname(user.getUnitName());
+			us.setBeInviteCode(user.getBeInviteCode());
+			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
+			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
+			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
+			us.setIdentifyName(StringUtils.isBlank(user.getUnitName())?"":user.getUnitName());
+			us.setLvl(UserLevel.GENERAL.getCode());
+			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
+			us.setTransferTime(now.getTime());
+			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			//获得抵用券
+			userService.saveVoucher(us);
+		}
+		return res;
+	}
 }
 }

+ 1 - 1
src/main/java/com/goafanti/business/bo/JtBusinessCategoryBo.java

@@ -8,8 +8,8 @@ public class JtBusinessCategoryBo {
 String topLevel;
 String topLevel;
 String topLevelId;
 String topLevelId;
 String summary;
 String summary;
-List<JtBusinessCategory>children;
 String topImg;
 String topImg;
+List<JtBusinessCategory>children;
 
 
 public String getTopImg() {
 public String getTopImg() {
 	return topImg;
 	return topImg;

+ 9 - 0
src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java

@@ -11,6 +11,7 @@ public class JtBusinessProjectResult extends JtBusinessProject {
 	private List<JtTag> tags;
 	private List<JtTag> tags;
 	
 	
 	private String  ownerName;
 	private String  ownerName;
+	private String ownerMobile;
 	private String interestCount;
 	private String interestCount;
 	private String createTimeFormat;
 	private String createTimeFormat;
 	private  CommentDetailResult	CommentDetailResult;
 	private  CommentDetailResult	CommentDetailResult;
@@ -116,4 +117,12 @@ public void setCompanyId(String companyId) {
 	public void setInterested(Integer interested) {
 	public void setInterested(Integer interested) {
 		this.interested = interested;
 		this.interested = interested;
 	}
 	}
+
+	public String getOwnerMobile() {
+		return ownerMobile;
+	}
+
+	public void setOwnerMobile(String ownerMobile) {
+		this.ownerMobile = ownerMobile;
+	}
 }
 }

+ 1 - 1
src/main/java/com/goafanti/business/service/JtTagService.java

@@ -18,7 +18,7 @@ public interface JtTagService {
 
 
 	Pagination<JtTagBo> selectListJtTag(JtTag a, Integer pageNo, Integer pageSize);
 	Pagination<JtTagBo> selectListJtTag(JtTag a, Integer pageNo, Integer pageSize);
 	
 	
-	Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 );
+	Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ,Integer size8 );
 
 
 	
 	
 
 

+ 2 - 1
src/main/java/com/goafanti/business/service/impl/JtTagServiceImpl.java

@@ -52,7 +52,7 @@ public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements J
 	}
 	}
 
 
 	@Override
 	@Override
-	public Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ) {
+	public Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ,Integer size8) {
 		Map<String, Object> map=new HashMap<>();
 		Map<String, Object> map=new HashMap<>();
 		map.put("military", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
 		map.put("military", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
 		map.put("government", jtBusinessProjectMapper.getProjectByTag("政府市场采购", size2));
 		map.put("government", jtBusinessProjectMapper.getProjectByTag("政府市场采购", size2));
@@ -61,6 +61,7 @@ public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements J
 		map.put("financingLease", jtBusinessProjectMapper.getProjectByTag("融资租售", size5));
 		map.put("financingLease", jtBusinessProjectMapper.getProjectByTag("融资租售", size5));
 		map.put("defenseWeapon", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
 		map.put("defenseWeapon", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
 		map.put("ownUse", jtBusinessProjectMapper.getProjectByTag("他山己用", size7));
 		map.put("ownUse", jtBusinessProjectMapper.getProjectByTag("他山己用", size7));
+		map.put("brandBuilding", jtBusinessProjectMapper.getProjectByTag("品牌建设",size8));
 		return map;
 		return map;
 	}
 	}
 }
 }

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

@@ -838,7 +838,7 @@ public class WebpageController extends BaseController {
 		
 		
 		modelview.addObject("projects", jtBusinessProjects);
 		modelview.addObject("projects", jtBusinessProjects);
 		List<PolicyResult> policies = (List<PolicyResult>) policyService
 		List<PolicyResult> policies = (List<PolicyResult>) policyService
-				.searchPolicy("", 2, null, null, "web_index", 1, 3, null).getList();
+				.searchPolicy("", 2, null, null, "web_index", 1, 99, null).getList();
 		for (PolicyResult p : policies) {
 		for (PolicyResult p : policies) {
 			if (null != p.getTitleImg() && p.getTitleImg().contains(",")) {
 			if (null != p.getTitleImg() && p.getTitleImg().contains(",")) {
 				p.setTitleImg(p.getTitleImg().substring(0, p.getTitleImg().indexOf(",")));
 				p.setTitleImg(p.getTitleImg().substring(0, p.getTitleImg().indexOf(",")));

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

@@ -91,7 +91,7 @@ public interface UserMapper {
 
 
 	Long selectNumberByPrimaryKey(String userId);
 	Long selectNumberByPrimaryKey(String userId);
 	
 	
-	User selectByMobieAndType(String mobile, Integer type);
+	User selectByMobieAndType(@Param("mobile")String mobile, @Param("type")Integer type);
 
 
 	List<OrganizationContactBook> findAllContacts(String uid);
 	List<OrganizationContactBook> findAllContacts(String uid);
 
 

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

@@ -1429,8 +1429,9 @@ where
   	<select id="selectAppAchuevementDetail" resultType="com.goafanti.achievement.bo.AchievementEntity">
   	<select id="selectAppAchuevementDetail" resultType="com.goafanti.achievement.bo.AchievementEntity">
   	select a.id,a.name,a.keyword,a.data_category as dataCategory,a.category,a.summary,a.introduction,a.transfer_mode as transferMode,a.status,a.transfer_price as transferPrice ,a.innovation,a.maturity,a.audit_status,a.technical_picture_url as technicalPictureUrl,
   	select a.id,a.name,a.keyword,a.data_category as dataCategory,a.category,a.summary,a.introduction,a.transfer_mode as transferMode,a.status,a.transfer_price as transferPrice ,a.innovation,a.maturity,a.audit_status,a.technical_picture_url as technicalPictureUrl,
   a.field_a as fieldA,a.field_b as fieldB,a.field_c as fieldC,f.name as field1,f2.name as field2,f3.name as field3,a.release_status as releaseStatus,a.audit_status as auditStatus,a.boutique,a.field_a as fieldA,a.is_hot as isHot,a.release_date as releaseDate,if(isnull(b.count),0,b.count) as interestCount,
   a.field_a as fieldA,a.field_b as fieldB,a.field_c as fieldC,f.name as field1,f2.name as field2,f3.name as field3,a.release_status as releaseStatus,a.audit_status as auditStatus,a.boutique,a.field_a as fieldA,a.is_hot as isHot,a.release_date as releaseDate,if(isnull(b.count),0,b.count) as interestCount,
-  if(isnull(d.achievement_id),0,1) interest,ifnull(t.count,0) as orderCount,a.picture_url_min as pictureUrlMin
+  if(isnull(d.achievement_id),0,1) interest,ifnull(t.count,0) as orderCount,a.picture_url_min as pictureUrlMin,us.nickname as ownerName,us.mobile as ownerMobile
    from achievement a left join industry_category f on a.field_a=f.id
    from achievement a left join industry_category f on a.field_a=f.id
+  left join `user` us on a.owner_id=us.id
   left join industry_category f2 on a.field_b=f2.id
   left join industry_category f2 on a.field_b=f2.id
   left join industry_category f3 on a.field_c=f3.id
   left join industry_category f3 on a.field_c=f3.id
   left join (select b.commodity_id as id,count(*) as count from jt_order a left join jt_order_detail b on a.order_no=b.order_no
   left join (select b.commodity_id as id,count(*) as count from jt_order a left join jt_order_detail b on a.order_no=b.order_no

+ 7 - 6
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -61,14 +61,15 @@
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </select>
   </select>
   <select id="selectAppByPrimaryKey" resultType="com.goafanti.demand.bo.AppDemandBo" parameterType="java.lang.String" >
   <select id="selectAppByPrimaryKey" resultType="com.goafanti.demand.bo.AppDemandBo" parameterType="java.lang.String" >
-    select 
+       select 
     d.id, d.serial_number AS serialNumber, d.data_category AS dataCategory, d.name, d.keyword,d.budget_cost as budgetCost,
     d.id, d.serial_number AS serialNumber, d.data_category AS dataCategory, d.name, d.keyword,d.budget_cost as budgetCost,
-    d.info_sources AS infoSources, d.industry_category_a AS fieldA,d.industry_category_b AS fieldB,
-    f.name as field1,f2.name as field2,d.is_hot as isHot,d.release_date as releaseDate,d.demand_type as demandType,
-    d.name,d.problem_des as problemDes,d.picture_url as pictureUrl,d.release_status as releaseStatus,
-    d.audit_status as auditStatus,d.fixed_budget as fixedBudget,d.crowd_cost as crowdCost,
-    ifnull(i.y,0) as interestCount,if(isnull(a.demand_id),0,1) as interest,ifnull(t.count,0) as orderCount,d.picture_url_min as pictureUrlMin
+    d.info_sources AS infoSources, d.industry_category_a AS fieldA,d.industry_category_b AS fieldB,f.name as field1,
+    f2.name as field2,d.is_hot as isHot,d.release_date as releaseDate,d.demand_type as demandType,d.name,
+    d.problem_des as problemDes,d.picture_url as pictureUrl,d.release_status as releaseStatus,d.audit_status as auditStatus,
+    d.fixed_budget as fixedBudget,d.crowd_cost as crowdCost,ifnull(i.y,0) as interestCount,if(isnull(a.demand_id),0,1) as interest,ifnull(t.count,0) as orderCount,
+    d.picture_url_min as pictureUrlMin,us.nickname as ownerName,us.mobile as ownerMobile
     from demand d
     from demand d
+    left join `user` us on d.employer_id=us.id
     left join (select b.commodity_id as id,count(*) as count from jt_order a left join jt_order_detail b on a.order_no=b.order_no
     left join (select b.commodity_id as id,count(*) as count from jt_order a left join jt_order_detail b on a.order_no=b.order_no
 	GROUP by b.commodity_id) t on d.id=t.id
 	GROUP by b.commodity_id) t on d.id=t.id
 	left join (select count(0) as y,demand_id from demand_interest
 	left join (select count(0) as y,demand_id from demand_interest

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

@@ -453,10 +453,11 @@ where
 	and jt2.id = #{0}
 	and jt2.id = #{0}
  </select>
  </select>
  <select id="getCategoryBySuperId" resultType="com.goafanti.common.model.JtBusinessCategory">
  <select id="getCategoryBySuperId" resultType="com.goafanti.common.model.JtBusinessCategory">
-  select
+    select
 	id,
 	id,
 	name,
 	name,
 	super_id as superId,
 	super_id as superId,
+	img_url as imgUrl,
 	sort,module
 	sort,module
 from
 from
 	jt_business_category
 	jt_business_category
@@ -467,6 +468,7 @@ where
   <resultMap id="JtBusinessCategoryBoResult" type="com.goafanti.business.bo.JtBusinessCategoryBo">  
   <resultMap id="JtBusinessCategoryBoResult" type="com.goafanti.business.bo.JtBusinessCategoryBo">  
         <id column="name" property="topLevel" />  
         <id column="name" property="topLevel" />  
         <id column="topLevelId" property="topLevelId" />
         <id column="topLevelId" property="topLevelId" />
+        <id column="topImg" property="topImg" />
         <id column="summary" property="summary"/>
         <id column="summary" property="summary"/>
         <collection column="topLevelId" ofType="com.goafanti.common.model.JtBusinessCategory" property="children" select="getCategoryBySuperId">
         <collection column="topLevelId" ofType="com.goafanti.common.model.JtBusinessCategory" property="children" select="getCategoryBySuperId">
         </collection>  
         </collection>  

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

@@ -597,12 +597,12 @@
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
   <select id="selectByPrimaryKeyWithModule" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
   <select id="selectByPrimaryKeyWithModule" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
-    select 
-        jtbp.id, jtbp.name, jtbp.category_id as categoryId, jtbp.number, jtbp.price, jtbp.activity_price as activityPrice, jtbp.member_price as memberPrice, jtbp.offset, 
-        jtbp.activity_flag as activityFlag, u.nickname as ownerName,ifnull(p.count,0) as interestCount,if(isnull(x.project_id),0,1) as interested,jtbp.keyword,jtbp.summary,
+	select 
+    jtbp.id, jtbp.name, jtbp.category_id as categoryId, jtbp.number, jtbp.price, jtbp.activity_price as activityPrice, jtbp.member_price as memberPrice, jtbp.offset, 
+    jtbp.activity_flag as activityFlag,ifnull(p.count,0) as interestCount,if(isnull(x.project_id),0,1) as interested,jtbp.keyword,jtbp.summary,
     jtbp.introduce, jtbp.province, jtbp.city, jtbp.create_time as createTime, jtbp.min_img_url as minImgUrl, jtbp.max_img_url as maxImgUrl, jtbp.value, jtbp.apply_conditions as applyConditions, 
     jtbp.introduce, jtbp.province, jtbp.city, jtbp.create_time as createTime, jtbp.min_img_url as minImgUrl, jtbp.max_img_url as maxImgUrl, jtbp.value, jtbp.apply_conditions as applyConditions, 
     jtbp.owner_id as ownerId, jtbp.is_hot as isHot, jtbp.audit_status as auditStatus, jtbp.audit_info as auditInfo, jtbp.release_date as releaseDate,jtbc.module as module,jtbp.advertisement
     jtbp.owner_id as ownerId, jtbp.is_hot as isHot, jtbp.audit_status as auditStatus, jtbp.audit_info as auditInfo, jtbp.release_date as releaseDate,jtbc.module as module,jtbp.advertisement
-    ,u.`type` as type
+    ,u.`type` as type,u.mobile as ownerMobile, u.nickname as ownerName
     from jt_business_project jtbp left join `user` u on jtbp.owner_id=u.id
     from jt_business_project jtbp left join `user` u on jtbp.owner_id=u.id
     left join jt_business_category jtbc on jtbc.id =  jtbp.category_id
     left join jt_business_category jtbc on jtbc.id =  jtbp.category_id
     left join (select project_id,count(*) as count from project_interest group by project_id) p on jtbp.id=p.project_id
     left join (select project_id,count(*) as count from project_interest group by project_id) p on jtbp.id=p.project_id

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

@@ -1347,7 +1347,7 @@ select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitU
 		b.industry,b.work_unit as workUnit,b.professional_title as professionalTitle,a.introduction,
 		b.industry,b.work_unit as workUnit,b.professional_title as professionalTitle,a.introduction,
 		ifnull(c.count,0) as countInterest,b.expert,ifnull(x.a,0) as favorable,ifnull(x.b,0) as general,
 		ifnull(c.count,0) as countInterest,b.expert,ifnull(x.a,0) as favorable,ifnull(x.b,0) as general,
 		ifnull(x.c,0) as inferior,ifnull(x.d,0) as commentCount,ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate,
 		ifnull(x.c,0) as inferior,ifnull(x.d,0) as commentCount,ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate,
-		if(isnull(d.to_uid),0,1) as interested, b.typical_case as typicalCase, b.good_at_industry as goodAtIndustry
+		if(isnull(d.to_uid),0,1) as interested, b.typical_case as typicalCase, b.good_at_industry as goodAtIndustry,a.mobile
 		from `user` a left join user_identity b on a.id=b.uid left join (select a.commodity_id as uid,
 		from `user` a left join user_identity b on a.id=b.uid left join (select a.commodity_id as uid,
 			sum(case when a.star &gt; 3 then 1 else 0 end) as a,
 			sum(case when a.star &gt; 3 then 1 else 0 end) as a,
 			sum(case when a.star=3 then 1 else 0 end) as b,
 			sum(case when a.star=3 then 1 else 0 end) as b,

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

@@ -709,7 +709,11 @@
     select
     select
   <include refid="Base_Column_List" />
   <include refid="Base_Column_List" />
     from user
     from user
-    where mobile = #{0} and type=#{1} and source = 0
+    where mobile = #{mobile} 
+    <if test="type != null">
+    and type=#{type} 
+    </if>
+    and source = 0
   </select>
   </select>
   
   
   <select id="selectByNameAndType" resultMap="BaseResultMap">
   <select id="selectByNameAndType" resultMap="BaseResultMap">

+ 2 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -97,7 +97,8 @@ public class FileUtils {
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		boolean uniq = false;
 		boolean uniq = false;
 		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1
 		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1
-				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1|| sign.indexOf("banners")!=-1) {
+				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1
+				|| sign.indexOf("banners")!=-1|| sign.indexOf("head_portrait")!=-1) {
 			uniq = true;
 			uniq = true;
 		}
 		}
 		String fileName = "";
 		String fileName = "";

+ 34 - 6
src/main/java/com/goafanti/common/utils/InvitationCodeUtils.java

@@ -24,7 +24,6 @@ public class InvitationCodeUtils {
     public static String toSerialCode(long id) {
     public static String toSerialCode(long id) {
         char[] buf=new char[32];
         char[] buf=new char[32];
         int charPos=32;
         int charPos=32;
-        System.out.println(id);
         while((id / binLen) > 0) {
         while((id / binLen) > 0) {
             int ind=(int)(id % binLen);
             int ind=(int)(id % binLen);
             buf[--charPos]=r[ind];
             buf[--charPos]=r[ind];
@@ -40,17 +39,46 @@ public class InvitationCodeUtils {
             Random rnd=new Random();
             Random rnd=new Random();
             for(int i=1; i <= s - str.length(); i++) {
             for(int i=1; i <= s - str.length(); i++) {
             sb.append(r[rnd.nextInt(binLen)]);
             sb.append(r[rnd.nextInt(binLen)]);
-            System.out.println(rnd.nextInt(binLen));
             }
             }
             str+=sb.toString();
             str+=sb.toString();
         }
         }
         return str;
         return str;
     }
     }
- /*
-  public static void main(String[] args) {
-	  for (int i = 0; i < 100; i++) {
+    /**
+     * 根据ID生成随机码
+     * @param id ID
+     * @return 随机码
+     */
+    public static String randomCode(long id,Integer size) {
+        char[] buf=new char[32];
+        int charPos=32;
+        while((id / binLen) > 0) {
+            int ind=(int)(id % binLen);
+            buf[--charPos]=r[ind];
+            id /= binLen;
+            
+        }
+        buf[--charPos]=r[(int)(id % binLen)];
+        String str=new String(buf, charPos, (32 - charPos));
+        // 不够长度的自动随机补全
+        if(str.length() < size) {
+            StringBuilder sb=new StringBuilder();
+            Random rnd=new Random();
+            for(int i=1; i <= size - str.length(); i++) {
+            sb.append(r[rnd.nextInt(binLen)]);
+            }
+            str+=sb.toString();
+        }else if(str.length() > size){
+        	System.out.println(str.length()-size);
+        	System.out.println(str.length());
+			str=str.substring(str.length()-size,str.length());
+		}
+        return str;
+    }
+ 
+  /*public static void main(String[] args) {
+		  System.out.println(randomCode(new Date().getTime(),6));
 		  System.out.println(toSerialCode(new Date().getTime()));
 		  System.out.println(toSerialCode(new Date().getTime()));
-	}
 }*/
 }*/
 
 
 	
 	

+ 1 - 1
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -60,7 +60,7 @@ public class UserRealm extends AuthorizingRealm {
 			return new SimpleAuthenticationInfo(aftUser, aftUser.getPassword(), passwordUtil.getAftSalt(aftUser),
 			return new SimpleAuthenticationInfo(aftUser, aftUser.getPassword(), passwordUtil.getAftSalt(aftUser),
 					getName());
 					getName());
 		} else {
 		} else {
-			User user = userService.selectByMobieAndType(token.getUsername().trim(), token.getType());
+			User user = userService.selectByMobieAndType(token.getUsername().trim(), null);
 			if (null == user) {
 			if (null == user) {
 				throw new UnknownAccountException();
 				throw new UnknownAccountException();
 			}
 			}

+ 15 - 0
src/main/java/com/goafanti/demand/bo/AppDemandBo.java

@@ -30,6 +30,9 @@ public class AppDemandBo {
 	    private BigDecimal budgetCost;
 	    private BigDecimal budgetCost;
 	    private Date createTime;
 	    private Date createTime;
 	    private String pictureUrlMin;
 	    private String pictureUrlMin;
+		private String  ownerName;//所有人名称
+		private String ownerMobile;//所有人电话
+
 		public int getFieldA() {
 		public int getFieldA() {
 			return fieldA;
 			return fieldA;
 		}
 		}
@@ -176,4 +179,16 @@ public class AppDemandBo {
 		public void setPictureUrlMin(String pictureUrlMin) {
 		public void setPictureUrlMin(String pictureUrlMin) {
 			this.pictureUrlMin = pictureUrlMin;
 			this.pictureUrlMin = pictureUrlMin;
 		}
 		}
+		public String getOwnerName() {
+			return ownerName;
+		}
+		public void setOwnerName(String ownerName) {
+			this.ownerName = ownerName;
+		}
+		public String getOwnerMobile() {
+			return ownerMobile;
+		}
+		public void setOwnerMobile(String ownerMobile) {
+			this.ownerMobile = ownerMobile;
+		}
 }
 }

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

@@ -721,6 +721,7 @@ public class UserApiController extends BaseApiController {
 		}
 		}
 		if(StringUtils.isNotBlank(email))user.setEmail(email);
 		if(StringUtils.isNotBlank(email))user.setEmail(email);
 		user.setNickname(nickname);
 		user.setNickname(nickname);
+		if(type !=null)user.setType(type);
 		if(res.getError().size()>0){
 		if(res.getError().size()>0){
 			return res;
 			return res;
 		}
 		}
@@ -728,6 +729,7 @@ public class UserApiController extends BaseApiController {
 		return res;
 		return res;
 	}
 	}
 	
 	
+	
 	/**
 	/**
 	 * 登陆后返回用户基本信息
 	 * 登陆后返回用户基本信息
 	 * 
 	 * 

+ 65 - 9
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -1,16 +1,15 @@
 package com.goafanti.user.controller;
 package com.goafanti.user.controller;
 
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.UnknownAccountException;
 import org.apache.shiro.web.util.SavedRequest;
 import org.apache.shiro.web.util.SavedRequest;
 import org.apache.shiro.web.util.WebUtils;
 import org.apache.shiro.web.util.WebUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -21,19 +20,16 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.goafanti.app.bo.UserBasicInfo;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.MessageConsumer;
-import com.goafanti.common.model.MessageProducer;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.User;
+import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.message.bo.MessageBo;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.user.service.UserService;
 import com.goafanti.user.service.UserService;
 
 
@@ -46,6 +42,9 @@ public class UserLoginController extends BaseController {
 	@Resource
 	@Resource
 	private MessageService messageService;
 	private MessageService messageService;
 	
 	
+	@Resource(name = "passwordUtil")
+	private PasswordUtil	passwordUtil;
+	
 	
 	
 	@RequestMapping(value = "/login", method = RequestMethod.GET)
 	@RequestMapping(value = "/login", method = RequestMethod.GET)
 	@ResponseBody
 	@ResponseBody
@@ -74,9 +73,66 @@ public class UserLoginController extends BaseController {
 			jo.put("queryString", sr.getQueryString());
 			jo.put("queryString", sr.getQueryString());
 		}
 		}
 		res.setToken(SecurityUtils.getSubject().getSession().getId());
 		res.setToken(SecurityUtils.getSubject().getSession().getId());
+		Map<String, Object> map =new HashMap<>();
+		map.put("uid",TokenManager.getUserId());
+		map.put("type",TokenManager.getUserType());
+		res.data(map);
 		return res;
 		return res;
 	}
 	}
+	/**
+	 * 登录检查
+	 * 
+	 * @param remember
+	 * @return
+	 */
+	@RequestMapping(value = "/open/loginCheck", method = RequestMethod.GET)
+	@ResponseBody
+	public Result loginCheck(String mobile,String password) {
+		Result res = new Result();
+		if (StringUtils.isBlank(mobile)||StringUtils.isBlank(password)) {
+			res.getError().add(buildError("","手机号码不能为空"));
+			return res;
+		}
+		User user=userService.selectByMobieAndType(mobile,null);
+		if(user==null){
+			res.getError().add(buildError("","手机号码不存在"));
+			return res;
+		}
+		
+		String pwd=user.getPassword();
+		user.setPassword(password);
+		if (!pwd.equals(passwordUtil.getEncryptPwd(user))) {
+			res.getError().add(buildError("","手机密码错误"));
+			return res;
+		}
+		if (user!=null) {
+			res.data(user);
+		}
+		return res;
+	}
+	
 
 
+	@RequestMapping(value = "/open/updateUser",method = RequestMethod.POST)
+	@ResponseBody
+	public Result updateUser(User u){
+		Result res = new Result();
+		if(u!=null&&StringUtils.isNotEmpty(u.getMobile())){
+			//验证手机号码格式是否正确
+			Pattern p = Pattern.compile("^(1[1-9][0-9])\\d{8}$"); // 验证手机号           
+			Matcher m = p.matcher(u.getMobile());   
+			if(!m.matches()){
+				res.getError().add(buildError("电话号码格式不对","电话号码格式不对"));
+			}else{
+				//验证手机是否存在
+				int i = userService.getCountByMobile(u.getId(),u.getMobile(),u.getType());
+				if(i>0){
+					res.getError().add(buildError("电话号码重复","电话号码重复"));
+				}
+			}
+		}
+		res.data(userService.updateByPrimaryKeySelective(u));
+		return res;
+	}
 
 
 	/**
 	/**
 	 * 用户登录
 	 * 用户登录

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

@@ -25,6 +25,7 @@ import com.goafanti.common.enums.UserLevel;
 import com.goafanti.common.enums.VoucherSourceType;
 import com.goafanti.common.enums.VoucherSourceType;
 import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.User;
+import com.goafanti.common.utils.InvitationCodeUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
@@ -80,7 +81,7 @@ public class UserRegisterController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
 			return res;
 			return res;
 		}
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
+		User u = userService.selectByMobieAndType(user.getMobile().trim(),null);
 		if (null != u) {
 		if (null != u) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 			return res;
 			return res;
@@ -110,7 +111,6 @@ public class UserRegisterController extends BaseController {
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setNickname(user.getUnitName());
 			us.setNickname(user.getUnitName());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
-			us.setType(user.getType());
 			us.setBeInviteCode(user.getBeInviteCode());
 			us.setBeInviteCode(user.getBeInviteCode());
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
@@ -142,14 +142,13 @@ public class UserRegisterController extends BaseController {
 			return res;
 			return res;
 		}
 		}
 		if (StringUtils.isBlank(user.getUnitName())) {
 		if (StringUtils.isBlank(user.getUnitName())) {
-			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户名不能为空"));
-			return res;
+			user.setUnitName("jt_"+InvitationCodeUtils.randomCode(new Date().getTime(),6));
 		}
 		}
 		if (StringUtils.isBlank(user.getMobile())) {
 		if (StringUtils.isBlank(user.getMobile())) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
 			return res;
 			return res;
 		}
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
+		User u = userService.selectByMobieAndType(user.getMobile().trim(),null);
 		if (null != u) {
 		if (null != u) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 		}
 		}
@@ -177,7 +176,7 @@ public class UserRegisterController extends BaseController {
 			us.setUpdateTime(now.getTime());
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setNickname(user.getUnitName());
 			us.setNickname(user.getUnitName());
-			us.setType(user.getType());
+			if(user.getType() !=null)us.setType(user.getType());
 			us.setBeInviteCode(user.getBeInviteCode());
 			us.setBeInviteCode(user.getBeInviteCode());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);

+ 64 - 39
src/main/webapp/WEB-INF/views/common.html

@@ -397,45 +397,48 @@
 		<div class="login">
 		<div class="login">
 			<div class="login_mian">
 			<div class="login_mian">
 				<div class="login_left">
 				<div class="login_left">
-					<div class="login_ewm">
-						<img th:src="${portalHost+'/img/Android.jpg'}" alt="二维码" />
-						<p>Android版</p>
-						<p>客户端</p>
-					</div>
-					<div class="login_ewm">
-						<img th:src="${portalHost+'/img/iPhone.jpg'}" alt="二维码" />
-						<p>iPhone版</p>
-						<p>客户端</p>
-					</div>
+					<a href="/user/signIn"></a>	
 				</div>
 				</div>
 				<div class="login_right">
 				<div class="login_right">
-					<h5>用户登陆<a th:href="@{/user/signIn}">免费注册有好礼呦!!</a></h5>
-					<form  id="form_login">
-						<div class="login_uesr">
-							<label for="uesname"><img th:src="${portalHost+'/img/login_use.png'}"/></label>
-							<input type="text" name="uesname" id="Lo_user" placeholder="用户名" />
-							<img th:src="${portalHost+'/img/login_del.png'}" class="log_del"/>
-						</div>
-						<div class="login_pass">
-							<label for="pass"><img th:src="${portalHost+'/img/login_password.png'}"/></label>
-							<input type="password" name="pass" id="Lo_pass" autocomplete="off" placeholder="请输入密码" />
-						</div>
-						<div class="login_pass">
-							<img th:src="${portalHost+'/img/resiger_username.jpg'}" alt=""/>
-							<select id="customerType">
-								<option value="0">个人</option>
-								<option value="1">企业</option>
-							</select>
-						</div>
-						<div class="login_check">
-						<a href="#">忘记密码?</a>
-						</div>
-						<input type="submit" value="登 陆" class="login_submit"/>
-					</form>
-					<img th:src="${portalHost+'/img/login_hua.png'}" alt="" class="login_hua"/>
-					<img th:src="${portalHost+'/img/login_shadow.png'}" alt="阴影效果" class="login_shadow"/>
-					<img th:src="${portalHost+'/img/login_close.png'}" alt="" class="login_close"/>
+					<div class="loginB ">
+						<h5>用户登陆</h5>
+						<form id="form_login">
+							<div class="login_uesr">
+								<label for="uesname">
+									<img th:src="${portalHost+'/img/index/index_login11.png'}" />
+								</label>
+								<input type="text" name="uesname" id="Lo_user" placeholder="请输入手机号" />
+							</div>
+							<div class="login_pass">
+								<label for="pass">
+									<img th:src="${portalHost+'/img/index/index_login1122.png'}" />
+								</label>
+								<input type="password" autocomplete="off" name="pass" id="Lo_pass" placeholder="请输入密码" />
+							</div>
+							<div class="login_check">
+								<a href="" class="forgetPass">忘记密码?</a><a href="/user/signIn">点我注册</a>
+							</div>
+							<input type="submit" value="登 陆" class="login_submit" />
+						</form>
+					</div>
+					<div class="loginSelect ">
+						<h5>用户类型</h5>
+						<form class="formSelect">
+							<div class="login_uesr">
+								<label for="type1" class="active">
+								<input type="radio" name="userType" value="0" id="type1" />个人用户</label>
+							</div>
+							<div class="login_pass">
+								<label for="type2" >
+								<input type="radio" name="userType"  value="1" id="type2"/>企业用户</label>
+							</div>
+							<input type="submit" value="确 认" class="typeQren" />
+						</form>
+					</div>
 				</div>
 				</div>
+				
+				<img th:src="${portalHost+'/img/login_shadow.png'}" alt="阴影效果" class="login_shadow" />
+				<img th:src="${portalHost+'/img/login_close.png'}" alt="" class="login_close" />
 			</div>
 			</div>
 		</div>
 		</div>
 		<div id="forget">
 		<div id="forget">
@@ -455,13 +458,13 @@
 								手机号码:<input type="text" name="type" id="forget_phone" placeholder="请输入您的手机号码..."/>
 								手机号码:<input type="text" name="type" id="forget_phone" placeholder="请输入您的手机号码..."/>
 							</label>
 							</label>
 						</div>
 						</div>
-						<div class="login_pa">
+					<!-- 	<div class="login_pa">
 							客户类别:
 							客户类别:
 							<select id="customerTy">
 							<select id="customerTy">
 								<option value="0">个人</option>
 								<option value="0">个人</option>
 								<option value="1">企业</option>
 								<option value="1">企业</option>
 							</select>
 							</select>
-						</div>
+						</div> -->
 						<div class="cellcode_">
 						<div class="cellcode_">
 							<div>
 							<div>
 								验证码:<input type="text" name="cellCode" placeholder="手机验证码" id="photo_n"/>
 								验证码:<input type="text" name="cellCode" placeholder="手机验证码" id="photo_n"/>
@@ -512,6 +515,28 @@
 		<div class="loading">
 		<div class="loading">
 			<div></div>
 			<div></div>
 		</div>
 		</div>
+		<div class="modeBj">
+			<div class="modeLogin">
+				<i class="glyphicon glyphicon-remove delLogin"></i>
+				<div>
+					<span>请选择您的用户类型</span>
+					<p data-val='0' class="active">个人用户</p>
+					<p data-val='1'>企业用户</p>
+					<button class="btn btn-success">确认</button>
+					<button class="btn btn-default">返回</button>
+				</div>
+			</div>
+		</div>
+		<div class="modeLogin">
+			<i class="glyphicon glyphicon-remove delLogin"></i>
+			<div>
+				<span>请选择您的用户类型</span>
+				<p data-val='0' class="active">个人用户</p>
+				<p data-val='1'>企业用户</p>
+				<button class="btn btn-success">确认</button>
+				<button class="btn btn-default">返回</button>
+			</div>
+		</div>
 	</th:block>
 	</th:block>
 
 
 	<th:block th:fragment="footer(scripts)">
 	<th:block th:fragment="footer(scripts)">
@@ -584,7 +609,7 @@
 				lvl : /*[[${userData == null} ? null : ${userData.lvl}]]*/''
 				lvl : /*[[${userData == null} ? null : ${userData.lvl}]]*/''
 			}
 			}
 			/*]]>*/
 			/*]]>*/
-			
+		
 		</script>
 		</script>
 		<th:block th:replace="${scripts}" />
 		<th:block th:replace="${scripts}" />
 		<script language="javascript" src="https://put.zoosnet.net/JS/LsJS.aspx?siteid=PUT70876498&float=1&lng=cn"></script>
 		<script language="javascript" src="https://put.zoosnet.net/JS/LsJS.aspx?siteid=PUT70876498&float=1&lng=cn"></script>

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/facilitator.html

@@ -27,7 +27,7 @@
     	<div class="facTab">
     	<div class="facTab">
     		<span>所有项目</span>
     		<span>所有项目</span>
     		<span>主页</span>
     		<span>主页</span>
-    		<span>点我领</span>
+    		<span>点我领</span>
     	</div>
     	</div>
     	<div class="facJuan">
     	<div class="facJuan">
 	    	<div class="facFirst">
 	    	<div class="facFirst">

+ 3 - 2
src/main/webapp/WEB-INF/views/portal/invRegister.html

@@ -15,7 +15,7 @@
 	<div th:replace="common::nav('','')"></div>
 	<div th:replace="common::nav('','')"></div>
     <!-- 公共头部结束 -->
     <!-- 公共头部结束 -->
     <div class="continueHighBanner">
     <div class="continueHighBanner">
-        <a th:href="@{/portal/invitation}"><img th:src="${portalHost+'/img/load/invR_banner.png'}" alt=""></a>
+        <a th:href="@{/user/signIn}"><img th:src="${portalHost+'/img/load/invR_banner.png'}" alt=""></a>
     </div>
     </div>
     <div class="container invRegister">
     <div class="container invRegister">
         <div class="topList">
         <div class="topList">
@@ -24,11 +24,12 @@
                    <a th:href="@{'/portal/facilitatorDetails?uid='+${v.grantingUid}+'#2'}">
                    <a th:href="@{'/portal/facilitatorDetails?uid='+${v.grantingUid}+'#2'}">
                    	  
                    	  
                        <span th:text="'抵用券有效期:'+${v.durationDay}+'天'">2018.01.10-2018.02.20</span>
                        <span th:text="'抵用券有效期:'+${v.durationDay}+'天'">2018.01.10-2018.02.20</span>
-                       <h1><span th:text="${v.money}">> 500</span><sup>优惠劵</sup></h1>
+                       <h1><span th:text="${v.money}">> 500</span><sup></sup></h1>
                        <p  th:text="${v.name}"></p>
                        <p  th:text="${v.name}"></p>
                    </a>    
                    </a>    
                 </li>
                 </li>
             </ul>
             </ul>
+            <a th:href="@{/portal/invitation}">了解活动规则详情 &gt;&gt;</a>
         </div>   
         </div>   
         <div class="invTitle">
         <div class="invTitle">
             <h2>企业必备</h2>
             <h2>企业必备</h2>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 28 - 9
src/main/webapp/WEB-INF/views/portal/invitation.html


+ 59 - 66
src/main/webapp/WEB-INF/views/user/signIn.html

@@ -4,7 +4,7 @@
 <head th:replace="common::header(~{::title},~{::link})">
 <head th:replace="common::header(~{::title},~{::link})">
 	<title>注册页</title>
 	<title>注册页</title>
 	<link th:href="${portalHost + '/vendors.css'}" rel="stylesheet">
 	<link th:href="${portalHost + '/vendors.css'}" rel="stylesheet">
-	<link th:href="${staticHost+'/dll/dll.css'}" rel="stylesheet">
+	<link th:href="${portalHost + '/dll/dll.css'}" rel="stylesheet">
 	<link th:href="${portalHost + '/register.css'}" rel="stylesheet">
 	<link th:href="${portalHost + '/register.css'}" rel="stylesheet">
 </head>
 </head>
 <body>
 <body>
@@ -14,74 +14,67 @@
 	<!--主体内容区域开始-->
 	<!--主体内容区域开始-->
   	  	<!--主体内容区域开始-->
   	  	<!--主体内容区域开始-->
   	<div class="registered">
   	<div class="registered">
-  		<div class="reg_con">
-			<form action="" id="form_register">
-				<div class="clear_first"></div>
-				<div class="zhuce">
-					<div class="title">用户注册</div>
-					<div class="regist">
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/name.jpg'}" alt=""/>
-							<input type="text" name="userName" placeholder="请输入名称"  id="username" autocomplete="off"/>
-							<img th:src="${portalHost+'/img/login_del.png'}" class="log_del"/>
-							<span class="star"> * </span>
-						</div>
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/pass2.jpg'}" alt=""/>
-							<input type="password" name="userPassword" placeholder="请输入密码" id="userpassword" autocomplete="off"/>
-							<span class="star"> * </span>
-						</div>
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/pass2.jpg'}" alt=""/>
-							<input type="password" name="userPassword2" placeholder="确认密码" id="userpassword2" autocomplete="off"/>
-							<span class="star"> * </span>
-						</div>
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/resiger_username.jpg'}" alt=""/>
-							<select id="customerTypes">
-								<option value="0">个人</option>
-								<option value="1">企业</option>
-							</select>
-							<span class="star"> * </span>
-						</div>
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/resiger_photo2.jpg'}" alt=""/>
-							<input type="text" name="photo" placeholder="请输入手机号码" id="usePhoto" autocomplete="off"/>
-							<span class="star"> * </span>
-						</div>						
-						<div class="cellcode">
-							<div>
-								<input type="text" name="cellCode" placeholder="手机验证码" id="photo_num"/>
-							</div>
-							<input type="button" id="photo" value="获取验证码" disabled/>
-						</div>	
-						<div class="zhuce_input">
-							<img th:src="${portalHost+'/img/resiger_photo300.jpg'}" alt=""/>
-							<input type="text" name="beInviteCode" placeholder="请输入邀请码" id="beInviteCode" autocomplete="off"/>
-						</div>											
-						<div class="protocol">
-							<label for="protocol" class="protocol_lab cheackeds_no">
-								<input type="checkbox" name="pro" id="protocol"/>
-								<a href="javascript:;" class="head_login_">同意技淘网会员服务协议条款</a>
-							</label>
-						</div>
-						<div class="submit">
-							<input type="submit" class="sub" value="注册"/>
-						</div>
+	<div class="reg_con">
+		<form action="" method="post" id="form_register">
+			<div class="clear_first"></div>
+			<div class="zhuce">
+				<div class="picture">
+				</div>
+				<div class="regist">
+					<div class="titleUser">
+						<p >用户注册</p>
+						<p >已注册可直接<a href="javascript:;" class="head_login">登录</a></p>
 					</div>
 					</div>
-					<div class="picture">
-						<div class="denglu">已有账号?去 <a href="javascript:;" class="head_login">登录</a></div>
-						<a href="#" class="clear huodong">
-							<img th:src="${portalHost+'/img/huodong.jpg'}" alt=""/>
-						</a>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll3.png'}" alt=""/>
+						<input type="text" name="photo" placeholder="请输入手机号码" id="usePhoto" autocomplete="off"/>
+						<span class="star"> * </span>
+						<span class="Tips "></span>
+					</div>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll4.png'}" alt=""/>
+						<input type="text" name="cellCode" placeholder="手机验证码" id="photo_num" autocomplete="off" />
+						<input type="button" id="photo" value="获取验证码" disabled="disabled"/>
+						<span class="star"> * </span>
+						<span class="Tips"></span>
+					</div>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll6.png'}" alt=""/>
+						<input type="password" name="userPassword" placeholder="请输入密码" id="userpassword" autocomplete="off"/>
+						<span class="star"> * </span>
+						<span class="Tips"></span>
+					</div>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll6.png'}" alt=""/>
+						<input type="password" name="userPassword2" placeholder="确认密码" id="userpassword2" autocomplete="off"/>
+						<span class="star"> * </span>
+						<span class="Tips"></span>
+					</div>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll3.png'}" alt=""/>
+						<input type="text" name="userName" placeholder="请输入用户名"  id="username" autocomplete="off"/>
+						<span class="star"> * </span>
+						<span class="Tips"></span>
+					</div>
+					<div class="zhuce_input">
+						<img th:src="${portalHost+'/img/indedImg/enroll9.png'}" alt=""/>
+						<input type="text" name="beInviteCode" placeholder="请输入邀请码" id="beInviteCode" autocomplete="off">
+					</div>
+					<div class="protocol">
+						<label for="protocol" class="cheackeds_no">
+							<input type="checkbox" name="pro" id="protocol"/>
+							<a href="javascript:;" class="head_login_">同意技淘网会员服务协议条款</a>
+						</label>
+					</div>
+					<div class="submit">
+						<input type="submit" class="sub" value="注册"/>
 					</div>
 					</div>
 				</div>
 				</div>
-				<div class="shadow">
-					<img th:src="${portalHost+'/img/shadow7.png'}" alt=""/>
-				</div>
-			</form>
-		</div>
-  	</div>
+				
+			</div>
+		</form>
+	</div>
+</div>
   	<div class="login_">
   	<div class="login_">
 		<div class="login_main_">
 		<div class="login_main_">
 			<h3 class="title_">免责声明 DISCLAIMER</h3>
 			<h3 class="title_">免责声明 DISCLAIMER</h3>