Browse Source

Accept Merge Request #185 mg1.0.33 : (master -> test)

Merge Request: mg1.0.33
Created By: @Antiloveg
Accepted By: @Antiloveg
URL: https://coding.net/t/aft/p/AFT/git/merge/185
Antiloveg 8 years ago
parent
commit
f5823d0611
55 changed files with 1347 additions and 387 deletions
  1. 1 1
      pom.xml
  2. 2 3
      schema/20170626-activities-news-billings.sql
  3. 16 0
      schema/20170705-coganizance-record.sql
  4. 5 5
      src/main/java/com/goafanti/achievement/service/impl/AchievementOrderServiceImpl.java
  5. 4 0
      src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java
  6. 51 20
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  7. 102 0
      src/main/java/com/goafanti/admin/controller/AdminCognizanceRecordApiController.java
  8. 35 8
      src/main/java/com/goafanti/admin/controller/AdminContractApiController.java
  9. 27 11
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  10. 1 1
      src/main/java/com/goafanti/cognizance/service/OrgActivityCostService.java
  11. 1 1
      src/main/java/com/goafanti/cognizance/service/impl/OrgActivityCostServiceImpl.java
  12. 27 35
      src/main/java/com/goafanti/cognizance/service/impl/OrgActivityServiceImpl.java
  13. 13 0
      src/main/java/com/goafanti/cognizanceRecord/service/CoganizanceRecordService.java
  14. 68 0
      src/main/java/com/goafanti/cognizanceRecord/service/impl/CoganizanceRecordServiceImpl.java
  15. 8 0
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  16. 9 0
      src/main/java/com/goafanti/common/controller/PortalController.java
  17. 109 12
      src/main/java/com/goafanti/common/controller/PublicController.java
  18. 21 0
      src/main/java/com/goafanti/common/dao/CoganizanceRecordMapper.java
  19. 2 0
      src/main/java/com/goafanti/common/dao/ContractMapper.java
  20. 1 1
      src/main/java/com/goafanti/common/dao/OrgActivityCostMapper.java
  21. 1 3
      src/main/java/com/goafanti/common/dao/UserMapper.java
  22. 57 0
      src/main/java/com/goafanti/common/enums/AchievementBargainingMode.java
  23. 50 0
      src/main/java/com/goafanti/common/enums/MobileCodeCheckOverTimeSign.java
  24. 13 5
      src/main/java/com/goafanti/common/mapper/AchievementOrderMapper.xml
  25. 132 0
      src/main/java/com/goafanti/common/mapper/CoganizanceRecordMapper.xml
  26. 13 0
      src/main/java/com/goafanti/common/mapper/ContractMapper.xml
  27. 13 5
      src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml
  28. 1 0
      src/main/java/com/goafanti/common/mapper/OrgActivityCostMapper.xml
  29. 6 2
      src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml
  30. 7 3
      src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml
  31. 199 27
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  32. 61 0
      src/main/java/com/goafanti/common/model/CoganizanceRecord.java
  33. 1 1
      src/main/java/com/goafanti/common/model/UserInfo.java
  34. 38 18
      src/main/java/com/goafanti/common/utils/VerifyCodeUtils.java
  35. 35 8
      src/main/java/com/goafanti/contract/controller/ContractApiController.java
  36. 2 0
      src/main/java/com/goafanti/contract/service/ContractService.java
  37. 5 0
      src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java
  38. 10 1
      src/main/java/com/goafanti/core/shiro/cache/ShiroRedisCache.java
  39. 13 3
      src/main/java/com/goafanti/core/shiro/cache/ShiroRedisCacheManager.java
  40. 4 2
      src/main/java/com/goafanti/demand/service/impl/DemandOrderServiceImpl.java
  41. 6 0
      src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java
  42. 10 0
      src/main/java/com/goafanti/portal/bo/AchievementPortalDetailBo.java
  43. 12 0
      src/main/java/com/goafanti/portal/bo/AchievementPortalSimilarListBo.java
  44. 10 0
      src/main/java/com/goafanti/user/bo/UserListBo.java
  45. 43 107
      src/main/java/com/goafanti/user/controller/UserApiController.java
  46. 5 4
      src/main/java/com/goafanti/user/service/UserService.java
  47. 69 6
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  48. 1 1
      src/main/resources/props/config_dev.properties
  49. 1 1
      src/main/resources/props/config_local.properties
  50. 1 1
      src/main/resources/props/config_test.properties
  51. 18 2
      src/main/resources/props/error.properties
  52. 3 1
      src/main/resources/shiro_base_auth.ini
  53. 3 0
      src/main/resources/spring/spring-shiro.xml
  54. 1 20
      src/main/webapp/WEB-INF/views/portal/news/newsDetails.html
  55. 0 68
      src/main/webapp/WEB-INF/views/portal/news/newsIndex.html

+ 1 - 1
pom.xml

@@ -14,7 +14,7 @@
 		<java-version>1.8</java-version>
 		<org.springframework-version>4.2.5.RELEASE</org.springframework-version>
 		<org.slf4j-version>1.7.21</org.slf4j-version>
-		<shiro-version>1.2.6</shiro-version>
+		<shiro-version>1.3.2</shiro-version>
 		<mybatis-version>3.2.8</mybatis-version>
 		<mybatis-spring-version>1.2.2</mybatis-spring-version>
 		<org.aspectj-version>1.6.10</org.aspectj-version>

+ 2 - 3
schema/20170626-activities-news-billings.sql

@@ -3,12 +3,13 @@ CREATE TABLE `news` (
   `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   `edit_time` datetime DEFAULT NULL COMMENT '修改时间',
   `title` varchar(45) DEFAULT NULL COMMENT '标题',
+  `title_img` varchar(128) DEFAULT NULL COMMENT '题图url',
   `author` varchar(45) DEFAULT NULL COMMENT '作者',
   `type` int(2) NOT NULL DEFAULT '0' COMMENT '类型',
   `content` longtext COMMENT '内容',
   `hot` int(1) NOT NULL DEFAULT '0' COMMENT '是否放在首页',
   `source` varchar(45) DEFAULT NULL COMMENT '来源',
-  `sourceUrl` varchar(255) DEFAULT NULL COMMENT '来源url',
+  `source_url` varchar(255) DEFAULT NULL COMMENT '来源url',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='新闻资讯';
 
@@ -49,5 +50,3 @@ CREATE TABLE `billings` (
   `consumption` bigint(18) NOT NULL DEFAULT '0' COMMENT '用户总消费额,单位为分',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户交易支付流水表';
-
-

+ 16 - 0
schema/20170705-coganizance-record.sql

@@ -0,0 +1,16 @@
+ALTER TABLE `organization_tech` MODIFY COLUMN `specialty` VARCHAR (255) NULL COMMENT '擅长领域';
+
+ALTER TABLE `achievement` MODIFY COLUMN `owner_mobile` VARCHAR(36) NULL COMMENT '所有人联系电话';
+
+ALTER TABLE `demand` MODIFY COLUMN `employer_contacts_mobile` VARCHAR(36) COMMENT '雇主联系人电话';
+
+ALTER TABLE `demand` MODIFY COLUMN `employer_name` VARCHAR(45) COMMENT'雇主名称';
+
+CREATE TABLE `coganizance_record` (
+  `id` BIGINT(18) NOT NULL  AUTO_INCREMENT,
+  `district` INT(4) NOT NULL COMMENT '地区(省份/市)',
+  `unit_name` VARCHAR(45) NOT NULL COMMENT '公司名称',
+  `year` INT(4) NOT NULL COMMENT '高企认定年份',
+  PRIMARY KEY (`id`))AUTO_INCREMENT = 1
+ENGINE = InnoDB
+COMMENT = '高企认定数据';

+ 5 - 5
src/main/java/com/goafanti/achievement/service/impl/AchievementOrderServiceImpl.java

@@ -82,7 +82,7 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 	@Override
 	public int updateShutdownByUser(AchievementOrder order) {
 		order.setStatus(AchievementOrderStatus.SHUTDOWN.getCode());
-		
+
 		AchievementOrderLog aol = new AchievementOrderLog();
 		aol.setId(UUID.randomUUID().toString());
 		aol.setStatus(AchievementOrderStatus.SHUTDOWN.getCode());
@@ -129,7 +129,7 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return (Pagination<OrgAchievementOrderListBo>) findPage("findOrgAchievementOrderListByPage",
 				"findOrgAchievementOrderCount", disposeAchievementOrder(uid, null, unitName, status, true), pNo, pSize);
 	}
-	
+
 	@Override
 	public int updateAchievementOrder(AchievementOrder achievementOrder, AchievementOrderLog aol,
 			String recordTimeFormattedDate) {
@@ -148,7 +148,6 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return achievementOrderMapper.updateByPrimaryKeySelective(achievementOrder);
 	}
 
-
 	private Map<String, Object> disposeAchievementOrder(String uid, String username, String unitName, Integer status,
 			Boolean flag) {
 		Map<String, Object> params = new HashMap<>();
@@ -170,7 +169,9 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		}
 
 		if (flag) {
-			params.put("techBrokerId", TokenManager.getAdminId());
+			if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+				params.put("techBrokerId", TokenManager.getAdminId());
+			}
 		} else {
 			params.put("uid", TokenManager.getUserId());
 		}
@@ -178,5 +179,4 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return params;
 	}
 
-	
 }

+ 4 - 0
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -276,6 +276,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 			a.setReleaseDate(now.getTime());
 			a.setReleaseStatus(DemandReleaseStatus.RELEASED.getCode());
 			a.setTechBrokerId(techBroderId);
+			if (StringUtils.isNotBlank(a.getKeyword())) {
+				String[] keywords = a.getKeyword().trim().split(",|,");
+				disposeAchievementKeyword(keywords, a, false);
+			}
 			String ownerId = a.getOwnerId();
 			if (StringUtils.isNotBlank(ownerId)) {
 				if (UserType.PERSONAL.getCode().equals(a.getOwnerType())) {

+ 51 - 20
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -289,9 +289,27 @@ public class AdminApiController extends CertifyApiController {
 	 * 管理员"我的客户"列表
 	 */
 	@RequestMapping(value = "/customer", method = RequestMethod.GET)
-	public Result getCustomer() {
+	public Result getCustomer(Integer number, String mobile, Integer auditStatus, String auditName, String email,
+			String startCreateTime, String endCreateTime, Integer type, String pageNo, String pageSize) {
 		Result res = new Result();
-		res.setData(userService.selectUserByAid(TokenManager.getAdminId()));
+		if (null == type) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户类型", "用户类型"));
+			return res;
+		}
+		if (!UserType.PERSONAL.getCode().equals(type) && !UserType.ORGANIZATION.getCode().equals(type)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "用户类型", "用户类型"));
+			return res;
+		}
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(userService.selectUserByAid(number, mobile, auditStatus, auditName, email,
+				TokenManager.getAdminId(), startCreateTime, endCreateTime, type, pNo, pSize));
 		return res;
 	}
 
@@ -430,7 +448,7 @@ public class AdminApiController extends CertifyApiController {
 	 * 个人用户列表
 	 */
 	@RequestMapping(value = "/userList", method = RequestMethod.POST)
-	public Result userList(String mobile, String email,
+	public Result userList(String username, String mobile, String email,
 			@RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
 			String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
 		Result res = new Result();
@@ -442,7 +460,7 @@ public class AdminApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
+		res.setData(getUserList(username, mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
 		return res;
 	}
 
@@ -1364,6 +1382,11 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 		}
 
+		if (StringUtils.isBlank(orgActivity.getActivityNumber())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "研发活动编号"));
+			return res;
+		}
+
 		if (StringUtils.isBlank(startDateFormattedDate)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "开始时间"));
 			return res;
@@ -1374,25 +1397,22 @@ public class AdminApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (!StringUtils.isBlank(startDateFormattedDate)) {
-			try {
-				orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
-			} catch (ParseException e) {
-			}
+		try {
+			orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
+		} catch (ParseException e) {
 		}
 
-		if (!StringUtils.isBlank(endDateFormattedDate)) {
-			try {
-				orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD));
-			} catch (ParseException e) {
-			}
+		try {
+			orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD));
+		} catch (ParseException e) {
 		}
 
 		OrgActivity oa = new OrgActivity();
 		BeanUtils.copyProperties(orgActivity, oa);
-		oa.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+
 		if (StringUtils.isBlank(oa.getId())) {
 			oa.setId(UUID.randomUUID().toString());
+			oa.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 			orgActivityService.insert(oa);
 		} else {
 			orgActivityService.updateOrgActivity(oa);
@@ -2281,6 +2301,11 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
+		
+		if (StringUtils.isBlank(orgTechCenter.getCenterName())){
+			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "", "研发部门名称"));
+			return res;
+		}
 
 		if (!checkCertify(res, orgTechCenter.getUid()).getError().isEmpty()) {
 			return res;
@@ -2809,8 +2834,14 @@ public class AdminApiController extends CertifyApiController {
 		BeanUtils.copyProperties(u, user);
 
 		if (StringUtils.isBlank(user.getId())) {
-			user.setId(UUID.randomUUID().toString());
-			userAbilityService.insert(user);
+			UserAbility uu = userAbilityService.selectUserAbilityByUserId(user.getUid());
+			if (null != uu) {
+				BeanUtils.copyProperties(user, uu);
+				userAbilityService.updateByPrimaryKeySelective(uu);
+			} else {
+				user.setId(UUID.randomUUID().toString());
+				userAbilityService.insert(user);
+			}
 		} else {
 			userAbilityService.updateByPrimaryKeySelective(user);
 		}
@@ -2958,9 +2989,9 @@ public class AdminApiController extends CertifyApiController {
 	}
 
 	// user个人列表
-	private Pagination<UserListBo> getUserList(String mobile, String email, String[] createTime, Integer number,
-			String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
-		return userService.listUser(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize);
+	private Pagination<UserListBo> getUserList(String username, String mobile, String email, String[] createTime,
+			Integer number, String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
+		return userService.listUser(username, mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize);
 	}
 
 	// 高企详情

+ 102 - 0
src/main/java/com/goafanti/admin/controller/AdminCognizanceRecordApiController.java

@@ -0,0 +1,102 @@
+package com.goafanti.admin.controller;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.goafanti.cognizanceRecord.service.CoganizanceRecordService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+
+@Controller
+@RequestMapping(value = "/api/admin/cognizanceRecord")
+public class AdminCognizanceRecordApiController extends CertifyApiController {
+	@Resource
+	private CoganizanceRecordService	coganizanceRecordService;
+
+	private static final int			DISTRICT_MAX_LENGTH		= 4;
+
+	private static final int			YEAR_MAX_LENGTH			= 4;
+
+	private static final int			UNIT_NAME_MAX_LENGTH	= 45;
+
+	/**
+	 * 查询
+	 */
+	@RequestMapping(value = "/search", method = RequestMethod.GET)
+	public Result search(Integer district, String unitName, Integer year, String pageSize, String pageNo) {
+		Result res = new Result();
+		if (null == district && StringUtils.isBlank(unitName) && null == year) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "查询条件"));
+			return res;
+		}
+		Integer pNo = 1;
+		Integer pSize = 20;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(coganizanceRecordService.listSearch(district, unitName, year, pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 批量导入
+	 */
+	@RequestMapping(value = "/import", method = RequestMethod.POST)
+	public Result importCoganizanceRecord(Integer district, String unitName, Integer year) {
+		Result res = new Result();
+		if (null == district) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "地区"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(unitName)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司名称"));
+			return res;
+		}
+
+		if (null == year) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
+			return res;
+		}
+
+		res = disposeImport(district, unitName, year, res);
+		if (!res.getError().isEmpty()) {
+			return res;
+		}
+		String[] unitNames = (String[])res.getData();
+		coganizanceRecordService.insertImport(district, unitNames, year);
+		return res;
+	}
+
+	private Result disposeImport(Integer district, String unitName, Integer year, Result res) {
+		if (district.toString().length() > DISTRICT_MAX_LENGTH) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "地区"));
+			return res;
+		}
+		if (year.toString().length() > YEAR_MAX_LENGTH) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "年份"));
+			return res;
+		}
+		String[] unitNames = unitName.split(",|,");
+		if (null != unitNames && unitName.length() > 0) {
+			for (String s : unitNames) {
+				if (StringUtils.isNotBlank(s) && s.length() > UNIT_NAME_MAX_LENGTH) {
+					res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "公司名称"));
+					return res;
+				}
+			}
+		}
+		res.setData(unitNames);
+		return res;
+	}
+
+}

+ 35 - 8
src/main/java/com/goafanti/admin/controller/AdminContractApiController.java

@@ -58,6 +58,8 @@ public class AdminContractApiController extends CertifyApiController {
 	@Resource
 	private TechProjectService		techProjectService;
 
+	private static final Integer	SECTION_YEAR	= 4;
+
 	/**
 	 * 批量删除合同
 	 */
@@ -108,7 +110,7 @@ public class AdminContractApiController extends CertifyApiController {
 		}
 
 		if (null != c.getCognizanceYear() && !c.getCognizanceYear().equals(0)) {
-			if (!disposeCog(c.getCognizanceYear(), c.getUid(), res).getError().isEmpty()) {
+			if (!disposeCog(c.getId(), c.getCognizanceYear(), c.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
 		}
@@ -304,13 +306,18 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 
+		if (null == contract.getType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "合同类型"));
+			return res;
+		}
+
 		User curUser = userService.selectByPrimaryKey(contract.getUid());
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
 
 		if (null != contract.getCognizanceYear() && !contract.getCognizanceYear().equals(0)) {
-			if (!disposeCog(contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
+			if (!disposeCog(contract.getId(), contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
 		}
@@ -352,13 +359,18 @@ public class AdminContractApiController extends CertifyApiController {
 			return res;
 		}
 
+		if (null == ic.getType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "合同类型"));
+			return res;
+		}
+
 		User curUser = userService.selectByPrimaryKey(ic.getUid());
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
 
 		if (null != ic.getCognizanceYear() && !ic.getCognizanceYear().equals(0)) {
-			if (!disposeCog(ic.getCognizanceYear(), ic.getUid(), res).getError().isEmpty()) {
+			if (!disposeCog(ic.getId(), ic.getCognizanceYear(), ic.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
 		}
@@ -458,17 +470,32 @@ public class AdminContractApiController extends CertifyApiController {
 		return res;
 	}
 
-	private Result disposeCog(Integer year, String uid, Result res) {
+	private Result disposeCog(String id, Integer year, String uid, Result res) {
 		Integer latelyYear = orgCognizanceService.selectLatelyRecordYear(uid);
-		if (null != latelyYear && year - latelyYear < 4) {
+		if (null != latelyYear && year - latelyYear < SECTION_YEAR) {
 			res.getError()
-					.add(buildError(ErrorConstants.STATUS_ERROR, "高企认定申请中或认定未到期!无法提交新申请!", "高企认定申请中或认定未到期!无法提交新申请!"));
+					.add(buildError(ErrorConstants.STATUS_ERROR, "高企认定申请中或认定未到期!无法提交新申请!", "高企认定申请中或认定未到期!无法提交新申请"));
 			return res;
 		}
-		Contract c = contractService.findByUidAndYear(uid, year);
+		
+		Contract c = contractService.findLatelyRecordByUid(uid);
+		boolean flag = Boolean.TRUE;
 		if (null != c) {
-			res.getError().add(buildError("", "当前年份已有合同申请,无法提交新申请!"));
+			if (StringUtils.isNotBlank(id)) {
+				if (null != c.getCognizanceYear() && year - c.getCognizanceYear() < SECTION_YEAR
+						&& !id.equals(c.getId())) {
+					flag = false;
+				}
+			} else {
+				if (null != c.getCognizanceYear() && year - c.getCognizanceYear() < SECTION_YEAR) {
+					flag = false;
+				}
+			}
 		}
+		if (!flag) {
+			res.getError().add(buildError(ErrorConstants.CONTRACT_YEAR_SECTION));
+		}
+
 		return res;
 	}
 

+ 27 - 11
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -1339,27 +1339,38 @@ public class CognizanceApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (!StringUtils.isBlank(startDateFormattedDate)) {
-			try {
-				orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
-			} catch (ParseException e) {
-			}
+		if (StringUtils.isBlank(orgActivity.getActivityNumber())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "研发活动编号"));
+			return res;
 		}
 
-		if (!StringUtils.isBlank(endDateFormattedDate)) {
-			try {
-				orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD));
-			} catch (ParseException e) {
-			}
+		if (StringUtils.isBlank(startDateFormattedDate)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "开始时间"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(endDateFormattedDate)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "结束时间"));
+			return res;
+		}
+
+		try {
+			orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
+		} catch (ParseException e) {
+		}
+
+		try {
+			orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD));
+		} catch (ParseException e) {
 		}
 
 		OrgActivity oa = new OrgActivity();
 		BeanUtils.copyProperties(orgActivity, oa);
-		oa.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 
 		if (StringUtils.isBlank(oa.getId())) {
 			oa.setId(UUID.randomUUID().toString());
 			oa.setUid(TokenManager.getUserId());
+			oa.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 			orgActivityService.insert(oa);
 		} else {
 			orgActivityService.updateOrgActivity(oa);
@@ -2139,6 +2150,11 @@ public class CognizanceApiController extends CertifyApiController {
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
+		
+		if (StringUtils.isBlank(orgTechCenter.getCenterName())){
+			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "", "研发部门名称"));
+			return res;
+		}
 
 		if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
 			try {

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

@@ -17,7 +17,7 @@ public interface OrgActivityCostService {
 
 	int updateByPrimaryKeySelective(OrgActivityCost orgActivityCost);
 
-	OrgActivityCost selectOrgActivityCostByAid(String id);
+	List<OrgActivityCost> selectOrgActivityCostByAid(String id);
 
 	int deleteByAid(List<String> id);
 

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

@@ -85,7 +85,7 @@ public class OrgActivityCostServiceImpl extends BaseMybatisDao<OrgActivityCostMa
 
 
 	@Override
-	public OrgActivityCost selectOrgActivityCostByAid(String aid) {
+	public List<OrgActivityCost> selectOrgActivityCostByAid(String aid) {
 		return orgActivityCostMapper.selectOrgActivityCostByAid(aid);
 	}
 

+ 27 - 35
src/main/java/com/goafanti/cognizance/service/impl/OrgActivityServiceImpl.java

@@ -22,45 +22,45 @@ import com.goafanti.common.model.OrgActivityCost;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+
 @Service
 public class OrgActivityServiceImpl extends BaseMybatisDao<OrgActivityMapper> implements OrgActivityService {
 	@Autowired
-	private OrgActivityMapper orgActivityMapper;
+	private OrgActivityMapper		orgActivityMapper;
 	@Autowired
-	private OrgActivityCostMapper orgActivityCostMapper;
+	private OrgActivityCostMapper	orgActivityCostMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<OrgActivity> listOrgActivity(String activityNumber, String activityName, String sDate,
 			String eDate, Integer pageNo, Integer pageSize, String uid) throws ParseException {
 		Map<String, Object> params = new HashMap<>();
-		
+
 		Date startDate = null;
 		Date endDate = null;
-		
-		if (!StringUtils.isBlank(activityNumber)){
+
+		if (!StringUtils.isBlank(activityNumber)) {
 			params.put("activityNumber", activityNumber);
 		}
-		
-		if (!StringUtils.isBlank(activityName)){
+
+		if (!StringUtils.isBlank(activityName)) {
 			params.put("activityName", activityName);
 		}
-		
-		if (!StringUtils.isBlank(sDate)){
+
+		if (!StringUtils.isBlank(sDate)) {
 			startDate = DateUtils.parseDate(sDate, AFTConstants.YYYYMMDD);
 			params.put("startDate", startDate);
 		}
-		
-		if (!StringUtils.isBlank(eDate)){
+
+		if (!StringUtils.isBlank(eDate)) {
 			endDate = DateUtils.addDays(DateUtils.parseDate(eDate, AFTConstants.YYYYMMDD), 1);
 			params.put("endDate", endDate);
 		}
-		
-		if(!StringUtils.isBlank(uid)){
+
+		if (!StringUtils.isBlank(uid)) {
 			params.put("uid", uid);
 		}
-		
-		
+
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
 		}
@@ -101,35 +101,27 @@ public class OrgActivityServiceImpl extends BaseMybatisDao<OrgActivityMapper> im
 	@Override
 	public void updateOrgActivity(OrgActivity orgActivity) {
 		orgActivityMapper.updateByPrimaryKeySelective(orgActivity);
-		Boolean flag = false;
-		OrgActivityCost cost = orgActivityCostMapper.selectOrgActivityCostByAid(orgActivity.getId());
-		if (null != cost) {
-			if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
-				cost.setActivityNumber(orgActivity.getActivityNumber());
-				flag = true;
-			}
-			if (null != orgActivity.getStartDate()) {
-				cost.setStartDate(orgActivity.getStartDate());
-				flag = true;
+		List<OrgActivityCost> cost = orgActivityCostMapper.selectOrgActivityCostByAid(orgActivity.getId());
+		if (null != cost && cost.size() > 0) {
+			for (OrgActivityCost c : cost) {
+				if (null != c) {
+					c.setActivityNumber(orgActivity.getActivityNumber());
+					c.setStartDate(orgActivity.getStartDate());
+					c.setEndDate(orgActivity.getEndDate());
+					orgActivityCostMapper.updateByPrimaryKeySelective(c);
+				}
 			}
-			if (null != orgActivity.getEndDate()) {
-				cost.setEndDate(orgActivity.getEndDate());
-				flag = true;
-			}
-		}
-		if (flag) {
-			orgActivityCostMapper.updateByPrimaryKeySelective(cost);
 		}
-		
 	}
 
 	@Override
 	public OrgActivity selectDetailByIdAndYear(String id, int year) {
 		OrgActivityDetailCostBo oadcb = orgActivityCostMapper.selectDetailCostByIdAndYear(id, year);
 		OrgActivity oa = orgActivityMapper.selectByPrimaryKey(id);
-		if (null != oadcb){
+		if (null != oadcb) {
 			oa.setFirstYearExpenditure(null == oadcb.getFirstYearCost() ? new BigDecimal(0) : oadcb.getFirstYearCost());
-			oa.setSecondYearExpenditure(null == oadcb.getSecondYearCost() ? new BigDecimal(0) : oadcb.getSecondYearCost());
+			oa.setSecondYearExpenditure(
+					null == oadcb.getSecondYearCost() ? new BigDecimal(0) : oadcb.getSecondYearCost());
 			oa.setThirdYearExpenditure(null == oadcb.getThirdYearCost() ? new BigDecimal(0) : oadcb.getThirdYearCost());
 		}
 		return oa;

+ 13 - 0
src/main/java/com/goafanti/cognizanceRecord/service/CoganizanceRecordService.java

@@ -0,0 +1,13 @@
+package com.goafanti.cognizanceRecord.service;
+
+import com.goafanti.common.model.CoganizanceRecord;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface CoganizanceRecordService {
+
+	Pagination<CoganizanceRecord> listSearch(Integer district, String unitName, Integer year, Integer pNo,
+			Integer pSize);
+
+	void insertImport(Integer district, String[] unitNames, Integer year);
+
+}

+ 68 - 0
src/main/java/com/goafanti/cognizanceRecord/service/impl/CoganizanceRecordServiceImpl.java

@@ -0,0 +1,68 @@
+package com.goafanti.cognizanceRecord.service.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.cognizanceRecord.service.CoganizanceRecordService;
+import com.goafanti.common.dao.CoganizanceRecordMapper;
+import com.goafanti.common.model.CoganizanceRecord;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+
+@Service
+public class CoganizanceRecordServiceImpl extends BaseMybatisDao<CoganizanceRecordMapper>
+		implements CoganizanceRecordService {
+	@Autowired
+	private CoganizanceRecordMapper coganizanceRecordMapper;
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CoganizanceRecord> listSearch(Integer district, String unitName, Integer year, Integer pNo,
+			Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (null != district) {
+			params.put("district", district);
+		}
+
+		if (StringUtils.isNotBlank(unitName)) {
+			params.put("unitName", unitName);
+		}
+
+		if (null != year) {
+			params.put("year", year);
+		}
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 20) {
+			pSize = 20;
+		}
+
+		return (Pagination<CoganizanceRecord>) findPage("findCoganizanceRecordListByPage", "findCoganizanceRecordCount",
+				params, pNo, pSize);
+	}
+
+	@Override
+	public void insertImport(Integer district, String[] unitNames, Integer year) {
+		CoganizanceRecord cr = null;
+		List<CoganizanceRecord> list = new ArrayList<>();
+		for (String s : unitNames) {
+			if (StringUtils.isNotBlank(s)) {
+				cr = new CoganizanceRecord(district, s, year);
+				list.add(cr);
+			}
+		}
+		coganizanceRecordMapper.insertBatch(list);
+
+	}
+
+}

+ 8 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -86,4 +86,12 @@ public class ErrorConstants {
 
 	public static final String	EVALUATE_PARAM					= "EVALUATE_PARAM";
 
+	public static final String	CONTRACT_YEAR_SECTION			= "CONTRACT_YEAR_SECTION";
+
+	public static final String	VCODE_EMPTY_ERROR				= "VCODE_EMPTY_ERROR";
+
+	public static final String	MCODE_FREQUENCY_ERROR			= "MCODE_FREQUENCY_ERROR";
+
+	public static final String	MCODE_EMPTY_ERROR				= "MCODE_EMPTY_ERROR";
+
 }

+ 9 - 0
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -14,6 +14,7 @@ import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.view.RedirectView;
 
 import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.common.enums.AchievementBargainingMode;
 import com.goafanti.common.enums.AchievementMaturity;
 import com.goafanti.common.enums.AchievementTransferMode;
 import com.goafanti.common.enums.UserLevel;
@@ -176,6 +177,10 @@ public class PortalController extends BaseController {
 						} else {
 							bo.setTransferPriceS(PRICE_NEGOTIABLE);
 						}
+						if (null == bo.getBargainingMode()
+								|| AchievementBargainingMode.NEGOTIABLE.getCode().equals(bo.getBargainingMode())) {
+							bo.setTransferPriceS(PRICE_NEGOTIABLE);
+						}
 					}
 				}
 				mv.addObject("similarList", similarList);
@@ -231,6 +236,10 @@ public class PortalController extends BaseController {
 			} else {
 				achievement.setTransferPriceS(PRICE_NEGOTIABLE);
 			}
+			if (null == achievement.getBargainingMode()
+					|| AchievementBargainingMode.NEGOTIABLE.equals(achievement.getBargainingMode())) {
+				achievement.setTransferPriceS(PRICE_NEGOTIABLE);
+			}
 			achievement.setLocation(location);
 
 		}

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

@@ -23,9 +23,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.goafanti.admin.service.AftFileService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.enums.MobileCodeCheckOverTimeSign;
+import com.goafanti.common.enums.UserType;
+import com.goafanti.common.model.User;
 import com.goafanti.common.service.IndustryCategoryService;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
+import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
@@ -66,9 +70,12 @@ public class PublicController extends BaseController {
 
 	@Autowired
 	private DistrictGlossoryService	districtGlossoryService;
-	
+
 	@Value(value = "${patentTemplate}")
-	private String				patentTemplate	= null;
+	private String					patentTemplate		= null;
+
+	@Resource(name = "passwordUtil")
+	private PasswordUtil			passwordUtil;
 
 	/**
 	 * 获取验证码
@@ -111,18 +118,18 @@ public class PublicController extends BaseController {
 		// 用于找回密码
 		if (sign) {
 			if (null == userService.selectByMobieAndType(mobile.trim(), type)) {
-				res.getError().add(buildError(ErrorConstants.NON_REGISTER, "", "该用户未注册!"));
+				res.getError().add(buildError(ErrorConstants.NON_REGISTER, "", "该用户未注册"));
 				return res;
 			}
 		}
 
 		if (!sign) {
 			if (StringUtils.isBlank(verificationCode)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "验证码"));
+				res.getError().add(buildError(ErrorConstants.VCODE_EMPTY_ERROR, "", "图像验证码不能为空!"));
 				return res;
 			}
-			if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)) {
-				res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "", "验证码"));
+			if (!VerifyCodeUtils.verifyCode(verificationCode)) {
+				res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "", "图形验证码输入错误!"));
 				return res;
 			}
 		}
@@ -131,11 +138,11 @@ public class PublicController extends BaseController {
 				|| TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE_TIME) == "") {
 			sendMessage(mobile, res);
 		} else if (TimeUtils.checkOverTime("getMCode")) {
-			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
-			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
+			VerifyCodeUtils.clearMobileCode();
+			VerifyCodeUtils.clearMobileCodeTime();
 			sendMessage(mobile, res);
 		} else {
-			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "", "手机验证码发送频繁!"));
+			res.getError().add(buildError(ErrorConstants.MCODE_FREQUENCY_ERROR, "", "手机验证码发送频繁!"));
 		}
 
 		// resetCode
@@ -161,7 +168,7 @@ public class PublicController extends BaseController {
 		String paramString = "{\"code\":\"" + mobileVerifyCode + "\",\"product\":\"阿凡提信息科技\"}";
 		String ret = MobileMessageUtils.sendMessage(mobileCodeTemplate, paramString, mobile, accessKey, accessSecret);
 		if (StringUtils.isNotBlank(ret)) {
-			res.getError().add(buildError("", "获取手机验证码异常!"));
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "", "获取手机验证码异常!"));
 		}
 		return res;
 	}
@@ -176,7 +183,7 @@ public class PublicController extends BaseController {
 	@RequestMapping(value = "/downLoadPicture", method = RequestMethod.GET)
 	public Result downLoadPicture(HttpServletResponse response, String path, HttpServletRequest request) {
 		Result res = new Result();
-		if (path == "" || path == null) {
+		if (StringUtils.isBlank(path)) {
 			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
 			return res;
 		}
@@ -202,16 +209,19 @@ 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 {
 				in.close();
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
+				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
 			}
 			try {
 				out.close();
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
+				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
 			}
 		}
 		return res;
@@ -285,7 +295,7 @@ public class PublicController extends BaseController {
 		if (!StringUtils.isBlank(path)) {
 			return handleDownloadFile(response, fileName, path, res);
 		} else {
-			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
+			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "下载文件不存在!"));
 			return res;
 		}
 	}
@@ -360,5 +370,92 @@ public class PublicController extends BaseController {
 		return new Result().data(districtGlossoryService.list(pid));
 	}
 
+	/**
+	 * 
+	 * @param mobileCode
+	 * @return
+	 */
+	@RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
+	@ResponseBody
+	public Result checkMCode(String mobileCode) {
+		Result res = new Result();
+
+		if (StringUtils.isBlank(mobileCode)) {
+			res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "手机验证码"));
+			return res;
+		}
+
+		if (TimeUtils.checkOverTime(MobileCodeCheckOverTimeSign.REGISTER.getCode())) {
+			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "", "手机验证码超时失效!"));
+			VerifyCodeUtils.clearMobileCode();
+			VerifyCodeUtils.clearMobileCodeTime();
+			return res;
+		}
+		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)) {
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "", "手机验证码错误"));
+			return res;
+		}
+		return res;
+
+	}
+
+	/**
+	 * 重置密码
+	 * 
+	 * @param resetCode
+	 * @param mobile
+	 * @param type
+	 * @param newPwd
+	 * @return
+	 */
+	@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
+	@ResponseBody
+	public Result resetPwd(String resetCode, String mobile, Integer type, String newPwd) {
+		Result res = new Result();
+		if (TimeUtils.checkOverTime(MobileCodeCheckOverTimeSign.RESETCODE.getCode())) {
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "", "页面超时失效,请重新获取验证码!"));
+			cleanCodeSession();
+			return res;
+		}
+		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)) {
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR, "", "页面失效,请重新获取验证码!"));
+			cleanCodeSession();
+			return res;
+		}
+
+		if (StringUtils.isBlank(newPwd)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新密码"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(mobile)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "mobile"));
+			return res;
+		}
+
+		if (!UserType.ORGANIZATION.getCode().equals(type) && !UserType.PERSONAL.getCode().equals(type)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "type"));
+			return res;
+		}
+
+		User user = userService.selectByMobieAndType(mobile, type);
+		if (null == user) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "mobile"));
+			return res;
+		}
+		user.setPassword(newPwd);
+		user.setPassword(passwordUtil.getEncryptPwd(user));
+		userService.updateByPrimaryKey(user);
+		VerifyCodeUtils.clearResetCode();
+		VerifyCodeUtils.clearResetCodeTime();
+		return res;
+	}
+
+	private void cleanCodeSession() {
+		VerifyCodeUtils.clearResetCode();
+		VerifyCodeUtils.clearResetCodeTime();
+		VerifyCodeUtils.clearMobileCode();
+		VerifyCodeUtils.clearMobileCodeTime();
+	}
 
 }

+ 21 - 0
src/main/java/com/goafanti/common/dao/CoganizanceRecordMapper.java

@@ -0,0 +1,21 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+
+import com.goafanti.common.model.CoganizanceRecord;
+
+public interface CoganizanceRecordMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(CoganizanceRecord record);
+
+    int insertSelective(CoganizanceRecord record);
+
+    CoganizanceRecord selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(CoganizanceRecord record);
+
+    int updateByPrimaryKey(CoganizanceRecord record);
+
+	void insertBatch(List<CoganizanceRecord> list);
+}

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

@@ -28,4 +28,6 @@ public interface ContractMapper {
 	int batchDeleteByPrimaryKey(List<String> id);
 
 	Contract findByUidAndYear(@Param("uid") String uid, @Param("year")Integer year);
+
+	Contract findLatelyRecordByUid(String uid);
 }

+ 1 - 1
src/main/java/com/goafanti/common/dao/OrgActivityCostMapper.java

@@ -22,7 +22,7 @@ public interface OrgActivityCostMapper {
 
 	int batchDeleteByPrimaryKey(List<String> id);
 
-	OrgActivityCost selectOrgActivityCostByAid(String aid);
+	List<OrgActivityCost> selectOrgActivityCostByAid(String aid);
 
 	int batchDeleteByAid(List<String> aid);
 

+ 1 - 3
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -1,11 +1,9 @@
 package com.goafanti.common.dao;
 
-import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.common.model.User;
-import com.goafanti.user.bo.OrgListBo;
 import com.goafanti.user.bo.OrgPartnerDetailBo;
 import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserPageHomeBo;
@@ -30,7 +28,7 @@ public interface UserMapper {
 
 	UserDownLoadBo selectUserDownLoadBoByUserId(String id);
 
-	List<OrgListBo> selectUserByAid(String aid);
+	//List<OrgListBo> selectUserByAid(String aid);
 
 	String findUserByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);
 

+ 57 - 0
src/main/java/com/goafanti/common/enums/AchievementBargainingMode.java

@@ -0,0 +1,57 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+	
+public enum AchievementBargainingMode {
+	
+	NEGOTIABLE(0, "议价方式--面议"),
+	FIXED_PRICE(1,"议价方式--定价"),
+	OTHER(2, "其他");
+
+	private AchievementBargainingMode(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, AchievementBargainingMode> status = new HashMap<Integer, AchievementBargainingMode>();
+
+	static {
+		for (AchievementBargainingMode value : AchievementBargainingMode.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static AchievementBargainingMode getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static AchievementBargainingMode getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+
+}

+ 50 - 0
src/main/java/com/goafanti/common/enums/MobileCodeCheckOverTimeSign.java

@@ -0,0 +1,50 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum MobileCodeCheckOverTimeSign {
+	
+	REGISTER("register", "注册手机验证码"),
+	RESETCODE("resetCode", "重置密码手机验证码"),
+	OTHER("", "未知参数");
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, MobileCodeCheckOverTimeSign> status = new HashMap<String, MobileCodeCheckOverTimeSign>();
+	
+	private MobileCodeCheckOverTimeSign(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (MobileCodeCheckOverTimeSign value : MobileCodeCheckOverTimeSign.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static MobileCodeCheckOverTimeSign getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 13 - 5
src/main/java/com/goafanti/common/mapper/AchievementOrderMapper.xml

@@ -239,7 +239,9 @@
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
   	and   a.owner_type= 0
-  	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -264,7 +266,9 @@
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
   	and   a.owner_type= 0
-  	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -291,7 +295,9 @@
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
   	and   a.owner_type= 1
-  	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -315,8 +321,10 @@
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
-  	and   a.owner_type= 0
-  	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	and   a.owner_type= 1
+  	<if test="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>

+ 132 - 0
src/main/java/com/goafanti/common/mapper/CoganizanceRecordMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.CoganizanceRecordMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.CoganizanceRecord" >
+    <id column="id" property="id" jdbcType="BIGINT" />
+    <result column="district" property="district" jdbcType="INTEGER" />
+    <result column="unit_name" property="unitName" jdbcType="VARCHAR" />
+    <result column="year" property="year" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, district, unit_name, year
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from coganizance_record
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from coganizance_record
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.CoganizanceRecord" >
+    insert into coganizance_record (id, district, unit_name, 
+      year)
+    values (#{id,jdbcType=BIGINT}, #{district,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, 
+      #{year,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.CoganizanceRecord" >
+    insert into coganizance_record
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="district != null" >
+        district,
+      </if>
+      <if test="unitName != null" >
+        unit_name,
+      </if>
+      <if test="year != null" >
+        year,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="district != null" >
+        #{district,jdbcType=INTEGER},
+      </if>
+      <if test="unitName != null" >
+        #{unitName,jdbcType=VARCHAR},
+      </if>
+      <if test="year != null" >
+        #{year,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CoganizanceRecord" >
+    update coganizance_record
+    <set >
+      <if test="district != null" >
+        district = #{district,jdbcType=INTEGER},
+      </if>
+      <if test="unitName != null" >
+        unit_name = #{unitName,jdbcType=VARCHAR},
+      </if>
+      <if test="year != null" >
+        year = #{year,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CoganizanceRecord" >
+    update coganizance_record
+    set district = #{district,jdbcType=INTEGER},
+      unit_name = #{unitName,jdbcType=VARCHAR},
+      year = #{year,jdbcType=INTEGER}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  
+  <select id="findCoganizanceRecordListByPage" parameterType="String" resultMap="BaseResultMap">
+    select 
+   	 <include refid="Base_Column_List" />
+    from coganizance_record
+    where 1 = 1
+    <if test="district != null">
+    	and district = #{district,jdbcType=INTEGER}
+    </if>
+     <if test="unitName != null">
+     	and unit_name like CONCAT(#{unitName,jdbcType=VARCHAR},'%')
+    </if>
+     <if test="year != null">
+     	and year = #{year,jdbcType=INTEGER}
+    </if>
+    ORDER BY id DESC
+	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findCoganizanceRecordCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+   	 count(1)
+    from coganizance_record
+    where 1 = 1
+    <if test="district != null">
+    	and district = #{district,jdbcType=INTEGER}
+    </if>
+     <if test="unitName != null">
+     	and unit_name like CONCAT(#{unitName,jdbcType=VARCHAR},'%')
+    </if>
+     <if test="year != null">
+     	and year = #{year,jdbcType=INTEGER}
+    </if>
+  </select>
+  
+   <insert id="insertBatch" parameterType="com.goafanti.common.model.CoganizanceRecord">
+    insert into coganizance_record 
+    	(id, district, unit_name, year)
+    values 
+    <foreach item="item" index="index" collection="list" separator=",">
+      (
+      	#{item.id,jdbcType=BIGINT}, 
+      	#{item.district,jdbcType=INTEGER}, 
+      	#{item.unitName,jdbcType=VARCHAR},
+      	#{item.year,jdbcType=INTEGER}
+      )
+    </foreach>
+  </insert>
+</mapper>

+ 13 - 0
src/main/java/com/goafanti/common/mapper/ContractMapper.xml

@@ -525,4 +525,17 @@
     and cognizance_year = #{year,jdbcType=INTEGER}
     and deleted_sign = 0
   </select>
+  
+  <select id="findLatelyRecordByUid" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    	<include refid="Base_Column_List" />
+    from contract 
+    where year =  
+	   	(select
+	   		Max(cognizance_year)
+	   	from contract
+	   	where uid = #{uid,jdbcType=VARCHAR}
+	   	and deleted_sign = 0
+	   	)
+  </select>
 </mapper>

+ 13 - 5
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -251,7 +251,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -276,7 +278,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -303,7 +307,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -328,14 +334,16 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
   	<if test="uid != null">
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
-  	<if test="username != null">
+    <if test="unitName != null">
   		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   </select>

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

@@ -348,6 +348,7 @@
     <include refid="Base_Column_List" />
     from org_activity_cost
     where aid = #{aid,jdbcType=VARCHAR}
+    and deleted_sign = 0
   </select>
   
   <update id="batchDeleteByAid" parameterType="java.util.List">

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

@@ -520,8 +520,12 @@
   </select>
   
   <select id="selectLatelyRecordYear" resultType="Integer" parameterType="java.lang.String" >
-  select Max(year)  from  org_cognizance  where state not in (8, 11, 13)
-	 and deleted_sign = 0 and uid= #{uid,jdbcType=VARCHAR} 
+     select 
+  		Max(year)  
+  	 from  org_cognizance  
+  	 where state not in (8, 11, 13)
+	 and deleted_sign = 0 
+	 and uid= #{uid,jdbcType=VARCHAR} 
 
   </select>
   

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

@@ -1153,8 +1153,11 @@
 	
 	<select id="findSearchSubscriberListByPage" parameterType="String" resultType="com.goafanti.portal.bo.OrgSubscriberListBo">
 			SELECT
-				u.id as uid, oi.unit_name as unitName, u.number,
-				oi.id as identityId, info.logo_url as logoUrl,
+				u.id as uid, 
+				oi.unit_name as unitName, 
+				u.number,
+				oi.id as identityId, 
+				info.logo_url as logoUrl,
 				oi.licence_province as province,
 				adc.achievement_count as achievementNum,
 				adc.demand_count as demandNum
@@ -1162,6 +1165,7 @@
 				<![CDATA[ user ]]> u
 			LEFT JOIN organization_identity oi ON oi.uid = u.id
 			LEFT JOIN organization_info info on info.uid = u.id
+			LEFT JOIN organization_tech ot on ot.uid = u.id
 			LEFT JOIN achievement_demand_count adc on adc.uid = u.id
 			WHERE
 				u.type = 1
@@ -1181,7 +1185,7 @@
 				AND oi.licence_area = #{area,jdbcType=INTEGER}
 			</if>
 			<if test="field != null">
-				AND oi.field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
+				AND ot.search_area_category like CONCAT(#{field,jdbcType=VARCHAR},'%')
 			</if>
 			<if test="name != null">
 				AND oi.unit_name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')

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

@@ -216,9 +216,17 @@
   </select>
   
   <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
-  	select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , i.aft_username as aftUsername, i.audit_status as auditStatus, a.name as adminName,
-  	       ad.name as managerName
+  	select 
+  		u.id ,
+  		u.mobile, 
+  		u.email, 
+  		u.create_time as createTime, 
+  	    u.number , 
+  	    i.aft_username as aftUsername, 
+  	    i.username,
+  	    i.audit_status as auditStatus, 
+  	    a.name as adminName,
+  	    ad.name as managerName
     from user u  
     LEFT JOIN admin a on a.id = u.aid
     LEFT JOIN admin ad on ad.id = u.mid
@@ -240,7 +248,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="username != null">
-		and i.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')   
+		and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%')   
 	</if>
 	<if test="auditStatus != null">
 		and i.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -272,7 +280,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="username != null">
-		and i.username = #{username,jdbcType=VARCHAR}
+		and i.username like CONCAT ('%',#{username,jdbcType=VARCHAR},'%') 
 	</if>
 	<if test="auditStatus != null">
 		and i.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -351,19 +359,167 @@
 	</if>
   </select>  
   
-   <select id="selectUserByAid" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
-    select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , o.aft_username as aftUsername, o.audit_status as orgAuditStatus, a.name as adminName, u.type,
-  	       o.unit_name as unitName, i.username, i.audit_status as userAuditStatus
+   <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
+    select 
+    	u.id ,
+    	u.mobile, 
+    	u.email, 
+    	u.create_time as createTime, 
+  	    u.number , 
+  	    a.name as adminName, 
+  	    u.type,
+  	    i.username, 
+  	    i.audit_status as userAuditStatus,
+  	    i.aft_username as aftUsername
     from user u  
     LEFT JOIN admin a on a.id = u.aid 
-	LEFT JOIN organization_identity o  ON u.id = o.uid 
 	LEFT JOIN user_identity i on u.id = i.uid
-   
-    where u.aid = #{aid,jdbcType=VARCHAR}
+    where u.type = 0
+    <if test="aid != null">
+    	and u.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="number !=null">
+    	and u.number = #{number,jdbcType=INTEGER}
+    </if>
+    <if test="mobile !=null">
+    	and u.mobile= #{mobile,jdbcType=VARCHAR}
+    </if>
+    <if test="auditStatus !=null">
+    	and i.audit_status = #{auditStatus,jdbcType=INTEGER}
+    </if>
+     <if test="auditName !=null">
+    	and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="email !=null">
+    	and u.email = #{email,jdbcType=VARCHAR}
+    </if>
+    <if test="startCreateTime !=null">
+    	and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
+    </if>
+     <if test="endCreateTime !=null">
+    	and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
+    </if>
+    order by u.number desc
+    <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
+  	 select 
+    	count(1)
+    from user u  
+    LEFT JOIN admin a on a.id = u.aid 
+	LEFT JOIN user_identity i on u.id = i.uid
+    where u.type = 0
+    <if test="aid != null">
+    	and u.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="number !=null">
+    	and u.number = #{number,jdbcType=INTEGER}
+    </if>
+    <if test="mobile !=null">
+    	and u.mobile= #{mobile,jdbcType=VARCHAR}
+    </if>
+    <if test="auditStatus !=null">
+    	and i.audit_status = #{auditStatus,jdbcType=INTEGER}
+    </if>
+    <if test="auditName !=null">
+    	and i.username like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="email !=null">
+    	and u.email = #{email,jdbcType=VARCHAR}
+    </if>
+    <if test="startCreateTime !=null">
+    	and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
+    </if>
+     <if test="endCreateTime !=null">
+    	and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
+    </if>
+  </select>
+  
+  
+  <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
+    select 
+    	u.id ,
+    	u.mobile, 
+    	u.email, 
+    	u.create_time as createTime, 
+  	    u.number , 
+  	    a.name as adminName, 
+  	    u.type,
+  	    i.unit_name as unitName, 
+  	    i.audit_status as orgAuditStatus,
+  	    i.aft_username as aftUsername
+    from user u  
+    LEFT JOIN admin a on a.id = u.aid 
+	LEFT JOIN organization_identity i on u.id = i.uid
+    where u.type = 1
+    <if test="aid != null">
+    	and u.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="number !=null">
+    	and u.number = #{number,jdbcType=INTEGER}
+    </if>
+    <if test="mobile !=null">
+    	and u.mobile= #{mobile,jdbcType=VARCHAR}
+    </if>
+    <if test="auditStatus !=null">
+    	and i.audit_status = #{auditStatus,jdbcType=INTEGER}
+    </if>
+     <if test="auditName !=null">
+    	and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="email !=null">
+    	and u.email = #{email,jdbcType=VARCHAR}
+    </if>
+    <if test="startCreateTime !=null">
+    	and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
+    </if>
+    <if test="endCreateTime !=null">
+    	and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
+    </if>
     order by u.number desc
+    <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
+  	 select 
+    	count(1)
+    from user u  
+    LEFT JOIN admin a on a.id = u.aid 
+	LEFT JOIN organization_identity i on u.id = i.uid
+    where u.type = 1
+    <if test="aid != null">
+    	and u.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="number !=null">
+    	and u.number = #{number,jdbcType=INTEGER}
+    </if>
+    <if test="mobile !=null">
+    	and u.mobile= #{mobile,jdbcType=VARCHAR}
+    </if>
+    <if test="auditStatus !=null">
+    	and i.audit_status = #{auditStatus,jdbcType=INTEGER}
+    </if>
+    <if test="auditName !=null">
+    	and i.unit_name like CONCAT('%',#{auditName,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="email !=null">
+    	and u.email = #{email,jdbcType=VARCHAR}
+    </if>
+    <if test="startCreateTime !=null">
+    	and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
+    </if>
+     <if test="endCreateTime !=null">
+    	and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
+    </if>
   </select>
   
+  
+  
   <select id="findUserByNameAndMobile" resultType="java.lang.String">
   	select 
   		ui.username
@@ -393,14 +549,22 @@
   </select>
   
    <select id="findAreaManagerUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
-  	select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , i.aft_username as aftUsername, i.audit_status as auditStatus, a.name as adminName,
-  	       ad.name as managerName
+  	select 
+  		u.id ,
+  		u.mobile, 
+  		u.email, 
+  		u.create_time as createTime, 
+  	    u.number , 
+  	    i.aft_username as aftUsername, 
+  	    i.audit_status as auditStatus, 
+  	    i.username,
+  	    a.name as adminName,
+  	    ad.name as managerName
     from user u  
     LEFT JOIN admin a on a.id = u.aid
     LEFT JOIN admin ad on ad.id = u.mid
-    LEFT JOIN user_identity i 
-    ON u.id = i.uid  where u.type = 0
+    LEFT JOIN user_identity i on u.id = i.uid  
+    where u.type = 0
     <if test = "mobile != null">
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	</if>
@@ -417,7 +581,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="username != null">
-		and i.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')   
+		and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')   
 	</if>
 	<if test="auditStatus != null">
 		and i.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -463,7 +627,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="username != null">
-		and i.username = #{username,jdbcType=VARCHAR}
+		and i.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')   
 	</if>
 	<if test="auditStatus != null">
 		and i.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -484,16 +648,22 @@
   </select>  
   
    <select id="findAreaManagerOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
-  select u.id ,u.mobile, u.email, u.create_time as createTime, 
-  	       u.number , o.aft_username as aftUsername, o.audit_status as auditStatus, a.name as adminName,
-  	       o.unit_name as unitName, ad.name as managerName
+  	select 
+  		u.id ,
+  		u.mobile, 
+  		u.email, 
+  		u.create_time as createTime, 
+  	    u.number , 
+  	    o.aft_username as aftUsername, 
+  	    o.audit_status as auditStatus, 
+  	    a.name as adminName,
+  	    o.unit_name as unitName, 
+  	    ad.name as managerName
     from user u  
     LEFT JOIN admin a on a.id = u.aid 
     LEFT JOIN admin ad on ad.id = u.mid
-	LEFT JOIN organization_identity o 
-    ON u.id = o.uid 
+	LEFT JOIN organization_identity o on u.id = o.uid 
     WHERE u.type = 1
-   
     <if test = "mobile != null">
 	    and u.mobile = #{mobile,jdbcType=VARCHAR}
 	</if>
@@ -513,7 +683,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="unitName != null">
-		and o.unit_name = #{unitName,jdbcType=VARCHAR}
+		and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
 	</if>
 	<if test="auditStatus != null">
 		and o.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -560,7 +730,7 @@
 		and u.number = #{number,jdbcType=INTEGER}
 	</if>
 	<if test="unitName != null">
-		and o.unit_name = #{unitName,jdbcType=VARCHAR}
+		and o.unit_name like '%'#{unitName,jdbcType=VARCHAR}'%'
 	</if>
 	<if test="auditStatus != null">
 		and o.audit_status= #{auditStatus,jdbcType=INTEGER}
@@ -615,11 +785,13 @@
 		info.logo_url AS logoUrl,
 		info.company_introduction AS company_introduction,
 		info.publicity_picture_url AS publicityPictureUrl,
+		ot.search_area_category as field, 
 		interest.id as interestId
 	FROM
 	<![CDATA[ user ]]> u
 	LEFT JOIN organization_identity oi ON oi.uid = u.id
 	LEFT JOIN organization_info info ON info.uid = u.id
+	LEFT JOIN organization_tech ot ON ot.uid = u.id
 	LEFT JOIN user_ability ua ON ua.uid = u.id
 	LEFT JOIN user_interest interest on interest.to_uid = u.id and interest.from_uid = #{tokenId,jdbcType=VARCHAR}
 	WHERE

+ 61 - 0
src/main/java/com/goafanti/common/model/CoganizanceRecord.java

@@ -0,0 +1,61 @@
+package com.goafanti.common.model;
+
+public class CoganizanceRecord {
+    private Long id;
+
+    /**
+    * 地区(省份/市)
+    */
+    private Integer district;
+
+    /**
+    * 公司名称
+    */
+    private String unitName;
+
+    /**
+    * 高企认定年份
+    */
+    private Integer year;
+    
+    public CoganizanceRecord(Integer district, String unitName, Integer year){
+    	this.district = district;
+    	this.unitName = unitName;
+    	this.year = year;
+    }
+
+    public CoganizanceRecord() {
+	}
+
+	public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getDistrict() {
+        return district;
+    }
+
+    public void setDistrict(Integer district) {
+        this.district = district;
+    }
+
+    public String getUnitName() {
+        return unitName;
+    }
+
+    public void setUnitName(String unitName) {
+        this.unitName = unitName;
+    }
+
+    public Integer getYear() {
+        return year;
+    }
+
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+}

+ 1 - 1
src/main/java/com/goafanti/common/model/UserInfo.java

@@ -41,7 +41,7 @@ public class UserInfo {
 	/**
 	 * 生活照
 	 */
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	@Size(min = 0, max = 1000, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	lifePhotoUrl;
 
 	/**

+ 38 - 18
src/main/java/com/goafanti/common/utils/VerifyCodeUtils.java

@@ -21,22 +21,22 @@ import com.goafanti.core.shiro.token.TokenManager;
 public class VerifyCodeUtils {
 
 	// 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
-	public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
+	public static final String	VERIFY_CODES	= "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
 	// 验证码的Key
-	public static final String V_CODE = "_CODE";
-	
-	//手机验证码
-	public static final String M_VERIFY_CODES = "23456789";
-	//手机验证码Key
-	public static final String 	M_CODE = "M_CODE";
-	//手机验证码生成时间
-	public static final String M_CODE_TIME = "M_CODE_TIME";
-	
-	public static final String RESET_CODE = "RESET_CODE";
-	
-	public static final String RESET_CODE_TIME = "RESET_CODE_TIME";
-	
-	private static Random random = new Random();
+	public static final String	V_CODE			= "_CODE";
+
+	// 手机验证码
+	public static final String	M_VERIFY_CODES	= "23456789";
+	// 手机验证码Key
+	public static final String	M_CODE			= "M_CODE";
+	// 手机验证码生成时间
+	public static final String	M_CODE_TIME		= "M_CODE_TIME";
+
+	public static final String	RESET_CODE		= "RESET_CODE";
+
+	public static final String	RESET_CODE_TIME	= "RESET_CODE_TIME";
+
+	private static Random		random			= new Random();
 
 	/**
 	 * 验证码对象
@@ -44,9 +44,9 @@ public class VerifyCodeUtils {
 	 */
 	public static class Verify {
 
-		private String code;// 如 1 + 2
+		private String	code;	// 如 1 + 2
 
-		private Integer value;// 如 3
+		private Integer	value;	// 如 3
 
 		public String getCode() {
 			return code;
@@ -91,9 +91,10 @@ public class VerifyCodeUtils {
 	public static String generateVerifyCode(int verifySize) {
 		return generateVerifyCode(verifySize, VERIFY_CODES);
 	}
-	
+
 	/**
 	 * 手机验证码
+	 * 
 	 * @param verifySize
 	 * @return
 	 */
@@ -120,6 +121,25 @@ public class VerifyCodeUtils {
 	public static void clearVerifyCode() {
 		TokenManager.getSession().removeAttribute(V_CODE);
 	}
+	
+	/**
+	 * 清除手机验证码
+	 */
+	public static void clearMobileCode(){
+		TokenManager.getSession().removeAttribute(M_CODE);
+	}
+	
+	public static void clearMobileCodeTime(){
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
+	}
+	
+	public static void clearResetCode(){
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
+	}
+	
+	public static void clearResetCodeTime(){
+		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
+	}
 
 	/**
 	 * 对比验证码

+ 35 - 8
src/main/java/com/goafanti/contract/controller/ContractApiController.java

@@ -48,6 +48,8 @@ public class ContractApiController extends CertifyApiController {
 	@Resource
 	private PatentInfoService		patentInfoService;
 
+	private static final Integer	SECTION_YEAR	= 4;
+
 	/**
 	 * 合同详情-科技项目列表
 	 */
@@ -176,8 +178,14 @@ public class ContractApiController extends CertifyApiController {
 			return res;
 		}
 
+		if (null == contract.getType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "合同类型"));
+			return res;
+		}
+
 		if (null != contract.getCognizanceYear() && !contract.getCognizanceYear().equals(0)) {
-			if (!disposeCog(contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
+			if (!disposeCog(contract.getId(), contract.getCognizanceYear(), contract.getUid(), res).getError()
+					.isEmpty()) {
 				return res;
 			}
 		}
@@ -185,10 +193,10 @@ public class ContractApiController extends CertifyApiController {
 		Contract c = new Contract();
 		BeanUtils.copyProperties(contract, c);
 		Contract ct = contractService.selectByPrimaryKey(c.getId());
-		if (null != ct && !ContractStatus.COMPLETE.getCode().equals(ct.getStatus())) {
+		if (null != ct && !ContractStatus.CREATE.getCode().equals(ct.getStatus())) {
 			res.setData(contractService.updateByPrimaryKeySelective(c));
 		} else {
-			res.getError().add(buildError("", "当前合同已完成(结款),无法操作!"));
+			res.getError().add(buildError("", "当前合同为非草稿状态,无法操作!"));
 		}
 		return res;
 	}
@@ -204,12 +212,18 @@ public class ContractApiController extends CertifyApiController {
 					ContractFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
+
+		if (null == contract.getType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "合同类型"));
+			return res;
+		}
+
 		User curUser = TokenManager.getUserToken();
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
 		if (null != contract.getCognizanceYear() && !contract.getCognizanceYear().equals(0)) {
-			if (!disposeCog(contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
+			if (!disposeCog(null, contract.getCognizanceYear(), contract.getUid(), res).getError().isEmpty()) {
 				return res;
 			}
 		}
@@ -242,18 +256,31 @@ public class ContractApiController extends CertifyApiController {
 		return res;
 	}
 
-	private Result disposeCog(Integer year, String uid, Result res) {
+	private Result disposeCog(String id, Integer year, String uid, Result res) {
 		Integer latelyYear = orgCognizanceService.selectLatelyRecordYear(uid);
-		if (null != latelyYear && year - latelyYear < 4) {
+		if (null != latelyYear && year - latelyYear < SECTION_YEAR) {
 			res.getError()
 					.add(buildError(ErrorConstants.STATUS_ERROR, "高企认定申请中或认定未到期!无法提交新申请!", "高企认定申请中或认定未到期!无法提交新申请!"));
 			return res;
 		}
 
-		Contract c = contractService.findByUidAndYear(uid, year);
+		Contract c = contractService.findLatelyRecordByUid(uid);
+		boolean flag = Boolean.TRUE;
 		if (null != c) {
-			res.getError().add(buildError("", "当前年份已有合同申请,无法提交新申请!"));
+			if (StringUtils.isNotBlank(id)) {
+				if (null != c.getCognizanceYear() && year - c.getCognizanceYear() < SECTION_YEAR && !id.equals(c.getId())) {
+					flag = false;
+				}
+			} else {
+				if (null != c.getCognizanceYear() && year - c.getCognizanceYear() < SECTION_YEAR) {
+					flag = false;
+				}
+			}
 		}
+		if (!flag) {
+			res.getError().add(buildError(ErrorConstants.CONTRACT_YEAR_SECTION));
+		}
+
 		return res;
 	}
 }

+ 2 - 0
src/main/java/com/goafanti/contract/service/ContractService.java

@@ -41,4 +41,6 @@ public interface ContractService {
 
 	Contract findByUidAndYear(String uid, Integer year);
 
+	Contract findLatelyRecordByUid(String uid);
+
 }

+ 5 - 0
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -389,4 +389,9 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 		return contractMapper.findByUidAndYear(uid, year);
 	}
 
+	@Override
+	public Contract findLatelyRecordByUid(String uid) {
+		return contractMapper.findLatelyRecordByUid(uid);
+	}
+
 }

+ 10 - 1
src/main/java/com/goafanti/core/shiro/cache/ShiroRedisCache.java

@@ -3,6 +3,7 @@ package com.goafanti.core.shiro.cache;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.shiro.cache.Cache;
 import org.apache.shiro.cache.CacheException;
@@ -18,6 +19,8 @@ public class ShiroRedisCache implements Cache<String, Object> {
 
 	private Set<String>						emptySet	= new HashSet<>();
 
+	private long							expire		= -1l;
+
 	public ShiroRedisCache() {
 
 	}
@@ -27,6 +30,12 @@ public class ShiroRedisCache implements Cache<String, Object> {
 		this.name = name;
 	}
 
+	public ShiroRedisCache(RedisTemplate<String, Object> redisTemplate, String name, long expire) {
+		this.redisTemplate = redisTemplate;
+		this.name = name;
+		this.expire = expire;
+	}
+
 	@Override
 	public Object get(String key) throws CacheException {
 		if (key == null) {
@@ -42,7 +51,7 @@ public class ShiroRedisCache implements Cache<String, Object> {
 			return null;
 		}
 
-		redisTemplate.opsForValue().set(decorateKey(key), value);
+		redisTemplate.opsForValue().set(decorateKey(key), value, expire, TimeUnit.SECONDS);
 		return value;
 	}
 

+ 13 - 3
src/main/java/com/goafanti/core/shiro/cache/ShiroRedisCacheManager.java

@@ -7,11 +7,13 @@ import org.springframework.data.redis.core.RedisTemplate;
 
 public class ShiroRedisCacheManager extends AbstractCacheManager {
 
-	private RedisTemplate<String, Object> redisTemplate;
+	private RedisTemplate<String, Object>	redisTemplate;
+
+	private long							expire	= -1l;	// 秒
 
 	@Override
 	protected Cache<String, Object> createCache(String name) throws CacheException {
-		return new ShiroRedisCache(redisTemplate, name);
+		return new ShiroRedisCache(redisTemplate, name, expire);
 	}
 
 	public RedisTemplate<String, Object> getRedisTemplate() {
@@ -21,5 +23,13 @@ public class ShiroRedisCacheManager extends AbstractCacheManager {
 	public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
 		this.redisTemplate = redisTemplate;
 	}
-	
+
+	public long getExpire() {
+		return expire;
+	}
+
+	public void setExpire(long expire) {
+		this.expire = expire;
+	}
+
 }

+ 4 - 2
src/main/java/com/goafanti/demand/service/impl/DemandOrderServiceImpl.java

@@ -82,7 +82,7 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 	@Override
 	public int updateShutdownByUser(DemandOrder order) {
 		order.setStatus(DemandOrderStatus.SHUTDOWN.getCode());
-		
+
 		DemandOrderLog dol = new DemandOrderLog();
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
@@ -167,7 +167,9 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 			params.put("unitName", unitName);
 		}
 		if (flag) {
-			params.put("techBrokerId", TokenManager.getAdminId());
+			if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+				params.put("techBrokerId", TokenManager.getAdminId());
+			}
 		} else {
 			params.put("uid", TokenManager.getUserId());
 		}

+ 6 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -298,6 +298,12 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			d.setReleaseDate(now.getTime());
 			d.setReleaseStatus(DemandReleaseStatus.RELEASED.getCode());
 			d.setTechBrokerId(techBroderId);
+			
+			if (StringUtils.isNotBlank(d.getKeyword())){
+				String[] keywords = d.getKeyword().trim().split(",|,");
+				disposeDemandKeyword(keywords, d, false);
+			}
+			
 			String employerId = d.getEmployerId();
 			if (StringUtils.isNotBlank(employerId)) {
 				if (UserType.PERSONAL.getCode().equals(d.getDataCategory())) {

+ 10 - 0
src/main/java/com/goafanti/portal/bo/AchievementPortalDetailBo.java

@@ -58,6 +58,16 @@ public class AchievementPortalDetailBo {
 
 	private Integer			level;
 
+	private Integer			bargainingMode;
+
+	public Integer getBargainingMode() {
+		return bargainingMode;
+	}
+
+	public void setBargainingMode(Integer bargainingMode) {
+		this.bargainingMode = bargainingMode;
+	}
+
 	public Integer getLevel() {
 		return level;
 	}

+ 12 - 0
src/main/java/com/goafanti/portal/bo/AchievementPortalSimilarListBo.java

@@ -21,6 +21,18 @@ public class AchievementPortalSimilarListBo {
 
 	private String		transferPriceS;
 
+	private Integer		bargainingMode;
+	
+	
+
+	public Integer getBargainingMode() {
+		return bargainingMode;
+	}
+
+	public void setBargainingMode(Integer bargainingMode) {
+		this.bargainingMode = bargainingMode;
+	}
+
 	public String getTransferPriceS() {
 		return transferPriceS;
 	}

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

@@ -28,6 +28,16 @@ public class UserListBo {
 
 	private String	managerName;
 
+	private String	username;
+	
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
 	public String getId() {
 		return id;
 	}

+ 43 - 107
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -110,6 +110,20 @@ public class UserApiController extends BaseApiController {
 	@Resource
 	private OrgRatepayService				orgRatepayService;
 
+	private static final Integer			STEP_ONE			= 1;
+
+	// private static final Integer STEP_TWO = 2;
+
+	private static final Integer			STEP_THREE			= 3;
+
+	// private static final Integer STEP_FOUR = 4;
+
+	private static final Integer			STEP_FIVE			= 5;
+
+	private static final Integer			MAX_WRONG_COUNT		= 3;
+
+	private static final Integer			INIT_WRONG_COUNT	= 0;
+
 	/**
 	 * 修改密码
 	 * 
@@ -144,86 +158,6 @@ public class UserApiController extends BaseApiController {
 	}
 
 	/**
-	 * 重置密码
-	 * 
-	 * @param resetCode
-	 * @param mobile
-	 * @param type
-	 * @param newPwd
-	 * @return
-	 */
-	@RequestMapping(value = "/resetPwd", method = RequestMethod.POST)
-	public Result resetPwd(String resetCode, String mobile, Integer type, String newPwd) {
-		Result res = new Result();
-		if (TimeUtils.checkOverTime("resetCode")) {
-			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "页面超时失效,请重新获取验证码!"));
-			this.cleanCodeSession();
-			return res;
-		}
-		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)) {
-			res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR, "页面失效,请重新获取验证码!"));
-			this.cleanCodeSession();
-			return res;
-		}
-
-		if (StringUtils.isBlank(newPwd)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新密码"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(mobile)) {
-			res.getError().add(buildError(ErrorConstants.MOBILE_EMPTY_ERROR, "", "mobile"));
-			return res;
-		}
-
-		if (1 != type || 0 != type) {
-			res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "", "type"));
-			return res;
-		}
-
-		User user = userService.selectByMobieAndType(mobile, type);
-		if (null == user) {
-			res.getError().add(buildError(ErrorConstants.MOBILE_EMPTY_ERROR, "", "mobile"));
-			return res;
-		}
-		user.setPassword(newPwd);
-		user.setPassword(passwordUtil.getEncryptPwd(user));
-		userService.updateByPrimaryKey(user);
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
-		return res;
-	}
-
-	/**
-	 * 
-	 * @param mobileCode
-	 * @return
-	 */
-	@RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
-	public Result checkMCode(String mobileCode) {
-		Result res = new Result();
-
-		if (StringUtils.isBlank(mobileCode)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "手机验证码"));
-			return res;
-		}
-
-		if (TimeUtils.checkOverTime("register")) {
-			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "手机验证码超时失效"));
-			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
-			TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
-			return res;
-		}
-		System.out.println(TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE));
-		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)) {
-			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码错误"));
-			return res;
-		}
-		return res;
-
-	}
-
-	/**
 	 * 更换手机
 	 * 
 	 * @param mobile
@@ -749,22 +683,26 @@ public class UserApiController extends BaseApiController {
 	@RequestMapping(value = "/userNextPro", method = RequestMethod.POST)
 	public Result userNextProcess(UserIdentity userIdentity, String verificationCode) {
 		Result res = new Result();
-		if ((IdentityProcess.UNCOMMITTED.getCode() + 1) == userIdentity.getProcess()) {
+		if (null == userIdentity.getProcess()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "process"));
+			return res;
+		}
+		if (StringUtils.isBlank(verificationCode)) {
+			res.getError().add(buildError(ErrorConstants.VCODE_EMPTY_ERROR));
+			return res;
+		}
+		if (STEP_ONE.equals(userIdentity.getProcess())) {
 			if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)) {
-				res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "验证码错误"));
+				res.getError().add(buildError(ErrorConstants.VCODE_ERROR));
 				return res;
 			}
-		}
-
-		if (IdentityProcess.COMMITTED.getCode() == userIdentity.getProcess()) {// 3
+		} else if (STEP_THREE.equals(userIdentity.getProcess())) {
 			UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
 			u.setProcess(IdentityProcess.COMMITTED.getCode());
 			u.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
 			userIdentityService.updateByPrimaryKeySelective(u);
 			return res;
-		}
-
-		if (IdentityProcess.RESULTS.getCode() == userIdentity.getProcess()) {
+		} else if (STEP_FIVE.equals(userIdentity.getProcess())) {
 			UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
 			if ((System.currentTimeMillis() - u.getPaymentDate().getTime()) > 432000000) {
 				u.setAuditStatus(IdentityAuditStatus.NOTPASSED.getCode());// 4
@@ -772,7 +710,7 @@ public class UserApiController extends BaseApiController {
 				res.getError().add(buildError("", "1"));// 超过打款日期5日,无法提交确认
 				return res;
 			}
-			if (3 == u.getWrongCount()) {
+			if (MAX_WRONG_COUNT.equals(u.getWrongCount())) {
 				u.setAuditStatus(IdentityAuditStatus.NOTPASSED.getCode());// 4
 				u.setProcess(IdentityProcess.RESULTS.getCode());// 5
 				userIdentityService.updateByPrimaryKeySelective(u);
@@ -820,23 +758,29 @@ public class UserApiController extends BaseApiController {
 	public Result orgNextProcess(OrganizationIdentity orgIdentity, String listedDateFormattedDate,
 			String verificationCode) throws ParseException {
 		Result res = new Result();
-		if ((IdentityProcess.UNCOMMITTED.getCode() + 1) == orgIdentity.getProcess()) {
+		if (null == orgIdentity.getProcess()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "process"));
+			return res;
+		}
+		if (StringUtils.isBlank(verificationCode)) {
+			res.getError().add(buildError(ErrorConstants.VCODE_EMPTY_ERROR));
+			return res;
+		}
+		if (STEP_ONE.equals(orgIdentity.getProcess())) {
 			if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.V_CODE).equals(verificationCode)) {
-				res.getError().add(buildError(ErrorConstants.VCODE_ERROR, "验证码错误"));
+				res.getError().add(buildError(ErrorConstants.VCODE_ERROR));
 				return res;
 			}
 			if (!StringUtils.isBlank(listedDateFormattedDate)) {
 				orgIdentity.setListedDate(DateUtils.parseDate(listedDateFormattedDate, AFTConstants.YYYYMMDD));
 			}
-		}
-		if (IdentityProcess.COMMITTED.getCode() == orgIdentity.getProcess()) {
+		} else if (STEP_THREE.equals(orgIdentity.getProcess())) {
 			OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
 			o.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
 			o.setProcess(IdentityProcess.COMMITTED.getCode());
 			organizationIdentityService.updateByPrimaryKeySelective(o);
 			return res;
-		}
-		if (5 == orgIdentity.getProcess()) {
+		} else if (STEP_FIVE.equals(orgIdentity.getProcess())) {
 			OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
 			if (System.currentTimeMillis() - o.getPaymentDate().getTime() > 432000000) {
 				o.setAuditStatus(IdentityAuditStatus.NOTPASSED.getCode());// 4
@@ -844,7 +788,7 @@ public class UserApiController extends BaseApiController {
 				res.getError().add(buildError("", "1"));// 超过打款日期5日,无法提交确认
 				return res;
 			}
-			if (3 == o.getWrongCount()) {
+			if (MAX_WRONG_COUNT.equals(o.getWrongCount())) {
 				o.setAuditStatus(IdentityAuditStatus.NOTPASSED.getCode());// 4
 				o.setProcess(IdentityProcess.RESULTS.getCode());// 5
 				organizationIdentityService.updateByPrimaryKeySelective(o);
@@ -900,7 +844,7 @@ public class UserApiController extends BaseApiController {
 			user.setId(u.getId());
 			user.setUid(u.getUid());
 			user.setProcess(IdentityProcess.UNCOMMITTED.getCode());
-			user.setWrongCount(0);
+			user.setWrongCount(INIT_WRONG_COUNT);
 			user.setAmountMoney(new BigDecimal(0));
 			user.setAuditStatus(IdentityAuditStatus.UNCOMMITTED.getCode());
 			res.setData(userIdentityService.updateByPrimaryKey(user));
@@ -910,7 +854,7 @@ public class UserApiController extends BaseApiController {
 			org.setId(o.getId());
 			org.setUid(o.getUid());
 			org.setProcess(IdentityProcess.UNCOMMITTED.getCode());
-			org.setWrongCount(0);
+			org.setWrongCount(INIT_WRONG_COUNT);
 			org.setAuditStatus(IdentityAuditStatus.UNCOMMITTED.getCode());
 			org.setValidationAmount(new BigDecimal(0));
 			res.setData(organizationIdentityService.updateByPrimaryKey(org));
@@ -930,13 +874,6 @@ public class UserApiController extends BaseApiController {
 		return res;
 	}
 
-	private void cleanCodeSession() {
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE);
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.RESET_CODE_TIME);
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
-		TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
-	}
-
 	private UidAndTypeBo basicInfo(UserService userService) {
 		User u = userService.selectByPrimaryKey(TokenManager.getUserId());
 		UidAndTypeBo ub = new UidAndTypeBo();
@@ -950,10 +887,9 @@ public class UserApiController extends BaseApiController {
 	// 判断用户是否通过认证
 	private Result checkCertify(Result res) {
 		OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
-		if (null == o || 5 != o.getAuditStatus()) {
+		if (null == o || !IdentityAuditStatus.PASSED.getCode().equals(o.getAuditStatus())) {
 			res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
 		}
-
 		return res;
 	}
 

+ 5 - 4
src/main/java/com/goafanti/user/service/UserService.java

@@ -32,13 +32,14 @@ public interface UserService {
 
 	UserDownLoadBo selectUserDownLoadBoByUserId(String userId);
 
-	Pagination<UserListBo> listUser(String mobile, String email, String[] createTime, Integer number,
+	Pagination<UserListBo> listUser(String username, String mobile, String email, String[] createTime, Integer number,
 			String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException;
 
-	Pagination<OrgListBo> listOrg(String uid, String mobile, String email, String[] createTime, Integer number, String unitName,
-			Integer auditStatus, Integer pNo, Integer pSize) throws ParseException;
+	Pagination<OrgListBo> listOrg(String uid, String mobile, String email, String[] createTime, Integer number,
+			String unitName, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException;
 
-	List<OrgListBo> selectUserByAid(String adminId);
+	Pagination<OrgListBo> selectUserByAid(Integer number, String mobile, Integer auditStatus, String auditName, String email,
+			String adminId, String startCreateTime, String endCreateTime, Integer type, Integer pNo, Integer pSize);
 
 	List<OrgUnitNames> selectDemandUnitNames();
 

+ 69 - 6
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -135,8 +135,8 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<UserListBo> listUser(String mobile, String email, String[] pDate, Integer number, String username,
-			Integer auditStatus, Integer pageNo, Integer pageSize) throws ParseException {
+	public Pagination<UserListBo> listUser(String username, String mobile, String email, String[] pDate, Integer number,
+			String aftUsername, Integer auditStatus, Integer pageNo, Integer pageSize) throws ParseException {
 		Map<String, Object> params = new HashMap<>();
 		Date pStart = null;
 		Date pEnd = null;
@@ -176,6 +176,10 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 			params.put("auditStatus", auditStatus);
 		}
 
+		if (!StringUtils.isBlank(aftUsername)) {
+			params.put("aftUsername", aftUsername);
+		}
+
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
 		}
@@ -271,9 +275,68 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		return null;
 	}
 
+	@SuppressWarnings("unchecked")
 	@Override
-	public List<OrgListBo> selectUserByAid(String aid) {
-		return userMapper.selectUserByAid(aid);
+	public Pagination<OrgListBo> selectUserByAid(Integer number, String mobile, Integer auditStatus, String auditName,
+			String email, String aid, String startCreateTime, String endCreateTime, Integer type, Integer pageNo,
+			Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (StringUtils.isNotBlank(startCreateTime)) {
+			try {
+				params.put("startCreateTime", DateUtils.parseDate(startCreateTime, AFTConstants.YYYYMMDD));
+			} catch (ParseException e) {
+			}
+		}
+
+		if (StringUtils.isNotBlank(endCreateTime)) {
+			try {
+				params.put("endCreateTime",
+						DateUtils.addDays(DateUtils.parseDate(endCreateTime, AFTConstants.YYYYMMDD), 1));
+			} catch (ParseException e) {
+			}
+		}
+
+		if (null != number) {
+			params.put("number", number);
+		}
+
+		if (StringUtils.isNotBlank(mobile)) {
+			params.put("mobile", mobile);
+		}
+
+		if (null != auditStatus) {
+			params.put("auditStatus", auditStatus);
+		}
+
+		if (StringUtils.isNotBlank(auditName)) {
+			params.put("auditName", auditName);
+		}
+
+		if (StringUtils.isNotBlank(email)) {
+			params.put("email", email);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			params.put("aid", aid);
+		}
+
+		if (pageNo == null || pageNo < 0) {
+			pageNo = 1;
+		}
+
+		if (pageSize == null || pageSize < 0 || pageSize > 10) {
+			pageSize = 10;
+		}
+
+		if (UserType.PERSONAL.getCode().equals(type)) {
+			return (Pagination<OrgListBo>) findPage("findUserByAidWithParamsListByPage", "findUserByAidWithParamsCount",
+					params, pageNo, pageSize);
+		} else if (UserType.ORGANIZATION.getCode().equals(type)) {
+			return (Pagination<OrgListBo>) findPage("findOrgByAidWithParamsListByPage", "findOrgByAidWithParamsCount",
+					params, pageNo, pageSize);
+		}
+		return null;
 	}
 
 	@Override
@@ -308,7 +371,7 @@ 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)) {
+			if (TokenManager.hasRole(AFTConstants.SUPERADMIN)|| TokenManager.hasRole(AFTConstants.TECHBROKER) || TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 				aid = null;
 			}
 			return disposeAchievementUserOwner(userIdentityMapper.selectAchievementUserOwner(aid, name));
@@ -320,7 +383,7 @@ 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)) {
+			if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.TECHBROKER) || TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 				aid = null;
 			}
 			return organizationIdentityMapper.selectAchievementOrgOwner(aid, name);

+ 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.32
+static.host=//afts.hnzhiming.com/1.0.33
 
 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.32
+static.host=//afts.hnzhiming.com/1.0.33
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc

+ 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.32
+static.host=//aftts.hnzhiming.com/1.0.33
 
 upload.path=/data/aft/public/upload
 upload.private.path=/data/aft/private/upload

+ 18 - 2
src/main/resources/props/error.properties

@@ -13,7 +13,7 @@ com.alibaba.fastjson.JSONException=\u53c2\u6570\u683c\u5f0f\u9519\u8bef\uff0c\u8
 
 NON_LOGIN=\u7528\u6237\u672a\u767b\u5f55\u3002
 
-VCODE_ERROR=\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef\uff01
+VCODE_ERROR=\u56fe\u5f62\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef\uff01
 
 NO_AUTH_ERROR=\u672a\u6388\u6743\u6216\u6388\u6743\u8fc7\u671f\u3002
 
@@ -41,7 +41,7 @@ DATA_EMPTY_ERROR=\u5f53\u524d{0}\u6ca1\u6709\u6570\u636e\u3002
 
 PWD_NOT_MATCH_ERROR=\u539f\u5bc6\u7801\u8f93\u5165\u4e0d\u5339\u914d\u3002
 
-MCODE_ERROR=\u83b7\u53d6\u624b\u673a\u9a8c\u8bc1\u7801\u5f02\u5e38\uff01
+MCODE_ERROR=\u624b\u673a\u9a8c\u8bc1\u7801\u9519\u8bef\uff01
 
 NON_CERTIFIED=\u672a\u901a\u8fc7\u5b9e\u540d\u8ba4\u8bc1\uff0c\u65e0\u6cd5\u64cd\u4f5c\uff01
 
@@ -64,3 +64,19 @@ CONTRACT_COGNIZANCE_CREATED=\u5f53\u524d\u5408\u540c\u9ad8\u4f01\u8ba4\u5b9a\u75
 EVALUATE_ID=\u8bc4\u4f30\u62a5\u544a\u627e\u4e0d\u5230\uff01
 EVALUATE_STEP=\u9519\u8bef\u7684\u8bc4\u4f30\u6b65\u9aa4\uff01
 EVALUATE_PARAM=\u8bc4\u4f30\u53c2\u6570\u9519\u8bef\uff01
+
+CONTRACT_YEAR_SECTION=\u5f53\u524d\u7533\u8bf7\u5e74\u4efd\u5df2\u4e0e\u5176\u4ed6\u5408\u540c\u7533\u8bf7\u5e74\u4efd\u91cd\u53e0\uff0c\u65e0\u6cd5\u63d0\u4ea4\u65b0\u7533\u8bf7\uff01
+
+VCODE_EMPTY_ERROR=\u56fe\u50cf\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01
+
+MCODE_FREQUENCY_ERROR=\u624b\u673a\u9a8c\u8bc1\u7801\u53d1\u9001\u9891\u7e41\uff01
+
+NON_REGISTER=\u8be5\u7528\u6237\u672a\u6ce8\u518c\uff01
+
+MCODE_EMPTY_ERROR=\u624b\u673a\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01
+
+MCODE_OVERTIME_ERROR=\u624b\u673a\u9a8c\u8bc1\u7801\u8d85\u65f6\u5931\u6548\uff01
+
+RESET_CODE_ERROR=\u9875\u9762\u5931\u6548,\u8bf7\u91cd\u65b0\u83b7\u53d6\u9a8c\u8bc1\u7801\uff01
+
+RESET_CODE_OVERTIME=\u9875\u9762\u8d85\u65f6\u5931\u6548,\u8bf7\u91cd\u65b0\u83b7\u53d6\u9a8c\u8bc1\u7801\uff01

+ 3 - 1
src/main/resources/shiro_base_auth.ini

@@ -2,10 +2,12 @@
 /=anon
 /index=anon
 /login=anon
+/user/login.html=anon
 /user/login=anon
 /user/signIn.html=anon
 /admin/login=anon
-/admin/index.html=anon
+/admin/login.html=anon
+/admin/index.html=admin
 /signin=anon
 /managesignin=anon
 /register=anon

+ 3 - 0
src/main/resources/spring/spring-shiro.xml

@@ -37,10 +37,12 @@
 
 	<bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager">
 		<constructor-arg index="0" ref="redisTemplate" />
+		<property name="defaultExpiration" value="86400" />		
 	</bean>
 	
 	<bean id="shrioRedisCacheManager" class="com.goafanti.core.shiro.cache.ShiroRedisCacheManager">
 		<property name="redisTemplate" ref="sessionRedisTemplate" />
+		<property name="expire" value="43200" />
 	</bean>
 
 	<bean id="sessionIdGenerator"
@@ -97,6 +99,7 @@
 	<!-- Session Manager -->
 	<bean id="sessionManager"
 		class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
+		<property name="sessionIdUrlRewritingEnabled" value="false" />
 		<!-- -->
 		<property name="sessionValidationInterval" value="1800000" />
 		<!-- -->

+ 1 - 20
src/main/webapp/WEB-INF/views/portal/news/newsDetails.html

@@ -11,14 +11,7 @@
 <body>
 	<header>
 		<div th:replace="common::{topNav}">
-			<div class="container">
-				<div class="lt">欢迎进入科技认知计算交易平台!</div>
-				<div class="rt">
-					<a href="/user/login.html" class="login">登录</a> <a
-						href="/user/signIn.html">注册</a> <a href="#">导航</a> <a href="#">关于我们</a>
-					<a href="#">联系我们</a>
-				</div>
-			</div>
+			
 		</div>
 	</header>
 	<div class="header_nav_detail">
@@ -100,18 +93,6 @@
 			</div>
 			<div class="tab-pane fade" id="newsDetailsTab2"></div>
 		</div>
-		<!--<div class="myPagination_div">
-            <ul class="myPagination">
-                <li class="n"><a href="#">&laquo;</a></li>
-                <li class="active"><a href="#">1</a></li>
-                <li><a href="#">2</a></li>
-                <li><a href="#">3</a></li>
-                <li><a href="#">4</a></li>
-                <li><a href="#">5</a></li>
-                <li class="n"><a href="#">&raquo;</a></li>
-            </ul>
-        </div>-->
-
 	</div>
 	<footer>
 		<div th:replace="common::copyright"></div>

File diff suppressed because it is too large
+ 0 - 68
src/main/webapp/WEB-INF/views/portal/news/newsIndex.html