Просмотр исходного кода

Accept Merge Request #127 v1.0.23 : (master -> test)

Merge Request: v1.0.23
Created By: @Antiloveg
Accepted By: @Antiloveg
URL: https://coding.net/t/aft/p/AFT/git/merge/127
Antiloveg лет назад: 9
Родитель
Сommit
18f2a3e026
19 измененных файлов с 879 добавлено и 69 удалено
  1. 17 0
      schema/permission.sql
  2. 2 1
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 11 39
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  4. 534 0
      src/main/java/com/goafanti/admin/controller/AdminPreviewApiController.java
  5. 24 0
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  6. 264 3
      src/main/java/com/goafanti/common/controller/PreviewController.java
  7. 2 2
      src/main/java/com/goafanti/common/dao/CopyrightLogMapper.java
  8. 1 1
      src/main/java/com/goafanti/common/mapper/CopyrightLogMapper.xml
  9. 6 6
      src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml
  10. 1 1
      src/main/java/com/goafanti/copyright/bo/CopyrightLogBO.java
  11. 3 3
      src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java
  12. 2 2
      src/main/java/com/goafanti/copyright/service/CopyrightInfoService.java
  13. 2 2
      src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java
  14. 4 4
      src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java
  15. 2 1
      src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java
  16. 1 1
      src/main/resources/props/config_dev.properties
  17. 1 1
      src/main/resources/props/config_local.properties
  18. 1 1
      src/main/resources/props/config_prod.properties
  19. 1 1
      src/main/resources/props/config_test.properties

+ 17 - 0
schema/permission.sql

@@ -340,6 +340,23 @@ insert into `permission`(`id`, `url`, `name`)
 values
 (UUID(), 'api/admin/copyright/circulation', '软著申请管理--软著批量流转');
 
+insert into `permission`(`id`, `url`, `name`) 
+values
+(UUID(), '/api/admin/preview/patent', '文件预览--专利申请相关材料预览授权'), 
+(UUID(), '/api/admin/preview/copyright', '文件预览--软著相关材料(软著申请书、软著证书)预览授权'), 
+(UUID(), '/api/admin/preview/techProject', '文件预览--科技项目材料预览授权'), 
+(UUID(), '/api/admin/preview/techCenterDetail', '文件预览--产学研协议附件预览授权'), 
+(UUID(), '/api/admin/preview/activity', '文件预览--研发活动立项证明材料预览授权'), 
+(UUID(), '/api/admin/preview/activityCost', '文件预览--研发活动费用台帐预览授权'), 
+(UUID(), '/api/admin/preview/techProduct', '文件预览--高新技术产品台帐预览授权'), 
+(UUID(), '/api/admin/preview/intellectualProperty', '文件预览--知识产权证书及稿件预览授权'), 
+(UUID(), '/api/admin/preview/achievement', '文件预览--科技成果附件预览授权'), 
+(UUID(), '/api/admin/preview/ratepay', '文件预览--所得税纳税申报表预览授权'),
+(UUID(), '/api/admin/preview/finance', '文件预览--财务报表预览授权'), 
+(UUID(), '/api/admin/preview/humanResource', '文件预览--人力资源情况预览授权'), 
+(UUID(), '/api/admin/preview/honor', '文件预览--企业荣誉及其他证明材料预览授权'), 
+(UUID(), '/api/admin/preview/standard', '文件预览--标准制定情况附件预览授权');
+
 
 
 

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

@@ -69,6 +69,7 @@ import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AdminFields;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.CognizanceApplyFields;
+import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.FinanceRatepayFields;
 import com.goafanti.common.enums.IdentityAuditStatus;
 import com.goafanti.common.enums.IdentityProcess;
@@ -886,7 +887,7 @@ public class AdminApiController extends CertifyApiController {
 				return res;
 			}
 			ohr.setId(UUID.randomUUID().toString());
-			ohr.setDeletedSign(0);
+			ohr.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 			orgHumanResourceService.insert(ohr);
 		} else {
 			orgHumanResourceService.updateByPrimaryKeySelective(ohr);

+ 11 - 39
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -54,7 +54,6 @@ import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.FileUtils;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.SHA256Util;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -312,7 +311,7 @@ public class AdminPatentApiController extends CertifyApiController {
 		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY) {
+		if (attachmentType != AttachmentType.LAST_YEAR_RATEPAY) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
 			return res;
 		}
@@ -324,6 +323,11 @@ public class AdminPatentApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到上年度纳税申报表", "上年度纳税申报表"));
 			return res;
 		}
+		
+		Map<String, String> map = new TreeMap<String, String>();
+		map.put("id", ratepay.getId());
+		map.put("year", ratepay.getYear().toString());
+		res.setData(map);
 
 		return res;
 	}
@@ -443,38 +447,7 @@ public class AdminPatentApiController extends CertifyApiController {
 		return res;
 	}
 
-	/**
-	 * 预览专利相关材料
-	 * 
-	 * @param id
-	 * @param sign
-	 * @param response
-	 * @return
-	 */
-	@RequestMapping(value = "/preview", method = RequestMethod.GET)
-	public Result preview(String id, String sign) {
-		Result res = new Result();
-		if (StringUtils.isEmpty(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
-			return res;
-		}
-		PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
-		if (pi == null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
-			return res;
-		}
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
-				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
-				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
-			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
-			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
-			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
-		return res;
-	}
+	
 
 	/**
 	 * 下载模版文件(专利代理委托书)
@@ -513,15 +486,14 @@ public class AdminPatentApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/downloadRatepay", method = RequestMethod.GET)
-	public Result downloadRatepay(HttpServletResponse response, String uid, String sign) {
+	public Result downloadRatepay(HttpServletResponse response, String id, String sign) {
 		Result res = new Result();
-		if (StringUtils.isBlank(uid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "纳税表ID"));
 			return res;
 		}
 
-		Calendar cal = Calendar.getInstance();
-		OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, cal.get(Calendar.YEAR) - 1);
+		OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
 
 		if (null == ratepay) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到上年度纳税申报表", "上年度纳税申报表"));

+ 534 - 0
src/main/java/com/goafanti/admin/controller/AdminPreviewApiController.java

@@ -0,0 +1,534 @@
+package com.goafanti.admin.controller;
+
+import java.util.Calendar;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.cognizance.service.OrgActivityCostService;
+import com.goafanti.cognizance.service.OrgActivityService;
+import com.goafanti.cognizance.service.OrgFinanceService;
+import com.goafanti.cognizance.service.OrgHonorDatumService;
+import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
+import com.goafanti.cognizance.service.OrgRatepayService;
+import com.goafanti.cognizance.service.OrgStandardService;
+import com.goafanti.cognizance.service.OrgTechAchievementService;
+import com.goafanti.cognizance.service.OrgTechCenterDetailService;
+import com.goafanti.cognizance.service.OrgTechProductService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.OrgActivity;
+import com.goafanti.common.model.OrgActivityCost;
+import com.goafanti.common.model.OrgFinance;
+import com.goafanti.common.model.OrgHonorDatum;
+import com.goafanti.common.model.OrgHumanResource;
+import com.goafanti.common.model.OrgIntellectualProperty;
+import com.goafanti.common.model.OrgRatepay;
+import com.goafanti.common.model.OrgStandard;
+import com.goafanti.common.model.OrgTechAchievement;
+import com.goafanti.common.model.OrgTechCenterDetail;
+import com.goafanti.common.model.OrgTechProduct;
+import com.goafanti.common.model.PatentInfo;
+import com.goafanti.common.model.TechProject;
+import com.goafanti.common.utils.SHA256Util;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.patent.service.PatentInfoService;
+import com.goafanti.techproject.service.TechProjectService;
+import com.goafanti.user.service.OrgHumanResourceService;
+
+@RestController
+@RequestMapping(value = "/api/admin/preview")
+public class AdminPreviewApiController extends CertifyApiController {
+	@Resource
+	private PatentInfoService				patentInfoService;
+	@Resource
+	private CopyrightInfoService			copyrightInfoService;
+	@Resource
+	private TechProjectService				techProjectService;
+	@Resource
+	private OrgTechCenterDetailService		orgTechCenterDetailService;
+	@Resource
+	private OrgActivityService				orgActivityService;
+	@Resource
+	private OrgActivityCostService			orgActivityCostService;
+	@Resource
+	private OrgTechProductService			orgTechProductService;
+	@Resource
+	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
+	@Resource
+	private OrgTechAchievementService		orgTechAchievementService;
+	@Resource
+	private OrgRatepayService				orgRatepayService;
+	@Resource
+	private OrgFinanceService				orgFinanceService;
+	@Resource
+	private OrgHumanResourceService			OrgHumanResourceService;
+	@Resource
+	private OrgHonorDatumService			OrgHonorDatumService;
+	@Resource
+	private OrgStandardService				orgStandardService;
+
+	@Value(value = "${aesSecretKey}")
+	private String							secretKey	= null;
+
+	/**
+	 * 专利相关材料(专利代理委托书、专利稿件、授权通知书、专利证书、上年度纳税报表)预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/patent", method = RequestMethod.GET)
+	public Result previewPatent(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
+			return res;
+		}
+		PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
+		if (null == pi) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
+				|| attachmentType == AttachmentType.LAST_YEAR_RATEPAY
+				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 软著相关材料(软著申请书、软著证书)预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/copyright", method = RequestMethod.GET)
+	public Result previewCopyright(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著ID"));
+			return res;
+		}
+
+		CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
+		if (null == ci) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.COPYRIGHT_AUTH || attachmentType == AttachmentType.COPYRIGHT_APPLY) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 科技项目材料预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/techProject", method = RequestMethod.GET)
+	public Result previewTechProject(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
+			return res;
+		}
+
+		TechProject tp = techProjectService.selectByPrimaryKey(id);
+		if (null == tp) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.TECH_PROJECT) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 企业研发机构-产学研协议附件预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/techCenterDetail", method = RequestMethod.GET)
+	public Result previewTechCenterDetail(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研记录ID"));
+			return res;
+		}
+
+		OrgTechCenterDetail otcd = orgTechCenterDetailService.selectByPrimaryKey(id);
+		if (null == otcd) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研记录ID"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PROTOCOL) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 研发活动立项证明材料预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/activity", method = RequestMethod.GET)
+	public Result previewActivity(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动ID"));
+			return res;
+		}
+
+		OrgActivity oa = orgActivityService.selectOrgActivityByPrimaryKey(id);
+		if (null == oa) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动ID"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PROOF) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 研发活动费用台帐预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/activityCost", method = RequestMethod.GET)
+	public Result previewActivityCost(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动费用ID"));
+			return res;
+		}
+
+		OrgActivityCost oac = orgActivityCostService.selectByPrimaryKey(id);
+		if (null == oac) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动费用ID"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.ACTIVITY_COST_ACCOUNT) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 高新技术产品台帐预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/techProduct", method = RequestMethod.GET)
+	public Result previewTechProduct(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品ID"));
+			return res;
+		}
+
+		OrgTechProduct otp = orgTechProductService.selectByPrimaryKey(id);
+		if (null == otp) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.TECH_PRODUCT) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 知识产权证书及稿件预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/intellectualProperty", method = RequestMethod.GET)
+	public Result previewIntellectualProperty(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.PROPERTY_RIGHT) {
+			OrgIntellectualProperty oip = orgIntellectualPropertyService.selectByPrimaryKey(id);
+			if (null == oip) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
+				return res;
+			}
+		} else if (attachmentType == AttachmentType.PATENT_WRITING) {
+			PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
+			if (null == pi) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利稿件ID"));
+				return res;
+			}
+		} else if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
+			CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
+			if (null == ci) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权申请书ID"));
+				return res;
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+			return res;
+		}
+
+		String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+		String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+		res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		return res;
+	}
+
+	/**
+	 * 科技成果附件预览授权
+	 * 
+	 * @param id
+	 * @param sing
+	 * @return
+	 */
+	@RequestMapping(value = "/achievement", method = RequestMethod.GET)
+	public Result previewAchievement(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+		OrgTechAchievement ota = orgTechAchievementService.selectByPrimaryKey(id);
+		if (null == ota) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.ACHIEVEMENT) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+
+		return res;
+	}
+
+	/**
+	 * 所得税纳税申报表预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/ratepay", method = RequestMethod.GET)
+	public Result previewRatepay(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税申报表ID"));
+			return res;
+		}
+		OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
+		if (null == ratepay) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税申报表ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.RATEPAY) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 财务报表预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/finance", method = RequestMethod.GET)
+	public Result previewFinance(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "财务报表ID"));
+			return res;
+		}
+
+		OrgFinance of = orgFinanceService.selectByPrimaryKey(id);
+		if (null == of) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "财务报表ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.FINANCE) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 人力资源情况预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/humanResource", method = RequestMethod.GET)
+	public Result previewHumanResource(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "人力资源ID"));
+			return res;
+		}
+
+		OrgHumanResource ohr = OrgHumanResourceService.selectByPrimaryKey(id);
+		if (null == ohr) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "人力资源ID"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.ROSTER || attachmentType == AttachmentType.SOCIAL_SECURITY) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 企业荣誉及其他证明材料预览授权
+	 * 
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/honor", method = RequestMethod.GET)
+	public Result previewHonor(String id, String sign) {
+		Result res = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业荣誉及其他证明材料ID"));
+			return res;
+		}
+		OrgHonorDatum ohd = OrgHonorDatumService.selectByPrimaryKey(id);
+		if (null == ohd) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业荣誉及其他证明材料ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.HONOR) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 标准制定情况附件预览授权
+	 * @param id
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/standard", method = RequestMethod.GET)
+	public Result previewStandard(String id, String sign){
+		Result res  = new Result();
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
+			return res;
+		}
+		
+		OrgStandard os = orgStandardService.selectByPrimaryKey(id);
+		if (null == os){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.STANDARD) {
+			String time = String.valueOf(Calendar.getInstance().getTime().getTime());
+			String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
+			res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+}

+ 24 - 0
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -857,7 +857,31 @@ public class CognizanceApiController extends CertifyApiController {
 		}
 		return res;
 	}
+    
+	/**
+	 * 实名认证--企业上年度纳税申报表上传
+	 * 
+	 * @param req
+	 * @param sign
+	 * @param uid
+	 * @return
+	 */
+	@RequestMapping(value = "/uploadLastYearRatepay", method = RequestMethod.POST)
+	public Result uploadLastYearRatepay(HttpServletRequest req, String sign) {
+		Result res = new Result();
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.RATEPAY) {
+			Calendar now = Calendar.getInstance(); 
+			sign = sign + "_" + (now.get(Calendar.YEAR)-1);
+			res.setData(handleFiles(res, "/cognizance/", true, req, sign, TokenManager.getUserId()));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
 
+		return res;
+	}
+	
 	/**
 	 * 企业纳税申报表上传
 	 * 

+ 264 - 3
src/main/java/com/goafanti/common/controller/PreviewController.java

@@ -11,14 +11,40 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import com.goafanti.cognizance.service.OrgActivityCostService;
+import com.goafanti.cognizance.service.OrgActivityService;
+import com.goafanti.cognizance.service.OrgFinanceService;
+import com.goafanti.cognizance.service.OrgHonorDatumService;
+import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
+import com.goafanti.cognizance.service.OrgRatepayService;
+import com.goafanti.cognizance.service.OrgStandardService;
+import com.goafanti.cognizance.service.OrgTechAchievementService;
+import com.goafanti.cognizance.service.OrgTechCenterDetailService;
+import com.goafanti.cognizance.service.OrgTechProductService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.OrgActivity;
+import com.goafanti.common.model.OrgActivityCost;
+import com.goafanti.common.model.OrgFinance;
+import com.goafanti.common.model.OrgHonorDatum;
+import com.goafanti.common.model.OrgHumanResource;
+import com.goafanti.common.model.OrgIntellectualProperty;
+import com.goafanti.common.model.OrgRatepay;
+import com.goafanti.common.model.OrgStandard;
+import com.goafanti.common.model.OrgTechAchievement;
+import com.goafanti.common.model.OrgTechCenterDetail;
+import com.goafanti.common.model.OrgTechProduct;
 import com.goafanti.common.model.PatentInfo;
+import com.goafanti.common.model.TechProject;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.SHA256Util;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.patent.service.PatentInfoService;
+import com.goafanti.techproject.service.TechProjectService;
+import com.goafanti.user.service.OrgHumanResourceService;
 import com.goafanti.user.service.UserService;
 
 @Controller
@@ -26,12 +52,38 @@ import com.goafanti.user.service.UserService;
 public class PreviewController extends BaseApiController {
 
 	@Resource
-	private PatentInfoService	patentInfoService;
+	private PatentInfoService				patentInfoService;
 	@Resource
-	private UserService			userService;
+	private UserService						userService;
+	@Resource
+	private CopyrightInfoService			copyrightInfoService;
+	@Resource
+	private TechProjectService				techProjectService;
+	@Resource
+	private OrgTechCenterDetailService		orgTechCenterDetailService;
+	@Resource
+	private OrgActivityService				orgActivityService;
+	@Resource
+	private OrgActivityCostService			orgActivityCostService;
+	@Resource
+	private OrgTechProductService			orgTechProductService;
+	@Resource
+	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
+	@Resource
+	private OrgTechAchievementService		orgTechAchievementService;
+	@Resource
+	private OrgRatepayService				orgRatepayService;
+	@Resource
+	private OrgFinanceService				orgFinanceService;
+	@Resource
+	private OrgHumanResourceService			OrgHumanResourceService;
+	@Resource
+	private OrgHonorDatumService			OrgHonorDatumService;
+	@Resource
+	private OrgStandardService				orgStandardService;
 
 	@Value(value = "${aesSecretKey}")
-	private String				secretKey	= null;
+	private String							secretKey	= null;
 
 	@RequestMapping(value = "/preview", method = RequestMethod.GET)
 	public Result preview(HttpServletResponse response, String sign, String temp, String token, String auth) {
@@ -58,6 +110,126 @@ public class PreviewController extends BaseApiController {
 					handlePatentPreview(response, pi, attachmentType);
 				}
 				break;
+			case LAST_YEAR_RATEPAY:
+			case RATEPAY:
+				OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(token);
+				if (null == ratepay) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleRatepayPreview(response, ratepay, attachmentType);
+				}
+				break;
+			case COPYRIGHT_AUTH:
+			case COPYRIGHT_APPLY:
+				CopyrightInfoDetail ci = copyrightInfoService.findByPrimaryKey(token);
+				if (null == ci) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleCopyrightPreview(response, ci, attachmentType);
+				}
+				break;
+			case TECH_PROJECT:
+				TechProject tp = techProjectService.selectByPrimaryKey(token);
+				if (null == tp) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleTechProjectPreview(response, tp, attachmentType);
+				}
+				break;
+			case PROTOCOL:
+				OrgTechCenterDetail otcd = orgTechCenterDetailService.selectByPrimaryKey(token);
+				if (null == otcd) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleTechCenterDetailPreview(response, otcd, attachmentType);
+				}
+				break;
+			case PROOF:
+				OrgActivity oa = orgActivityService.selectOrgActivityByPrimaryKey(token);
+				if (null == oa) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleActivityPreview(response, oa, attachmentType);
+				}
+				break;
+			case ACTIVITY_COST_ACCOUNT:
+				OrgActivityCost oac = orgActivityCostService.selectByPrimaryKey(token);
+				if (null == oac) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleActivityCostPreview(response, oac, attachmentType);
+				}
+				break;
+			case TECH_PRODUCT:
+				OrgTechProduct otp = orgTechProductService.selectByPrimaryKey(token);
+				if (null == otp) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleTechProductPreview(response, otp, attachmentType);
+				}
+				break;
+			case PROPERTY_RIGHT:
+				OrgIntellectualProperty oip = orgIntellectualPropertyService.selectByPrimaryKey(token);
+				if (null == oip) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleIntellectualPropertyPreview(response, oip, attachmentType);
+				}
+				break;
+			case ACHIEVEMENT:
+				OrgTechAchievement ota = orgTechAchievementService.selectByPrimaryKey(token);
+				if (null == ota) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleAchievementPreview(response, ota, attachmentType);
+				}
+				break;
+			case FINANCE:
+				OrgFinance of = orgFinanceService.selectByPrimaryKey(token);
+				if (null == of) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleFinancePreview(response, of, attachmentType);
+				}
+				break;
+			case ROSTER:
+			case SOCIAL_SECURITY:
+				OrgHumanResource ohr = OrgHumanResourceService.selectByPrimaryKey(token);
+				if (null == ohr) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleHumanResourcePreview(response, ohr, attachmentType);
+				}
+				break;
+			case HONOR:
+				OrgHonorDatum ohd = OrgHonorDatumService.selectByPrimaryKey(token);
+				if (null == ohd) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleHonorPreview(response, ohd, attachmentType);
+				}
+				break;
+			case STANDARD:
+				OrgStandard os = orgStandardService.selectByPrimaryKey(token);
+				if (null == os){
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
+					return res;
+				} else {
+					handleStandardPreview(response, os, attachmentType);
+				}
+				break;
 			default:
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "预览"));
 			}
@@ -65,6 +237,7 @@ public class PreviewController extends BaseApiController {
 		return res;
 	}
 
+	
 	private void handlePatentPreview(HttpServletResponse response, PatentInfo pi, AttachmentType attachmentType) {
 		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
 			downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
@@ -77,4 +250,92 @@ public class PreviewController extends BaseApiController {
 		}
 	}
 
+	private void handleRatepayPreview(HttpServletResponse response, OrgRatepay ratepay, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY || attachmentType == AttachmentType.RATEPAY) {
+			downloadFile(response, ratepay.getTaxReturnDownloadFileName(), ratepay.getTaxReturnUrl());
+		}
+	}
+
+	private void handleCopyrightPreview(HttpServletResponse response, CopyrightInfoDetail ci,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.COPYRIGHT_AUTH) {
+			downloadFile(response, ci.getCertificateUrlDownloadFileName(), ci.getCertificateUrl());
+		} else if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
+			downloadFile(response, ci.getApplicationUrlDownloadFileName(), ci.getApplicationUrl());
+		}
+	}
+
+	private void handleTechProjectPreview(HttpServletResponse response, TechProject tp, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.TECH_PROJECT) {
+			downloadFile(response, tp.getApprovalDownloadFileName(), tp.getApprovalUrl());
+		}
+	}
+
+	private void handleTechCenterDetailPreview(HttpServletResponse response, OrgTechCenterDetail otcd,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.PROTOCOL) {
+			downloadFile(response, otcd.getProtocolDownloadFileName(), otcd.getProtocolUrl());
+		}
+	}
+
+	private void handleActivityPreview(HttpServletResponse response, OrgActivity oa, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.PROOF) {
+			downloadFile(response, oa.getProofDownloadFileName(), oa.getProofUrl());
+		}
+	}
+
+	private void handleActivityCostPreview(HttpServletResponse response, OrgActivityCost oac,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.ACTIVITY_COST_ACCOUNT) {
+			downloadFile(response, oac.getAccountDownloadFileName(), oac.getAccountUrl());
+		}
+	}
+
+	private void handleTechProductPreview(HttpServletResponse response, OrgTechProduct otp,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.TECH_PRODUCT) {
+			downloadFile(response, otp.getAccountDownloadFileName(), otp.getAccountUrl());
+		}
+	}
+
+	private void handleIntellectualPropertyPreview(HttpServletResponse response, OrgIntellectualProperty oip,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.PROPERTY_RIGHT) {
+			downloadFile(response, oip.getPropertyRightDownloadFileName(), oip.getPropertyRightUrl());
+		}
+	}
+
+	private void handleAchievementPreview(HttpServletResponse response, OrgTechAchievement ota,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.ACHIEVEMENT) {
+			downloadFile(response, ota.getEnclosureDownloadFileName(), ota.getEnclosureUrl());
+		}
+	}
+
+	private void handleFinancePreview(HttpServletResponse response, OrgFinance of, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.FINANCE) {
+			downloadFile(response, of.getFinanceDownloadFileName(), of.getFinanceUrl());
+		}
+	}
+
+	private void handleHumanResourcePreview(HttpServletResponse response, OrgHumanResource ohr,
+			AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.ROSTER) {
+			downloadFile(response, ohr.getRosterDownloadFileName(), ohr.getRosterUrl());
+		} else if (attachmentType == AttachmentType.SOCIAL_SECURITY) {
+			downloadFile(response, ohr.getSocialSecurityDownloadFileName(), ohr.getSocialSecurityUrl());
+		}
+	}
+
+	private void handleHonorPreview(HttpServletResponse response, OrgHonorDatum ohd, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.HONOR) {
+			downloadFile(response, ohd.getEnclosureDownloadFileName(), ohd.getEnclosureUrl());
+		}
+	}
+	
+	private void handleStandardPreview(HttpServletResponse response, OrgStandard os, AttachmentType attachmentType) {
+		if (attachmentType == AttachmentType.STANDARD) {
+			downloadFile(response, os.getStandardDownloadFileName(), os.getEnclosureUrl());
+		}
+	}
 }

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

@@ -3,7 +3,7 @@ package com.goafanti.common.dao;
 import java.util.List;
 
 import com.goafanti.common.model.CopyrightLog;
-import com.goafanti.copyright.bo.CopyrightLogBO;
+import com.goafanti.copyright.bo.CopyrightLogBo;
 
 public interface CopyrightLogMapper {
 	int deleteByPrimaryKey(String id);
@@ -18,7 +18,7 @@ public interface CopyrightLogMapper {
 
 	int updateByPrimaryKey(CopyrightLog record);
 
-	List<CopyrightLogBO> findByCopyrightId(String id);
+	List<CopyrightLogBo> findByCopyrightId(String id);
 
 	int batchInsert(List<CopyrightLog> log);
 }

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

@@ -114,7 +114,7 @@
       comment = #{comment,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <select id="findByCopyrightId" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightLogBO">
+  <select id="findByCopyrightId" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightLogBo">
     select a.name as principal, b.name as operator, cl.record_time as recordTime, cl.status as status, cl.comment as comment
     from copyright_log cl
    	left join admin a on cl.principal = a.id

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

@@ -454,9 +454,9 @@
 		CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
 	    CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
 	    CONCAT(i.third_contacts,'  ', i.third_mobile) as thirdContacts
-	from organization_identity i
-	RIGHT JOIN user u  on u.id = i.uid 
-	LEFT JOIN admin a on a.id = i.consultant
+	from user u 
+	LEFT JOIN organization_identity i  on u.id = i.uid 
+	LEFT JOIN admin a on a.id = u.aid
 	where u.type = 1 and u.lvl = 1
 	<if test="unitName != null">
 	    and i.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
@@ -474,9 +474,9 @@
   
   <select id="findCultivationCount" resultType="java.lang.Integer" parameterType="java.lang.String">
   	select count(1)
-	from organization_identity i
-	RIGHT JOIN user u  on u.id = i.uid 
-	LEFT JOIN admin a on a.id = i.consultant
+	from user u 
+	LEFT JOIN organization_identity i  on u.id = i.uid 
+	LEFT JOIN admin a on a.id = u.aid
 	where u.type = 1 and u.lvl = 1
 	<if test="unitName != null">
 	    and i.unit_name = #{unitName,jdbcType=VARCHAR}

+ 1 - 1
src/main/java/com/goafanti/copyright/bo/CopyrightLogBO.java

@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.constant.AFTConstants;
 
-public class CopyrightLogBO {
+public class CopyrightLogBo {
 
 	/**
 	 * 操作时间

+ 3 - 3
src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java

@@ -28,7 +28,7 @@ import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightLog;
 import com.goafanti.common.model.User;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
-import com.goafanti.copyright.bo.CopyrightLogBO;
+import com.goafanti.copyright.bo.CopyrightLogBo;
 import com.goafanti.copyright.bo.InputCopyright;
 import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -238,8 +238,8 @@ public class CopyrightApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著申请id"));
 			return res;
 		}
-		List<CopyrightLogBO> list = copyrightInfoService.findLogsByPrimaryKey(id);
-		for (CopyrightLogBO log : list) {
+		List<CopyrightLogBo> list = copyrightInfoService.findLogsByPrimaryKey(id);
+		for (CopyrightLogBo log : list) {
 			if (CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.SIGN 
 					|| CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.CIRCULATION
 					|| CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.SETTLEMENT) {

+ 2 - 2
src/main/java/com/goafanti/copyright/service/CopyrightInfoService.java

@@ -7,7 +7,7 @@ import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightLog;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.bo.CopyrightInfoSummary;
-import com.goafanti.copyright.bo.CopyrightLogBO;
+import com.goafanti.copyright.bo.CopyrightLogBo;
 import com.goafanti.core.mybatis.page.Pagination;
 
 public interface CopyrightInfoService {
@@ -32,7 +32,7 @@ public interface CopyrightInfoService {
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			Integer pageSize, String uid);
 
-	List<CopyrightLogBO> findLogsByPrimaryKey(String id);
+	List<CopyrightLogBo> findLogsByPrimaryKey(String id);
 
 	int batchCirculation(String[] ids, String recordTimeFormattedDate, CopyrightLog cl);
 

+ 2 - 2
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -34,7 +34,7 @@ import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.User;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.bo.CopyrightInfoSummary;
-import com.goafanti.copyright.bo.CopyrightLogBO;
+import com.goafanti.copyright.bo.CopyrightLogBo;
 import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -214,7 +214,7 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 	}
 
 	@Override
-	public List<CopyrightLogBO> findLogsByPrimaryKey(String id) {
+	public List<CopyrightLogBo> findLogsByPrimaryKey(String id) {
 		return copyrightLogMapper.findByCopyrightId(id);
 	}
 

+ 4 - 4
src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java

@@ -110,14 +110,14 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 				u.setLvl(1);
 				;
 				userMapper.updateByPrimaryKeySelective(u);
-				Calendar cal = Calendar.getInstance();
+				Calendar now = Calendar.getInstance();
 				if (null != o.getLastYearTaxReportUrl()
-						&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, Calendar.YEAR - 1)) {
+						&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR)-1)) {
 					OrgRatepay r = new OrgRatepay();
 					r.setId(UUID.randomUUID().toString());
 					r.setUid(uid);
-					r.setYear(cal.get(Calendar.YEAR) - 1);
-					r.setDeletedSign(0);
+					r.setYear(now.get(Calendar.YEAR) - 1);
+					r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 					r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
 					orgRatepayMapper.insert(r);
 				}

+ 2 - 1
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -54,10 +54,11 @@ public class UserIdentityServiceImpl implements UserIdentityService{
 			userIdentity.setId(UUID.randomUUID().toString());
 			userIdentity.setUid(uid);
 			userIdentity.setWrongCount(0);
+			userIdentity.setAuditStatus(0);
 			return userIdentityMapper.insert(userIdentity);
 		} else {
 			userIdentity.setId(identity.getId());
-			if (5 == userIdentity.getAuditStatus()){
+			if (null != userIdentity.getAuditStatus() && 5 == userIdentity.getAuditStatus()){
 				User u = new User();
 				u.setId(userIdentity.getUid());
 				u.setLvl(1);

+ 1 - 1
src/main/resources/props/config_dev.properties

@@ -51,7 +51,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.22
+static.host=//afts.hnzhiming.com/1.0.23
 
 upload.path=/data/wwwroot/aft/upload
 upload.private.path=/data/upload

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.22
+static.host=//afts.hnzhiming.com/1.0.23
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc

+ 1 - 1
src/main/resources/props/config_prod.properties

@@ -51,4 +51,4 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.22
+static.host=//afts.hnzhiming.com/1.0.23

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//aftts.hnzhiming.com/1.0.22
+static.host=//aftts.hnzhiming.com/1.0.23
 
 upload.path=/data/aft/public/upload
 upload.private.path=/data/aft/private/upload