Browse Source

1.认证资料下载权限控制
2.客户端专利申请接口、客户端专利详情接口、用户端专利列表接口

Antiloveg 9 years ago
parent
commit
c57b0bdfd9
27 changed files with 1440 additions and 46 deletions
  1. 10 0
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  2. 73 19
      src/main/java/com/goafanti/common/controller/PublicController.java
  3. 25 0
      src/main/java/com/goafanti/common/controller/WebpageController.java
  4. 32 0
      src/main/java/com/goafanti/common/dao/PatentInfoMapper.java
  5. 3 0
      src/main/java/com/goafanti/common/dao/UserMapper.java
  6. 15 4
      src/main/java/com/goafanti/common/mapper/OrganizationInfoMapper.xml
  7. 404 0
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  8. 19 1
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  9. 15 0
      src/main/java/com/goafanti/common/model/OrganizationInfo.java
  10. 379 0
      src/main/java/com/goafanti/common/model/PatentInfo.java
  11. 6 6
      src/main/java/com/goafanti/common/utils/TimeUtils.java
  12. 4 0
      src/main/java/com/goafanti/common/utils/VerifyCodeUtils.java
  13. 95 0
      src/main/java/com/goafanti/techservice/patent/controller/PatentApiController.java
  14. 19 0
      src/main/java/com/goafanti/techservice/patent/service/PatentInfoService.java
  15. 86 0
      src/main/java/com/goafanti/techservice/patent/service/impl/PatentInfoServiceImpl.java
  16. 62 0
      src/main/java/com/goafanti/user/bo/UserDownLoadBo.java
  17. 83 9
      src/main/java/com/goafanti/user/controller/UserApiController.java
  18. 41 1
      src/main/java/com/goafanti/user/controller/UserLoginController.java
  19. 2 3
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  20. 3 0
      src/main/java/com/goafanti/user/service/UserService.java
  21. 6 0
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  22. 11 0
      src/main/webapp/WEB-INF/views/admin/index.jsp
  23. 11 0
      src/main/webapp/WEB-INF/views/admin/login.jsp
  24. 11 0
      src/main/webapp/WEB-INF/views/admin/servicesManage/patent.jsp
  25. 11 0
      src/main/webapp/WEB-INF/views/admin/userManage.jsp
  26. 3 3
      src/main/webapp/WEB-INF/views/index.jsp
  27. 11 0
      src/main/webapp/WEB-INF/views/user/account/services.jsp

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

@@ -43,5 +43,15 @@ public class ErrorConstants {
 	public static final String MCODE_ERROR = "MCODE_ERROR";
 	
 	public static final String MCODE_OVERTIME_ERROR = "MCODE_OVERTIME_ERROR";
+	
+	public static final String NON_REGISTER = "NON_REGISTER";
+	
+	public static final String RESET_CODE_ERROR = "RESET_CODE_ERROR";
+	
+	public static final String RESET_CODE_OVERTIME = "RESET_CODE_OVERTIME";
+	
+	public static final String FILE_NON_EXISTENT = "FILE_NON_EXISTENT";
+	
+	public static final String INSUFFICIENT_AUTHORITY_ERROR ="INSUFFICIENT_AUTHORITY_ERROR";
 
 }

+ 73 - 19
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -2,18 +2,15 @@ package com.goafanti.common.controller;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
+import java.util.UUID;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.junit.Test;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;
@@ -32,9 +29,10 @@ import com.aliyuncs.sms.model.v20160927.SingleSendSmsResponse;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.user.bo.UserDownLoadBo;
+import com.goafanti.user.service.UserService;
 
 @Controller
 @Scope(value = "prototype")
@@ -54,6 +52,9 @@ public class PublicController extends BaseController {
 
 	@Value(value = "${static.host}")
 	private String	staticHost			= null;
+	
+	@Resource
+	private UserService						userService;
 
 	/**
 	 * 获取验证码
@@ -83,14 +84,33 @@ public class PublicController extends BaseController {
 
 	/**
 	 * 手机验证码
-	 * 
 	 * @param mobile
+	 * @param sign  是否用与找回密码
+	 * @param type
+	 * @return
 	 */
 	@RequestMapping(value = "/getMCode", method = RequestMethod.GET)
 	@ResponseBody
-	public Result getMcode(String mobile) {
+	public Result getMcode(String mobile ,boolean sign,Integer type) {
 		Result res = new Result();
-		if (TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME) == null
+		if(sign){
+			if(null == userService.selectByMobieAndType(mobile, type)){
+				res.getError().add(buildError(ErrorConstants.NON_REGISTER, "该用户未注册!"));
+				return res;
+			}
+		}
+		TokenManager.setVal2Session(VerifyCodeUtils.M_CODE, "123");
+		TokenManager.setVal2Session(VerifyCodeUtils.M_CODE_TIME, System.currentTimeMillis());
+		System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
+		if(res.getError().isEmpty() && sign){
+			String resetCode = UUID.randomUUID().toString();
+			System.out.println(resetCode);
+			TokenManager.setVal2Session(VerifyCodeUtils.RESET_CODE, resetCode);
+			TokenManager.setVal2Session(VerifyCodeUtils.RESET_CODE_TIME, System.currentTimeMillis());
+			res.setData(resetCode);
+		}
+		return res;
+		/*if (TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME) == null
 				|| TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME) == "") {
 			sendMessage(mobile, res);
 		} else if (TimeUtils.checkOverTime("getMCode")) {
@@ -100,7 +120,15 @@ public class PublicController extends BaseController {
 		} else {
 			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码发送频繁"));
 		}
-		return res;
+		
+		//resetCode
+		if(res.getError().isEmpty() && sign){
+			String resetCode = UUID.randomUUID().toString();
+			TokenManager.setVal2Session(VerifyCodeUtils.RESET_CODE, resetCode);
+			TokenManager.setVal2Session(VerifyCodeUtils.RESET_CODE_TIME, System.currentTimeMillis());
+			res.setData(resetCode);
+		}
+		return res;*/
 	}
 
 	/**
@@ -114,7 +142,6 @@ public class PublicController extends BaseController {
 		String mobileVerifyCode = VerifyCodeUtils.generateMobileVerifyCode(6);
 		// 存入Shiro会话session
 		TokenManager.setVal2Session(VerifyCodeUtils.M_CODE, mobileVerifyCode);
-		System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
 		TokenManager.setVal2Session(VerifyCodeUtils.M_CODE_TIME, System.currentTimeMillis());
 		IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKey, accessSecret);
 		try {
@@ -141,27 +168,39 @@ public class PublicController extends BaseController {
 		}
 		return res;
 	}
-
+     
+	/**
+	 * 下载图片
+	 * @param response
+	 * @param path
+	 * @param request
+	 */
 	@RequestMapping(value = "/downLoadPicture", method = RequestMethod.GET)
-	public void downLoadPicture(HttpServletResponse response, String path, HttpServletRequest request
-			) {
-		//String filename = (path.split("/")[(path.split("/").length - 1)]);
+	public Result downLoadPicture(HttpServletResponse response, String path, HttpServletRequest request){
+		Result res = new Result();
+		if(path == "" || path == null){
+			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
+			return res;
+		}
 		String filename =Long.toString(System.nanoTime())+".jpg"; 
 		InputStream in = null;
 		OutputStream out = null;
 		byte[] buffer = new byte[8 * 1024];
 		String fileSaveRootPath = "";
 		//下载权限判断
-		
+		UserDownLoadBo u = userService.selectUserDownLoadBoByUserId(TokenManager.getUserId());
+		if(!path.equals(u.getDegreeDiplomaUrl())&&!path.equals(u.getDiplomaUrl())&&
+		   !path.equals(u.getOppositeIdUrl())&&!path.equals(u.getPositiveIdUrl())&&
+		   !path.equals(u.getProfessionalCertificateUrl())&&!path.equals(u.getQualificationCertificateUrl())){
+			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "权限不足,无法下载!"));	
+			return res;
+		}
 		try {
 				fileSaveRootPath = uploadPrivatePath + path;
 				File file = new File(fileSaveRootPath);
 				in = new FileInputStream(file);
 			out = response.getOutputStream();
 			// 设置文件MIME类型
-		    //response.setContentType("multipart/form-data");
-			//response.setContentType("application/x-msdownload");
-			//response.setContentType("application/x-jpg");
 			response.setContentType("application/octet-stream");
 			response.setHeader("Content-Disposition", "attachment; filename=" + filename);
 			for (;;) {
@@ -185,11 +224,18 @@ public class PublicController extends BaseController {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
 			}
 		}
+		return res;
 	}
 	
+	/**
+	 * 删除图片文件(public图片)
+	 * @param path
+	 * @return
+	 */
 	@RequestMapping(value = "/deleteUploadPicture", method = RequestMethod.POST)
 	public boolean deleteUploadPicture(String path){
 		boolean flag = false;  
+		path = uploadPath+path;
 	   File file = new File(path);  
 	    // 判断目录或文件是否存在  
 	    if (!file.exists()||!file.isFile()) {  // 不存在返回 false  
@@ -199,5 +245,13 @@ public class PublicController extends BaseController {
 	    }  
 	}
 	
+	@RequestMapping(value = "/test", method = RequestMethod.POST)
+	@ResponseBody
+	public Result test(){
+		Result res = new Result();
+		res.setData(UUID.randomUUID().toString());
+		return res;
+	}
+	
 
 }

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

@@ -34,5 +34,30 @@ public class WebpageController extends BaseController {
 	public String userSignin(HttpServletRequest request, ModelAndView modelview) {
 		return "/user/signIn";
 	}
+	
+	@RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
+	public String userServices(HttpServletRequest request, ModelAndView modelview) {
+		return "/user/account/services";
+	}
+	
+	@RequestMapping(value = "/admin/index", method = RequestMethod.GET)
+	public String adminHome(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/index";
+	}
+	
+	@RequestMapping(value = "/admin/login", method = RequestMethod.GET)
+	public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/login";
+	}
+	
+	@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
+	public String adminUserManage(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/userManage";
+	}
+	
+	@RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
+	public String adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/servicesManage/patent";
+	}
 
 }

+ 32 - 0
src/main/java/com/goafanti/common/dao/PatentInfoMapper.java

@@ -0,0 +1,32 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.goafanti.common.model.PatentInfo;
+
+
+public interface PatentInfoMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(PatentInfo record);
+
+    int insertSelective(PatentInfo record);
+
+    PatentInfo selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(PatentInfo record);
+
+    int updateByPrimaryKeyWithBLOBs(PatentInfo record);
+
+    int updateByPrimaryKey(PatentInfo record);
+    
+    
+    
+
+	PatentInfo selectPatentInfoByUserId(String uid);
+	
+    List<PatentInfo> findClientApplyListByPage(Map<String, Object> params);
+	
+	int findClentApplyCount(Map<String, Object> params);
+}

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

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserInfo;
+import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserPageHomeBo;
 
 
@@ -21,4 +22,6 @@ public interface UserMapper {
 	User selectByMobieAndType(java.lang.String mobile, Integer type);
 
 	UserPageHomeBo selectUserPageHomeBoByUserId(String uid);
+
+	UserDownLoadBo selectUserDownLoadBoByUserId(String id);
 }

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

@@ -15,11 +15,12 @@
     <result column="home_unit" property="homeUnit" jdbcType="VARCHAR" />
     <result column="logo_url" property="logoUrl" jdbcType="VARCHAR" />
     <result column="publicity_picture_url" property="publicityPictureUrl" jdbcType="VARCHAR" />
+    <result column="number" property="number" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     id, uid, identity_type, company_name, legal_person,location_province, location_city,location_area,
     unit_size, company_introduction, 
-    home_unit,  logo_url, publicity_picture_url
+    home_unit,  logo_url, publicity_picture_url,number
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -36,13 +37,13 @@
       company_name, legal_person,location_province, location_city,location_area,
       unit_size, 
       company_introduction, home_unit,  
-      logo_url, publicity_picture_url)
+      logo_url, publicity_picture_url,number)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{identityType,jdbcType=VARCHAR}, 
       #{companyName,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
       #{locationProvince,jdbcType=VARCHAR}, #{locationCity,jdbcType=VARCHAR}, #{locationArea,jdbcType=VARCHAR}, 
       #{unitSize,jdbcType=VARCHAR}, 
       #{companyIntroduction,jdbcType=VARCHAR}, #{homeUnit,jdbcType=VARCHAR},  
-      #{logoUrl,jdbcType=VARCHAR}, #{publicityPictureUrl,jdbcType=VARCHAR})
+      #{logoUrl,jdbcType=VARCHAR}, #{publicityPictureUrl,jdbcType=VARCHAR},#{number,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationInfo" >
     insert into organization_info
@@ -86,6 +87,9 @@
       <if test="publicityPictureUrl != null" >
        publicity_picture_url,
       </if>
+      <if test="number != null" >
+      number,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -127,6 +131,9 @@
       <if test="publicityPictureUrl != null" >
         #{publicityPictureUrl,jdbcType=VARCHAR},
       </if>
+      <if test="number != null" >
+        #{number,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationInfo" >
@@ -168,6 +175,9 @@
       <if test="publicityPictureUrl != null" >
        publicity_picture_url = #{publicityPictureUrl,jdbcType=VARCHAR},
       </if>
+       <if test="number != null" >
+       number = #{number,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -184,7 +194,8 @@
       company_introduction = #{companyIntroduction,jdbcType=VARCHAR},
       home_unit = #{homeUnit,jdbcType=VARCHAR},
       logo_url = #{logoUrl,jdbcType=VARCHAR},
-      publicity_picture_url = #{publicityPictureUrl,jdbcType=VARCHAR}
+      publicity_picture_url = #{publicityPictureUrl,jdbcType=VARCHAR},
+      number = #{number,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   

+ 404 - 0
src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml

@@ -0,0 +1,404 @@
+<?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.PatentInfoMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentInfo" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="uid" property="uid" jdbcType="VARCHAR" />
+    <result column="serial_number" property="serialNumber" jdbcType="VARCHAR" />
+    <result column="patent_number" property="patentNumber" jdbcType="VARCHAR" />
+    <result column="patent_name" property="patentName" jdbcType="VARCHAR" />
+    <result column="patent_catagory" property="patentCatagory" jdbcType="INTEGER" />
+    <result column="patent_state" property="patentState" jdbcType="INTEGER" />
+    <result column="patent_field" property="patentField" jdbcType="INTEGER" />
+    <result column="patent_prory_statement_url" property="patentProryStatementUrl" jdbcType="VARCHAR" />
+    <result column="patent_writing_url" property="patentWritingUrl" jdbcType="VARCHAR" />
+    <result column="authorization_notice_url" property="authorizationNoticeUrl" jdbcType="VARCHAR" />
+    <result column="patent_certificate_url" property="patentCertificateUrl" jdbcType="VARCHAR" />
+    <result column="patent_application_date" property="patentApplicationDate" jdbcType="TIMESTAMP" />
+    <result column="first_inventor_name" property="firstInventorName" jdbcType="VARCHAR" />
+    <result column="first_inventor_nationality" property="firstInventorNationality" jdbcType="VARCHAR" />
+    <result column="first_inventor_id_number" property="firstInventorIdNumber" jdbcType="VARCHAR" />
+    <result column="first_inventor_is_publish" property="firstInventorIsPublish" jdbcType="INTEGER" />
+    <result column="second_inventor_name" property="secondInventorName" jdbcType="VARCHAR" />
+    <result column="second_inventor_nationality" property="secondInventorNationality" jdbcType="VARCHAR" />
+    <result column="second_inventor_is_publish" property="secondInventorIsPublish" jdbcType="INTEGER" />
+    <result column="third_inventor_name" property="thirdInventorName" jdbcType="VARCHAR" />
+    <result column="third_inventor_nationality" property="thirdInventorNationality" jdbcType="VARCHAR" />
+    <result column="third_inventor_is_publish" property="thirdInventorIsPublish" jdbcType="INTEGER" />
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="author" property="author" jdbcType="VARCHAR" />
+    <result column="office" property="office" jdbcType="VARCHAR" />
+    <result column="principal" property="principal" jdbcType="VARCHAR" />
+    <result column="authorized_date" property="authorizedDate" jdbcType="TIMESTAMP"/>
+    <result column="patent_des" property="patentDes" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, uid, serial_number, patent_number, patent_name, patent_catagory, patent_state, 
+    patent_field, patent_prory_statement_url, patent_writing_url, authorization_notice_url, 
+    patent_certificate_url, patent_application_date, first_inventor_name, first_inventor_nationality, 
+    first_inventor_id_number, first_inventor_is_publish, second_inventor_name, second_inventor_nationality, 
+    second_inventor_is_publish, third_inventor_name, third_inventor_nationality, third_inventor_is_publish, 
+    create_time, author, office, principal, authorized_date , patent_des
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from patent_info
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from patent_info
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.PatentInfo" >
+    insert into patent_info (id, uid, serial_number, 
+      patent_number, patent_name, patent_catagory, 
+      patent_state, patent_field, patent_prory_statement_url, 
+      patent_writing_url, authorization_notice_url, 
+      patent_certificate_url, patent_application_date, 
+      first_inventor_name, first_inventor_nationality, 
+      first_inventor_id_number, first_inventor_is_publish, 
+      second_inventor_name, second_inventor_nationality, 
+      second_inventor_is_publish, third_inventor_name, 
+      third_inventor_nationality, third_inventor_is_publish, 
+      create_time, author, office, 
+      principal, authorized_date,patent_des)
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, 
+      #{patentNumber,jdbcType=VARCHAR}, #{patentName,jdbcType=VARCHAR}, #{patentCatagory,jdbcType=INTEGER}, 
+      #{patentState,jdbcType=INTEGER}, #{patentField,jdbcType=INTEGER}, #{patentProryStatementUrl,jdbcType=VARCHAR}, 
+      #{patentWritingUrl,jdbcType=VARCHAR}, #{authorizationNoticeUrl,jdbcType=VARCHAR}, 
+      #{patentCertificateUrl,jdbcType=VARCHAR}, #{patentApplicationDate,jdbcType=TIMESTAMP}, 
+      #{firstInventorName,jdbcType=VARCHAR}, #{firstInventorNationality,jdbcType=VARCHAR}, 
+      #{firstInventorIdNumber,jdbcType=VARCHAR}, #{firstInventorIsPublish,jdbcType=INTEGER}, 
+      #{secondInventorName,jdbcType=VARCHAR}, #{secondInventorNationality,jdbcType=VARCHAR}, 
+      #{secondInventorIsPublish,jdbcType=INTEGER}, #{thirdInventorName,jdbcType=VARCHAR}, 
+      #{thirdInventorNationality,jdbcType=VARCHAR}, #{thirdInventorIsPublish,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{author,jdbcType=VARCHAR}, #{office,jdbcType=VARCHAR}, 
+      #{principal,jdbcType=VARCHAR}, #{authorizedDate,jdbcType=TIMESTAMP},#{patentDes,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentInfo" >
+    insert into patent_info
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="uid != null" >
+        uid,
+      </if>
+      <if test="serialNumber != null" >
+        serial_number,
+      </if>
+      <if test="patentNumber != null" >
+        patent_number,
+      </if>
+      <if test="patentName != null" >
+        patent_name,
+      </if>
+      <if test="patentCatagory != null" >
+        patent_catagory,
+      </if>
+      <if test="patentState != null" >
+        patent_state,
+      </if>
+      <if test="patentField != null" >
+        patent_field,
+      </if>
+      <if test="patentProryStatementUrl != null" >
+        patent_prory_statement_url,
+      </if>
+      <if test="patentWritingUrl != null" >
+        patent_writing_url,
+      </if>
+      <if test="authorizationNoticeUrl != null" >
+        authorization_notice_url,
+      </if>
+      <if test="patentCertificateUrl != null" >
+        patent_certificate_url,
+      </if>
+      <if test="patentApplicationDate != null" >
+        patent_application_date,
+      </if>
+      <if test="firstInventorName != null" >
+        first_inventor_name,
+      </if>
+      <if test="firstInventorNationality != null" >
+        first_inventor_nationality,
+      </if>
+      <if test="firstInventorIdNumber != null" >
+        first_inventor_id_number,
+      </if>
+      <if test="firstInventorIsPublish != null" >
+        first_inventor_is_publish,
+      </if>
+      <if test="secondInventorName != null" >
+        second_inventor_name,
+      </if>
+      <if test="secondInventorNationality != null" >
+        second_inventor_nationality,
+      </if>
+      <if test="secondInventorIsPublish != null" >
+        second_inventor_is_publish,
+      </if>
+      <if test="thirdInventorName != null" >
+        third_inventor_name,
+      </if>
+      <if test="thirdInventorNationality != null" >
+        third_inventor_nationality,
+      </if>
+      <if test="thirdInventorIsPublish != null" >
+        third_inventor_is_publish,
+      </if>
+      <if test="createTime != null" >
+        create_time,
+      </if>
+      <if test="author != null" >
+        author,
+      </if>
+      <if test="office != null" >
+        office,
+      </if>
+      <if test="principal != null" >
+        principal,
+      </if>
+      <if test="authorizedDate != null" >
+        authorized_date,
+      </if>
+      <if test="patentDes != null" >
+        patent_des,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null" >
+        #{serialNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="patentNumber != null" >
+        #{patentNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="patentName != null" >
+        #{patentName,jdbcType=VARCHAR},
+      </if>
+      <if test="patentCatagory != null" >
+        #{patentCatagory,jdbcType=INTEGER},
+      </if>
+      <if test="patentState != null" >
+        #{patentState,jdbcType=INTEGER},
+      </if>
+      <if test="patentField != null" >
+        #{patentField,jdbcType=INTEGER},
+      </if>
+      <if test="patentProryStatementUrl != null" >
+        #{patentProryStatementUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentWritingUrl != null" >
+        #{patentWritingUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="authorizationNoticeUrl != null" >
+        #{authorizationNoticeUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentCertificateUrl != null" >
+        #{patentCertificateUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentApplicationDate != null" >
+        #{patentApplicationDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="firstInventorName != null" >
+        #{firstInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorNationality != null" >
+        #{firstInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorIdNumber != null" >
+        #{firstInventorIdNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorIsPublish != null" >
+        #{firstInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="secondInventorName != null" >
+        #{secondInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="secondInventorNationality != null" >
+        #{secondInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="secondInventorIsPublish != null" >
+        #{secondInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="thirdInventorName != null" >
+        #{thirdInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="thirdInventorNationality != null" >
+        #{thirdInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="thirdInventorIsPublish != null" >
+        #{thirdInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="author != null" >
+        #{author,jdbcType=VARCHAR},
+      </if>
+      <if test="office != null" >
+        #{office,jdbcType=VARCHAR},
+      </if>
+      <if test="principal != null" >
+        #{principal,jdbcType=VARCHAR},
+      </if>
+       <if test="authorizedDate != null" >
+        #{authorizedDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="patentDes != null" >
+        #{patentDes,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentInfo" >
+    update patent_info
+    <set >
+      <if test="uid != null" >
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null" >
+        serial_number = #{serialNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="patentNumber != null" >
+        patent_number = #{patentNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="patentName != null" >
+        patent_name = #{patentName,jdbcType=VARCHAR},
+      </if>
+      <if test="patentCatagory != null" >
+        patent_catagory = #{patentCatagory,jdbcType=INTEGER},
+      </if>
+      <if test="patentState != null" >
+        patent_state = #{patentState,jdbcType=INTEGER},
+      </if>
+      <if test="patentField != null" >
+        patent_field = #{patentField,jdbcType=INTEGER},
+      </if>
+      <if test="patentProryStatementUrl != null" >
+        patent_prory_statement_url = #{patentProryStatementUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentWritingUrl != null" >
+        patent_writing_url = #{patentWritingUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="authorizationNoticeUrl != null" >
+        authorization_notice_url = #{authorizationNoticeUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentCertificateUrl != null" >
+        patent_certificate_url = #{patentCertificateUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="patentApplicationDate != null" >
+        patent_application_date = #{patentApplicationDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="firstInventorName != null" >
+        first_inventor_name = #{firstInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorNationality != null" >
+        first_inventor_nationality = #{firstInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorIdNumber != null" >
+        first_inventor_id_number = #{firstInventorIdNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="firstInventorIsPublish != null" >
+        first_inventor_is_publish = #{firstInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="secondInventorName != null" >
+        second_inventor_name = #{secondInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="secondInventorNationality != null" >
+        second_inventor_nationality = #{secondInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="secondInventorIsPublish != null" >
+        second_inventor_is_publish = #{secondInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="thirdInventorName != null" >
+        third_inventor_name = #{thirdInventorName,jdbcType=VARCHAR},
+      </if>
+      <if test="thirdInventorNationality != null" >
+        third_inventor_nationality = #{thirdInventorNationality,jdbcType=VARCHAR},
+      </if>
+      <if test="thirdInventorIsPublish != null" >
+        third_inventor_is_publish = #{thirdInventorIsPublish,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="author != null" >
+        author = #{author,jdbcType=VARCHAR},
+      </if>
+      <if test="office != null" >
+        office = #{office,jdbcType=VARCHAR},
+      </if>
+      <if test="principal != null" >
+        principal = #{principal,jdbcType=VARCHAR},
+      </if>
+       <if test="authorizedDate != null" >
+        authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="patentDes != null" >
+        patent_des = #{patentDes,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentInfo" >
+    update patent_info
+    set uid = #{uid,jdbcType=VARCHAR},
+      serial_number = #{serialNumber,jdbcType=VARCHAR},
+      patent_number = #{patentNumber,jdbcType=VARCHAR},
+      patent_name = #{patentName,jdbcType=VARCHAR},
+      patent_catagory = #{patentCatagory,jdbcType=INTEGER},
+      patent_state = #{patentState,jdbcType=INTEGER},
+      patent_field = #{patentField,jdbcType=INTEGER},
+      patent_prory_statement_url = #{patentProryStatementUrl,jdbcType=VARCHAR},
+      patent_writing_url = #{patentWritingUrl,jdbcType=VARCHAR},
+      authorization_notice_url = #{authorizationNoticeUrl,jdbcType=VARCHAR},
+      patent_certificate_url = #{patentCertificateUrl,jdbcType=VARCHAR},
+      patent_application_date = #{patentApplicationDate,jdbcType=TIMESTAMP},
+      first_inventor_name = #{firstInventorName,jdbcType=VARCHAR},
+      first_inventor_nationality = #{firstInventorNationality,jdbcType=VARCHAR},
+      first_inventor_id_number = #{firstInventorIdNumber,jdbcType=VARCHAR},
+      first_inventor_is_publish = #{firstInventorIsPublish,jdbcType=INTEGER},
+      second_inventor_name = #{secondInventorName,jdbcType=VARCHAR},
+      second_inventor_nationality = #{secondInventorNationality,jdbcType=VARCHAR},
+      second_inventor_is_publish = #{secondInventorIsPublish,jdbcType=INTEGER},
+      third_inventor_name = #{thirdInventorName,jdbcType=VARCHAR},
+      third_inventor_nationality = #{thirdInventorNationality,jdbcType=VARCHAR},
+      third_inventor_is_publish = #{thirdInventorIsPublish,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      author = #{author,jdbcType=VARCHAR},
+      office = #{office,jdbcType=VARCHAR},
+      principal = #{principal,jdbcType=VARCHAR},
+      authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
+      patent_des = #{patentDes,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  
+  <select id="selectPatentInfoByUserId" parameterType="java.lang.String" resultType="BaseResultMap">
+    select 
+      <include refid="Base_Column_List" />
+      from patent_info
+    where uid = #{uid,jdbcType=VARCHAR}
+  </select>
+  
+   <select id="findClientApplyListByPage" resultMap="BaseResultMap" >
+ 	select
+    <include refid="Base_Column_List" />
+    from patent_info
+    <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findClentApplyCount" resultType="java.lang.Integer">
+ 	select count(1)
+    from patent_info
+  </select>
+</mapper>

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

@@ -24,6 +24,16 @@
     <result column="person_portrait_url" jdbcType="VARCHAR" property="personPortraitUrl"/>
   </resultMap>
   
+  <resultMap type="com.goafanti.user.bo.UserDownLoadBo" id="UserDownLoadBo">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="diploma_url" jdbcType="VARCHAR" property="diplomaUrl"/>
+    <result column="degree_diploma_url" jdbcType="VARCHAR" property="degreeDiplomaUrl"/>
+    <result column="professional_certificate_url" jdbcType="VARCHAR" property="professionalCertificateUrl"/>
+    <result column="qualification_certificate_url" jdbcType="VARCHAR" property="qualificationCertificateUrl"/>
+    <result column="positive_id_url" jdbcType="VARCHAR" property="positiveIdUrl"/>
+    <result column="opposite_id_url" jdbcType="VARCHAR" property="oppositeIdUrl"/>
+  </resultMap>
+  
   
   <sql id="Base_Column_List">
     id, mobile, password, nickname, email, create_time, number, lvl, type
@@ -163,6 +173,14 @@
    on u.id = i.uid where i.uid = #{uid,jdbcType = VARCHAR}
   </select>
   
-  
+  <select id="selectUserDownLoadBoByUserId" resultMap="UserDownLoadBo" parameterType="java.lang.String">
+  	select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
+	  e.diploma_url, e.degree_diploma_url
+	  from user u 
+		LEFT JOIN user_identity i on u.id = i.uid
+		LEFT JOIN user_career c on u.id = c.uid
+		LEFT JOIN user_edu e on u.id = e.uid 
+	where u.id =#{id,jdbcType=VARCHAR}
+  </select>
   
 </mapper>

+ 15 - 0
src/main/java/com/goafanti/common/model/OrganizationInfo.java

@@ -62,6 +62,11 @@ public class OrganizationInfo {
     * 宣传图片
     */
     private String publicityPictureUrl;
+    
+    /**
+     * 公司编号
+     */
+    private Integer number;
 
     public String getId() {
         return id;
@@ -168,5 +173,15 @@ public class OrganizationInfo {
 		this.publicityPictureUrl = publicityPictureUrl;
 	}
 
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+	
+	
+
     
 }

+ 379 - 0
src/main/java/com/goafanti/common/model/PatentInfo.java

@@ -0,0 +1,379 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class PatentInfo {
+    private String id;
+
+    private String uid;
+
+    /**
+    * 编号
+    */
+    private String serialNumber;
+
+    /**
+    * 申请号/专利号
+    */
+    private String patentNumber;
+
+    /**
+    * 专利名称
+    */
+    private String patentName;
+
+    /**
+    * 专利类型
+    */
+    private Integer patentCatagory;
+
+    /**
+    * 专利状态
+    */
+    private Integer patentState;
+
+    /**
+    * 专利领域
+    */
+    private Integer patentField;
+
+    /**
+    * 专利代理委托书
+    */
+    private String patentProryStatementUrl;
+
+    /**
+    * 专利稿件
+    */
+    private String patentWritingUrl;
+
+    /**
+    * 授权通知书
+    */
+    private String authorizationNoticeUrl;
+
+    /**
+    * 专利证书
+    */
+    private String patentCertificateUrl;
+    
+    
+   /**
+    * 专利申请日(受理日)
+    */
+    private Date patentApplicationDate;
+
+    /**
+    * 第一发明人
+    */
+    private String firstInventorName;
+
+    /**
+    * 第一发明人国籍
+    */
+    private String firstInventorNationality;
+
+    /**
+    * 第一发明人身份证号
+    */
+    private String firstInventorIdNumber;
+
+    /**
+    * 第一发明人是否公布(0--不公布,1--公布)
+    */
+    private Integer firstInventorIsPublish;
+
+    /**
+    * 第二发明人姓名
+    */
+    private String secondInventorName;
+
+    /**
+    * 第二发明人国际
+    */
+    private String secondInventorNationality;
+
+    /**
+    * 第二发明人是否公布(0--不公布,1--公布)
+    */
+    private Integer secondInventorIsPublish;
+
+    /**
+    * 第三发明人姓名
+    */
+    private String thirdInventorName;
+
+    /**
+    * 第三发明人国籍
+    */
+    private String thirdInventorNationality;
+
+    /**
+    * 第三发明人是否公布(0--不公布,1--公布)
+    */
+    private Integer thirdInventorIsPublish;
+
+    /**
+    * 创建时间(派单日)
+    */
+    private Date createTime;
+
+    /**
+    * 撰写人
+    */
+    private String author;
+
+    /**
+    * 事务所
+    */
+    private String office;
+
+    /**
+    * 负责人
+    */
+    private String principal;
+
+    /**
+    * 专利简介
+    */
+    private String patentDes;
+    
+    /**
+     * 授权日
+     */
+    private Date authorizedDate;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getPatentNumber() {
+        return patentNumber;
+    }
+
+    public void setPatentNumber(String patentNumber) {
+        this.patentNumber = patentNumber;
+    }
+
+    public String getPatentName() {
+        return patentName;
+    }
+
+    public void setPatentName(String patentName) {
+        this.patentName = patentName;
+    }
+
+    public Integer getPatentCatagory() {
+        return patentCatagory;
+    }
+
+    public void setPatentCatagory(Integer patentCatagory) {
+        this.patentCatagory = patentCatagory;
+    }
+
+    public Integer getPatentState() {
+        return patentState;
+    }
+
+    public void setPatentState(Integer patentState) {
+        this.patentState = patentState;
+    }
+
+    public Integer getPatentField() {
+        return patentField;
+    }
+
+    public void setPatentField(Integer patentField) {
+        this.patentField = patentField;
+    }
+
+    public String getPatentProryStatementUrl() {
+        return patentProryStatementUrl;
+    }
+
+    public void setPatentProryStatementUrl(String patentProryStatementUrl) {
+        this.patentProryStatementUrl = patentProryStatementUrl;
+    }
+
+    public String getPatentWritingUrl() {
+        return patentWritingUrl;
+    }
+
+    public void setPatentWritingUrl(String patentWritingUrl) {
+        this.patentWritingUrl = patentWritingUrl;
+    }
+
+    public String getAuthorizationNoticeUrl() {
+        return authorizationNoticeUrl;
+    }
+
+    public void setAuthorizationNoticeUrl(String authorizationNoticeUrl) {
+        this.authorizationNoticeUrl = authorizationNoticeUrl;
+    }
+
+    public String getPatentCertificateUrl() {
+        return patentCertificateUrl;
+    }
+
+    public void setPatentCertificateUrl(String patentCertificateUrl) {
+        this.patentCertificateUrl = patentCertificateUrl;
+    }
+
+    public Date getPatentApplicationDate() {
+        return patentApplicationDate;
+    }
+
+    public void setPatentApplicationDate(Date patentApplicationDate) {
+        this.patentApplicationDate = patentApplicationDate;
+    }
+
+    public String getFirstInventorName() {
+        return firstInventorName;
+    }
+
+    public void setFirstInventorName(String firstInventorName) {
+        this.firstInventorName = firstInventorName;
+    }
+
+    public String getFirstInventorNationality() {
+        return firstInventorNationality;
+    }
+
+    public void setFirstInventorNationality(String firstInventorNationality) {
+        this.firstInventorNationality = firstInventorNationality;
+    }
+
+    public String getFirstInventorIdNumber() {
+        return firstInventorIdNumber;
+    }
+
+    public void setFirstInventorIdNumber(String firstInventorIdNumber) {
+        this.firstInventorIdNumber = firstInventorIdNumber;
+    }
+
+    public Integer getFirstInventorIsPublish() {
+        return firstInventorIsPublish;
+    }
+
+    public void setFirstInventorIsPublish(Integer firstInventorIsPublish) {
+        this.firstInventorIsPublish = firstInventorIsPublish;
+    }
+
+    public String getSecondInventorName() {
+        return secondInventorName;
+    }
+
+    public void setSecondInventorName(String secondInventorName) {
+        this.secondInventorName = secondInventorName;
+    }
+
+    public String getSecondInventorNationality() {
+        return secondInventorNationality;
+    }
+
+    public void setSecondInventorNationality(String secondInventorNationality) {
+        this.secondInventorNationality = secondInventorNationality;
+    }
+
+    public Integer getSecondInventorIsPublish() {
+        return secondInventorIsPublish;
+    }
+
+    public void setSecondInventorIsPublish(Integer secondInventorIsPublish) {
+        this.secondInventorIsPublish = secondInventorIsPublish;
+    }
+
+    public String getThirdInventorName() {
+        return thirdInventorName;
+    }
+
+    public void setThirdInventorName(String thirdInventorName) {
+        this.thirdInventorName = thirdInventorName;
+    }
+
+    public String getThirdInventorNationality() {
+        return thirdInventorNationality;
+    }
+
+    public void setThirdInventorNationality(String thirdInventorNationality) {
+        this.thirdInventorNationality = thirdInventorNationality;
+    }
+
+    public Integer getThirdInventorIsPublish() {
+        return thirdInventorIsPublish;
+    }
+
+    public void setThirdInventorIsPublish(Integer thirdInventorIsPublish) {
+        this.thirdInventorIsPublish = thirdInventorIsPublish;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(String author) {
+        this.author = author;
+    }
+
+    public String getOffice() {
+        return office;
+    }
+
+    public void setOffice(String office) {
+        this.office = office;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public void setPrincipal(String principal) {
+        this.principal = principal;
+    }
+
+    public String getPatentDes() {
+        return patentDes;
+    }
+
+    public void setPatentDes(String patentDes) {
+        this.patentDes = patentDes;
+    }
+
+	public Date getAuthorizedDate() {
+		return authorizedDate;
+	}
+
+	public void setAuthorizedDate(Date authorizedDate) {
+		this.authorizedDate = authorizedDate;
+	}
+    
+    
+}

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

@@ -3,21 +3,21 @@ package com.goafanti.common.utils;
 import com.goafanti.core.shiro.token.TokenManager;
 
 public class TimeUtils {
-	//public  static final String NON_OVER_TIME = "NON_OVER_TIME";
-	
-	//public  static final String OVER_TIME = "OVER_TIME";
-	
 	    
           public static  Boolean checkOverTime(String s){
         	  Boolean flag=false;
         	  if("getMCode".equals(s)){
 	        	  if(System.currentTimeMillis()-(Long) TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME)>60000){
-	        		 flag=true;
+	        		 flag = true;
 	        	  }
         	  }else if("register".equals(s)){
         		  if(System.currentTimeMillis()-(Long) TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME)>900000){
- 	        		 flag=true;
+ 	        		 flag = true;
  	        	  }
+        	  }else if("resetCode".equals(s)){
+        		  if(System.currentTimeMillis()-(Long) TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE_TIME)>300000){
+        			  flag = true ;
+        		  }
         	  }
         	  return flag;
           }

+ 4 - 0
src/main/java/com/goafanti/common/utils/VerifyCodeUtils.java

@@ -32,6 +32,10 @@ public class VerifyCodeUtils {
 	//手机验证码生成时间
 	public static final String M_CODE_TIME = "M_CODE_TIME";
 	
+	public static final String RESET_CODE = "RESET_CODE";
+	
+	public static final String RESET_CODE_TIME = "RESET_CODE_TIME";
+	
 	private static Random random = new Random();
 
 	/**

+ 95 - 0
src/main/java/com/goafanti/techservice/patent/controller/PatentApiController.java

@@ -0,0 +1,95 @@
+package com.goafanti.techservice.patent.controller;
+
+import java.util.UUID;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.PatentInfo;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.techservice.patent.service.PatentInfoService;
+
+
+
+@Controller
+@RequestMapping(value = "/techservice/patent")
+public class PatentApiController extends BaseApiController{
+	@Resource
+	private PatentInfoService						patentInfoService;
+	
+	/**
+	 * 用户端专利申请
+	 */
+	@RequestMapping(value="/clientApplyPatent",method=RequestMethod.POST)
+	public Result clientApplyPatent(PatentInfo patentInfo){
+		Result res = new Result();
+		PatentInfo info = patentInfoService.selectPatentInfoByUserId(TokenManager.getUserId());
+		if(null == info){
+			patentInfo.setId(UUID.randomUUID().toString());
+			patentInfo.setUid(TokenManager.getUserId());
+			patentInfoService.insert(patentInfo);
+		}else{
+			patentInfo.setId(info.getId());
+			patentInfoService.updateByPrimaryKeySelective(patentInfo);
+		}
+		res.setData(patentInfo);
+		return res;
+	}
+	
+	/**
+	 * 用户端专利详情
+	 * 
+	 */
+	@RequestMapping(value="/clientPatentInfo",method=RequestMethod.POST)
+	public Result clientPatentInfo(String id){
+		Result res = new Result();
+		res.setData(patentInfoService.selectByPrimaryKey(id));
+		return res;
+	}
+	
+	/**
+	 * 用户端申请专利列表
+	 * @param patentNumber
+	 * @param patentName
+	 * @param patentCatagory
+	 * @param patentState
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	public Result clientApplyList(String patentNumber, String patentName, Integer patentCatagory, Integer patentState,
+			String pageNo, String pageSize){
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 15;
+
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
+		return res;
+	}
+	
+	private Pagination<PatentInfo> getClientApplyList(Result res, String patentNumber, String patentName, Integer parentCatagory, 
+			Integer patentState, Integer pNo, Integer pSize){
+		return (Pagination<PatentInfo>) patentInfoService.getClientApplyList
+				(TokenManager.getUserId(), patentNumber, patentName, parentCatagory, patentState,pNo, pSize);
+	}
+	
+	
+	
+	
+	
+	
+	 
+}

+ 19 - 0
src/main/java/com/goafanti/techservice/patent/service/PatentInfoService.java

@@ -0,0 +1,19 @@
+package com.goafanti.techservice.patent.service;
+
+import com.goafanti.common.model.PatentInfo;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface PatentInfoService {
+
+	PatentInfo selectPatentInfoByUserId(String userId);
+
+	PatentInfo insert(PatentInfo patentInfo);
+
+	int updateByPrimaryKeySelective(PatentInfo patentInfo);
+
+	PatentInfo selectByPrimaryKey(String id);
+
+	Pagination<PatentInfo> getClientApplyList(String userId, String patentNumber, String patentName,
+			Integer parentCatagory, Integer patentState, Integer pNo, Integer pSize);
+
+}

+ 86 - 0
src/main/java/com/goafanti/techservice/patent/service/impl/PatentInfoServiceImpl.java

@@ -0,0 +1,86 @@
+package com.goafanti.techservice.patent.service.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.PatentInfoMapper;
+import com.goafanti.common.model.PatentInfo;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.techservice.patent.service.PatentInfoService;
+
+
+@Service
+public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> implements PatentInfoService {
+	@Autowired
+	PatentInfoMapper patentInfoMapper;
+	
+	
+	@Override
+	public PatentInfo selectPatentInfoByUserId(String uid) {
+		return patentInfoMapper.selectPatentInfoByUserId(uid);
+	}
+
+
+	@Override
+	public PatentInfo insert(PatentInfo patentInfo) {
+		patentInfoMapper.insert(patentInfo);
+		return patentInfo;
+	}
+
+
+	@Override
+	public int updateByPrimaryKeySelective(PatentInfo patentInfo) {
+		return patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
+	}
+
+
+	@Override
+	public PatentInfo selectByPrimaryKey(String id) {
+		return patentInfoMapper.selectByPrimaryKey(id);
+	}
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<PatentInfo> getClientApplyList(String userId, String patentNumber, String patentName,
+			Integer parentCatagory, Integer patentState, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		
+		if (userId == null){
+			return null;
+		}else{		
+			params.put("userId", userId);
+		}
+		
+		if (patentNumber != null){
+			params.put("patentNumber", patentNumber);
+		}
+		
+		if (patentName != null){
+			params.put("patentName", patentName);
+		}
+		
+		if (parentCatagory != null){
+			params.put("parentCatagory", parentCatagory);
+		}
+		
+		if(patentState != null){
+			params.put("patentState", patentState);
+		}
+			
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0) {
+			pageSize = 15;
+		}
+		return (Pagination<PatentInfo>) findPage("findClientApplyListByPage", "findClentApplyCount", params, pageNo,
+				pageSize);
+	}
+
+}

+ 62 - 0
src/main/java/com/goafanti/user/bo/UserDownLoadBo.java

@@ -0,0 +1,62 @@
+package com.goafanti.user.bo;
+
+public class UserDownLoadBo {
+	private String id;
+	
+	private String diplomaUrl;
+	
+	private String degreeDiplomaUrl;
+	
+	private String professionalCertificateUrl;
+	
+	private String qualificationCertificateUrl;
+	
+	private String positiveIdUrl;
+	
+	private String oppositeIdUrl;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getDiplomaUrl() {
+		return diplomaUrl;
+	}
+	public void setDiplomaUrl(String diplomaUrl) {
+		this.diplomaUrl = diplomaUrl;
+	}
+	public String getDegreeDiplomaUrl() {
+		return degreeDiplomaUrl;
+	}
+	public void setDegreeDiplomaUrl(String degreeDiplomaUrl) {
+		this.degreeDiplomaUrl = degreeDiplomaUrl;
+	}
+	public String getProfessionalCertificateUrl() {
+		return professionalCertificateUrl;
+	}
+	public void setProfessionalCertificateUrl(String professionalCertificateUrl) {
+		this.professionalCertificateUrl = professionalCertificateUrl;
+	}
+	public String getQualificationCertificateUrl() {
+		return qualificationCertificateUrl;
+	}
+	public void setQualificationCertificateUrl(String qualificationCertificateUrl) {
+		this.qualificationCertificateUrl = qualificationCertificateUrl;
+	}
+	public String getPositiveIdUrl() {
+		return positiveIdUrl;
+	}
+	public void setPositiveIdUrl(String positiveIdUrl) {
+		this.positiveIdUrl = positiveIdUrl;
+	}
+	public String getOppositeIdUrl() {
+		return oppositeIdUrl;
+	}
+	public void setOppositeIdUrl(String oppositeIdUrl) {
+		this.oppositeIdUrl = oppositeIdUrl;
+	}
+	
+	
+}

+ 83 - 9
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -75,7 +75,13 @@ public class UserApiController extends BaseApiController {
 	private OrganizationTechService			organizationTechService;
 	@Resource
 	private OrganizationPropertiesService	organizationPropertiesService;
-
+    
+	/**
+	 * 修改密码
+	 * @param password
+	 * @param newPassword
+	 * @return
+	 */
 	@RequestMapping(value = "/pwd", method = RequestMethod.POST)
 	public Result updatePwd(String password, String newPassword) {
 		Result res = new Result();
@@ -101,6 +107,60 @@ public class UserApiController extends BaseApiController {
 		}
 		return res;
 	}
+	
+	/**
+	 * 重置密码
+	 * @param resetCode
+	 * @param mobile
+	 * @param type
+	 * @param newPwd
+	 * @return
+	 */
+	@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
+	public Result resetPwd(String resetCode,String mobile,Integer type,String newPwd){
+		Result res = new Result();
+		if(TimeUtils.checkOverTime("resetCode")){
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME,"页面超时失效,请重新获取验证码!"));
+			this.cleanCodeSession();
+			return res;
+		}
+		if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)){
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR,"页面失效,请重新获取验证码!"));
+			this.cleanCodeSession();
+			return res;
+		}
+		User user = userService.selectByMobieAndType(mobile, type);
+		user.setPassword(newPwd);
+		user.setPassword(passwordUtil.getEncryptPwd(user));
+		userService.updateByPrimaryKey(user);
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
+		return res;
+	}
+	
+	
+	/**
+	 * 
+	 * @param mobileCode
+	 * @return
+	 */
+	@RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
+	public Result checkMCode(String mobileCode){
+		Result res = new Result();
+		if(TimeUtils.checkOverTime("register")){
+			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR,"手机验证码超时失效"));
+			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
+			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
+			return res;
+		}
+		System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
+		if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)){
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR,"手机验证码错误"));
+			return res;
+		}
+		return res;
+				
+	}
 
 	/**
 	 * 更换手机
@@ -202,25 +262,32 @@ public class UserApiController extends BaseApiController {
 		res.setData(handleFile(res, "/identity/", true, req, sign));
 		return res;
 	}
-
+	
 	/**
 	 * 专利
 	 * 
 	 * @param req
 	 * @return
 	 */
-	/*
-	 * @RequestMapping(value = "/patent/upload", method = RequestMethod.POST)
-	 * public Result patentFile(HttpServletRequest req) { Result res = new
-	 * Result(); res.setData(handleFile(res, "/patent/", true, req)); return
-	 * res; }
-	 */
+	
+	 @RequestMapping(value = "/patent/upload", method = RequestMethod.POST)
+	  public Result patentFile(HttpServletRequest req ,String sign) {
+		 Result res = new Result();
+		 res.setData(handleFile(res, "/patent/", true, req, sign));
+		 return	  res; 
+		 }
+
+	
 
 	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign) {
 		List<MultipartFile> files = getFiles(req);
 		String fileName = "";
 		if (isPrivate || sign != "") {
-			fileName = path + TokenManager.getUserId() + sign + ".jpg";
+			if("/patent/".equals(path)){
+				fileName = path + TokenManager.getUserId() + sign + ".pdf";
+			}else{
+				fileName = path + TokenManager.getUserId() + sign + ".jpg";
+			}
 		} else {
 			fileName = path + System.nanoTime() + ".jpg";
 		}
@@ -580,5 +647,12 @@ public class UserApiController extends BaseApiController {
 		}
 		return res;
 	}
+	
+	private void cleanCodeSession(){
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
+	}
 
 }

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

@@ -3,6 +3,8 @@ package com.goafanti.user.controller;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,6 +17,8 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.User;
+import com.goafanti.common.utils.TimeUtils;
+import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.service.UserService;
 
@@ -29,7 +33,9 @@ public class UserLoginController extends BaseController {
 	@ResponseBody
 	public Result login(HttpServletRequest request, Model model) {
 		Result res = new Result();
+		if(TokenManager.isLogin()){
 			TokenManager.logout();
+		}
 		return res;
 	}
 	
@@ -48,7 +54,14 @@ public class UserLoginController extends BaseController {
 		modelview.setView(rv);
 		return modelview;
 	}
-
+    
+	/**
+	 * 登录
+	 * @param user
+	 * @param remember
+	 * @param request
+	 * @return
+	 */
 	@RequestMapping(value = "/signin", method = RequestMethod.POST)
 	@ResponseBody
 	public Result signin(User user,Boolean remember, HttpServletRequest request) {
@@ -56,5 +69,32 @@ public class UserLoginController extends BaseController {
 		res.setData(TokenManager.login(user, remember));
 		return res;
 	}
+	
+	/**
+	 * 忘记密码 使用手机号+手机验证码登录
+	 * @param mobile
+	 * @param mobileCode
+	 * @param type
+	 * @return
+	 */
+	@RequestMapping(value = "/mobileSigin", method = RequestMethod.POST)
+	@ResponseBody
+	public Result mobileSignIn(User user,String mobileCode){
+		Result res = new Result();
+		if(StringUtils.isBlank(user.getMobile())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"必须指定","手机号"));
+			return res;
+		}
+		if(TimeUtils.checkOverTime("register")){
+			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR,"手机验证码超时失效"));
+			return res;
+		}
+		if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)){
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR,"手机验证码错误"));
+			return res;
+		}
+		return res;
+	}
+	
 
 }

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

@@ -46,15 +46,14 @@ public class UserRegisterController extends BaseController{
 			return res;
 		}
 		//验证码15分钟有效
-		/*if(TimeUtils.checkOverTime("register")){
+		if(TimeUtils.checkOverTime("register")){
 			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR,"手机验证码超时失效"));
 			return res;
 		}
-		System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
 		if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)){
 			res.getError().add(buildError(ErrorConstants.MCODE_ERROR,"手机验证码错误"));
 			return res;
-		}*/
+		}
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
 					bindingResult.getFieldError().getField()));

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

@@ -2,6 +2,7 @@ package com.goafanti.user.service;
 
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserInfo;
+import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserPageHomeBo;
 
 
@@ -21,4 +22,6 @@ public interface UserService {
 
 	UserPageHomeBo selectUserPageHomeBoByUserId(String userId);
 
+	UserDownLoadBo selectUserDownLoadBoByUserId(String userId);
+
 }

+ 6 - 0
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -13,6 +13,7 @@ import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.OrganizationInfo;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserInfo;
+import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserPageHomeBo;
 import com.goafanti.user.service.UserService;
 
@@ -82,6 +83,11 @@ public class UserServiceImpl implements UserService {
 		return userMapper.selectUserPageHomeBoByUserId(uid);
 	}
 
+	@Override
+	public UserDownLoadBo selectUserDownLoadBoByUserId(String id) {
+		return userMapper.selectUserDownLoadBoByUserId(id);
+	}
+
 
 
 

+ 11 - 0
src/main/webapp/WEB-INF/views/admin/index.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../header.jsp"%>
+<title>登录页</title>
+<link href="${staticHost}/admin/index.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/admin/index.js"></script>
+</body>
+</html>

+ 11 - 0
src/main/webapp/WEB-INF/views/admin/login.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../header.jsp"%>
+<title>登录页</title>
+<link href="${staticHost}/admin/login.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/admin/login.js"></script>
+</body>
+</html>

+ 11 - 0
src/main/webapp/WEB-INF/views/admin/servicesManage/patent.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../../header.jsp"%>
+<title>登录页</title>
+<link href="${staticHost}/admin/servicesManage/patent.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/admin/servicesManage/patent.js"></script>
+</body>
+</html>

+ 11 - 0
src/main/webapp/WEB-INF/views/admin/userManage.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../header.jsp"%>
+<title>登录页</title>
+<link href="${staticHost}/admin/userManage.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/admin/userManage.js"></script>
+</body>
+</html>

+ 3 - 3
src/main/webapp/WEB-INF/views/index.jsp

@@ -6,11 +6,11 @@
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
 	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
-	<!--[if lt IE 9]>
+	<!-- [if lt IE 9]>
     <script src="//cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
 	<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
-  	<![endif]-->
-	<title>首页</title>
+  	<![endif] -->
+	<title>index</title>
 </head>
 <body>
 	<div id="root">建设中..</div>

+ 11 - 0
src/main/webapp/WEB-INF/views/user/account/services.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../../header.jsp"%>
+<title>科技服务</title>
+<link href="${staticHost}/user/account/services.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/user/account/services.js"></script>
+</body>
+</html>