Antiloveg 8 years ago
parent
commit
7553e935fc

+ 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;
+	}
+
+}

+ 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);