Antiloveg лет назад: 9
Родитель
Сommit
7b2dd006ef

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

@@ -182,7 +182,7 @@ public class PublicController extends BaseController {
 		byte[] buffer = new byte[8 * 1024];
 		byte[] buffer = new byte[8 * 1024];
 		String fileSaveRootPath = "";
 		String fileSaveRootPath = "";
 		//下载权限判断
 		//下载权限判断
-		if(null == TokenManager.getAdminToken()){
+		/*if(null == TokenManager.getAdminToken()){
 			UserDownLoadBo u = userService.selectUserDownLoadBoByUserId(TokenManager.getUserId());
 			UserDownLoadBo u = userService.selectUserDownLoadBoByUserId(TokenManager.getUserId());
 			if(!path.equals(u.getDegreeDiplomaUrl())&&!path.equals(u.getDiplomaUrl())&&
 			if(!path.equals(u.getDegreeDiplomaUrl())&&!path.equals(u.getDiplomaUrl())&&
 			   !path.equals(u.getOppositeIdUrl())&&!path.equals(u.getPositiveIdUrl())&&
 			   !path.equals(u.getOppositeIdUrl())&&!path.equals(u.getPositiveIdUrl())&&
@@ -190,7 +190,7 @@ public class PublicController extends BaseController {
 				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "权限不足,无法下载!"));	
 				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "权限不足,无法下载!"));	
 				return res;
 				return res;
 			}
 			}
-		}
+		}*/
 		try {
 		try {
 				fileSaveRootPath = uploadPrivatePath + path;
 				fileSaveRootPath = uploadPrivatePath + path;
 				File file = new File(fileSaveRootPath);
 				File file = new File(fileSaveRootPath);

+ 5 - 3
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -337,9 +337,11 @@
   
   
    
    
   <select id="selectOrgIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgIdentityBo">
   <select id="selectOrgIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgIdentityBo">
-  	select t.id,t.uid,t.contacts,t.fixed_tel,t.qq,t.postal_address,t.postcode,
-    u.email from user u LEFT JOIN organization_identity t
-    on t.uid = u.id where t.uid=#{uid,jdbcType=VARCHAR}
+  	select t.id,t.uid,t.contacts,t.fixed_tel as fixedTel ,t.qq,t.postal_address as postalAddress ,t.postcode,
+    u.email ,i.legal_person as legalPerson from user u LEFT JOIN organization_identity t
+    on t.uid = u.id 
+    left join organization_info i 
+    on u.id = i.uid where t.uid=#{uid,jdbcType=VARCHAR} 
   </select>
   </select>
   
   
   <select id="selectAllOrgIndentity" resultMap="BaseResultMap">
   <select id="selectAllOrgIndentity" resultMap="BaseResultMap">

+ 14 - 0
src/main/java/com/goafanti/common/model/PatentLog.java

@@ -2,6 +2,8 @@ package com.goafanti.common.model;
 
 
 import java.util.Date;
 import java.util.Date;
 
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
 public class PatentLog {
 public class PatentLog {
     private String id;
     private String id;
 
 
@@ -89,4 +91,16 @@ public class PatentLog {
     public void setComment(String comment) {
     public void setComment(String comment) {
         this.comment = comment;
         this.comment = comment;
     }
     }
+    
+    public String getRecordTimeFormattedDate(){
+		if (this.recordTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getRecordTime(), "yyyy-MM-dd");
+		}
+	}
+	
+	public void setRecordTimeFormattedDate(String createTimeFormattedDate){
+		
+	}
 }
 }

+ 24 - 11
src/main/java/com/goafanti/techservice/patent/controller/PatentApiController.java

@@ -230,28 +230,41 @@ public class PatentApiController extends BaseApiController {
 	 * 管理端专利详情修改保存
 	 * 管理端专利详情修改保存
 	 */
 	 */
 	@RequestMapping(value = "/managePatentInfo", method = RequestMethod.POST)
 	@RequestMapping(value = "/managePatentInfo", method = RequestMethod.POST)
-	public Result managePatentInfo(PatentInfo patentInfo, String pid, PatentLog patentLog) {
+	public Result managePatentInfo(PatentInfo patentInfo, String xid, PatentLog patentLog ,String recordTimeFormattedDate) {
 		Result res = new Result();
 		Result res = new Result();
-		if (null == patentInfo.getId()) {
-			res.getError().add(buildError("保存失败!"));
-			return res;
-		}
+		
+		Date d ;
+		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
+			try {
+				d = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
+			} catch (ParseException e) {
+				res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "参数格式不正确",  "yyyy-MM-dd"));
+				return res;
+			} 
+	    }else{
+		    d = null;
+	    }
+		
 		if (patentLog != null) {
 		if (patentLog != null) {
 			switch (patentLog.getState()) {
 			switch (patentLog.getState()) {
 			case 1:
 			case 1:
-				patentInfo.setCreateTime(patentLog.getRecordTime());
+				patentInfo.setCreateTime(d);
 				break;
 				break;
 			case 3:
 			case 3:
-				patentInfo.setPatentApplicationDate(patentLog.getRecordTime());
+				patentInfo.setPatentApplicationDate(d);
 				break;
 				break;
 			case 8:
 			case 8:
-				patentInfo.setAuthorizedDate(patentLog.getRecordTime());
+				patentInfo.setAuthorizedDate(d);
 				break;
 				break;
 			}
 			}
 			patentInfo.setPatentState(patentLog.getState());
 			patentInfo.setPatentState(patentLog.getState());
+			patentLog.setPid(xid);
+			patentLog.setRecordTime(d);
+			patentLog.setOperator(TokenManager.getAdminId());
 			patentLogService.insert(patentLog);
 			patentLogService.insert(patentLog);
 		}
 		}
-		patentInfo.setId(pid);
+		patentInfo.setId(xid);
+		//patentInfo,set
 		patentInfoService.updateByPrimaryKeySelective(patentInfo);
 		patentInfoService.updateByPrimaryKeySelective(patentInfo);
 		return res;
 		return res;
 	}
 	}
@@ -429,7 +442,7 @@ public class PatentApiController extends BaseApiController {
 	 * 专利综合管理报表导出
 	 * 专利综合管理报表导出
 	 * @throws ParseException 
 	 * @throws ParseException 
 	 */
 	 */
-	@RequestMapping(value = "/exportComposite", method = RequestMethod.POST)
+	@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
 	public Result exportComposite(Integer serialNumber, String patentNumber, String office,
 	public Result exportComposite(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
 			String[] createTime, String[] patentApplicationDate, String author, HttpServletResponse response) throws ParseException{
 			String[] createTime, String[] patentApplicationDate, String author, HttpServletResponse response) throws ParseException{
@@ -692,7 +705,7 @@ public class PatentApiController extends BaseApiController {
 	@RequestMapping(value="/downloadTemplate",method = RequestMethod.GET)
 	@RequestMapping(value="/downloadTemplate",method = RequestMethod.GET)
 	public Result downloadPatentProryStatement(HttpServletResponse response,  HttpServletRequest request){
 	public Result downloadPatentProryStatement(HttpServletResponse response,  HttpServletRequest request){
 		Result res = new Result();
 		Result res = new Result();
-		String filename ="专利代理委托书模版" + Long.toString(System.nanoTime())+".doc"; 
+		String filename = "专利代理委托书模版" + Long.toString(System.nanoTime())+".doc"; 
 		String fileSaveRootPath = uploadPrivatePath + "/patent/patent_prory_statement.doc";
 		String fileSaveRootPath = uploadPrivatePath + "/patent/patent_prory_statement.doc";
 		return patentDownload(res,response,filename,fileSaveRootPath);
 		return patentDownload(res,response,filename,fileSaveRootPath);
 	}
 	}

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

@@ -103,13 +103,13 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		Date pEnd = null;
 		Date pEnd = null;
 		
 		
 		
 		
-		if(cDate != null ){
+		if(cDate != null && cDate.length>0){
 			 cStart = DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
 			 cStart = DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
 			 if(cDate.length == 2){
 			 if(cDate.length == 2){
 				 cEnd = DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
 				 cEnd = DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
 			 }
 			 }
 		}
 		}
-		if(pDate != null ){
+		if(pDate != null && pDate.length>0){
 			pStart = DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
 			pStart = DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
 			if(pDate.length == 2){
 			if(pDate.length == 2){
 				pEnd = DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
 				pEnd = DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);

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

@@ -11,8 +11,18 @@ public class OrgIdentityBo extends OrganizationIdentity{@Size(min = 0, max = 127
 		+ ErrorConstants.EMAIL_PATTERN_ERROR + "}")
 		+ ErrorConstants.EMAIL_PATTERN_ERROR + "}")
 	private String email;
 	private String email;
 
 
+    private String legalPerson;
+
     
     
 
 
+	public String getLegalPerson() {
+		return legalPerson;
+	}
+
+	public void setLegalPerson(String legalPerson) {
+		this.legalPerson = legalPerson;
+	}
+
 	public String getEmail() {
 	public String getEmail() {
 		return email;
 		return email;
 	}
 	}

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

@@ -443,6 +443,16 @@ public class UserApiController extends BaseApiController {
 		organizationIdentity.setQq(orgIdentityBo.getQq());
 		organizationIdentity.setQq(orgIdentityBo.getQq());
 		organizationIdentity.setPostalAddress(orgIdentityBo.getPostalAddress());
 		organizationIdentity.setPostalAddress(orgIdentityBo.getPostalAddress());
 		organizationIdentity.setPostcode(orgIdentityBo.getPostcode());
 		organizationIdentity.setPostcode(orgIdentityBo.getPostcode());
+		OrganizationInfo info = organizationInfoService.selectOrgInfoByUserId(TokenManager.getUserId());
+		if(null == info){
+			OrganizationInfo i = new OrganizationInfo();
+			i.setId(UUID.randomUUID().toString());
+			i.setUid(TokenManager.getUserId());
+			organizationInfoService.insert(i);
+		}else{
+			info.setLegalPerson(orgIdentityBo.getLegalPerson());
+			organizationInfoService.updateByPrimaryKeySelective(info);
+		}
 		if (identity == null) {
 		if (identity == null) {
 			organizationIdentity.setId(UUID.randomUUID().toString());
 			organizationIdentity.setId(UUID.randomUUID().toString());
 			organizationIdentity.setUid(TokenManager.getUserId());
 			organizationIdentity.setUid(TokenManager.getUserId());
@@ -451,6 +461,7 @@ public class UserApiController extends BaseApiController {
 			organizationIdentity.setId(identity.getId());
 			organizationIdentity.setId(identity.getId());
 			organizationIdentityService.updateByPrimaryKeySelective(organizationIdentity);
 			organizationIdentityService.updateByPrimaryKeySelective(organizationIdentity);
 		}
 		}
+		System.out.println(orgIdentityBo.getPostalAddress()+" "+orgIdentityBo.getFixedTel()+" "+orgIdentityBo.getLegalPerson());
 		res.setData(orgIdentityBo);
 		res.setData(orgIdentityBo);
 		return res;
 		return res;
 	}
 	}