Browse Source

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

wubb 8 years ago
parent
commit
4f41265f5f

+ 1 - 1
schema/201707012-lecture.sql

@@ -1,6 +1,6 @@
 CREATE TABLE `lecture` (
   `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
-  `uid` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '开展讲座人ID',
+  `uid` VARCHAR(36) CHARACTER SET 'utf8mb4'  NULL COMMENT '开展讲座人ID',
   `lecture_time` DATETIME NOT NULL COMMENT '讲座开展时间',
   `create_time` DATETIME NULL COMMENT '记录创建时间',
   `last_update_time` DATETIME NULL COMMENT '记录最后更新时间',

+ 5 - 0
schema/data/permission.sql

@@ -510,3 +510,8 @@ insert into `permission`(`id`, `url`, `name`)
 values
 (UUID(), 'api/admin/cognizanceRecord/search', '高企信息管理--高企信息查询'),
 (UUID(), 'api/admin/cognizanceRecord/import', '高企信息管理--高企信息批量导入');
+
+insert into `permission`(`id`, `url`, `name`) 
+values
+(UUID(), 'api/admin/audit/modifyAchievementTechBroker', '科技成果技术经纪人流转(审核员)'),
+(UUID(), 'api/admin/audit/modifyDemandTechBroker', '科技需求技术经纪人流转(审核员)');

+ 2 - 0
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -66,5 +66,7 @@ public interface AchievementService {
 
 	List<AchievementPortalSimilarListBo> findByFieldA(Integer fieldA, String id, Integer type);
 
+	int updateByPrimaryKeySelective(Achievement a);
+
 
 }

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

@@ -590,4 +590,9 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		return null;
 	}
 
+	@Override
+	public int updateByPrimaryKeySelective(Achievement a) {
+		return achievementMapper.updateByPrimaryKey(a);
+	}
+
 }

+ 127 - 0
src/main/java/com/goafanti/activityUser/bo/ActivityUserListBo.java

@@ -0,0 +1,127 @@
+package com.goafanti.activityUser.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.model.ActivityUser;
+
+public class ActivityUserListBo extends ActivityUser {
+	private String	activityName;
+
+	private Integer	number;
+
+	private String	mobile;
+
+	private String	username;
+
+	private String	unitName;
+
+	private Date	startTime;
+
+	private Date	endTime;
+
+	private Date	enrollDeadline;
+
+	public String getActivityName() {
+		return activityName;
+	}
+
+	public void setActivityName(String activityName) {
+		this.activityName = activityName;
+	}
+
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
+	public Date getEnrollDeadline() {
+		return enrollDeadline;
+	}
+
+	public void setEnrollDeadline(Date enrollDeadline) {
+		this.enrollDeadline = enrollDeadline;
+	}
+
+	public String getStartTimeFormattedDate() {
+		if (this.startTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setCreateTimeFormattedDate(String startTimeFormattedDate) {
+
+	}
+
+	public String getEndTimeFormattedDate() {
+		if (this.endTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
+
+	}
+	
+	public String getEnrollDeadlineFormattedDate() {
+		if (this.enrollDeadline == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
+
+	}
+
+}

+ 12 - 0
src/main/java/com/goafanti/activityUser/service/ActivityUserService.java

@@ -1,6 +1,10 @@
 package com.goafanti.activityUser.service;
 
+import java.util.List;
+
+import com.goafanti.activityUser.bo.ActivityUserListBo;
 import com.goafanti.common.model.ActivityUser;
+import com.goafanti.core.mybatis.page.Pagination;
 
 public interface ActivityUserService {
 
@@ -10,4 +14,12 @@ public interface ActivityUserService {
 
 	int update(ActivityUser au);
 
+	Pagination<ActivityUserListBo> listActivityUser(String activityName, String mobile, String username, Integer number,
+			Integer pageSize, Integer pageNo);
+
+	Pagination<ActivityUserListBo> listActivityOrg(String activityName, String mobile, String unitName, Integer number,
+			Integer pSize, Integer pNo);
+
+	int batchDeleteByPrimaryKey(List<String> asList);
+
 }

+ 74 - 2
src/main/java/com/goafanti/activityUser/service/impl/ActivityUserServiceImpl.java

@@ -1,19 +1,28 @@
 package com.goafanti.activityUser.service.impl;
 
 import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.activityUser.bo.ActivityUserListBo;
 import com.goafanti.activityUser.service.ActivityUserService;
 import com.goafanti.common.dao.ActivityUserMapper;
 import com.goafanti.common.model.ActivityUser;
+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;
+
 @Service
-public class ActivityUserServiceImpl implements ActivityUserService {
-	
+public class ActivityUserServiceImpl extends BaseMybatisDao<ActivityUserMapper> implements ActivityUserService {
+
 	@Autowired
 	private ActivityUserMapper activityUserMapper;
+
 	@Override
 	public ActivityUser selectByUid(String uid) {
 		return activityUserMapper.selectByUid(uid);
@@ -39,4 +48,67 @@ public class ActivityUserServiceImpl implements ActivityUserService {
 		return activityUserMapper.updateByPrimaryKey(au);
 	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<ActivityUserListBo> listActivityUser(String activityName, String mobile, String username,
+			Integer number, Integer pSize, Integer pNo) {
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+
+		return (Pagination<ActivityUserListBo>) findPage("findActivityUserListByPage", "findActivityUserCount",
+				disposeActivityList(activityName, mobile, number, username, null), pNo, pSize);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<ActivityUserListBo> listActivityOrg(String activityName, String mobile, String unitName,
+			Integer number, Integer pSize, Integer pNo) {
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<ActivityUserListBo>) findPage("findActivityOrgListByPage", "findActivityOrgCount",
+				disposeActivityList(activityName, mobile, number, null, unitName), pNo, pSize);
+	}
+
+	private Map<String, Object> disposeActivityList(String activityName, String mobile, Integer number, String username,
+			String unitName) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (StringUtils.isNotBlank(mobile)) {
+			params.put("mobile", mobile);
+		}
+
+		if (null != number) {
+			params.put("number", number);
+		}
+
+		if (StringUtils.isNotBlank(activityName)) {
+			params.put("activityName", activityName);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("username", username);
+		}
+		
+		if (StringUtils.isNotBlank(unitName)){
+			params.put("unitName", unitName);
+		}
+		return params;
+	}
+
+	@Override
+	public int batchDeleteByPrimaryKey(List<String> id) {
+		return activityUserMapper.batchDeleteByPrimaryKey(id);
+	}
+
 }

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

@@ -37,6 +37,15 @@ public class AdminActivityApiController extends BaseApiController {
 	private ActivityService	activityService;
 	@Autowired
 	JDBCIdGenerator			idGenerator;
+	
+	/**
+	 * 活动报名列表
+	 */
+	@RequestMapping(value = "/signUpList", method = RequestMethod.GET)
+	public Result signUpList(){
+		Result res = new Result();
+		return res;
+	}
 
 	/**
 	 * 活动列表
@@ -171,6 +180,8 @@ public class AdminActivityApiController extends BaseApiController {
 		}
 		return res;
 	}
+	
+	
 
 	private Result disposeInputActivity(Result res, InputActivity ia, String startTimeFormattedDate) {
 		if (StringUtils.isBlank(ia.getName())) {

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

@@ -0,0 +1,75 @@
+package com.goafanti.admin.controller;
+
+import java.util.Arrays;
+
+import javax.annotation.Resource;
+
+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.activityUser.service.ActivityUserService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.utils.StringUtils;
+
+@RestController
+@RequestMapping(value = "/api/admin/activityUser")
+public class AdminActivityUserApiController extends BaseApiController {
+	@Resource
+	private ActivityUserService activityUserService;
+
+	/**
+	 * 活动圈个人用户报名列表
+	 */
+	@RequestMapping(value = "/userList", method = RequestMethod.GET)
+	public Result activityUserList(String activityName, String mobile, String username, Integer number, String pageSize,
+			String pageNo) {
+		Result res = new Result();
+		res.setData(activityUserService.listActivityUser(activityName, mobile, username, number, getPSize(pageSize), getPNo(pageNo)));
+		return res;
+	}
+
+	/**
+	 * 活动圈组织用户报名列表
+	 */
+	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
+	public Result activityOrgList(String activityName, String mobile, String unitName, Integer number, String pageSize,
+			String pageNo) {
+		Result res = new Result();
+		res.setData(activityUserService.listActivityOrg(activityName, mobile, unitName, number, getPSize(pageSize), getPNo(pageNo)));
+		return res;
+	}
+	
+	/**
+	 * 批量删除活动报名记录
+	 */
+	@RequestMapping(value = "/delete", method = RequestMethod.POST)
+	public Result delete(@RequestParam(name = "ids[]", required = false) String[] ids) {
+		Result res = new Result();
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+		} else {
+			res.setData(activityUserService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		return res;
+	}
+
+	private Integer getPNo(String pageNo) {
+		Integer pNo = 1;
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		return pNo;
+	}
+
+	private Integer getPSize(String pageSize) {
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		return pSize;
+	}
+}

+ 64 - 0
src/main/java/com/goafanti/admin/controller/AdminAuditApiController.java

@@ -27,6 +27,70 @@ public class AdminAuditApiController extends CertifyApiController {
 	private DemandService		demandService;
 	@Resource
 	private AchievementService	achievementService;
+	
+	/**
+	 * 科技成果技术经纪人流转
+	 */
+	@RequestMapping(value = "/modifyAchievementTechBroker", method = RequestMethod.POST)
+	public Result modifyAchievementTechBroker(String id, String techBrokerId){
+		Result res =new Result();
+		if (StringUtils.isBlank(id)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "科技成果ID"));
+			return res;
+		}
+		
+		if(StringUtils.isBlank(techBrokerId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "技术经纪人ID"));
+			return res;
+		}
+		
+		Achievement a = achievementService.selectByPrimaryKey(id);
+		if (null == a){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+		
+		if (!AchievementAuditStatus.AUDITED.getCode().equals(a.getAuditStatus())){
+			res.getError().add(buildError("", "当前状态无法更改技术经纪人!"));
+			return res;
+		}
+		
+		
+		a.setTechBrokerId(techBrokerId);
+		res.setData(achievementService.updateByPrimaryKeySelective(a));
+		return res;
+	}
+	
+	/**
+	 * 科技需求技术经纪人流转
+	 */
+	@RequestMapping(value = "/modifyDemandTechBroker", method = RequestMethod.POST)
+	public Result modifyDemandTechBroker(String id, String techBrokerId){
+		Result res =new Result();
+		if (StringUtils.isBlank(id)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "科技需求ID"));
+			return res;
+		}
+		
+		if(StringUtils.isBlank(techBrokerId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "技术经纪人ID"));
+			return res;
+		}
+		
+		Demand d = demandService.selectByPrimaryKey(id);
+		if (null == d){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技需求ID"));
+			return res;
+		}
+		
+		if (!DemandAuditStatus.AUDITED.getCode().equals(d.getAuditStatus())){
+			res.getError().add(buildError("", "当前状态无法更改技术经纪人!"));
+			return res;
+		}
+		d.setTechBrokerId(techBrokerId);
+		res.setData(demandService.updateByPrimaryKeySelective(d));
+		return res;
+	}
 
 	/**
 	 * 获取技术经纪人下拉

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

@@ -216,10 +216,10 @@ public class AdminLectureApiController extends BaseApiController {
 
 	private Result disposeLecture(Result res, InputLecture il, String lectureTimeFormattedDate,
 			String endTimeFormattedDate) {
-		if (StringUtils.isBlank(il.getUid())) {
+		/*if (StringUtils.isBlank(il.getUid())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展人ID"));
 			return res;
-		}
+		}*/
 
 		if (StringUtils.isBlank(il.getName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂名称"));

+ 51 - 50
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -2,103 +2,104 @@ package com.goafanti.common.constant;
 
 public class ErrorConstants {
 
-	public static final String	NON_LOGIN						= "NON_LOGIN";
+	public static final String	NON_LOGIN							= "NON_LOGIN";
 
-	public static final String	VCODE_ERROR						= "VCODE_ERROR";
+	public static final String	VCODE_ERROR							= "VCODE_ERROR";
 
-	public static final String	NO_AUTH_ERROR					= "NO_AUTH_ERROR";
+	public static final String	NO_AUTH_ERROR						= "NO_AUTH_ERROR";
 
-	public static final String	PARAM_ERROR						= "PARAM_ERROR";
+	public static final String	PARAM_ERROR							= "PARAM_ERROR";
 
-	public static final String	PARAM_INTEGER_ERROR				= "PARAM_INTEGER_ERROR";
+	public static final String	PARAM_INTEGER_ERROR					= "PARAM_INTEGER_ERROR";
 
-	public static final String	PARAM_EMPTY_ERROR				= "PARAM_EMPTY_ERROR";
+	public static final String	PARAM_EMPTY_ERROR					= "PARAM_EMPTY_ERROR";
 
-	public static final String	PARAM_SIZE_ERROR				= "PARAM_SIZE_ERROR";
+	public static final String	PARAM_SIZE_ERROR					= "PARAM_SIZE_ERROR";
 
-	public static final String	PARAM_PATTERN_ERROR				= "PARAM_PATTERN_ERROR";
+	public static final String	PARAM_PATTERN_ERROR					= "PARAM_PATTERN_ERROR";
 
-	public static final String	EMAIL_SIZE_ERROR				= "EMAIL_SIZE_ERROR";
+	public static final String	EMAIL_SIZE_ERROR					= "EMAIL_SIZE_ERROR";
 
-	public static final String	EMAIL_PATTERN_ERROR				= "EMAIL_PATTERN_ERROR";
+	public static final String	EMAIL_PATTERN_ERROR					= "EMAIL_PATTERN_ERROR";
 
-	public static final String	DUNPLICATE_KAY_ERROR			= "DUNPLICATE_KAY_ERROR";
+	public static final String	DUNPLICATE_KAY_ERROR				= "DUNPLICATE_KAY_ERROR";
 
-	public static final String	DATA_EMPTY_ERROR				= "DATA_EMPTY_ERROR";
+	public static final String	DATA_EMPTY_ERROR					= "DATA_EMPTY_ERROR";
 
-	public static final String	PWD_NOT_MATCH_ERROR				= "PWD_NOT_MATCH_ERROR";
+	public static final String	PWD_NOT_MATCH_ERROR					= "PWD_NOT_MATCH_ERROR";
 
-	public static final String	PWD_SAME_ERROR					= "PWD_SAME_ERROR";
+	public static final String	PWD_SAME_ERROR						= "PWD_SAME_ERROR";
 
-	public static final String	USER_ALREADY_EXIST				= "USER_ALREADY_EXIST";
+	public static final String	USER_ALREADY_EXIST					= "USER_ALREADY_EXIST";
 
-	public static final String	MOBILE_PATTERN_ERROR			= "MOBILE_PATTERN_ERROR";
+	public static final String	MOBILE_PATTERN_ERROR				= "MOBILE_PATTERN_ERROR";
 
-	public static final String	MOBILE_SIZE_ERROR				= "MOBILE_SIZE_ERROR";
+	public static final String	MOBILE_SIZE_ERROR					= "MOBILE_SIZE_ERROR";
 
-	public static final String	MOBILE_SAME_ERROR				= "MOBILE_SAME_ERROR";
+	public static final String	MOBILE_SAME_ERROR					= "MOBILE_SAME_ERROR";
 
-	public static final String	MOBILE_EMPTY_ERROR				= "MOBILE_EMPTY_ERROR";
+	public static final String	MOBILE_EMPTY_ERROR					= "MOBILE_EMPTY_ERROR";
 
-	public static final String	IDNUMBER_SIZE_ERROR				= "IDNUMBER_SIZE_ERROR";
+	public static final String	IDNUMBER_SIZE_ERROR					= "IDNUMBER_SIZE_ERROR";
 
-	public static final String	IDNUMBER_PATTERN_ERROR			= "IDNUMBER_PATTERN_ERROR";
+	public static final String	IDNUMBER_PATTERN_ERROR				= "IDNUMBER_PATTERN_ERROR";
 
-	public static final String	MCODE_ERROR						= "MCODE_ERROR";
+	public static final String	MCODE_ERROR							= "MCODE_ERROR";
 
-	public static final String	MCODE_OVERTIME_ERROR			= "MCODE_OVERTIME_ERROR";
+	public static final String	MCODE_OVERTIME_ERROR				= "MCODE_OVERTIME_ERROR";
 
-	public static final String	NON_REGISTER					= "NON_REGISTER";
+	public static final String	NON_REGISTER						= "NON_REGISTER";
 
-	public static final String	RESET_CODE_ERROR				= "RESET_CODE_ERROR";
+	public static final String	RESET_CODE_ERROR					= "RESET_CODE_ERROR";
 
-	public static final String	RESET_CODE_OVERTIME				= "RESET_CODE_OVERTIME";
+	public static final String	RESET_CODE_OVERTIME					= "RESET_CODE_OVERTIME";
 
-	public static final String	FILE_NON_EXISTENT				= "FILE_NON_EXISTENT";
+	public static final String	FILE_NON_EXISTENT					= "FILE_NON_EXISTENT";
 
-	public static final String	INSUFFICIENT_AUTHORITY_ERROR	= "INSUFFICIENT_AUTHORITY_ERROR";
+	public static final String	INSUFFICIENT_AUTHORITY_ERROR		= "INSUFFICIENT_AUTHORITY_ERROR";
 
-	public static final String	NON_CERTIFIED					= "NON_CERTIFIED";
+	public static final String	NON_CERTIFIED						= "NON_CERTIFIED";
 
-	public static final String	DUPLICATE_DATA_ERROR			= "DUPLICATE_DATA_ERROR";
+	public static final String	DUPLICATE_DATA_ERROR				= "DUPLICATE_DATA_ERROR";
 
-	public static final String	FILE_PATTERN_ERROR				= "FILE_PATTERN_ERROR";
+	public static final String	FILE_PATTERN_ERROR					= "FILE_PATTERN_ERROR";
 
-	public static final String	RECORD_CALLBACK					= "RECORD_CALLBACK";
+	public static final String	RECORD_CALLBACK						= "RECORD_CALLBACK";
 
-	public static final String	RECORD_SETTLEMENT				= "RECORD_SETTLEMENT";
+	public static final String	RECORD_SETTLEMENT					= "RECORD_SETTLEMENT";
 
-	public static final String	STATUS_ERROR					= "STATUS_ERROR";
+	public static final String	STATUS_ERROR						= "STATUS_ERROR";
 
-	public static final String	CONTRACT_PATENT_CREATED			= "CONTRACT_PATENT_CREATED";
+	public static final String	CONTRACT_PATENT_CREATED				= "CONTRACT_PATENT_CREATED";
 
-	public static final String	CONTRACT_COPYRIGHT_CREATED		= "CONTRACT_COPYRIGHT_CREATED";
+	public static final String	CONTRACT_COPYRIGHT_CREATED			= "CONTRACT_COPYRIGHT_CREATED";
 
-	public static final String	CONTRACT_TECHPROJECT_CREATED	= "CONTRACT_TECHPROJECT_CREATED";
+	public static final String	CONTRACT_TECHPROJECT_CREATED		= "CONTRACT_TECHPROJECT_CREATED";
 
-	public static final String	CONTRACT_COGNIZANCE_CREATED		= "CONTRACT_COGNIZANCE_CREATED";
+	public static final String	CONTRACT_COGNIZANCE_CREATED			= "CONTRACT_COGNIZANCE_CREATED";
 
-	public static final String	RECORD_REJECT					= "RECORD_REJECT";
+	public static final String	RECORD_REJECT						= "RECORD_REJECT";
 
-	public static final String	EVALUATE_ID						= "EVALUATE_ID";
+	public static final String	EVALUATE_ID							= "EVALUATE_ID";
 
-	public static final String	EVALUATE_STEP					= "EVALUATE_STEP";
+	public static final String	EVALUATE_STEP						= "EVALUATE_STEP";
 
-	public static final String	EVALUATE_PARAM					= "EVALUATE_PARAM";
+	public static final String	EVALUATE_PARAM						= "EVALUATE_PARAM";
 
-	public static final String	CONTRACT_YEAR_SECTION			= "CONTRACT_YEAR_SECTION";
+	public static final String	CONTRACT_YEAR_SECTION				= "CONTRACT_YEAR_SECTION";
 
-	public static final String	VCODE_EMPTY_ERROR				= "VCODE_EMPTY_ERROR";
+	public static final String	VCODE_EMPTY_ERROR					= "VCODE_EMPTY_ERROR";
 
-	public static final String	MCODE_FREQUENCY_ERROR			= "MCODE_FREQUENCY_ERROR";
+	public static final String	MCODE_FREQUENCY_ERROR				= "MCODE_FREQUENCY_ERROR";
 
-	public static final String	MCODE_EMPTY_ERROR				= "MCODE_EMPTY_ERROR";
+	public static final String	MCODE_EMPTY_ERROR					= "MCODE_EMPTY_ERROR";
 
-	public static final String	IDENTITY_PAY_OVER_TIME			= "IDENTITY_PAY_OVER_TIME";
+	public static final String	IDENTITY_PAY_OVER_TIME				= "IDENTITY_PAY_OVER_TIME";
 
-	public static final String	OVER_MAX_WRONG_COUNT			= "OVER_MAX_WRONG_COUNT";
+	public static final String	OVER_MAX_WRONG_COUNT				= "OVER_MAX_WRONG_COUNT";
 
-	public static final String	WRONG_MONEY						= "WRONG_MONEY";
+	public static final String	WRONG_MONEY							= "WRONG_MONEY";
+
+	public static final String	M_CODE_ERROR						= "M_CODE_ERROR";
 
-	public static final String	M_CODE_ERROR					= "M_CODE_ERROR";
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/ActivityUserMapper.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 
+import java.util.List;
+
 import com.goafanti.common.model.ActivityUser;
 import com.goafanti.common.model.ActivityUserKey;
 
@@ -17,4 +19,6 @@ public interface ActivityUserMapper {
     int updateByPrimaryKey(ActivityUser record);
 
 	ActivityUser selectByUid(String uid);
+
+	int batchDeleteByPrimaryKey(List<String> id);
 }

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

@@ -1060,7 +1060,7 @@
   	and a.audit_status = 3
   	order by a.release_date desc
   	<if test="page_sql!=null">
-			${page_sql}
+		${page_sql}
 	</if>
   </select>
   

+ 126 - 0
src/main/java/com/goafanti/common/mapper/ActivityUserMapper.xml

@@ -86,4 +86,130 @@
     from activity_user
     where  uid = #{uid,jdbcType=VARCHAR}
   </select>
+  
+  <select id="findActivityUserListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
+  	select
+  		au.aid,
+  		au.uid,
+  		au.create_time as createTime,
+  		au.last_update_time as lastUpdateTime,
+  		a.name as activityName,
+  		u.number,
+  		u.mobile,
+  		ui.username,
+  		a.start_time as startTime,
+  		a.end_time as endTime,
+  		a.enroll_deadline as enrollDeadline
+  	from activity_user au
+  	left join user u on u.id = au.uid
+  	left join user_identity ui on ui.uid = au.uid
+  	left join activity a on a.id = au.aid
+  	where u.type = 0 
+  	<if test="mobile != null">
+  		and u.mobile = #{mobile,jdbcType=VARCHAR}
+  	</if>
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="activityName != null">
+  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="username != null">
+  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
+  	</if>
+  	order by au.last_update_time desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findActivityUserCount" parameterType="String" resultType="java.lang.Integer">
+  	select
+  		count(1)
+  	from activity_user au
+  	left join user u on u.id = au.uid
+  	left join user_identity ui on ui.uid = au.uid
+  	left join activity a on a.id = au.aid
+  	where u.type = 0 
+  	<if test="mobile != null">
+  		and u.mobile = #{mobile,jdbcType=VARCHAR}
+  	</if>
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="activityName != null">
+  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="username != null">
+  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
+  	</if>
+  </select>
+  
+  <select id="findActivityOrgListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
+  	select
+  		au.aid,
+  		au.uid,
+  		au.create_time as createTime,
+  		au.last_update_time as lastUpdateTime,
+  		a.name as activityName,
+  		u.number,
+  		u.mobile,
+  		oi.unit_name as unitName,
+  		a.start_time as startTime,
+  		a.end_time as endTime,
+  		a.enroll_deadline as enrollDeadline
+  	from activity_user au
+  	left join user u on u.id = au.uid
+  	left join organization_identity oi on oi.uid = au.uid
+  	left join activity a on a.id = au.aid
+  	where u.type = 1 
+  	<if test="mobile != null">
+  		and u.mobile = #{mobile,jdbcType=VARCHAR}
+  	</if>
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="activityName != null">
+  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="unitName != null">
+  		and ui.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+  	</if>
+  	order by au.last_update_time desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findActivityOrgCount" parameterType="String" resultType="java.lang.Integer">
+  	select
+  		count(1)
+  	from activity_user au
+  	left join user u on u.id = au.uid
+  	left join organization_identity oi on oi.uid = au.uid
+  	left join activity a on a.id = au.aid
+  	where u.type = 1 
+  	<if test="mobile != null">
+  		and u.mobile = #{mobile,jdbcType=VARCHAR}
+  	</if>
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="activityName != null">
+  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="unitName != null">
+  		and ui.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
+  	</if>
+  </select>
+  
+  <delete id="batchDeleteByPrimaryKey" parameterType="java.util.List">
+  	delete
+  		from activity_user
+  	where id in
+  	<foreach item="item" index="index" collection="list" open="("
+			separator="," close=")">
+			#{item}
+	</foreach>
+  </delete>
 </mapper>

+ 28 - 28
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -481,18 +481,18 @@
 	from  demand d 
 	LEFT JOIN user_identity ui on d.employer_id = ui.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="mid != null">
+	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
 	where d.deleted_sign = 0 and d.data_category = 0 
-	<if test="mid != null">
-		and u.mid = #{mid,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		and u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="principal != null">
-		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="techBroker != null">
-		and  d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 	</if>
 	<if test="province != null">
 		and  ui.province = #{province,jdbcType=INTEGER}
@@ -551,18 +551,18 @@
 	from  demand d 
 	LEFT JOIN user_identity ui on d.employer_id = ui.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="mid != null">
+	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
 	where d.deleted_sign = 0 and d.data_category = 0 
-	<if test="mid != null">
-		and u.mid = #{mid,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		and u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="principal != null">
-		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="techBroker != null">
-		and  d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 	</if>
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
@@ -623,18 +623,18 @@
 	from  demand d 
 	LEFT JOIN organization_identity oi on d.employer_id = oi.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="mid != null">
+	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
 	where d.deleted_sign = 0 and d.data_category = 1 
-	<if test="mid != null">
-		and u.mid = #{mid,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		and u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="principal != null">
-		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="techBroker != null">
-		and  d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 	</if>
 	<if test="province != null">
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
@@ -693,18 +693,18 @@
 	from  demand d 
 	LEFT JOIN organization_identity oi on d.employer_id = oi.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="mid != null">
+	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
 	where d.deleted_sign = 0 and d.data_category = 1
-	<if test="mid != null">
-		and u.mid = #{mid,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		and u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="principal != null">
-		and  d.principal_id = #{principal,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
 	</if>
-	<if test="techBroker != null">
-		and  d.tech_broker_id = #{techBroker,jdbcType=VARCHAR}
+	<if test="adminId != null">
+		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 	</if>
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}

+ 28 - 0
src/main/java/com/goafanti/common/model/ActivityUser.java

@@ -2,6 +2,10 @@ package com.goafanti.common.model;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class ActivityUser extends ActivityUserKey {
     /**
     * 报名时间
@@ -28,4 +32,28 @@ public class ActivityUser extends ActivityUserKey {
     public void setLastUpdateTime(Date lastUpdateTime) {
         this.lastUpdateTime = lastUpdateTime;
     }
+    
+    public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.createTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+    
+    public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+    
+    public String getLastUpdateTimeFormattedDate() {
+		if (this.lastUpdateTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.lastUpdateTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+    
+    public void setLastUpdateTimeFormattedDate(String lastUpdateTimeFormattedDate) {
+
+	}
 }

+ 2 - 0
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -70,6 +70,8 @@ public interface DemandService {
 
 	List<DemandPortalSimilarListBo> findByIndustryCategoryA(Integer industryCategoryA, String id);
 
+	int updateByPrimaryKeySelective(Demand d);
+
 
 
 }

+ 47 - 31
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -85,10 +85,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandManageListBo> selectUserDemandManageList(String employerName, Integer auditStatus, Integer province,
-			Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
-			String validityPeriodStartDate, String validityPeriodEndDate, String username, Integer status,
-			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize) {
+	public Pagination<DemandManageListBo> selectUserDemandManageList(String employerName, Integer auditStatus,
+			Integer province, Integer serialNumber, String name, String keyword, Integer infoSources,
+			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
+			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
+			Integer pSize) {
 
 		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
 				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
@@ -102,23 +103,27 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			pSize = 10;
 		}
 
-		if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) || TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
-			params.put("principal", TokenManager.getAdminId());
-		}
+		/*
+		 * if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) ||
+		 * TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
+		 * params.put("principal", TokenManager.getAdminId()); }
+		 * 
+		 * if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)) {
+		 * params.put("mid", TokenManager.getAdminId()); }
+		 * 
+		 * if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
+		 * params.put("techBroker", TokenManager.getAdminId()); }
+		 */
 
-		if (TokenManager.hasRole(AFTConstants.MANAGERADMIN)) {
-			params.put("mid", TokenManager.getAdminId());
-		}
-
-		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
-			params.put("techBroker", TokenManager.getAdminId());
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
 		}
 		
-		if (StringUtils.isNotBlank(employerName)){
+		if (StringUtils.isNotBlank(employerName)) {
 			params.put("employerName", employerName);
 		}
-		
-		if (StringUtils.isNotBlank(username)){
+
+		if (StringUtils.isNotBlank(username)) {
 			params.put("username", username);
 		}
 
@@ -129,10 +134,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandManageListBo> selectOrgDemandManageList(String employerName, Integer auditStatus, Integer province,
-			Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
-			String validityPeriodStartDate, String validityPeriodEndDate, String username, Integer status,
-			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize) {
+	public Pagination<DemandManageListBo> selectOrgDemandManageList(String employerName, Integer auditStatus,
+			Integer province, Integer serialNumber, String name, String keyword, Integer infoSources,
+			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
+			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
+			Integer pSize) {
 		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
 				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
 				releaseDateStartDate, releaseDateEndDate);
@@ -145,7 +151,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			pSize = 10;
 		}
 
-		if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) || TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
+		/*if (TokenManager.hasRole(AFTConstants.SALESMANAGERADMIN) || TokenManager.hasRole(AFTConstants.SALESMANADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 		}
 
@@ -155,13 +161,17 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
 			params.put("techBroker", TokenManager.getAdminId());
-		}
+		}*/
 		
-		if (StringUtils.isNotBlank(employerName)){
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
+		}
+
+		if (StringUtils.isNotBlank(employerName)) {
 			params.put("employerName", employerName);
 		}
-		
-		if (StringUtils.isNotBlank(username)){
+
+		if (StringUtils.isNotBlank(username)) {
 			params.put("unitName", username);
 		}
 
@@ -314,12 +324,12 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			d.setReleaseDate(now.getTime());
 			d.setReleaseStatus(DemandReleaseStatus.RELEASED.getCode());
 			d.setTechBrokerId(techBroderId);
-			
-			if (StringUtils.isNotBlank(d.getKeyword())){
+
+			if (StringUtils.isNotBlank(d.getKeyword())) {
 				String[] keywords = d.getKeyword().trim().split(",|,");
 				disposeDemandKeyword(keywords, d, false);
 			}
-			
+
 			String employerId = d.getEmployerId();
 			if (StringUtils.isNotBlank(employerId)) {
 				if (UserType.PERSONAL.getCode().equals(d.getDataCategory())) {
@@ -553,9 +563,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			params.put("keyword", keyword);
 		}
 
-		/*if (!StringUtils.isBlank(username)) {
-			params.put("username", username);
-		}*/
+		/*
+		 * if (!StringUtils.isBlank(username)) { params.put("username",
+		 * username); }
+		 */
 
 		if (null != infoSources) {
 			params.put("infoSources", infoSources);
@@ -706,4 +717,9 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		return demandMapper.findByIndustryCategoryA(industryCategoryA, id);
 	}
 
+	@Override
+	public int updateByPrimaryKeySelective(Demand d) {
+		return demandMapper.updateByPrimaryKeySelective(d);
+	}
+
 }