Antiloveg 8 years ago
parent
commit
365df34864

+ 9 - 7
src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java

@@ -47,6 +47,7 @@ import com.goafanti.common.enums.PatentRegistrationFields;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.OrgRatepay;
+import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
@@ -93,6 +94,8 @@ public class AdminPatentApiController extends CertifyApiController {
 	private AftFileService					aftFileService;
 	@Resource
 	private OrgRatepayService				orgRatepayService;
+	@Resource
+	private OrganizationIdentityService		organizationIdentityService;
 
 	@Value(value = "${aesSecretKey}")
 	private String							secretKey	= null;
@@ -111,7 +114,7 @@ public class AdminPatentApiController extends CertifyApiController {
 					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
+
 		if (ids == null || ids.length < 1) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
 			return res;
@@ -121,7 +124,7 @@ public class AdminPatentApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转状态", "流转状态"));
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(pi.getPrincipal())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人", "负责人"));
 			return res;
@@ -322,7 +325,7 @@ public class AdminPatentApiController extends CertifyApiController {
 		if (null == ratepay) {
 			return res;
 		}
-		
+
 		Map<String, String> map = new TreeMap<String, String>();
 		map.put("id", ratepay.getId());
 		map.put("year", ratepay.getYear().toString());
@@ -432,7 +435,8 @@ public class AdminPatentApiController extends CertifyApiController {
 				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
 				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
 			if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
-				downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
+				OrganizationIdentity oi = organizationIdentityService.selectOrgIdentityByUserId(pi.getUid());
+				downloadFile(response, oi.getPatentProryStatementDownloadFileName(), oi.getPatentProryStatementUrl());
 			} else if (attachmentType == AttachmentType.PATENT_WRITING) {
 				downloadFile(response, pi.getPatentWritingDownloadFileName(), pi.getPatentWritingUrl());
 			} else if (attachmentType == AttachmentType.AUTHORIZATION_NOTICE) {
@@ -446,8 +450,6 @@ public class AdminPatentApiController extends CertifyApiController {
 		return res;
 	}
 
-	
-
 	/**
 	 * 下载模版文件(专利代理委托书)
 	 * 
@@ -898,7 +900,7 @@ public class AdminPatentApiController extends CertifyApiController {
 		List<Admin> list = adminService.selectPatentPrincipal();
 		Map<String, String> map = new TreeMap<String, String>();
 		for (Admin o : list) {
-			map.put(o.getId(), o.getName()+ " " + o.getPosition());
+			map.put(o.getId(), o.getName() + " " + o.getPosition());
 		}
 		res.setData(map);
 		return res;

+ 14 - 10
src/main/java/com/goafanti/admin/controller/AdminUserCertifyApiController.java

@@ -36,10 +36,10 @@ import com.goafanti.user.service.UserIdentityService;
 @RequestMapping(value = "/api/admin/userCertify")
 public class AdminUserCertifyApiController extends CertifyApiController {
 	@Resource
-	private UserIdentityService userIdentityService;
-	
+	private UserIdentityService			userIdentityService;
+
 	@Resource
-	private OrganizationIdentityService organizationIdentityService;
+	private OrganizationIdentityService	organizationIdentityService;
 
 	/**
 	 * 上传认证资料(营业执照图片、组织机构代码证图片、上年度纳税申报表)
@@ -61,21 +61,22 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 		if (attachmentType == AttachmentType.ORGCODE || attachmentType == AttachmentType.LICENCE) {
 			res.setData(handleFiles(res, "/identity/", true, req, sign, uid));
 		} else if (attachmentType == AttachmentType.RATEPAY) {
-			sign = sign + "_" + (Calendar.getInstance().get(Calendar.YEAR)-1);
+			sign = sign + "_" + (Calendar.getInstance().get(Calendar.YEAR) - 1);
 			res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 审核员--个人用户详情
+	 * 
 	 * @param uid
 	 * @return
 	 */
 	@RequestMapping(value = "/userDetail", method = RequestMethod.GET)
-	public Result userDetail(String uid){
+	public Result userDetail(String uid) {
 		Result res = new Result();
 		if (StringUtils.isBlank(uid)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
@@ -84,9 +85,10 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 		res.setData(userIdentityService.selectAuditorUserIdentityByUserId(uid));
 		return res;
 	}
-	
+
 	/**
 	 * 审核员审核个人用户信息
+	 * 
 	 * @param userIdentity
 	 * @param bindingResult
 	 * @param paymentDateFormattedDate
@@ -94,7 +96,7 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
 	public Result disposeUser(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
-			String paymentDateFormattedDate, String aid, String mid){
+			String paymentDateFormattedDate, String aid, String mid) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -148,9 +150,10 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 审核员---团体用户详情
+	 * 
 	 * @param uid
 	 * @return
 	 */
@@ -164,9 +167,10 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 		res.setData(organizationIdentityService.selectAuditorOrgIdentityDetailByUserId(uid));
 		return res;
 	}
-	
+
 	/**
 	 * 审核员审核团体用户信息
+	 * 
 	 * @param orgIdentity
 	 * @param bindingResult
 	 * @param paymentDateFormattedDate

+ 8 - 4
src/main/java/com/goafanti/common/controller/PreviewController.java

@@ -35,6 +35,7 @@ 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.OrganizationIdentity;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.utils.DateUtils;
@@ -45,6 +46,7 @@ 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.OrganizationIdentityService;
 import com.goafanti.user.service.UserService;
 
 @Controller
@@ -81,6 +83,8 @@ public class PreviewController extends BaseApiController {
 	private OrgHonorDatumService			OrgHonorDatumService;
 	@Resource
 	private OrgStandardService				orgStandardService;
+	@Resource
+	private OrganizationIdentityService		organizationIdentityService;
 
 	@Value(value = "${aesSecretKey}")
 	private String							secretKey	= null;
@@ -223,7 +227,7 @@ public class PreviewController extends BaseApiController {
 				break;
 			case STANDARD:
 				OrgStandard os = orgStandardService.selectByPrimaryKey(token);
-				if (null == os){
+				if (null == os) {
 					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "预览"));
 					return res;
 				} else {
@@ -237,10 +241,10 @@ 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());
+		OrganizationIdentity oi = organizationIdentityService.selectOrgIdentityByUserId(pi.getUid());
+			downloadFile(response, oi.getPatentProryStatementDownloadFileName(), oi.getPatentProryStatementUrl());
 		} else if (attachmentType == AttachmentType.PATENT_WRITING) {
 			downloadFile(response, pi.getPatentWritingDownloadFileName(), pi.getPatentWritingUrl());
 		} else if (attachmentType == AttachmentType.AUTHORIZATION_NOTICE) {
@@ -332,7 +336,7 @@ public class PreviewController extends BaseApiController {
 			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());

+ 4 - 2
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -1088,7 +1088,8 @@
 			licence_area as licenceArea, licence_scanning_url as licenceScanningUrl, org_code as orgCode,
 			org_code_url as orgCodeUrl, banks, bank_branch as bankBranch, bank_card_number as bankCardNumber,
 			location_province as locationProvince, location_city as locationCity, location_area as locationArea,
-			validation_amount as validationAmount, payment_date as paymentDate, audit_status as auditStatus
+			validation_amount as validationAmount, payment_date as paymentDate, audit_status as auditStatus, 
+			last_year_tax_report_url as lastYearTaxReportUrl
 		from organization_identity 
 		where uid = #{uid,jdbcType=VARCHAR}
 	</select>
@@ -1104,7 +1105,8 @@
 			 oi.licence_area as licenceArea,  oi.licence_scanning_url as licenceScanningUrl,  oi.org_code as orgCode,
 			 oi.org_code_url as orgCodeUrl,  oi.banks, bank_branch as bankBranch,  oi.bank_card_number as bankCardNumber,
 			 oi.location_province as locationProvince,  oi.location_city as locationCity,  oi.location_area as locationArea,
-			 oi.validation_amount as validationAmount,  oi.payment_date as paymentDate,  oi.audit_status as auditStatus
+			 oi.validation_amount as validationAmount,  oi.payment_date as paymentDate,  oi.audit_status as auditStatus,
+			 oi.last_year_tax_report_url as lastYearTaxReportUrl
 		from user u 
 		LEFT JOIN organization_identity oi on oi.uid = u.id
 		where uid = #{uid,jdbcType=VARCHAR}

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

@@ -162,10 +162,10 @@
         type = #{type,jdbcType=INTEGER},
       </if>
       <if test="aid != null">
-        aid = #{aid,jdbcType=VARCHAR}
+        aid = #{aid,jdbcType=VARCHAR},
       </if>
       <if test="mid != null">
-        mid = #{mid,jdbcType=VARCHAR}
+        mid = #{mid,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}

+ 16 - 13
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -27,6 +27,7 @@ import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftFile;
+import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.common.model.User;
@@ -62,6 +63,8 @@ public class PatentApiController extends CertifyApiController {
 	private UserService						userService;
 	@Resource
 	private AftFileService					aftFileService;
+	@Resource
+	private OrganizationIdentityService		organizationIdentityService;
 
 	@Value(value = "${upload.private.path}")
 	private String							uploadPrivatePath	= null;
@@ -83,10 +86,12 @@ public class PatentApiController extends CertifyApiController {
 		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
+		if (attachmentType == AttachmentType.PATENT_WRITING
 				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
 				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
 			res.setData(handleFiles(res, "/patent/", true, req, sign, TokenManager.getUserId()));
+		} else if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT){
+			res.setData(handleFile(res, "/identity/", true, req, sign));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
 		}
@@ -122,7 +127,8 @@ public class PatentApiController extends CertifyApiController {
 				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
 				|| attachmentType == AttachmentType.PATENT_CERTIFICATE) {
 			if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
-				downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
+				OrganizationIdentity oi = organizationIdentityService.selectOrgIdentityByUserId(pi.getUid());
+				downloadFile(response, oi.getPatentProryStatementDownloadFileName(), oi.getPatentProryStatementUrl());
 			} else if (attachmentType == AttachmentType.PATENT_WRITING) {
 				downloadFile(response, pi.getPatentWritingDownloadFileName(), pi.getPatentWritingUrl());
 			} else if (attachmentType == AttachmentType.AUTHORIZATION_NOTICE) {
@@ -297,17 +303,14 @@ public class PatentApiController extends CertifyApiController {
 	/**
 	 * 获取公司
 	 *//*
-	@RequestMapping(value = "/getUnitNames", method = RequestMethod.GET)
-	public Result getUnitNames() {
-		Result res = new Result();
-		List<OrganizationIdentity> list = organizationIdentityServivce.selectAllOrgIndentity();
-		Map<String, String> map = new TreeMap<String, String>();
-		for (OrganizationIdentity o : list) {
-			map.put(o.getUid(), o.getUnitName());
-		}
-		res.setData(map);
-		return res;
-	}*/
+		 * @RequestMapping(value = "/getUnitNames", method = RequestMethod.GET)
+		 * public Result getUnitNames() { Result res = new Result();
+		 * List<OrganizationIdentity> list =
+		 * organizationIdentityServivce.selectAllOrgIndentity(); Map<String,
+		 * String> map = new TreeMap<String, String>(); for
+		 * (OrganizationIdentity o : list) { map.put(o.getUid(),
+		 * o.getUnitName()); } res.setData(map); return res; }
+		 */
 
 	/**
 	 * 获取管理员

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

@@ -360,7 +360,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setComment(patentInfo.getPatentDes());
 		patentLogMapper.insert(log);
 
-		if (!StringUtils.isBlank(patentInfo.getPatentProryStatementUrl()) && TokenManager.getToken() instanceof Admin) {
+		if (!StringUtils.isBlank(patentInfo.getPatentProryStatementUrl())) {
 			OrganizationIdentity oi = organizationIdentityMapper.selectOrgIdentityByUserId(patentInfo.getUid());
 			oi.setPatentProryStatementUrl(patentInfo.getPatentProryStatementUrl());
 			organizationIdentityMapper.updateByPrimaryKeySelective(oi);

+ 12 - 3
src/main/java/com/goafanti/user/bo/OrgIdentityDetailBo.java

@@ -34,7 +34,6 @@ public class OrgIdentityDetailBo {
 	 */
 	private String		firstContacts;
 
-
 	/**
 	 * 第一联系人电话
 	 */
@@ -154,6 +153,18 @@ public class OrgIdentityDetailBo {
 	 * 审核状态
 	 */
 	private Integer		auditStatus;
+	/**
+	 * 上年度纳税报表
+	 */
+	private String		lastYearTaxReportUrl;
+
+	public String getLastYearTaxReportUrl() {
+		return lastYearTaxReportUrl;
+	}
+
+	public void setLastYearTaxReportUrl(String lastYearTaxReportUrl) {
+		this.lastYearTaxReportUrl = lastYearTaxReportUrl;
+	}
 
 	public String getId() {
 		return id;
@@ -388,8 +399,6 @@ public class OrgIdentityDetailBo {
 	public void setAuditStatus(Integer auditStatus) {
 		this.auditStatus = auditStatus;
 	}
-	
-	
 
 	public String getFirstContacts() {
 		return firstContacts;

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

@@ -150,7 +150,8 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 
 			Calendar cal = Calendar.getInstance();
 			if (null != orgIdentity.getLastYearTaxReportUrl()) {
-				if (null == orgRatepayMapper.selectRatepayByUidAndYear(orgIdentity.getUid(), Calendar.YEAR - 1)) {
+				OrgRatepay rate = orgRatepayMapper.selectRatepayByUidAndYear(orgIdentity.getUid(), Calendar.YEAR - 1);
+				if (null == rate) {
 					OrgRatepay r = new OrgRatepay();
 					r.setId(UUID.randomUUID().toString());
 					r.setUid(orgIdentity.getUid());
@@ -158,11 +159,14 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 					r.setDeletedSign(0);
 					r.setTaxReturnUrl(orgIdentity.getLastYearTaxReportUrl());
 					orgRatepayMapper.insert(r);
+				} else {
+					rate.setTaxReturnUrl(orgIdentity.getLastYearTaxReportUrl());
+					orgRatepayMapper.updateByPrimaryKeySelective(rate);
 				}
 			}
 		}
 		User user = userMapper.selectByPrimaryKey(orgIdentity.getUid());
-		if (!TokenManager.hasRole(AFTConstants.AUDITORADMIN)){
+		if (!TokenManager.hasRole(AFTConstants.AUDITORADMIN) && !TokenManager.hasRole(AFTConstants.SUPERADMIN)){
 			user.setAid(TokenManager.getAdminId());
 			createAuditorNotice(user);
 		} else {
@@ -224,7 +228,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			userMapper.updateByPrimaryKeySelective(u);
 			createAuditorNotice(u);
 		}
-		if (TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+		if (TokenManager.hasRole(AFTConstants.AUDITORADMIN) || TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			u.setAid(aid);
 			u.setMid(mid);
 			if (IdentityAuditStatus.PASSED.getCode() == oi.getAuditStatus()) {

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

@@ -94,7 +94,7 @@ public class UserIdentityServiceImpl implements UserIdentityService{
 			userMapper.updateByPrimaryKeySelective(user);
 		} 
 		User user = userMapper.selectByPrimaryKey(u.getUid());
-		if (!TokenManager.hasRole(AFTConstants.AUDITORADMIN)){
+		if (!TokenManager.hasRole(AFTConstants.AUDITORADMIN) && !TokenManager.hasRole(AFTConstants.SUPERADMIN)){
 			user.setAid(TokenManager.getAdminId());
 			createAuditorNotice(user);
 		} else {
@@ -119,7 +119,7 @@ public class UserIdentityServiceImpl implements UserIdentityService{
 			userMapper.updateByPrimaryKeySelective(u);
 			createAuditorNotice(u);
 		}
-		if (TokenManager.hasRole(AFTConstants.AUDITORADMIN)){
+		if (TokenManager.hasRole(AFTConstants.AUDITORADMIN) || TokenManager.hasRole(AFTConstants.SUPERADMIN)){
 			u.setAid(aid);
 			u.setMid(mid);
 			if (IdentityAuditStatus.PASSED.getCode() == ui.getAuditStatus()){

+ 14 - 11
src/main/webapp/WEB-INF/views/header.jsp

@@ -64,38 +64,41 @@
 	window.showOrgList = true;
 	window.showPermissionList = true;
 	window.showRoleList = true;
+	window.showAuditStatus = true;
 	</shiro:hasRole>
 
 	<shiro:hasPermission name="admin/userManage">
-		window.showUserManage = true;
+	window.showUserManage = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="admin/services">
-		window.showServices = true;
+	window.showServices = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="admin/achievement">
-		window.showAchievement = true;
+	window.showAchievement = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="admin/demand">
-		window.showDemand = true;
+	window.showDemand = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="admin/idea">
-		window.showIdea = true;
+	window.showIdea = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="admin/customer">
-		window.showCustomer = true;
+	window.showCustomer = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="api/admin/userList">
-		window.showUserList = true;
+	window.showUserList = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="api/admin/orgList">
-		window.showOrgList = true;
+	window.showOrgList = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="api/admin/permissionList">
-		window.showPermissionList = true;
+	window.showPermissionList = true;
 	</shiro:hasPermission>
 	<shiro:hasPermission name="api/admin/roleList">
-		window.showRoleList = true;
+	window.showRoleList = true;
+	</shiro:hasPermission>
+	<shiro:hasPermission name="api/admin/auditStatus">
+	window.showAuditStatus = true;
 	</shiro:hasPermission>
-	
 </script>
 <script type="text/javascript" src="${staticHost}/vendors.js"></script>