wanghui лет назад: 8
Родитель
Сommit
fce848bfd8
96 измененных файлов с 2280 добавлено и 2965 удалено
  1. 1 1
      src/main/java/com/goafanti/admin/controller/AdminLectureUserApiController.java
  2. 1 1
      src/main/java/com/goafanti/admin/controller/AdminAchievementApiController.java
  3. 1 1
      src/main/java/com/goafanti/achievement/controller/AchievementApiController.java
  4. 1 1
      src/main/java/com/goafanti/admin/controller/AdminActivityApiController.java
  5. 1 1
      src/main/java/com/goafanti/admin/controller/AdminActivityUserApiController.java
  6. 0 14
      src/main/java/com/goafanti/admin/controller/AdminBigShotApiController.java
  7. 0 102
      src/main/java/com/goafanti/admin/controller/AdminCognizanceRecordApiController.java
  8. 1 1
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  9. 0 1
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  10. 0 176
      src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java
  11. 35 35
      src/main/java/com/goafanti/app/controller/MyAppApiController.java
  12. 2 3
      src/main/java/com/goafanti/app/controller/AppPortalController.java
  13. 5 9
      src/main/java/com/goafanti/app/controller/AppServiceController.java
  14. 156 2
      src/main/java/com/goafanti/app/controller/AppApiController.java
  15. 96 96
      src/main/java/com/goafanti/banners/controller/BannersApiController.java
  16. 1 1
      src/main/java/com/goafanti/admin/bo/BusinessBo.java
  17. 1 1
      src/main/java/com/goafanti/admin/bo/BusinessProjectBo.java
  18. 1 1
      src/main/java/com/goafanti/admin/bo/BusinessVarietiesBo.java
  19. 1 1
      src/main/java/com/goafanti/admin/bo/ProjectSizeBo.java
  20. 1 1
      src/main/java/com/goafanti/admin/bo/VarietiesBo.java
  21. 22 21
      src/main/java/com/goafanti/admin/controller/BusinessProjectController.java
  22. 15 16
      src/main/java/com/goafanti/admin/controller/AdminVarietiesApiController.java
  23. 3 3
      src/main/java/com/goafanti/admin/service/BusinessProjectService.java
  24. 4 4
      src/main/java/com/goafanti/admin/service/AdminVarietiesService.java
  25. 4 4
      src/main/java/com/goafanti/admin/service/impl/BusinessProjectServiceImpl.java
  26. 5 5
      src/main/java/com/goafanti/admin/service/impl/AdminVarietiesServiceImpl.java
  27. 1 1
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  28. 0 13
      src/main/java/com/goafanti/cognizanceRecord/service/CoganizanceRecordService.java
  29. 0 68
      src/main/java/com/goafanti/cognizanceRecord/service/impl/CoganizanceRecordServiceImpl.java
  30. 1 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  31. 1 1
      src/main/java/com/goafanti/common/controller/WebpageController.java
  32. 1 11
      src/main/java/com/goafanti/common/dao/AchievementMapper.java
  33. 2 2
      src/main/java/com/goafanti/common/dao/BusinessVarietiesMapper.java
  34. 0 21
      src/main/java/com/goafanti/common/dao/CoganizanceRecordMapper.java
  35. 1 1
      src/main/java/com/goafanti/common/dao/MemberGradeMapper.java
  36. 1 1
      src/main/java/com/goafanti/common/dao/ProjectSizeMapper.java
  37. 0 39
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  38. 2 2
      src/main/java/com/goafanti/common/mapper/BusinessProjectMapper.xml
  39. 5 5
      src/main/java/com/goafanti/common/mapper/BusinessVarietiesMapper.xml
  40. 0 132
      src/main/java/com/goafanti/common/mapper/CoganizanceRecordMapper.xml
  41. 4 4
      src/main/java/com/goafanti/common/mapper/MemberGradeMapper.xml
  42. 4 4
      src/main/java/com/goafanti/common/mapper/ProjectSizeMapper.xml
  43. 0 61
      src/main/java/com/goafanti/common/model/CoganizanceRecord.java
  44. 3 8
      src/main/java/com/goafanti/dataGlossory/service/impl/DistrictGlossoryServiceImpl.java
  45. 3 7
      src/main/java/com/goafanti/engagedFieldGlossory/service/impl/EngagedFieldGlossoryServiceImpl.java
  46. 1 1
      src/main/java/com/goafanti/common/task/ExpiredUserMemberTask.java
  47. 1 1
      src/main/java/com/goafanti/admin/controller/AdminContractApiController.java
  48. 1 1
      src/main/java/com/goafanti/contract/controller/ContractApiController.java
  49. 417 417
      src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java
  50. 1 1
      src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java
  51. 193 5
      src/main/java/com/goafanti/customer/controller/CustomerApiController.java
  52. 0 220
      src/main/java/com/goafanti/customer/controller/BusinessApiController.java
  53. 0 124
      src/main/java/com/goafanti/customer/service/BusinessService.java
  54. 115 0
      src/main/java/com/goafanti/customer/service/CustomerService.java
  55. 0 239
      src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java
  56. 198 1
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  57. 0 17
      src/main/java/com/goafanti/dataGlossory/service/DistrictGlossoryService.java
  58. 1 1
      src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java
  59. 1 1
      src/main/java/com/goafanti/demand/controller/DemandApiController.java
  60. 0 10
      src/main/java/com/goafanti/engagedFieldGlossory/service/EngagedFieldGlossoryService.java
  61. 577 577
      src/main/java/com/goafanti/evaluation/controller/EvaluationController.java
  62. 1 1
      src/main/java/com/goafanti/admin/controller/AdminLectureApiController.java
  63. 1 1
      src/main/java/com/goafanti/memberGrade/bo/BusinessType.java
  64. 1 1
      src/main/java/com/goafanti/memberGrade/bo/MemberGrade.java
  65. 1 1
      src/main/java/com/goafanti/memberGrade/bo/MemberGradeBO.java
  66. 6 6
      src/main/java/com/goafanti/memberGrade/controller/MemberGradeController.java
  67. 4 4
      src/main/java/com/goafanti/memberGrade/controller/MemberGradeFrontController.java
  68. 2 2
      src/main/java/com/goafanti/memberGrade/service/MemberGradeService.java
  69. 1 1
      src/main/java/com/goafanti/memberGrade/service/MemberOrderService.java
  70. 2 2
      src/main/java/com/goafanti/message/JGMessageHelper.java
  71. 1 1
      src/main/java/com/goafanti/admin/controller/AdminMessageController.java
  72. 0 5
      src/main/java/com/goafanti/message/controller/MessageApiController.java
  73. 1 1
      src/main/java/com/goafanti/admin/controller/AdminNewsApiController.java
  74. 69 69
      src/main/java/com/goafanti/consultOrder/controller/AdminConsultOrderApiController.java
  75. 1 1
      src/main/java/com/goafanti/admin/controller/AdminOrderApiController.java
  76. 85 85
      src/main/java/com/goafanti/consultOrder/controller/ConsultOrderApiController.java
  77. 1 1
      src/main/java/com/goafanti/order/controller/OrderController.java
  78. 102 102
      src/main/java/com/goafanti/consultOrder/service/ConsultOrderService.java
  79. 3 4
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  80. 1 1
      src/main/java/com/goafanti/organization/controller/OrganizationManagementController.java
  81. 1 2
      src/main/java/com/goafanti/patent/controller/PatentApiController.java
  82. 0 38
      src/main/java/com/goafanti/portal/controller/PoralResidentIntegrationController.java
  83. 1 1
      src/main/java/com/goafanti/portal/controller/PortalBigShotController.java
  84. 3 3
      src/main/java/com/goafanti/portal/controller/PortalMemberController.java
  85. 2 2
      src/main/java/com/goafanti/news/controller/NewsController.java
  86. 1 1
      src/main/java/com/goafanti/portal/controller/PortalStarController.java
  87. 0 46
      src/main/java/com/goafanti/residentIntegration/bo/ResidentIntegrationBo.java
  88. 0 17
      src/main/java/com/goafanti/residentIntegration/service/ResidentIntegrationService.java
  89. 0 33
      src/main/java/com/goafanti/residentIntegration/service/impl/ResidentIntegrationServiceImpl.java
  90. 1 1
      src/main/java/com/goafanti/admin/controller/AdminStarApiController.java
  91. 1 1
      src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java
  92. 1 1
      src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java
  93. 4 4
      src/main/java/com/goafanti/user/controller/UserLoginController.java
  94. 1 3
      src/main/java/com/goafanti/user/controller/UserPartnerApiController.java
  95. 84 19
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  96. 4 4
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.LectureUser.controller;
 
 import java.util.Arrays;
 

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.achievement.controller;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.util.ArrayList;

+ 1 - 1
src/main/java/com/goafanti/achievement/controller/AchievementApiController.java

@@ -35,7 +35,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
 @RequestMapping(value = "/api/user/achievement")
-public class AchievementApiController extends CertifyApiController {
+public class UserAchievementApiController extends CertifyApiController {
 	@Resource
 	private AchievementService		achievementService;
 	@Resource

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.activity.controller;
 
 import java.util.Arrays;
 import java.util.Calendar;

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.activityUser.controller;
 
 import javax.annotation.Resource;
 

+ 0 - 14
src/main/java/com/goafanti/admin/controller/AdminBigShotApiController.java

@@ -1,14 +0,0 @@
-package com.goafanti.admin.controller;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.common.controller.BaseApiController;
-/**
- * 大咖说首页
- */
-@RestController
-@RequestMapping(value = "/api/admin/bigShot")
-public class AdminBigShotApiController extends BaseApiController{
-		
-}

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

@@ -1,102 +0,0 @@
-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;
-	}
-
-}

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

@@ -61,12 +61,12 @@ import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.common.model.User;
+import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.utils.FileUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.easemob.enums.EasemonSysUsers;
 import com.goafanti.patent.bo.InputPatentCost;

+ 0 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -12,7 +12,6 @@ import org.springframework.stereotype.Service;
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.AdminService;
-import com.goafanti.app.bo.AppAdminListBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminLocationMapper;
 import com.goafanti.common.dao.AdminMapper;

+ 0 - 176
src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java

@@ -1,176 +0,0 @@
-package com.goafanti.app.controller;
-
-import javax.annotation.Resource;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-
-import com.goafanti.achievement.service.AchievementInterestService;
-import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.activity.service.ActivityService;
-import com.goafanti.banners.service.BannersService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
-
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.demand.service.DemandService;
-import com.goafanti.news.service.NewsService;
-
-import com.goafanti.user.service.UserCareerService;
-import com.goafanti.user.service.UserIdentityService;
-import com.goafanti.user.service.UserInterestService;
-
-@RestController
-@RequestMapping(path = "/api/open/achievementDemand", method = RequestMethod.GET)
-public class AppAchievementDemandController extends BaseApiController {
-	@Resource
-	private BannersService		bannersService;
-	@Resource
-	private ActivityService		activityService;
-	@Resource
-	private NewsService			newsService;
-	@Resource
-	private AchievementService	achievementService;
-	@Resource
-	private DemandService		demandService;
-	@Resource
-	private UserCareerService	userCareerService;
-	@Resource
-	private UserInterestService userInterestService; 
-	@Resource
-	private UserIdentityService	userIdentityService;
-	@Resource
-	AchievementInterestService achievementInterestService;
-	
-	/**
-	 * 关注功能
-	 */
-	@RequestMapping(value = "/interestAdd", method = RequestMethod.GET)
-	public Result Addinterest( Integer type,String objectId,String interest) {
-		Result res = new Result();
-		if (null==type) {
-			res.getError().add(buildError( "分类错误!", "分类错误"));
-			return res;
-		}
-		String uid=null;
-		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
-			uid=TokenManager.getUserId();
-		}
-		
-		if (Integer.valueOf(interest)==0) {
-			res.setData(achievementInterestService.saveInterest( uid, type, objectId,interest));
-		}else {
-			res.setData(achievementInterestService.deleteInterest( uid, type, objectId,interest));
-		}
-			
-		return res;
-	}
-	
-	
-	/**
-	 * 我的成果
-	 */
-	@RequestMapping(value = "/achievementList", method = RequestMethod.GET)
-	private Result achievementList(String pageNo, String pageSize) {
-		Result res = new Result();
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(achievementService.listAppMyAchievement(pNo, pSize));
-		return res;
-	}
-
-	/**
-	 * 我的需求
-	 */
-	@RequestMapping(value = "/demandList", method = RequestMethod.GET)
-	public Result demandList(String pageNo, String pageSize) {
-		Result res = new Result();
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(demandService.listMyDemand( pNo, pSize));
-		return res;
-	}
-	/**
-	 * 关注列表
-	 */
-	@RequestMapping(value = "/interestList", method = RequestMethod.GET)
-	public Result interestList(Integer type,String pageNo, String pageSize) {
-		Result res = new Result();
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (null==type||type<0||type>5) {
-			res.getError().add(buildError( "类型选择错误", "类型选择错误"));
-		}
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(demandService.selectinterest(type, pNo, pSize));
-		return res;
-	}
-	/**
-	 * 专家详情
-	 */
-	@RequestMapping(value = "/expertsDetail", method = RequestMethod.GET)
-	public Result expertsDetail(String uid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(uid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"专家必须指定","专家"));
-			return res;
-		}
-		res.setData(userIdentityService.expertsDetail( uid));
-		return res;
-	}
-	/**
-	 * 成果详情
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/achievementDetail", method = RequestMethod.GET)
-	private Result userDetail(String id ) {
-		Result res = new Result();
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"成果必须指定","成果"));
-			return res;
-		}
-		res.setData(achievementService.selectAppUserOwnerDetail(id));
-		return res;
-	}
-	/**
-	 * 需求详情
-	 */
-	@RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
-	public Result DemandDetail(String id ) {
-		Result res = new Result();
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"需求必须指定","需求"));
-			return res;
-		}
-		res.setData(demandService.selectDemandDetail( id));
-		return res;
-	}
-	
-	
-	
-	
-}

+ 35 - 35
src/main/java/com/goafanti/app/controller/MyAppApiController.java

@@ -1,35 +1,35 @@
-package com.goafanti.app.controller;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.app.service.AppConfigService;
-import com.goafanti.app.service.MyAppService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.utils.StringUtils;
-
-@RestController
-@RequestMapping(path = "/api/app", method = RequestMethod.GET)
-public class MyAppApiController extends BaseApiController {
-
-	@Autowired
-	AppConfigService	appConfigService;
-	@Autowired
-	MyAppService		myAppService;
-
-	@RequestMapping(value = "/config", method = RequestMethod.GET)
-	public Result config(String noCache) {
-		if (StringUtils.equals(noCache, "1")) {
-			appConfigService.cleanList();
-		}
-		return res().data(appConfigService.findPortalAppConfigs());
-	}
-
-	@RequestMapping(value = "/count", method = RequestMethod.GET)
-	public Result count(String cate) {
-		return res().data(myAppService.countByCate(cate));
-	}
-}
+package com.goafanti.app.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.app.service.AppConfigService;
+import com.goafanti.app.service.MyAppService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.utils.StringUtils;
+
+@RestController
+@RequestMapping(path = "/api/app", method = RequestMethod.GET)
+public class AppConfigController extends BaseApiController {
+
+	@Autowired
+	AppConfigService	appConfigService;
+	@Autowired
+	MyAppService		myAppService;
+
+	@RequestMapping(value = "/config", method = RequestMethod.GET)
+	public Result config(String noCache) {
+		if (StringUtils.equals(noCache, "1")) {
+			appConfigService.cleanList();
+		}
+		return res().data(appConfigService.findPortalAppConfigs());
+	}
+
+	@RequestMapping(value = "/count", method = RequestMethod.GET)
+	public Result count(String cate) {
+		return res().data(myAppService.countByCate(cate));
+	}
+}

+ 2 - 3
src/main/java/com/goafanti/app/controller/AppPortalController.java

@@ -15,8 +15,8 @@ import com.goafanti.demand.service.DemandService;
 import com.goafanti.user.service.UserIdentityService;
 
 @RestController
-@RequestMapping(path = "/portal/app/achievementDemand", method = RequestMethod.GET)
-public class AppPortalController extends BaseApiController {
+@RequestMapping(path = "/app/discovery", method = RequestMethod.GET)
+public class AppDiscoveryController extends BaseApiController {
 	@Resource
 	private AchievementService	achievementService;
 	@Resource
@@ -73,7 +73,6 @@ public class AppPortalController extends BaseApiController {
 		return res;
 	}
 	
-	
 	/**
 	 * 行业分类列表
 	 * 

+ 5 - 9
src/main/java/com/goafanti/app/controller/AppServiceController.java

@@ -5,9 +5,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.admin.service.AdminService;
-import com.goafanti.admin.service.AdminVarietiesService;
-import com.goafanti.admin.service.BusinessProjectService;
 import com.goafanti.app.bo.ServiceImages;
+import com.goafanti.business.service.BusinessVarietiesService;
+import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
@@ -15,22 +15,18 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.user.service.UserIdentityService;
 
 
-
-
 @RestController
-@RequestMapping(path = "/portal/Service", method = RequestMethod.GET)
+@RequestMapping(path = "/app/service", method = RequestMethod.GET)
 public class AppServiceController extends BaseApiController {
 	@Resource
-	private AdminVarietiesService	adminVarietiesService;
+	private BusinessVarietiesService	adminVarietiesService;
 	@Resource
 	private BusinessProjectService	businessProjectService;
 	@Resource
 	private AdminService			adminService;
 	@Resource
 	private UserIdentityService 	userIdentityService;
-	
-	
-	
+
 	/**
 	 * 获取初级品类
 	 */

+ 156 - 2
src/main/java/com/goafanti/app/controller/AppApiController.java

@@ -16,6 +16,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.alibaba.fastjson.JSONObject;
+import com.goafanti.achievement.service.AchievementInterestService;
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.activity.service.ActivityService;
+import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
@@ -27,22 +31,46 @@ import com.goafanti.common.model.MessageProducer;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.service.DemandService;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.easemob.bo.EasemobInfo;
 import com.goafanti.message.bo.MessageBo;
 import com.goafanti.message.bo.MessageListBo;
 import com.goafanti.message.service.MessageService;
+import com.goafanti.news.service.NewsService;
+import com.goafanti.user.service.UserCareerService;
+import com.goafanti.user.service.UserIdentityService;
+import com.goafanti.user.service.UserInterestService;
 import com.goafanti.user.service.UserService;
 
 @RestController
-@RequestMapping(path = "/api/user/app", method = RequestMethod.GET)
-public class AppApiController extends BaseApiController {
+@RequestMapping(path = "/app/user", method = RequestMethod.GET)
+public class AppUserController extends BaseApiController {
 	@Resource
 	private UserService userServiceImpl;
 	@Resource
 	private MessageService messageService;
 	@Resource
 	private EasemobUtils   easemobUtils;
+	@Resource
+	private BannersService		bannersService;
+	@Resource
+	private ActivityService		activityService;
+	@Resource
+	private NewsService			newsService;
+	@Resource
+	private AchievementService	achievementService;
+	@Resource
+	private DemandService		demandService;
+	@Resource
+	private UserCareerService	userCareerService;
+	@Resource
+	private UserInterestService userInterestService; 
+	@Resource
+	private UserIdentityService	userIdentityService;
+	@Resource
+	AchievementInterestService achievementInterestService;
+	
 	@RequestMapping(value = "/uploadImg",method = RequestMethod.POST)
 	public Result uploadAvatar(HttpServletRequest req){
 		Result res = new Result();
@@ -208,4 +236,130 @@ public class AppApiController extends BaseApiController {
 		res.setData(jsonObject);
 		return res;
 	}
+	
+	
+	/**
+	 * 关注功能
+	 */
+	@RequestMapping(value = "/interestAdd", method = RequestMethod.GET)
+	public Result Addinterest( Integer type,String objectId,String interest) {
+		Result res = new Result();
+		if (null==type) {
+			res.getError().add(buildError( "分类错误!", "分类错误"));
+			return res;
+		}
+		String uid=null;
+		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
+			uid=TokenManager.getUserId();
+		}
+		
+		if (Integer.valueOf(interest)==0) {
+			res.setData(achievementInterestService.saveInterest( uid, type, objectId,interest));
+		}else {
+			res.setData(achievementInterestService.deleteInterest( uid, type, objectId,interest));
+		}
+			
+		return res;
+	}
+	
+	
+	/**
+	 * 我的成果
+	 */
+	@RequestMapping(value = "/achievementList", method = RequestMethod.GET)
+	private Result achievementList(String pageNo, String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(achievementService.listAppMyAchievement(pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 我的需求
+	 */
+	@RequestMapping(value = "/demandList", method = RequestMethod.GET)
+	public Result demandList(String pageNo, String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.listMyDemand( pNo, pSize));
+		return res;
+	}
+	/**
+	 * 关注列表
+	 */
+	@RequestMapping(value = "/interestList", method = RequestMethod.GET)
+	public Result interestList(Integer type,String pageNo, String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (null==type||type<0||type>5) {
+			res.getError().add(buildError( "类型选择错误", "类型选择错误"));
+		}
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.selectinterest(type, pNo, pSize));
+		return res;
+	}
+	/**
+	 * 专家详情
+	 */
+	@RequestMapping(value = "/expertsDetail", method = RequestMethod.GET)
+	public Result expertsDetail(String uid) {
+		Result res = new Result();
+		if (StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"专家必须指定","专家"));
+			return res;
+		}
+		res.setData(userIdentityService.expertsDetail( uid));
+		return res;
+	}
+	/**
+	 * 成果详情
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/achievementDetail", method = RequestMethod.GET)
+	private Result userDetail(String id ) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"成果必须指定","成果"));
+			return res;
+		}
+		res.setData(achievementService.selectAppUserOwnerDetail(id));
+		return res;
+	}
+	/**
+	 * 需求详情
+	 */
+	@RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
+	public Result DemandDetail(String id ) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"需求必须指定","需求"));
+			return res;
+		}
+		res.setData(demandService.selectDemandDetail( id));
+		return res;
+	}
 }

+ 96 - 96
src/main/java/com/goafanti/banners/controller/BannersApiController.java

@@ -1,96 +1,96 @@
-package com.goafanti.banners.controller;
-
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.Assert;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import com.goafanti.banners.enums.BannersType;
-import com.goafanti.banners.service.BannersService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.model.Banners;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.JDBCIdGenerator;
-
-@Controller
-@RequestMapping(value = "/api/admin/banners")
-public class BannersApiController extends BaseApiController {
-	@Resource
-	BannersService	bannersService;
-	@Autowired
-	JDBCIdGenerator	idGenerator;
-
-	@RequestMapping(value = "/upload", method = RequestMethod.POST)
-	public Result upload(String sign, HttpServletRequest req) {
-		Assert.isTrue(StringUtils.isNotBlank(sign) && BannersType.containsType(sign), "广告图位置标示不正确。");
-		Result res = res();
-		Calendar c = Calendar.getInstance();
-		res.data(handleFile(res, false, req, AttachmentType.BANNERS_PIC.getCode(), String.valueOf(c.get(Calendar.YEAR)),
-				String.valueOf(c.get(Calendar.MONTH) + 1), idGenerator.generateId().toString()));
-		return res;
-	}
-
-	@RequestMapping(value = "/save", method = RequestMethod.POST)
-	public Result save(@Valid Banners banners, BindingResult bindingResult) {
-		Assert.notNull(banners, "广告图参数不正确");
-		Assert.isTrue(StringUtils.isNotBlank(banners.getSign()) && BannersType.containsType(banners.getSign()),
-				"广告图位置标示不正确。");
-		Assert.hasText(banners.getImgurl(), "广告图url参数不正确");
-		Assert.isTrue(!bindingResult.hasFieldErrors(),
-				bindingResult.hasFieldErrors() ? bindingResult.getFieldError().getDefaultMessage() : "");
-		Result res = res();
-		if (banners.getId() == null) {
-			banners.setId(idGenerator.generateId());
-			res.data(bannersService.insertBanner(banners));
-		} else {
-			res.data(bannersService.updateBanner(banners));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	public Result portalBannersList(String key, String pageNo, String pageSize) {
-		Assert.isTrue(StringUtils.isBlank(key) || BannersType.containsType(key), "广告图位置标示不正确。");
-		Integer pN = getPageNo(pageNo);
-		Integer pS = getPageSize(pageSize);
-		Map<String, Object> result = new HashMap<>();
-		result.put("list", bannersService.findBannersList(key, (pN - 1) * pS, pS));
-		result.put("total", bannersService.findBannersListCount(key));
-		return res().data(result);
-	}
-
-	@RequestMapping(value = "/delete", method = RequestMethod.POST)
-	public Result delete(String id) {
-		Assert.isTrue(StringUtils.isNumeric(id), "广告图id不正确。");
-		return res().data(bannersService.deleteBanner(Long.valueOf(id)));
-	}
-
-	@RequestMapping(value = "/clearCache", method = RequestMethod.GET)
-	public Result clearCache(String key) {
-		Assert.isTrue(StringUtils.isNotBlank(key) && BannersType.containsType(key), "广告图位置标示不正确。");
-		bannersService.cleanList(key);
-		return res().data(bannersService.findPortalBanners(key));
-	}
-
-	@RequestMapping(value = "/keys", method = RequestMethod.GET)
-	public Result portalBannersKeys() {
-		Map<String, String> types = new HashMap<>();
-		for (BannersType type : BannersType.values()) {
-			types.put(type.getKey(), type.getDesc());
-		}
-		return res().data(types);
-	}
-
-}
+package com.goafanti.banners.controller;
+
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.Assert;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.goafanti.banners.enums.BannersType;
+import com.goafanti.banners.service.BannersService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.Banners;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+
+@Controller
+@RequestMapping(value = "/api/admin/banners")
+public class AdminBannersApiController extends BaseApiController {
+	@Resource
+	BannersService	bannersService;
+	@Autowired
+	JDBCIdGenerator	idGenerator;
+
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result upload(String sign, HttpServletRequest req) {
+		Assert.isTrue(StringUtils.isNotBlank(sign) && BannersType.containsType(sign), "广告图位置标示不正确。");
+		Result res = res();
+		Calendar c = Calendar.getInstance();
+		res.data(handleFile(res, false, req, AttachmentType.BANNERS_PIC.getCode(), String.valueOf(c.get(Calendar.YEAR)),
+				String.valueOf(c.get(Calendar.MONTH) + 1), idGenerator.generateId().toString()));
+		return res;
+	}
+
+	@RequestMapping(value = "/save", method = RequestMethod.POST)
+	public Result save(@Valid Banners banners, BindingResult bindingResult) {
+		Assert.notNull(banners, "广告图参数不正确");
+		Assert.isTrue(StringUtils.isNotBlank(banners.getSign()) && BannersType.containsType(banners.getSign()),
+				"广告图位置标示不正确。");
+		Assert.hasText(banners.getImgurl(), "广告图url参数不正确");
+		Assert.isTrue(!bindingResult.hasFieldErrors(),
+				bindingResult.hasFieldErrors() ? bindingResult.getFieldError().getDefaultMessage() : "");
+		Result res = res();
+		if (banners.getId() == null) {
+			banners.setId(idGenerator.generateId());
+			res.data(bannersService.insertBanner(banners));
+		} else {
+			res.data(bannersService.updateBanner(banners));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result portalBannersList(String key, String pageNo, String pageSize) {
+		Assert.isTrue(StringUtils.isBlank(key) || BannersType.containsType(key), "广告图位置标示不正确。");
+		Integer pN = getPageNo(pageNo);
+		Integer pS = getPageSize(pageSize);
+		Map<String, Object> result = new HashMap<>();
+		result.put("list", bannersService.findBannersList(key, (pN - 1) * pS, pS));
+		result.put("total", bannersService.findBannersListCount(key));
+		return res().data(result);
+	}
+
+	@RequestMapping(value = "/delete", method = RequestMethod.POST)
+	public Result delete(String id) {
+		Assert.isTrue(StringUtils.isNumeric(id), "广告图id不正确。");
+		return res().data(bannersService.deleteBanner(Long.valueOf(id)));
+	}
+
+	@RequestMapping(value = "/clearCache", method = RequestMethod.GET)
+	public Result clearCache(String key) {
+		Assert.isTrue(StringUtils.isNotBlank(key) && BannersType.containsType(key), "广告图位置标示不正确。");
+		bannersService.cleanList(key);
+		return res().data(bannersService.findPortalBanners(key));
+	}
+
+	@RequestMapping(value = "/keys", method = RequestMethod.GET)
+	public Result portalBannersKeys() {
+		Map<String, String> types = new HashMap<>();
+		for (BannersType type : BannersType.values()) {
+			types.put(type.getKey(), type.getDesc());
+		}
+		return res().data(types);
+	}
+
+}

+ 1 - 1
src/main/java/com/goafanti/admin/bo/BusinessBo.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.business.bo;
 
 import java.util.Date;
 

+ 1 - 1
src/main/java/com/goafanti/admin/bo/BusinessProjectBo.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.business.bo;
 
 
 import java.math.BigDecimal;

+ 1 - 1
src/main/java/com/goafanti/admin/bo/BusinessVarietiesBo.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.business.bo;
 
 
 import java.util.Date;

+ 1 - 1
src/main/java/com/goafanti/admin/bo/ProjectSizeBo.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.business.bo;
 
 
 import java.math.BigDecimal;

+ 1 - 1
src/main/java/com/goafanti/admin/bo/VarietiesBo.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.business.bo;
 
 public class VarietiesBo {
 	private String id;

+ 22 - 21
src/main/java/com/goafanti/admin/controller/BusinessProjectController.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.business.controller;
 
 
 import javax.annotation.Resource;
@@ -8,7 +8,8 @@ import javax.servlet.http.HttpServletRequest;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
-import com.goafanti.admin.service.BusinessProjectService;
+
+import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
@@ -20,10 +21,10 @@ import com.goafanti.common.utils.StringUtils;
 
 @RestController
 @RequestMapping("/api/admin/ProjectSize")
-public class BusinessProjectController extends CertifyApiController{
+public class AdminBusinessProjectController extends CertifyApiController{
 	
 	@Resource
-	BusinessProjectService businessprojectService;
+	BusinessProjectService businessProjectService;
 	
 	/**
 	 * 新增项目
@@ -40,7 +41,7 @@ public class BusinessProjectController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "所属品类为空", "所属品类"));
 			return res;
 		}
-		if (businessprojectService.getBnamecount(bname)>0) {
+		if (businessProjectService.getBnamecount(bname)>0) {
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "项目名称已存在", "项目名称"));
 			return res;
 		}
@@ -50,7 +51,7 @@ public class BusinessProjectController extends CertifyApiController{
 				return res;
 			}
 		}
-		res.setData(businessprojectService.insert(bname, cid, country,province,city,district));
+		res.setData(businessProjectService.insert(bname, cid, country,province,city,district));
 		return res; 
 	}
 	
@@ -67,7 +68,7 @@ public class BusinessProjectController extends CertifyApiController{
 			}
 		}
 		
-		 res.setData(businessprojectService.listProject( bname, cid, country,province, city, district ,activityFlag, status, pageNo,pageSize ));
+		 res.setData(businessProjectService.listProject( bname, cid, country,province, city, district ,activityFlag, status, pageNo,pageSize ));
 		return res;
 	}
 	/**
@@ -93,7 +94,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/orgProject", method = RequestMethod.GET)
 	public Result orgProject(String id){
 		Result res=new Result();
-		res.setData(businessprojectService.orgProjects(id));
+		res.setData(businessProjectService.orgProjects(id));
 		return res;
 	}
 	/**
@@ -102,7 +103,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/deleteProject", method = RequestMethod.GET)
 	public Result deleteProject(String id){
 		Result res=new Result();
-		res.setData(businessprojectService.deleteProject(id));
+		res.setData(businessProjectService.deleteProject(id));
 		return res;
 	}
 	
@@ -112,7 +113,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/stopProject", method = RequestMethod.GET)
 	public Result stopProject(String id){
 		Result res=new Result();
-		res.setData(businessprojectService.updateStopProject(id));
+		res.setData(businessProjectService.updateStopProject(id));
 		return res;
 	}
 	/**
@@ -121,7 +122,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/getAllCname", method = RequestMethod.GET)
 	public Result getAllCname(Integer flag){
 		Result res=new Result();
-		res.setData(businessprojectService.getAllCnames(flag));
+		res.setData(businessProjectService.getAllCnames(flag));
 		return res;
 	}
 	
@@ -140,7 +141,7 @@ public class BusinessProjectController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "所属品类为空", "所属品类"));
 			return res;
 		}
-		if (businessprojectService.judgeBeing(s)) {
+		if (businessProjectService.judgeBeing(s)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "项目名称已存在", "项目名称"));
 			return res;
 		}
@@ -150,7 +151,7 @@ public class BusinessProjectController extends CertifyApiController{
 				return res;
 			}
 		}
-		res.setData(businessprojectService.updateProject(s));
+		res.setData(businessProjectService.updateProject(s));
 		return res;
 	}
 	/**
@@ -159,16 +160,16 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/addProjectSize", method = RequestMethod.POST)
 	public Result addProjectSize(ProjectSize ps){
 		Result res=new Result();
-		if (businessprojectService.WhetherRepeat(ps)) {
+		if (businessProjectService.WhetherRepeat(ps)) {
 				res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "规格名称已存在", "规格名称"));
 				return res;
 			}
-		if (businessprojectService.judgeStatus(ps)) {
+		if (businessProjectService.judgeStatus(ps)) {
 			res.getError().add(buildError( "项目已停用", "项目已停用"));
 			return res;
 		}
 		
-		res.setData(businessprojectService.addProjectSize(ps));
+		res.setData(businessProjectService.addProjectSize(ps));
 		return res;
 	}
 	
@@ -178,7 +179,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/orgProjectSize", method = RequestMethod.POST)
 	public Result orgProjectSize(ProjectSize ps){
 		Result res=new Result();
-		res.setData(businessprojectService.updateOrgProjectSize(ps));
+		res.setData(businessProjectService.updateOrgProjectSize(ps));
 		return res;
 	}
 	/**
@@ -191,7 +192,7 @@ public class BusinessProjectController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "项目名称名称为空", "项目"));
 			return res;
 		}
-		res.setData(businessprojectService.listProjectSize(pid,pNo, Psize));
+		res.setData(businessProjectService.listProjectSize(pid,pNo, Psize));
 		return res;
 	}
 	
@@ -201,7 +202,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/getProjectSize", method = RequestMethod.GET)
 	public Result getProjectSize(String  id){
 		Result res=new Result();
-		res.setData(businessprojectService.getProjectSize(id));
+		res.setData(businessProjectService.getProjectSize(id));
 		return res;
 	}
 	/**
@@ -210,7 +211,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/deleteProjectSize", method = RequestMethod.GET)
 	public Result deleteProjectSize(String  id){
 		Result res=new Result();
-		res.setData(businessprojectService.deleteProjectSize(id));
+		res.setData(businessProjectService.deleteProjectSize(id));
 		return res;
 	}
 	/**
@@ -219,7 +220,7 @@ public class BusinessProjectController extends CertifyApiController{
 	@RequestMapping(value = "/stopProjectSize", method = RequestMethod.GET)
 	public Result stopProjectSize(String  id){
 		Result res=new Result();
-		res.setData(businessprojectService.updateSotpProjectSize(id));
+		res.setData(businessProjectService.updateSotpProjectSize(id));
 		return res;
 	}
 }

+ 15 - 16
src/main/java/com/goafanti/admin/controller/AdminVarietiesApiController.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.business.controller;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -7,8 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-
-import com.goafanti.admin.service.AdminVarietiesService;
+import com.goafanti.business.service.BusinessVarietiesService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 
@@ -19,7 +18,7 @@ import com.goafanti.common.utils.StringUtils;
 @RequestMapping("api/admin/Varieties")
 public class AdminVarietiesApiController extends CertifyApiController{
 	@Resource
-	private AdminVarietiesService adminVarietiesService;
+	private BusinessVarietiesService businessVarietiesService;
 	
 	/**
 	 * 新增品类
@@ -35,16 +34,16 @@ public class AdminVarietiesApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "上级品类为空", "上级品类"));
 			return res;
 		}
-		if (0<(adminVarietiesService.isBeing(cname))) {
+		if (0<(businessVarietiesService.isBeing(cname))) {
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "品类名称已存在", "品类名称"));
 			return res;
 		}
-		if (2<adminVarietiesService.getLayer(superId)) {
+		if (2<businessVarietiesService.getLayer(superId)) {
 			res.getError().add(buildError( "品类层级不能大于3", "品类层级不能大于3")); 
 			return res;
 		}
 		
-		res.setData(adminVarietiesService.insert(cname,superId));
+		res.setData(businessVarietiesService.insert(cname,superId));
 		
 		return res;
 		
@@ -56,7 +55,7 @@ public class AdminVarietiesApiController extends CertifyApiController{
 	public Result vtList(String cname,String superId,Integer layer,
 			String status,Integer pageNo, Integer pageSize) {
 		Result res = new Result();
-        res.setData(adminVarietiesService.listVarieties(cname, superId, layer,
+        res.setData(businessVarietiesService.listVarieties(cname, superId, layer,
         		status, pageNo, pageSize));
 		return res;
 	}
@@ -67,7 +66,7 @@ public class AdminVarietiesApiController extends CertifyApiController{
 	@RequestMapping(value = "/getSuperList" , method = RequestMethod.GET)
 	public Result getSuperList() {
 		Result res=new Result();
-		res.setData(adminVarietiesService.getSuperList());
+		res.setData(businessVarietiesService.getSuperList());
 		return res;
 		
 	}
@@ -77,7 +76,7 @@ public class AdminVarietiesApiController extends CertifyApiController{
 	@RequestMapping(value="/detailVarieties" ,method=RequestMethod.GET)
 	public Result detailVarieties(String  id) {
 		Result res = new Result();
-		res.setData(adminVarietiesService.editVarieties(id));
+		res.setData(businessVarietiesService.editVarieties(id));
 		return res;
 	}
 	/**
@@ -94,15 +93,15 @@ public class AdminVarietiesApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "上级用户为空", "上级用户"));
 			return res;
 		}
-		if (1<(adminVarietiesService.isBeing(cname))) {
+		if (1<(businessVarietiesService.isBeing(cname))) {
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "品类名称已存在", "品类名称"));
 			return res;
 		}
-		if (adminVarietiesService.ifLayer(superId,id)) {
+		if (businessVarietiesService.ifLayer(superId,id)) {
 			res.getError().add(buildError( "品类层级不能超过三级", "品类层级不能超过三级"));
 			return res;
 		}
-		res.setData(adminVarietiesService.updateVarietoes(id, cname, superId, status, varietiesLogo));
+		res.setData(businessVarietiesService.updateVarietoes(id, cname, superId, status, varietiesLogo));
 		return res; 
 	}
 	/**
@@ -111,11 +110,11 @@ public class AdminVarietiesApiController extends CertifyApiController{
 	@RequestMapping(value = "/deleteState", method = RequestMethod.GET)
 	public Result deleteState(String id){
 		Result res=new Result();
-		if (adminVarietiesService.getCountSon(id)>0) {
+		if (businessVarietiesService.getCountSon(id)>0) {
 			res.getError().add(buildError("品类下存在子品类", "品类存在子品类"));
 			return res;
 		}
-		res.setData(adminVarietiesService.deleteState(id));
+		res.setData(businessVarietiesService.deleteState(id));
 		return res;
 	}
 	/**
@@ -124,7 +123,7 @@ public class AdminVarietiesApiController extends CertifyApiController{
 	@RequestMapping(value = "/updateStatus", method = RequestMethod.GET)
 	public Result updateStatus(String id){
 		Result res=new Result();
-		res.setData(adminVarietiesService.updateStatus(id));
+		res.setData(businessVarietiesService.updateStatus(id));
 		return res;
 	}
 	/**

+ 3 - 3
src/main/java/com/goafanti/admin/service/BusinessProjectService.java

@@ -1,13 +1,13 @@
-package com.goafanti.admin.service;
+package com.goafanti.business.service;
 
 
 
 import java.util.List;
 import java.util.Map;
 
-import com.goafanti.admin.bo.BusinessProjectBo;
-import com.goafanti.admin.bo.ProjectSizeBo;
 import com.goafanti.app.bo.ProjectBo;
+import com.goafanti.business.bo.BusinessProjectBo;
+import com.goafanti.business.bo.ProjectSizeBo;
 import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.BusinessVarieties;
 import com.goafanti.common.model.ProjectSize;

+ 4 - 4
src/main/java/com/goafanti/admin/service/AdminVarietiesService.java

@@ -1,13 +1,13 @@
-package com.goafanti.admin.service;
+package com.goafanti.business.service;
 
 import java.util.List;
 
-import com.goafanti.admin.bo.BusinessVarietiesBo;
-import com.goafanti.admin.bo.VarietiesBo;
+import com.goafanti.business.bo.BusinessVarietiesBo;
+import com.goafanti.business.bo.VarietiesBo;
 import com.goafanti.common.model.BusinessVarieties;
 import com.goafanti.core.mybatis.page.Pagination;
 
-public interface AdminVarietiesService {
+public interface BusinessVarietiesService {
 	
 	int insert(String cname, String superId);
 	

+ 4 - 4
src/main/java/com/goafanti/admin/service/impl/BusinessProjectServiceImpl.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.service.impl;
+package com.goafanti.business.service.impl;
 
 
 import java.util.ArrayList;
@@ -12,11 +12,11 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.admin.bo.BusinessProjectBo;
-import com.goafanti.admin.bo.ProjectSizeBo;
-import com.goafanti.admin.service.BusinessProjectService;
 import com.goafanti.app.bo.ProjectBo;
 import com.goafanti.app.bo.ProjectDetailBo;
+import com.goafanti.business.bo.BusinessProjectBo;
+import com.goafanti.business.bo.ProjectSizeBo;
+import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.BusinessVarietiesMapper;
 import com.goafanti.common.dao.ProjectInterestMapper;

+ 5 - 5
src/main/java/com/goafanti/admin/service/impl/AdminVarietiesServiceImpl.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.service.impl;
+package com.goafanti.business.service.impl;
 
 import java.util.Date;
 import java.util.HashMap;
@@ -10,9 +10,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.admin.bo.BusinessVarietiesBo;
-import com.goafanti.admin.bo.VarietiesBo;
-import com.goafanti.admin.service.AdminVarietiesService;
+import com.goafanti.business.bo.BusinessVarietiesBo;
+import com.goafanti.business.bo.VarietiesBo;
+import com.goafanti.business.service.BusinessVarietiesService;
 import com.goafanti.common.dao.BusinessVarietiesMapper;
 import com.goafanti.common.model.BusinessVarieties;
 import com.goafanti.common.utils.StringUtils;
@@ -21,7 +21,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 
 @Service
-public class AdminVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesMapper> implements AdminVarietiesService {
+public class BusinessVarietiesServiceImpl extends BaseMybatisDao<BusinessVarietiesMapper> implements BusinessVarietiesService {
 	
 	@Autowired
 	private BusinessVarietiesMapper businessVarietiesMapper;

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

@@ -109,7 +109,7 @@ import com.goafanti.user.service.UserService;
 
 @Controller
 @RequestMapping(value = "/api/user/cognizance")
-public class CognizanceApiController extends CertifyApiController {
+public class UserCognizanceApiController extends CertifyApiController {
 	@Resource
 	private UserService						userService;
 	@Resource

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

@@ -1,13 +0,0 @@
-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);
-
-}

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

@@ -1,68 +0,0 @@
-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);
-
-	}
-
-}

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

@@ -25,6 +25,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.User;
+import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.IndustryCategoryService;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
@@ -33,7 +34,6 @@ import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 import com.goafanti.user.service.UserService;
 
 @Controller

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

@@ -20,8 +20,8 @@ import com.goafanti.common.enums.AchievementMaturity;
 import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.marketing.bo.MarketingManagementBo;
 import com.goafanti.marketing.service.MarketingManagementService;

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

@@ -14,7 +14,6 @@ import com.goafanti.portal.bo.AchievementDetailBo;
 import com.goafanti.portal.bo.AchievementPortalDetailBo;
 import com.goafanti.portal.bo.AchievementPortalSimilarListBo;
 import com.goafanti.portal.bo.InternationalListBo;
-import com.goafanti.residentIntegration.bo.ResidentIntegrationBo;
 
 public interface AchievementMapper {
 	int deleteByPrimaryKey(String id);
@@ -59,16 +58,7 @@ public interface AchievementMapper {
 	
 	/** 查询国际化技术 **/
 	List<InternationalListBo> selectInternationalAchievement();
-	
-	/** 查询军民融合成果 **/
-	List<ResidentIntegrationBo> selectJmrhAchievement();
-	
-	/** 查询军民融合技术 **/
-	List<ResidentIntegrationBo> selectJmrTechnology();
-	
-	/** 查询军民融合项目 **/
-	List<ResidentIntegrationBo> selectJmrProject();
-	
+
 	/** 查询精品项目 **/
 	List<AchievementListBo> listAchievement();
 	

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

@@ -1,7 +1,7 @@
 package com.goafanti.common.dao;
 
-import com.goafanti.admin.bo.BusinessVarietiesBo;
-import com.goafanti.admin.bo.VarietiesBo;
+import com.goafanti.business.bo.BusinessVarietiesBo;
+import com.goafanti.business.bo.VarietiesBo;
 import com.goafanti.common.model.BusinessVarieties;
 import com.goafanti.common.model.BusinessVarietiesExample;
 import java.util.List;

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

@@ -1,21 +0,0 @@
-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);
-}

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

@@ -4,7 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.goafanti.common.model.MemberOrder;
-import com.goafanti.memberGrade.bo.MemberGrade;
+import com.goafanti.member.bo.MemberGrade;
 
 public interface MemberGradeMapper {
 	List<MemberGrade> selectMemberGrade();

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

@@ -1,6 +1,6 @@
 package com.goafanti.common.dao;
 
-import com.goafanti.admin.bo.ProjectSizeBo;
+import com.goafanti.business.bo.ProjectSizeBo;
 import com.goafanti.common.model.ProjectSize;
 import com.goafanti.common.model.ProjectSizeExample;
 import java.util.List;

+ 0 - 39
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1653,45 +1653,6 @@
 		a.release_date desc
 	limit 0,5
   </select>
-  <select id="selectJmrhAchievement" resultType="com.goafanti.residentIntegration.bo.ResidentIntegrationBo">
-  	select 
-  		id, name, owner_type as ownerType
-	from 
-		achievement t 
-	where 
-		jmrh_flag = 1 and data_category = 0 and audit_status = 3
-	order by 
-		create_time desc
-	limit 5;
-  </select>
-  <select id="selectJmrTechnology" resultType="com.goafanti.residentIntegration.bo.ResidentIntegrationBo">
-  	select 
-  		id, name, maturity, owner_type as ownerType
-	from 
-		achievement t 
-	where 
-		jmrh_flag = 1 and data_category = 1 and audit_status = 3
-	order by 
-		create_time desc
-	limit 5;
-  </select>
-  <select id="selectJmrProject" resultType="com.goafanti.residentIntegration.bo.ResidentIntegrationBo">
-  	select 
-  		a.id, a.name, c.residence_city as residenceCity,d.name as industry, owner_type as ownerType
-	from 
-		achievement a 
-	left join 
-		user b on a.owner_id = b.id
-	left join 
-		user_info c on b.id = c.uid
-	left join 
-		field_glossory d on a.field_a = d.id
-	where
-		jmrh_flag = 1 and data_category = 1 and audit_status = 3
-	order by 
-		a.create_time asc
-	limit 5;
-  </select>
   <select id="findBoutiqueListByPage" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.BoutiqueListBo">
   	select 
 		a.id ,

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

@@ -568,7 +568,7 @@
     where id = #{id,jdbcType=VARCHAR}
   </update>
 
-  	<select id="findProjectListByPage" resultType="com.goafanti.admin.bo.BusinessProjectBo">
+  	<select id="findProjectListByPage" resultType="com.goafanti.business.bo.BusinessProjectBo">
  		select b.id, b.create_id as createId, b.create_time as createTime, b.update_time as updateTime,  b.delete_sign deleteSign, b.bname,
  		  b.cid,  b.price,  b.offset,  b.activity_price as activityPrice,  b.activity_flag as activityFlag,  b.member_price as memberPrice, 
  		  b.introduce,  b.status,  b.country,  b.province,  b.city,  b.district, 
@@ -653,7 +653,7 @@
   
   </select>
   
-  <select id="findProjectSizeListByPage" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+  <select id="findProjectSizeListByPage" resultType="com.goafanti.business.bo.ProjectSizeBo">
   select 
   	 p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
     p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname

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

@@ -380,7 +380,7 @@
   	where id=#{ superId,jdbcType=VARCHAR} 
   	</select>
   	
-  	<select id="findVarietiesListByPage" resultType="com.goafanti.admin.bo.BusinessVarietiesBo">
+  	<select id="findVarietiesListByPage" resultType="com.goafanti.business.bo.BusinessVarietiesBo">
  		select b.id,b.create_id as createId ,b.create_time as createTime,b.update_time as updateTime,
   		b.delete_sign daleteSign,b.cid,b.cname,b.super_id superId ,b.layer,b.status,b2.cname as superName
   		from business_varieties b
@@ -423,13 +423,13 @@
 		
   </select>
   
-  <select id="getSuperList"  resultType="com.goafanti.admin.bo.BusinessVarietiesBo">
+  <select id="getSuperList"  resultType="com.goafanti.business.bo.BusinessVarietiesBo">
   		select b.id,b.create_id as createId ,b.create_time as createTime,b.update_time as updateTime,
   		b.delete_sign daleteSign,b.cid,b.cname,b.super_id superId ,b.layer,b.status
   		from business_varieties b
   		where b.delete_sign=0 and status=0
   </select>
-  <select id="editVarieties" parameterType="string" resultType="com.goafanti.admin.bo.BusinessVarietiesBo">
+  <select id="editVarieties" parameterType="string" resultType="com.goafanti.business.bo.BusinessVarietiesBo">
   		select b.id,b.create_id as createId ,b.create_time as createTime,b.update_time as updateTime,b.varieties_logo as varietiesLogo,
   		b.delete_sign as deleteSign,b.cid,b.cname,b.super_id superId ,b.layer,b.status,b2.cname superName,a.name as createName
   		from business_varieties b 
@@ -454,7 +454,7 @@
   		and b.cname= #{cname,jdbcType=VARCHAR}
   	</select>
   	
-  	<select id="selectSuperid" resultType="com.goafanti.admin.bo.BusinessVarietiesBo">
+  	<select id="selectSuperid" resultType="com.goafanti.business.bo.BusinessVarietiesBo">
   		select b.id,b.create_id as createId ,b.create_time as createTime,b.update_time as updateTime,
   		b.delete_sign as deleteSign,b.cid,b.cname,b.super_id superId ,b.layer,b.status
   		from business_varieties b 
@@ -488,7 +488,7 @@
   		where b.delete_sign=0
   		and b.id= #{superId,jdbcType=VARCHAR}
   	</select>
-  	<select id="getVarieties" resultType="com.goafanti.admin.bo.VarietiesBo">
+  	<select id="getVarieties" resultType="com.goafanti.business.bo.VarietiesBo">
   		select id, cname AS name, varieties_logo as varietiesLogo 
 	from business_varieties b
 	where b.delete_sign=0

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

@@ -1,132 +0,0 @@
-<?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>

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

@@ -20,7 +20,7 @@
 	</resultMap>
 
 
-	<resultMap id="memberGradeMap" type="com.goafanti.memberGrade.bo.MemberGrade">
+	<resultMap id="memberGradeMap" type="com.goafanti.member.bo.MemberGrade">
 		<id column="id" property="id" />
 		<result column="grade_name" property="gradeName" />
 		<result column="business" property="business" />
@@ -43,7 +43,7 @@
 	</delete>
 
 	<!-- 新增会员等级是否存在 -->
-	<select id="selectRank" parameterType="com.goafanti.memberGrade.bo.MemberGrade"
+	<select id="selectRank" parameterType="com.goafanti.member.bo.MemberGrade"
 		resultType="int">
 		SELECT COUNT(*) FROM member_grade WHERE
 		member_rank=#{memberRank}
@@ -51,7 +51,7 @@
 
 
 	<!-- 新增会员等级 -->
-	<insert id="addGradeName" parameterType="com.goafanti.memberGrade.bo.MemberGrade"
+	<insert id="addGradeName" parameterType="com.goafanti.member.bo.MemberGrade"
 		useGeneratedKeys="true" keyProperty="id">
 		INSERT INTO
 		member_grade(grade_name,member_rank) VALUES (#{gradeName},#{memberRank})
@@ -59,7 +59,7 @@
 
 
 	<!-- 为等级添加业务和费用 -->
-	<update id="addBusinessAndCost" parameterType="com.goafanti.memberGrade.bo.MemberGrade">
+	<update id="addBusinessAndCost" parameterType="com.goafanti.member.bo.MemberGrade">
 		UPDATE
 		member_grade SET business=#{business},cost=#{cost} WHERE id=#{id}
 	</update>

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

@@ -331,7 +331,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.admin.bo.ProjectSizeBo">
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.business.bo.ProjectSizeBo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
@@ -396,7 +396,7 @@
     where id = #{id,jdbcType=VARCHAR}
   </update>
  	
-  <select id="selectByPrimaryBusinessId" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+  <select id="selectByPrimaryBusinessId" resultType="com.goafanti.business.bo.ProjectSizeBo">
     
     select 
   	 p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
@@ -406,7 +406,7 @@
     where p.pid = #{pid,jdbcType=VARCHAR}
   </select>
   
-  <select id="selectByBusinessId" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+  <select id="selectByBusinessId" parameterType="java.lang.String" resultType="com.goafanti.business.bo.ProjectSizeBo">
     select 
     p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
     p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
@@ -415,7 +415,7 @@
     where p.id = #{id,jdbcType=VARCHAR}
   </select>	
   
-  <select id="getgetPnamecount" resultType="com.goafanti.admin.bo.ProjectSizeBo">
+  <select id="getgetPnamecount" resultType="com.goafanti.business.bo.ProjectSizeBo">
    select 
    p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice, 
    p.activity_flag as activityFlag, p.member_price as memberPrice, p.status

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

@@ -1,61 +0,0 @@
-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;
-    }
-}

+ 3 - 8
src/main/java/com/goafanti/dataGlossory/service/impl/DistrictGlossoryServiceImpl.java

@@ -1,4 +1,4 @@
-package com.goafanti.dataGlossory.service.impl;
+package com.goafanti.common.service;
 
 import java.util.List;
 
@@ -12,33 +12,28 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.model.DistrictGlossory;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 @Service
-public class DistrictGlossoryServiceImpl implements DistrictGlossoryService {
-	private static final Logger	logger	= LoggerFactory.getLogger(DistrictGlossoryServiceImpl.class);
+public class DistrictGlossoryService {
+	private static final Logger	logger	= LoggerFactory.getLogger(DistrictGlossoryService.class);
 	
 	@Autowired
 	private DistrictGlossoryMapper districtGlossoryMapper;
 	
-	@Override
 	public DistrictGlossory selectByPrimaryKey(Integer id) {
 		return districtGlossoryMapper.selectByPrimaryKey(id);
 	}
 	
-	@Override
 	@Cacheable(value = "DistrictGlossoryCache", key = "'DistrictGlossory:'+#pid")
 	public List<DistrictGlossory> list(Integer pid) {
 		LoggerUtils.debug(logger, "缓存地区列表:[%s]", pid);
 		return districtGlossoryMapper.findByPid(pid);
 	}
 
-	@Override
 	@CacheEvict(value = "DistrictGlossoryCache", key = "'DistrictGlossory:'+#pid")
 	public void clear(Integer pid) {
 		LoggerUtils.debug(logger, "清除地区列表缓存:[%s]", pid);
 	}
 
-	@Override
 	public String selectNameById(Integer id) {
 		return districtGlossoryMapper.selectNameById(id);
 	}

+ 3 - 7
src/main/java/com/goafanti/engagedFieldGlossory/service/impl/EngagedFieldGlossoryServiceImpl.java

@@ -1,4 +1,4 @@
-package com.goafanti.engagedFieldGlossory.service.impl;
+package com.goafanti.common.service;
 
 
 import org.slf4j.Logger;
@@ -11,23 +11,19 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.dao.EngagedFieldGlossoryMapper;
 import com.goafanti.common.model.EngagedFieldGlossory;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.engagedFieldGlossory.service.EngagedFieldGlossoryService;
 @Service
-public class EngagedFieldGlossoryServiceImpl implements EngagedFieldGlossoryService{
-	private static final Logger	logger	= LoggerFactory.getLogger(EngagedFieldGlossoryServiceImpl.class);
+public class EngagedFieldGlossoryService{
+	private static final Logger	logger	= LoggerFactory.getLogger(EngagedFieldGlossoryService.class);
 	
 	@Autowired
 	private EngagedFieldGlossoryMapper engagedFieldGlossoryMapper;
 	
-	@Override
 	@Cacheable(value = "EngagedFieldGlossoryCache", key = "'EngagedFieldGlossory:'+#id")
 	public EngagedFieldGlossory selectByPrimaryKey(Integer id) {
 		LoggerUtils.debug(logger, "缓存从事领域:[%s]", id);
 		return engagedFieldGlossoryMapper.selectByPrimaryKey(id);
 	}
-	
 
-	@Override
 	@CacheEvict(value = "EngagedFieldGlossoryCache", key = "'EngagedFieldGlossory:'+#id")
 	public void clear(Integer id) {
 		LoggerUtils.debug(logger, "清除从事领域缓存:[%s]", id);

+ 1 - 1
src/main/java/com/goafanti/common/task/ExpiredUserMemberTask.java

@@ -6,7 +6,7 @@ import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.memberGrade.service.MemberOrderService;
+import com.goafanti.member.service.MemberOrderService;
 
 @Component
 public class ExpiredUserMemberTask {

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.contract.controller;
 
 import java.util.Arrays;
 import java.util.Map;

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

@@ -34,7 +34,7 @@ import com.goafanti.techproject.service.TechProjectService;
 
 @RestController
 @RequestMapping(value = "/api/user/contract")
-public class ContractApiController extends CertifyApiController {
+public class UserContractApiController extends CertifyApiController {
 	@Resource
 	private ContractService			contractService;
 	@Resource

+ 417 - 417
src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java

@@ -1,417 +1,417 @@
-package com.goafanti.admin.controller;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.FieldError;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.admin.service.AdminService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.enums.CopyrightFields;
-import com.goafanti.common.enums.CopyrightStatus;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.CopyrightInfo;
-import com.goafanti.common.model.CopyrightLog;
-import com.goafanti.common.model.User;
-import com.goafanti.copyright.bo.CopyrightInfoDetail;
-import com.goafanti.copyright.bo.InputCopyright;
-import com.goafanti.copyright.service.CopyrightInfoService;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.easemob.EasemobUtils;
-import com.goafanti.easemob.enums.EasemonSysUsers;
-import com.goafanti.user.service.UserService;
-
-@RestController
-@RequestMapping(value = "/api/admin/copyright")
-public class AdminCopyrightApiController extends CertifyApiController {
-	@Resource
-	private CopyrightInfoService	copyrightInfoService;
-	@Resource
-	private UserService				userService;
-	@Resource
-	private AdminService			adminService;
-
-	@Autowired
-	EasemobUtils					easemobUtils;
-
-	@RequestMapping(value = "/circulation", method = RequestMethod.POST)
-	public Result circulation(@RequestParam(name = "ids[]", required = false) String[] ids, @Valid InputCopyright ic,
-			BindingResult bindingResult, String recordTimeFormattedDate) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		if (ids == null || ids.length < 1) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
-			return res;
-		}
-
-		if (null == ic.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转状态", "流转状态"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(ic.getPrincipal())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人", "负责人"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(recordTimeFormattedDate)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到记录流转时间", "记录流转时间"));
-			return res;
-		}
-
-		if (CopyrightStatus.DELIVERD.getCode() != ic.getStatus()
-				&& CopyrightStatus.CIRCULATION.getCode() != ic.getStatus()
-				&& CopyrightStatus.SETTLEMENT.getCode() != ic.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "仅派单、流转、结款可操作!"));
-			return res;
-		}
-
-		CopyrightLog cl = new CopyrightLog();
-		BeanUtils.copyProperties(ic, cl);
-
-		res.setData(copyrightInfoService.batchCirculation(ids, recordTimeFormattedDate, cl));
-		return res;
-	}
-
-	@RequestMapping(value = "/apply", method = RequestMethod.POST)
-	public Result newApply(@Valid InputCopyright inputInfo, BindingResult bindingResult) {
-		Result res = new Result();
-		if (handleBindingError(res, bindingResult)) {
-			return res;
-		}
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isBlank(inputInfo.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-		if (StringUtils.isBlank(inputInfo.getSalesman())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到营销员", "营销员"));
-			return res;
-		}
-		User curUser = userService.selectByPrimaryKey(inputInfo.getUid());
-		if (!checkCertify(res, curUser)) {
-			return res;
-		}
-		String salesman = inputInfo.getSalesman();
-		CopyrightInfo ci = new CopyrightInfo();
-		BeanUtils.copyProperties(inputInfo, ci);
-		ci.setUid(curUser.getId());
-		copyrightInfoService.saveCopyright(ci, salesman);
-		res.setData(ci);
-		return res;
-	}
-
-	@RequestMapping(value = "/modify", method = RequestMethod.POST)
-	public Result modify(String id, @Valid InputCopyright inputInfo, BindingResult bindingResult) {
-		Result res = new Result();
-		if (handleBindingError(res, bindingResult)) {
-			return res;
-		}
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到软著", "软著申请id"));
-			return res;
-		}
-		CopyrightInfo oci = copyrightInfoService.selectByPrimaryKey(id);
-		if (oci == null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到软著", "软著申请"));
-			return res;
-		}
-
-		if (CopyrightStatus.CALLBACK.getCode() == oci.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.RECORD_CALLBACK, "当前记录已退单,无法修改!"));
-			return res;
-		}
-
-		if (CopyrightStatus.SETTLEMENT.getCode() == oci.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.RECORD_SETTLEMENT, "当前记录已结款,无法修改!"));
-			return res;
-		}
-
-		CopyrightInfo ci = new CopyrightInfo();
-		CopyrightLog cl = new CopyrightLog();
-		BeanUtils.copyProperties(oci, ci);
-		BeanUtils.copyProperties(inputInfo, ci);
-		BeanUtils.copyProperties(inputInfo, cl);
-		ci.setId(oci.getId());
-		ci.setUid(oci.getUid());
-		if (CopyrightStatus.CIRCULATION.getCode() == ci.getStatus()) {
-			ci.setStatus(CopyrightStatus.DELIVERD.getCode());
-		}
-
-		cl.setCid(oci.getId());
-		cl.setOperator(TokenManager.getAdminId());
-		copyrightInfoService.updateByPrimaryKeySelective(ci, cl);
-		res.setData(1);
-		if (inputInfo.getStatus() != null && !inputInfo.getStatus().equals(oci.getStatus())
-				&& inputInfo.getStatus() <= CopyrightStatus.CALLBACK.getCode()
-				&& inputInfo.getStatus() >= CopyrightStatus.SUBMIT.getCode()) {
-			easemobUtils.sendMessage(EasemonSysUsers.ADMIN_DDDT.getUsername(),
-					userService.selectNumberByPrimaryKey(oci.getUid()), "您的软著申请订单:#%s%s,状态变更为%s", oci.getSerialNumber(),
-					oci.getCopyrightName() == null ? "" : oci.getCopyrightName(),
-					CopyrightStatus.getStatus(inputInfo.getStatus()).getDesc());
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/upload", method = RequestMethod.POST)
-	public Result upload(String id, String sign, HttpServletRequest req) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isEmpty(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
-			return res;
-		}
-		CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
-		if (ci == null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
-			return res;
-		}
-
-		if (CopyrightStatus.CALLBACK.getCode() == ci.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.RECORD_CALLBACK, "当前记录已退单,无法修改!"));
-			return res;
-		}
-
-		if (CopyrightStatus.SETTLEMENT.getCode() == ci.getStatus()) {
-			res.getError().add(buildError(ErrorConstants.RECORD_SETTLEMENT, "当前记录已结款,无法修改!"));
-			return res;
-		}
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.COPYRIGHT_APPLY || attachmentType == AttachmentType.COPYRIGHT_AUTH) {
-			String filePath = handleFile(res, true, req, attachmentType.getCode(), ci.getUid(), ci.getId());
-			if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
-				ci.setApplicationUrl(filePath);
-			} else if (attachmentType == AttachmentType.COPYRIGHT_AUTH) {
-				ci.setCertificateUrl(filePath);
-			}
-			copyrightInfoService.updateByPrimaryKey(ci);
-			res.setData(filePath);
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/delete", method = RequestMethod.POST)
-	public Result delete(@RequestParam(name = "id[]", required = false) String[] ids) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (ids == null || ids.length < 1) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
-		} else {
-			res.setData(copyrightInfoService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	public Result list(String contractId, Integer province, String unitName, String uid, String copyrightName,
-			String status, String pageNo, String pageSize,
-			@RequestParam(name = "createTime[]", required = false) String[] createTime,
-			@RequestParam(name = "acceptTime[]", required = false) String[] acceptTime,
-			@RequestParam(name = "authTime[]", required = false) String[] authTime) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		res.setData(copyrightInfoService.listMyCopyrightInfo(contractId, province, unitName, copyrightName,
-				CopyrightStatus.getStatus(status), createTime, acceptTime, authTime, getPageNo(pageNo),
-				getPageSize(pageSize), uid));
-		return res;
-	}
-
-	@RequestMapping(value = "/detail", method = RequestMethod.GET)
-	public Result detail(String id) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
-		} else {
-			res.setData(copyrightInfoService.findByPrimaryKey(id));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/logs", method = RequestMethod.GET)
-	public Result logs(String id) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "软著申请id"));
-		} else {
-			res.setData(copyrightInfoService.findLogsByPrimaryKey(id));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/download", method = RequestMethod.GET)
-	public Result download(String id, String sign, HttpServletResponse response) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isEmpty(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
-			return res;
-		}
-		CopyrightInfoDetail ci = copyrightInfoService.findByPrimaryKey(id);
-		if (ci == null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
-			return res;
-		}
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.COPYRIGHT_APPLY || attachmentType == AttachmentType.COPYRIGHT_AUTH) {
-			if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
-				downloadFile(response, ci.getApplicationUrlDownloadFileName(), ci.getApplicationUrl());
-			} else if (attachmentType == AttachmentType.COPYRIGHT_AUTH) {
-				downloadFile(response, ci.getCertificateUrlDownloadFileName(), ci.getCertificateUrl());
-			}
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
-		return res;
-	}
-
-	@RequestMapping(value = "/status", method = RequestMethod.GET)
-	public Result status() {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		res.setData(disposeStatus());
-		return res;
-	}
-
-	/**
-	 * 软著咨询师下拉
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/getConsultant", method = RequestMethod.GET)
-	public Result getConsultant() {
-		Result res = new Result();
-		List<Admin> list = adminService.selectCopyrightConsultant();
-		Map<String, String> map = new TreeMap<String, String>();
-		for (Admin o : list) {
-			map.put(o.getId(), o.getName());
-		}
-		res.setData(map);
-		return res;
-	}
-
-	/**
-	 * 软著负责人下拉
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/getPrincipal", method = RequestMethod.GET)
-	public Result getPrincipal() {
-		Result res = new Result();
-		List<Admin> list = adminService.selectCopyrightPrincipal();
-		Map<String, String> map = new TreeMap<String, String>();
-		for (Admin o : list) {
-			map.put(o.getId(), o.getName() + " " + (null == o.getPosition() ? "" : o.getPosition()));
-		}
-		res.setData(map);
-		return res;
-	}
-
-	private boolean handleBindingError(Result res, BindingResult bindingResult) {
-		if (bindingResult.hasErrors()) {
-			for (FieldError fe : bindingResult.getFieldErrors()) {
-				Class<?> clazz = bindingResult.getFieldType(fe.getField());
-				if (clazz != null && "java.util.Date".equals(clazz.getName())) {
-					res.getError()
-							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
-									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
-											.field(fe.getField()));
-				} else {
-					res.getError()
-							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
-									.field(fe.getField()));
-				}
-			}
-			return true;
-		}
-		return false;
-	}
-
-	private Map<String, String> disposeStatus() {
-		Map<String, String> status = new TreeMap<String, String>();
-		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
-			for (CopyrightStatus p : CopyrightStatus.values()) {
-				status.put(p.getCode().toString(), p.getDesc());
-				status.remove(CopyrightStatus.OTHER.getCode().toString());
-			}
-		} else {
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CREATE.getCode())) {
-				status.put(CopyrightStatus.CREATE.getCode().toString(), CopyrightStatus.CREATE.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SIGN.getCode())) {
-				status.put(CopyrightStatus.SIGN.getCode().toString(), CopyrightStatus.SIGN.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.DELIVERD.getCode())) {
-				status.put(CopyrightStatus.DELIVERD.getCode().toString(), CopyrightStatus.DELIVERD.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SUBMIT.getCode())) {
-				status.put(CopyrightStatus.SUBMIT.getCode().toString(), CopyrightStatus.SUBMIT.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CIRCULATION.getCode())) {
-				status.put(CopyrightStatus.CIRCULATION.getCode().toString(), CopyrightStatus.CIRCULATION.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.ACCEPT.getCode())) {
-				status.put(CopyrightStatus.ACCEPT.getCode().toString(), CopyrightStatus.ACCEPT.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.AMEND.getCode())) {
-				status.put(CopyrightStatus.AMEND.getCode().toString(), CopyrightStatus.AMEND.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.REJECT.getCode())) {
-				status.put(CopyrightStatus.REJECT.getCode().toString(), CopyrightStatus.REJECT.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.AUTHORIZED.getCode())) {
-				status.put(CopyrightStatus.AUTHORIZED.getCode().toString(), CopyrightStatus.AUTHORIZED.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SETTLEMENT.getCode())) {
-				status.put(CopyrightStatus.SETTLEMENT.getCode().toString(), CopyrightStatus.SETTLEMENT.getDesc());
-			}
-			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CALLBACK.getCode())) {
-				status.put(CopyrightStatus.CALLBACK.getCode().toString(), CopyrightStatus.CALLBACK.getDesc());
-			}
-		}
-		return status;
-	}
-}
+package com.goafanti.copyright.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.admin.service.AdminService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.CopyrightFields;
+import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.common.model.User;
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.bo.InputCopyright;
+import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.easemob.EasemobUtils;
+import com.goafanti.easemob.enums.EasemonSysUsers;
+import com.goafanti.user.service.UserService;
+
+@RestController
+@RequestMapping(value = "/api/admin/copyright")
+public class AdminCopyrightApiController extends CertifyApiController {
+	@Resource
+	private CopyrightInfoService	copyrightInfoService;
+	@Resource
+	private UserService				userService;
+	@Resource
+	private AdminService			adminService;
+
+	@Autowired
+	EasemobUtils					easemobUtils;
+
+	@RequestMapping(value = "/circulation", method = RequestMethod.POST)
+	public Result circulation(@RequestParam(name = "ids[]", required = false) String[] ids, @Valid InputCopyright ic,
+			BindingResult bindingResult, String recordTimeFormattedDate) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+			return res;
+		}
+
+		if (null == ic.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转状态", "流转状态"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ic.getPrincipal())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人", "负责人"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(recordTimeFormattedDate)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到记录流转时间", "记录流转时间"));
+			return res;
+		}
+
+		if (CopyrightStatus.DELIVERD.getCode() != ic.getStatus()
+				&& CopyrightStatus.CIRCULATION.getCode() != ic.getStatus()
+				&& CopyrightStatus.SETTLEMENT.getCode() != ic.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "仅派单、流转、结款可操作!"));
+			return res;
+		}
+
+		CopyrightLog cl = new CopyrightLog();
+		BeanUtils.copyProperties(ic, cl);
+
+		res.setData(copyrightInfoService.batchCirculation(ids, recordTimeFormattedDate, cl));
+		return res;
+	}
+
+	@RequestMapping(value = "/apply", method = RequestMethod.POST)
+	public Result newApply(@Valid InputCopyright inputInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(inputInfo.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+		if (StringUtils.isBlank(inputInfo.getSalesman())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到营销员", "营销员"));
+			return res;
+		}
+		User curUser = userService.selectByPrimaryKey(inputInfo.getUid());
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		String salesman = inputInfo.getSalesman();
+		CopyrightInfo ci = new CopyrightInfo();
+		BeanUtils.copyProperties(inputInfo, ci);
+		ci.setUid(curUser.getId());
+		copyrightInfoService.saveCopyright(ci, salesman);
+		res.setData(ci);
+		return res;
+	}
+
+	@RequestMapping(value = "/modify", method = RequestMethod.POST)
+	public Result modify(String id, @Valid InputCopyright inputInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到软著", "软著申请id"));
+			return res;
+		}
+		CopyrightInfo oci = copyrightInfoService.selectByPrimaryKey(id);
+		if (oci == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到软著", "软著申请"));
+			return res;
+		}
+
+		if (CopyrightStatus.CALLBACK.getCode() == oci.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.RECORD_CALLBACK, "当前记录已退单,无法修改!"));
+			return res;
+		}
+
+		if (CopyrightStatus.SETTLEMENT.getCode() == oci.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.RECORD_SETTLEMENT, "当前记录已结款,无法修改!"));
+			return res;
+		}
+
+		CopyrightInfo ci = new CopyrightInfo();
+		CopyrightLog cl = new CopyrightLog();
+		BeanUtils.copyProperties(oci, ci);
+		BeanUtils.copyProperties(inputInfo, ci);
+		BeanUtils.copyProperties(inputInfo, cl);
+		ci.setId(oci.getId());
+		ci.setUid(oci.getUid());
+		if (CopyrightStatus.CIRCULATION.getCode() == ci.getStatus()) {
+			ci.setStatus(CopyrightStatus.DELIVERD.getCode());
+		}
+
+		cl.setCid(oci.getId());
+		cl.setOperator(TokenManager.getAdminId());
+		copyrightInfoService.updateByPrimaryKeySelective(ci, cl);
+		res.setData(1);
+		if (inputInfo.getStatus() != null && !inputInfo.getStatus().equals(oci.getStatus())
+				&& inputInfo.getStatus() <= CopyrightStatus.CALLBACK.getCode()
+				&& inputInfo.getStatus() >= CopyrightStatus.SUBMIT.getCode()) {
+			easemobUtils.sendMessage(EasemonSysUsers.ADMIN_DDDT.getUsername(),
+					userService.selectNumberByPrimaryKey(oci.getUid()), "您的软著申请订单:#%s%s,状态变更为%s", oci.getSerialNumber(),
+					oci.getCopyrightName() == null ? "" : oci.getCopyrightName(),
+					CopyrightStatus.getStatus(inputInfo.getStatus()).getDesc());
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result upload(String id, String sign, HttpServletRequest req) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
+			return res;
+		}
+		CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
+		if (ci == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
+			return res;
+		}
+
+		if (CopyrightStatus.CALLBACK.getCode() == ci.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.RECORD_CALLBACK, "当前记录已退单,无法修改!"));
+			return res;
+		}
+
+		if (CopyrightStatus.SETTLEMENT.getCode() == ci.getStatus()) {
+			res.getError().add(buildError(ErrorConstants.RECORD_SETTLEMENT, "当前记录已结款,无法修改!"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.COPYRIGHT_APPLY || attachmentType == AttachmentType.COPYRIGHT_AUTH) {
+			String filePath = handleFile(res, true, req, attachmentType.getCode(), ci.getUid(), ci.getId());
+			if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
+				ci.setApplicationUrl(filePath);
+			} else if (attachmentType == AttachmentType.COPYRIGHT_AUTH) {
+				ci.setCertificateUrl(filePath);
+			}
+			copyrightInfoService.updateByPrimaryKey(ci);
+			res.setData(filePath);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/delete", method = RequestMethod.POST)
+	public Result delete(@RequestParam(name = "id[]", required = false) String[] ids) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+		} else {
+			res.setData(copyrightInfoService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String contractId, Integer province, String unitName, String uid, String copyrightName,
+			String status, String pageNo, String pageSize,
+			@RequestParam(name = "createTime[]", required = false) String[] createTime,
+			@RequestParam(name = "acceptTime[]", required = false) String[] acceptTime,
+			@RequestParam(name = "authTime[]", required = false) String[] authTime) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		res.setData(copyrightInfoService.listMyCopyrightInfo(contractId, province, unitName, copyrightName,
+				CopyrightStatus.getStatus(status), createTime, acceptTime, authTime, getPageNo(pageNo),
+				getPageSize(pageSize), uid));
+		return res;
+	}
+
+	@RequestMapping(value = "/detail", method = RequestMethod.GET)
+	public Result detail(String id) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
+		} else {
+			res.setData(copyrightInfoService.findByPrimaryKey(id));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/logs", method = RequestMethod.GET)
+	public Result logs(String id) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "软著申请id"));
+		} else {
+			res.setData(copyrightInfoService.findLogsByPrimaryKey(id));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(String id, String sign, HttpServletResponse response) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
+			return res;
+		}
+		CopyrightInfoDetail ci = copyrightInfoService.findByPrimaryKey(id);
+		if (ci == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著id"));
+			return res;
+		}
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.COPYRIGHT_APPLY || attachmentType == AttachmentType.COPYRIGHT_AUTH) {
+			if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
+				downloadFile(response, ci.getApplicationUrlDownloadFileName(), ci.getApplicationUrl());
+			} else if (attachmentType == AttachmentType.COPYRIGHT_AUTH) {
+				downloadFile(response, ci.getCertificateUrlDownloadFileName(), ci.getCertificateUrl());
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/status", method = RequestMethod.GET)
+	public Result status() {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		res.setData(disposeStatus());
+		return res;
+	}
+
+	/**
+	 * 软著咨询师下拉
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/getConsultant", method = RequestMethod.GET)
+	public Result getConsultant() {
+		Result res = new Result();
+		List<Admin> list = adminService.selectCopyrightConsultant();
+		Map<String, String> map = new TreeMap<String, String>();
+		for (Admin o : list) {
+			map.put(o.getId(), o.getName());
+		}
+		res.setData(map);
+		return res;
+	}
+
+	/**
+	 * 软著负责人下拉
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/getPrincipal", method = RequestMethod.GET)
+	public Result getPrincipal() {
+		Result res = new Result();
+		List<Admin> list = adminService.selectCopyrightPrincipal();
+		Map<String, String> map = new TreeMap<String, String>();
+		for (Admin o : list) {
+			map.put(o.getId(), o.getName() + " " + (null == o.getPosition() ? "" : o.getPosition()));
+		}
+		res.setData(map);
+		return res;
+	}
+
+	private boolean handleBindingError(Result res, BindingResult bindingResult) {
+		if (bindingResult.hasErrors()) {
+			for (FieldError fe : bindingResult.getFieldErrors()) {
+				Class<?> clazz = bindingResult.getFieldType(fe.getField());
+				if (clazz != null && "java.util.Date".equals(clazz.getName())) {
+					res.getError()
+							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
+									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
+											.field(fe.getField()));
+				} else {
+					res.getError()
+							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
+									.field(fe.getField()));
+				}
+			}
+			return true;
+		}
+		return false;
+	}
+
+	private Map<String, String> disposeStatus() {
+		Map<String, String> status = new TreeMap<String, String>();
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			for (CopyrightStatus p : CopyrightStatus.values()) {
+				status.put(p.getCode().toString(), p.getDesc());
+				status.remove(CopyrightStatus.OTHER.getCode().toString());
+			}
+		} else {
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CREATE.getCode())) {
+				status.put(CopyrightStatus.CREATE.getCode().toString(), CopyrightStatus.CREATE.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SIGN.getCode())) {
+				status.put(CopyrightStatus.SIGN.getCode().toString(), CopyrightStatus.SIGN.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.DELIVERD.getCode())) {
+				status.put(CopyrightStatus.DELIVERD.getCode().toString(), CopyrightStatus.DELIVERD.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SUBMIT.getCode())) {
+				status.put(CopyrightStatus.SUBMIT.getCode().toString(), CopyrightStatus.SUBMIT.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CIRCULATION.getCode())) {
+				status.put(CopyrightStatus.CIRCULATION.getCode().toString(), CopyrightStatus.CIRCULATION.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.ACCEPT.getCode())) {
+				status.put(CopyrightStatus.ACCEPT.getCode().toString(), CopyrightStatus.ACCEPT.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.AMEND.getCode())) {
+				status.put(CopyrightStatus.AMEND.getCode().toString(), CopyrightStatus.AMEND.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.REJECT.getCode())) {
+				status.put(CopyrightStatus.REJECT.getCode().toString(), CopyrightStatus.REJECT.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.AUTHORIZED.getCode())) {
+				status.put(CopyrightStatus.AUTHORIZED.getCode().toString(), CopyrightStatus.AUTHORIZED.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.SETTLEMENT.getCode())) {
+				status.put(CopyrightStatus.SETTLEMENT.getCode().toString(), CopyrightStatus.SETTLEMENT.getDesc());
+			}
+			if (TokenManager.hasPermission("CopyrightStatus" + CopyrightStatus.CALLBACK.getCode())) {
+				status.put(CopyrightStatus.CALLBACK.getCode().toString(), CopyrightStatus.CALLBACK.getDesc());
+			}
+		}
+		return status;
+	}
+}

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

@@ -36,7 +36,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
 @RequestMapping(value = "/api/user/copyright")
-public class CopyrightApiController extends CertifyApiController {
+public class UserCopyrightApiController extends CertifyApiController {
 	@Resource
 	private CopyrightInfoService copyrightInfoService;
 

+ 193 - 5
src/main/java/com/goafanti/customer/controller/CustomerApiController.java

@@ -39,23 +39,22 @@ import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.ExcelUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.BusinessListBo;
+import com.goafanti.customer.bo.BussinessFollowBo;
 import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
 import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.bo.UserDetailBo;
-import com.goafanti.customer.service.BusinessService;
 import com.goafanti.customer.service.CustomerService;
 
 @RestController
 @RequestMapping("api/admin/customer")
-public class CustomerApiController extends BaseApiController{
+public class AdminCustomerApiController extends BaseApiController{
 	@Resource
 	private CustomerService customerService;
 	@Resource
-	private BusinessService businessService;
-	@Resource
 	private AftFileService aftFileService;
 	@Value(value = "${upload.private.path}")
 	private String	uploadPrivatePath	= null;
@@ -228,7 +227,7 @@ public class CustomerApiController extends BaseApiController{
 		fbb.setFollowTime(format.format(new Date()));
 		fbb.setIdentifyName(user.getIdentifyName());
 		fbb.setUid(uid);
-		fbb.setUserBusinessList(businessService.findBusinessByUAid(uid, TokenManager.getAdminId()));
+		fbb.setUserBusinessList(customerService.findBusinessByUAid(uid, TokenManager.getAdminId()));
 		res.setData(fbb);
 		return res;
 	}
@@ -607,4 +606,193 @@ public class CustomerApiController extends BaseApiController{
 		customerService.updateByOperatorType(uid, AFTConstants.USER_TRANSFER_TO_OTHER, aid);
 		return res;
 	}
+	
+	/** 查询我的业务列表 **/
+	@RequestMapping(value = "/listBusiness", method = RequestMethod.POST)
+	public Result listBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listBusiness(blo, pageNo, pageSize));
+		return res;
+	}
+	
+	/** 查询所有的业务列表 **/
+	@RequestMapping(value = "/listAllBusiness", method = RequestMethod.POST)
+	public Result listAllBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listAllBusiness(blo, pageNo, pageSize));
+		return res;
+	}
+	
+	/** 查询业务字典 **/
+	@RequestMapping(value = "/findBusinessGlossory",method = RequestMethod.GET)
+	public Result findBusinessGlossory(){
+		Result res = new Result();
+		res.setData(customerService.findBusinessGlossory());
+		return res;
+	}
+
+	/** 新增客户意向 **/
+	@RequestMapping(value = "/addBusinessAndFollow", method = RequestMethod.POST)
+	public Result addBusinessAndFollow(BussinessFollowBo bfb){
+		Result res = new Result();
+		if(StringUtils.isBlank(bfb.getBusinessGlossoryId()) || StringUtils.isBlank(bfb.getUid())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}		
+		if(customerService.judgeBusiness(bfb.getUid(), Integer.parseInt(bfb.getBusinessGlossoryId()))>0){
+			res.getError().add(new Error("该项业务已经被跟进"));
+			return res;
+		}
+		try {
+			customerService.addBusinessAndFollow(bfb);
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		return res;
+	}
+	
+	/** 进入新增意向服务 **/
+	@RequestMapping(value = "/toAddBusinessAndFollow", method = RequestMethod.GET)
+	public Result toAddBusinessAndFollow(){
+		Result res = new Result();
+		BussinessFollowBo bo = new BussinessFollowBo();
+		bo.setAdminName(TokenManager.getAdminToken().getName());
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		bo.setCreateTime(format.format(new Date()));
+		bo.setFollowTime(bo.getCreateTime());
+		res.setData(bo);
+		return res;
+	}
+	
+	/** 进入修改业务意向 **/
+	@RequestMapping(value = "/toUpdateBusiness", method = RequestMethod.GET)
+	public Result toUpdateBusiness(String businessId){
+		Result res = new Result();
+		res.setData(customerService.findBusinessDetail(businessId));
+		return res;
+	}
+	
+	/** 修改业务意向 **/
+	@RequestMapping(value = "/updateBusiness", method = RequestMethod.POST)
+	public Result updateBusiness(BussinessFollowBo bfb){
+		Result res = new Result();
+		customerService.updateBusiness(bfb);
+		return res;
+	}
+	
+	/** 进入跟进单个客户意向 **/
+	@RequestMapping(value = "/toAddFollowOneBusiness", method = RequestMethod.GET)
+	public Result toAddFollowOneBusiness(String businessId){
+		Result res = new Result();
+		BussinessFollowBo bo = customerService.findBusinessDetail(businessId);
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		bo.setFollowTime(format.format(new Date()));
+		res.setData(bo);
+		return res;
+	}
+	
+	/** 跟进单个客户意向 **/
+	@RequestMapping(value = "/addFollowOneBusiness", method = RequestMethod.POST)
+	public Result addFollowOneBusiness(BussinessFollowBo bfb){
+		Result res = new Result();
+		if(StringUtils.isBlank(bfb.getBusinessId()) ||
+				StringUtils.isBlank(bfb.getUid()) || StringUtils.isBlank(bfb.getOcbId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+			return res;
+		}
+		try {
+			customerService.addFollowOneBusiness(bfb);
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		return res;
+	}
+	
+	/** 进入修改某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/toUpdateFollowOneBusiness", method = RequestMethod.GET)
+	public Result toUpdateFollowOneBusiness(String ufbId){
+		Result res = new Result();
+		if(StringUtils.isBlank(ufbId)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		res.setData(customerService.findFollowOneBusiness(ufbId));
+		return res;
+	}
+	
+	/** 修改某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/updateFollowOneBusiness", method = RequestMethod.POST)
+	public Result updateFollowOneBusiness(BussinessFollowBo bfb){
+		Result res = new Result();
+		if(StringUtils.isBlank(bfb.getFollowId()) || StringUtils.isBlank(bfb.getUfbId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		customerService.updateFollowOneBusiness(bfb);
+		return res;
+	}
+	
+	/** 删除某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/deleteFollowOneBusiness", method = RequestMethod.GET)
+	public Result deleteFollowOneBusiness(String ufbId){
+		Result res = new Result();
+		if(StringUtils.isBlank(ufbId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		customerService.deleteFollowOneBusiness(ufbId);
+		return res;
+	}
+	
+	/** 添加单个联系人 **/
+	@RequestMapping(value = "/addOneContact", method = RequestMethod.POST)
+	public Result addOneContact(OrganizationContactBook ocb){
+		Result res = new Result();
+		if(StringUtils.isBlank(ocb.getUid())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		if(StringUtils.isBlank(ocb.getName()) || StringUtils.isBlank(ocb.getMobile())){
+			res.getError().add(buildError("联系人号码和联系人姓名不能为空"));
+			return res;
+		}
+		customerService.addOneContact(ocb);
+		return res;
+	}
+	
+	/** 删除单个联系人 **/
+	@RequestMapping(value = "/deleteOneContact", method = RequestMethod.GET)
+	public Result deleteOneContact(String ocbId){
+		Result res = new Result();
+		if(StringUtils.isBlank(ocbId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		customerService.deleteOneContact(ocbId);
+		return res;
+	}
+	
+	/** 删除 业务 **/
+	@RequestMapping(value = "/deleteBusiness", method =RequestMethod.GET)
+	public Result deleteBusiness(String businessId){
+		Result res = new Result();
+		if(StringUtils.isBlank(businessId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		customerService.deleteBusiness(businessId);
+		return res;
+	}
+	
+	/** 停止业务 **/
+	@RequestMapping(value = "/stopBusiness", method = RequestMethod.GET)
+	public Result stopBusiness(String businessId){
+		Result res = new Result();
+		if(StringUtils.isBlank(businessId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		customerService.updateBusinessToStop(businessId);
+		return res;
+	}
 }

+ 0 - 220
src/main/java/com/goafanti/customer/controller/BusinessApiController.java

@@ -1,220 +0,0 @@
-package com.goafanti.customer.controller;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.annotation.Resource;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.common.bo.Error;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseController;
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.BussinessFollowBo;
-import com.goafanti.customer.service.BusinessService;
-
-@RestController
-@RequestMapping("api/admin/customer")
-public class BusinessApiController extends BaseController{
-	@Resource
-	private BusinessService businessService;
-	
-	/** 查询我的业务列表 **/
-	@RequestMapping(value = "/listBusiness", method = RequestMethod.POST)
-	public Result listBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
-		Result res = new Result();
-		res.setData(businessService.listBusiness(blo, pageNo, pageSize));
-		return res;
-	}
-	
-	/** 查询所有的业务列表 **/
-	@RequestMapping(value = "/listAllBusiness", method = RequestMethod.POST)
-	public Result listAllBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
-		Result res = new Result();
-		res.setData(businessService.listAllBusiness(blo, pageNo, pageSize));
-		return res;
-	}
-	
-	/** 查询业务字典 **/
-	@RequestMapping(value = "/findBusinessGlossory",method = RequestMethod.GET)
-	public Result findBusinessGlossory(){
-		Result res = new Result();
-		res.setData(businessService.findBusinessGlossory());
-		return res;
-	}
-
-	/** 新增客户意向 **/
-	@RequestMapping(value = "/addBusinessAndFollow", method = RequestMethod.POST)
-	public Result addBusinessAndFollow(BussinessFollowBo bfb){
-		Result res = new Result();
-		if(StringUtils.isBlank(bfb.getBusinessGlossoryId()) || StringUtils.isBlank(bfb.getUid())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}		
-		if(businessService.judgeBusiness(bfb.getUid(), Integer.parseInt(bfb.getBusinessGlossoryId()))>0){
-			res.getError().add(new Error("该项业务已经被跟进"));
-			return res;
-		}
-		try {
-			businessService.addBusinessAndFollow(bfb);
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		return res;
-	}
-	
-	/** 进入新增意向服务 **/
-	@RequestMapping(value = "/toAddBusinessAndFollow", method = RequestMethod.GET)
-	public Result toAddBusinessAndFollow(){
-		Result res = new Result();
-		BussinessFollowBo bo = new BussinessFollowBo();
-		bo.setAdminName(TokenManager.getAdminToken().getName());
-		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
-		bo.setCreateTime(format.format(new Date()));
-		bo.setFollowTime(bo.getCreateTime());
-		res.setData(bo);
-		return res;
-	}
-	
-	/** 进入修改业务意向 **/
-	@RequestMapping(value = "/toUpdateBusiness", method = RequestMethod.GET)
-	public Result toUpdateBusiness(String businessId){
-		Result res = new Result();
-		res.setData(businessService.findBusinessDetail(businessId));
-		return res;
-	}
-	
-	/** 修改业务意向 **/
-	@RequestMapping(value = "/updateBusiness", method = RequestMethod.POST)
-	public Result updateBusiness(BussinessFollowBo bfb){
-		Result res = new Result();
-		businessService.updateBusiness(bfb);
-		return res;
-	}
-	
-	/** 进入跟进单个客户意向 **/
-	@RequestMapping(value = "/toAddFollowOneBusiness", method = RequestMethod.GET)
-	public Result toAddFollowOneBusiness(String businessId){
-		Result res = new Result();
-		BussinessFollowBo bo = businessService.findBusinessDetail(businessId);
-		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
-		bo.setFollowTime(format.format(new Date()));
-		res.setData(bo);
-		return res;
-	}
-	
-	/** 跟进单个客户意向 **/
-	@RequestMapping(value = "/addFollowOneBusiness", method = RequestMethod.POST)
-	public Result addFollowOneBusiness(BussinessFollowBo bfb){
-		Result res = new Result();
-		if(StringUtils.isBlank(bfb.getBusinessId()) ||
-				StringUtils.isBlank(bfb.getUid()) || StringUtils.isBlank(bfb.getOcbId())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
-			return res;
-		}
-		try {
-			businessService.addFollowOneBusiness(bfb);
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		return res;
-	}
-	
-	/** 进入修改某个客户一个业务的当次拜访 **/
-	@RequestMapping(value = "/toUpdateFollowOneBusiness", method = RequestMethod.GET)
-	public Result toUpdateFollowOneBusiness(String ufbId){
-		Result res = new Result();
-		if(StringUtils.isBlank(ufbId)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		res.setData(businessService.findFollowOneBusiness(ufbId));
-		return res;
-	}
-	
-	/** 修改某个客户一个业务的当次拜访 **/
-	@RequestMapping(value = "/updateFollowOneBusiness", method = RequestMethod.POST)
-	public Result updateFollowOneBusiness(BussinessFollowBo bfb){
-		Result res = new Result();
-		if(StringUtils.isBlank(bfb.getFollowId()) || StringUtils.isBlank(bfb.getUfbId())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		businessService.updateFollowOneBusiness(bfb);
-		return res;
-	}
-	
-	/** 删除某个客户一个业务的当次拜访 **/
-	@RequestMapping(value = "/deleteFollowOneBusiness", method = RequestMethod.GET)
-	public Result deleteFollowOneBusiness(String ufbId){
-		Result res = new Result();
-		if(StringUtils.isBlank(ufbId)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		businessService.deleteFollowOneBusiness(ufbId);
-		return res;
-	}
-	
-	/** 添加单个联系人 **/
-	@RequestMapping(value = "/addOneContact", method = RequestMethod.POST)
-	public Result addOneContact(OrganizationContactBook ocb){
-		Result res = new Result();
-		if(StringUtils.isBlank(ocb.getUid())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		if(StringUtils.isBlank(ocb.getName()) || StringUtils.isBlank(ocb.getMobile())){
-			res.getError().add(buildError("联系人号码和联系人姓名不能为空"));
-			return res;
-		}
-		businessService.addOneContact(ocb);
-		return res;
-	}
-	
-	/** 删除单个联系人 **/
-	@RequestMapping(value = "/deleteOneContact", method = RequestMethod.GET)
-	public Result deleteOneContact(String ocbId){
-		Result res = new Result();
-		if(StringUtils.isBlank(ocbId)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		businessService.delete(ocbId);
-		return res;
-	}
-	
-	/** 删除 业务 **/
-	@RequestMapping(value = "/deleteBusiness", method =RequestMethod.GET)
-	public Result deleteBusiness(String businessId){
-		Result res = new Result();
-		if(StringUtils.isBlank(businessId)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		businessService.deleteBusiness(businessId);
-		return res;
-	}
-	
-	/** 停止业务 **/
-	@RequestMapping(value = "/stopBusiness", method = RequestMethod.GET)
-	public Result stopBusiness(String businessId){
-		Result res = new Result();
-		if(StringUtils.isBlank(businessId)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
-			return res;
-		}
-		businessService.updateBusinessToStop(businessId);
-		return res;
-	}
-	
-}

+ 0 - 124
src/main/java/com/goafanti/customer/service/BusinessService.java

@@ -1,124 +0,0 @@
-package com.goafanti.customer.service;
-
-import java.text.ParseException;
-import java.util.List;
-
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.model.UserBusiness;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.BussinessFollowBo;
-
-public interface BusinessService {
-	/**
-	 * 查询我的业务列表
-	 * @param blo
-	 * @return
-	 */
-	Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize);
-
-	/**
-	 * 查询所有的业务列表
-	 * @param bfb
-	 * @return
-	 */
-	Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize);
-	
-	/**
-	 *  意向字典
-	 * @return
-	 */
-	List<BusinessListBo> findBusinessGlossory();
-	
-	/**
-	 * 
-	 * @param uid 客户ID
-	 * @param businessGlossoryId 业务意向字典ID 
-	 * @return
-	 */
-	int judgeBusiness(String uid,Integer businessGlossoryId);
-
-	/**
-	 * 添加意向服务和跟进记录
-	 * @param bfb
-	 */
-	void addBusinessAndFollow(BussinessFollowBo bfb)  throws ParseException ;
-	
-	/**
-	 * 查询业务列表
-	 * @param uid 客户ID
-	 * @param aid 营销员ID
-	 * @return
-	 */
-	List<UserBusiness> findBusinessByUAid(String uid,String aid);
-
-	/**
-	 * 查看业务意向详情
-	 * @param businessId
-	 * @return
-	 */
-	BussinessFollowBo findBusinessDetail(String businessId);
-
-	/**
-	 * 修改业务意向
-	 * @param bfb
-	 * @return
-	 */
-	int updateBusiness(BussinessFollowBo bfb);
-
-	/**
-	 * 跟进单个业务意向
-	 * @param bfb
-	 * @return
-	 */
-	int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException;
-
-	/**
-	 * 查询某个客户的一个意向的当次拜访
-	 * @param ufbId
-	 * @return
-	 */
-	BussinessFollowBo findFollowOneBusiness(String ufbId);
-
-	/**
-	 * 修改某个客户的一个意向的当次拜访
-	 * @param bfb
-	 * @return
-	 */
-	int updateFollowOneBusiness(BussinessFollowBo bfb);
-
-	/**
-	 * 添加单个联系人
-	 * @param ocb
-	 * @return
-	 */
-	int addOneContact(OrganizationContactBook ocb);
-
-	/**
-	 * 删除业务
-	 * @param businessId
-	 * @return
-	 */
-	int deleteBusiness(String businessId);
-
-	/**
-	 * 停止业务
-	 * @param businessId
-	 * @return
-	 */
-	int updateBusinessToStop(String businessId);
-
-	/**
-	 * 删除跟进记录中间表记录
-	 * @param ufbId
-	 * @return
-	 */
-	int deleteFollowOneBusiness(String ufbId);
-
-	/**
-	 * 删除单个联系人
-	 * @param ocbId
-	 * @return
-	 */
-	int delete(String ocbId);
-}

+ 115 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -1,5 +1,6 @@
 package com.goafanti.customer.service;
 
+import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
@@ -9,6 +10,8 @@ import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.customer.bo.BusinessListBo;
+import com.goafanti.customer.bo.BussinessFollowBo;
 import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
@@ -251,4 +254,116 @@ public interface CustomerService {
 	 * @return
 	 */
 	Pagination<StatisticBo> followStatistic(Date sDate, Date eDate, String depNo, Integer pageNo, Integer pageSize);
+	
+	/**
+	 * 查询我的业务列表
+	 * @param blo
+	 * @return
+	 */
+	Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize);
+
+	/**
+	 * 查询所有的业务列表
+	 * @param bfb
+	 * @return
+	 */
+	Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize);
+	
+	/**
+	 *  意向字典
+	 * @return
+	 */
+	List<BusinessListBo> findBusinessGlossory();
+	
+	/**
+	 * 
+	 * @param uid 客户ID
+	 * @param businessGlossoryId 业务意向字典ID 
+	 * @return
+	 */
+	int judgeBusiness(String uid,Integer businessGlossoryId);
+
+	/**
+	 * 添加意向服务和跟进记录
+	 * @param bfb
+	 */
+	void addBusinessAndFollow(BussinessFollowBo bfb)  throws ParseException ;
+	
+	/**
+	 * 查询业务列表
+	 * @param uid 客户ID
+	 * @param aid 营销员ID
+	 * @return
+	 */
+	List<UserBusiness> findBusinessByUAid(String uid,String aid);
+
+	/**
+	 * 查看业务意向详情
+	 * @param businessId
+	 * @return
+	 */
+	BussinessFollowBo findBusinessDetail(String businessId);
+
+	/**
+	 * 修改业务意向
+	 * @param bfb
+	 * @return
+	 */
+	int updateBusiness(BussinessFollowBo bfb);
+
+	/**
+	 * 跟进单个业务意向
+	 * @param bfb
+	 * @return
+	 */
+	int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException;
+
+	/**
+	 * 查询某个客户的一个意向的当次拜访
+	 * @param ufbId
+	 * @return
+	 */
+	BussinessFollowBo findFollowOneBusiness(String ufbId);
+
+	/**
+	 * 修改某个客户的一个意向的当次拜访
+	 * @param bfb
+	 * @return
+	 */
+	int updateFollowOneBusiness(BussinessFollowBo bfb);
+
+	/**
+	 * 添加单个联系人
+	 * @param ocb
+	 * @return
+	 */
+	int addOneContact(OrganizationContactBook ocb);
+
+	/**
+	 * 删除业务
+	 * @param businessId
+	 * @return
+	 */
+	int deleteBusiness(String businessId);
+
+	/**
+	 * 停止业务
+	 * @param businessId
+	 * @return
+	 */
+	int updateBusinessToStop(String businessId);
+
+	/**
+	 * 删除跟进记录中间表记录
+	 * @param ufbId
+	 * @return
+	 */
+	int deleteFollowOneBusiness(String ufbId);
+
+	/**
+	 * 删除单个联系人
+	 * @param ocbId
+	 * @return
+	 */
+	int deleteOneContact(String ocbId);
 }

+ 0 - 239
src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java

@@ -1,239 +0,0 @@
-package com.goafanti.customer.service.impl;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.OrganizationContactBookMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserFollowBusinessMapper;
-import com.goafanti.common.dao.UserFollowMapper;
-import com.goafanti.common.enums.CustomerStatusFiled;
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.model.UserBusiness;
-import com.goafanti.common.model.UserFollow;
-import com.goafanti.common.model.UserFollowBusiness;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.BussinessFollowBo;
-import com.goafanti.customer.service.BusinessService;
-
-@Service
-public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> implements BusinessService {
-	@Autowired
-	private UserBusinessMapper userBusinessMapper;
-	@Autowired
-	private UserFollowMapper userFollowMapper;
-	@Autowired
-	private UserFollowBusinessMapper userFollowBusinessMapper;
-	@Autowired
-	private OrganizationContactBookMapper organizationContactBookMapper;
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize) {
-		blo.setAid(TokenManager.getAdminId());
-		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize) {
-		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
-	}
-	
-	private Map<String,Object> disposeParams(BusinessListBo blo){
-		Map<String, Object> params = new HashMap<String, Object>();
-		if(StringUtils.isNotBlank(blo.getUid())) params.put("uid", blo.getUid());
-		if(StringUtils.isNotBlank(blo.getAid())) params.put("aid", blo.getAid());
-		if(StringUtils.isNotBlank(blo.getAdminName())) params.put("adminName", blo.getAdminName());
-		if(StringUtils.isNotBlank(blo.getBusinessGlossoryId())) params.put("businessGlossoryId", blo.getBusinessGlossoryId());
-		if(StringUtils.isNotBlank(blo.getStartDate())) params.put("startDate", blo.getStartDate()+" 00:00:00");
-		if(StringUtils.isNotBlank(blo.getEndDate())) params.put("endDate", blo.getEndDate()+ " 23:59:59");
-		if(StringUtils.isNotBlank(blo.getIdentifyName())) params.put("identifyName", blo.getIdentifyName());
-		if(StringUtils.isNoneBlank(blo.getFollowSituation())) params.put("followSituation", blo.getFollowSituation());
-		if(StringUtils.isNotBlank(blo.getCustomerStatus())) params.put("customerStatus", blo.getCustomerStatus());
-		return params;
-	}
-
-	@Override
-	public List<BusinessListBo> findBusinessGlossory() {
-		return userBusinessMapper.findBusinessGlossory();
-	}
-
-	@Override
-	public int judgeBusiness(String uid, Integer businessGlossoryId) {
-		
-		return userBusinessMapper.judgeBusiness(uid,businessGlossoryId,"");
-	}
-
-	@Override
-	@Transactional
-	public void addBusinessAndFollow(BussinessFollowBo bfb) throws ParseException {
-		UserBusiness ub = new UserBusiness();
-		String ubId = UUID.randomUUID().toString();
-		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
-		ub.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
-		ub.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
-		ub.setId(ubId);
-		ub.setUid(bfb.getUid());
-		ub.setAid(TokenManager.getAdminId());
-		ub.setRemarks(bfb.getRemarks());
-		ub.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
-		ub.setUpdateTime(format.parse(bfb.getCreateTime()));
-		ub.setCreateTime(format.parse(bfb.getCreateTime()));
-		userBusinessMapper.insert(ub);
-		if (StringUtils.isNotBlank(bfb.getOcbId())) { // 跟进联系人不为空则添加跟进记录
-			UserFollow uf = new UserFollow();
-			String ufId = UUID.randomUUID().toString();
-			uf.setId(ufId);
-			uf.setUid(bfb.getUid());
-			uf.setCreateTime(format.parse(bfb.getFollowTime()));
-			uf.setOcbId(bfb.getOcbId());
-			uf.setResult(bfb.getResult());
-			uf.setContactType(Integer.parseInt(bfb.getContactType()));
-			uf.setAid(TokenManager.getAdminId());
-			uf.setEffective(0);
-			int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
-			uf.setFollowCount(followCount);
-			userFollowMapper.insert(uf);
-			UserFollowBusiness ufb = new UserFollowBusiness();
-			ufb.setId(UUID.randomUUID().toString());
-			ufb.setBusinessId(ubId);
-			ufb.setFollowId(ufId);
-			ufb.setCustomerStatus(ub.getCustomerStatus());
-			ufb.setFollowSituation(ub.getFollowSituation());
-			ufb.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
-			userFollowBusinessMapper.insert(ufb);
-		}
-	}
-
-	@Override
-	public List<UserBusiness> findBusinessByUAid(String uid, String aid) {
-		
-		return userBusinessMapper.findBusinessByUAid(uid,aid);
-	}
-
-	@Override
-	public BussinessFollowBo findBusinessDetail(String businessId) {
-		
-		return userBusinessMapper.findBusinessDetail(businessId);
-	}
-
-	@Override
-	public int updateBusiness(BussinessFollowBo bfb) {
-		UserBusiness userBusiness = new UserBusiness();
-		userBusiness.setId(bfb.getBusinessId());
-		userBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
-		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
-		userBusiness.setRemarks(bfb.getRemarks());
-		userBusiness.setUpdateTime(new Date());
-		return userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
-	}
-
-	@Override
-	@Transactional
-	public int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException {
-		Date updateTime = new Date();
-		SimpleDateFormat format = new  SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
-		UserBusiness userBusiness = new UserBusiness();
-		userBusiness.setId(bfb.getBusinessId());
-		userBusiness.setUpdateTime(updateTime);
-		userBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
-		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
-		userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
-		UserFollow userFollow = new UserFollow();
-		String followId = UUID.randomUUID().toString();
-		int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
-		userFollow.setId(followId);
-		userFollow.setResult(bfb.getResult());
-		userFollow.setCreateTime(format.parse(bfb.getFollowTime()));
-		userFollow.setEffective(0);
-		userFollow.setOcbId(bfb.getOcbId());
-		userFollow.setFollowCount(followCount);
-		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
-		userFollow.setAid(TokenManager.getAdminId());
-		userFollow.setUid(bfb.getUid());
-		userFollowMapper.insert(userFollow);
-		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
-		String ufbId = UUID.randomUUID().toString();
-		userFollowBusiness.setId(ufbId);
-		userFollowBusiness.setFollowId(followId);
-		userFollowBusiness.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
-		userFollowBusiness.setBusinessId(bfb.getBusinessId());
-		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
-		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
-		userFollowBusiness.setRemarks(bfb.getRemarks());
-		userFollowBusinessMapper.insert(userFollowBusiness);
-		return 1;
-	}
-
-	@Override
-	public BussinessFollowBo findFollowOneBusiness(String ufbId) {
-		
-		return userBusinessMapper.findFollowOneBusiness(ufbId);
-	}
-
-	@Override
-	public int updateFollowOneBusiness(BussinessFollowBo bfb) {
-		//修改业务跟进中间表
-		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
-		userFollowBusiness.setId(bfb.getUfbId());
-		userFollowBusiness.setRemarks(bfb.getRemarks());
-		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
-		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
-		userFollowBusinessMapper.updateByPrimaryKeySelective(userFollowBusiness);
-		//修改跟进记录表
-		UserFollow userFollow = new UserFollow();
-		userFollow.setId(bfb.getFollowId());
-		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
-		userFollow.setResult(bfb.getResult());
-		if(StringUtils.isNotBlank(bfb.getOcbId())) userFollow.setOcbId(bfb.getOcbId());
-		userFollowMapper.updateByPrimaryKeySelective(userFollow);
-		return 1;
-	}
-
-	@Override
-	public int addOneContact(OrganizationContactBook ocb) {
-		ocb.setAid(TokenManager.getAdminId());
-		ocb.setId(UUID.randomUUID().toString());
-		return organizationContactBookMapper.insert(ocb);
-	}
-
-	@Override
-	public int deleteBusiness(String businessId) {
-		return userBusinessMapper.deleteByPrimaryKey(businessId);
-	}
-
-	@Override
-	public int updateBusinessToStop(String businessId) {
-		UserBusiness ub = new UserBusiness();
-		ub.setId(businessId);
-		ub.setCustomerStatus(CustomerStatusFiled.STATUS_STOP.getCode());
-		return userBusinessMapper.updateByPrimaryKeySelective(ub);
-	}
-
-	@Override
-	public int deleteFollowOneBusiness(String ufbId) {
-		UserFollowBusiness ufb = new UserFollowBusiness();
-		ufb.setId(ufbId);
-		return userFollowBusinessMapper.deleteByPrimaryKey(ufbId);
-	}
-
-	@Override
-	public int delete(String ocbId) {
-		return organizationContactBookMapper.deleteByPrimaryKey(ocbId);
-	}
-
-}

+ 198 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -29,6 +29,7 @@ import com.goafanti.common.dao.UserFollowBusinessMapper;
 import com.goafanti.common.dao.UserFollowMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.CustomerStatusFiled;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.IdentityProcess;
 import com.goafanti.common.enums.MemberStatus;
@@ -48,6 +49,8 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.BusinessListBo;
+import com.goafanti.customer.bo.BussinessFollowBo;
 import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
@@ -70,7 +73,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Autowired
 	private OrganizationContactBookMapper organizationContactBookMapper;
 	@Resource(name = "passwordUtil")
-	private PasswordUtil					passwordUtil;
+	private PasswordUtil	passwordUtil;
 	@Resource
 	private UserFollowMapper userFollowMapper;
 	@Resource
@@ -721,6 +724,200 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		Pagination<StatisticBo> page = (Pagination<StatisticBo>)findPage("followStatisticList", "followStatisticCount", params, pageNo, pageSize);
 		return page;
 	}
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize) {
+		blo.setAid(TokenManager.getAdminId());
+		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
+	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize) {
+		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
+	}
+	
+	private Map<String,Object> disposeParams(BusinessListBo blo){
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(StringUtils.isNotBlank(blo.getUid())) params.put("uid", blo.getUid());
+		if(StringUtils.isNotBlank(blo.getAid())) params.put("aid", blo.getAid());
+		if(StringUtils.isNotBlank(blo.getAdminName())) params.put("adminName", blo.getAdminName());
+		if(StringUtils.isNotBlank(blo.getBusinessGlossoryId())) params.put("businessGlossoryId", blo.getBusinessGlossoryId());
+		if(StringUtils.isNotBlank(blo.getStartDate())) params.put("startDate", blo.getStartDate()+" 00:00:00");
+		if(StringUtils.isNotBlank(blo.getEndDate())) params.put("endDate", blo.getEndDate()+ " 23:59:59");
+		if(StringUtils.isNotBlank(blo.getIdentifyName())) params.put("identifyName", blo.getIdentifyName());
+		if(StringUtils.isNoneBlank(blo.getFollowSituation())) params.put("followSituation", blo.getFollowSituation());
+		if(StringUtils.isNotBlank(blo.getCustomerStatus())) params.put("customerStatus", blo.getCustomerStatus());
+		return params;
+	}
+
+	@Override
+	public List<BusinessListBo> findBusinessGlossory() {
+		return userBusinessMapper.findBusinessGlossory();
+	}
+
+	@Override
+	public int judgeBusiness(String uid, Integer businessGlossoryId) {
+		
+		return userBusinessMapper.judgeBusiness(uid,businessGlossoryId,"");
+	}
+
+	@Override
+	@Transactional
+	public void addBusinessAndFollow(BussinessFollowBo bfb) throws ParseException {
+		UserBusiness ub = new UserBusiness();
+		String ubId = UUID.randomUUID().toString();
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		ub.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		ub.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		ub.setId(ubId);
+		ub.setUid(bfb.getUid());
+		ub.setAid(TokenManager.getAdminId());
+		ub.setRemarks(bfb.getRemarks());
+		ub.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
+		ub.setUpdateTime(format.parse(bfb.getCreateTime()));
+		ub.setCreateTime(format.parse(bfb.getCreateTime()));
+		userBusinessMapper.insert(ub);
+		if (StringUtils.isNotBlank(bfb.getOcbId())) { // 跟进联系人不为空则添加跟进记录
+			UserFollow uf = new UserFollow();
+			String ufId = UUID.randomUUID().toString();
+			uf.setId(ufId);
+			uf.setUid(bfb.getUid());
+			uf.setCreateTime(format.parse(bfb.getFollowTime()));
+			uf.setOcbId(bfb.getOcbId());
+			uf.setResult(bfb.getResult());
+			uf.setContactType(Integer.parseInt(bfb.getContactType()));
+			uf.setAid(TokenManager.getAdminId());
+			uf.setEffective(0);
+			int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
+			uf.setFollowCount(followCount);
+			userFollowMapper.insert(uf);
+			UserFollowBusiness ufb = new UserFollowBusiness();
+			ufb.setId(UUID.randomUUID().toString());
+			ufb.setBusinessId(ubId);
+			ufb.setFollowId(ufId);
+			ufb.setCustomerStatus(ub.getCustomerStatus());
+			ufb.setFollowSituation(ub.getFollowSituation());
+			ufb.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
+			userFollowBusinessMapper.insert(ufb);
+		}
+	}
+
+	@Override
+	public List<UserBusiness> findBusinessByUAid(String uid, String aid) {
+		
+		return userBusinessMapper.findBusinessByUAid(uid,aid);
+	}
+
+	@Override
+	public BussinessFollowBo findBusinessDetail(String businessId) {
+		
+		return userBusinessMapper.findBusinessDetail(businessId);
+	}
+
+	@Override
+	public int updateBusiness(BussinessFollowBo bfb) {
+		UserBusiness userBusiness = new UserBusiness();
+		userBusiness.setId(bfb.getBusinessId());
+		userBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userBusiness.setRemarks(bfb.getRemarks());
+		userBusiness.setUpdateTime(new Date());
+		return userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
+	}
+
+	@Override
+	@Transactional
+	public int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException {
+		Date updateTime = new Date();
+		SimpleDateFormat format = new  SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		UserBusiness userBusiness = new UserBusiness();
+		userBusiness.setId(bfb.getBusinessId());
+		userBusiness.setUpdateTime(updateTime);
+		userBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
+		UserFollow userFollow = new UserFollow();
+		String followId = UUID.randomUUID().toString();
+		int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
+		userFollow.setId(followId);
+		userFollow.setResult(bfb.getResult());
+		userFollow.setCreateTime(format.parse(bfb.getFollowTime()));
+		userFollow.setEffective(0);
+		userFollow.setOcbId(bfb.getOcbId());
+		userFollow.setFollowCount(followCount);
+		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
+		userFollow.setAid(TokenManager.getAdminId());
+		userFollow.setUid(bfb.getUid());
+		userFollowMapper.insert(userFollow);
+		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
+		String ufbId = UUID.randomUUID().toString();
+		userFollowBusiness.setId(ufbId);
+		userFollowBusiness.setFollowId(followId);
+		userFollowBusiness.setBusinessGlossoryId(Integer.parseInt(bfb.getBusinessGlossoryId()));
+		userFollowBusiness.setBusinessId(bfb.getBusinessId());
+		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userFollowBusiness.setRemarks(bfb.getRemarks());
+		userFollowBusinessMapper.insert(userFollowBusiness);
+		return 1;
+	}
+
+	@Override
+	public BussinessFollowBo findFollowOneBusiness(String ufbId) {
+		
+		return userBusinessMapper.findFollowOneBusiness(ufbId);
+	}
+
+	@Override
+	public int updateFollowOneBusiness(BussinessFollowBo bfb) {
+		//修改业务跟进中间表
+		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
+		userFollowBusiness.setId(bfb.getUfbId());
+		userFollowBusiness.setRemarks(bfb.getRemarks());
+		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userFollowBusinessMapper.updateByPrimaryKeySelective(userFollowBusiness);
+		//修改跟进记录表
+		UserFollow userFollow = new UserFollow();
+		userFollow.setId(bfb.getFollowId());
+		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
+		userFollow.setResult(bfb.getResult());
+		if(StringUtils.isNotBlank(bfb.getOcbId())) userFollow.setOcbId(bfb.getOcbId());
+		userFollowMapper.updateByPrimaryKeySelective(userFollow);
+		return 1;
+	}
+
+	@Override
+	public int addOneContact(OrganizationContactBook ocb) {
+		ocb.setAid(TokenManager.getAdminId());
+		ocb.setId(UUID.randomUUID().toString());
+		return organizationContactBookMapper.insert(ocb);
+	}
+
+	@Override
+	public int deleteBusiness(String businessId) {
+		return userBusinessMapper.deleteByPrimaryKey(businessId);
+	}
+
+	@Override
+	public int updateBusinessToStop(String businessId) {
+		UserBusiness ub = new UserBusiness();
+		ub.setId(businessId);
+		ub.setCustomerStatus(CustomerStatusFiled.STATUS_STOP.getCode());
+		return userBusinessMapper.updateByPrimaryKeySelective(ub);
+	}
+
+	@Override
+	public int deleteFollowOneBusiness(String ufbId) {
+		UserFollowBusiness ufb = new UserFollowBusiness();
+		ufb.setId(ufbId);
+		return userFollowBusinessMapper.deleteByPrimaryKey(ufbId);
+	}
+
+	@Override
+	public int deleteOneContact(String ocbId) {
+		return organizationContactBookMapper.deleteByPrimaryKey(ocbId);
+	}
 	
 }

+ 0 - 17
src/main/java/com/goafanti/dataGlossory/service/DistrictGlossoryService.java

@@ -1,17 +0,0 @@
-package com.goafanti.dataGlossory.service;
-
-import java.util.List;
-
-import com.goafanti.common.model.DistrictGlossory;
-
-public interface DistrictGlossoryService {
-
-	DistrictGlossory selectByPrimaryKey(Integer province);
-	
-	public List<DistrictGlossory> list(Integer pid);
-
-	public void clear(Integer pid);
-	
-	public String selectNameById(Integer id);
-	
-}

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.demand.controller;
 
 import java.io.IOException;
 import java.lang.reflect.Field;

+ 1 - 1
src/main/java/com/goafanti/demand/controller/DemandApiController.java

@@ -36,7 +36,7 @@ import com.goafanti.demand.service.DemandService;
 
 @RestController
 @RequestMapping(value = "/api/user/demand")
-public class DemandApiController extends CertifyApiController {
+public class UserDemandApiController extends CertifyApiController {
 	@Resource
 	private DemandService		demandService;
 	@Resource

+ 0 - 10
src/main/java/com/goafanti/engagedFieldGlossory/service/EngagedFieldGlossoryService.java

@@ -1,10 +0,0 @@
-package com.goafanti.engagedFieldGlossory.service;
-
-import com.goafanti.common.model.EngagedFieldGlossory;
-
-public interface EngagedFieldGlossoryService {
-
-	public EngagedFieldGlossory selectByPrimaryKey(Integer id);
-
-	public void clear(Integer id);
-}

Разница между файлами не показана из-за своего большого размера
+ 577 - 577
src/main/java/com/goafanti/evaluation/controller/EvaluationController.java


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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.lecture.controller;
 
 import java.util.Arrays;
 

+ 1 - 1
src/main/java/com/goafanti/memberGrade/bo/BusinessType.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.bo;
+package com.goafanti.member.bo;
 
 /**
  * 增值服务枚举

+ 1 - 1
src/main/java/com/goafanti/memberGrade/bo/MemberGrade.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.bo;
+package com.goafanti.member.bo;
 
 /**
  * 会员等级

+ 1 - 1
src/main/java/com/goafanti/memberGrade/bo/MemberGradeBO.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.bo;
+package com.goafanti.member.bo;
 
 import com.alibaba.fastjson.JSONObject;
 

+ 6 - 6
src/main/java/com/goafanti/memberGrade/controller/MemberGradeController.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.controller;
+package com.goafanti.member.controller;
 
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -22,10 +22,10 @@ import com.goafanti.common.enums.OrderState;
 import com.goafanti.common.model.MemberOrder;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.memberGrade.bo.MemberGrade;
-import com.goafanti.memberGrade.bo.MemberGradeBO;
-import com.goafanti.memberGrade.service.MemberGradeService;
-import com.goafanti.memberGrade.service.MemberOrderService;
+import com.goafanti.member.bo.MemberGrade;
+import com.goafanti.member.bo.MemberGradeBO;
+import com.goafanti.member.service.MemberGradeService;
+import com.goafanti.member.service.MemberOrderService;
 
 /**
  * 会员等级管理 后台
@@ -35,7 +35,7 @@ import com.goafanti.memberGrade.service.MemberOrderService;
  */
 @RestController
 @RequestMapping(value = "/api/admin/member")
-public class MemberGradeController extends BaseApiController {
+public class AdminMemberController extends BaseApiController {
 	@Autowired
 	private MemberGradeService	memberGradeService;
 	@Autowired

+ 4 - 4
src/main/java/com/goafanti/memberGrade/controller/MemberGradeFrontController.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.controller;
+package com.goafanti.member.controller;
 
 import java.util.Date;
 import java.util.HashMap;
@@ -23,8 +23,8 @@ import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.memberGrade.bo.BusinessType;
-import com.goafanti.memberGrade.service.MemberGradeService;
+import com.goafanti.member.bo.BusinessType;
+import com.goafanti.member.service.MemberGradeService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
 
@@ -36,7 +36,7 @@ import com.goafanti.user.service.UserService;
  */
 @RestController
 @RequestMapping(value = "/api/user/member")
-public class MemberGradeFrontController extends BaseApiController {
+public class UserMemberController extends BaseApiController {
 	@Autowired
 	private MemberGradeService	memberGradeService;
 	@Autowired

+ 2 - 2
src/main/java/com/goafanti/memberGrade/service/MemberGradeService.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.service;
+package com.goafanti.member.service;
 
 import java.util.HashMap;
 import java.util.List;
@@ -12,7 +12,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.goafanti.common.dao.MemberGradeMapper;
 import com.goafanti.common.model.MemberOrder;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.memberGrade.bo.MemberGrade;
+import com.goafanti.member.bo.MemberGrade;
 
 @Service
 public class MemberGradeService {

+ 1 - 1
src/main/java/com/goafanti/memberGrade/service/MemberOrderService.java

@@ -1,4 +1,4 @@
-package com.goafanti.memberGrade.service;
+package com.goafanti.member.service;
 
 import java.util.HashMap;
 import java.util.List;

+ 2 - 2
src/main/java/com/goafanti/message/JGMessageHelper.java

@@ -37,9 +37,9 @@ import cn.jiguang.common.resp.ResponseWrapper;
  */
 public class JGMessageHelper implements InitializingBean, DisposableBean{
 	@Value(value = "${jiguang.appKey}")
-	private String appKey = "36944c5628d34ff997f56dcd"; 
+	private String appKey; 
 	@Value(value = "${jiguang.masterSecret}")
-	private String masterSecret = "cceff6a22d91c06786bfdcd3";
+	private String masterSecret;
 	@Value(value = "${jiguang.pushUrl}")
 	private String pushUrl;
 	@Autowired

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.message.controller;
 
 import java.text.ParseException;
 import java.util.Date;

+ 0 - 5
src/main/java/com/goafanti/message/controller/MessageApiController.java

@@ -1,5 +0,0 @@
-package com.goafanti.message.controller;
-
-public class MessageApiController {
-
-}

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.news.controller;
 
 import java.text.ParseException;
 import java.util.Arrays;

+ 69 - 69
src/main/java/com/goafanti/consultOrder/controller/AdminConsultOrderApiController.java

@@ -1,69 +1,69 @@
-package com.goafanti.consultOrder.controller;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.enums.OrderState;
-import com.goafanti.common.model.ConsultOrder;
-import com.goafanti.consultOrder.service.ConsultOrderService;
-
-@RestController
-@RequestMapping(value = "/api/admin/consultorder")
-public class AdminConsultOrderApiController extends BaseApiController {
-
-	@Autowired
-	ConsultOrderService consultOrderService;
-
-	/**
-	 * 
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	public Result list(String number, String toNumber, String pageNo, String pageSize, String id, String paymentId,
-			String state) {
-		return res().data(consultOrderService.getList(
-				consultOrderService.disposeSearchParams(number, toNumber, id, paymentId, state), getPageNo(pageNo),
-				getPageSize(pageSize)));
-	}
-
-	/**
-	 * 
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/del", method = RequestMethod.POST)
-	public Result delConsultOrder(Long id) {
-		ConsultOrder co = consultOrderService.selectByPrimaryKey(id);
-		if (co.getOrderState() != OrderState.UNPAYED.getCode()) {
-			return res().data(0);
-		}
-		ConsultOrder newCo = new ConsultOrder();
-		newCo.setId(co.getId());
-		newCo.setOrderState(OrderState.CANCELLED.getCode());
-		return res().data(consultOrderService.updateByPrimaryKeySelective(newCo));
-	}
-
-	/**
-	 * 
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/update", method = RequestMethod.POST)
-	public Result updateConsultOrder(ConsultOrder inputCO) {
-		ConsultOrder co = consultOrderService.selectByPrimaryKey(inputCO.getId());
-		if (co.getOrderState() != OrderState.UNPAYED.getCode()) {
-			return res().data(0);
-		}
-		co.setPaymentId(inputCO.getPaymentId());
-		co.setPaymentType(inputCO.getPaymentType());
-		co.setPaymentTime(inputCO.getPaymentTime());
-		co.setPaymentValue(inputCO.getPaymentValue());
-		co.setOrderState(OrderState.getStatus(inputCO.getOrderState()).getCode());
-		return res().data(consultOrderService.updateByPrimaryKeySelective(co));
-	}
-}
+package com.goafanti.order.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.OrderState;
+import com.goafanti.common.model.ConsultOrder;
+import com.goafanti.order.service.ConsultOrderService;
+
+@RestController
+@RequestMapping(value = "/api/admin/consultorder")
+public class AdminConsultOrderApiController extends BaseApiController {
+
+	@Autowired
+	ConsultOrderService consultOrderService;
+
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String number, String toNumber, String pageNo, String pageSize, String id, String paymentId,
+			String state) {
+		return res().data(consultOrderService.getList(
+				consultOrderService.disposeSearchParams(number, toNumber, id, paymentId, state), getPageNo(pageNo),
+				getPageSize(pageSize)));
+	}
+
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/del", method = RequestMethod.POST)
+	public Result delConsultOrder(Long id) {
+		ConsultOrder co = consultOrderService.selectByPrimaryKey(id);
+		if (co.getOrderState() != OrderState.UNPAYED.getCode()) {
+			return res().data(0);
+		}
+		ConsultOrder newCo = new ConsultOrder();
+		newCo.setId(co.getId());
+		newCo.setOrderState(OrderState.CANCELLED.getCode());
+		return res().data(consultOrderService.updateByPrimaryKeySelective(newCo));
+	}
+
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/update", method = RequestMethod.POST)
+	public Result updateConsultOrder(ConsultOrder inputCO) {
+		ConsultOrder co = consultOrderService.selectByPrimaryKey(inputCO.getId());
+		if (co.getOrderState() != OrderState.UNPAYED.getCode()) {
+			return res().data(0);
+		}
+		co.setPaymentId(inputCO.getPaymentId());
+		co.setPaymentType(inputCO.getPaymentType());
+		co.setPaymentTime(inputCO.getPaymentTime());
+		co.setPaymentValue(inputCO.getPaymentValue());
+		co.setOrderState(OrderState.getStatus(inputCO.getOrderState()).getCode());
+		return res().data(consultOrderService.updateByPrimaryKeySelective(co));
+	}
+}

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.order.controller;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;

+ 85 - 85
src/main/java/com/goafanti/consultOrder/controller/ConsultOrderApiController.java

@@ -1,85 +1,85 @@
-package com.goafanti.consultOrder.controller;
-
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.enums.OrderState;
-import com.goafanti.common.model.ConsultOrder;
-import com.goafanti.common.service.SysDictService;
-import com.goafanti.consultOrder.service.ConsultOrderService;
-import com.goafanti.core.shiro.token.TokenManager;
-
-@RestController
-@RequestMapping(value = "/api/user/consultorder")
-public class ConsultOrderApiController extends BaseApiController {
-
-	private static final String	CONSULT_PRICE	= "consult_price";
-
-	@Autowired
-	SysDictService				sysDictService;
-	@Autowired
-	ConsultOrderService			consultOrderService;
-
-	/**
-	 * 前台生成订单
-	 * 
-	 * @param toUserId
-	 * @return
-	 */
-	@RequestMapping(value = "/add", method = RequestMethod.POST)
-	public Result addConsultOrder(String toUserId) {
-		String price = sysDictService.getValue(CONSULT_PRICE);
-		if (StringUtils.isNotBlank(price) && StringUtils.isNotBlank(toUserId)) {
-			return res().data(consultOrderService.insertSelective(toUserId, Double.parseDouble(price)));
-		}
-		return res().error(buildError(ErrorConstants.PARAM_ERROR, "参数错误", "预约"));
-	}
-
-	/**
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/price", method = RequestMethod.GET)
-	public Result getPrice() {
-		return res().data(sysDictService.getValue(CONSULT_PRICE));
-	}
-
-	/**
-	 * 
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/del", method = RequestMethod.POST)
-	public Result delConsultOrder(Long id) {
-		ConsultOrder co = consultOrderService.selectByPrimaryKey(id);
-		if (co.getOrderState() != OrderState.UNPAYED.getCode()
-				|| !StringUtils.equals(co.getUserId(), TokenManager.getUserId())) {
-			return res().data(0);
-		}
-		ConsultOrder newCo = new ConsultOrder();
-		newCo.setId(co.getId());
-		newCo.setOrderState(OrderState.CANCELLED.getCode());
-		return res().data(consultOrderService.updateByPrimaryKeySelective(newCo));
-	}
-
-	/**
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	public Result list(String number, String toNumber, String pageNo, String pageSize, String id, String paymentId,
-			String state) {
-		Map<String, Object> params = consultOrderService.disposeSearchParams(number, toNumber, id, paymentId, state);
-		params.put("uid", TokenManager.getUserId());
-		return res().data(consultOrderService.getList(params, getPageNo(pageNo), getPageSize(pageSize)));
-	}
-
-}
+package com.goafanti.order.controller;
+
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.OrderState;
+import com.goafanti.common.model.ConsultOrder;
+import com.goafanti.common.service.SysDictService;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.service.ConsultOrderService;
+
+@RestController
+@RequestMapping(value = "/api/user/consultorder")
+public class UserConsultOrderApiController extends BaseApiController {
+
+	private static final String	CONSULT_PRICE	= "consult_price";
+
+	@Autowired
+	SysDictService				sysDictService;
+	@Autowired
+	ConsultOrderService			consultOrderService;
+
+	/**
+	 * 前台生成订单
+	 * 
+	 * @param toUserId
+	 * @return
+	 */
+	@RequestMapping(value = "/add", method = RequestMethod.POST)
+	public Result addConsultOrder(String toUserId) {
+		String price = sysDictService.getValue(CONSULT_PRICE);
+		if (StringUtils.isNotBlank(price) && StringUtils.isNotBlank(toUserId)) {
+			return res().data(consultOrderService.insertSelective(toUserId, Double.parseDouble(price)));
+		}
+		return res().error(buildError(ErrorConstants.PARAM_ERROR, "参数错误", "预约"));
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/price", method = RequestMethod.GET)
+	public Result getPrice() {
+		return res().data(sysDictService.getValue(CONSULT_PRICE));
+	}
+
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/del", method = RequestMethod.POST)
+	public Result delConsultOrder(Long id) {
+		ConsultOrder co = consultOrderService.selectByPrimaryKey(id);
+		if (co.getOrderState() != OrderState.UNPAYED.getCode()
+				|| !StringUtils.equals(co.getUserId(), TokenManager.getUserId())) {
+			return res().data(0);
+		}
+		ConsultOrder newCo = new ConsultOrder();
+		newCo.setId(co.getId());
+		newCo.setOrderState(OrderState.CANCELLED.getCode());
+		return res().data(consultOrderService.updateByPrimaryKeySelective(newCo));
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String number, String toNumber, String pageNo, String pageSize, String id, String paymentId,
+			String state) {
+		Map<String, Object> params = consultOrderService.disposeSearchParams(number, toNumber, id, paymentId, state);
+		params.put("uid", TokenManager.getUserId());
+		return res().data(consultOrderService.getList(params, getPageNo(pageNo), getPageSize(pageSize)));
+	}
+
+}

+ 1 - 1
src/main/java/com/goafanti/order/controller/OrderController.java

@@ -19,7 +19,7 @@ import com.goafanti.order.service.OrderService;
 
 @RestController
 @RequestMapping(value = "/api/user/order")
-public class OrderController extends CertifyApiController{
+public class UserOrderApiController extends CertifyApiController{
 	
 	@Resource
 	private OrderService orderServiceImpl;

+ 102 - 102
src/main/java/com/goafanti/consultOrder/service/ConsultOrderService.java

@@ -1,102 +1,102 @@
-package com.goafanti.consultOrder.service;
-
-import java.util.Date;
-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 org.springframework.ui.ModelMap;
-
-import com.goafanti.common.dao.ConsultOrderMapper;
-import com.goafanti.common.dao.UserMapper;
-import com.goafanti.common.enums.OrderState;
-import com.goafanti.common.model.ConsultOrder;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.JDBCIdGenerator;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
-
-@Service
-public class ConsultOrderService extends BaseMybatisDao<ConsultOrder> {
-
-	@Autowired
-	private ConsultOrderMapper	consultOrderMapper;
-
-	@Autowired
-	private UserMapper			userMapper;
-
-	@Autowired
-	private JDBCIdGenerator		idGenerator;
-
-	public int deleteByPrimaryKey(Long id) {
-		if (TokenManager.getAdminToken() == null) {
-			Map<String, Object> map = new HashMap<>();
-			map.put("id", id);
-			map.put("uid", TokenManager.getUserId());
-			return consultOrderMapper.deleteRecord(map);
-		} else {
-			return consultOrderMapper.deleteByPrimaryKey(id);
-		}
-	}
-
-	public int insertSelective(String toUid, Double price) {
-		if (userMapper.selectByPrimaryKey(toUid) == null) {
-			return 0;
-		}
-		ConsultOrder co = new ConsultOrder();
-		co.setId(idGenerator.generateId());
-		co.setUserId(TokenManager.getUserId());
-		co.setToUserId(toUid);
-		co.setOrderState(OrderState.UNPAYED.getCode());
-		co.setOrderTime(new Date());
-		co.setPrice(price);
-		return consultOrderMapper.insertSelective(co);
-	}
-
-	public int updateByPrimaryKeySelective(ConsultOrder record) {
-		return consultOrderMapper.updateByPrimaryKeySelective(record);
-	}
-
-	public ConsultOrder selectByPrimaryKey(Long id) {
-		return consultOrderMapper.selectByPrimaryKey(id);
-	}
-
-	public Pagination<ModelMap> getList(Map<String, Object> params, Integer pNo, Integer pSize) {
-		Pagination<ModelMap> page = new Pagination<>();
-		page.setPageNo(pNo);
-		page.setPageSize(pSize);
-		int offset = (page.getPageNo() - 1) * page.getPageSize();
-		params.put("page_sql", String.format(" limit  %s , %s ", offset, pSize));
-		List<ModelMap> res = consultOrderMapper.findConsultOrderListByPage(params);
-		for (ModelMap mm : res) {
-			mm.put("id", String.valueOf(mm.get("id")));
-		}
-		page.setList(res);
-		page.setTotalCount(consultOrderMapper.findConsultOrderCount(params));
-		return page;
-	}
-
-	public Map<String, Object> disposeSearchParams(String number, String toNumber, String id, String paymentId,
-			String state) {
-		Map<String, Object> params = new HashMap<>();
-		if (StringUtils.isNumeric(number)) {
-			params.put("number", Integer.parseInt(number));
-		}
-		if (StringUtils.isNumeric(toNumber)) {
-			params.put("tnumber", Integer.parseInt(toNumber));
-		}
-		if (StringUtils.isNumeric(id)) {
-			params.put("id", Long.parseLong(id));
-		}
-		if (StringUtils.isNotBlank(paymentId)) {
-			params.put("pid", paymentId);
-		}
-		if (state != null) {
-			params.put("state", OrderState.getStatus(state).getCode());
-		}
-		return params;
-	}
-}
+package com.goafanti.order.service;
+
+import java.util.Date;
+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 org.springframework.ui.ModelMap;
+
+import com.goafanti.common.dao.ConsultOrderMapper;
+import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.OrderState;
+import com.goafanti.common.model.ConsultOrder;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+
+@Service
+public class ConsultOrderService extends BaseMybatisDao<ConsultOrder> {
+
+	@Autowired
+	private ConsultOrderMapper	consultOrderMapper;
+
+	@Autowired
+	private UserMapper			userMapper;
+
+	@Autowired
+	private JDBCIdGenerator		idGenerator;
+
+	public int deleteByPrimaryKey(Long id) {
+		if (TokenManager.getAdminToken() == null) {
+			Map<String, Object> map = new HashMap<>();
+			map.put("id", id);
+			map.put("uid", TokenManager.getUserId());
+			return consultOrderMapper.deleteRecord(map);
+		} else {
+			return consultOrderMapper.deleteByPrimaryKey(id);
+		}
+	}
+
+	public int insertSelective(String toUid, Double price) {
+		if (userMapper.selectByPrimaryKey(toUid) == null) {
+			return 0;
+		}
+		ConsultOrder co = new ConsultOrder();
+		co.setId(idGenerator.generateId());
+		co.setUserId(TokenManager.getUserId());
+		co.setToUserId(toUid);
+		co.setOrderState(OrderState.UNPAYED.getCode());
+		co.setOrderTime(new Date());
+		co.setPrice(price);
+		return consultOrderMapper.insertSelective(co);
+	}
+
+	public int updateByPrimaryKeySelective(ConsultOrder record) {
+		return consultOrderMapper.updateByPrimaryKeySelective(record);
+	}
+
+	public ConsultOrder selectByPrimaryKey(Long id) {
+		return consultOrderMapper.selectByPrimaryKey(id);
+	}
+
+	public Pagination<ModelMap> getList(Map<String, Object> params, Integer pNo, Integer pSize) {
+		Pagination<ModelMap> page = new Pagination<>();
+		page.setPageNo(pNo);
+		page.setPageSize(pSize);
+		int offset = (page.getPageNo() - 1) * page.getPageSize();
+		params.put("page_sql", String.format(" limit  %s , %s ", offset, pSize));
+		List<ModelMap> res = consultOrderMapper.findConsultOrderListByPage(params);
+		for (ModelMap mm : res) {
+			mm.put("id", String.valueOf(mm.get("id")));
+		}
+		page.setList(res);
+		page.setTotalCount(consultOrderMapper.findConsultOrderCount(params));
+		return page;
+	}
+
+	public Map<String, Object> disposeSearchParams(String number, String toNumber, String id, String paymentId,
+			String state) {
+		Map<String, Object> params = new HashMap<>();
+		if (StringUtils.isNumeric(number)) {
+			params.put("number", Integer.parseInt(number));
+		}
+		if (StringUtils.isNumeric(toNumber)) {
+			params.put("tnumber", Integer.parseInt(toNumber));
+		}
+		if (StringUtils.isNumeric(id)) {
+			params.put("id", Long.parseLong(id));
+		}
+		if (StringUtils.isNotBlank(paymentId)) {
+			params.put("pid", paymentId);
+		}
+		if (state != null) {
+			params.put("state", OrderState.getStatus(state).getCode());
+		}
+		return params;
+	}
+}

+ 3 - 4
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -69,11 +69,10 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		bo.setOrderNo(String.valueOf(idGenerator.generateId()));
 		bo.setCreateTime(DateUtils.formatDate(new Date(),AFTConstants.YYYYMMDDHHMMSS));
 		bo.setCommodityType(commodityType);
-		if(bo.getCommodityPrice().equals("0")){
+		if(bo.getCommodityPrice().equals("0"))
 			bo.setCommodityPrice("面议");
-		}else{
+		else
 			bo.setCommodityPrice(bo.getCommodityPrice()+" 万");
-		}
 		if(StringUtils.isBlank(bo.getFirstPayment())) 
 			bo.setFirstPayment("面议");
 		else 
@@ -171,7 +170,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					tOrder.getFirstPayment().doubleValue());
 			if(boundary == 1){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付首付款"));
-			}else if(boundary == -1){ //首付待付清 ()
+			}else if(boundary == -1){ //首付待付清
 				tOrder.setActuallyTotalPayment(
 						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(), changeAmount.doubleValue())));
 				tOrder.setActuallyFirstPayment(

+ 1 - 1
src/main/java/com/goafanti/organization/controller/OrganizationManagementController.java

@@ -17,7 +17,7 @@ import com.goafanti.organization.service.OrganizationService;
 
 @RestController
 @RequestMapping("api/admin/organization")
-public class OrganizationManagementController extends BaseApiController{
+public class AdminOrganizationController extends BaseApiController{
 	@Resource
 	private OrganizationService organizationService;
 	@Autowired

+ 1 - 2
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -28,7 +28,6 @@ import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftFile;
-import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.common.model.User;
@@ -45,7 +44,7 @@ import com.goafanti.user.service.UserService;
 
 @Controller
 @RequestMapping(value = "/api/user/patent")
-public class PatentApiController extends CertifyApiController {
+public class UserPatentApiController extends CertifyApiController {
 	@Resource
 	private PatentInfoService				patentInfoService;
 	@Resource

+ 0 - 38
src/main/java/com/goafanti/portal/controller/PoralResidentIntegrationController.java

@@ -1,38 +0,0 @@
-package com.goafanti.portal.controller;
-
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.goafanti.common.controller.BaseController;
-import com.goafanti.news.bo.NewsSummary;
-import com.goafanti.news.service.NewsService;
-import com.goafanti.residentIntegration.bo.ResidentIntegrationBo;
-import com.goafanti.residentIntegration.service.ResidentIntegrationService;
-
-@Controller
-public class PoralResidentIntegrationController extends BaseController{
-	@Resource
-	private ResidentIntegrationService residentIntegrationService;
-	@Resource
-	private NewsService				   newsService;
-	@RequestMapping(value="/portal/residentIntegration/index")
-	public ModelAndView residentIntegrationIndex(ModelAndView mv){
-		List<ResidentIntegrationBo> jmrhAchievementList = residentIntegrationService.selectJmrhAchievement();
-		List<ResidentIntegrationBo> jmrhTechnologyList = residentIntegrationService.selectJmrTechnology();
-		List<ResidentIntegrationBo> jmrhProjectList = residentIntegrationService.selectJmrProject();
-		List<NewsSummary> gjzcNewsList = newsService.findJmrhNewsList("4");
-		List<NewsSummary> dfzcNewsList = newsService.findJmrhNewsList("5");
-		mv.addObject("jmrhAchievementList", jmrhAchievementList);
-		mv.addObject("jmrhTechnologyList",jmrhTechnologyList);
-		mv.addObject("jmrhProjectList",jmrhProjectList);
-		mv.addObject("gjzcNewsList",gjzcNewsList);
-		mv.addObject("dfzcNewsList",dfzcNewsList);
-		mv.setViewName("/portal/residentIntegration/index");
-		return mv;
-	}
-}

+ 1 - 1
src/main/java/com/goafanti/portal/controller/PortalBigShotController.java

@@ -18,8 +18,8 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.Banners;
 import com.goafanti.common.model.User;
+import com.goafanti.common.service.EngagedFieldGlossoryService;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.engagedFieldGlossory.service.EngagedFieldGlossoryService;
 import com.goafanti.lecture.bo.BigShotLectureListBo;
 import com.goafanti.lecture.service.LectureService;
 import com.goafanti.star.bo.BigShotStarListBo;

+ 3 - 3
src/main/java/com/goafanti/portal/controller/PortalMemberController.java

@@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.RestController;
 import com.alibaba.fastjson.JSON;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.memberGrade.bo.MemberGrade;
-import com.goafanti.memberGrade.bo.MemberGradeBO;
-import com.goafanti.memberGrade.service.MemberGradeService;
+import com.goafanti.member.bo.MemberGrade;
+import com.goafanti.member.bo.MemberGradeBO;
+import com.goafanti.member.service.MemberGradeService;
 /**
  * 不用登录查询
  * @author Administrator

+ 2 - 2
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -1,4 +1,4 @@
-package com.goafanti.news.controller;
+package com.goafanti.portal.controller;
 
 import java.util.List;
 
@@ -27,7 +27,7 @@ import com.goafanti.news.enums.NewsType;
 import com.goafanti.news.service.NewsService;
 
 @Controller
-public class NewsController extends BaseController {
+public class PortalNewsController extends BaseController {
 	@Resource
 	NewsService				newsService;
 	@Resource

+ 1 - 1
src/main/java/com/goafanti/portal/controller/PortalStarController.java

@@ -18,8 +18,8 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.Banners;
 import com.goafanti.common.model.User;
+import com.goafanti.common.service.EngagedFieldGlossoryService;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.engagedFieldGlossory.service.EngagedFieldGlossoryService;
 import com.goafanti.lecture.bo.LectureListBo;
 import com.goafanti.lecture.service.LectureService;
 import com.goafanti.star.bo.HotStarListBo;

+ 0 - 46
src/main/java/com/goafanti/residentIntegration/bo/ResidentIntegrationBo.java

@@ -1,46 +0,0 @@
-package com.goafanti.residentIntegration.bo;
-
-public class ResidentIntegrationBo {
-	private String id;/** 成果编号 **/
-	private String name;/** 成果名字 **/
-	private String maturity;/** 成熟度 **/
-	private String industry;/** 行业 **/
-	private String residenceCity;/** 所属城市 **/
-	private String ownerType;/** 所有人类型 **/
-	public String getName() {
-		return name;
-	}
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getMaturity() {
-		return maturity;
-	}
-	public void setMaturity(String maturity) {
-		this.maturity = maturity;
-	}
-	public String getIndustry() {
-		return industry;
-	}
-	public void setIndustry(String industry) {
-		this.industry = industry;
-	}
-	public String getResidenceCity() {
-		return residenceCity;
-	}
-	public void setResidenceCity(String residenceCity) {
-		this.residenceCity = residenceCity;
-	}
-	public String getOwnerType() {
-		return ownerType;
-	}
-	public void setOwnerType(String ownerType) {
-		this.ownerType = ownerType;
-	}
-}

+ 0 - 17
src/main/java/com/goafanti/residentIntegration/service/ResidentIntegrationService.java

@@ -1,17 +0,0 @@
-package com.goafanti.residentIntegration.service;
-
-import java.util.List;
-
-import com.goafanti.residentIntegration.bo.ResidentIntegrationBo;
-
-public interface ResidentIntegrationService {
-	
-	/** 查询军民融合成果 **/
-	List<ResidentIntegrationBo> selectJmrhAchievement();
-	
-	/** 查询军民融合技术 **/
-	List<ResidentIntegrationBo> selectJmrTechnology();
-	
-	/** 查询军民融合项目 **/
-	List<ResidentIntegrationBo> selectJmrProject();
-}

+ 0 - 33
src/main/java/com/goafanti/residentIntegration/service/impl/ResidentIntegrationServiceImpl.java

@@ -1,33 +0,0 @@
-package com.goafanti.residentIntegration.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.goafanti.common.dao.AchievementMapper;
-import com.goafanti.residentIntegration.bo.ResidentIntegrationBo;
-import com.goafanti.residentIntegration.service.ResidentIntegrationService;
-@Service
-public class ResidentIntegrationServiceImpl implements ResidentIntegrationService {
-	@Autowired
-	private AchievementMapper achievementMapper;
-	@Override
-	public List<ResidentIntegrationBo> selectJmrhAchievement() {
-		// TODO Auto-generated method stub
-		return achievementMapper.selectJmrhAchievement();
-	}
-
-	@Override
-	public List<ResidentIntegrationBo> selectJmrTechnology() {
-		// TODO Auto-generated method stub
-		return achievementMapper.selectJmrTechnology();
-	}
-
-	@Override
-	public List<ResidentIntegrationBo> selectJmrProject() {
-		// TODO Auto-generated method stub
-		return achievementMapper.selectJmrProject();
-	}
-
-}

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.star.controller;
 
 import java.util.List;
 

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

@@ -1,4 +1,4 @@
-package com.goafanti.admin.controller;
+package com.goafanti.techproject.controller;
 
 import java.text.ParseException;
 import java.util.Arrays;

+ 1 - 1
src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java

@@ -35,7 +35,7 @@ import com.goafanti.techproject.service.TechWebsiteService;
 
 @Controller
 @RequestMapping(value = "/api/user/techproject")
-public class TechProjectApiController extends CertifyApiController {
+public class UserTechProjectApiController extends CertifyApiController {
 	@Resource
 	private TechProjectService		techProjectService;
 	@Resource

+ 4 - 4
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -73,17 +73,17 @@ public class UserLoginController extends BaseController {
 	 * @param request
 	 * @return
 	 */
-	@RequestMapping(value = "/signin", method = RequestMethod.POST)
+	@RequestMapping(value = "/mLogin", method = RequestMethod.POST)
 	@ResponseBody
-	public Result signin(User user, Boolean remember, HttpServletRequest request) {
+	public Result mLogin(User user, Boolean remember, HttpServletRequest request) {
 		Result res = new Result();
 		JSONObject jo = (JSONObject) JSON.toJSON(TokenManager.login(user, remember));
-		SavedRequest sr = WebUtils.getAndClearSavedRequest(request);
 		UserBasicInfo ubi=userService.selectBaseInfo();
+		/*SavedRequest sr = WebUtils.getAndClearSavedRequest(request);
 		if (sr != null) {
 			jo.put("requestURI", sr.getRequestURI());
 			jo.put("queryString", sr.getQueryString());
-		}
+		}*/
 		jo.put("easemobName",ubi.getEasemobName());
 		jo.put("easemobPass",ubi.getEasemobPass());
 		res.setToken(SecurityUtils.getSubject().getSession().getId());

+ 1 - 3
src/main/java/com/goafanti/user/controller/UserPartnerApiController.java

@@ -76,9 +76,7 @@ public class UserPartnerApiController extends CertifyApiController {
 		}
 		res.setData(demandService.lisePartnerDemand(employerId, pNo, pSize));
 		return res;
-	}
-	
-	
+	}	
 
 	/**
 	 * "伙伴"主页--科技成果列表

+ 84 - 19
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -49,15 +49,16 @@ public class UserRegisterController extends BaseController {
 	@Resource
 	private EasemobUtils   easemobUtils;
 	Logger					logger	= Logger.getLogger(UserRegisterController.class);
+	
 	/**
-	 * 用户注册
+	 * 网站用户注册
 	 * 
 	 * @param user
 	 * @return
 	 */
 	@RequestMapping(value = "/register", method = RequestMethod.POST)
 	@ResponseBody
-	public Result register(@Valid InputUser user, String companyName, String contacts, String mobileCode,String uuid,
+	public Result register(@Valid InputUser user, String mobileCode,String uuid,
 			BindingResult bindingResult,HttpRequest req) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
@@ -79,8 +80,12 @@ public class UserRegisterController extends BaseController {
 					bindingResult.getFieldError().getField()));
 			return res;
 		}
-		if (StringUtils.isBlank(user.getMobile())) {
+		if(StringUtils.isBlank(user.getUsername())){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "用户名"));
+		}else if(null == user.getType()){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "用户类型"));
+		}else if (StringUtils.isBlank(user.getMobile())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "手机号码"));
 		} else if (StringUtils.isBlank(user.getPassword())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "密码"));
 		} else {
@@ -101,26 +106,87 @@ public class UserRegisterController extends BaseController {
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
 			us.setLvl(0);
-			us.setNickname(companyName);
+			us.setNickname(user.getUsername());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setIsMember(AFTConstants.NO);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
-			us.setIdentifyName(StringUtils.isBlank(companyName)?"":companyName);
+			us.setIdentifyName(StringUtils.isBlank(user.getUnitName())?"":user.getUnitName());
 			us.setLvl(UserLevel.GENERAL.getCode());
-			/*
-			List<Admin> admins = adminService.selectAllAdmin();
-			if (!admins.isEmpty()) {
-				Collections.shuffle(admins);
-				user.setAid(admins.get(0).getId());// 随机分配管理员
+			us.setAid("0");
+		}
+		return res;
+	}
+	
+	
+	/**
+	 * 网站用户注册
+	 * 
+	 * @param user
+	 * @return
+	 */
+	@RequestMapping(value = "/mRegister", method = RequestMethod.POST)
+	@ResponseBody
+	public Result mRegister(@Valid InputUser user, String mobileCode,String uuid,
+			BindingResult bindingResult,HttpRequest req) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		// 验证码15分钟有效
+		if (TimeUtils.checkOverTime("register")) {
+			res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "手机验证码超时失效"));
+			return res;
+		}
+		if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode.toLowerCase())) {
+			res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "手机验证码错误"));
+			return res;
+		}
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					bindingResult.getFieldError().getField()));
+			return res;
+		}
+		if(StringUtils.isBlank(user.getUsername())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "用户名"));
+		}else if(null == user.getType()){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "用户类型"));
+		}else if (StringUtils.isBlank(user.getMobile())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "手机号码"));
+		} else if (StringUtils.isBlank(user.getPassword())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定", "密码"));
+		} else {
+			User u = userService.selectByMobieAndType(user.getMobile().trim(), user.getType());
+			if (null != u) {
+					res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 			}
-			*/
-			us.setAid("2");//ID为"2"的管理员
-			userService.insertRegister(us,companyName,contacts);
-			User u1 = userService.selectByPrimaryKey(us.getId()); 			
-			registerEasemobAfterRegister(uuid,u1);//开通环信账号
 		}
-		
+		if (res.getError().isEmpty()) {
+			User us = new User();
+			us.setId(UUID.randomUUID().toString());
+			us.setMobile(user.getMobile().trim());
+			us.setType(user.getType());
+			us.setPassword(user.getPassword());
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			us.setCreateTime(now.getTime());
+			us.setUpdateTime(now.getTime());
+			us.setPassword(passwordUtil.getEncryptPwd(us));
+			us.setLvl(0);
+			us.setNickname(user.getUsername());
+			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
+			us.setIsMember(AFTConstants.NO);
+			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
+			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
+			us.setIdentifyName(StringUtils.isBlank(user.getUnitName())?"":user.getUnitName());
+			us.setLvl(UserLevel.GENERAL.getCode());
+			us.setAid("0");
+			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			User currentUser = userService.selectByPrimaryKey(us.getId()); 			
+			registerEasemobAfterRegister(uuid,currentUser);//开通环信账号
+		}
 		return res;
 	}
 	
@@ -131,10 +197,9 @@ public class UserRegisterController extends BaseController {
 			resultObj.put("password", easemobPass);
 			resultObj.put("username", easemobName);
 			resultObj.put("nickname", StringUtils.isBlank(u.getNickname()) ? "技淘用户" + u.getNumber() : u.getNickname());
-			easemobUtils.send(
+			easemobUtils.sendLater(
 					new EasemobInfo().uri("/users/").data(resultObj.toJSONString()).method(HttpMethod.POST));
 			//绑定账号
-			messageService.addJpushEasemobAccount(uuid,u.getId(),easemobName,easemobPass);
-			
+			messageService.addJpushEasemobAccount(uuid,u.getId(),easemobName,easemobPass);		
 	}
 }

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

@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.app.bo.UserBasicInfo;
 import com.goafanti.common.constant.AFTConstants;
@@ -57,13 +58,13 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	private OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 
 	@Override
-	public User insertRegister(User user, String unitName, String contacts) {
+	@Transactional
+	public User insertRegister(User user, String unitName, String userName) {
 		userMapper.insert(user);
 		if (null != user.getType() && UserType.ORGANIZATION.getCode().equals(user.getType())) {
 			OrganizationIdentity organizationIdentity = new OrganizationIdentity();
 			organizationIdentity.setUid(user.getId());
 			organizationIdentity.setUnitName(StringUtils.isBlank(unitName) ? "" : unitName);
-			organizationIdentity.setContacts(StringUtils.isBlank(contacts) ? "" : contacts);
 			organizationIdentity.setId(UUID.randomUUID().toString());
 			organizationIdentity.setIdentityType(0);
 			organizationIdentity.setAuditStatus(0);
@@ -73,7 +74,6 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 			organizationIdentity.setListedType(0);
 			organizationIdentityMapper.insert(organizationIdentity);
 		}
-
 		if (null != user.getType() && UserType.PERSONAL.getCode().equals(user.getType())) {
 			UserIdentity ui = new UserIdentity();
 			ui.setId(UUID.randomUUID().toString());
@@ -81,7 +81,7 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 			ui.setAuditStatus(0);
 			ui.setProcess(0);
 			ui.setWrongCount(0);
-			ui.setUsername(StringUtils.isBlank(unitName) ? "" : unitName);
+			ui.setUsername(StringUtils.isBlank(userName) ? "" : userName);
 			userIdentityMapper.insert(ui);
 		}