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

Merge branch 'master' of https://git.coding.net/aft/AFT

wubb лет назад: 8
Родитель
Сommit
d5f4836881
28 измененных файлов с 372 добавлено и 98 удалено
  1. 6 1
      schema/data/permission.sql
  2. 16 5
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 6 1
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  4. 1 1
      src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java
  5. 30 16
      src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java
  6. 2 0
      src/main/java/com/goafanti/common/controller/BaseController.java
  7. 15 10
      src/main/java/com/goafanti/common/controller/PortalController.java
  8. 0 3
      src/main/java/com/goafanti/common/controller/PublicController.java
  9. 9 3
      src/main/java/com/goafanti/common/controller/WebpageController.java
  10. 4 2
      src/main/java/com/goafanti/common/dao/CopyrightInfoMapper.java
  11. 11 0
      src/main/java/com/goafanti/common/dao/OrgCognizanceMapper.java
  12. 4 2
      src/main/java/com/goafanti/common/dao/PatentInfoMapper.java
  13. 4 2
      src/main/java/com/goafanti/common/dao/TechProjectMapper.java
  14. 8 4
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  15. 31 5
      src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml
  16. 68 5
      src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml
  17. 4 1
      src/main/java/com/goafanti/common/mapper/OrgRatepayMapper.xml
  18. 34 8
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  19. 33 6
      src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml
  20. 4 1
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  21. 1 1
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  22. 1 2
      src/main/java/com/goafanti/common/utils/FileUtils.java
  23. 30 0
      src/main/java/com/goafanti/portal/bo/UserSubscriberListBo.java
  24. 16 13
      src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java
  25. 14 2
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  26. 2 2
      src/main/webapp/WEB-INF/views/common.html
  27. 2 2
      src/main/webapp/WEB-INF/views/portal/search/subscriber.html
  28. 16 0
      src/main/webapp/WEB-INF/views/portal/search/subscriberUser.html

+ 6 - 1
schema/data/permission.sql

@@ -504,4 +504,9 @@ values
 
 insert into `permission`(`id`, `url`, `name`) 
 values
-(UUID(), 'api/admin/deleteHumanResource', '企业人员情况--删除团体人力资源');
+(UUID(), 'api/admin/deleteHumanResource', '企业人员情况--删除团体人力资源');
+
+insert into `permission`(`id`, `url`, `name`) 
+values
+(UUID(), 'api/admin/cognizanceRecord/search', '高企信息管理--高企信息查询'),
+(UUID(), 'api/admin/cognizanceRecord/import', '高企信息管理--高企信息批量导入');

+ 16 - 5
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -203,13 +203,19 @@ public class AdminApiController extends CertifyApiController {
 	 * 统计专利、软著及科技项目申报业务情况
 	 */
 	@RequestMapping(value = "/getBusinessCount", method = RequestMethod.GET)
-	public Result countBusiness(String uid) {
+	public Result countBusiness(String uid, Integer year) {
 		Result res = new Result();
 		if (StringUtils.isBlank(uid)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户ID"));
 			return res;
 		}
-		res.setData(orgCognizanceService.countBusiness(uid));
+
+		if (null == year) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
+			return res;
+		}
+
+		res.setData(orgCognizanceService.countBusiness(uid, year));
 		return res;
 	}
 
@@ -1039,6 +1045,11 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
+		
+		if (null == orgIntellectualProperty.getCatagory()){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到类别", "类别"));
+			return res;
+		}
 		if (!checkCertify(res, orgIntellectualProperty.getUid()).getError().isEmpty()) {
 			return res;
 		}
@@ -1071,7 +1082,7 @@ public class AdminApiController extends CertifyApiController {
 				res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
 				return res;
 			}
-			oip.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
+			oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
 			res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(oip));
 		}
 		return res;
@@ -2683,10 +2694,10 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (year - oc.getYear() != 0) {
+		/*if (year - oc.getYear() != 0) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高企ID及年份"));
 			return res;
-		}
+		}*/
 
 		res.setData(handleCognizanceDetail(uid, cid, year));
 		return res;

+ 6 - 1
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -1642,6 +1642,11 @@ public class CognizanceApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "知识产权编号", "知识产权编号"));
 			return res;
 		}
+		
+		if (null == orgIntellectualProperty.getCatagory()){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到类别", "类别"));
+			return res;
+		}
 
 		OrgIntellectualProperty p = orgIntellectualPropertyService.findByUidAndIntellectualPropertyNumber(
 				TokenManager.getUserId(), orgIntellectualProperty.getIntellectualPropertyNumber());
@@ -1672,7 +1677,7 @@ public class CognizanceApiController extends CertifyApiController {
 				res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
 				return res;
 			}
-			oip.setEvaluationCategory(oip.getCatagory() <= 2 ? 1 : 0);
+			oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
 			res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(oip));
 		}
 		return res;

+ 1 - 1
src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java

@@ -52,7 +52,7 @@ public interface OrgCognizanceService {
 
 	Integer selectLatelyRecordYear(String uid);
 
-	BusinessCountBo countBusiness(String uid);
+	BusinessCountBo countBusiness(String uid, Integer year);
 
 	OrgCognizance saveCognizance(OrgCognizance oc, String salesman);
 

+ 30 - 16
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -45,6 +45,7 @@ import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgCognizance;
 import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.common.model.OrgCognizanceProportion;
+import com.goafanti.common.model.OrgHumanResource;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.User;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -166,15 +167,27 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 			cog.setGrossProfit3(
 					null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
 		}
-
-		CognizanceCatagoryBo catagory = orgCognizanceMapper.selectCognizanceCatagoryBoByUidAndYear(year, uid);
-		if (null != catagory) {
-			cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
-			cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
-			cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
-			cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
-			cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
+		Integer firstCatagory = orgCognizanceMapper.findFirstCatagory(year, uid);
+		Integer secondCatagory = orgCognizanceMapper.findSecondCatagory(year, uid);
+		OrgHumanResource ohr = orgCognizanceMapper.findFirmAndTechTotal(year, uid);
+		BigDecimal totalRevenue = orgCognizanceMapper.findTotalRevenue(year, uid);
+		/*
+		 * CognizanceCatagoryBo catagory =
+		 * orgCognizanceMapper.selectCognizanceCatagoryBoByUidAndYear(year,
+		 * uid); if (null != catagory) {
+		 */
+		cog.setFirstCatagory(null == firstCatagory ? 0 : firstCatagory);
+		cog.setSecondCatagory(null == secondCatagory ? 0 : secondCatagory);
+		if (null != ohr) {
+			cog.setFirmTotal(null == ohr.getFirmTotal() ? 0 : ohr.getFirmTotal());
+			cog.setTechTotal(null == ohr.getTechTotal() ? 0 : ohr.getTechTotal());
+		} else {
+			cog.setFirmTotal(0);
+			cog.setTechTotal(0);
 		}
+		cog.setTotalRevenue(null == totalRevenue ? new BigDecimal(0) : totalRevenue);
+		// }
+
 		BigDecimal revenue = orgCognizanceMapper.selectLastYearRevenueByUidAndYear(year, uid); // 上年度销售收入
 		cog.setLastYearRevenue(null == revenue ? new BigDecimal(0) : revenue);
 		return cog;
@@ -234,7 +247,8 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 				cog.setAcceptDate(recordTime);
 			} else if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.ISSUING) {
 				cog.setIssuingDate(recordTime);
-				o.setCertificateNumber(StringUtils.isBlank(cog.getCertificateNumber()) ? "" : cog.getCertificateNumber());
+				o.setCertificateNumber(
+						StringUtils.isBlank(cog.getCertificateNumber()) ? "" : cog.getCertificateNumber());
 				o.setIssuingDate(recordTime);
 				o.setCogContacts(null == cog.getContacts() ? null : cog.getContacts());
 				organizationIdentityMapper.updateByPrimaryKeySelective(o);
@@ -348,15 +362,15 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	}
 
 	@Override
-	public BusinessCountBo countBusiness(String uid) {
+	public BusinessCountBo countBusiness(String uid, Integer year) {
 		BusinessCountBo bcb = new BusinessCountBo();
 		bcb.setUid(uid);
-		bcb.setCopyrightDone(copyrightInfoMapper.countCopyrightDone(uid));
-		bcb.setCopyrightUndone(copyrightInfoMapper.countCopyrightUnDone(uid));
-		bcb.setPatentDone(patentInfoMapper.countPatentDone(uid));
-		bcb.setPatentUndone(patentInfoMapper.countPatentUndone(uid));
-		bcb.setTechProjectDone(techProjectMapper.countTechProjectDone(uid));
-		bcb.setTechProjectUndone(techProjectMapper.countTechProjectUndone(uid));
+		bcb.setCopyrightDone(copyrightInfoMapper.countCopyrightDone(uid, year));
+		bcb.setCopyrightUndone(copyrightInfoMapper.countCopyrightUnDone(uid, year));
+		bcb.setPatentDone(patentInfoMapper.countPatentDone(uid, year));
+		bcb.setPatentUndone(patentInfoMapper.countPatentUndone(uid, year));
+		bcb.setTechProjectDone(techProjectMapper.countTechProjectDone(uid, year));
+		bcb.setTechProjectUndone(techProjectMapper.countTechProjectUndone(uid, year));
 		return bcb;
 	}
 

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

@@ -117,11 +117,13 @@ public class BaseController {
 		if (TokenManager.isLogin() && TokenManager.getToken() instanceof User) {
 			model.addAttribute("userData", TokenManager.getUserToken());
 			model.addAttribute("userName", TokenManager.getUserToken().getNickname());
+			model.addAttribute("isAdmin", false);
 		}
 
 		if (TokenManager.isLogin() && TokenManager.getToken() instanceof Admin) {
 			model.addAttribute("adminData", TokenManager.getAdminToken());
 			model.addAttribute("userName", TokenManager.getAdminToken().getName());
+			model.addAttribute("isAdmin", true);
 		}
 	}
 }

+ 15 - 10
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -172,14 +172,16 @@ public class PortalController extends BaseController {
 						if (null != bo.getMaturity()) {
 							bo.setMaturityS(bo.getMaturity() * MULTIPLE + "%");
 						}
-						if (null != bo.getTransferPrice()) {
-							bo.setTransferPriceS(bo.getTransferPrice() + UNIT);
-						} else {
-							bo.setTransferPriceS(PRICE_NEGOTIABLE);
-						}
+
 						if (null == bo.getBargainingMode()
 								|| AchievementBargainingMode.NEGOTIABLE.getCode().equals(bo.getBargainingMode())) {
 							bo.setTransferPriceS(PRICE_NEGOTIABLE);
+						} else {
+							if (null != bo.getTransferPrice()) {
+								bo.setTransferPriceS(bo.getTransferPrice() + UNIT);
+							} else {
+								bo.setTransferPriceS(PRICE_NEGOTIABLE);
+							}
 						}
 					}
 				}
@@ -231,15 +233,18 @@ public class PortalController extends BaseController {
 			String province = achievement.getProvince();
 			String city = achievement.getCity();
 			location += (StringUtils.isBlank(province) ? "" : province) + (StringUtils.isBlank(city) ? "" : city);
-			if (null != achievement.getTransferPrice()) {
-				achievement.setTransferPriceS(achievement.getTransferPrice() + UNIT);
-			} else {
-				achievement.setTransferPriceS(PRICE_NEGOTIABLE);
-			}
+
 			if (null == achievement.getBargainingMode()
 					|| AchievementBargainingMode.NEGOTIABLE.equals(achievement.getBargainingMode())) {
 				achievement.setTransferPriceS(PRICE_NEGOTIABLE);
+			} else {
+				if (null != achievement.getTransferPrice()) {
+					achievement.setTransferPriceS(achievement.getTransferPrice() + UNIT);
+				} else {
+					achievement.setTransferPriceS(PRICE_NEGOTIABLE);
+				}
 			}
+
 			achievement.setLocation(location);
 
 		}

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

@@ -209,7 +209,6 @@ public class PublicController extends BaseController {
 			}
 		} catch (IOException e) {
 			LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
-			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));
 		} finally {
 			try {
 				if (null != in) {
@@ -217,7 +216,6 @@ public class PublicController extends BaseController {
 				}
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
-				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));
 			}
 			try {
 				if (null != out) {
@@ -225,7 +223,6 @@ public class PublicController extends BaseController {
 				}
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
-				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));
 			}
 		}
 		return res;

+ 9 - 3
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -176,9 +176,15 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 
-	@RequestMapping(value = "/portal/search/subscriber", method = RequestMethod.GET)
-	public ModelAndView portalSearchSubscriber(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/portal/search/subscriber");
+	@RequestMapping(value = "/portal/search/subscriberUser", method = RequestMethod.GET)
+	public ModelAndView portalSearchSubscriberUser(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/search/subscriberUser");
+		return modelview;
+	}
+	
+	@RequestMapping(value = "/portal/search/subscriberOrg", method = RequestMethod.GET)
+	public ModelAndView portalSearchSubscriberOrg(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/search/subscriberOrg");
 		return modelview;
 	}
 	

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

@@ -3,6 +3,8 @@ package com.goafanti.common.dao;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.copyright.bo.CopyrightContractListBo;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
@@ -31,7 +33,7 @@ public interface CopyrightInfoMapper {
 
 	List<CopyrightInfo> selectByPrimaryKeys(List<String> asList);
 
-	Integer countCopyrightDone(String uid);
+	Integer countCopyrightDone(@Param("uid")String uid, @Param("year")Integer year);
 
 	List<CopyrightContractListBo> listContractCopyrightByContractId(String contractId);
 
@@ -41,5 +43,5 @@ public interface CopyrightInfoMapper {
 
 	Integer findCopyrightInfoNumByUid(String uid);
 
-	Integer countCopyrightUnDone(String uid);
+	Integer countCopyrightUnDone(@Param("uid")String uid, @Param("year")Integer year);
 }

+ 11 - 0
src/main/java/com/goafanti/common/dao/OrgCognizanceMapper.java

@@ -3,12 +3,15 @@ package com.goafanti.common.dao;
 import java.math.BigDecimal;
 import java.util.List;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.cognizance.bo.CognizanceCatagoryBo;
 import com.goafanti.cognizance.bo.CognizanceContractBo;
 import com.goafanti.cognizance.bo.CognizanceManageCostBo;
 import com.goafanti.cognizance.bo.CognizanceOrgInfoBo;
 import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.common.model.OrgCognizance;
+import com.goafanti.common.model.OrgHumanResource;
 
 public interface OrgCognizanceMapper {
     int deleteByPrimaryKey(String id);
@@ -43,4 +46,12 @@ public interface OrgCognizanceMapper {
 
 	int batchDeleteByContractId(List<String> id);
 
+	Integer findFirstCatagory(@Param("year")Integer year, @Param("uid")String uid);
+
+	Integer findSecondCatagory(@Param("year")Integer year, @Param("uid")String uid);
+
+	OrgHumanResource findFirmAndTechTotal(@Param("year")Integer year, @Param("uid")String uid);
+
+	BigDecimal findTotalRevenue(@Param("year")Integer year, @Param("uid")String uid);
+
 }

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

@@ -3,6 +3,8 @@ package com.goafanti.common.dao;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.patent.bo.PatentAnnualFeeTaskBo;
 import com.goafanti.patent.bo.PatentContractListBo;
@@ -37,9 +39,9 @@ public interface PatentInfoMapper {
 
 	List<PatentInfo> selectByPrimaryKeys(List<String> id);
 
-	Integer countPatentDone(String uid);
+	Integer countPatentDone(@Param("uid")String uid, @Param("year")Integer year);
 
-	Integer countPatentUndone(String uid);
+	Integer countPatentUndone(@Param("uid")String uid, @Param("year")Integer year);
 
 	List<PatentExpireBo> selectExpireRecord();
 

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

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.common.model.TechProject;
 import com.goafanti.techproject.bo.TechProjectContractListBo;
 import com.goafanti.techproject.bo.TechProjectDetailBo;
@@ -24,9 +26,9 @@ public interface TechProjectMapper {
 
 	int batchDeleteByPrimaryKey(List<String> id);
 
-	Integer countTechProjectDone(String uid);
+	Integer countTechProjectDone(@Param("uid")String uid, @Param("year")Integer year);
 
-	Integer countTechProjectUndone(String uid);
+	Integer countTechProjectUndone(@Param("uid")String uid, @Param("year")Integer year);
 
 	List<OrgUnitNames> selectWebsiteUnitNames(String principal);
 

+ 8 - 4
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1164,7 +1164,8 @@
 		a.transfer_mode as transferMode,
 		interest.id as interestId,
 		u.lvl as level,
-		a.owner_name as ownerName
+		a.owner_name as ownerName,
+		a.bargaining_mode as bargainingMode
 	FROM
 		achievement a
 	LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
@@ -1197,7 +1198,8 @@
 		a.transfer_mode as transferMode,
 		interest.id as interestId,
 		u.lvl as level,
-		a.owner_name as ownerName
+		a.owner_name as ownerName,
+		a.bargaining_mode as bargainingMode
 	FROM
 		achievement a
 	LEFT JOIN <![CDATA[ user ]]> u on u.id = a.owner_id
@@ -1218,7 +1220,8 @@
 		a.maturity,
 		ui.province,
 		ui.city,
-		a.transfer_price as transferPrice
+		a.transfer_price as transferPrice,
+		a.bargaining_mode as bargainingMode
 	FROM
 		achievement a
 	LEFT JOIN user_identity ui ON ui.uid = a.owner_id
@@ -1239,7 +1242,8 @@
 		a.maturity,
 		oi.licence_province as province,
 		oi.licence_city as city,
-		a.transfer_price as transferPrice
+		a.transfer_price as transferPrice,
+		a.bargaining_mode as bargainingMode
 	FROM
 		achievement a
 	LEFT JOIN organization_identity oi ON oi.uid = a.owner_id

+ 31 - 5
src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml

@@ -435,16 +435,42 @@
 		</foreach>
   </select>
   
-  <select id="countCopyrightDone" parameterType="java.lang.String" resultType="java.lang.Integer">
-   select count(1) from copyright_info 
+  <select id="countCopyrightDone"  resultType="java.lang.Integer">
+   select 
+   		count(1) 
+   from copyright_info 
    where uid = #{uid,jdbcType=VARCHAR}
    and delete_sign = 0 and status in (8,9) 
+   and authorized_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+   and authorized_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
+   
   </select>
   
-  <select id="countCopyrightUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
-   select count(1) from copyright_info 
+  <select id="countCopyrightUndone"  resultType="java.lang.Integer">
+   select 
+   		count(1) 
+   from copyright_info 
    where uid = #{uid,jdbcType=VARCHAR}
-   and delete_sign = 0 and status <![CDATA[ < ]]> 8 
+   and delete_sign = 0 
+   and status <![CDATA[ < ]]> 8 
+   and authorized_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+   and authorized_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
   </select>
   
   <select id="listContractCopyrightByContractId" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightContractListBo">

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

@@ -454,12 +454,12 @@
 					and authorization_date >= 
 						(
 							select  
-								str_to_date(CONCAT(#{0}-2,'-01-01'), '%Y-%m-%d %H')
+								str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H')
 						)
 					and authorization_date  <![CDATA[ < ]]> 
 						(
 							select  
-								str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H')
+								str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H')
 						)
 					and deleted_sign = 0
 					GROUP BY uid
@@ -476,12 +476,12 @@
 					and authorization_date >= 
 						(
 							select  
-								str_to_date(CONCAT(#{0}-2,'-01-01'), '%Y-%m-%d %H')
+								str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H')
 						)
 					and authorization_date  <![CDATA[ < ]]> 
 						(
 							select  
-								str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H')
+								str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H')
 						)
 					GROUP BY uid
 				) b on b.uid = u.id
@@ -516,7 +516,7 @@
 		from org_tech_product 
 		where 
 			uid = #{1}
-			and year = #{0} 
+			and year = #{0}-1 
 			and deleted_sign = 0
   </select>
 	
@@ -610,4 +610,67 @@
 		#{item}
 	</foreach>
   </update>
+  
+  <select id="findFirstCatagory" resultType="java.lang.Integer">
+  		select 
+			count(1) as firstCatagory 
+			from org_intellectual_property 
+					where uid = #{uid,jdbcType=VARCHAR}
+					and evaluation_category= 0 
+					and deleted_sign = 0 
+					and authorization_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+					and authorization_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
+					and deleted_sign = 0
+					GROUP BY uid
+  </select>
+  
+  <select id="findSecondCatagory" resultType="java.lang.Integer">
+  	select 
+						count(1) as secondCatagory 
+					from org_intellectual_property 
+					where uid = #{uid,jdbcType=VARCHAR}
+					and evaluation_category = 1 
+					and deleted_sign = 0 
+					and authorization_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+					and authorization_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
+					GROUP BY uid
+  </select>
+  
+  <select id="findFirmAndTechTotal" resultType="com.goafanti.common.model.OrgHumanResource">
+		select 
+			uid, 
+						firm_total as firmTotal, 
+						tech_total as techTotal 
+					from org_human_resource 
+					where 
+						uid = #{uid,jdbcType=VARCHAR} 
+						and year = #{year,jdbcType=INTEGER}-1   
+						and deleted_sign = 0
+  </select>
+  
+  <select id="findTotalRevenue" resultType="java.math.BigDecimal">
+  SELECT 
+						(operating_income + non_operating_income - non_taxable_income) as totalRevenue
+					from org_ratepay 
+					where 
+						uid = #{uid,jdbcType=VARCHAR} 
+						and year = #{year,jdbcType=INTEGER}-1  
+						and deleted_sign = 0
+  </select>
 </mapper>

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

@@ -238,6 +238,9 @@
     select 
     <include refid="Base_Column_List" />
     from org_ratepay
-    where uid = #{0} and year = #{1} and deleted_sign = 0
+    where 
+    	uid = #{0} 
+    and year = #{1} 
+    and deleted_sign = 0
   </select>
 </mapper>

+ 34 - 8
src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml

@@ -983,16 +983,42 @@
 		</foreach>
 	</select>
 	
-  <select id="countPatentDone" parameterType="java.lang.String" resultType="java.lang.Integer">
-	   select count(1) from patent_info 
-	   where uid = #{uid,jdbcType=VARCHAR}
-	   and deleted_sign = 0 and patent_state in (12,13) 
+  <select id="countPatentDone"  resultType="java.lang.Integer">
+	 select 
+	  	 count(1) from patent_info 
+	 where uid = #{uid,jdbcType=VARCHAR}
+	 and deleted_sign = 0 
+	 and patent_state in (12,13) 
+	 and authorized_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+     and authorized_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
+	 
   </select>
   
-  <select id="countPatentUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
-	   select count(1) from patent_info 
-	   where uid = #{uid,jdbcType=VARCHAR}
-	   and deleted_sign = 0 and patent_state <![CDATA[ < ]]> 12 
+  <select id="countPatentUndone"  resultType="java.lang.Integer">
+    select 
+    	count(1) 
+    from patent_info 
+	where uid = #{uid,jdbcType=VARCHAR}
+	and deleted_sign = 0 
+	and patent_state <![CDATA[ < ]]> 12
+	and authorized_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+    and authorized_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
   </select>
   
   <select id="selectExpireRecord"  resultType="com.goafanti.patent.bo.PatentExpireBo">	

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

@@ -461,16 +461,43 @@
 	</foreach>
   </update>
   
-  <select id="countTechProjectDone" parameterType="java.lang.String" resultType="java.lang.Integer">
-	   select count(1) from tech_project 
+  <select id="countTechProjectDone"  resultType="java.lang.Integer">
+	   select 
+	   		count(1) 
+	   from tech_project 
 	   where uid = #{uid,jdbcType=VARCHAR}
-	   and deleted_sign = 0 and state in (6,8) 
+	   and 
+	   deleted_sign = 0 
+	   and state in (6,8) 
+	   and approved_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+   	   and approved_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						)
   </select>
   
-  <select id="countTechProjectUndone" parameterType="java.lang.String" resultType="java.lang.Integer">
-	   select count(1) from tech_project 
+  <select id="countTechProjectUndone"  resultType="java.lang.Integer">
+	   select 
+	   		count(1) 
+	   from tech_project 
 	   where uid = #{uid,jdbcType=VARCHAR}
-	   and deleted_sign = 0 and state in (1,2,3,4,5,7)
+	   and deleted_sign = 0 
+	   and state in (1,2,3,4,5,7)
+	   and approved_date >= 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER}-3,'-01-01'), '%Y-%m-%d %H')
+						)
+   	   and approved_date  <![CDATA[ < ]]> 
+						(
+							select  
+								str_to_date(CONCAT(#{year,jdbcType=INTEGER},'-01-01'), '%Y-%m-%d %H')
+						) 
   </select>
   
   <select id="selectWebsiteUnitNames" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgUnitNames">

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

@@ -418,7 +418,10 @@
 			ui.id as identityId, ui.province,
 			info.person_portrait_url as personPortraitUrl,
 			adc.achievement_count as achievementNum,
-			adc.demand_count as demandNum
+			adc.demand_count as demandNum,
+			uc.engaged_field as engagedField,
+			uc.work_unit as workUnit,
+			uc.position
 		FROM
 			<![CDATA[ user ]]> u
 		LEFT JOIN user_identity ui ON ui.uid = u.id

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

@@ -655,7 +655,7 @@
   		u.create_time as createTime, 
   	    u.number , 
   	    o.aft_username as aftUsername, 
-  	    o.audit_status as auditStatus, 
+  	    o.audit_status as orgAuditStatus, 
   	    a.name as adminName,
   	    o.unit_name as unitName, 
   	    ad.name as managerName

+ 1 - 2
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -104,8 +104,7 @@ public class FileUtils {
 				|| sign.indexOf("patent_certificate") != -1 || sign.indexOf("standard") != -1
 				|| sign.indexOf("demand_picture") != -1 || sign.indexOf("demand_text_file") != -1
 				|| sign.indexOf("achievement_technical_picture") != -1
-				|| sign.indexOf("achievement_maturity_picture") != -1
-				|| sign.indexOf("demand_order_file") != -1) {
+				|| sign.indexOf("achievement_maturity_picture") != -1 || sign.indexOf("demand_order_file") != -1) {
 			uniq = true;
 		}
 		String fileName = "";

+ 30 - 0
src/main/java/com/goafanti/portal/bo/UserSubscriberListBo.java

@@ -15,6 +15,36 @@ public class UserSubscriberListBo {
 
 	private String	province;
 
+	private String	engagedField;
+
+	private String	workUnit;
+
+	private String	position;
+
+	public String getEngagedField() {
+		return engagedField;
+	}
+
+	public void setEngagedField(String engagedField) {
+		this.engagedField = engagedField;
+	}
+
+	public String getWorkUnit() {
+		return workUnit;
+	}
+
+	public void setWorkUnit(String workUnit) {
+		this.workUnit = workUnit;
+	}
+
+	public String getPosition() {
+		return position;
+	}
+
+	public void setPosition(String position) {
+		this.position = position;
+	}
+
 	public String getUid() {
 		return uid;
 	}

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

@@ -129,17 +129,6 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 				u.setId(uid);
 				u.setLvl(1);
 				userMapper.updateByPrimaryKeySelective(u);
-				Calendar now = Calendar.getInstance();
-				if (null != o.getLastYearTaxReportUrl()
-						&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1)) {
-					OrgRatepay r = new OrgRatepay();
-					r.setId(UUID.randomUUID().toString());
-					r.setUid(uid);
-					r.setYear(now.get(Calendar.YEAR) - 1);
-					r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
-					r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
-					orgRatepayMapper.insert(r);
-				}
 			}
 			return organizationIdentityMapper.updateByPrimaryKeySelective(o);
 		}
@@ -180,8 +169,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			user.setLvl(UserLevel.GENERAL.getCode());
 			userMapper.updateByPrimaryKeySelective(user);
 			createNotice(user, oi.getAuditStatus());
-		}
-		if (IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())) {
+		} else {
 			/*
 			 * if (UserLevel.GENERAL.getCode().equals(level)) {
 			 * user.setLvl(UserLevel.CERTIFIED.getCode()); }
@@ -190,6 +178,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			user.setAid(aid);
 			user.setMid(mid);
 			userMapper.updateByPrimaryKeySelective(user);
+			disposeRatePay(oi, oi.getUid());
 			createNotice(user, oi.getAuditStatus());
 		}
 		return organizationIdentityMapper.updateByPrimaryKeySelective(oi);
@@ -356,4 +345,18 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		return bo;
 	}
 
+	private void disposeRatePay(OrganizationIdentity o, String uid) {
+		Calendar now = Calendar.getInstance();
+		if (null != o.getLastYearTaxReportUrl()
+				&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1)) {
+			OrgRatepay r = new OrgRatepay();
+			r.setId(UUID.randomUUID().toString());
+			r.setUid(uid);
+			r.setYear(now.get(Calendar.YEAR) - 1);
+			r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+			r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
+			orgRatepayMapper.insert(r);
+		}
+	}
+
 }

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

@@ -269,6 +269,16 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 			return (Pagination<OrgListBo>) findPage("findOrgListByPage", "findOrgCount", params, pageNo, pageSize);
 		} else if (TokenManager.hasRole(AFTConstants.AREAADMIN) || TokenManager.hasRole(AFTConstants.MANAGERADMIN)) {
+			List<Integer> provinceList = adminLocationMapper
+					.selectProvinceWhereCityIsNullByAdminId(TokenManager.getAdminId());
+			List<Integer> cityList = adminLocationMapper.selectCityByAdminId(TokenManager.getAdminId());
+			provinceList.addAll(cityList);
+			if (null != provinceList && provinceList.size() > 0) {
+				params.put("provinceList", provinceList);
+			}
+			if (null != cityList && cityList.size() > 0) {
+				params.put("cityList", cityList);
+			}
 			return (Pagination<OrgListBo>) findPage("findAreaManagerOrgListByPage", "findAreaManagerOrgCount", params,
 					pageNo, pageSize);
 		}
@@ -371,7 +381,8 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)) {
 			return disposeAchievementUserOwner(userIdentityMapper.selectManagerAchievementUserOwner(aid, name));
 		} else {
-			if (TokenManager.hasRole(AFTConstants.SUPERADMIN)|| TokenManager.hasRole(AFTConstants.TECHBROKER) || TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.TECHBROKER)
+					|| TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 				aid = null;
 			}
 			return disposeAchievementUserOwner(userIdentityMapper.selectAchievementUserOwner(aid, name));
@@ -383,7 +394,8 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)) {
 			return organizationIdentityMapper.selectManagerAchievementOrgOwner(aid, name);
 		} else {
-			if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.TECHBROKER) || TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.TECHBROKER)
+					|| TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 				aid = null;
 			}
 			return organizationIdentityMapper.selectAchievementOrgOwner(aid, name);

+ 2 - 2
src/main/webapp/WEB-INF/views/common.html

@@ -54,8 +54,8 @@
 				<li th:classappend="${subM=='demand'}? 'active'"><a th:href="${basePath + '/portal/search/demand.html'}">需求谷</a></li>
 				<li th:classappend="${subM=='tech'}? 'active'"><a th:href="${basePath + '/portal/search/achievement.html'}">技术海</a></li>
 				<!-- <li><a href="#">Idea</a></li> -->
-				<li th:classappend="${subM=='company'}? 'active'"><a th:href="${basePath + '/portal/search/subscriber.html'}">伙伴</a></li>
-				<li th:classappend="${subM=='person'}? 'active'"><a th:href="${basePath + '/portal/search/subscriber.html'}">行家</a></li>
+				<li th:classappend="${subM=='company'}? 'active'"><a th:href="${basePath + '/portal/search/subscriberOrg.html'}">伙伴</a></li>
+				<li th:classappend="${subM=='person'}? 'active'"><a th:href="${basePath + '/portal/search/subscriberUser.html'}">行家</a></li>
 				<!-- <li th:classappend="${subM=='international'}? 'active'"><a th:href="${basePath + '/portal/international/internationalIndex.html'}">国际业务</a></li> -->
 			</ul>
 		</li>

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/search/subscriber.html

@@ -3,14 +3,14 @@
 	xmlns:th="http://www.thymeleaf.org">
 <head th:replace="common::header(~{::title},~{::link})">
 	<title>伙伴搜索页面</title>
-	<link th:href="${staticHost+'/portal/search/subscriber.css'}" rel="stylesheet">
+	<link th:href="${staticHost+'/portal/search/subscriberOrg.css'}" rel="stylesheet">
 </head>
 <body>
 	<div id="root"></div>
 	
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
-		<script type="text/javascript" th:src="${staticHost+'/portal/search/subscriber.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/portal/search/subscriberOrg.js'}"></script>
 	</div>
 </body>
 </html>

+ 16 - 0
src/main/webapp/WEB-INF/views/portal/search/subscriberUser.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org">
+<head th:replace="common::header(~{::title},~{::link})">
+	<title>行家搜索页面</title>
+	<link th:href="${staticHost+'/portal/search/subscriberUser.css'}" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/portal/search/subscriberUser.js'}"></script>
+	</div>
+</body>
+</html>