Browse Source

Merge remote-tracking branch 'origin/test'

limin 7 years ago
parent
commit
bf14caa4af
76 changed files with 5124 additions and 272 deletions
  1. 5 0
      .gitignore
  2. 2 1
      GeneratorConfig.xml
  3. 18 0
      src/main/java/com/goafanti/achievement/bo/AchievementEntity.java
  4. 7 0
      src/main/java/com/goafanti/app/bo/ExpertsListBo.java
  5. 37 3
      src/main/java/com/goafanti/app/controller/AppUserController.java
  6. 1 1
      src/main/java/com/goafanti/app/controller/OpenAppHomeController.java
  7. 111 1
      src/main/java/com/goafanti/app/controller/OpenAppUserController.java
  8. 1 1
      src/main/java/com/goafanti/business/bo/JtBusinessCategoryBo.java
  9. 9 0
      src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java
  10. 2 0
      src/main/java/com/goafanti/business/controller/UserJtBusinessController.java
  11. 1 1
      src/main/java/com/goafanti/business/service/JtTagService.java
  12. 2 0
      src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java
  13. 2 1
      src/main/java/com/goafanti/business/service/impl/JtTagServiceImpl.java
  14. 67 7
      src/main/java/com/goafanti/common/controller/PortalController.java
  15. 48 4
      src/main/java/com/goafanti/common/controller/PublicController.java
  16. 13 2
      src/main/java/com/goafanti/common/controller/WebpageController.java
  17. 2 0
      src/main/java/com/goafanti/common/dao/JtMessageConsumerMapper.java
  18. 78 0
      src/main/java/com/goafanti/common/dao/JtVoucherDetailMapper.java
  19. 83 0
      src/main/java/com/goafanti/common/dao/JtVoucherMapper.java
  20. 8 2
      src/main/java/com/goafanti/common/dao/UserMapper.java
  21. 59 0
      src/main/java/com/goafanti/common/enums/VoucherSourceType.java
  22. 2 1
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  23. 1 0
      src/main/java/com/goafanti/common/mapper/BannersMapper.xml
  24. 7 6
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  25. 3 1
      src/main/java/com/goafanti/common/mapper/JtBusinessCategoryMapper.xml
  26. 5 4
      src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml
  27. 7 0
      src/main/java/com/goafanti/common/mapper/JtMessageConsumerMapper.xml
  28. 39 5
      src/main/java/com/goafanti/common/mapper/JtMessageProducerMapper.xml
  29. 374 0
      src/main/java/com/goafanti/common/mapper/JtVoucherDetailMapper.xml
  30. 428 0
      src/main/java/com/goafanti/common/mapper/JtVoucherMapper.xml
  31. 2 2
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  32. 55 7
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  33. 8 0
      src/main/java/com/goafanti/common/model/JtCollectSearch.java
  34. 22 0
      src/main/java/com/goafanti/common/model/JtMessageProducer.java
  35. 214 0
      src/main/java/com/goafanti/common/model/JtVoucher.java
  36. 145 0
      src/main/java/com/goafanti/common/model/JtVoucherDetail.java
  37. 652 0
      src/main/java/com/goafanti/common/model/JtVoucherDetailExample.java
  38. 842 0
      src/main/java/com/goafanti/common/model/JtVoucherExample.java
  39. 20 0
      src/main/java/com/goafanti/common/model/User.java
  40. 2 0
      src/main/java/com/goafanti/common/service/GlobalSearchService.java
  41. 7 0
      src/main/java/com/goafanti/common/utils/DateUtils.java
  42. 2 1
      src/main/java/com/goafanti/common/utils/FileUtils.java
  43. 85 0
      src/main/java/com/goafanti/common/utils/InvitationCodeUtils.java
  44. 1 1
      src/main/java/com/goafanti/core/shiro/token/UserRealm.java
  45. 33 0
      src/main/java/com/goafanti/demand/bo/AppDemandBo.java
  46. 32 4
      src/main/java/com/goafanti/message/JGMessageHelper.java
  47. 18 0
      src/main/java/com/goafanti/message/bo/AppMessageBo.java
  48. 31 4
      src/main/java/com/goafanti/message/controller/AdminMessageController.java
  49. 3 1
      src/main/java/com/goafanti/message/service/JtMessageProducerService.java
  50. 1 0
      src/main/java/com/goafanti/message/service/MessageService.java
  51. 62 4
      src/main/java/com/goafanti/message/service/impl/JtMessageProducerServiceImpl.java
  52. 11 0
      src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java
  53. 17 1
      src/main/java/com/goafanti/portal/bo/AchievementObject.java
  54. 10 0
      src/main/java/com/goafanti/user/bo/InputUser.java
  55. 20 2
      src/main/java/com/goafanti/user/controller/UserApiController.java
  56. 65 9
      src/main/java/com/goafanti/user/controller/UserLoginController.java
  57. 60 14
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  58. 7 1
      src/main/java/com/goafanti/user/service/UserService.java
  59. 75 0
      src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java
  60. 73 2
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  61. 86 0
      src/main/java/com/goafanti/voucher/bo/JtVoucherDetailListBo.java
  62. 88 0
      src/main/java/com/goafanti/voucher/bo/JtVoucherListBo.java
  63. 78 0
      src/main/java/com/goafanti/voucher/controller/AdminVoucherController.java
  64. 87 0
      src/main/java/com/goafanti/voucher/controller/AdminVoucherDetailController.java
  65. 91 0
      src/main/java/com/goafanti/voucher/controller/UserVoucherController.java
  66. 25 0
      src/main/java/com/goafanti/voucher/service/VoucherDetailService.java
  67. 26 0
      src/main/java/com/goafanti/voucher/service/VoucherService.java
  68. 97 0
      src/main/java/com/goafanti/voucher/service/impl/VoucherDetailServiceImpl.java
  69. 92 0
      src/main/java/com/goafanti/voucher/service/impl/VoucherServiceImpl.java
  70. 2 0
      src/main/resources/props/config_local.properties
  71. 2 0
      src/main/resources/props/config_test.properties
  72. 64 39
      src/main/webapp/WEB-INF/views/common.html
  73. 82 76
      src/main/webapp/WEB-INF/views/portal/facilitator.html
  74. 173 0
      src/main/webapp/WEB-INF/views/portal/invRegister.html
  75. 74 0
      src/main/webapp/WEB-INF/views/portal/invitation.html
  76. 60 63
      src/main/webapp/WEB-INF/views/user/signIn.html

+ 5 - 0
.gitignore

@@ -2,3 +2,8 @@
 /bin/
 /.classpath
 /.settings
+/bin/
+/bin/
+/bin/
+/bin/
+/bin/

+ 2 - 1
GeneratorConfig.xml

@@ -10,6 +10,7 @@
    <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
    <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" />
    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
-   <table schema="aft" tableName="jt_collect_search"/>
+   <table schema="aft" tableName="jt_voucher"/>
+   <table schema="aft" tableName="jt_voucher_detail"/>
   </context>
 </generatorConfiguration>

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

@@ -32,6 +32,8 @@ public class AchievementEntity {
     private Integer interest;//是否感兴趣
     private Integer orderCount;//订单数
 	private String pictureUrlMin;//APP图片
+	private String  ownerName;//所有人名称
+	private String ownerMobile;//所有人电话
 
     public String getField2() {
 		return field2;
@@ -256,4 +258,20 @@ public class AchievementEntity {
 	public void setPictureUrlMin(String 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;
+	}
 }

+ 7 - 0
src/main/java/com/goafanti/app/bo/ExpertsListBo.java

@@ -25,6 +25,7 @@ public class ExpertsListBo {
 	private String typicalCase;
 	private String honer;
 	private String goodAtIndustry;
+	private String mobile;
 	public String getUid() {
 		return uid;
 	}
@@ -157,5 +158,11 @@ public class ExpertsListBo {
 	public void setGoodAtIndustry(String goodAtIndustry) {
 		this.goodAtIndustry = goodAtIndustry;
 	}
+	public String getMobile() {
+		return mobile;
+	}
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
 	
 }

+ 37 - 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.List;
 import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
@@ -113,9 +116,19 @@ public class AppUserController extends CertifyApiController {
 	@RequestMapping(value = "/updateUser",method = RequestMethod.POST)
 	public Result updateUser(User u){
 		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());
 		userServiceImpl.updateByPrimaryKeySelective(u);
@@ -240,6 +253,18 @@ public class AppUserController extends CertifyApiController {
 		messageService.updateMessageConsumer(messageId);
 		return res;
 	}
+	/**
+	 * 读取推送消息
+	 * @param messageId
+	 * @throws IllegalAccessException 
+	 * @throws InvocationTargetException 
+	 */
+	@RequestMapping(value = "/readJpushMessage",method = RequestMethod.GET)
+	private Result readJpushMessage(String messageId){
+		Result res = new Result();
+		res.data(messageService.updateReadJpushMessage(messageId));
+		return res;
+	}
 
 	/**
 	 * 查询环信昵称和头像
@@ -850,4 +875,13 @@ public class AppUserController extends CertifyApiController {
 		result.setData(messageService.updateAppReadMessage(id));
 		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)
 	public Result getApplicationData() {
 		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));
 		result.setData(map);
 		return result;

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

@@ -1,9 +1,16 @@
 package com.goafanti.app.controller;
 
+import java.util.Calendar;
+import java.util.UUID;
+
 import javax.annotation.Resource;
+import javax.validation.Valid;
+
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
 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.service.CommentService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 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.easemob.EasemobUtils;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.news.service.NewsService;
+import com.goafanti.user.bo.InputUser;
 import com.goafanti.user.service.UserCareerService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserInterestService;
@@ -50,7 +67,11 @@ public class OpenAppUserController extends BaseApiController {
 	@Resource
 	private UserIdentityService	userIdentityService;
 	@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());
 		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 topLevelId;
 String summary;
-List<JtBusinessCategory>children;
 String topImg;
+List<JtBusinessCategory>children;
 
 public String getTopImg() {
 	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 String  ownerName;
+	private String ownerMobile;
 	private String interestCount;
 	private String createTimeFormat;
 	private  CommentDetailResult	CommentDetailResult;
@@ -116,4 +117,12 @@ public void setCompanyId(String companyId) {
 	public void setInterested(Integer interested) {
 		this.interested = interested;
 	}
+
+	public String getOwnerMobile() {
+		return ownerMobile;
+	}
+
+	public void setOwnerMobile(String ownerMobile) {
+		this.ownerMobile = ownerMobile;
+	}
 }

+ 2 - 0
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -240,4 +240,6 @@ public class UserJtBusinessController extends CertifyApiController{
 	}
 	
 	
+	
+	
 }

+ 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);
 	
-	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 - 0
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -504,6 +504,8 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	public int updateByPrimaryKeySelective(JtBusinessProject jtBusinessProject) {
 		return jtBusinessProjectMapper.updateByPrimaryKeySelective(jtBusinessProject);
 	}
+
+	
 	
 
 }

+ 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
-	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.put("military", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
 		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("defenseWeapon", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
 		map.put("ownUse", jtBusinessProjectMapper.getProjectByTag("他山己用", size7));
+		map.put("brandBuilding", jtBusinessProjectMapper.getProjectByTag("品牌建设",size8));
 		return map;
 	}
 }

+ 67 - 7
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -9,19 +9,19 @@ import javax.servlet.http.HttpServletRequest;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.view.RedirectView;
-
 import com.goafanti.achievement.bo.AchievementPartnerListBo;
 import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.business.bo.JtBusinessProjectResult;
 import com.goafanti.business.service.JtBusinessService;
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.enums.AchievementMaturity;
+import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.UserInterest;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandInterestService;
 import com.goafanti.demand.service.DemandService;
@@ -30,6 +30,8 @@ import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserInterestService;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+import com.goafanti.voucher.service.VoucherService;
 
 @Controller
 public class PortalController extends BaseController {
@@ -50,11 +52,13 @@ public class PortalController extends BaseController {
 	@Resource
 	private DistrictGlossoryService districtglossoryservice;
 	@Resource
-	OrderService	orderService;
+	private OrderService	orderService;
+	@Resource
+	private UserInterestService userInterestService;
 	@Resource
-	UserInterestService userInterestService;
+	private JtBusinessService	jtBusinessService;
 	@Resource
-	JtBusinessService	jtBusinessService;
+	private VoucherService	voucherService;
 
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
 	public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
@@ -152,5 +156,61 @@ public class PortalController extends BaseController {
 
 	}
 	
-	
+	@SuppressWarnings("unchecked")
+	@RequestMapping(value="/portal/invRegister",method = RequestMethod.GET)
+	public ModelAndView portalActivityDetails(ModelAndView modelAndView){
+		modelAndView.setViewName("/portal/invRegister");
+		//获得项目抵用券
+		List<JtVoucherListBo> vlist=voucherService.selectActivityVoucher();
+		for (JtVoucherListBo j : vlist) {
+			if (j!=null&&j.getName().length()>12) {
+				j.setName(j.getName().substring(0, 11)+"…");
+			}
+		}
+		modelAndView.addObject("vouchers",vlist);
+		//高企服务
+		List<JtBusinessProject> glist=jtBusinessService.getKJListByIds(2, 0, 2);
+		for (JtBusinessProject j : glist) {
+			if (j.getName().length()>5) {
+				j.setName(j.getName().substring(0, 4)+"…");
+			}
+		}
+		modelAndView.addObject( "gqfw",glist);
+		//随机热门项目
+		Pagination<JtBusinessProjectResult> p=jtBusinessService.getProjects(null,null,null,null, 3,1,null,2,null,1,null,null,null);
+		List<JtBusinessProjectResult> plist=(List<JtBusinessProjectResult>) p.getList();
+		for (JtBusinessProjectResult j : plist) {
+			if (j.getName().length()>8) {
+				j.setName(j.getName().substring(0, 7)+"…");
+			}
+		}
+		modelAndView.addObject("hotProject",plist);
+		//军民融合
+		List<JtBusinessProject> jlist=jtBusinessService.getKJListByIds(3, 0, 3);
+		for (JtBusinessProject j : jlist) {
+			if (j.getName().length()>12) {
+				j.setName(j.getName().substring(0, 11)+"…");
+			}
+		}
+		modelAndView.addObject( "jmrh",jlist);
+		//知识产权
+		List<JtBusinessProject> zlist=jtBusinessService.getKJListByIds(1, 0, 3);
+		for (JtBusinessProject j : zlist) {
+			if (j.getName().length()>8) {
+				j.setName(j.getName().substring(0, 7)+"…");
+			}
+		}
+		modelAndView.addObject( "zscq",zlist);
+		//政府扶持
+		List<JtBusinessProject> zfList=jtBusinessService.getProjectByTag("政府扶持", 4);
+		for (JtBusinessProject j : zlist) {
+			if (j.getName().length()>11) {
+				j.setName(j.getName().substring(0, 10)+"…");
+			}
+		}
+		modelAndView.addObject( "zffc",zfList);
+		
+		
+		return modelAndView;
 	}
+}

+ 48 - 4
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -5,6 +5,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -31,16 +32,19 @@ import com.goafanti.comment.service.CommentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.enums.UserType;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.service.IndustryCategoryService;
+import com.goafanti.common.utils.InvitationCodeUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.DemandListBo;
@@ -48,6 +52,10 @@ import com.goafanti.demand.service.DemandService;
 import com.goafanti.portal.bo.AchievementObject;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.bo.JtVoucherDetailListBo;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Controller
 @Scope(value = "prototype")
@@ -103,6 +111,13 @@ public class PublicController extends BaseController {
 
 	@Resource(name = "passwordUtil")
 	private PasswordUtil			passwordUtil;
+	
+	@Resource
+	private	VoucherDetailService	voucherDetailService;
+	@Resource
+	private VoucherService		voucherService;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
 
 	/**
 	 * 获取验证码
@@ -518,10 +533,6 @@ public class PublicController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "手机号"));
 			return res;
 		}
-		if (null==type) {
-			res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "帐号类型"));
-			return res;
-		}
 		if (TimeUtils.checkOverTime(VerifyCodeUtils.M_CODE)) {
 			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "", "手机验证码超时失效!"));
 			VerifyCodeUtils.clearMobileCode();
@@ -770,4 +781,37 @@ public class PublicController extends BaseController {
 		return res;
 	}
 	
+	@SuppressWarnings("unchecked")
+	@RequestMapping(value = "/getUserVoucher", method = RequestMethod.GET)
+	@ResponseBody
+	public Result getUserVoucher(String uid,Integer pageNo,Integer pageSize){
+		Result res = new Result();
+		Pagination<JtVoucherListBo> p=voucherService.selectVoucherList(null,1,1,4,uid, pageNo, pageSize);
+		List<JtVoucherListBo> vl=(List<JtVoucherListBo>) p.getList();
+		if (TokenManager.getUserId()==null) return res.data(p);
+		List<String> l=voucherDetailService.getTokenVoucher();
+		for (JtVoucherListBo jt : vl) {
+			for (String s : l) {
+				if (s.equals(jt.getId())) {
+					jt.setIsGet(1);
+				}
+				
+			}
+		}
+		return 	res.data(p);
+	}
+	@RequestMapping(value = "/userGetVoucher", method = RequestMethod.POST)
+	@ResponseBody
+	public Result userGetVoucher(String uid,String vid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid)&&TokenManager.getUserId()!=null)uid=TokenManager.getUserId();
+		if(StringUtils.isBlank(vid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","抵用券"));
+		}
+		if(StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","领用者"));
+		}
+		res.data(voucherDetailService.saveUserGetVoucher(uid,vid));
+		return res;
+	}
 }

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

@@ -838,7 +838,7 @@ public class WebpageController extends BaseController {
 		
 		modelview.addObject("projects", jtBusinessProjects);
 		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) {
 			if (null != p.getTitleImg() && p.getTitleImg().contains(",")) {
 				p.setTitleImg(p.getTitleImg().substring(0, p.getTitleImg().indexOf(",")));
@@ -859,7 +859,7 @@ public class WebpageController extends BaseController {
 		}
 		
 		//获得轮播图数据
-		List<Banners> blist = bannersService.findBannersList("index", 0, 3, 1);
+		List<Banners> blist = bannersService.findBannersList("index", 0, 4, 1);
 		if(null != blist){
 			modelview.addObject("bannerlist", blist);
 		}
@@ -1501,6 +1501,17 @@ public class WebpageController extends BaseController {
 	}
 	
 	/**
+	 * 邀请好友
+	 * @param modelview
+	 * @return
+	 */
+	@RequestMapping(value = "/portal/invitation", method = RequestMethod.GET)
+	public ModelAndView portalInvitation(ModelAndView modelview){
+		modelview.setViewName("/portal/invitation");
+		return modelview;
+	}
+	
+	/**
 	 * 政策 资讯 百科
 	 * @param policy
 	 * @param pageNo

+ 2 - 0
src/main/java/com/goafanti/common/dao/JtMessageConsumerMapper.java

@@ -80,4 +80,6 @@ public interface JtMessageConsumerMapper {
 	AppMessageBo selectById(String id);
 	
 	int addBatch(List<JtMessageConsumer> list);
+
+	JtMessageConsumer getMessageConsumer(@Param("messageId")String messageId, @Param("userId")String userId);
 }

+ 78 - 0
src/main/java/com/goafanti/common/dao/JtVoucherDetailMapper.java

@@ -0,0 +1,78 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.common.model.JtVoucherDetailExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface JtVoucherDetailMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	long countByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insert(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insertSelective(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	List<JtVoucherDetail> selectByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	JtVoucherDetail selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") JtVoucherDetail record,
+			@Param("example") JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExample(@Param("record") JtVoucherDetail record, @Param("example") JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKeySelective(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKey(JtVoucherDetail record);
+
+	List<String> getTokenVoucher(String uid);
+}

+ 83 - 0
src/main/java/com/goafanti/common/dao/JtVoucherMapper.java

@@ -0,0 +1,83 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.JtVoucherExample;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface JtVoucherMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	long countByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insert(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insertSelective(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	List<JtVoucher> selectByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	JtVoucher selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") JtVoucher record, @Param("example") JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExample(@Param("record") JtVoucher record, @Param("example") JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKeySelective(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKey(JtVoucher record);
+
+	List<String> getSourceVoucher(Integer source);
+
+	List<JtVoucherListBo> selectVoucherByClassify(@Param("name")String name, @Param("isHot")Integer isHot,@Param("size")Integer size);
+
+	JtVoucherListBo selectByName(@Param("name")String name, @Param("size")Integer size);
+}

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

@@ -91,7 +91,7 @@ public interface UserMapper {
 
 	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);
 
@@ -114,5 +114,11 @@ public interface UserMapper {
 	
 	List<JtMessageConsumer> getAllUser();
 	
-	int getCountByMobile(@Param("id")String id,@Param("mobile")String mobile);
+	int getCountByMobile(@Param("id")String id,@Param("mobile")String mobile,@Param("type")Integer type);
+
+	List<String> getUserListMobile();
+
+	String getInvitationCode(String uid);
+
+	User getToInviteCode(String toInviteCode);
 }

+ 59 - 0
src/main/java/com/goafanti/common/enums/VoucherSourceType.java

@@ -0,0 +1,59 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum VoucherSourceType {
+	
+	YQGR(0, "邀请个人"),
+	YQFWS(1, "邀请服务商"),
+	BYQGR(2, "被邀请个人"),
+	BYQFWS(3, "被邀请服务商"),
+	HD(3, "活动"),
+	OTHER(3, "其他");
+
+	private VoucherSourceType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, VoucherSourceType> status = new HashMap<Integer, VoucherSourceType>();
+
+	static {
+		for (VoucherSourceType value : VoucherSourceType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static VoucherSourceType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static VoucherSourceType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 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 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,
-  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
+  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 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

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

@@ -358,6 +358,7 @@
 	<if test="client != null">
 	and client= #{client,jdbcType=INTEGER}
 	</if>
+	order by text
 	<if test="pN != null and pS != null">
 	limit #{pN,jdbcType=INTEGER},#{pS,jdbcType=INTEGER}
 	</if>

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

@@ -61,14 +61,15 @@
     where id = #{id,jdbcType=VARCHAR}
   </select>
   <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.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
+    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
 	GROUP by b.commodity_id) t on d.id=t.id
 	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}
  </select>
  <select id="getCategoryBySuperId" resultType="com.goafanti.common.model.JtBusinessCategory">
-  select
+    select
 	id,
 	name,
 	super_id as superId,
+	img_url as imgUrl,
 	sort,module
 from
 	jt_business_category
@@ -467,6 +468,7 @@ where
   <resultMap id="JtBusinessCategoryBoResult" type="com.goafanti.business.bo.JtBusinessCategoryBo">  
         <id column="name" property="topLevel" />  
         <id column="topLevelId" property="topLevelId" />
+        <id column="topImg" property="topImg" />
         <id column="summary" property="summary"/>
         <collection column="topLevelId" ofType="com.goafanti.common.model.JtBusinessCategory" property="children" select="getCategoryBySuperId">
         </collection>  

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

@@ -597,12 +597,12 @@
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <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.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
     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
@@ -877,6 +877,7 @@
 	  	p.name,
 	  	p.introduce,
 	  	p.min_img_url as minImgUrl,
+	  	p.price,
 	  	p.advertisement
   	from jt_business_project p
     left join jt_business_category c on p.category_id = c.id

+ 7 - 0
src/main/java/com/goafanti/common/mapper/JtMessageConsumerMapper.xml

@@ -298,4 +298,11 @@
 	where a.delete_sign=0 and b.delete_sign=0 and  b.is_draft=0 and b.is_send=1
 	and a.id=#{id,jdbcType=VARCHAR}
   </select>
+  <select id="getMessageConsumer" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from jt_message_consumer
+    where message_id=#{messageId,jdbcType=VARCHAR}
+	and aid= #{userId,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 39 - 5
src/main/java/com/goafanti/common/mapper/JtMessageProducerMapper.xml

@@ -19,6 +19,8 @@
     <result column="is_draft" jdbcType="BIT" property="isDraft" />
     <result column="is_send" jdbcType="BIT" property="isSend" />
     <result column="delete_sign" jdbcType="BIT" property="deleteSign" />
+    <result column="code" jdbcType="VARCHAR" property="code" />
+    <result column="resource_name" jdbcType="VARCHAR" property="resourceName" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -95,7 +97,7 @@
       This element was generated on Wed Aug 29 09:46:33 CST 2018.
     -->
     id, creater, create_time, send_time, title, body, subject, resource_id, resource_type, 
-    is_draft, is_send, delete_sign
+    is_draft, is_send, delete_sign,code,resource_name
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.JtMessageProducerExample" resultMap="BaseResultMap">
     <!--
@@ -156,11 +158,11 @@
     insert into jt_message_producer (id, creater, create_time, 
       send_time, title, body, 
       subject, resource_id, resource_type, 
-      is_draft, is_send, delete_sign)
+      is_draft, is_send, delete_sign,code,resource_name)
     values (#{id,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{sendTime,jdbcType=TIMESTAMP}, #{title,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR}, 
       #{subject,jdbcType=INTEGER}, #{resourceId,jdbcType=VARCHAR}, #{resourceType,jdbcType=INTEGER}, 
-      #{isDraft,jdbcType=BIT}, #{isSend,jdbcType=BIT}, #{deleteSign,jdbcType=BIT})
+      #{isDraft,jdbcType=BIT}, #{isSend,jdbcType=BIT}, #{deleteSign,jdbcType=BIT},#{code,jdbcType=VARCHAR},#{resourceName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.JtMessageProducer">
     <!--
@@ -206,6 +208,12 @@
       <if test="deleteSign != null">
         delete_sign,
       </if>
+      <if test="code != null">
+        code,
+      </if>
+        <if test="resourceName != null">
+        resource_name,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -244,6 +252,12 @@
       <if test="deleteSign != null">
         #{deleteSign,jdbcType=BIT},
       </if>
+      <if test="code != null">
+        #{code,jdbcType=VARCHAR},
+      </if>
+        <if test="resourceName != null">
+        #{resourceName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.JtMessageProducerExample" resultType="java.lang.Integer">
@@ -370,6 +384,12 @@
       <if test="deleteSign != null">
         delete_sign = #{deleteSign,jdbcType=BIT},
       </if>
+       <if test="code != null">
+        code = #{code,jdbcType=VARCHAR},
+      </if>
+        <if test="resourceName != null">
+        resource_name = #{resourceName,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -390,7 +410,9 @@
       resource_type = #{resourceType,jdbcType=INTEGER},
       is_draft = #{isDraft,jdbcType=BIT},
       is_send = #{isSend,jdbcType=BIT},
-      delete_sign = #{deleteSign,jdbcType=BIT}
+      delete_sign = #{deleteSign,jdbcType=BIT},
+      code = #{code,jdbcType=VARCHAR},
+      resource_name = #{resourceName,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   
@@ -399,7 +421,7 @@
   	select 
     id, creater, create_time as createTime, send_time as sendTime, title, body, subject, 
     resource_id as resourceId, resource_type as resourceType, 
-    is_draft as isDraft, is_send as isSend, delete_sign as deleteSign
+    is_draft as isDraft, is_send as isSend, delete_sign as deleteSign,code,resource_name as resourceName
     from jt_message_producer
     where delete_sign = 0 
     <if test="title != null">
@@ -421,6 +443,12 @@
     <if test="sendStartTime != null and sendEndTime != null">
     and send_time between #{sendStartTime,jdbcType=VARCHAR}  and #{sendEndTime,jdbcType=VARCHAR}
     </if>
+    <if test="code != null">
+    and code = #{code,jdbcType=VARCHAR}
+    </if>
+    <if test="subject != null">
+    and subject =  #{subject,jdbcType=INTEGER}
+    </if>
     order by create_time desc
     <if test="page_sql!=null">
         ${page_sql}
@@ -447,5 +475,11 @@
     <if test="sendStartTime != null and sendEndTime != null">
     and send_time between #{sendStartTime,jdbcType=VARCHAR}  and #{sendEndTime,jdbcType=VARCHAR}
     </if>
+    <if test="code != null">
+    and code = #{code,jdbcType=VARCHAR}
+    </if>
+    <if test="subject != null">
+    and subject =  #{subject,jdbcType=INTEGER}
+    </if>
   </select>
 </mapper>

+ 374 - 0
src/main/java/com/goafanti/common/mapper/JtVoucherDetailMapper.xml

@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.JtVoucherDetailMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="voucher_id" jdbcType="VARCHAR" property="voucherId" />
+    <result column="use_uid" jdbcType="VARCHAR" property="useUid" />
+    <result column="use_time" jdbcType="TIMESTAMP" property="useTime" />
+    <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    id, voucher_id, use_uid, use_time, receive_time, status
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from jt_voucher_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher_detail (id, voucher_id, use_uid, 
+      use_time, receive_time, status
+      )
+    values (#{id,jdbcType=VARCHAR}, #{voucherId,jdbcType=VARCHAR}, #{useUid,jdbcType=VARCHAR}, 
+      #{useTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher_detail
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="voucherId != null">
+        voucher_id,
+      </if>
+      <if test="useUid != null">
+        use_uid,
+      </if>
+      <if test="useTime != null">
+        use_time,
+      </if>
+      <if test="receiveTime != null">
+        receive_time,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="voucherId != null">
+        #{voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="useUid != null">
+        #{useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="useTime != null">
+        #{useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select count(*) from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.voucherId != null">
+        voucher_id = #{record.voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.useUid != null">
+        use_uid = #{record.useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.useTime != null">
+        use_time = #{record.useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.receiveTime != null">
+        receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    set id = #{record.id,jdbcType=VARCHAR},
+      voucher_id = #{record.voucherId,jdbcType=VARCHAR},
+      use_uid = #{record.useUid,jdbcType=VARCHAR},
+      use_time = #{record.useTime,jdbcType=TIMESTAMP},
+      receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      status = #{record.status,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    <set>
+      <if test="voucherId != null">
+        voucher_id = #{voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="useUid != null">
+        use_uid = #{useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="useTime != null">
+        use_time = #{useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    set voucher_id = #{voucherId,jdbcType=VARCHAR},
+      use_uid = #{useUid,jdbcType=VARCHAR},
+      use_time = #{useTime,jdbcType=TIMESTAMP},
+      receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      status = #{status,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectVoucherDetailList" resultType="com.goafanti.voucher.bo.JtVoucherDetailListBo">
+  	select
+		b.id, a.name, a.money, b.receive_time as receiveTime, a.duration_day as durationDay,
+		IF(date_add(b.receive_time, interval a.duration_day day) &lt; now(),2,b.status) as status,
+		a.source, b.use_time as useTime, c.mobile as userMobile,
+		date_format(b.receive_time,'%Y-%m-%d %H:%I:%S')as starTime,
+		date_format(date_add(b.receive_time, interval a.duration_day day),'%Y-%m-%d %H:%I:%S')as endTime
+		from  jt_voucher_detail b
+		left join jt_voucher a on a.id=b.voucher_id
+		left join user c on b.use_uid=c.id
+		where 1=1
+	<if test="uid != null">
+		and  b.use_uid  = #{uid,jdbcType=VARCHAR}
+	</if>	
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="status != null">
+	  and IF(date_add(b.receive_time, interval a.duration_day day) &lt; now(),2,b.status)  = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="userMobile != null">
+		and  c.mobile = #{userMobile,jdbcType=VARCHAR}
+	</if>
+	<if test="source != null">
+		and  a.source = #{source,jdbcType=INTEGER}
+	</if>
+	
+	<if test="sort == 0">
+		order by a.money 
+	</if>
+	<if test="sort == 1">
+		order by b.receive_time
+	</if>
+	<if test="sort == 2">
+		order by endTime
+	</if>
+	<if test="sortType == 1">
+	 desc
+	 </if>
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="selectVoucherDetailCount" resultType="java.lang.Integer">
+  	 select	count(*)  from jt_voucher_detail b
+		left join jt_voucher a on a.id=b.voucher_id
+		left join user c on b.use_uid=c.id
+	where 1=1
+	<if test="uid != null">
+		and  b.use_uid  = #{uid,jdbcType=VARCHAR}
+	</if>	
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="status != null">
+	    and IF(date_add(b.receive_time, interval a.duration_day day) &lt; now(),2,b.status)  = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="userMobile != null">
+		and  c.mobile = #{userMobile,jdbcType=VARCHAR}
+	</if>
+	<if test="source != null">
+		and  a.source = #{source,jdbcType=INTEGER}
+	</if>
+  </select>
+  <select id="getTokenVoucher" resultType="java.lang.String">
+  select b.id from jt_voucher_detail a 
+    left join jt_voucher b on a.voucher_id = b.id
+    where b.source=4 
+    and a.use_uid= #{uid,jdbcType=VARCHAR}
+  </select>
+</mapper>

+ 428 - 0
src/main/java/com/goafanti/common/mapper/JtVoucherMapper.xml

@@ -0,0 +1,428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.JtVoucherMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="source" jdbcType="INTEGER" property="source" />
+    <result column="money" jdbcType="DECIMAL" property="money" />
+    <result column="duration_day" jdbcType="INTEGER" property="durationDay" />
+    <result column="active_state" jdbcType="INTEGER" property="activeState" />
+    <result column="granting_uid" jdbcType="VARCHAR" property="grantingUid" />
+    <result column="limit_use" jdbcType="INTEGER" property="limitUse" />
+    <result column="limit_project_id" jdbcType="VARCHAR" property="limitProjectId" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    id, name, source, money, duration_day, active_state, granting_uid, limit_use, limit_project_id
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.JtVoucherExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from jt_voucher
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtVoucherExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher (id, name, source, 
+      money, duration_day, active_state, 
+      granting_uid, limit_use, limit_project_id
+      )
+    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, 
+      #{money,jdbcType=DECIMAL}, #{durationDay,jdbcType=INTEGER}, #{activeState,jdbcType=INTEGER}, 
+      #{grantingUid,jdbcType=VARCHAR}, #{limitUse,jdbcType=INTEGER}, #{limitProjectId,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="source != null">
+        source,
+      </if>
+      <if test="money != null">
+        money,
+      </if>
+      <if test="durationDay != null">
+        duration_day,
+      </if>
+      <if test="activeState != null">
+        active_state,
+      </if>
+      <if test="grantingUid != null">
+        granting_uid,
+      </if>
+      <if test="limitUse != null">
+        limit_use,
+      </if>
+      <if test="limitProjectId != null">
+        limit_project_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        #{source,jdbcType=INTEGER},
+      </if>
+      <if test="money != null">
+        #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="durationDay != null">
+        #{durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="activeState != null">
+        #{activeState,jdbcType=INTEGER},
+      </if>
+      <if test="grantingUid != null">
+        #{grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="limitUse != null">
+        #{limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="limitProjectId != null">
+        #{limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.JtVoucherExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select count(*) from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.name != null">
+        name = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.source != null">
+        source = #{record.source,jdbcType=INTEGER},
+      </if>
+      <if test="record.money != null">
+        money = #{record.money,jdbcType=DECIMAL},
+      </if>
+      <if test="record.durationDay != null">
+        duration_day = #{record.durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="record.activeState != null">
+        active_state = #{record.activeState,jdbcType=INTEGER},
+      </if>
+      <if test="record.grantingUid != null">
+        granting_uid = #{record.grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.limitUse != null">
+        limit_use = #{record.limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="record.limitProjectId != null">
+        limit_project_id = #{record.limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    set id = #{record.id,jdbcType=VARCHAR},
+      name = #{record.name,jdbcType=VARCHAR},
+      source = #{record.source,jdbcType=INTEGER},
+      money = #{record.money,jdbcType=DECIMAL},
+      duration_day = #{record.durationDay,jdbcType=INTEGER},
+      active_state = #{record.activeState,jdbcType=INTEGER},
+      granting_uid = #{record.grantingUid,jdbcType=VARCHAR},
+      limit_use = #{record.limitUse,jdbcType=INTEGER},
+      limit_project_id = #{record.limitProjectId,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    <set>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        source = #{source,jdbcType=INTEGER},
+      </if>
+      <if test="money != null">
+        money = #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="durationDay != null">
+        duration_day = #{durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="activeState != null">
+        active_state = #{activeState,jdbcType=INTEGER},
+      </if>
+      <if test="grantingUid != null">
+        granting_uid = #{grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="limitUse != null">
+        limit_use = #{limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="limitProjectId != null">
+        limit_project_id = #{limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    set name = #{name,jdbcType=VARCHAR},
+      source = #{source,jdbcType=INTEGER},
+      money = #{money,jdbcType=DECIMAL},
+      duration_day = #{durationDay,jdbcType=INTEGER},
+      active_state = #{activeState,jdbcType=INTEGER},
+      granting_uid = #{grantingUid,jdbcType=VARCHAR},
+      limit_use = #{limitUse,jdbcType=INTEGER},
+      limit_project_id = #{limitProjectId,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  
+  <select id="selectVoucherList" resultType="com.goafanti.voucher.bo.JtVoucherListBo">
+  select
+  	id, name, source, money, duration_day as durationDay, active_state as activeState, granting_uid as grantingUid,
+  	limit_use as limitUse, limit_project_id as limitProjectId
+   from jt_voucher
+   where 1=1
+   <if test="uid != null">
+   		and  granting_uid = #{uid,jdbcType=VARCHAR} 
+	</if>
+   <if test="name != null">
+		and  name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="limitUse != null">
+		and  limit_use  = #{limitUse,jdbcType=INTEGER}
+	</if>
+	<if test="activeState != null">
+		and  active_state = #{activeState,jdbcType=INTEGER}
+	</if>
+	<if test="source != null">
+		and  source = #{source,jdbcType=INTEGER}
+	</if>
+	order by name
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+   
+  </select>
+  <select id="selectVoucherCount" resultType="java.lang.Integer">
+  	 select
+  	count(*)
+   from jt_voucher
+   where 1=1
+   <if test="uid != null">
+		and  granting_uid = #{uid,jdbcType=VARCHAR} 
+		</if>
+   <if test="name != null">
+		and  name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="limitUse != null">
+		and  limit_use  = #{limitUse,jdbcType=INTEGER}
+	</if>
+	<if test="activeState != null">
+		and  active_state = #{activeState,jdbcType=INTEGER}
+	</if>
+	<if test="source != null">
+		and  source = #{source,jdbcType=INTEGER}
+	</if>
+  </select>
+  
+  <select id="getSourceVoucher" resultType="java.lang.String">
+  	select id from jt_voucher where active_state=1 and source= #{source,jdbcType=INTEGER}
+  </select>
+  <select id="selectVoucherByClassify" resultType="com.goafanti.voucher.bo.JtVoucherListBo">
+  select a.id,a.name,a.source,a.active_state as activeState,a.money,a.duration_day as durationDay,
+  a.granting_uid as grantingUid,a.limit_use as limitUse,a.limit_project_id as limitProjectId
+    from jt_voucher a
+    left join jt_business_project b on a.limit_project_id=b.id
+    left join jt_business_category c on b.category_id=c.id
+    where a.source=4 and a.active_state=1
+    <if test="name != null">
+    and c.name= #{name,jdbcType=VARCHAR}
+    </if>
+    <if test="isHot != null">
+    and b.is_hot= #{isHot,jdbcType=VARCHAR}
+    </if>
+    limit #{size,jdbcType=INTEGER}
+  </select>
+  <select id="selectByName" resultType="com.goafanti.voucher.bo.JtVoucherListBo">
+   select a.id,a.name,a.source,a.active_state as activeState,a.money,a.duration_day as durationDay,
+  a.granting_uid as grantingUid,a.limit_use as limitUse,a.limit_project_id as limitProjectId
+    from jt_voucher a
+    where a.source=4 and a.active_state=1
+    and a.name= #{name,jdbcType=VARCHAR}
+    limit #{size}
+  </select>
+  
+</mapper>

+ 2 - 2
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,
 		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,
-		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,
 			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,
@@ -1538,7 +1538,7 @@ select a.create_time as createTime,
 
 
 <select id="selectByIdentityId" resultType="com.goafanti.app.bo.ExpertsListBo">
-	select a.id,a.uid as uid,b.nickname as username,b.society_tag as keyword,a.expert,b.introduction,a.consultant_type as consultantType from user_identity a 
+	select a.id,a.uid as uid,b.mobile,b.nickname as username,b.society_tag as keyword,a.expert,b.introduction,a.consultant_type as consultantType from user_identity a 
     left join user b on a.uid=b.id
     where a.id=#{id,jdbcType=VARCHAR}
 </select>

+ 55 - 7
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -36,6 +36,8 @@
     <result column="username" jdbcType="VARCHAR" property="username" />
     <result column="authentication" jdbcType="INTEGER" property="authentication" />
     <result column="introduction" jdbcType="VARCHAR" property="introduction" />
+    <result column="be_invite_code" jdbcType="VARCHAR" property="beInviteCode" />
+    <result column="to_invite_code" jdbcType="VARCHAR" property="toInviteCode" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -114,7 +116,7 @@
     id, mobile, password, nickname, email, create_time, number, lvl, type, mid, status, 
     source, update_time, company_logo_url, head_portrait_url, society_tag, introduction, 
     value_added_tag, organization_id, identify_name, background_url, audit_opinion, audit_status, 
-    share_type, aid, transfer_time, username, authentication
+    share_type, aid, transfer_time, username, authentication,be_invite_code,to_invite_code
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.UserExample" resultMap="BaseResultMap">
     <!--
@@ -180,7 +182,8 @@
       introduction, value_added_tag, organization_id, 
       identify_name, background_url, audit_opinion, 
       audit_status, share_type, aid, 
-      transfer_time, username, authentication
+      transfer_time, username, authentication,be_invite_code,to_invite_code
+      
       )
     values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
       #{nickname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
@@ -190,7 +193,9 @@
       #{introduction,jdbcType=VARCHAR}, #{valueAddedTag,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR}, 
       #{identifyName,jdbcType=VARCHAR}, #{backgroundUrl,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR}, 
       #{auditStatus,jdbcType=INTEGER}, #{shareType,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, 
-      #{transferTime,jdbcType=TIMESTAMP}, #{username,jdbcType=VARCHAR}, #{authentication,jdbcType=INTEGER}
+      #{transferTime,jdbcType=TIMESTAMP}, #{username,jdbcType=VARCHAR}, #{authentication,jdbcType=INTEGER},
+      #{beInviteCode,jdbcType=VARCHAR},#{toInviteCode,jdbcType=VARCHAR} 
+      
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
@@ -285,6 +290,12 @@
       <if test="authentication != null">
         authentication,
       </if>
+      <if test="beInviteCode != null">
+        be_invite_code,
+      </if>
+      <if test="toInviteCode != null">
+        to_invite_code,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -371,6 +382,12 @@
       <if test="authentication != null">
         #{authentication,jdbcType=INTEGER},
       </if>
+      <if test="beInviteCode != null">
+        #{beInviteCode,jdbcType=VARCHAR},
+      </if>
+      <if test="toInviteCode != null">
+      #{toInviteCode,jdbcType=VARCHAR},    
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.UserExample" resultType="java.lang.Long">
@@ -515,7 +532,9 @@
       aid = #{record.aid,jdbcType=VARCHAR},
       transfer_time = #{record.transferTime,jdbcType=TIMESTAMP},
       username = #{record.username,jdbcType=VARCHAR},
-      authentication = #{record.authentication,jdbcType=INTEGER}
+      authentication = #{record.authentication,jdbcType=INTEGER},
+      be_invite_code = #{beInviteCode,jdbcType=VARCHAR},
+      to_invite_code = #{toInviteCode,jdbcType=VARCHAR}   
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -609,6 +628,12 @@
       <if test="authentication != null">
         authentication = #{authentication,jdbcType=INTEGER},
       </if>
+      <if test="beInviteCode != null">
+        be_invite_code = #{beInviteCode,jdbcType=VARCHAR},
+      </if>
+      <if test="toInviteCode != null">
+        to_invite_code = #{toInviteCode,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -645,7 +670,9 @@
       aid = #{aid,jdbcType=VARCHAR},
       transfer_time = #{transferTime,jdbcType=TIMESTAMP},
       username = #{username,jdbcType=VARCHAR},
-      authentication = #{authentication,jdbcType=INTEGER}
+      authentication = #{authentication,jdbcType=INTEGER},
+       be_invite_code = #{beInviteCode,jdbcType=VARCHAR},
+       to_invite_code = #{toInviteCode,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
  
@@ -682,7 +709,11 @@
     select
   <include refid="Base_Column_List" />
     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 id="selectByNameAndType" resultMap="BaseResultMap">
@@ -1248,7 +1279,24 @@
 	</select>
 	<!-- 验证手机号码是否重复 -->
 	<select id="getCountByMobile" parameterType="com.goafanti.common.model.User" resultType="java.lang.Integer">
-		select count(0) from user where mobile = #{mobile,jdbcType=VARCHAR} and id &lt;&gt; #{id,jdbcType=VARCHAR}
+		select count(0) from user where mobile = #{mobile,jdbcType=VARCHAR} 
+		<if test="type != null">
+		and type= #{type,jdbcType=INTEGER}
+		</if>
+		and id &lt;&gt; #{id,jdbcType=VARCHAR}
+	</select>
+	<select id="getUserListMobile"  resultType="java.lang.String">
+	select mobile from `user`
+ 		where status=0
+ 		and source=0
+	</select>
+	<select id="getInvitationCode" resultType="java.lang.String">
+	select to_invite_code from `user` where id= #{uid,jdbcType=VARCHAR}
+	</select>
+	<select id="getToInviteCode" resultMap="BaseResultMap">
+	select 
+	<include refid="Base_Column_List" />
+	from `user` where to_invite_code= #{toInviteCode,jdbcType=VARCHAR}
 	</select>
 
 </mapper>

+ 8 - 0
src/main/java/com/goafanti/common/model/JtCollectSearch.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.model;
 
+import com.goafanti.common.utils.StringUtils;
+
 public class JtCollectSearch {
     /**
      *
@@ -153,6 +155,9 @@ public class JtCollectSearch {
      * @mbg.generated Mon Sep 10 14:08:59 CST 2018
      */
     public String getKeyword() {
+    	if (StringUtils.isBlank(keyword)) {
+			return "暂无";
+		}
         return keyword;
     }
 
@@ -169,6 +174,9 @@ public class JtCollectSearch {
     }
 
 	public String getSummary() {
+		if (StringUtils.isBlank(summary)) {
+			return "暂无";
+		}
 		return summary;
 	}
 

+ 22 - 0
src/main/java/com/goafanti/common/model/JtMessageProducer.java

@@ -64,6 +64,12 @@ public class JtMessageProducer {
 	 * @mbggenerated  Wed Aug 29 09:46:33 CST 2018
 	 */
 	private Boolean deleteSign;
+	
+	
+	private String code;
+	
+	
+	private String resourceName;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_message_producer.id
@@ -280,4 +286,20 @@ public class JtMessageProducer {
 	public void setDeleteSign(Boolean deleteSign) {
 		this.deleteSign = deleteSign;
 	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+
+	public void setResourceName(String resourceName) {
+		this.resourceName = resourceName;
+	}
 }

+ 214 - 0
src/main/java/com/goafanti/common/model/JtVoucher.java

@@ -0,0 +1,214 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+
+public class JtVoucher {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String name;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer source;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private BigDecimal money;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer durationDay;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer activeState;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String grantingUid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer limitUse;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String limitProjectId;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.id
+	 * @return  the value of jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.id
+	 * @param id  the value for jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.name
+	 * @return  the value of jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.name
+	 * @param name  the value for jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.source
+	 * @return  the value of jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getSource() {
+		return source;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.source
+	 * @param source  the value for jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setSource(Integer source) {
+		this.source = source;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.money
+	 * @return  the value of jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public BigDecimal getMoney() {
+		return money;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.money
+	 * @param money  the value for jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setMoney(BigDecimal money) {
+		this.money = money;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.duration_day
+	 * @return  the value of jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getDurationDay() {
+		return durationDay;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.duration_day
+	 * @param durationDay  the value for jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDurationDay(Integer durationDay) {
+		this.durationDay = durationDay;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.active_state
+	 * @return  the value of jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getActiveState() {
+		return activeState;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.active_state
+	 * @param activeState  the value for jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setActiveState(Integer activeState) {
+		this.activeState = activeState;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.granting_uid
+	 * @return  the value of jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getGrantingUid() {
+		return grantingUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.granting_uid
+	 * @param grantingUid  the value for jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setGrantingUid(String grantingUid) {
+		this.grantingUid = grantingUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.limit_use
+	 * @return  the value of jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getLimitUse() {
+		return limitUse;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.limit_use
+	 * @param limitUse  the value for jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setLimitUse(Integer limitUse) {
+		this.limitUse = limitUse;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.limit_project_id
+	 * @return  the value of jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getLimitProjectId() {
+		return limitProjectId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.limit_project_id
+	 * @param limitProjectId  the value for jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setLimitProjectId(String limitProjectId) {
+		this.limitProjectId = limitProjectId;
+	}
+}

+ 145 - 0
src/main/java/com/goafanti/common/model/JtVoucherDetail.java

@@ -0,0 +1,145 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class JtVoucherDetail {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String voucherId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String useUid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Date useTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Date receiveTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer status;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.id
+	 * @return  the value of jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.id
+	 * @param id  the value for jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.voucher_id
+	 * @return  the value of jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getVoucherId() {
+		return voucherId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.voucher_id
+	 * @param voucherId  the value for jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setVoucherId(String voucherId) {
+		this.voucherId = voucherId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.use_uid
+	 * @return  the value of jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getUseUid() {
+		return useUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.use_uid
+	 * @param useUid  the value for jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setUseUid(String useUid) {
+		this.useUid = useUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.use_time
+	 * @return  the value of jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Date getUseTime() {
+		return useTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.use_time
+	 * @param useTime  the value for jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setUseTime(Date useTime) {
+		this.useTime = useTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.receive_time
+	 * @return  the value of jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Date getReceiveTime() {
+		return receiveTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.receive_time
+	 * @param receiveTime  the value for jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setReceiveTime(Date receiveTime) {
+		this.receiveTime = receiveTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.status
+	 * @return  the value of jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.status
+	 * @param status  the value for jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+}

+ 652 - 0
src/main/java/com/goafanti/common/model/JtVoucherDetailExample.java

@@ -0,0 +1,652 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class JtVoucherDetailExample {
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected String orderByClause;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected boolean distinct;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected List<Criteria> oredCriteria;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public JtVoucherDetailExample() {
+		oredCriteria = new ArrayList<Criteria>();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setOrderByClause(String orderByClause) {
+		this.orderByClause = orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getOrderByClause() {
+		return orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDistinct(boolean distinct) {
+		this.distinct = distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public boolean isDistinct() {
+		return distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public List<Criteria> getOredCriteria() {
+		return oredCriteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void or(Criteria criteria) {
+		oredCriteria.add(criteria);
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria or() {
+		Criteria criteria = createCriteriaInternal();
+		oredCriteria.add(criteria);
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria createCriteria() {
+		Criteria criteria = createCriteriaInternal();
+		if (oredCriteria.size() == 0) {
+			oredCriteria.add(criteria);
+		}
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected Criteria createCriteriaInternal() {
+		Criteria criteria = new Criteria();
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void clear() {
+		oredCriteria.clear();
+		orderByClause = null;
+		distinct = false;
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected abstract static class GeneratedCriteria {
+		protected List<Criterion> criteria;
+
+		protected GeneratedCriteria() {
+			super();
+			criteria = new ArrayList<Criterion>();
+		}
+
+		public boolean isValid() {
+			return criteria.size() > 0;
+		}
+
+		public List<Criterion> getAllCriteria() {
+			return criteria;
+		}
+
+		public List<Criterion> getCriteria() {
+			return criteria;
+		}
+
+		protected void addCriterion(String condition) {
+			if (condition == null) {
+				throw new RuntimeException("Value for condition cannot be null");
+			}
+			criteria.add(new Criterion(condition));
+		}
+
+		protected void addCriterion(String condition, Object value, String property) {
+			if (value == null) {
+				throw new RuntimeException("Value for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value));
+		}
+
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
+			if (value1 == null || value2 == null) {
+				throw new RuntimeException("Between values for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value1, value2));
+		}
+
+		public Criteria andIdIsNull() {
+			addCriterion("id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIsNotNull() {
+			addCriterion("id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdEqualTo(String value) {
+			addCriterion("id =", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotEqualTo(String value) {
+			addCriterion("id <>", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThan(String value) {
+			addCriterion("id >", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThanOrEqualTo(String value) {
+			addCriterion("id >=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThan(String value) {
+			addCriterion("id <", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThanOrEqualTo(String value) {
+			addCriterion("id <=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLike(String value) {
+			addCriterion("id like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotLike(String value) {
+			addCriterion("id not like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIn(List<String> values) {
+			addCriterion("id in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotIn(List<String> values) {
+			addCriterion("id not in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdBetween(String value1, String value2) {
+			addCriterion("id between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotBetween(String value1, String value2) {
+			addCriterion("id not between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIsNull() {
+			addCriterion("voucher_id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIsNotNull() {
+			addCriterion("voucher_id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdEqualTo(String value) {
+			addCriterion("voucher_id =", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotEqualTo(String value) {
+			addCriterion("voucher_id <>", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdGreaterThan(String value) {
+			addCriterion("voucher_id >", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdGreaterThanOrEqualTo(String value) {
+			addCriterion("voucher_id >=", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLessThan(String value) {
+			addCriterion("voucher_id <", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLessThanOrEqualTo(String value) {
+			addCriterion("voucher_id <=", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLike(String value) {
+			addCriterion("voucher_id like", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotLike(String value) {
+			addCriterion("voucher_id not like", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIn(List<String> values) {
+			addCriterion("voucher_id in", values, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotIn(List<String> values) {
+			addCriterion("voucher_id not in", values, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdBetween(String value1, String value2) {
+			addCriterion("voucher_id between", value1, value2, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotBetween(String value1, String value2) {
+			addCriterion("voucher_id not between", value1, value2, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIsNull() {
+			addCriterion("use_uid is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIsNotNull() {
+			addCriterion("use_uid is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidEqualTo(String value) {
+			addCriterion("use_uid =", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotEqualTo(String value) {
+			addCriterion("use_uid <>", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidGreaterThan(String value) {
+			addCriterion("use_uid >", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidGreaterThanOrEqualTo(String value) {
+			addCriterion("use_uid >=", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLessThan(String value) {
+			addCriterion("use_uid <", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLessThanOrEqualTo(String value) {
+			addCriterion("use_uid <=", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLike(String value) {
+			addCriterion("use_uid like", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotLike(String value) {
+			addCriterion("use_uid not like", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIn(List<String> values) {
+			addCriterion("use_uid in", values, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotIn(List<String> values) {
+			addCriterion("use_uid not in", values, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidBetween(String value1, String value2) {
+			addCriterion("use_uid between", value1, value2, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotBetween(String value1, String value2) {
+			addCriterion("use_uid not between", value1, value2, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIsNull() {
+			addCriterion("use_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIsNotNull() {
+			addCriterion("use_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeEqualTo(Date value) {
+			addCriterion("use_time =", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotEqualTo(Date value) {
+			addCriterion("use_time <>", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeGreaterThan(Date value) {
+			addCriterion("use_time >", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("use_time >=", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeLessThan(Date value) {
+			addCriterion("use_time <", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeLessThanOrEqualTo(Date value) {
+			addCriterion("use_time <=", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIn(List<Date> values) {
+			addCriterion("use_time in", values, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotIn(List<Date> values) {
+			addCriterion("use_time not in", values, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeBetween(Date value1, Date value2) {
+			addCriterion("use_time between", value1, value2, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotBetween(Date value1, Date value2) {
+			addCriterion("use_time not between", value1, value2, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIsNull() {
+			addCriterion("receive_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIsNotNull() {
+			addCriterion("receive_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeEqualTo(Date value) {
+			addCriterion("receive_time =", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotEqualTo(Date value) {
+			addCriterion("receive_time <>", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeGreaterThan(Date value) {
+			addCriterion("receive_time >", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("receive_time >=", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeLessThan(Date value) {
+			addCriterion("receive_time <", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeLessThanOrEqualTo(Date value) {
+			addCriterion("receive_time <=", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIn(List<Date> values) {
+			addCriterion("receive_time in", values, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotIn(List<Date> values) {
+			addCriterion("receive_time not in", values, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeBetween(Date value1, Date value2) {
+			addCriterion("receive_time between", value1, value2, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotBetween(Date value1, Date value2) {
+			addCriterion("receive_time not between", value1, value2, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIsNull() {
+			addCriterion("status is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIsNotNull() {
+			addCriterion("status is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusEqualTo(Integer value) {
+			addCriterion("status =", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotEqualTo(Integer value) {
+			addCriterion("status <>", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusGreaterThan(Integer value) {
+			addCriterion("status >", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+			addCriterion("status >=", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusLessThan(Integer value) {
+			addCriterion("status <", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusLessThanOrEqualTo(Integer value) {
+			addCriterion("status <=", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIn(List<Integer> values) {
+			addCriterion("status in", values, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotIn(List<Integer> values) {
+			addCriterion("status not in", values, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusBetween(Integer value1, Integer value2) {
+			addCriterion("status between", value1, value2, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+			addCriterion("status not between", value1, value2, "status");
+			return (Criteria) this;
+		}
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public static class Criterion {
+		private String condition;
+		private Object value;
+		private Object secondValue;
+		private boolean noValue;
+		private boolean singleValue;
+		private boolean betweenValue;
+		private boolean listValue;
+		private String typeHandler;
+
+		public String getCondition() {
+			return condition;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+
+		public Object getSecondValue() {
+			return secondValue;
+		}
+
+		public boolean isNoValue() {
+			return noValue;
+		}
+
+		public boolean isSingleValue() {
+			return singleValue;
+		}
+
+		public boolean isBetweenValue() {
+			return betweenValue;
+		}
+
+		public boolean isListValue() {
+			return listValue;
+		}
+
+		public String getTypeHandler() {
+			return typeHandler;
+		}
+
+		protected Criterion(String condition) {
+			super();
+			this.condition = condition;
+			this.typeHandler = null;
+			this.noValue = true;
+		}
+
+		protected Criterion(String condition, Object value, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.typeHandler = typeHandler;
+			if (value instanceof List<?>) {
+				this.listValue = true;
+			} else {
+				this.singleValue = true;
+			}
+		}
+
+		protected Criterion(String condition, Object value) {
+			this(condition, value, null);
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.secondValue = secondValue;
+			this.typeHandler = typeHandler;
+			this.betweenValue = true;
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue) {
+			this(condition, value, secondValue, null);
+		}
+	}
+
+	/**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table jt_voucher_detail
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Oct 16 15:02:07 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+}

+ 842 - 0
src/main/java/com/goafanti/common/model/JtVoucherExample.java

@@ -0,0 +1,842 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JtVoucherExample {
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected String orderByClause;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected boolean distinct;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected List<Criteria> oredCriteria;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public JtVoucherExample() {
+		oredCriteria = new ArrayList<Criteria>();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setOrderByClause(String orderByClause) {
+		this.orderByClause = orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getOrderByClause() {
+		return orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDistinct(boolean distinct) {
+		this.distinct = distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public boolean isDistinct() {
+		return distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public List<Criteria> getOredCriteria() {
+		return oredCriteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void or(Criteria criteria) {
+		oredCriteria.add(criteria);
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria or() {
+		Criteria criteria = createCriteriaInternal();
+		oredCriteria.add(criteria);
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria createCriteria() {
+		Criteria criteria = createCriteriaInternal();
+		if (oredCriteria.size() == 0) {
+			oredCriteria.add(criteria);
+		}
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected Criteria createCriteriaInternal() {
+		Criteria criteria = new Criteria();
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void clear() {
+		oredCriteria.clear();
+		orderByClause = null;
+		distinct = false;
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected abstract static class GeneratedCriteria {
+		protected List<Criterion> criteria;
+
+		protected GeneratedCriteria() {
+			super();
+			criteria = new ArrayList<Criterion>();
+		}
+
+		public boolean isValid() {
+			return criteria.size() > 0;
+		}
+
+		public List<Criterion> getAllCriteria() {
+			return criteria;
+		}
+
+		public List<Criterion> getCriteria() {
+			return criteria;
+		}
+
+		protected void addCriterion(String condition) {
+			if (condition == null) {
+				throw new RuntimeException("Value for condition cannot be null");
+			}
+			criteria.add(new Criterion(condition));
+		}
+
+		protected void addCriterion(String condition, Object value, String property) {
+			if (value == null) {
+				throw new RuntimeException("Value for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value));
+		}
+
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
+			if (value1 == null || value2 == null) {
+				throw new RuntimeException("Between values for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value1, value2));
+		}
+
+		public Criteria andIdIsNull() {
+			addCriterion("id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIsNotNull() {
+			addCriterion("id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdEqualTo(String value) {
+			addCriterion("id =", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotEqualTo(String value) {
+			addCriterion("id <>", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThan(String value) {
+			addCriterion("id >", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThanOrEqualTo(String value) {
+			addCriterion("id >=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThan(String value) {
+			addCriterion("id <", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThanOrEqualTo(String value) {
+			addCriterion("id <=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLike(String value) {
+			addCriterion("id like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotLike(String value) {
+			addCriterion("id not like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIn(List<String> values) {
+			addCriterion("id in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotIn(List<String> values) {
+			addCriterion("id not in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdBetween(String value1, String value2) {
+			addCriterion("id between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotBetween(String value1, String value2) {
+			addCriterion("id not between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNull() {
+			addCriterion("name is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNotNull() {
+			addCriterion("name is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameEqualTo(String value) {
+			addCriterion("name =", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotEqualTo(String value) {
+			addCriterion("name <>", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThan(String value) {
+			addCriterion("name >", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThanOrEqualTo(String value) {
+			addCriterion("name >=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThan(String value) {
+			addCriterion("name <", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThanOrEqualTo(String value) {
+			addCriterion("name <=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLike(String value) {
+			addCriterion("name like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotLike(String value) {
+			addCriterion("name not like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIn(List<String> values) {
+			addCriterion("name in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotIn(List<String> values) {
+			addCriterion("name not in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameBetween(String value1, String value2) {
+			addCriterion("name between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotBetween(String value1, String value2) {
+			addCriterion("name not between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIsNull() {
+			addCriterion("source is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIsNotNull() {
+			addCriterion("source is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceEqualTo(Integer value) {
+			addCriterion("source =", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotEqualTo(Integer value) {
+			addCriterion("source <>", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceGreaterThan(Integer value) {
+			addCriterion("source >", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceGreaterThanOrEqualTo(Integer value) {
+			addCriterion("source >=", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceLessThan(Integer value) {
+			addCriterion("source <", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceLessThanOrEqualTo(Integer value) {
+			addCriterion("source <=", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIn(List<Integer> values) {
+			addCriterion("source in", values, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotIn(List<Integer> values) {
+			addCriterion("source not in", values, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceBetween(Integer value1, Integer value2) {
+			addCriterion("source between", value1, value2, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotBetween(Integer value1, Integer value2) {
+			addCriterion("source not between", value1, value2, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIsNull() {
+			addCriterion("money is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIsNotNull() {
+			addCriterion("money is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyEqualTo(BigDecimal value) {
+			addCriterion("money =", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotEqualTo(BigDecimal value) {
+			addCriterion("money <>", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyGreaterThan(BigDecimal value) {
+			addCriterion("money >", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyGreaterThanOrEqualTo(BigDecimal value) {
+			addCriterion("money >=", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyLessThan(BigDecimal value) {
+			addCriterion("money <", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyLessThanOrEqualTo(BigDecimal value) {
+			addCriterion("money <=", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIn(List<BigDecimal> values) {
+			addCriterion("money in", values, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotIn(List<BigDecimal> values) {
+			addCriterion("money not in", values, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("money between", value1, value2, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("money not between", value1, value2, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIsNull() {
+			addCriterion("duration_day is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIsNotNull() {
+			addCriterion("duration_day is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayEqualTo(Integer value) {
+			addCriterion("duration_day =", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotEqualTo(Integer value) {
+			addCriterion("duration_day <>", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayGreaterThan(Integer value) {
+			addCriterion("duration_day >", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayGreaterThanOrEqualTo(Integer value) {
+			addCriterion("duration_day >=", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayLessThan(Integer value) {
+			addCriterion("duration_day <", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayLessThanOrEqualTo(Integer value) {
+			addCriterion("duration_day <=", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIn(List<Integer> values) {
+			addCriterion("duration_day in", values, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotIn(List<Integer> values) {
+			addCriterion("duration_day not in", values, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayBetween(Integer value1, Integer value2) {
+			addCriterion("duration_day between", value1, value2, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotBetween(Integer value1, Integer value2) {
+			addCriterion("duration_day not between", value1, value2, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIsNull() {
+			addCriterion("active_state is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIsNotNull() {
+			addCriterion("active_state is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateEqualTo(Integer value) {
+			addCriterion("active_state =", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotEqualTo(Integer value) {
+			addCriterion("active_state <>", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateGreaterThan(Integer value) {
+			addCriterion("active_state >", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateGreaterThanOrEqualTo(Integer value) {
+			addCriterion("active_state >=", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateLessThan(Integer value) {
+			addCriterion("active_state <", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateLessThanOrEqualTo(Integer value) {
+			addCriterion("active_state <=", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIn(List<Integer> values) {
+			addCriterion("active_state in", values, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotIn(List<Integer> values) {
+			addCriterion("active_state not in", values, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateBetween(Integer value1, Integer value2) {
+			addCriterion("active_state between", value1, value2, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotBetween(Integer value1, Integer value2) {
+			addCriterion("active_state not between", value1, value2, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIsNull() {
+			addCriterion("granting_uid is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIsNotNull() {
+			addCriterion("granting_uid is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidEqualTo(String value) {
+			addCriterion("granting_uid =", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotEqualTo(String value) {
+			addCriterion("granting_uid <>", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidGreaterThan(String value) {
+			addCriterion("granting_uid >", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidGreaterThanOrEqualTo(String value) {
+			addCriterion("granting_uid >=", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLessThan(String value) {
+			addCriterion("granting_uid <", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLessThanOrEqualTo(String value) {
+			addCriterion("granting_uid <=", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLike(String value) {
+			addCriterion("granting_uid like", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotLike(String value) {
+			addCriterion("granting_uid not like", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIn(List<String> values) {
+			addCriterion("granting_uid in", values, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotIn(List<String> values) {
+			addCriterion("granting_uid not in", values, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidBetween(String value1, String value2) {
+			addCriterion("granting_uid between", value1, value2, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotBetween(String value1, String value2) {
+			addCriterion("granting_uid not between", value1, value2, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIsNull() {
+			addCriterion("limit_use is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIsNotNull() {
+			addCriterion("limit_use is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseEqualTo(Integer value) {
+			addCriterion("limit_use =", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotEqualTo(Integer value) {
+			addCriterion("limit_use <>", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseGreaterThan(Integer value) {
+			addCriterion("limit_use >", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseGreaterThanOrEqualTo(Integer value) {
+			addCriterion("limit_use >=", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseLessThan(Integer value) {
+			addCriterion("limit_use <", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseLessThanOrEqualTo(Integer value) {
+			addCriterion("limit_use <=", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIn(List<Integer> values) {
+			addCriterion("limit_use in", values, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotIn(List<Integer> values) {
+			addCriterion("limit_use not in", values, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseBetween(Integer value1, Integer value2) {
+			addCriterion("limit_use between", value1, value2, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotBetween(Integer value1, Integer value2) {
+			addCriterion("limit_use not between", value1, value2, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIsNull() {
+			addCriterion("limit_project_id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIsNotNull() {
+			addCriterion("limit_project_id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdEqualTo(String value) {
+			addCriterion("limit_project_id =", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotEqualTo(String value) {
+			addCriterion("limit_project_id <>", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdGreaterThan(String value) {
+			addCriterion("limit_project_id >", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdGreaterThanOrEqualTo(String value) {
+			addCriterion("limit_project_id >=", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLessThan(String value) {
+			addCriterion("limit_project_id <", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLessThanOrEqualTo(String value) {
+			addCriterion("limit_project_id <=", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLike(String value) {
+			addCriterion("limit_project_id like", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotLike(String value) {
+			addCriterion("limit_project_id not like", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIn(List<String> values) {
+			addCriterion("limit_project_id in", values, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotIn(List<String> values) {
+			addCriterion("limit_project_id not in", values, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdBetween(String value1, String value2) {
+			addCriterion("limit_project_id between", value1, value2, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotBetween(String value1, String value2) {
+			addCriterion("limit_project_id not between", value1, value2, "limitProjectId");
+			return (Criteria) this;
+		}
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public static class Criterion {
+		private String condition;
+		private Object value;
+		private Object secondValue;
+		private boolean noValue;
+		private boolean singleValue;
+		private boolean betweenValue;
+		private boolean listValue;
+		private String typeHandler;
+
+		public String getCondition() {
+			return condition;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+
+		public Object getSecondValue() {
+			return secondValue;
+		}
+
+		public boolean isNoValue() {
+			return noValue;
+		}
+
+		public boolean isSingleValue() {
+			return singleValue;
+		}
+
+		public boolean isBetweenValue() {
+			return betweenValue;
+		}
+
+		public boolean isListValue() {
+			return listValue;
+		}
+
+		public String getTypeHandler() {
+			return typeHandler;
+		}
+
+		protected Criterion(String condition) {
+			super();
+			this.condition = condition;
+			this.typeHandler = null;
+			this.noValue = true;
+		}
+
+		protected Criterion(String condition, Object value, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.typeHandler = typeHandler;
+			if (value instanceof List<?>) {
+				this.listValue = true;
+			} else {
+				this.singleValue = true;
+			}
+		}
+
+		protected Criterion(String condition, Object value) {
+			this(condition, value, null);
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.secondValue = secondValue;
+			this.typeHandler = typeHandler;
+			this.betweenValue = true;
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue) {
+			this(condition, value, secondValue, null);
+		}
+	}
+
+	/**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table jt_voucher
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Oct 16 15:03:29 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+}

+ 20 - 0
src/main/java/com/goafanti/common/model/User.java

@@ -144,6 +144,10 @@ public class  User  extends BaseModel implements AftUser {
 	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
 	 */
 	private Integer authentication;
+	
+	private String toInviteCode;
+	
+	private String beInviteCode;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user.id
@@ -649,6 +653,22 @@ public class  User  extends BaseModel implements AftUser {
 		this.authentication = authentication;
 	}
 
+	public String getToInviteCode() {
+		return toInviteCode;
+	}
+
+	public void setToInviteCode(String toInviteCode) {
+		this.toInviteCode = toInviteCode;
+	}
+
+	public String getBeInviteCode() {
+		return beInviteCode;
+	}
+
+	public void setBeInviteCode(String beInviteCode) {
+		this.beInviteCode = beInviteCode;
+	}
+
 	/**
 	 * 
 	 */

+ 2 - 0
src/main/java/com/goafanti/common/service/GlobalSearchService.java

@@ -2,6 +2,7 @@ package com.goafanti.common.service;
 
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.springframework.stereotype.Service;
@@ -23,6 +24,7 @@ public class GlobalSearchService  extends BaseMybatisDao<JtCollectSearchMapper>
 		return (Pagination<JtCollectSearch>) findPage("globalSearchList", "globalSearchCount", params, pageNo,
 				pageSize);
 		
+		
 	}
 
 	@SuppressWarnings("unchecked")

+ 7 - 0
src/main/java/com/goafanti/common/utils/DateUtils.java

@@ -455,5 +455,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 		setMidnight(c);
 		return c.getTime();
 	}
+	public static Date getDateAdd(Date date,int a){
+		Calendar ca = Calendar.getInstance();
+		ca.setTime(date);
+		ca.add(Calendar.DATE, a);
+		return ca.getTime();
+		
+	}
 
 }

+ 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("."));
 		boolean uniq = false;
 		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;
 		}
 		String fileName = "";

+ 85 - 0
src/main/java/com/goafanti/common/utils/InvitationCodeUtils.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.utils;
+
+import java.util.Date;
+import java.util.Random;
+
+
+public class InvitationCodeUtils {
+	/** 自定义进制(选择你想要的进制数,不能重复且最好不要0、1这些容易混淆的字符) */
+    private static final char[] r=new char[]{'Q', 'W', 'E', '8', 'S', '2', 'D', 'Z', 'X', '9', 'C', '7', 'P', '5', 'K', '3', 'M', 'J', 'U', 'F', 'R', '4', 'V', 'Y', 'T', 'N', '6', 'B', 'G', 'H'};
+ 
+ 
+ 
+    /** 进制长度 */
+    private static final int binLen=r.length;
+ 
+    /** 邀请码长度 */
+    private static final int s=12;
+ 
+    /**
+     * 根据ID生成随机码
+     * @param id ID
+     * @return 随机码
+     */
+    public static String toSerialCode(long id) {
+        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() < s) {
+            StringBuilder sb=new StringBuilder();
+            
+            Random rnd=new Random();
+            for(int i=1; i <= s - str.length(); i++) {
+            sb.append(r[rnd.nextInt(binLen)]);
+            }
+            str+=sb.toString();
+        }
+        return str;
+    }
+    /**
+     * 根据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()));
+}*/
+
+	
+}

+ 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),
 					getName());
 		} else {
-			User user = userService.selectByMobieAndType(token.getUsername(), token.getType());
+			User user = userService.selectByMobieAndType(token.getUsername().trim(), null);
 			if (null == user) {
 				throw new UnknownAccountException();
 			}

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

@@ -3,6 +3,10 @@ package com.goafanti.demand.bo;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class AppDemandBo {
 	   private int fieldA;//行业
 	    private int fieldB;//行业二级
@@ -26,6 +30,9 @@ public class AppDemandBo {
 	    private BigDecimal budgetCost;
 	    private Date createTime;
 	    private String pictureUrlMin;
+		private String  ownerName;//所有人名称
+		private String ownerMobile;//所有人电话
+
 		public int getFieldA() {
 			return fieldA;
 		}
@@ -62,6 +69,13 @@ public class AppDemandBo {
 		public void setReleaseDate(Date releaseDate) {
 			this.releaseDate = releaseDate;
 		}
+		public String getReleaseDateFormattedDate() {
+			if (this.releaseDate == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 		public int getInterestCount() {
 			return interestCount;
 		}
@@ -152,10 +166,29 @@ public class AppDemandBo {
 		public void setCreateTime(Date createTime) {
 			this.createTime = createTime;
 		}
+		public String getCreateTimeFormattedDate() {
+			if (this.createTime == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 		public String getPictureUrlMin() {
 			return pictureUrlMin;
 		}
 		public void setPictureUrlMin(String 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;
+		}
 }

+ 32 - 4
src/main/java/com/goafanti/message/JGMessageHelper.java

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 
+import com.goafanti.common.model.JtMessageProducer;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.message.bo.MessageAdapter;
 import com.goafanti.message.bo.MessageBo;
@@ -50,6 +51,8 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 	private static final Logger logger = LoggerFactory.getLogger(JGMessageHelper.class);
 	private static final int MAX_TRYCOUNT = 3;
 	private static final String MESSAGE_ID = "message_id";//消息ID
+	private static final String MESSAGE_TITLE = "message_title";//消息ID
+	private static final String MESSAGE_BODY = "message_body";//消息ID
 	private static final String RESOURCE_ID =  "resource_id";//资源ID
 	private static final String RESOURCE_TYPE = "resource_type";//资源类型
 	public void send(MessageAdapter messageAdapter){
@@ -115,6 +118,34 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 		}
 	}
 	
+	public void sendPushMessage(JtMessageProducer mp){
+		MessageAdapter ma = new MessageAdapter();
+		if(mp !=null&&StringUtils.isNotBlank(mp.getId())){
+			ma.pushPayload(PushPayload.newBuilder()
+					.setPlatform(Platform.android_ios())
+					.setAudience(Audience.all())
+					.setNotification(Notification.newBuilder()
+							.setAlert("")
+			        		.addPlatformNotification(AndroidNotification.newBuilder()
+			        				.addExtra(MESSAGE_ID, mp.getId())
+			        				.addExtra(MESSAGE_TITLE, mp.getTitle())
+			        				.addExtra(MESSAGE_BODY, mp.getBody())
+			        				.addExtra(RESOURCE_ID, mp.getResourceId() == null ? "" : mp.getResourceId())
+			        				.addExtra(RESOURCE_TYPE, mp.getResourceType() == null ? "":mp.getResourceType().toString()).build())
+			        		.addPlatformNotification(IosNotification.newBuilder()
+			        				.incrBadge(1)
+			        				.setContentAvailable(true)
+			        				.addExtra(MESSAGE_ID, mp.getId())
+			        				.addExtra(MESSAGE_TITLE, mp.getTitle())
+			        				.addExtra(MESSAGE_BODY, mp.getBody())
+			        				.addExtra(RESOURCE_ID, mp.getResourceId() == null ? "" : mp.getResourceId())
+			        				.addExtra(RESOURCE_TYPE, mp.getResourceType()== null ? "": mp.getResourceType().toString()).build())
+			        		.build())
+					.build());
+			send(ma);
+		}
+	}
+	
 	public void sendSystemMessage(MessageBo... mb){
 		for(MessageBo bo : mb){
 			sendSystemMessage(bo);
@@ -142,10 +173,7 @@ public class JGMessageHelper implements InitializingBean, DisposableBean{
 		MessageAdapter ma = new MessageAdapter().pushPayload( 
 				PushPayload.newBuilder()
 		.setPlatform(Platform.android_ios())
-		.setAudience(Audience.newBuilder()
-				.addAudienceTarget(
-						AudienceTarget.registrationId("101d8559094270e0d78"))
-				.build())
+		.setAudience(Audience.all())
 		.setNotification(Notification.newBuilder()
         		.setAlert("消息标题")
         		.addPlatformNotification(AndroidNotification.newBuilder()

+ 18 - 0
src/main/java/com/goafanti/message/bo/AppMessageBo.java

@@ -2,6 +2,10 @@ package com.goafanti.message.bo;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class AppMessageBo {
 	private String id;
 	private String title;
@@ -45,5 +49,19 @@ public class AppMessageBo {
 	public void setSendTime(Date sendTime) {
 		this.sendTime = sendTime;
 	}
+	public String getSendTimeFormattedDate() {
+		if (this.sendTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getSendTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 	
 }

+ 31 - 4
src/main/java/com/goafanti/message/controller/AdminMessageController.java

@@ -4,6 +4,7 @@ import java.text.ParseException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import javax.annotation.Resource;
@@ -331,6 +332,31 @@ public class AdminMessageController extends CertifyApiController{
 		}
 		return res;
 	}
+	/**
+	 * 发送短信消息
+	 * @param messageId
+	 * @return
+	 */
+	@RequestMapping(value = "/mobileMessage", method = RequestMethod.GET)
+	public Result mobileMessage(String messageCode){
+		Result res = checkMessageCode(messageCode);
+		if (res.getError().isEmpty()) {
+			//发送消息
+			res.setData(jtMessageProducerService.saveMobileMessage(messageCode));
+		}
+		return res;
+	}
+	
+	private Result checkMessageCode(String messageCode) {
+		Result res = new Result();
+		String regex = "^(SMS_)\\d{9}$";
+		Pattern p = Pattern.compile(regex);
+		Matcher m = p.matcher(messageCode);
+		if ( !m.matches()) {
+			res.getError().add(buildError("", "消息Codec错误"));
+			}
+		return res;
+	}
 	
 	/**
 	 * 获得单个消息数据接口
@@ -377,14 +403,15 @@ public class AdminMessageController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value="/getMessageList", method = RequestMethod.GET)
-	public Result getMessageList(JtMessageProducer messageProducer,String sendStartTime, String sendEndTime, Integer pageNo,Integer pageSize ){
+	public Result getMessageList(JtMessageProducer messageProducer,String sendStartTime, String sendEndTime,String messageCode,Integer subject, Integer pageNo,Integer pageSize ){
 		Result res = new Result();
-		if(StringUtils.isBlank(TokenManager.getUserId())){
+		/*if(StringUtils.isBlank(TokenManager.getUserId())){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"", "登录数据失效"));
-		}
+			return res;
+		}*/
 		if (res.getError().isEmpty()) {
 			//查看消息列表
-			res.setData(jtMessageProducerService.getMessageList(messageProducer, sendStartTime, sendEndTime, pageNo, pageSize ));
+			res.setData(jtMessageProducerService.getMessageList(messageProducer, sendStartTime, sendEndTime, messageCode, subject,pageNo, pageSize ));
 		}
 		return res;
 	}

+ 3 - 1
src/main/java/com/goafanti/message/service/JtMessageProducerService.java

@@ -37,5 +37,7 @@ public interface JtMessageProducerService {
 	 * 消息列表
 	 * @return
 	 */
-	Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime, Integer pageNo,Integer pageSize);
+	Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime, String code,Integer subject,Integer pageNo,Integer pageSize);
+
+	int saveMobileMessage(String messageCode);
 }

+ 1 - 0
src/main/java/com/goafanti/message/service/MessageService.java

@@ -163,6 +163,7 @@ public interface MessageService {
 
 	 Pagination<AppMessageBo> applistMessage(Integer pageNo, Integer pageSize);
 	 AppMessageBo updateAppReadMessage(String id);
+	int updateReadJpushMessage(String messageId);
 		
 
 	

+ 62 - 4
src/main/java/com/goafanti/message/service/impl/JtMessageProducerServiceImpl.java

@@ -1,25 +1,32 @@
 package com.goafanti.message.service.impl;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.JtMessageConsumerMapper;
 import com.goafanti.common.dao.JtMessageProducerMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.model.JtMessageConsumer;
 import com.goafanti.common.model.JtMessageProducer;
+import com.goafanti.common.utils.MobileMessageUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.message.JGMessageHelper;
 import com.goafanti.message.service.JtMessageProducerService;
 
 @Service
@@ -32,6 +39,12 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 	private AdminMapper adminMapper;
 	@Autowired
 	private JtMessageConsumerMapper jtMessageConsumerMapper;
+	@Autowired
+	private JGMessageHelper jgMessageHelper;
+	@Value(value = "${accessKey}")
+	private String					accessKey			= null;
+	@Value(value = "${accessSecret}")
+	private String					accessSecret		= null;
 	
 
 	@Override
@@ -50,6 +63,9 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 		if(null != messageProducer.getCreateTime()){
 			messageProducer.setCreateTime(new Date());
 		}
+		if (messageProducer.getResourceType()==null) {
+			messageProducer.setResourceType(-1);//安卓跳转处理
+		}
 		return jtMessageProducerMapper.insertSelective(messageProducer);
 	}
 	
@@ -69,8 +85,16 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 		messageProducer.setIsSend(true);
 		messageProducer.setIsDraft(false);
 		jtMessageProducerMapper.updateByPrimaryKeySelective(messageProducer);
+		JtMessageProducer producer=jtMessageProducerMapper.selectByPrimaryKey(messageId);
+		if (producer!=null) {
+			if (producer.getSubject()==1) {
+				//推送消息
+				jgMessageHelper.sendPushMessage(producer);
+			}
+		}
 		return jtMessageConsumerMapper.addBatch(list);
 	}
+	
 
 	@Override
 	public JtMessageProducer getMessageById(String messageId) {
@@ -80,20 +104,21 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 	@Override
 	public int updateMessageById(JtMessageProducer messageProducer) {
 		int count = 0;
+		// 修改消息
+		messageProducer.setCreateTime(null);//不修改创建时间
+		count = jtMessageProducerMapper.updateByPrimaryKeySelective(messageProducer);
 		// 推送消息
 		if(messageProducer.getIsSend() && !messageProducer.getDeleteSign() && !messageProducer.getIsDraft()){
 			if(null == messageProducer.getSendTime()) messageProducer.setSendTime(new Date());
 			count += addSendMessage(messageProducer.getId());
 		}
-		// 修改消息
-		messageProducer.setCreateTime(null);//不修改创建时间
-		count = jtMessageProducerMapper.updateByPrimaryKeySelective(messageProducer);
 		return count;
 	}
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime, Integer pageNo,Integer pageSize) {
+	public Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime,
+			String messageCode,Integer subject,Integer pageNo,Integer pageSize){
 		if(pageNo==null || pageNo<1)pageNo=1;
 		if(pageSize==null ||pageSize<1)pageSize=10; 
 		Map<String, Object> params=new HashMap<String,Object>();
@@ -103,8 +128,41 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 		if(null != messageProducer.getIsSend())params.put("isSend",messageProducer.getIsSend());
 		if(StringUtils.isNotBlank(sendStartTime))params.put("sendStartTime",sendStartTime);
 		if(StringUtils.isNotBlank(sendEndTime))params.put("sendEndTime",sendEndTime);
+		if(StringUtils.isNotBlank(messageCode))params.put("code",messageCode);
+		if(null!=subject)params.put("subject",subject);
 		return (Pagination<JtMessageProducer>) findPage("getMyMessageList", "getMyMessageCount", params, pageNo, pageSize);
 	}
 
+	@Override
+	public int saveMobileMessage(String messageCode) {
+		String regex = "^(1[1-9][0-9])\\d{8}$";
+		Pattern p = Pattern.compile(regex);
+		List<String> mobileList=userMapper.getUserListMobile();
+		String mobile="";
+		for (String string : mobileList) {
+			if (null!=string) {
+				Matcher m = p.matcher(string);
+			if ( m.matches()) {
+				mobile+=string+",";
+				}
+			}
+		}
+		if(mobile.length()>1)mobile=mobile.substring(0, mobile.length()-1);
+		MobileMessageUtils.sendMessage(messageCode, null, mobile, accessKey, accessSecret);
+		JtMessageProducer producer=new JtMessageProducer();
+		producer.setId(UUID.randomUUID().toString());
+		producer.setCreater(AFTConstants.DEFAULT_INITIATOR);
+		producer.setTitle("");
+		producer.setSubject(2);
+		producer.setIsSend(true);
+		producer.setIsDraft(false);
+		producer.setDeleteSign(false);
+		producer.setCode(messageCode);
+		producer.setSendTime(new Date());
+		jtMessageProducerMapper.insertSelective(producer);
+		return 1;
+		
+	}
+
 
 }

+ 11 - 0
src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java

@@ -458,6 +458,17 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 		return jtMessageConsumerMapper.selectById(id);
 	}
 
+	@Override
+	public int updateReadJpushMessage(String messageId) {
+		JtMessageConsumer j=jtMessageConsumerMapper.getMessageConsumer(messageId,TokenManager.getUserId());
+		int i=0;
+		if (j!=null) {
+			j.setIsRead(true);
+			 i=jtMessageConsumerMapper.updateByPrimaryKeySelective(j);
+		}
+		return i;
+	}
+
 	
 
 }

+ 17 - 1
src/main/java/com/goafanti/portal/bo/AchievementObject.java

@@ -3,7 +3,10 @@ package com.goafanti.portal.bo;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
 import com.goafanti.achievement.bo.InputAchievement;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.enums.AchievementCategory;
 import com.goafanti.common.enums.AchievementDataCategory;
 import com.goafanti.common.enums.Maturity;
@@ -58,6 +61,13 @@ public class AchievementObject extends InputAchievement {
 	public void setReleaseDate(Date releaseDate) {
 		this.releaseDate = releaseDate;
 	}
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 	public String getFieldAS() {
 		return fieldAS;
 	}
@@ -166,7 +176,13 @@ public class AchievementObject extends InputAchievement {
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
-	
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 
 	
 	

+ 10 - 0
src/main/java/com/goafanti/user/bo/InputUser.java

@@ -23,6 +23,8 @@ public class InputUser {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	type;
 	
+	private String beInviteCode;
+	
 	public Integer getType() {
 		return type;
 	}
@@ -62,4 +64,12 @@ public class InputUser {
 	public void setUsername(String username) {
 		this.username = username;
 	}
+
+	public String getBeInviteCode() {
+		return beInviteCode;
+	}
+
+	public void setBeInviteCode(String beInviteCode) {
+		this.beInviteCode = beInviteCode;
+	}
 }

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

@@ -694,7 +694,7 @@ public class UserApiController extends BaseApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/updateUserBase", method = RequestMethod.POST)
-	public Result updateUserBase(String identifyName,String mobile,String email,String nickname){
+	public Result updateUserBase(String identifyName,String mobile,String email,String nickname,Integer type){
 		Result res = new Result();
 		if(StringUtils.isBlank(identifyName) || StringUtils.isBlank(mobile)
 				||StringUtils.isBlank(nickname)){
@@ -711,7 +711,7 @@ public class UserApiController extends BaseApiController {
 				res.getError().add(buildError("电话号码格式不对","电话号码格式不对"));
 			}else{
 				//验证手机是否存在
-				int i = userService.getCountByMobile(user.getId(),mobile);
+				int i = userService.getCountByMobile(user.getId(),mobile,type);
 				if(i>0){
 					res.getError().add(buildError("电话号码重复","电话号码重复"));
 				}else{
@@ -721,6 +721,7 @@ public class UserApiController extends BaseApiController {
 		}
 		if(StringUtils.isNotBlank(email))user.setEmail(email);
 		user.setNickname(nickname);
+		if(type !=null)user.setType(type);
 		if(res.getError().size()>0){
 			return res;
 		}
@@ -728,6 +729,7 @@ public class UserApiController extends BaseApiController {
 		return res;
 	}
 	
+	
 	/**
 	 * 登陆后返回用户基本信息
 	 * 
@@ -1003,6 +1005,22 @@ public class UserApiController extends BaseApiController {
         }
 		return res;
 	}
+	/**
+	 * 获取用户邀请码
+	 */
+	@RequestMapping(value = "/InvitationCode", method = RequestMethod.GET)
+	public Result InvitationCode(String uid) {
+		Result res = new Result();
+		if (uid==null) {
+			if(!(TokenManager.getToken() instanceof User)||TokenManager.getUserId()==null){
+			res.getError().add(buildError("未获取到用户信息", "未获取到用户信息"));
+			return res;
+			}
+			uid=TokenManager.getUserId();
+		}
+		res.data(userService.updateGetInvitationCode(uid));
+		return res;
+	}
 	
 
 

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

@@ -1,16 +1,15 @@
 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.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.UnknownAccountException;
 import org.apache.shiro.web.util.SavedRequest;
 import org.apache.shiro.web.util.WebUtils;
 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.JSONObject;
-import com.goafanti.app.bo.UserBasicInfo;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.dao.AdminMapper;
 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.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.message.bo.MessageBo;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.user.service.UserService;
 
@@ -46,6 +42,9 @@ public class UserLoginController extends BaseController {
 	@Resource
 	private MessageService messageService;
 	
+	@Resource(name = "passwordUtil")
+	private PasswordUtil	passwordUtil;
+	
 	
 	@RequestMapping(value = "/login", method = RequestMethod.GET)
 	@ResponseBody
@@ -74,9 +73,66 @@ public class UserLoginController extends BaseController {
 			jo.put("queryString", sr.getQueryString());
 		}
 		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;
 	}
+	/**
+	 * 登录检查
+	 * 
+	 * @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;
+	}
 
 	/**
 	 * 用户登录

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

@@ -1,40 +1,42 @@
 package com.goafanti.user.controller;
 
 import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
 import java.util.UUID;
-
 import javax.annotation.Resource;
 import javax.validation.Valid;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
-import org.apache.shiro.crypto.hash.SimpleHash;
-import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-
-import com.alibaba.fastjson.JSONObject;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.UserAuthentication;
 import com.goafanti.common.enums.UserFields;
 import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.enums.VoucherSourceType;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
+import com.goafanti.common.utils.InvitationCodeUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.easemob.EasemobUtils;
-import com.goafanti.easemob.bo.EasemobInfo;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.user.bo.InputUser;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Controller
 public class UserRegisterController extends BaseController {
@@ -48,6 +50,12 @@ public class UserRegisterController extends BaseController {
 	private MessageService messageService;
 	@Resource
 	private EasemobUtils   easemobUtils;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
+	@Resource
+	private	VoucherDetailService	voucherDetailService;
+	@Resource
+	private VoucherService		voucherService;
 	Logger					logger	= Logger.getLogger(UserRegisterController.class);
 	
 	/**
@@ -73,9 +81,10 @@ public class UserRegisterController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "手机号码不能为空"));
 			return res;
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
+		User u = userService.selectByMobieAndType(user.getMobile().trim(),null);
 		if (null != u) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
+			return res;
 		}
 		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, "手机验证码错误"));
@@ -86,6 +95,10 @@ public class UserRegisterController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "手机验证码超时失效"));
 			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());
@@ -98,7 +111,7 @@ public class UserRegisterController extends BaseController {
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setNickname(user.getUnitName());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
-			us.setType(user.getType());
+			us.setBeInviteCode(user.getBeInviteCode());
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
 			us.setIdentifyName(StringUtils.isBlank(user.getUnitName())?"":user.getUnitName());
@@ -106,6 +119,8 @@ public class UserRegisterController extends BaseController {
 			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
 			us.setTransferTime(now.getTime());
 			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			//获得抵用券
+			userService.saveVoucher(us);
 		}
 		return res;
 	}
@@ -126,17 +141,28 @@ public class UserRegisterController extends BaseController {
 					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
+		if (StringUtils.isBlank(user.getUnitName())) {
+			user.setUnitName("jt_"+InvitationCodeUtils.randomCode(new Date().getTime(),6));
+		}
+		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;
 		}
-		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode.toLowerCase())) {
-			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码错误"));
+		if (user.getBeInviteCode()!=null&&!user.getBeInviteCode().equals("")&&userService.checkeToInviteCode(user.getBeInviteCode())) {
+			res.getError().add(buildError("邀请码不存在", "邀请码不存在"));
 			return res;
 		}
 		if (res.getError().isEmpty()) {
@@ -150,7 +176,8 @@ public class UserRegisterController extends BaseController {
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setNickname(user.getUnitName());
-			us.setType(user.getType());
+			if(user.getType() !=null)us.setType(user.getType());
+			us.setBeInviteCode(user.getBeInviteCode());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
@@ -159,11 +186,30 @@ public class UserRegisterController extends BaseController {
 			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
 			us.setTransferTime(now.getTime());
 			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			//获得抵用券
+			userService.saveVoucher(us);
 		}
 		return res;
 	}
 	
-	/*private void registerEasemobAfterRegister(String uuid,User u){
+	/*public void getVoucher(User u){
+		if (StringUtils.isNotBlank(u.getBackgroundUrl())) {
+			
+			List<String> ids=voucherService.getSourceVoucher(VoucherSourceType.BYQFWS.getCode());
+			for (String s : ids) {
+				JtVoucherDetail j=new JtVoucherDetail();
+				j.setId(jDBCIdGenerator.generateId().toString());
+				j.setReceiveTime(new Date());
+				j.setVoucherId(s);
+				j.setUseUid(u.getId());
+				j.setStatus(0);
+				voucherDetailService.saveVoucherDetail(j);
+			}
+			
+		}
+	}
+	
+	private void registerEasemobAfterRegister(String uuid,User u){
 			JSONObject resultObj = new JSONObject();
 			String easemobName =  String.valueOf(u.getNumber());
 			String easemobPass = new SimpleHash("md5", u.getId(), null, 1).toHex();

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

@@ -68,6 +68,12 @@ public interface UserService {
 	 * @param user
 	 * @return
 	 */
-	int getCountByMobile(String id, String mobile);
+	int getCountByMobile(String id, String mobile,Integer type);
+
+	String updateGetInvitationCode(String uid);
+
+	void saveVoucher(User us);
+
+	boolean checkeToInviteCode(String beInviteCode);
 	
 }

+ 75 - 0
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -2,10 +2,15 @@ package com.goafanti.user.service.impl;
 
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.Resource;
 
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -37,13 +42,17 @@ import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.SocietyTagStatus;
 import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.enums.VoucherSourceType;
 import com.goafanti.common.enums.collectType;
 import com.goafanti.common.model.JtCollectSearch;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.MobileMessageUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.portal.bo.UserSubscriberListBo;
@@ -55,6 +64,8 @@ import com.goafanti.user.bo.MyInterestedBo;
 import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.bo.UserIdentityDetailAdminBo;
 import com.goafanti.user.service.UserIdentityService;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Service
 public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper> implements UserIdentityService {
@@ -74,8 +85,24 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 	UserInterestMapper	userInterestMapper;
 	@Autowired
 	JtCollectSearchMapper	jtCollectSearchMapper;
+	@Autowired
+	private VoucherService		voucherService;
+	@Autowired
+	private VoucherDetailService	voucherDetailService;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
 	@Value(value="${collect_flag}")
 	private Boolean collectFlag ;
+	@Value(value = "${examineAdopt}")
+	private String					examineAdopt	= null;
+	@Value(value = "${examineNoAdopt}")
+	private String					examineNoAdopt	= null;
+
+	@Value(value = "${accessKey}")
+	private String					accessKey			= null;
+
+	@Value(value = "${accessSecret}")
+	private String					accessSecret		= null;
 	
 
 	private static final Logger	logger	= LoggerFactory.getLogger(UserIdentityServiceImpl.class);
@@ -592,6 +619,9 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		identity.setAuditStatus(auditStatus);*/
 		if(collectFlag){
 		ExpertsListBo u=userIdentityMapper.selectByIdentityId(identity.getId());
+		String str="";
+		if(u.getExpert()==2&&u.getConsultantType() == 4)str="法律顾问";
+		if(u.getExpert()==2&&u.getConsultantType() != 4)str="顾问";
 		if (identity.getAuditStatus()==2) {
 				JtCollectSearch r=new JtCollectSearch();
 				if(u.getExpert()==1){
@@ -603,6 +633,11 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 					}else{
 						r.setFromTable(collectType.ADVISER.getDesc());
 					}
+					//通过后短信通知
+					examineSendMessage(u, str, examineAdopt);
+					//抵用券发放
+					User user=userMapper.selectByPrimaryKey(u.getUid());
+					getVoucher(user);
 				}
 				r.setKeyword(SocietyTagStatus.getStatus(u.getKeyword()).getDesc());
 				r.setTitle(u.getUsername());
@@ -617,10 +652,25 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		
 		if (identity.getAuditStatus()==4||identity.getAuditStatus()==3) {
 			if(collectFlag)jtCollectSearchMapper.deleteByrowId(u.getUid());
+			//不通过短信通知
+			examineSendMessage(u, str, examineNoAdopt);
 			}
 		}
 		return userIdentityMapper.updateAuditing(identity);
 	}
+
+	private void examineSendMessage(ExpertsListBo u, String str, String code) {
+		//String paramString = "{\"code\":\"" + mobileVerifyCode + "\",\"product\":\"技淘网\"}";
+		String paramString = "{\"audit\":\"" + str  + "\"}";
+		String regex = "^(1[1-9][0-9])\\d{8}$";
+		Pattern p = Pattern.compile(regex);
+		if (null!=u.getMobile()) {
+				Matcher m = p.matcher(u.getMobile());
+			if ( m.matches()) {
+				MobileMessageUtils.sendMessage(code, paramString, u.getMobile(), accessKey, accessSecret);
+				}
+		}
+	}
 	
 
 	@Override
@@ -689,5 +739,30 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		return userIdentityMapper.getRandAdviserByType(exceptid, consultantType, size);
 	}
 	
+	public void getVoucher(User us) {
+		if (StringUtils.isNotBlank(us.getBeInviteCode())) {
+			List<String> ids=voucherService.getSourceVoucher(VoucherSourceType.BYQFWS.getCode());
+			for (String s : ids) {
+				JtVoucherDetail j=new JtVoucherDetail();
+				j.setId(jDBCIdGenerator.generateId().toString());
+				j.setReceiveTime(new Date());
+				j.setVoucherId(s);
+				j.setUseUid(us.getId());
+				j.setStatus(0);
+				voucherDetailService.saveVoucherDetail(j);
+			}
+			User toUser=userMapper.getToInviteCode(us.getBeInviteCode());
+			List<String> ids2=voucherService.getSourceVoucher(VoucherSourceType.YQFWS.getCode());
+			for (String string : ids2) {
+				JtVoucherDetail j=new JtVoucherDetail();
+				j.setId(jDBCIdGenerator.generateId().toString());
+				j.setReceiveTime(new Date());
+				j.setVoucherId(string);
+				j.setUseUid(toUser.getId());
+				j.setStatus(0);
+				voucherDetailService.saveVoucherDetail(j);
+			}
+		}
+	}
 
 }

+ 73 - 2
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -1,9 +1,12 @@
 package com.goafanti.user.service.impl;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.Resource;
+
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -17,9 +20,14 @@ import com.goafanti.common.dao.JtCollectSearchMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.VoucherSourceType;
 import com.goafanti.common.model.JtCollectSearch;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
+import com.goafanti.common.utils.InvitationCodeUtils;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.bo.OrgUnitNames;
@@ -29,6 +37,8 @@ import com.goafanti.user.bo.UserNames;
 import com.goafanti.user.bo.UserPageHomeBo;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Service
 public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserService {
@@ -40,6 +50,12 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	private UserIdentityMapper				userIdentityMapper;
 	@Autowired
 	private JtCollectSearchMapper 		jtCollectSearchMapper;
+	@Autowired
+	private VoucherService		voucherService;
+	@Autowired
+	private VoucherDetailService	voucherDetailService;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
 	@Value(value="${collect_flag}")
 	private boolean collectFlag;
 	@Override
@@ -243,7 +259,62 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	}
 
 	@Override
-	public int getCountByMobile(String id,String mobile) {
-		return userMapper.getCountByMobile(id,mobile);
+	public int getCountByMobile(String id,String mobile,Integer type) {
+		return userMapper.getCountByMobile(id,mobile,type);
+	}
+
+	@Override
+	public String updateGetInvitationCode(String uid) {
+		String str=userMapper.getInvitationCode(uid);
+		if (str==null) {
+			str=InvitationCodeUtils.toSerialCode(new Date().getTime());
+			User u=new User();
+			u.setId(uid);
+			u.setToInviteCode(str);
+			userMapper.updateByPrimaryKeySelective(u);
+		}
+		return str;
+	}
+
+	@Override
+	public void saveVoucher(User us) {
+		if (StringUtils.isNotBlank(us.getBeInviteCode())) {
+			List<String> ids=voucherService.getSourceVoucher(VoucherSourceType.BYQGR.getCode());
+			if (ids !=null && ids.size()>0) {
+				for (String s : ids) {
+					JtVoucherDetail j=new JtVoucherDetail();
+					j.setId(jDBCIdGenerator.generateId().toString());
+					j.setReceiveTime(new Date());
+					j.setVoucherId(s);
+					j.setUseUid(us.getId());
+					j.setStatus(0);
+					voucherDetailService.saveVoucherDetail(j);
+				}
+			}
+			User toUser=userMapper.getToInviteCode(us.getBeInviteCode());
+			if (toUser !=null) {
+				List<String> ids2=voucherService.getSourceVoucher(VoucherSourceType.YQGR.getCode());
+				for (String string : ids2) {
+					JtVoucherDetail j=new JtVoucherDetail();
+					j.setId(jDBCIdGenerator.generateId().toString());
+					j.setReceiveTime(new Date());
+					j.setVoucherId(string);
+					j.setUseUid(toUser.getId());
+					j.setStatus(0);
+					voucherDetailService.saveVoucherDetail(j);
+			}
+			
+			}
+		}
+	}
+
+	@Override
+	public boolean checkeToInviteCode(String beInviteCode) {
+		User user=userMapper.getToInviteCode(beInviteCode);
+		if (user==null) {
+			return true;
+		}
+		return false;
+		
 	}
 }

+ 86 - 0
src/main/java/com/goafanti/voucher/bo/JtVoucherDetailListBo.java

@@ -0,0 +1,86 @@
+package com.goafanti.voucher.bo;
+
+import java.util.Date;
+
+public class JtVoucherDetailListBo {
+		private String id;
+		private String name;
+		private String money;
+		private String source;
+		private Date receiveTime;
+		private String starTime;
+		private String endTime;
+		private String status;
+		private String useTime;
+		private String userMobile;
+		private Integer durationDay;
+		
+		public Date getReceiveTime() {
+			return receiveTime;
+		}
+		public void setReceiveTime(Date receiveTime) {
+			this.receiveTime = receiveTime;
+		}
+		public String getEndTime() {
+			return endTime;
+		}
+		public void setEndTime(String endTime) {
+			this.endTime = endTime;
+		}
+		public String getStatus() {
+			return status;
+		}
+		public void setStatus(String status) {
+			this.status = status;
+		}
+		public String getUseTime() {
+			return useTime;
+		}
+		public void setUseTime(String useTime) {
+			this.useTime = useTime;
+		}
+		public String getUserMobile() {
+			return userMobile;
+		}
+		public void setUserMobile(String userMobile) {
+			this.userMobile = userMobile;
+		}
+		public String getId() {
+			return id;
+		}
+		public void setId(String id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public String getSource() {
+			return source;
+		}
+		public void setSource(String source) {
+			this.source = source;
+		}
+		public String getMoney() {
+			return money;
+		}
+		public void setMoney(String money) {
+			this.money = money;
+		}
+		public Integer getDurationDay() {
+			return durationDay;
+		}
+		public void setDurationDay(Integer durationDay) {
+			this.durationDay = durationDay;
+		}
+		public String getStarTime() {
+			return starTime;
+		}
+		public void setStarTime(String starTime) {
+			this.starTime = starTime;
+		}
+	
+		
+}

+ 88 - 0
src/main/java/com/goafanti/voucher/bo/JtVoucherListBo.java

@@ -0,0 +1,88 @@
+package com.goafanti.voucher.bo;
+
+public class JtVoucherListBo {
+		private String id;
+		private String name;
+		private String source;
+		private String money;
+		private String durationDay;
+		private String activeState;
+		private String grantingUid;
+		private String limitUse;
+		private String limitProjectId;
+		private Integer isGet;
+		public String getId() {
+			return id;
+		}
+		public void setId(String id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public String getSource() {
+			return source;
+		}
+		public void setSource(String source) {
+			this.source = source;
+		}
+		public String getMoney() {
+			if (this.money != null) {
+				return money.split("\\.")[0];
+			}
+			return money;
+		}
+		public void setMoney(String money) {
+			this.money = money;
+		}
+		public String getDurationDay() {
+			return durationDay;
+		}
+		public void setDurationDay(String durationDay) {
+			this.durationDay = durationDay;
+		}
+		public String getActiveState() {
+			return activeState;
+		}
+		public void setActiveState(String activeState) {
+			this.activeState = activeState;
+		}
+		public String getGrantingUid() {
+			return grantingUid;
+		}
+		public void setGrantingUid(String grantingUid) {
+			this.grantingUid = grantingUid;
+		}
+		public String getLimitUse() {
+			return limitUse;
+		}
+		public void setLimitUse(String limitUse) {
+			this.limitUse = limitUse;
+		}
+		public String getLimitProjectId() {
+			return limitProjectId;
+		}
+		public void setLimitProjectId(String limitProjectId) {
+			this.limitProjectId = limitProjectId;
+		}
+		public Integer getIsGet() {
+			if (this.isGet==null) {
+				return 0;
+			}
+			return isGet;
+		}
+		public void setIsGet(Integer isGet) {
+			this.isGet = isGet;
+		}
+		@Override
+		public String toString() {
+			return "JtVoucherListBo [id=" + id + ", name=" + name + ", source=" + source + ", money=" + money
+					+ ", durationDay=" + durationDay + ", activeState=" + activeState + ", grantingUid=" + grantingUid
+					+ ", limitUse=" + limitUse + ", limitProjectId=" + limitProjectId + ", isGet=" + isGet + "]";
+		}
+		
+		
+}

+ 78 - 0
src/main/java/com/goafanti/voucher/controller/AdminVoucherController.java

@@ -0,0 +1,78 @@
+package com.goafanti.voucher.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.voucher.service.VoucherService;
+
+@RestController
+@RequestMapping(value = "/api/admin/voucher")
+public class AdminVoucherController extends CertifyApiController {
+	 @Resource
+	 private VoucherService		voucherService;
+	
+
+	 
+	 
+	 @RequestMapping(value = "/save" ,method=RequestMethod.POST)
+	 public Result saveVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty())return result;	
+		 result.data(voucherService.saveVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/update" ,method=RequestMethod.POST)
+	 public Result updateVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 /*chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		 if(voucher.getActiveState()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"活动标识","活动标识"));return result;
+	    	}*/
+		 result.data(voucherService.updateVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/delect" ,method=RequestMethod.POST)
+	 public Result delectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.delectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/select" ,method=RequestMethod.GET)
+	 public Result selectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/selectList" ,method=RequestMethod.GET)
+	 public Result selectVoucherList(String name,Integer limitUse,Integer activeState,Integer source,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucherList(name, limitUse, activeState, source,null, pageNo, pageSize));
+		 return result;
+	 }
+	 private Result chack(JtVoucher voucher, Result result) {
+		if(StringUtils.isBlank(voucher.getName())) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));return result;
+	    	}
+		 if(voucher.getSource()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"来源","来源"));return result;
+	    	}
+	    if(voucher.getMoney()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"面额","面额"));return result;
+	    	}
+	    if(voucher.getDurationDay()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"使用期限","使用期限"));return result;
+	    	}
+	    return result;
+	}
+}

+ 87 - 0
src/main/java/com/goafanti/voucher/controller/AdminVoucherDetailController.java

@@ -0,0 +1,87 @@
+package com.goafanti.voucher.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
+
+@RestController
+@RequestMapping(value = "/api/admin/voucherDetail")
+public class AdminVoucherDetailController extends CertifyApiController {
+	
+	 @Resource
+	private VoucherDetailService voucherDetailService;
+
+	 
+	 
+	 @RequestMapping(value = "/save" ,method=RequestMethod.POST)
+	 public Result saveVoucher(JtVoucherDetail voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		 result.data(voucherDetailService.saveVoucherDetail(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/update" ,method=RequestMethod.POST)
+	 public Result updateVoucher(JtVoucherDetail voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		result.data(voucherDetailService.updateVoucherDetail(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/delect" ,method=RequestMethod.POST)
+	 public Result delectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherDetailService.delectVoucherDetail(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/select" ,method=RequestMethod.GET)
+	 public Result selectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherDetailService.selectVoucherDetail(id));
+		 return result;
+	 }
+	
+	 
+	 @RequestMapping(value = "/selectList" ,method=RequestMethod.GET)
+	 public Result selectVoucherDetailList(String name,Integer status,String userMobile,Integer source,
+			 Integer sort,Integer sortType,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherDetailService.selectVoucherDetailList(name, status, userMobile,source,sort, sortType, pageNo, pageSize));
+		 return result;
+	 }
+	 
+
+
+
+	private Result chack(JtVoucherDetail voucher, Result result) {
+		
+		if(StringUtils.isBlank(voucher.getVoucherId())) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"抵用券规则","抵用券规则"));return result;
+	    	}
+		 if(voucher.getUseUid()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"用户","用户"));return result;
+	    	}
+	    
+	    if(voucher.getStatus()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"状态","状态"));return result;
+	    	}
+	    
+    
+	    return result;
+	}
+}

+ 91 - 0
src/main/java/com/goafanti/voucher/controller/UserVoucherController.java

@@ -0,0 +1,91 @@
+package com.goafanti.voucher.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
+
+@RestController
+@RequestMapping(value = "/api/user/voucher")
+public class UserVoucherController extends CertifyApiController {
+	 @Resource
+	 private VoucherService		voucherService;
+	 @Resource
+	 private VoucherDetailService	voucherDetailService;
+	
+
+	 
+	 
+	 @RequestMapping(value = "/save" ,method=RequestMethod.POST)
+	 public Result saveVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty())return result;	
+		 result.data(voucherService.saveVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/update" ,method=RequestMethod.POST)
+	 public Result updateVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 /*chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		 if(voucher.getActiveState()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"活动标识","活动标识"));return result;
+	    	}*/
+		 result.data(voucherService.updateVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/delect" ,method=RequestMethod.POST)
+	 public Result delectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.delectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/select" ,method=RequestMethod.GET)
+	 public Result selectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/selectList" ,method=RequestMethod.GET)
+	 public Result selectVoucherList(String name,Integer limitUse,Integer activeState,Integer source,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucherList(name, limitUse, activeState, source, null,pageNo, pageSize));
+		 return result;
+	 }
+	 @RequestMapping(value = "/selectDetailList" ,method=RequestMethod.GET)
+	 public Result selectVoucherDetailList(String name,Integer status,String userMobile,Integer source,
+			 Integer sort,Integer sortType,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherDetailService.selectVoucherDetailList(name, status, userMobile,source,sort, sortType, pageNo, pageSize));
+		 return result;
+	 }
+	 private Result chack(JtVoucher voucher, Result result) {
+		
+		if(StringUtils.isBlank(voucher.getName())) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));return result;
+	    	}
+		 if(voucher.getSource()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"来源","来源"));return result;
+	    	}
+	    if(voucher.getMoney()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"面额","面额"));return result;
+	    	}
+	    if(voucher.getDurationDay()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"使用期限","使用期限"));return result;
+	    	}
+	    
+    
+	    return result;
+	}
+}

+ 25 - 0
src/main/java/com/goafanti/voucher/service/VoucherDetailService.java

@@ -0,0 +1,25 @@
+package com.goafanti.voucher.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherDetailListBo;
+
+public interface VoucherDetailService {
+	int saveVoucherDetail(JtVoucherDetail voucher);
+	
+	int updateVoucherDetail(JtVoucherDetail voucher);
+	
+	int delectVoucherDetail(String id);
+	
+	JtVoucherDetail selectVoucherDetail(String id);
+	
+	Pagination<JtVoucherDetailListBo> selectVoucherDetailList(String name,Integer limitUse,String userMobile,Integer source,Integer sort,Integer sortType,Integer pageNo,Integer pageSize);
+
+	int saveUserGetVoucher(String uid, String vid);
+
+	List<String> getTokenVoucher();
+	
+	
+}

+ 26 - 0
src/main/java/com/goafanti/voucher/service/VoucherService.java

@@ -0,0 +1,26 @@
+package com.goafanti.voucher.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+
+public interface VoucherService {
+	int saveVoucher(JtVoucher voucher);
+	
+	int updateVoucher(JtVoucher voucher);
+	
+	int delectVoucher(String id);
+	
+	JtVoucher selectVoucher(String id);
+	
+	Pagination<JtVoucherListBo> selectVoucherList(String name,Integer limitUse,Integer activeState,Integer source,String uid,Integer pageNo,Integer pageSize);
+	
+	
+	List<String> getSourceVoucher(Integer source);
+
+	List<JtVoucherListBo> selectVoucherByClassify(String name, Integer isHot,Integer size);
+
+	List<JtVoucherListBo> selectActivityVoucher();
+}

+ 97 - 0
src/main/java/com/goafanti/voucher/service/impl/VoucherDetailServiceImpl.java

@@ -0,0 +1,97 @@
+package com.goafanti.voucher.service.impl;
+
+
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.JtVoucherDetailMapper;
+
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.voucher.bo.JtVoucherDetailListBo;
+import com.goafanti.voucher.service.VoucherDetailService;
+@Service
+public class VoucherDetailServiceImpl extends BaseMybatisDao<JtVoucherDetailMapper> implements VoucherDetailService {
+
+	@Autowired
+	JtVoucherDetailMapper jtVoucherDetailMapper;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
+
+	@Override
+	public int saveVoucherDetail(JtVoucherDetail voucher) {
+		return jtVoucherDetailMapper.insertSelective(voucher);
+	}
+
+	@Override
+	public int updateVoucherDetail(JtVoucherDetail voucher) {
+		return jtVoucherDetailMapper.updateByPrimaryKeySelective(voucher);
+	}
+
+	@Override
+	public int delectVoucherDetail(String id) {
+		return jtVoucherDetailMapper.deleteByPrimaryKey(id);
+	}
+
+	@Override
+	public JtVoucherDetail selectVoucherDetail(String id) {
+		return jtVoucherDetailMapper.selectByPrimaryKey(id);
+	}
+
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<JtVoucherDetailListBo> selectVoucherDetailList(String name, Integer status, String userMobile,
+			Integer source,Integer sort,Integer sortType, Integer pageNo, Integer pageSize) {
+		Map<String,Object> params = new HashMap<>();
+		if (pageNo==null||pageNo<1) pageNo=1;
+		if (pageSize==null||pageSize<1) pageSize=10;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (null != status) params.put("status", status);
+		if (null != userMobile) params.put("userMobile", userMobile);
+		if (null != source) params.put("source", source);
+		if (null != sort) params.put("sort", sort);
+		if (null != sortType) params.put("sortType", sortType);
+		if(TokenManager.getToken() instanceof User)params.put("uid", TokenManager.getUserId());
+		//params.put("uid", "a8cd3226-2e6e-43c7-b4b0-1b72bd9cfa41");
+		Pagination<JtVoucherDetailListBo> pagination=	(Pagination<JtVoucherDetailListBo>) findPage("selectVoucherDetailList", "selectVoucherDetailCount",params,
+						pageNo, pageSize);
+		return pagination;
+	}
+
+	@Override
+	public int saveUserGetVoucher(String uid, String vid) {
+		JtVoucherDetail j=new JtVoucherDetail();
+		j.setId(jDBCIdGenerator.generateId().toString());
+		j.setReceiveTime(new Date());
+		j.setVoucherId(vid);
+		j.setUseUid(uid);
+		j.setStatus(0);
+		return  jtVoucherDetailMapper.insertSelective(j);
+	}
+
+	
+	public List<String> getTokenVoucher() {
+		return jtVoucherDetailMapper.getTokenVoucher(TokenManager.getUserId());
+	}
+
+	
+
+	
+}

+ 92 - 0
src/main/java/com/goafanti/voucher/service/impl/VoucherServiceImpl.java

@@ -0,0 +1,92 @@
+package com.goafanti.voucher.service.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.JtVoucherMapper;
+import com.goafanti.common.enums.VoucherSourceType;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.User;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+import com.goafanti.voucher.service.VoucherService;
+@Service
+public class VoucherServiceImpl extends BaseMybatisDao<JtVoucherMapper> implements VoucherService {
+
+	@Autowired
+	JtVoucherMapper jtVoucherMapper;
+	@Override
+	public int saveVoucher(JtVoucher v) {
+		v.setId(UUID.randomUUID().toString());
+		v.setActiveState(1);//活动进行中
+		if (TokenManager.getToken() instanceof User&&TokenManager.getUserId()!=null) {
+			v.setGrantingUid(TokenManager.getUserId());
+		}
+		//v.setGrantingUid("a8cd3226-2e6e-43c7-b4b0-1b72bd9cfa41");
+		return jtVoucherMapper.insertSelective(v);
+	}
+
+	@Override
+	public int updateVoucher(JtVoucher v) {
+		return jtVoucherMapper.updateByPrimaryKeySelective(v);
+	}
+
+	@Override
+	public int delectVoucher(String id) {
+		return jtVoucherMapper.deleteByPrimaryKey(id);
+	}
+
+	@Override
+	public JtVoucher selectVoucher(String id) {
+		return jtVoucherMapper.selectByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<JtVoucherListBo> selectVoucherList(String name, Integer limitUse, Integer activeState, Integer source,
+			String uid,Integer pageNo, Integer pageSize) {
+		Map<String,Object> params = new HashMap<>();
+		if (pageNo==null||pageNo<1) pageNo=1;
+		if (pageSize==null||pageSize<1) pageSize=10;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (null != limitUse) params.put("limitUse", limitUse);
+		if (null != activeState) params.put("activeState", activeState);
+		if (null != source) params.put("source", source);
+		if(uid==null&&TokenManager.getToken() instanceof User)params.put("uid", TokenManager.getUserId());
+		if (StringUtils.isNotBlank(uid))params.put("uid", uid);
+		//params.put("uid", "1");
+		return (Pagination<JtVoucherListBo>) findPage("selectVoucherList", "selectVoucherCount",params,
+				pageNo, pageSize);
+	}
+
+	@Override
+	public List<String> getSourceVoucher(Integer source) {
+		return jtVoucherMapper.getSourceVoucher(source);
+	}
+
+	@Override
+	public List<JtVoucherListBo> selectVoucherByClassify(String name,Integer isHot, Integer size) {
+		List<JtVoucherListBo> list=jtVoucherMapper.selectVoucherByClassify( name,  isHot, size);
+		return list; 
+	}
+
+	@Override
+	public List<JtVoucherListBo> selectActivityVoucher() {
+		List<JtVoucherListBo> list=new ArrayList<JtVoucherListBo>();
+		list.add(jtVoucherMapper.selectByName("承制资格认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("保密资格认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("生产许可认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("高新认定抵用券",1));
+		return list;
+	}
+
+}

+ 2 - 0
src/main/resources/props/config_local.properties

@@ -71,6 +71,8 @@ aesSecretKey=aft1234567890123
 
 mobileCodeTemplate=SMS_37845022
 patentTemplate=SMS_72005286
+examineAdopt=SMS_147971258
+examineNoAdopt=SMS_147971261
 
 easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
 easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA

+ 2 - 0
src/main/resources/props/config_test.properties

@@ -70,6 +70,8 @@ aesSecretKey=aft1234567890123
 
 mobileCodeTemplate=SMS_37845022
 patentTemplate=SMS_72005286
+examineAdopt=SMS_147971258
+examineNoAdopt=SMS_147971261
 
 easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
 easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA

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

@@ -397,45 +397,48 @@
 		<div class="login">
 			<div class="login_mian">
 				<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 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>
+				
+				<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 id="forget">
@@ -455,13 +458,13 @@
 								手机号码:<input type="text" name="type" id="forget_phone" placeholder="请输入您的手机号码..."/>
 							</label>
 						</div>
-						<div class="login_pa">
+					<!-- 	<div class="login_pa">
 							客户类别:
 							<select id="customerTy">
 								<option value="0">个人</option>
 								<option value="1">企业</option>
 							</select>
-						</div>
+						</div> -->
 						<div class="cellcode_">
 							<div>
 								验证码:<input type="text" name="cellCode" placeholder="手机验证码" id="photo_n"/>
@@ -512,6 +515,28 @@
 		<div class="loading">
 			<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:fragment="footer(scripts)">
@@ -584,7 +609,7 @@
 				lvl : /*[[${userData == null} ? null : ${userData.lvl}]]*/''
 			}
 			/*]]>*/
-			
+		
 		</script>
 		<th:block th:replace="${scripts}" />
 		<script language="javascript" src="https://put.zoosnet.net/JS/LsJS.aspx?siteid=PUT70876498&float=1&lng=cn"></script>

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

@@ -25,84 +25,90 @@
     		</div>
     	</div>
     	<div class="facTab">
-    		<span class="facActive">所有项目</span>
+    		<span>所有项目</span>
     		<span>主页</span>
-    		
+    		<span>点我领币</span>
     	</div>
-    	<div class="facFirst">
-    		<div class="jianjie">
-    			<h4>公司简介</h4>
-    			  <p th:text="(${org.introduction}==null or ${org.introduction}=='')?'暂无':${org.introduction}"></p>
-    		</div>
-    		<div class="jianjie">
-    			<h4>业务范围</h4>
-    			<p th:text="(${org.businessScope}==null or${org.businessScope}=='')?'暂无':${org.businessScope}"></p>
-    		</div>
-    		<div class="RecommendTitle">
-	            <h2>荣誉资质</h2>
-	            <span></span>
-	        </div>
-    		<div class="rongyuCont" >
-    			<div th:each="pic:${honors}">
-    				<img  th:src="(${pic}==null or ${pic}=='')?${portalHost+'/img/fac/fea2.png'}:${avatarUploadHost+pic}" alt="" >
-    			</div>
-    			
-    		</div>
-    		<div class="RecommendTitle">
-	            <h2>联系我们</h2>
-	            <span></span>
-	        </div>
-	        <ol class="contantUs">
-	            <li>
-	                <span class="glyphicon glyphicon-earphone"></span>
-	                <div>
-	                    <p>联系方式<span class="pho" th:text="(${org.fixedTel}==null or ${org.fixedTel}=='')?'暂无':${org.fixedTel}"></span></p>
-	                    <p>QQ号码<span class="pho" th:text="(${org.qq}==null or ${org.qq}=='')?'暂无':${org.qq}"></span></p>
-	                </div>
-	            </li>
-	            <li>
-	                <span class="glyphicon glyphicon-envelope"></span>
-	                <div>
-	                    <p>公司邮箱</span></p>
-	                    <p><span th:text="(${org.email}==null or ${org.email}=='')?'暂无':${org.email}">3846252890@qq.com</span> </p>
-	                </div>
-	            </li>
-	            <li>
-	                <span class="glyphicon glyphicon-map-marker"></span>
-	                <div>
-	                    <p>公司地址</span></p>
-	                    <p><span th:text="(${org.postalAddress}==null or ${org.postalAddress}=='')?'暂无':${org.postalAddress}">湖南省长沙市营盘东路</span> </p>
-	                </div>
-	            </li>
-	        </ol>
-    	</div>
-    	<div id="facAll">
-    		<div class="facAll">
-    			
-    		</div>
-    		<div class="pagination_box">
-	            <nav aria-label="Page navigation" class="clearfix">
-	                <ul class="pagination">
-	                    <li class="pagePre">
-	                        <a href="#" aria-label="Previous">
-	                            <span aria-hidden="true">&laquo;</span>
-	                        </a>
-	                    </li>
-	                    <li class="pageNumber"><a href="#" value="1">1</a></li>
-	                    <li class="pageNext">
-	                        <a href="#" aria-label="Next">
-	                            <span aria-hidden="true">&raquo;</span>
-	                        </a>
-	                    </li>
-	                </ul>
-	                <div class="inp">
-	                    <input type="text" class=""><button class="btn btn-default">跳转</button>
-	                </div>
-	                <span class="totalCount">共0条数据</span>
-	            </nav>
-	        </div>
-    	</div>
-    </div>
+    	<div class="facJuan">
+	    	<div class="facFirst">
+	    		<div class="jianjie">
+	    			<h4>公司简介</h4>
+	    			  <p th:text="(${org.introduction}==null or ${org.introduction}=='')?'暂无':${org.introduction}"></p>
+	    		</div>
+	    		<div class="jianjie">
+	    			<h4>业务范围</h4>
+	    			<p th:text="(${org.businessScope}==null or${org.businessScope}=='')?'暂无':${org.businessScope}"></p>
+	    		</div>
+	    		<div class="RecommendTitle">
+		            <h2>荣誉资质</h2>
+		            <span></span>
+		        </div>
+	    		<div class="rongyuCont" >
+	    			<div th:each="pic:${honors}">
+	    				<img  th:src="(${pic}==null or ${pic}=='')?${portalHost+'/img/fac/fea2.png'}:${avatarUploadHost+pic}" alt="" >
+	    			</div>
+	    			
+	    		</div>
+	    		<div class="RecommendTitle">
+		            <h2>联系我们</h2>
+		            <span></span>
+		        </div>
+		        <ol class="contantUs">
+		            <li>
+		                <span class="glyphicon glyphicon-earphone"></span>
+		                <div>
+		                    <p>联系方式<span class="pho" th:text="(${org.fixedTel}==null or ${org.fixedTel}=='')?'暂无':${org.fixedTel}"></span></p>
+		                    <p>QQ号码<span class="pho" th:text="(${org.qq}==null or ${org.qq}=='')?'暂无':${org.qq}"></span></p>
+		                </div>
+		            </li>
+		            <li>
+		                <span class="glyphicon glyphicon-envelope"></span>
+		                <div>
+		                    <p>公司邮箱</span></p>
+		                    <p><span th:text="(${org.email}==null or ${org.email}=='')?'暂无':${org.email}">3846252890@qq.com</span> </p>
+		                </div>
+		            </li>
+		            <li>
+		                <span class="glyphicon glyphicon-map-marker"></span>
+		                <div>
+		                    <p>公司地址</span></p>
+		                    <p><span th:text="(${org.postalAddress}==null or ${org.postalAddress}=='')?'暂无':${org.postalAddress}">湖南省长沙市营盘东路</span> </p>
+		                </div>
+		            </li>
+		        </ol>
+	    	</div>
+	    	<div id="facAll">
+	    		<div class="facAll">
+	    			
+	    		</div>
+	    		<div class="pagination_box">
+		            <nav aria-label="Page navigation" class="clearfix">
+		                <ul class="pagination">
+		                    <li class="pagePre">
+		                        <a href="#" aria-label="Previous">
+		                            <span aria-hidden="true">&laquo;</span>
+		                        </a>
+		                    </li>
+		                    <li class="pageNumber"><a href="#" value="1">1</a></li>
+		                    <li class="pageNext">
+		                        <a href="#" aria-label="Next">
+		                            <span aria-hidden="true">&raquo;</span>
+		                        </a>
+		                    </li>
+		                </ul>
+		                <div class="inp">
+		                    <input type="text" class=""><button class="btn btn-default">跳转</button>
+		                </div>
+		                <span class="totalCount">共0条数据</span>
+		            </nav>
+		        </div>
+	    	</div>
+	    	<div class="listJ">
+              <ul></ul>
+        	</div>
+	    </div>
+	   
+	</div>
     <footer>
       <div th:replace="common::copyright"></div>
 		<div th:replace="common::login"></div>

+ 173 - 0
src/main/webapp/WEB-INF/views/portal/invRegister.html

@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head th:replace="common::header(~{::title},~{::link})">
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>优惠活动</title>
+<link th:href="${portalHost+'/dll/dll.css'}" rel="stylesheet">
+<link th:href="${portalHost+'/vendors.css'}" rel="stylesheet">
+<link th:href="${portalHost+'/newMenu/invRegister.css'}" rel="stylesheet"></head>
+
+<body>
+	<div th:replace="common::nav('','')"></div>
+    <!-- 公共头部结束 -->
+    <div class="continueHighBanner">
+        <a th:href="@{/user/signIn}"><img th:src="${portalHost+'/img/load/invR_banner.png'}" alt=""></a>
+    </div>
+    <div class="container invRegister">
+        <div class="topList">
+            <ul>
+                <li th:each="v:${vouchers}">
+                   <a th:href="@{'/portal/facilitatorDetails?uid='+${v.grantingUid}+'#2'}">
+                   	  
+                       <span th:text="'抵用券有效期:'+${v.durationDay}+'天'">2018.01.10-2018.02.20</span>
+                       <h1><span th:text="${v.money}">> 500</span><sup>枚</sup></h1>
+                       <p  th:text="${v.name}"></p>
+                   </a>    
+                </li>
+            </ul>
+            <a th:href="@{/portal/invitation}">了解活动规则详情 &gt;&gt;</a>
+        </div>   
+        <div class="invTitle">
+            <h2>企业必备</h2>
+        </div>
+        <div class="inVqiY">
+            <div th:each="g:${gqfw}">
+                <h3>2019</h3>
+                <h1 th:text="${g.name}"></h1>
+                <p th:text="${g.advertisement}"></p>
+                <span>¥<span th:text="${g.price}"></span> 万</span><br />
+                <a th:href="@{/portal/service/serviceDetail?(id=${g.id})}">立即办理</a>
+            </div>
+        </div>
+    </div>
+    <div class="invR_gaoQ">
+        <div>
+            <img th:src="${portalHost+'/img/load/invR_55.png'}" alt="">
+        </div>
+    </div>
+    <div class="container">
+        <div class="invTitle">
+            <h2>热门项目</h2>
+        </div>
+        <div class="hot_InvR">
+            <ul>
+                <li  th:each="p:${hotProject}">
+                    <a th:href="@{/portal/service/patentDetail?(id=${p.id})}">
+                        <div>
+                            <p  th:text="${p.name}">一句话营销营销</p>
+                        </div>
+                        <p th:text="${p.advertisement}">一句话营销</p>
+                        <h4><img th:src="${portalHost+'/img/load/invR_RMB2.png'}" alt=""><span th:text="${p.price}">2000</span>万</h4>
+                    </a>
+                </li>
+            </ul>
+        </div>
+        <div class="invTitle">
+            <h2>军民融合</h2>
+        </div>
+    </div>
+    <div class="civilian">
+            <div class="hot_InvR invR_junM container">
+                <ul>
+                    <li th:each="jm:${jmrh}">
+                        <a th:href="@{/portal/service/serviceDetail?(id=${jm.id})}">
+                            <div>
+                                <p th:text="${jm.name}">武器装备科研生产保密资格认证</p>
+                            </div>
+                            <p th:text="${jm.advertisement}">一句话营销</p>
+                            <h4><img th:src="${portalHost+'/img/load/invR_RMB2.png'}" alt=""><span th:text="${jm.price}">2000</span>万</h4>
+                        </a>
+                    </li>
+                </ul>
+        </div>
+    </div>
+    <div class="container">
+        <div class="invTitle">
+            <h2>知识产权</h2>
+        </div>
+        <div class="hot_InvR">
+            <ul>
+                <li th:each="zs:${zscq}">
+                    <a th:href="@{/portal/service/patentDetail?(id=${zs.id})}">
+                        <div>
+                            <p th:text="${zs.name}">一句话营销营销</p>
+                        </div>
+                        <p th:text="${zs.advertisement}">一句话营销</p>
+                       <h4><img th:src="${portalHost+'/img/load/invR_RMB2.png'}" alt=""><span th:text="${zs.price}">2000</span>万</h4>
+                    </a>
+                </li>
+            </ul>
+        </div>
+        <div class="invTitle invRFuC">
+            <h2>政府扶持</h2>
+        </div>
+    </div>
+    <div class="FcList_wrap">
+        <div class="FcList">
+            <ul>
+                <li th:each="zf:${zffc}">
+                     <a th:href="@{/portal/service/serviceDetail?(id=${zf.id})}">
+                        <p th:text="${zf.name}">一句话营销营销</p>
+                        <div>
+                        <span th:text="${zf.advertisement}">一句话营销</span>
+                       <h4> <img th:src="${portalHost+'/img/load/invR_rmb.png'}" alt=""><span th:text="${zf.price}">2000</span>万</h4>
+                       </div>
+                    </a>
+                </li>
+            </ul>
+        </div>
+    </div>
+    <div class="serviceW">
+        <p>我们的服务网点:</p>
+        <ul>
+            <li>北京</li>
+            <li>石家庄</li>
+            <li>郑州</li>
+            <li>济南</li>
+            <li>沈阳</li>
+            <li>大连</li>
+            <li>长春</li>
+            <li>内蒙古</li>
+            <li>南京</li>
+            <li>合肥</li>
+            <li>武汉</li>
+            <li>湖南</li>
+            <li>南昌</li>
+            <li>成都</li>
+            <li>贵州</li>
+            <li>昆明</li>
+            <li>广西</li>
+            <li>广州</li>
+            <li>福州</li>
+            <li>西藏</li>
+        </ul> 
+    </div>
+    <div class="advantage">
+        <div class="advantageTxt">
+            <p>我们的优势:</p>
+            <ul>
+                <li>A、17年信誉保证 历史通过率高达96.8%</li>
+                <li>B、全程一对一专人对接跟踪服务</li>
+                <li>C、未通过,可免费重新申请或退款</li>
+            </ul>
+        </div>
+    </div>
+    <div class="consultation">
+        <a onclick="openZoosUrl('chatwin');">立即咨询</a>
+    </div>
+    
+		<footer>
+		<div th:replace="common::copyright"></div>
+		<div th:replace="common::login"></div>
+	</footer>
+	<div th:replace="common::footer(~{::script})">
+<script type="text/javascript" th:src="${portalHost+'/dll/dll.js'}"></script>
+<script type="text/javascript" th:src="${portalHost+'/vendors.js'}"></script>
+<script type="text/javascript" th:src="${portalHost+'/newMenu/invRegister.js'}"></script>
+</div>
+</body>
+</html>

File diff suppressed because it is too large
+ 74 - 0
src/main/webapp/WEB-INF/views/portal/invitation.html


+ 60 - 63
src/main/webapp/WEB-INF/views/user/signIn.html

@@ -4,7 +4,7 @@
 <head th:replace="common::header(~{::title},~{::link})">
 	<title>注册页</title>
 	<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">
 </head>
 <body>
@@ -14,70 +14,67 @@
 	<!--主体内容区域开始-->
   	  	<!--主体内容区域开始-->
   	<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="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 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 class="shadow">
-					<img th:src="${portalHost+'/img/shadow7.png'}" alt=""/>
-				</div>
-			</form>
-		</div>
-  	</div>
+				
+			</div>
+		</form>
+	</div>
+</div>
   	<div class="login_">
 		<div class="login_main_">
 			<h3 class="title_">免责声明 DISCLAIMER</h3>
@@ -141,7 +138,7 @@
 	</footer>
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${portalHost+'/vendors.js'}"></script>
-		<script type="text/javascript" th:src="${staticHost+'/dll/dll.js'}"></script>
+		<script type="text/javascript" th:src="${portalHost+'/dll/dll.js'}"></script>
 		<script type="text/javascript" th:src="${portalHost+'/register.js'}"></script>
 	</div>
 </body>