Antiloveg hace 8 años
padre
commit
aeb4954acd
Se han modificado 18 ficheros con 461 adiciones y 378 borrados
  1. 3 0
      schema/2017-04-04.sql
  2. 66 89
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 7 0
      src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java
  4. 154 142
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  5. 31 25
      src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java
  6. 9 0
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  7. 18 13
      src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java
  8. 11 8
      src/main/java/com/goafanti/common/enums/CopyrightStatus.java
  9. 24 12
      src/main/java/com/goafanti/common/mapper/OrgTechCenterDetailMapper.xml
  10. 1 1
      src/main/java/com/goafanti/common/mapper/PermissionMapper.xml
  11. 42 13
      src/main/java/com/goafanti/common/model/OrgTechCenterDetail.java
  12. 12 1
      src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java
  13. 16 11
      src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java
  14. 4 8
      src/main/java/com/goafanti/patent/controller/PatentApiController.java
  15. 20 14
      src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java
  16. 21 24
      src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java
  17. 19 14
      src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java
  18. 3 3
      src/main/java/com/goafanti/user/controller/UserRegisterController.java

+ 3 - 0
schema/2017-04-04.sql

@@ -0,0 +1,3 @@
+alter table `org_tech_center_detail` 
+CHANGE COLUMN `term_time`  `term_start_time` DATETIME NULL COMMENT '期限开始时间' ,
+add COLUMN `term_end_time` DATETIME NULL COMMENT '期限结束时间' after `term_start_time`;

+ 66 - 89
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -163,6 +163,27 @@ public class AdminApiController extends CertifyApiController {
 	@Resource
 	private OrgTechCenterDetailService		orgTechCenterDetailService;
 	
+	
+	
+	/**
+	 * 管理员本人信息详情
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/adminInfo", method = RequestMethod.GET)
+	public Result adminInfo(){
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
+			return res;
+		}
+		res.setData(adminService.selectByPrimaryKey(TokenManager.getAdminId()));
+		return res;
+	}
+	
 	/**
 	 * 管理员修改本人信息
 	 * @param admin
@@ -233,27 +254,6 @@ public class AdminApiController extends CertifyApiController {
 	
 	
 	/**
-	 * 管理员本人信息详情
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/adminInfo", method = RequestMethod.GET)
-	public Result adminInfo(){
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
-			return res;
-		}
-		res.setData(adminService.selectByPrimaryKey(TokenManager.getAdminId()));
-		return res;
-	}
-	
-	
-
-	/**
 	 * 管理员列表
 	 * 
 	 * @param province
@@ -282,6 +282,10 @@ public class AdminApiController extends CertifyApiController {
 		res.setData(adminService.listAdmin(province, number, mobile, name, pNo, pSize));
 		return res;
 	}
+	
+	
+
+	
 
 	/**
 	 * 新增管理员
@@ -444,40 +448,6 @@ public class AdminApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 个人用户列表
-	 * 
-	 * @param mobile
-	 * @param email
-	 * @param createTime
-	 * @param number
-	 * @param auditStatus
-	 * @param pageNo
-	 * @param pageSize
-	 * @return
-	 * @throws ParseException
-	 */
-	@RequestMapping(value = "/userList", method = RequestMethod.POST)
-	public Result userList(String mobile, String email,
-			@RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
-			String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
-		return res;
-	}
-
-
-	/**
 	 * 新增用户
 	 * 
 	 * @param mobile
@@ -524,7 +494,39 @@ public class AdminApiController extends CertifyApiController {
 	}
 
 	
-	
+	/**
+	 * 个人用户列表
+	 * 
+	 * @param mobile
+	 * @param email
+	 * @param createTime
+	 * @param number
+	 * @param auditStatus
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/userList", method = RequestMethod.POST)
+	public Result userList(String mobile, String email,
+			@RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
+			String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
+		return res;
+	}
+
 	/**
 	 * 个人用户信息明细
 	 * 
@@ -552,7 +554,7 @@ public class AdminApiController extends CertifyApiController {
 	 * @return
 	 * @throws ParseException
 	 */
-	@RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
+	@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
 	public Result updateUserDetail(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
 			String paymentDateFormattedDate) {
 		Result res = new Result();
@@ -967,7 +969,7 @@ public class AdminApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 删除选中标准制定情况记录
+	 * 删除标准制定情况记录
 	 * 
 	 * @param id
 	 *            记录id
@@ -1301,7 +1303,7 @@ public class AdminApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 删除选中上年度高新技术产品(服务)情况记录
+	 * 删除上年度高新技术产品(服务)情况记录
 	 * 
 	 * @param ids
 	 * @return
@@ -1656,7 +1658,7 @@ public class AdminApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 删除企业年度研究开发费用结构明细
+	 * 删除企业年度研究开发费用结构明细记录
 	 * 
 	 * @param ids
 	 * @return
@@ -2043,7 +2045,7 @@ public class AdminApiController extends CertifyApiController {
 
 	
 	/**
-	 * 科技成果转化情况列表入口
+	 * 科技成果转化情况列表
 	 * 
 	 * @param pageNo
 	 * @param pageSize
@@ -2202,7 +2204,7 @@ public class AdminApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 企业荣誉及其他证明材料列表入口
+	 * 企业荣誉及其他证明材料列表
 	 * 
 	 * @return
 	 */
@@ -2501,7 +2503,7 @@ public class AdminApiController extends CertifyApiController {
 
 
 	/**
-	 * 技术中心明细入口
+	 * 产学研情况列表
 	 * 
 	 * @return
 	 */
@@ -2530,7 +2532,7 @@ public class AdminApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 技术中心明细新增+修改(管理+用户)
+	 * 产学研情况新增+修改
 	 * 
 	 * @param orgTechCenterDetail
 	 * @param projectTimeFormattedDate
@@ -3105,31 +3107,6 @@ public class AdminApiController extends CertifyApiController {
 		res.setData(orgCognizanceService.listCultivation(uid, province, unitName, pNo, pSize));
 		return res;
 	}
-
-
-	
-	
-
-	
-
-	
-	
-
-	
-
-	
-
-	
-
-	
-	
-
-	
-
-	
-
-	
-
 	
 
 	/**

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

@@ -99,6 +99,13 @@ public class AdminCopyrightApiController extends CertifyApiController {
 		BeanUtils.copyProperties(inputInfo, cl);
 		ci.setId(oci.getId());
 		ci.setUid(oci.getUid());
+		if (CopyrightStatus.CIRCULATION.getCode() == ci.getStatus()){
+			ci.setStatus(CopyrightStatus.DELIVERD.getCode());
+		}
+		
+		if (CopyrightStatus.SETTLEMENT.getCode() == ci.getStatus()){
+			ci.setStatus(CopyrightStatus.AUTHORIZED.getCode());
+		}
 		cl.setCid(oci.getId());
 		cl.setOperator(TokenManager.getAdminId());
 		copyrightInfoService.updateByPrimaryKeySelective(ci, cl);

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

@@ -91,6 +91,153 @@ public class AdminPatentApiController extends CertifyApiController {
 	private AftFileService					aftFileService;
 	@Resource
 	private OrgRatepayService				orgRatepayService;
+	
+	/**
+	 * 专利列表
+	 * 
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/patentList", method = RequestMethod.GET)
+	public Result patentList(Integer serialNumber, String patentNumber, String office, String locationProvince,
+			String unitName, Integer patentCatagory, String patentName, Integer patentState,
+			@RequestParam(name = "createTime[]", required = false) String[] createTime,
+			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
+			String author, String pageNo, String pageSize) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince,
+				unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo,
+				pSize));
+		return res;
+	}
+	
+	/**
+	 * 新增专利申请
+	 */
+	@RequestMapping(value = "/apply", method = RequestMethod.POST)
+	public Result manageApplyPatent(@Valid InputPatentInfo patentInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+
+		if (StringUtils.isBlank(patentInfo.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+
+		User curUser = userService.selectByPrimaryKey(patentInfo.getUid());
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+
+		String aid = curUser.getAid();
+		PatentInfo pi = new PatentInfo();
+		BeanUtils.copyProperties(patentInfo, pi);
+		res.setData(patentInfoService.savePatentInfo(pi, aid));
+		return res;
+	}
+	
+	/**
+	 * 专利详情
+	 * 
+	 * @param pid
+	 * @return
+	 */
+	@RequestMapping(value = "/detail", method = RequestMethod.GET)
+	public Result patentDetail(String pid) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
+		} else {
+			res.setData(patentInfoService.selectPatentInfoDetail(pid));
+		}
+		return res;
+	}
+	
+	/**
+	 * 管理端logs
+	 */
+	@RequestMapping(value = "/logs", method = RequestMethod.GET)
+	public Result patentProcess(String pid) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
+		} else {
+			res.setData(patentLogService.selectProcessByPid(pid));
+		}
+		return res;
+	}
+
+	
+	/**
+	 * 专利详情修改保存
+	 * 
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/update", method = RequestMethod.POST)
+	public Result managePatentInfo(@Valid InputPatentInfo patentInfo, BindingResult bindingResult,
+			String recordTimeFormattedDate) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+
+		if (StringUtils.isBlank(patentInfo.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		PatentInfo p = patentInfoService.selectByPrimaryKey(patentInfo.getId());
+		if (null == p) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		Date recordTime = null;
+		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
+			try {
+				recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+		PatentInfo pi = new PatentInfo();
+		PatentLog pl = new PatentLog();
+		pi.setId(patentInfo.getId());
+		BeanUtils.copyProperties(patentInfo, pi);
+		BeanUtils.copyProperties(patentInfo, pl);
+		patentInfoService.updatePatentInfo(pi, pl, recordTime);
+		res.setData(1);
+		return res;
+	}
+
 
 	/**
 	 * 专利状态流转下拉
@@ -347,150 +494,15 @@ public class AdminPatentApiController extends CertifyApiController {
 		return res;
 	}
 
-	/**
-	 * 管理端logs
-	 */
-	@RequestMapping(value = "/logs", method = RequestMethod.GET)
-	public Result patentProcess(String pid) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isBlank(pid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
-		} else {
-			res.setData(patentLogService.selectProcessByPid(pid));
-		}
-		return res;
-	}
-
-	/**
-	 * 新增专利申请
-	 */
-	@RequestMapping(value = "/apply", method = RequestMethod.POST)
-	public Result manageApplyPatent(@Valid InputPatentInfo patentInfo, BindingResult bindingResult) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-
-		if (StringUtils.isBlank(patentInfo.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-
-		User curUser = userService.selectByPrimaryKey(patentInfo.getUid());
-		if (!checkCertify(res, curUser)) {
-			return res;
-		}
-
-		String aid = curUser.getAid();
-		PatentInfo pi = new PatentInfo();
-		BeanUtils.copyProperties(patentInfo, pi);
-		res.setData(patentInfoService.savePatentInfo(pi, aid));
-		return res;
-	}
-
-	/**
-	 * 专利详情修改保存
-	 * 
-	 * @throws ParseException
-	 */
-	@RequestMapping(value = "/update", method = RequestMethod.POST)
-	public Result managePatentInfo(@Valid InputPatentInfo patentInfo, BindingResult bindingResult,
-			String recordTimeFormattedDate) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-
-		if (StringUtils.isBlank(patentInfo.getId())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
-			return res;
-		}
-
-		PatentInfo p = patentInfoService.selectByPrimaryKey(patentInfo.getId());
-		if (null == p) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
-			return res;
-		}
-
-		Date recordTime = null;
-		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
-			try {
-				recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDD);
-			} catch (ParseException e) {
-			}
-		}
-		PatentInfo pi = new PatentInfo();
-		PatentLog pl = new PatentLog();
-		pi.setId(patentInfo.getId());
-		BeanUtils.copyProperties(patentInfo, pi);
-		BeanUtils.copyProperties(patentInfo, pl);
-		patentInfoService.updatePatentInfo(pi, pl, recordTime);
-		res.setData(1);
-		return res;
-	}
+	
+	
+	
+	
+	
 
-	/**
-	 * 专利列表
-	 * 
-	 * @throws ParseException
-	 */
-	@RequestMapping(value = "/patentList", method = RequestMethod.GET)
-	public Result patentList(Integer serialNumber, String patentNumber, String office, String locationProvince,
-			String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			@RequestParam(name = "createTime[]", required = false) String[] createTime,
-			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
-			String author, String pageNo, String pageSize) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince,
-				unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo,
-				pSize));
-		return res;
-	}
+	
 
-	/**
-	 * 专利详情
-	 * 
-	 * @param pid
-	 * @return
-	 */
-	@RequestMapping(value = "/detail", method = RequestMethod.GET)
-	public Result patentDetail(String pid) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		if (StringUtils.isBlank(pid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
-		} else {
-			res.setData(patentInfoService.selectPatentInfoDetail(pid));
-		}
-		return res;
-	}
+	
 
 	/**
 	 * 待缴费专利管理列表

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

@@ -59,34 +59,9 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	@Resource
 	private UserService				userService;
 	
-	@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 = "/getDepartment", method = RequestMethod.GET)
-	public Result getDepartment(String uid) {
-		Result res = new Result();
-		if (!checkAdminLogin(res)) {
-			return res;
-		}
-		res.setData(techWebsiteService.getDepartment(uid));
-		return res;
-	}
-
-	/**
 	 * 科技项目申报列表
 	 * 
 	 * @param pageNo
@@ -245,6 +220,37 @@ public class AdminTechProjectApiController extends CertifyApiController {
 		res.setData(techProjectService.updateTechProject(tp, tpl, recordTime));
 		return res;
 	}
+	
+	/**
+	 * 流转状态下拉
+	 * @return
+	 */
+	@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 = "/getDepartment", method = RequestMethod.GET)
+	public Result getDepartment(String uid) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		res.setData(techWebsiteService.getDepartment(uid));
+		return res;
+	}
 
 	/**
 	 * 删除科技项目记录

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

@@ -56,6 +56,7 @@ import com.goafanti.common.enums.CognizanceApplyFields;
 import com.goafanti.common.enums.OrgActivityFields;
 import com.goafanti.common.enums.OrgAnnualReportFields;
 import com.goafanti.common.enums.OrgCognizanceFields;
+import com.goafanti.common.enums.OrgCognizanceStatus;
 import com.goafanti.common.enums.OrgFinanceFields;
 import com.goafanti.common.enums.OrgHonorDatumFields;
 import com.goafanti.common.enums.OrgIntellectualPropertyFields;
@@ -1125,6 +1126,14 @@ public class CognizanceApiController extends CertifyApiController {
 			return res;
 		}
 		List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
+		for (OrgCognizanceLog log : list) {
+			if (OrgCognizanceStatus.getStatus(log.getState()) == OrgCognizanceStatus.SIGN 
+					|| OrgCognizanceStatus.getStatus(log.getState()) == OrgCognizanceStatus.CIRCULATION
+					|| OrgCognizanceStatus.getStatus(log.getState()) == OrgCognizanceStatus.SETTLEMENT) {
+				list.remove(log);
+			}
+		}
+		
 		res.setData(list);
 		return res;
 	}

+ 18 - 13
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -214,18 +214,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 			log.setOperator(aid);
 			orgCognizanceLogMapper.insert(log);
 			
-			OrgCognizance info = orgCognizanceMapper.selectByPrimaryKey(cog.getId());
-			
-			Notice n = new Notice();
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			n.setId(UUID.randomUUID().toString());
-			n.setCreateTime(now.getTime());
-			n.setReaded(0);
-			n.setAid(log.getPrincipal());
-			n.setContent("编号" + info.getSerialNumber() + "  " + OrgCognizanceStatus.getStatus(log.getState()).getDesc());
-			n.setNoticeType(NoticeStatus.COGNIZANCE.getCode());
-			noticeMapper.insert(n);
+			createNotice(cog, log);
 			
 		}
 		orgCognizanceMapper.updateByPrimaryKeySelective(cog);
@@ -246,7 +235,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 
 		log.setRecordTime(c.getCreateTime());
 		log.setState(c.getState());
-		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
+		log.setPrincipal(StringUtils.isBlank(aid) && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 		}
@@ -282,4 +271,20 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 		return (Pagination<CultivationListBo>) findPage("findCultivationListByPage", "findCultivationCount", params,
 				pageNo, pageSize);
 	}
+	
+	
+	private void createNotice(OrgCognizance cog, OrgCognizanceLog l){
+		OrgCognizance info = orgCognizanceMapper.selectByPrimaryKey(cog.getId());
+		
+		Notice n = new Notice();
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		n.setId(UUID.randomUUID().toString());
+		n.setCreateTime(now.getTime());
+		n.setReaded(0);
+		n.setAid(l.getPrincipal());
+		n.setContent("编号" + info.getSerialNumber() + "  " + OrgCognizanceStatus.getStatus(l.getState()).getDesc());
+		n.setNoticeType(NoticeStatus.COGNIZANCE.getCode());
+		noticeMapper.insert(n);
+	}
 }

+ 11 - 8
src/main/java/com/goafanti/common/enums/CopyrightStatus.java

@@ -6,15 +6,18 @@ import java.util.Map;
 import org.apache.commons.lang3.StringUtils;
 
 public enum CopyrightStatus {
-	CREATE(1, "创建"),
+	CREATE(0, "创建"),
+	SIGN(1,"签单"),
 	DELIVERD(2, "派单"),
-	SUBMIT(3, "材料提交"),
-	ACCEPT(4, "受理"),
-	AMEND(5, "补正"),
-	REJECT(6, "驳回"),
-	AUTHORIZED(7, "已下证"),
-	CALLBACK(8, "撤销"),
-	OTHER(9, "其他");
+	CIRCULATION(3,"流转"),
+	SUBMIT(4, "材料提交"),
+	ACCEPT(5, "受理"),
+	AMEND(6, "补正"),
+	REJECT(7, "驳回"),
+	AUTHORIZED(8, "已下证"),
+	SETTLEMENT(9, "已结款"),
+	CALLBACK(10, "撤销"),
+	OTHER(11, "其他");
 
 	private CopyrightStatus(Integer code, String desc) {
 		this.code = code;

+ 24 - 12
src/main/java/com/goafanti/common/mapper/OrgTechCenterDetailMapper.xml

@@ -6,13 +6,14 @@
     <result column="cid" property="cid" jdbcType="VARCHAR" />
     <result column="project_time" property="projectTime" jdbcType="TIMESTAMP" />
     <result column="project_name" property="projectName" jdbcType="VARCHAR" />
-    <result column="term_time" property="termTime" jdbcType="TIMESTAMP" />
+    <result column="term_start_time" property="termStartTime" jdbcType="TIMESTAMP" />
+    <result column="term_end_time" property="termEndTime" jdbcType="TIMESTAMP" />
     <result column="institution" property="institution" jdbcType="VARCHAR" />
     <result column="protocol_url" property="protocolUrl" jdbcType="VARCHAR" />
     <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
-    id, cid, project_time, project_name, term_time, institution, protocol_url, deleted_sign
+    id, cid, project_time, project_name, term_start_time, term_end_time, institution, protocol_url, deleted_sign
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -26,10 +27,11 @@
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
     insert into org_tech_center_detail (id, cid, project_time, 
-      project_name, term_time, institution, 
+      project_name, term_start_time, term_end_time, institution, 
       protocol_url, deleted_sign)
     values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{projectTime,jdbcType=TIMESTAMP}, 
-      #{projectName,jdbcType=VARCHAR}, #{termTime,jdbcType=TIMESTAMP}, #{institution,jdbcType=VARCHAR}, 
+      #{projectName,jdbcType=VARCHAR}, #{termStartTime,jdbcType=TIMESTAMP}, #{termEndTime,jdbcType=TIMESTAMP},
+      #{institution,jdbcType=VARCHAR}, 
       #{protocolUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgTechCenterDetail" >
@@ -47,8 +49,11 @@
       <if test="projectName != null" >
         project_name,
       </if>
-      <if test="termTime != null" >
-        term_time,
+      <if test="termStartTime != null" >
+        term_start_time,
+      </if>
+      <if test="termEndTime != null" >
+        term_end_time,
       </if>
       <if test="institution != null" >
         institution,
@@ -73,8 +78,11 @@
       <if test="projectName != null" >
         #{projectName,jdbcType=VARCHAR},
       </if>
-      <if test="termTime != null" >
-        #{termTime,jdbcType=TIMESTAMP},
+      <if test="termStartTime != null" >
+        #{termStartTime,jdbcType=TIMESTAMP},
+      </if>
+       <if test="termEndTime != null" >
+        #{termEndTime,jdbcType=TIMESTAMP},
       </if>
       <if test="institution != null" >
         #{institution,jdbcType=VARCHAR},
@@ -99,8 +107,11 @@
       <if test="projectName != null" >
         project_name = #{projectName,jdbcType=VARCHAR},
       </if>
-      <if test="termTime != null" >
-        term_time = #{termTime,jdbcType=TIMESTAMP},
+      <if test="termStartTime != null" >
+        term_start_time = #{termStartTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="termEndTime != null" >
+        term_end_time = #{termEndTime,jdbcType=TIMESTAMP},
       </if>
       <if test="institution != null" >
         institution = #{institution,jdbcType=VARCHAR},
@@ -119,7 +130,8 @@
     set cid = #{cid,jdbcType=VARCHAR},
       project_time = #{projectTime,jdbcType=TIMESTAMP},
       project_name = #{projectName,jdbcType=VARCHAR},
-      term_time = #{termTime,jdbcType=TIMESTAMP},
+      term_start_time = #{termStartTime,jdbcType=TIMESTAMP},
+      term_end_time = #{termEndTime,jdbcType=TIMESTAMP},
       institution = #{institution,jdbcType=VARCHAR},
       protocol_url = #{protocolUrl,jdbcType=VARCHAR},
       deleted_sign = #{deletedSign,jdbcType=INTEGER}
@@ -128,7 +140,7 @@
   
    <select id="findOrgTechCenterDetailListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
   	 select 
-     d.id, d.cid, d.project_time , d.project_name , d.term_time,
+     d.id, d.cid, d.project_time , d.project_name , d.term_start_time, d.term_end_time,
       d.institution, d.protocol_url , d.deleted_sign
     from org_tech_center_detail d 
     where d.deleted_sign = 0 and d.cid = #{cid,jdbcType=VARCHAR}

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

@@ -78,7 +78,7 @@
   <select id="findAll" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
-    from permission
+    from permission order by name
   </select>
   
   <insert id="insertBatch" parameterType="com.goafanti.common.model.Permission">

+ 42 - 13
src/main/java/com/goafanti/common/model/OrgTechCenterDetail.java

@@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.utils.FileUtils;
 
 public class OrgTechCenterDetail {
@@ -24,9 +25,14 @@ public class OrgTechCenterDetail {
     private String projectName;
 
     /**
-    * 期限
+    * 期限开始时间
     */
-    private Date termTime;
+    private Date termStartTime;
+    
+    /**
+     * 期限结束时间
+     */
+    private Date termEndTime;
 
     /**
     * 大学机构
@@ -75,15 +81,24 @@ public class OrgTechCenterDetail {
         this.projectName = projectName;
     }
 
-    public Date getTermTime() {
-        return termTime;
-    }
 
-    public void setTermTime(Date termTime) {
-        this.termTime = termTime;
-    }
+    public Date getTermStartTime() {
+		return termStartTime;
+	}
+
+	public void setTermStartTime(Date termStartTime) {
+		this.termStartTime = termStartTime;
+	}
+
+	public Date getTermEndTime() {
+		return termEndTime;
+	}
+
+	public void setTermEndTime(Date termEndTime) {
+		this.termEndTime = termEndTime;
+	}
 
-    public String getInstitution() {
+	public String getInstitution() {
         return institution;
     }
 
@@ -120,15 +135,29 @@ public class OrgTechCenterDetail {
 		
 	}
 	
-	public String getTermTimeFormattedDate(){
-		if (this.termTime == null) {
+	public String getTermStartTimeFormattedDate(){
+		if (this.termStartTime == null) {
 			return null;
 		} else {
-			return DateFormatUtils.format(this.getTermTime(), "yyyy-MM-dd");
+			return DateFormatUtils.format(this.getTermStartTime(), AFTConstants.YYYYMMDD);
 		}
 	}
 	
-	public void setTermTimeFormattedDate(String termTimeFormattedDate){
+	
+	public void setTermStartTimeFormattedDate(String termStartTimeFormattedDate){
+		
+	}
+	
+	public String getTermEndTimeFormattedDate(){
+		if (this.termEndTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getTermEndTime(), AFTConstants.YYYYMMDD);
+		}
+	}
+	
+	
+	public void setTermEndTimeFormattedDate(String termEndTimeFormattedDate){
 		
 	}
 	

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

@@ -1,6 +1,8 @@
 package com.goafanti.copyright.controller;
 
 
+import java.util.List;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -26,6 +28,7 @@ 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.CopyrightLogBO;
 import com.goafanti.copyright.bo.InputCopyright;
 import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -213,7 +216,15 @@ public class CopyrightApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著申请id"));
 			return res;
 		}
-		res.setData(copyrightInfoService.findLogsByPrimaryKey(id));
+		List<CopyrightLogBO> list = copyrightInfoService.findLogsByPrimaryKey(id);
+		for (CopyrightLogBO log : list) {
+			if (CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.SIGN 
+					|| CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.CIRCULATION
+					|| CopyrightStatus.getStatus(log.getStatus()) == CopyrightStatus.SETTLEMENT) {
+				list.remove(log);
+			}
+		}
+		res.setData(list);
 		return res;
 	}
 	

+ 16 - 11
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -55,6 +55,7 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 		log.setStatus(copyrightInfo.getStatus());
 		copyrightInfoMapper.insertSelective(copyrightInfo);
 		copyrightLogMapper.insertSelective(log);
+		createNotice(copyrightInfo, log);
 		return copyrightInfo;
 	}
 
@@ -64,17 +65,7 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 				&& copyrightLog.getPrincipal() != null) {
 			copyrightLogMapper.insertSelective(copyrightLog);
 			
-			CopyrightInfo info = copyrightInfoMapper.selectByPrimaryKey(copyrightInfo.getId());
-			Notice n = new Notice();
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			n.setId(UUID.randomUUID().toString());
-			n.setCreateTime(now.getTime());
-			n.setReaded(0);
-			n.setAid(copyrightLog.getPrincipal());
-			n.setContent("编号" + info.getSerialNumber() + "  " + CopyrightStatus.getStatus(copyrightLog.getStatus()).getDesc());
-			n.setNoticeType(NoticeStatus.COPYRIGHT.getCode());
-			noticeMapper.insert(n);
+			createNotice(copyrightInfo, copyrightLog);
 			
 			if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.ACCEPT) {
 				copyrightInfo.setAcceptTime(copyrightLog.getRecordTime());
@@ -206,5 +197,19 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 	public void updateByPrimaryKey(CopyrightInfo copyrightInfo) {
 		copyrightInfoMapper.updateByPrimaryKey(copyrightInfo);
 	}
+	
+	private void createNotice(CopyrightInfo c, CopyrightLog l){
+		CopyrightInfo info = copyrightInfoMapper.selectByPrimaryKey(c.getId());
+		Notice n = new Notice();
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		n.setId(UUID.randomUUID().toString());
+		n.setCreateTime(now.getTime());
+		n.setReaded(0);
+		n.setAid(l.getPrincipal());
+		n.setContent("编号" + info.getSerialNumber() + "  " + CopyrightStatus.getStatus(l.getStatus()).getDesc());
+		n.setNoticeType(NoticeStatus.COPYRIGHT.getCode());
+		noticeMapper.insert(n);
+	}
 
 }

+ 4 - 8
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -264,14 +264,10 @@ public class PatentApiController extends CertifyApiController {
 		if (null != pi.getUid() && pi.getUid().equals(TokenManager.getUserId())) {
 			List<PatentLog> list = patentLogService.selectProcessByPid(pid);
 			for (PatentLog log : list) {
-				if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SIGN) {
-					log.setState(PatentInfoStatus.CREATE.getCode());
-				}
-				if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.CIRCULATION) {
-					log.setState(PatentInfoStatus.DELIVERD.getCode());
-				}
-				if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SETTLEMENT) {
-					log.setState(PatentInfoStatus.LICENSE.getCode());
+				if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SIGN 
+						|| PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.CIRCULATION
+						|| PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.SETTLEMENT) {
+					list.remove(log);
 				}
 			}
 			res.setData(list);

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

@@ -329,11 +329,12 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setPid(patentInfo.getId());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setState(PatentInfoStatus.CREATE.getCode());
-		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
+		log.setPrincipal(StringUtils.isBlank(aid) && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 		}
 		patentLogMapper.insert(log);
+		createNotice(patentInfo, log);
 		return patentInfo;
 	}
 
@@ -359,19 +360,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			}
 			p.setPrincipal(log.getPrincipal());
 			patentLogMapper.insert(log);
-
-			PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
-
-			Notice n = new Notice();
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			n.setId(UUID.randomUUID().toString());
-			n.setCreateTime(now.getTime());
-			n.setReaded(0);
-			n.setAid(log.getPrincipal());
-			n.setContent("编号" + info.getSerialNumber() + "  " + PatentInfoStatus.getStatus(log.getState()).getDesc());
-			n.setNoticeType(NoticeStatus.PATENTINFO.getCode());
-			noticeMapper.insert(n);
+			
+			createNotice(p, log);
+			
 			
 		}
 		patentInfoMapper.updateByPrimaryKeySelective(p);
@@ -445,5 +436,20 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	public PatentInfoDetailBo selectPatentInfoDetail(String id) {
 		return patentInfoMapper.selectPatentInfoDetail(id);
 	}
+	
+	private void createNotice(PatentInfo p, PatentLog l){
+		PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
+
+		Notice n = new Notice();
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		n.setId(UUID.randomUUID().toString());
+		n.setCreateTime(now.getTime());
+		n.setReaded(0);
+		n.setAid(l.getPrincipal());
+		n.setContent("编号" + info.getSerialNumber() + "  " + PatentInfoStatus.getStatus(l.getState()).getDesc());
+		n.setNoticeType(NoticeStatus.PATENTINFO.getCode());
+		noticeMapper.insert(n);
+	}
 
 }

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

@@ -39,16 +39,17 @@ public class TechProjectApiController extends CertifyApiController {
 	private TechWebsiteService		techWebsiteService;
 	@Resource
 	private TechProjectLogService	techProjectLogService;
-	
+
 	/**
 	 * 获取科技部门
+	 * 
 	 * @return
 	 */
 	@RequestMapping(value = "/getDepartment", method = RequestMethod.GET)
-	public Result getDepartment(String uid){
+	public Result getDepartment(String uid) {
 		Result res = new Result();
-		 res.setData(techWebsiteService.getDepartment(TokenManager.getUserId()));
-		 return res;
+		res.setData(techWebsiteService.getDepartment(TokenManager.getUserId()));
+		return res;
 	}
 
 	/**
@@ -144,17 +145,13 @@ public class TechProjectApiController extends CertifyApiController {
 			return res;
 		}
 		TechProject tp = techProjectService.selectByPrimaryKey(pid);
-		if (null != tp.getUid() && tp.getUid().equals(TokenManager.getUserId())){
+		if (null != tp.getUid() && tp.getUid().equals(TokenManager.getUserId())) {
 			List<TechProjectLog> list = techProjectLogService.selectTechProjectLogByPid(pid);
-			for (TechProjectLog log : list){
-				if (TechProjectStatus.getStatus(log.getState()) ==  TechProjectStatus.SIGN){
-					log.setState(TechProjectStatus.CREATE.getCode());
-				}
-				if (TechProjectStatus.getStatus(log.getState()) ==  TechProjectStatus.CIRCULATION){
-					log.setState(TechProjectStatus.DELIVERD.getCode());
-				}
-				if (TechProjectStatus.getStatus(log.getState()) ==  TechProjectStatus.SETTLEMENT){
-					log.setState(TechProjectStatus.APPRVOVED.getCode());
+			for (TechProjectLog log : list) {
+				if (TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.SIGN
+						|| TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.CIRCULATION
+						|| TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.SETTLEMENT) {
+					list.remove(log);
 				}
 			}
 			res.setData(list);
@@ -184,7 +181,7 @@ public class TechProjectApiController extends CertifyApiController {
 		if (!checkUserLogin(res)) {
 			return res;
 		}
-		
+
 		User curUser = TokenManager.getUserToken();
 		if (!checkCertify(res, curUser)) {
 			return res;
@@ -193,9 +190,9 @@ public class TechProjectApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技申报项目", "科技项目申报ID"));
 			return res;
 		}
-		
+
 		TechProject t = techProjectService.selectByPrimaryKey(techProject.getId());
-		if (null != t.getUid() && t.getUid().equals(curUser.getId())){
+		if (null != t.getUid() && t.getUid().equals(curUser.getId())) {
 			TechProject tp = new TechProject();
 			BeanUtils.copyProperties(techProject, tp);
 			res.setData(techProjectService.updateTechProject(tp, null, null));
@@ -222,20 +219,21 @@ public class TechProjectApiController extends CertifyApiController {
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
-		
+
 		String sign = "tech_project";
 		res.setData(handleFiles(res, "/techProject/", true, req, sign, uid));
 		return res;
 	}
-	
+
 	/**
 	 * 科技项目资料下载
+	 * 
 	 * @param id
 	 * @param response
 	 * @return
 	 */
 	@RequestMapping(value = "/download", method = RequestMethod.GET)
-	public Result download(String id, HttpServletResponse response){
+	public Result download(String id, HttpServletResponse response) {
 		Result res = new Result();
 		if (!checkUserLogin(res)) {
 			return res;
@@ -248,16 +246,15 @@ public class TechProjectApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
 			return res;
 		}
-		
+
 		TechProject t = techProjectService.selectByPrimaryKey(id);
-		if (null == t || !curUser.getId().equals(t.getUid())){
+		if (null == t || !curUser.getId().equals(t.getUid())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
 			return res;
 		}
-		
+
 		downloadFile(response, t.getApprovalDownloadFileName(), t.getApprovalUrl());
 		return res;
 	}
 
-
 }

+ 19 - 14
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -77,19 +77,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 				t.setState(log.getState());
 			}
 			techProjectLogMapper.insert(log);
-			
-			TechProject info = techProjectMapper.selectByPrimaryKey(t.getId());
-			
-			Notice n = new Notice();
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			n.setId(UUID.randomUUID().toString());
-			n.setCreateTime(now.getTime());
-			n.setReaded(0);
-			n.setAid(log.getPrincipal());
-			n.setContent("编号" + info.getSerialNumber() + "  " + TechProjectStatus.getStatus(log.getState()).getDesc());
-			n.setNoticeType(NoticeStatus.TECHPROJECT.getCode());
-			noticeMapper.insert(n);
+			createNotice(t, log);
 		}
 
 		return techProjectMapper.updateByPrimaryKeySelective(t);
@@ -109,12 +97,14 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		log.setId(UUID.randomUUID().toString());
 		log.setPid(techProject.getId());
 		log.setRecordTime(techProject.getRecordTime());
-		log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
+		log.setPrincipal(StringUtils.isBlank(aid) && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
 		log.setState(TechProjectStatus.CREATE.getCode());
 		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 		}
 		techProjectLogMapper.insert(log);
+		
+		createNotice(techProject, log);
 	}
 
 	@SuppressWarnings("unchecked")
@@ -158,5 +148,20 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	public TechProject selectByPrimaryKey(String id) {
 		return techProjectMapper.selectByPrimaryKey(id);
 	}
+	
+	private void createNotice(TechProject t, TechProjectLog l){
+		TechProject info = techProjectMapper.selectByPrimaryKey(t.getId());
+		
+		Notice n = new Notice();
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		n.setId(UUID.randomUUID().toString());
+		n.setCreateTime(now.getTime());
+		n.setReaded(0);
+		n.setAid(l.getPrincipal());
+		n.setContent("编号" + info.getSerialNumber() + "  " + TechProjectStatus.getStatus(l.getState()).getDesc());
+		n.setNoticeType(NoticeStatus.TECHPROJECT.getCode());
+		noticeMapper.insert(n);
+	}
 
 }

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

@@ -1,8 +1,6 @@
 package com.goafanti.user.controller;
 
 import java.util.Calendar;
-import java.util.Collections;
-import java.util.List;
 import java.util.UUID;
 
 import javax.annotation.Resource;
@@ -19,7 +17,6 @@ import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
-import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
@@ -88,11 +85,14 @@ public class UserRegisterController extends BaseController {
 			user.setCreateTime(now.getTime());
 			user.setPassword(passwordUtil.getEncryptPwd(user));
 			user.setLvl(0);
+			/*
 			List<Admin> admins = adminService.selectAllAdmin();
 			if (!admins.isEmpty()) {
 				Collections.shuffle(admins);
 				user.setAid(admins.get(0).getId());// 随机分配管理员
 			}
+			*/
+			user.setAid("2");//ID为"2"的管理员
 			userService.insertRegister(user, contacts, companyName);
 		}