Browse Source

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

Conflicts:
	src/main/java/com/goafanti/patent/controller/PatentApiController.java
albertshaw 9 years ago
parent
commit
855db6aa6d
38 changed files with 4300 additions and 1478 deletions
  1. 17 0
      schema/2017-03-23.sql
  2. 8 0
      schema/2017-03-24.sql
  3. 481 203
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  4. 844 0
      src/main/java/com/goafanti/admin/controller/AdminPatentApiController.java
  5. 85 60
      src/main/java/com/goafanti/admin/controller/AdminTechProjectController.java
  6. 5 5
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  7. 24 0
      src/main/java/com/goafanti/common/controller/BaseApiController.java
  8. 5 0
      src/main/java/com/goafanti/common/controller/WebpageController.java
  9. 3 0
      src/main/java/com/goafanti/common/dao/PatentInfoMapper.java
  10. 1 0
      src/main/java/com/goafanti/common/dao/PatentLogMapper.java
  11. 54 0
      src/main/java/com/goafanti/common/enums/PatentCostFields.java
  12. 66 0
      src/main/java/com/goafanti/common/enums/PatentInfoFields.java
  13. 70 0
      src/main/java/com/goafanti/common/enums/PatentInfoStatus.java
  14. 67 0
      src/main/java/com/goafanti/common/enums/PatentRegistrationFields.java
  15. 65 0
      src/main/java/com/goafanti/common/enums/TechProjectFields.java
  16. 64 0
      src/main/java/com/goafanti/common/enums/TechProjectStatus.java
  17. 195 192
      src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml
  18. 870 735
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  19. 16 23
      src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml
  20. 15 0
      src/main/java/com/goafanti/common/model/PatentInfo.java
  21. 2 10
      src/main/java/com/goafanti/common/utils/AesUtils.java
  22. 107 0
      src/main/java/com/goafanti/patent/bo/InputPatentCost.java
  23. 295 0
      src/main/java/com/goafanti/patent/bo/InputPatentInfo.java
  24. 143 0
      src/main/java/com/goafanti/patent/bo/InputPatentRegistration.java
  25. 301 0
      src/main/java/com/goafanti/patent/bo/PatentInfoDetailBo.java
  26. 138 0
      src/main/java/com/goafanti/patent/bo/PatentManageListBo.java
  27. 1 1
      src/main/java/com/goafanti/patent/bo/PatentRegistrationBo.java
  28. 123 59
      src/main/java/com/goafanti/patent/controller/PatentApiController.java
  29. 2 0
      src/main/java/com/goafanti/patent/service/PatentCostService.java
  30. 7 9
      src/main/java/com/goafanti/patent/service/PatentInfoService.java
  31. 5 0
      src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java
  32. 87 71
      src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java
  33. 34 0
      src/main/java/com/goafanti/techproject/bo/InputTechProject.java
  34. 0 47
      src/main/java/com/goafanti/techproject/bo/InputTechProjectLog.java
  35. 58 27
      src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java
  36. 27 23
      src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java
  37. 4 13
      src/main/java/com/goafanti/user/controller/UserApiController.java
  38. 11 0
      src/main/webapp/WEB-INF/views/admin/set.jsp

+ 17 - 0
schema/2017-03-23.sql

@@ -0,0 +1,17 @@
+ALTER TABLE `patent_info` 
+MODIFY COLUMN `patent_state` INT(2) NULL COMMENT '专利状态';
+
+ALTER TABLE `patent_log` 
+MODIFY COLUMN `state` INT(2) NULL COMMENT '专利状态';
+
+ALTER TABLE `org_cognizance` 
+MODIFY COLUMN `state` INT(2) NULL COMMENT '高企认定状态';
+
+ALTER TABLE `org_cognizance_log` 
+MODIFY COLUMN `state` INT(2) NULL COMMENT '高企认定状态';
+
+ALTER TABLE `tech_project` 
+MODIFY COLUMN `state` INT(2) NULL COMMENT '科技项目状态';
+
+ALTER TABLE `tech_project_log` 
+MODIFY COLUMN `state` INT(2) NULL COMMENT '科技项目状态状态';

+ 8 - 0
schema/2017-03-24.sql

@@ -0,0 +1,8 @@
+ALTER TABLE `patent_info` 
+ADD COLUMN `contacts` INT(1) NULL COMMENT '联系人及联系方式';
+
+ALTER TABLE `patent_info` 
+MODIFY COLUMN patent_number VARCHAR(20) COMMENT '申请号/专利号',
+MODIFY COLUMN patent_des VARCHAR(255) COMMENT '专利简介';
+
+

File diff suppressed because it is too large
+ 481 - 203
src/main/java/com/goafanti/admin/controller/AdminApiController.java


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

@@ -0,0 +1,844 @@
+package com.goafanti.admin.controller;
+
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.time.DateUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.springframework.beans.BeanUtils;
+import org.springframework.validation.BindingResult;
+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.cognizance.service.OrgIntellectualPropertyService;
+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.PatentCostFields;
+import com.goafanti.common.enums.PatentInfoFields;
+import com.goafanti.common.enums.PatentInfoStatus;
+import com.goafanti.common.enums.PatentRegistrationFields;
+import com.goafanti.common.model.PatentCost;
+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.utils.FileUtils;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.patent.bo.InputPatentCost;
+import com.goafanti.patent.bo.InputPatentInfo;
+import com.goafanti.patent.bo.InputPatentRegistration;
+import com.goafanti.patent.bo.PatentApplicationFeeBo;
+import com.goafanti.patent.bo.PatentCompositeBo;
+import com.goafanti.patent.bo.PatentManageListBo;
+import com.goafanti.patent.bo.PatentPendingBo;
+import com.goafanti.patent.service.AdminService;
+import com.goafanti.patent.service.PatentCostService;
+import com.goafanti.patent.service.PatentInfoService;
+import com.goafanti.patent.service.PatentLogService;
+import com.goafanti.patent.service.PatentRegistrationService;
+import com.goafanti.user.service.OrganizationIdentityService;
+import com.goafanti.user.service.UserService;
+
+@RestController
+@RequestMapping(value = "/api/admin/patent")
+public class AdminPatentApiController extends CertifyApiController {
+	@Resource
+	private PatentInfoService				patentInfoService;
+	@Resource
+	private PatentLogService				patentLogService;
+	@Resource
+	private OrganizationIdentityService		organizationIdentityServivce;
+	@Resource
+	private PatentCostService				patentCostService;
+	@Resource
+	private PatentRegistrationService		patentRegistrationService;
+	@Resource
+	private AdminService					adminService;
+	@Resource
+	private OrgIntellectualPropertyService	orgIntellectualPropertyService;
+	@Resource
+	private UserService						userService;
+
+	/**
+	 * 删除专利
+	 * 
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/delete", method = RequestMethod.GET)
+	public Result deletePatent(@RequestParam(name = "ids[]", 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(patentInfoService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		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;
+	}
+
+	/**
+	 * 待缴费专利管理列表
+	 */
+	@RequestMapping(value = "/pendingPaymentList", method = RequestMethod.GET)
+	public Result managePendingPaymentList(String locationProvince, 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.getManagePendingPaymentList(locationProvince, pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 年费确认缴费
+	 */
+	@RequestMapping(value = "/confirmPayment", method = RequestMethod.POST)
+	public Result confirmPayment(String cid, String uid) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(cid) || StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+		PatentCost cost = patentCostService.selectByPrimaryKey(cid);
+		if (null == cost) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		if (null == cost.getPid()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		PatentInfo info = patentInfoService.selectByPrimaryKey(cost.getPid());
+		if (!uid.equals(info.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		PatentCost patentCost = new PatentCost();
+		patentCost.setId(cid);
+		patentCost.setAnnualFeeState(1);
+		patentCostService.updateByPrimaryKeySelective(patentCost);
+		return res;
+	}
+
+	/**
+	 * 补正审查通知列表
+	 */
+	@RequestMapping(value = "/noticeOfCorrectionList", method = RequestMethod.POST)
+	public Result noticeOfCorrectionList(Date authorizedDate, Integer serialNumber, String patentNumber, String office,
+			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
+			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.getNoticeOfCorrectionList(authorizedDate, serialNumber, patentNumber, office,
+				locationProvince, unitName, patentCatagory, patentName, patentState, author, pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 补正审查通知答复确认
+	 */
+	@RequestMapping(value = "/replyConfirm", method = RequestMethod.POST)
+	public Result replyConfirm(String pid, String uid, Integer patentState) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid) || StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+
+		if (null == patentState || patentState != PatentInfoStatus.REVIEWNOTICE.getCode()
+				|| patentState != PatentInfoStatus.CORRECTIONNOTICE.getCode()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "专利状态", "专利状态"));
+			return res;
+		}
+
+		PatentInfo info = patentInfoService.selectByPrimaryKey(pid);
+		if (!uid.equals(info.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
+			return res;
+		}
+		patentInfoService.updateNoticeOfCorrection(pid, patentState);
+		return res;
+	}
+
+	/**
+	 * 收发详情入口/收发纸件登记
+	 */
+	@RequestMapping(value = "/getRecieveSendList", method = RequestMethod.GET)
+	public Result RecieveSendList(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(patentRegistrationService.getRecieveSendList(pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 收发登记详情编辑保存
+	 * 
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/saveRecieveSend", method = RequestMethod.POST)
+	public Result recieveSendDetail(BindingResult bindingResult, String rid, String pid,
+			@Valid InputPatentRegistration patentRegistrationBo)  {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					PatentRegistrationFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+
+		if (StringUtils.isBlank(pid) || StringUtils.isBlank(rid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "专利记录ID", "专利记录ID"));
+			return res;
+		}
+		patentRegistrationService.updateByPrimaryKey(regBo2Reg(rid, pid, patentRegistrationBo));
+		return res;
+	}
+	
+	
+	/**
+	 * 专利申请费用管理
+	 */
+	@RequestMapping(value = "/getApplicationFeeList", method = RequestMethod.GET)
+	public Result getApplicationFeeList(
+			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
+			String locationProvince, String pageNo, String pageSize) throws ParseException {
+		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(patentCostService.getApplicationFeeList(patentApplicationDate, locationProvince, pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 登记申请费用
+	 */
+	@RequestMapping(value = "/registerApplicationFee", method = RequestMethod.POST)
+	public Result registerApplicationFee(@Valid InputPatentCost patentCost,BindingResult bindingResult, String cid) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					PatentCostFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		
+		if (null == cid){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "专利记录ID", "专利记录ID"));
+			return res;
+		}
+		
+		PatentCost pc = new PatentCost();
+		BeanUtils.copyProperties(patentCost, pc);
+		pc.setId(cid);
+		res.setData(patentCostService.updateByPrimaryKeySelective(pc));
+		return res;
+	}
+	
+	/**
+	 * 专利综合管理报表导出
+	 * 
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
+	public Result exportComposite(@RequestParam(name = "serialNumber", required = false) String serialNumber,
+			String patentNumber, String office, String locationProvince, String unitName,
+			@RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName,
+			@RequestParam(name = "patentState", required = false) String patentState,
+			@RequestParam(name = "createTime[]", required = false) String[] createTime,
+			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
+			String author, HttpServletResponse response) throws ParseException {
+		Result res = new Result();
+
+		Integer sn = (!StringUtils.isNumeric(serialNumber) ? null : Integer.parseInt(serialNumber));
+		Integer pc = (!StringUtils.isNumeric(patentCatagory) ? null : Integer.parseInt(patentCatagory));
+		Integer ps = (!StringUtils.isNumeric(patentState) ? null : Integer.parseInt(patentState));
+		String lp = ("undefined".equals(locationProvince)) ? null : locationProvince;
+		@SuppressWarnings("unchecked")
+		List<PatentCompositeBo> composites = (List<PatentCompositeBo>) getManagePatentList(sn, patentNumber, office, lp,
+				unitName, pc, patentName, ps, createTime, patentApplicationDate, author, 1, 1000).getList();
+		if (res.getError().isEmpty()) {
+			exportComosites(response, composites);
+		} else {
+			FileUtils downloadUtils = new FileUtils();
+			downloadUtils.out(response, res.toString());
+		}
+		return res;
+	}
+
+	/**
+	 * 待缴年登印费专利管理报表导出
+	 */
+	@RequestMapping(value = "/exportPending", method = RequestMethod.GET)
+	public Result exportPending(String locationProvince, HttpServletResponse response) {
+		Result res = new Result();
+		@SuppressWarnings("unchecked")
+		List<PatentPendingBo> pendings = (List<PatentPendingBo>) getManagePendingPaymentList(locationProvince, 1, 1000)
+				.getList();
+		if (res.getError().isEmpty()) {
+			exportPendings(response, pendings);
+		} else {
+			FileUtils downloadUtils = new FileUtils();
+			downloadUtils.out(response, res.toString());
+		}
+		return res;
+	}
+
+	/**
+	 * 专利申请费用管理报表导出
+	 * 
+	 * @throws ParseException
+	 */
+	@RequestMapping(value = "/exportApplicationFee", method = RequestMethod.GET)
+	public Result exportApplicationFee(
+			@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
+			String locationProvince, HttpServletResponse response) throws ParseException {
+		Result res = new Result();
+		@SuppressWarnings("unchecked")
+		List<PatentApplicationFeeBo> fees = (List<PatentApplicationFeeBo>) getApplicationFeeList(patentApplicationDate,
+				locationProvince, 1, 1000).getList();
+		if (res.getError().isEmpty()) {
+			exportFees(response, fees);
+		} else {
+			FileUtils downloadUtils = new FileUtils();
+			downloadUtils.out(response, res.toString());
+		}
+
+		return res;
+	}
+
+	// 专利申请费用管理报表
+	private void exportFees(HttpServletResponse response, List<PatentApplicationFeeBo> fees) {
+		String sheetName = "专利申请费用管理报表";
+		HSSFWorkbook workbook = createWorkbook(sheetName, new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利名称", "缴费状态",
+				"申请费", "实审费", "文印费", "是否请款", "是否报销", "申请日", "缴费截止时间" });
+
+		HSSFSheet sheet = workbook.getSheet(sheetName);
+
+		for (int i = 0; i < fees.size(); i++) {
+			PatentApplicationFeeBo obj = fees.get(i);
+			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
+			if (null == obj.getSerialNumber()) {
+				row.createCell(0).setCellValue("");
+			} else {
+				row.createCell(0).setCellValue(obj.getSerialNumber());
+			}
+			row.createCell(1).setCellValue(obj.getPatentNumber());
+			row.createCell(2).setCellValue(obj.getLocationProvince());
+			row.createCell(3).setCellValue(obj.getUnitName());
+			row.createCell(4).setCellValue(obj.getPatentName());
+			if (null != obj.getPaymentState()) {
+				switch (obj.getPaymentState()) {
+				case 0:
+					row.createCell(5).setCellValue("未缴费");
+					break;
+				case 1:
+					row.createCell(5).setCellValue("已缴费");
+				}
+			} else {
+				row.createCell(5).setCellValue("未缴费");
+			}
+			row.createCell(6).setCellValue(null == obj.getApplicationFee() ? 0 : obj.getApplicationFee());
+			row.createCell(7).setCellValue(null == obj.getTrialFee() ? 0 : obj.getTrialFee());
+			row.createCell(8).setCellValue(null == obj.getPrintingFee() ? 0 : obj.getPrintingFee());
+
+			if (null != obj.getFunds()) {
+				switch (obj.getFunds()) {
+				case 0:
+					row.createCell(9).setCellValue("否");
+					break;
+				case 1:
+					row.createCell(9).setCellValue("是");
+				}
+			} else {
+				row.createCell(9).setCellValue("否");
+			}
+
+			if (null != obj.getReimbursement()) {
+				switch (obj.getReimbursement()) {
+				case 0:
+					row.createCell(10).setCellValue("否");
+					break;
+				case 1:
+					row.createCell(10).setCellValue("是");
+				}
+			} else {
+				row.createCell(10).setCellValue("否");
+			}
+
+			row.createCell(11).setCellValue(obj.getPatentApplicationDateFormattedDate());
+			row.createCell(12).setCellValue(null == obj.getPatentApplicationDateFormattedDate() ? ""
+					: calDeadline(obj.getPatentApplicationDateFormattedDate()));
+
+		}
+		FileUtils downloadUtils = new FileUtils();
+		downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
+	}
+
+	// 待缴年登印费专利管理报表
+	private void exportPendings(HttpServletResponse response, List<PatentPendingBo> pendings) {
+		String sheetName = "待缴年登印费专利管理报表";
+		HSSFWorkbook workbook = createWorkbook(sheetName,
+				new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利类型", "专利名称", "专利状态", "缴费状态", "缴费截止日期" });
+
+		HSSFSheet sheet = workbook.getSheet(sheetName);
+
+		for (int i = 0; i < pendings.size(); i++) {
+			PatentPendingBo obj = pendings.get(i);
+			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
+			if (null == obj.getSerialNumber()) {
+				row.createCell(0).setCellValue("");
+			} else {
+				row.createCell(0).setCellValue(obj.getSerialNumber());
+			}
+			row.createCell(1).setCellValue(obj.getPatentNumber());
+			row.createCell(2).setCellValue(obj.getLocationProvince());
+			row.createCell(3).setCellValue(obj.getUnitName());
+			if (null != obj.getPatentCatagory()) {
+				switch (obj.getPatentCatagory()) {
+				case 0:
+					row.createCell(4).setCellValue("发明型专利");
+					break;
+				case 1:
+					row.createCell(4).setCellValue("科技型专利");
+					break;
+				case 2:
+					row.createCell(4).setCellValue("外观型专利");
+					break;
+				}
+			} else {
+				row.createCell(4).setCellValue("");
+			}
+			row.createCell(5).setCellValue(obj.getPatentName());
+			row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
+			if (null != obj.getAnnualFeeState()) {
+				switch (obj.getAnnualFeeState()) {
+				case 0:
+					row.createCell(7).setCellValue("未缴费");
+					break;
+				case 1:
+					row.createCell(7).setCellValue("已缴费");
+					break;
+				}
+			} else {
+				row.createCell(7).setCellValue("未缴费");
+			}
+			row.createCell(8).setCellValue(null == obj.getAuthorizedDateFormattedDate() ? ""
+					: calDeadline(obj.getAuthorizedDateFormattedDate()));
+
+		}
+		FileUtils downloadUtils = new FileUtils();
+		downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
+	}
+
+	private void exportComosites(HttpServletResponse response, List<PatentCompositeBo> composites) {
+		String sheetName = "专利综合管理报表";
+		HSSFWorkbook workbook = createWorkbook(sheetName,
+				new String[] { "编号", "申请号/专利号", "事务所", "省份", "公司名称", "专利名称", "专利状态", "派单日", "申请日", "授权日", "资料撰写人" });
+		HSSFSheet sheet = workbook.getSheet(sheetName);
+
+		// 将查询出的数据设置到sheet对应的单元格中
+		for (int i = 0; i < composites.size(); i++) {
+			PatentCompositeBo obj = composites.get(i);// 遍历每个对象
+			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
+			if (null == obj.getSerialNumber()) {
+				row.createCell(0).setCellValue("");
+			} else {
+				row.createCell(0).setCellValue(obj.getSerialNumber());
+			}
+			row.createCell(1).setCellValue(obj.getPatentNumber());
+			row.createCell(2).setCellValue(obj.getOffice());
+			row.createCell(3).setCellValue(obj.getLocationProvince());
+			row.createCell(4).setCellValue(obj.getUnitName());
+			row.createCell(5).setCellValue(obj.getPatentName());
+			row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
+			row.createCell(7).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
+			row.createCell(8).setCellValue(obj.getCreateTimeFormattedDate());
+			row.createCell(9).setCellValue(obj.getPatentApplicationFormattedDate());
+			row.createCell(10).setCellValue(obj.getPatentApplicationFormattedDate());
+			row.createCell(11).setCellValue(obj.getAuthor());
+		}
+		FileUtils downloadUtils = new FileUtils();
+		downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
+
+	}
+
+	private HSSFWorkbook createWorkbook(String sheetName, String[] colNames) {
+		HSSFWorkbook workbook = new HSSFWorkbook();
+		HSSFSheet sheet = workbook.createSheet(sheetName);
+		// 产生表格标题行
+		HSSFRow rowm = sheet.createRow(0);
+		HSSFCell cellTitle = rowm.createCell(0);
+		cellTitle.setCellValue(sheetName);
+		sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, (colNames.length - 1)));
+
+		HSSFRow rowRowName = sheet.createRow(1); // 在索引2的位置创建行(最顶端的行开始的第二行)
+
+		// 将列头设置到sheet的单元格中
+		for (int n = 0; n < colNames.length; n++) {
+			rowRowName.createCell(n).setCellValue(colNames[n]);
+		}
+		return workbook;
+	}
+
+
+	private PatentRegistration regBo2Reg(String rid, String pid, InputPatentRegistration patentRegistrationBo) {
+		PatentRegistration patentRegistration = new PatentRegistration();
+		patentRegistration.setId(rid);
+		patentRegistration.setAcceptanceExpressCompany(patentRegistrationBo.getAcceptanceExpressCompany());
+		try {
+			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceIssueTime())) {
+				patentRegistration.setAcceptanceIssueTime(
+						DateUtils.parseDate(patentRegistrationBo.getAcceptanceIssueTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setAcceptanceIssueTime(null);
+			}
+			if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceReceiveTime())) {
+				patentRegistration.setAcceptanceReceiveTime(
+						DateUtils.parseDate(patentRegistrationBo.getAcceptanceReceiveTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setAcceptanceReceiveTime(null);
+			}
+			patentRegistration.setAcceptanceTrackingNumber(patentRegistrationBo.getAcceptanceTrackingNumber());
+			patentRegistration.setAuthorizationExpressCompany(patentRegistrationBo.getAuthorizationExpressCompany());
+			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationIssueTime())) {
+				patentRegistration.setAuthorizationIssueTime(
+						DateUtils.parseDate(patentRegistrationBo.getAuthorizationIssueTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setAuthorizationIssueTime(null);
+			}
+			if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationReceiveTime())) {
+				patentRegistration.setAuthorizationReceiveTime(
+						DateUtils.parseDate(patentRegistrationBo.getAuthorizationReceiveTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setAuthorizationReceiveTime(null);
+			}
+			patentRegistration.setAuthorizationTrackingNumber(patentRegistrationBo.getAuthorizationTrackingNumber());
+			patentRegistration.setCertificateExpressCompany(patentRegistrationBo.getCertificateExpressCompany());
+			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateIssueTime())) {
+				patentRegistration.setCertificateIssueTime(
+						DateUtils.parseDate(patentRegistrationBo.getCertificateIssueTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setCertificateIssueTime(null);
+			}
+			if (!StringUtils.isBlank(patentRegistrationBo.getCertificateRecieveTime())) {
+				patentRegistration.setCertificateRecieveTime(
+						DateUtils.parseDate(patentRegistrationBo.getCertificateRecieveTime(), "yyyy-MM-dd"));
+			} else {
+				patentRegistration.setCertificateRecieveTime(null);
+			}
+		} catch (ParseException e) {
+		}
+		patentRegistration.setCertificateTrackingNumber(patentRegistrationBo.getCertificateTrackingNumber());
+		patentRegistration.setPid(pid);
+		return patentRegistration;
+	}
+	
+
+		// 专利申请费用管理
+		private Pagination<PatentApplicationFeeBo> getApplicationFeeList(String[] patentApplicationDate,
+				String locationProvince, Integer pNo, Integer pSize) throws ParseException {
+			return patentCostService.getApplicationFeeList(patentApplicationDate, locationProvince, pNo, pSize);
+		}
+
+
+		// 待缴费专利管理
+		private Pagination<PatentPendingBo> getManagePendingPaymentList(String locationProvince, Integer pNo,
+				Integer pSize) {
+			return patentInfoService.getManagePendingPaymentList(locationProvince, pNo, pSize);
+		}
+
+		// 管理端申请专利列表(专利综合管理)
+		private Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
+				String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
+				String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
+				throws ParseException {
+			return patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince, unitName,
+					patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo, pSize);
+		}
+
+		
+		// 缴费截止日期
+		private String calDeadline(String s) {
+			String[] arr = s.split("-");
+			String y = arr[0];
+			String m = arr[1];
+			String d = arr[2];
+			if ("11".equals(arr[0])) {
+				m = "01";
+				y = String.valueOf(Integer.parseInt(y) + 1);
+			} else if ("12".equals(arr[0])) {
+				m = "02";
+				y = String.valueOf(Integer.parseInt(y) + 1);
+			} else {
+				m = String.valueOf(Integer.parseInt(m) + 2);
+			}
+			return y + m + d;
+		}
+
+		// 专利状态
+		private String switchPatState(Integer s) {
+			String state = "";
+			switch (s) {
+			case 0:
+				state = "申请";
+				break;
+			case 1:
+				state = "签单";
+				break;
+			case 2:
+				state = "派单";
+				break;
+			case 3:
+				state = "流转";
+				break;
+			case 4:
+				state = "撰写";
+				break;
+			case 5:
+				state = "受理";
+				break;
+			case 6:
+				state = "审查意见通知";
+				break;
+			case 7:
+				state = "审查意见已答复";
+				break;
+			case 8:
+				state = "补正通知";
+				break;
+			case 9:
+				state = "补正已答复";
+				break;
+			case 10:
+				state = "授权";
+				break;
+			case 11:
+				state = "驳回";
+				break;
+			case 12:
+				state = "发证";
+				break;
+			case 13:
+				state = "已结款";
+				break;
+			case 14:
+				state = "撤销";
+				break;
+			}
+			return state;
+		}
+
+}

+ 85 - 60
src/main/java/com/goafanti/admin/controller/AdminTechProjectController.java

@@ -1,6 +1,5 @@
 package com.goafanti.admin.controller;
 
-import java.io.IOException;
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.Date;
@@ -8,6 +7,7 @@ import java.util.List;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 import org.apache.commons.lang3.time.DateUtils;
@@ -18,26 +18,20 @@ import org.springframework.validation.BindingResult;
 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.multipart.MultipartFile;
 
 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.CopyrightFields;
+import com.goafanti.common.enums.TechProjectFields;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.common.model.TechWebsite;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.AesUtils;
-import com.goafanti.common.utils.Base64Utils;
-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.techproject.bo.InputTechProject;
-import com.goafanti.techproject.bo.InputTechProjectLog;
 import com.goafanti.techproject.bo.InputTechWebsite;
 import com.goafanti.techproject.bo.TechProjectManageListBo;
 import com.goafanti.techproject.bo.TechWebsiteDetailBo;
@@ -49,7 +43,7 @@ import com.goafanti.user.service.UserService;
 
 @Controller
 @RequestMapping(value = "/api/admintechproject")
-public class AdminTechProjectController extends CertifyApiController {
+public class AdminTechProjectApiController extends CertifyApiController {
 	@Value(value = "${aesSecretKey}")
 	private String					aesSecretKey	= null;
 	@Resource
@@ -62,6 +56,21 @@ public class AdminTechProjectController extends CertifyApiController {
 	private UserService				userService;
 
 	/**
+	 * 获取科技部门
+	 * 
+	 * @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
@@ -89,7 +98,10 @@ public class AdminTechProjectController extends CertifyApiController {
 			List<TechProjectManageListBo> l = (List<TechProjectManageListBo>) t.getList();
 			for (TechProjectManageListBo w : l) {
 				if (!StringUtils.isBlank(w.getPassword())) {
-					w.setPassword(Base64Utils.decodeData(w.getPassword()));
+					try {
+						w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
+					} catch (Exception e) {
+					}
 				}
 			}
 			t.setList(l);
@@ -108,7 +120,7 @@ public class AdminTechProjectController extends CertifyApiController {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
+					TechProjectFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
 		if (!checkAdminLogin(res)) {
@@ -179,28 +191,29 @@ public class AdminTechProjectController extends CertifyApiController {
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
-	public Result updateTechProject(@Valid InputTechProject techProject, @Valid InputTechProjectLog log, BindingResult bindingResult, String recordTimeFormattedDate) {
+	public Result updateTechProject(@Valid InputTechProject techProject, BindingResult bindingResult,
+			String recordTimeFormattedDate) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
+					TechProjectFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
 		if (!checkAdminLogin(res)) {
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(techProject.getId())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技申报项目", "科技项目申报ID"));
 			return res;
 		}
-		
+
 		TechProject t = techProjectService.selectByPrimaryKey(techProject.getId());
-		if (null == t){
+		if (null == t) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到申报项目", "科技项目申报"));
 			return res;
 		}
-		
+
 		Date recordTime = null;
 		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
 			try {
@@ -208,12 +221,12 @@ public class AdminTechProjectController extends CertifyApiController {
 			} catch (ParseException e) {
 			}
 		}
-		
+
 		TechProject tp = new TechProject();
 		TechProjectLog tpl = new TechProjectLog();
 		tp.setId(techProject.getId());
 		BeanUtils.copyProperties(techProject, tp);
-		BeanUtils.copyProperties(log, tpl);
+		BeanUtils.copyProperties(techProject, tpl);
 		res.setData(techProjectService.updateTechProject(tp, tpl, recordTime));
 		return res;
 	}
@@ -286,7 +299,7 @@ public class AdminTechProjectController extends CertifyApiController {
 						w.setPassword(AesUtils.decrypt(w.getPassword(), aesSecretKey));
 					} catch (Exception e) {
 					}
-					//w.setPassword(Base64Utils.decodeData(w.getPassword()));
+					// w.setPassword(Base64Utils.decodeData(w.getPassword()));
 				}
 			}
 			t.setList(l);
@@ -302,7 +315,7 @@ public class AdminTechProjectController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/techWebsiteDetail", method = RequestMethod.POST)
-	public Result techWebsiteDetail(String id)  {
+	public Result techWebsiteDetail(String id) {
 		Result res = new Result();
 		if (!checkAdminLogin(res)) {
 			return res;
@@ -317,11 +330,12 @@ public class AdminTechProjectController extends CertifyApiController {
 				} catch (Exception e) {
 				}
 			}
-			
-			/*if (null != w && !StringUtils.isBlank(w.getPassword())) {
-				w.setPassword(Base64Utils.decodeData(w.getPassword()));
-			}*/
-				res.setData(w);
+
+			/*
+			 * if (null != w && !StringUtils.isBlank(w.getPassword())) {
+			 * w.setPassword(Base64Utils.decodeData(w.getPassword())); }
+			 */
+			res.setData(w);
 		}
 		return res;
 	}
@@ -333,47 +347,49 @@ public class AdminTechProjectController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/disposeTechWebsite", method = RequestMethod.POST)
-	public Result disposeTechWebsite(@Valid InputTechWebsite w, BindingResult bindingResult)  {
+	public Result disposeTechWebsite(@Valid InputTechWebsite w, BindingResult bindingResult) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
+					TechProjectFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
 		if (!checkAdminLogin(res)) {
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(w.getUid())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
 			return res;
 		}
-		
+
 		User curUser = userService.selectByPrimaryKey(w.getUid());
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
-		
-		/*if (null != w && null != (w.getPassword())) {
-			w.setPassword(Base64Utils.encodeData(w.getPassword().trim()));
-		}*/
-		
+
+		/*
+		 * if (null != w && null != (w.getPassword())) {
+		 * w.setPassword(Base64Utils.encodeData(w.getPassword().trim())); }
+		 */
+
 		if (null != w && null != (w.getPassword())) {
 			try {
 				w.setPassword(AesUtils.encrypt(w.getPassword().trim(), aesSecretKey));
 			} catch (Exception e) {
 			}
 		}
-		
+
 		TechWebsite tw = new TechWebsite();
 		BeanUtils.copyProperties(w, tw);
-		
+
 		res.setData(techWebsiteService.saveWebsite(tw));
 		return res;
 	}
-	
+
 	/**
 	 * 科技项目申报材料上传
+	 * 
 	 * @param req
 	 * @param uid
 	 * @return
@@ -388,32 +404,41 @@ public class AdminTechProjectController extends CertifyApiController {
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
-		
+
 		String sign = "tech_project";
-		res.setData(handleFile(res, "/techProject/", true, req, sign, uid));
+		res.setData(handleFiles(res, "/techProject/", true, req, sign, uid));
 		return res;
 	}
 
-	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
-			String uid) {
-		List<MultipartFile> files = getFiles(req);
-		MultipartFile mf = files.get(0);
+	/**
+	 * 下载科技项目材料
+	 * 
+	 * @param response
+	 * @param fileName
+	 * @param path
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(HttpServletResponse response, String id) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
+			return res;
+		}
 
-		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
-				StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
-		if (!files.isEmpty()) {
-			try {
-				mf.transferTo(toPrivateFile(fileName));
-				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
-			} catch (IllegalStateException | IOException e) {
-				LoggerUtils.error(getClass(), "文件上传失败", e);
-				res.getError().add(buildError("", "文件上传失败!"));
-				return "";
-			}
-		} else {
-			res.getError().add(buildError("", "文件上传失败!"));
-			return "";
+		TechProject t = techProjectService.selectByPrimaryKey(id);
+		if (null == t) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
+			return res;
 		}
-		return fileName;
-	} 
+
+		downloadFile(response, t.getApprovalDownloadFileName(), t.getApprovalUrl());
+		return res;
+	}
+
 }

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

@@ -35,7 +35,7 @@ import com.goafanti.cognizance.service.OrgTechCenterService;
 import com.goafanti.cognizance.service.OrgTechProductService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.OrgActivity;
 import com.goafanti.common.model.OrgActivityCost;
 import com.goafanti.common.model.OrgAnnualReport;
@@ -61,7 +61,7 @@ import com.goafanti.user.service.UserService;
 
 @Controller
 @RequestMapping(value = "/techservice/cognizance")
-public class CognizanceApiController extends BaseApiController {
+public class CognizanceApiController extends CertifyApiController {
 	@Resource
 	private UserService						userService;
 	@Resource
@@ -111,8 +111,9 @@ public class CognizanceApiController extends BaseApiController {
 	public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
 			String endDateFormattedDate, String pageNo, String pageSize) throws ParseException {
 		Result res = new Result();
-		res = checkCertify(res);
-		if (res.getError().isEmpty()) {
+		if (!checkUserLogin(res)) {
+			return res;
+		}
 			Integer pNo = 1;
 			Integer pSize = 10;
 			if (StringUtils.isNumeric(pageSize)) {
@@ -123,7 +124,6 @@ public class CognizanceApiController extends BaseApiController {
 			}
 			res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
 					endDateFormattedDate, pNo, pSize, TokenManager.getUserId()));
-		}
 		return res;
 	}
 

+ 24 - 0
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.controller;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -162,4 +163,27 @@ public class BaseApiController extends BaseController {
 		}
 		return 10;
 	}
+	
+	protected String handleFiles(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
+			String uid) {
+		List<MultipartFile> files = getFiles(req);
+		MultipartFile mf = files.get(0);
+
+		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
+				StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
+		if (!files.isEmpty()) {
+			try {
+				mf.transferTo(toPrivateFile(fileName));
+				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
+			} catch (IllegalStateException | IOException e) {
+				LoggerUtils.error(getClass(), "文件上传失败", e);
+				res.getError().add(buildError("", "文件上传失败!"));
+				return "";
+			}
+		} else {
+			res.getError().add(buildError("", "文件上传失败!"));
+			return "";
+		}
+		return fileName;
+	} 
 }

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

@@ -80,6 +80,11 @@ public class WebpageController extends BaseController {
 		return "/admin/login";
 	}
 	
+	@RequestMapping(value = "/admin/set", method = RequestMethod.GET)
+	public String adminSet(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/set";
+	}
+	
 	/*@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
 	public String adminUserManage(HttpServletRequest request, ModelAndView modelview) {
 		return "/admin/userManage";

+ 3 - 0
src/main/java/com/goafanti/common/dao/PatentInfoMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.goafanti.common.model.PatentInfo;
+import com.goafanti.patent.bo.PatentInfoDetailBo;
 import com.goafanti.patent.bo.PatentRecieveSendBo;
 
 public interface PatentInfoMapper {
@@ -28,5 +29,7 @@ public interface PatentInfoMapper {
 	List<PatentRecieveSendBo> getPatentRecieveSendList();
 
 	int batchDeleteByPrimaryKey(List<String> id);
+
+	PatentInfoDetailBo selectPatentInfoDetail(String id);
 	
 }

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

@@ -18,4 +18,5 @@ public interface PatentLogMapper {
     int updateByPrimaryKey(PatentLog record);
 
 	List<PatentLog> selectProcessByPid(String pid);
+
 }

+ 54 - 0
src/main/java/com/goafanti/common/enums/PatentCostFields.java

@@ -0,0 +1,54 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PatentCostFields {
+	ANNUALFEE("annualFee", "用户id"),
+	ANNUALFEESTATE("annualFeeState", "联系人"),
+	APPLICATIONFEE("applicationFee", "专利名称"),
+	TRIALFEE("trialFee", "专利类别"),
+	PRINTINGFEE("printingFee", "专利号/申请号"),
+	FUNDS("funds", "专利领域"),
+	OTHER("", "未知参数");
+	
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, PatentCostFields> status = new HashMap<String, PatentCostFields>();
+	
+	private PatentCostFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (PatentCostFields value : PatentCostFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static PatentCostFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 66 - 0
src/main/java/com/goafanti/common/enums/PatentInfoFields.java

@@ -0,0 +1,66 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PatentInfoFields {
+	
+	UID("uid", "用户id"),
+	CONTACTS("contacts", "联系人"),
+	PATENTNAME("patentName", "专利名称"),
+	PATENTCATAGORY("patentCatagory", "专利类别"),
+	PATENTNUMBER("patentNumber", "专利号/申请号"),
+	PATENTFIELD("patentField", "专利领域"),
+	PATENTDES("patentDes", "专利简介"),
+	FIRSTINVENTORNAME("firstInventorName", "第一发明人姓名"),
+	FIRSTINVENTORNATIONALITY("firstInventorNationality", "第一发明人国籍"),
+	FIRSTINVENTORIDNUMBER("firstInventorIdNumber", "第一发明人身份证号"),
+	FIRSTINVENTORISPUBLISH("firstInventorIsPublish", "第一发明人是否公布"),
+	SECONDINVENTORNAME("secondInventorName", "第二发明人姓名"),
+	SECONDINVENTORNATIONALITY("secondInventorNationality", "第二发明人国籍"),
+	SECONDINVENTORISPUBLISH("secondInventorIsPublish", "第二发明人是否公布"),
+	THIRDINVENTORNAME("thirdInventorName", "第三发明人姓名"),
+	THIRDINVENTORNATIONALITY("thirdInventorNationality", "第三发明人国籍"),
+	THIRDINVENTORISPUBLISH("thirdInventorIsPublish", "第三发明人是否公布"),
+	OTHER("", "未知参数");
+	
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, PatentInfoFields> status = new HashMap<String, PatentInfoFields>();
+	
+	private PatentInfoFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (PatentInfoFields value : PatentInfoFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static PatentInfoFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 70 - 0
src/main/java/com/goafanti/common/enums/PatentInfoStatus.java

@@ -0,0 +1,70 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentInfoStatus {
+	CREATE(0, "申请"),
+	SIGN(1,"签单"),
+	DELIVERD(2, "派单"),
+	CIRCULATION(3,"流转"),
+	COMPOSE(4, "撰写"),
+	ACCEPT(5, "受理"),
+	REVIEWNOTICE(6, "审查意见通知"),
+	REVIEWREPLY(7, "审查意见答复"),
+	CORRECTIONNOTICE(8, "补正通知"),
+	CORRECTIONREPLY(9, "补正已答复"),
+	AUTHORIZE(10, "授权"),
+	REJECT(11, "驳回"),
+	LICENSE(12, "发证"),
+	SETTLEMENT(13, "已结款"),
+	CALLBACK(14, "撤销"),
+	OTHER(15, "其他");
+	
+	
+	private Integer	code;
+	private String	desc;
+	
+	private PatentInfoStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentInfoStatus> status = new HashMap<Integer, PatentInfoStatus>();
+
+	static {
+		for (PatentInfoStatus value : PatentInfoStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentInfoStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentInfoStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 67 - 0
src/main/java/com/goafanti/common/enums/PatentRegistrationFields.java

@@ -0,0 +1,67 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PatentRegistrationFields {
+	
+	ACCEPTANCERECEIVETIME("acceptanceReceiveTime", "用户id"),
+	ACCEPTANCEISSUETIME("acceptanceIssueTime", "联系人"),
+	ACCEPTANCETRACKINGNUMBER("acceptanceTrackingNumber", "专利名称"),
+	ACCEPTANCEEXPRESSCOMPANY("acceptanceExpressCompany", "专利类别"),
+	
+	AUTHORIZATIONRECEIVETIME("authorizationReceiveTime", "专利号/申请号"),
+	AUTHORIZATIONISSUETIME("authorizationIssueTime", "专利领域"),
+	AUTHORIZATIONTRACKINGNUMBER("authorizationTrackingNumber", "专利简介"),
+	AUTHORIZATIONEXPRESSCOMPANY("authorizationExpressCompany", "第一发明人姓名"),
+	
+	CERTIFICATERECIEVETIME("certificateRecieveTime", "第一发明人国籍"),
+	CERTIFICATEISSUETIME("certificateIssueTime", "第一发明人身份证号"),
+	CERTIFICATETRACKINGNUMBER("certificateTrackingNumber", "第一发明人是否公布"),
+	CERTIFICATEEXPRESSCOMPANY("certificateExpressCompany", "第二发明人姓名"),
+	
+	OTHER("", "未知参数");
+	
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, PatentRegistrationFields> status = new HashMap<String, PatentRegistrationFields>();
+	
+	private PatentRegistrationFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (PatentRegistrationFields value : PatentRegistrationFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static PatentRegistrationFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+	
+	
+
+}

+ 65 - 0
src/main/java/com/goafanti/common/enums/TechProjectFields.java

@@ -0,0 +1,65 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum TechProjectFields {
+
+	UID("uid", "用户id"),
+	CONTACTS("contacts", "联系人"),
+	DEPARTMENT("department", "科技项目申报部门"),
+	DISPATCHINFO("dispatchInfo", "派单信息"),
+	PROJECTNAME("projectName", "项目名称"),
+	PROJECTCATAGORY("projectCatagory", "项目类型"),
+	TECHHFIELD("techField", "技术领域"),
+	PROJECTDES("projectDes", "项目简介"),
+	PROJECTMODE("projectMode", "是否立项"),
+	PROJECTAPPROVAL("projectApproval", "立项金额"),
+	SUBSIDY("subsidy", "是否补助"),
+	CONSULTANT("consultant", "咨询师"),
+	APPROVALURL("approvalUrl", "科技项目资料URL"),
+	STATE("state", "科技项目状态"),
+	PRINCIPAL("principal", "负责人"),
+	COMMENT("comment", "备注"),
+	OTHER("", "未知参数");
+	
+	private String	code;
+	private String	desc;
+	
+	private static Map<String, TechProjectFields> status = new HashMap<String, TechProjectFields>();
+	
+	private TechProjectFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+	
+	static {
+		for (TechProjectFields value : TechProjectFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	
+	public static TechProjectFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+	
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+	
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 64 - 0
src/main/java/com/goafanti/common/enums/TechProjectStatus.java

@@ -0,0 +1,64 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum TechProjectStatus {
+	CREATE(0, "创建"),
+	SIGN(1,"签单"),
+	DELIVERD(2, "派单"),
+	CIRCULATION(3,"流转"),
+	SUBMIT(4, "材料提交"),
+	ACCEPT(5, "受理"),
+	APPRVOVED(6, "审批通过"),
+	REJECT(7, "审批不通过"),
+	SETTLEMENT(8, "已结款"),
+	CALLBACK(9, "撤销"),
+	OTHER(10, "其他");
+	
+	private Integer	code;
+	private String	desc;
+
+	private TechProjectStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, TechProjectStatus> status = new HashMap<Integer, TechProjectStatus>();
+
+	static {
+		for (TechProjectStatus value : TechProjectStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static TechProjectStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static TechProjectStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 195 - 192
src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml

@@ -1,207 +1,210 @@
 <?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.PatentCostMapper" >
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentCost" >
-    <id column="id" property="id" jdbcType="VARCHAR" />
-    <result column="pid" property="pid" jdbcType="VARCHAR" />
-    <result column="annual_fee" property="annualFee" jdbcType="INTEGER" />
-    <result column="annual_fee_state" property="annualFeeState" jdbcType="INTEGER" />
-    <result column="application_fee" property="applicationFee" jdbcType="INTEGER" />
-    <result column="trial_fee" property="trialFee" jdbcType="INTEGER" />
-    <result column="printing_fee" property="printingFee" jdbcType="INTEGER" />
-    <result column="funds" property="funds" jdbcType="INTEGER" />
-    <result column="reimbursement" property="reimbursement" jdbcType="INTEGER" />
-    <result column="payment_state" property="paymentState" jdbcType="INTEGER" />
-  </resultMap>
-  <sql id="Base_Column_List" >
-    id, pid, annual_fee, annual_fee_state, application_fee, trial_fee, printing_fee, 
-    funds, reimbursement, payment_state
-  </sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select 
-    <include refid="Base_Column_List" />
-    from patent_cost
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
-    delete from patent_cost
-    where id = #{id,jdbcType=VARCHAR}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.PatentCost" >
-    insert into patent_cost (id, pid, annual_fee, 
-      annual_fee_state, application_fee, trial_fee, 
-      printing_fee, funds, reimbursement, 
-      payment_state)
-    values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{annualFee,jdbcType=INTEGER}, 
-      #{annualFeeState,jdbcType=INTEGER}, #{applicationFee,jdbcType=INTEGER}, #{trialFee,jdbcType=INTEGER}, 
-      #{printingFee,jdbcType=INTEGER}, #{funds,jdbcType=INTEGER}, #{reimbursement,jdbcType=INTEGER}, 
-      #{paymentState,jdbcType=INTEGER})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentCost" >
-    insert into patent_cost
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        id,
-      </if>
-      <if test="pid != null" >
-        pid,
-      </if>
-      <if test="annualFee != null" >
-        annual_fee,
-      </if>
-      <if test="annualFeeState != null" >
-        annual_fee_state,
-      </if>
-      <if test="applicationFee != null" >
-        application_fee,
-      </if>
-      <if test="trialFee != null" >
-        trial_fee,
-      </if>
-      <if test="printingFee != null" >
-        printing_fee,
-      </if>
-      <if test="funds != null" >
-        funds,
-      </if>
-      <if test="reimbursement != null" >
-        reimbursement,
-      </if>
-      <if test="paymentState != null" >
-        payment_state,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        #{id,jdbcType=VARCHAR},
-      </if>
-      <if test="pid != null" >
-        #{pid,jdbcType=VARCHAR},
-      </if>
-      <if test="annualFee != null" >
-        #{annualFee,jdbcType=INTEGER},
-      </if>
-      <if test="annualFeeState != null" >
-        #{annualFeeState,jdbcType=INTEGER},
-      </if>
-      <if test="applicationFee != null" >
-        #{applicationFee,jdbcType=INTEGER},
-      </if>
-      <if test="trialFee != null" >
-        #{trialFee,jdbcType=INTEGER},
-      </if>
-      <if test="printingFee != null" >
-        #{printingFee,jdbcType=INTEGER},
-      </if>
-      <if test="funds != null" >
-        #{funds,jdbcType=INTEGER},
-      </if>
-      <if test="reimbursement != null" >
-        #{reimbursement,jdbcType=INTEGER},
-      </if>
-      <if test="paymentState != null" >
-        #{paymentState,jdbcType=INTEGER},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentCost" >
-    update patent_cost
-    <set >
-      <if test="pid != null" >
-        pid = #{pid,jdbcType=VARCHAR},
-      </if>
-      <if test="annualFee != null" >
-        annual_fee = #{annualFee,jdbcType=INTEGER},
-      </if>
-      <if test="annualFeeState != null" >
-        annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
-      </if>
-      <if test="applicationFee != null" >
-        application_fee = #{applicationFee,jdbcType=INTEGER},
-      </if>
-      <if test="trialFee != null" >
-        trial_fee = #{trialFee,jdbcType=INTEGER},
-      </if>
-      <if test="printingFee != null" >
-        printing_fee = #{printingFee,jdbcType=INTEGER},
-      </if>
-      <if test="funds != null" >
-        funds = #{funds,jdbcType=INTEGER},
-      </if>
-      <if test="reimbursement != null" >
-        reimbursement = #{reimbursement,jdbcType=INTEGER},
-      </if>
-      <if test="paymentState != null" >
-        payment_state = #{paymentState,jdbcType=INTEGER},
-      </if>
-    </set>
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentCost" >
-    update patent_cost
-    set pid = #{pid,jdbcType=VARCHAR},
-      annual_fee = #{annualFee,jdbcType=INTEGER},
-      annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
-      application_fee = #{applicationFee,jdbcType=INTEGER},
-      trial_fee = #{trialFee,jdbcType=INTEGER},
-      printing_fee = #{printingFee,jdbcType=INTEGER},
-      funds = #{funds,jdbcType=INTEGER},
-      reimbursement = #{reimbursement,jdbcType=INTEGER},
-      payment_state = #{paymentState,jdbcType=INTEGER}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  
-  <select id="findApplicationFeeListByPage" parameterType="String" resultType="com.goafanti.patent.bo.PatentApplicationFeeBo">
-  	select m.uid as uid , m.pid as pid , m.oid ,
-       		m.serialNumber ,m.patentNumber ,
-     	    m.locationProvince , m.unitName , 
-      		m.patentName , m.patentApplicationDate ,
-  	    c.id as cid ,
-    	c.payment_state as paymentState,c.application_fee as applicationFee ,
-    	c.trial_fee as trialFee , c.printing_fee as printingFee , 
-   	    c.funds as funds , c.reimbursement as reimbursement
-   	from patent_cost c RIGHT JOIN 
-     	(select u.id as uid , p.id as pid ,o.id as oid ,
-       		p.serial_number as serialNumber ,p.patent_number as patentNumber ,
-     	    o.location_province as locationProvince , o.unit_name as unitName , 
-      		p.patent_name as patentName , p.patent_application_date as patentApplicationDate
-    from user u
-		LEFT JOIN organization_identity o on o.uid = u.id  
-		INNER JOIN patent_info p on u.id =p.uid
-		where p.deleted_sign = 0
+<mapper namespace="com.goafanti.common.dao.PatentCostMapper">
+	<resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentCost">
+		<id column="id" property="id" jdbcType="VARCHAR" />
+		<result column="pid" property="pid" jdbcType="VARCHAR" />
+		<result column="annual_fee" property="annualFee" jdbcType="INTEGER" />
+		<result column="annual_fee_state" property="annualFeeState"
+			jdbcType="INTEGER" />
+		<result column="application_fee" property="applicationFee"
+			jdbcType="INTEGER" />
+		<result column="trial_fee" property="trialFee" jdbcType="INTEGER" />
+		<result column="printing_fee" property="printingFee" jdbcType="INTEGER" />
+		<result column="funds" property="funds" jdbcType="INTEGER" />
+		<result column="reimbursement" property="reimbursement"
+			jdbcType="INTEGER" />
+		<result column="payment_state" property="paymentState"
+			jdbcType="INTEGER" />
+	</resultMap>
+	<sql id="Base_Column_List">
+		id, pid, annual_fee, annual_fee_state, application_fee, trial_fee,
+		printing_fee,
+		funds, reimbursement, payment_state
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
+		parameterType="java.lang.String">
+		select
+		<include refid="Base_Column_List" />
+		from patent_cost
+		where id = #{id,jdbcType=VARCHAR}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+		delete from patent_cost
+		where id = #{id,jdbcType=VARCHAR}
+	</delete>
+	<insert id="insert" parameterType="com.goafanti.common.model.PatentCost">
+		insert into patent_cost (id, pid, annual_fee,
+		annual_fee_state, application_fee, trial_fee,
+		printing_fee, funds, reimbursement,
+		payment_state)
+		values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
+		#{annualFee,jdbcType=INTEGER},
+		#{annualFeeState,jdbcType=INTEGER}, #{applicationFee,jdbcType=INTEGER}, #{trialFee,jdbcType=INTEGER},
+		#{printingFee,jdbcType=INTEGER}, #{funds,jdbcType=INTEGER},
+		#{reimbursement,jdbcType=INTEGER},
+		#{paymentState,jdbcType=INTEGER})
+	</insert>
+	<insert id="insertSelective" parameterType="com.goafanti.common.model.PatentCost">
+		insert into patent_cost
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null">
+				id,
+			</if>
+			<if test="pid != null">
+				pid,
+			</if>
+			<if test="annualFee != null">
+				annual_fee,
+			</if>
+			<if test="annualFeeState != null">
+				annual_fee_state,
+			</if>
+			<if test="applicationFee != null">
+				application_fee,
+			</if>
+			<if test="trialFee != null">
+				trial_fee,
+			</if>
+			<if test="printingFee != null">
+				printing_fee,
+			</if>
+			<if test="funds != null">
+				funds,
+			</if>
+			<if test="reimbursement != null">
+				reimbursement,
+			</if>
+			<if test="paymentState != null">
+				payment_state,
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null">
+				#{id,jdbcType=VARCHAR},
+			</if>
+			<if test="pid != null">
+				#{pid,jdbcType=VARCHAR},
+			</if>
+			<if test="annualFee != null">
+				#{annualFee,jdbcType=INTEGER},
+			</if>
+			<if test="annualFeeState != null">
+				#{annualFeeState,jdbcType=INTEGER},
+			</if>
+			<if test="applicationFee != null">
+				#{applicationFee,jdbcType=INTEGER},
+			</if>
+			<if test="trialFee != null">
+				#{trialFee,jdbcType=INTEGER},
+			</if>
+			<if test="printingFee != null">
+				#{printingFee,jdbcType=INTEGER},
+			</if>
+			<if test="funds != null">
+				#{funds,jdbcType=INTEGER},
+			</if>
+			<if test="reimbursement != null">
+				#{reimbursement,jdbcType=INTEGER},
+			</if>
+			<if test="paymentState != null">
+				#{paymentState,jdbcType=INTEGER},
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentCost">
+		update patent_cost
+		<set>
+			<if test="pid != null">
+				pid = #{pid,jdbcType=VARCHAR},
+			</if>
+			<if test="annualFee != null">
+				annual_fee = #{annualFee,jdbcType=INTEGER},
+			</if>
+			<if test="annualFeeState != null">
+				annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
+			</if>
+			<if test="applicationFee != null">
+				application_fee = #{applicationFee,jdbcType=INTEGER},
+			</if>
+			<if test="trialFee != null">
+				trial_fee = #{trialFee,jdbcType=INTEGER},
+			</if>
+			<if test="printingFee != null">
+				printing_fee = #{printingFee,jdbcType=INTEGER},
+			</if>
+			<if test="funds != null">
+				funds = #{funds,jdbcType=INTEGER},
+			</if>
+			<if test="reimbursement != null">
+				reimbursement = #{reimbursement,jdbcType=INTEGER},
+			</if>
+			<if test="paymentState != null">
+				payment_state = #{paymentState,jdbcType=INTEGER},
+			</if>
+		</set>
+		where id = #{id,jdbcType=VARCHAR}
+	</update>
+	<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentCost">
+		update patent_cost
+		set pid = #{pid,jdbcType=VARCHAR},
+		annual_fee = #{annualFee,jdbcType=INTEGER},
+		annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
+		application_fee = #{applicationFee,jdbcType=INTEGER},
+		trial_fee = #{trialFee,jdbcType=INTEGER},
+		printing_fee = #{printingFee,jdbcType=INTEGER},
+		funds = #{funds,jdbcType=INTEGER},
+		reimbursement = #{reimbursement,jdbcType=INTEGER},
+		payment_state = #{paymentState,jdbcType=INTEGER}
+		where id = #{id,jdbcType=VARCHAR}
+	</update>
+
+	<select id="findApplicationFeeListByPage" parameterType="String"
+		resultType="com.goafanti.patent.bo.PatentApplicationFeeBo">
+		select p.uid as uid , p.id as pid ,o.id as oid, c.id as cid,
+		p.serial_number as serialNumber ,p.patent_number as patentNumber ,
+		o.location_province as locationProvince , o.unit_name as unitName ,
+		p.patent_name as patentName , p.patent_application_date as
+		patentApplicationDate,
+		c.payment_state as paymentState,c.application_fee as applicationFee ,
+		c.trial_fee as trialFee , c.printing_fee as printingFee ,
+		c.funds as funds , c.reimbursement as reimbursement
+		from patent_info p
+		LEFT JOIN organization_identity o on o.uid = p.uid
+		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
 		<if test="locationProvince != null">
-		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
+			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		<if test="pStart != null">
-		 and p.patent_application_date <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
+			and p.patent_application_date <![CDATA[ > ]]>
+			#{pStart,jdbcType=TIMESTAMP}
 		</if>
 		<if test="pEnd">
-		 and p.patent_application_date <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
+			and p.patent_application_date <![CDATA[ < ]]>
+			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
-		) m
-   on c.pid = m.pid order by m.serialNumber DESC
-   <if test="page_sql!=null">
-		${page_sql}
-	</if>
-  </select>
-  
-  <select id="findApplicationFeeCount" resultType="java.lang.Integer" parameterType="String"> 
-	select count(1) from   patent_cost c RIGHT JOIN 
-     	(select  p.id as pid 
-    from user u
-        LEFT JOIN organization_identity o on o.uid = u.id  
-		INNER JOIN patent_info p on u.id =p.uid
-		where p.deleted_sign = 0
+		order by p.serial_number DESC
+		<if test="page_sql!=null">
+			${page_sql}
+		</if>
+	</select>
+
+	<select id="findApplicationFeeCount" resultType="java.lang.Integer"
+		parameterType="java.lang.String">
+		select count(1)
+		from patent_info p
+		LEFT JOIN organization_identity o on o.uid = p.uid
+		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
 		<if test="locationProvince != null">
-		 and o.location_province = #{locationProvince,jdbcType=VARCHAR}
+			and o.location_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
 		<if test="pStart != null">
-		 and p.patent_application_date <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
+			and p.patent_application_date <![CDATA[ > ]]>
+			#{pStart,jdbcType=TIMESTAMP}
 		</if>
 		<if test="pEnd">
-		 and p.patent_application_date <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
+			and p.patent_application_date <![CDATA[ < ]]>
+			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
-		) m
-   on c.pid = m.pid 
-  </select>
+	</select>
 </mapper>

File diff suppressed because it is too large
+ 870 - 735
src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml


+ 16 - 23
src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml

@@ -204,31 +204,24 @@
   </update>
   
   <select id="findRecieveSendList" resultType="com.goafanti.patent.bo.PatentRecieveSendBo">
-   select r.id as rid, r.acceptance_receive_time as acceptanceReceiveTime , r.acceptance_issue_time as acceptanceIssueTime, 
-  	   r.acceptance_tracking_number as acceptanceTrackingNumber , r.acceptance_express_company as acceptanceExpressCompany,
-       r.authorization_receive_time as authorizationReceiveTime , r.authorization_issue_time as authorizationIssueTime, 
-       r.authorization_tracking_number as authorizationTrackingNumber , r.authorization_express_company as authorizationExpressCompany,
-       r.certificate_recieve_time as certificateRecieveTime, r.certificate_issue_time as certificateIssueTime, 
-       r.certificate_tracking_number as certificateTrackingNumber, r.certificate_express_company as certificateExpressCompany,
-       m.* from 
-      (select u.id as uid , p.id as pid ,o.id as oid , p.serial_number as serialNumber ,p.patent_number as patentNumber ,
-              o.location_province as locationProvince , o.unit_name as unitName ,
-              p.patent_catagory as patentCatagory , p.patent_name as patentName
-       from user u
-	   INNER JOIN patent_info p on u.id =p.uid and p.deleted_sign = 0
-	   LEFT JOIN organization_identity o on o.uid = u.id 
-	   ) m
-  LEFT JOIN patent_registration r on m.pid = r.pid  order by m.serialNumber desc
+  select p.id as pid ,p.uid as uid, o.id as oid, r.id as rid, p.serial_number as serialNumber ,p.patent_number as patentNumber ,
+         o.location_province as locationProvince , o.unit_name as unitName ,
+         p.patent_catagory as patentCatagory , p.patent_name as patentName,
+ 	     r.acceptance_receive_time as acceptanceReceiveTime , r.acceptance_issue_time as acceptanceIssueTime, 
+  	     r.acceptance_tracking_number as acceptanceTrackingNumber , r.acceptance_express_company as acceptanceExpressCompany,
+         r.authorization_receive_time as authorizationReceiveTime , r.authorization_issue_time as authorizationIssueTime, 
+         r.authorization_tracking_number as authorizationTrackingNumber , r.authorization_express_company as authorizationExpressCompany,
+         r.certificate_recieve_time as certificateRecieveTime, r.certificate_issue_time as certificateIssueTime, 
+         r.certificate_tracking_number as certificateTrackingNumber, r.certificate_express_company as certificateExpressCompany
+		from patent_info p 
+		LEFT  JOIN patent_registration r  on p.id = r.pid
+		LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
   </select>
   
   <select id="findRecieveSendCount" resultType="java.lang.Integer">
-  	select count(1) from 
-      (select p.id as pid 
-       from user u
-	   INNER JOIN patent_info p on u.id = p.uid and p.deleted_sign = 0
-	   LEFT JOIN organization_identity o on o.uid = u.id
-	   ) m
-    LEFT JOIN patent_registration r on m.pid = r.pid
-  	
+  	select count(1)
+	from patent_info p 
+	LEFT  JOIN patent_registration r  on p.id = r.pid
+	LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
   </select>
 </mapper>

+ 15 - 0
src/main/java/com/goafanti/common/model/PatentInfo.java

@@ -161,6 +161,11 @@ public class PatentInfo {
      * 删除标记
      */
     private Integer deletedSign;
+    
+    /**
+     * 联系人及联系方式
+     */
+    private Integer contacts;
 
     public String getId() {
         return id;
@@ -421,6 +426,16 @@ public class PatentInfo {
 	public void setDeletedSign(Integer deletedSign) {
 		this.deletedSign = deletedSign;
 	}
+	
+	
+
+	public Integer getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(Integer contacts) {
+		this.contacts = contacts;
+	}
 
 	//授权日/发文日
 	public String getAuthorizedFormattedDate() {

+ 2 - 10
src/main/java/com/goafanti/common/utils/AesUtils.java

@@ -3,32 +3,26 @@ package com.goafanti.common.utils;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
-
 import org.apache.commons.codec.binary.Base64;
 
 public class AesUtils {
-
 	public static String encrypt(String content, String key) throws Exception {
 		try {
 			Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
 			int blockSize = cipher.getBlockSize();
-
 			byte[] dataBytes = content.getBytes();
 			int plaintextLength = dataBytes.length;
 			if (plaintextLength % blockSize != 0) {
 				plaintextLength = plaintextLength + (blockSize - (plaintextLength % blockSize));
 			}
-
 			byte[] plaintext = new byte[plaintextLength];
 			System.arraycopy(dataBytes, 0, plaintext, 0, dataBytes.length);
-
 			SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES");
 			IvParameterSpec ivspec = new IvParameterSpec(key.getBytes());
-
 			cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec);
 			return Base64.encodeBase64String(cipher.doFinal(plaintext));
-
 		} catch (Exception e) {
+			e.printStackTrace();
 			return null;
 		}
 	}
@@ -39,9 +33,7 @@ public class AesUtils {
 			Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
 			SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES");
 			IvParameterSpec ivspec = new IvParameterSpec(key.getBytes());
-
 			cipher.init(Cipher.DECRYPT_MODE, keyspec, ivspec);
-
 			byte[] original = cipher.doFinal(decoded);
 			int i = original.length - 1;
 			for (; i >= 0; i--) {
@@ -53,8 +45,8 @@ public class AesUtils {
 			System.arraycopy(original, 0, subarray, 0, i + 1);
 			return new String(subarray);
 		} catch (Exception e) {
+			e.printStackTrace();
 			return null;
 		}
 	}
-
 }

+ 107 - 0
src/main/java/com/goafanti/patent/bo/InputPatentCost.java

@@ -0,0 +1,107 @@
+package com.goafanti.patent.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputPatentCost {
+	
+	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	annualFee;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	annualFeeState;
+	
+	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	applicationFee;
+	
+	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	trialFee;
+	
+	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	printingFee;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	funds;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	reimbursement;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	paymentState;
+
+	public Integer getAnnualFee() {
+		return annualFee;
+	}
+
+	public void setAnnualFee(Integer annualFee) {
+		this.annualFee = annualFee;
+	}
+
+	public Integer getAnnualFeeState() {
+		return annualFeeState;
+	}
+
+	public void setAnnualFeeState(Integer annualFeeState) {
+		this.annualFeeState = annualFeeState;
+	}
+
+	public Integer getApplicationFee() {
+		return applicationFee;
+	}
+
+	public void setApplicationFee(Integer applicationFee) {
+		this.applicationFee = applicationFee;
+	}
+
+	public Integer getTrialFee() {
+		return trialFee;
+	}
+
+	public void setTrialFee(Integer trialFee) {
+		this.trialFee = trialFee;
+	}
+
+	public Integer getPrintingFee() {
+		return printingFee;
+	}
+
+	public void setPrintingFee(Integer printingFee) {
+		this.printingFee = printingFee;
+	}
+
+	public Integer getFunds() {
+		return funds;
+	}
+
+	public void setFunds(Integer funds) {
+		this.funds = funds;
+	}
+
+	public Integer getReimbursement() {
+		return reimbursement;
+	}
+
+	public void setReimbursement(Integer reimbursement) {
+		this.reimbursement = reimbursement;
+	}
+
+	public Integer getPaymentState() {
+		return paymentState;
+	}
+
+	public void setPaymentState(Integer paymentState) {
+		this.paymentState = paymentState;
+	}
+	
+	
+}

+ 295 - 0
src/main/java/com/goafanti/patent/bo/InputPatentInfo.java

@@ -0,0 +1,295 @@
+package com.goafanti.patent.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputPatentInfo {
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	id;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	uid;
+
+	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	contacts;
+
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	patentName;
+
+	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	patentCatagory;
+
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	patentNumber;
+
+	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	patentField;
+
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	patentDes;
+    
+	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	firstInventorName;
+	
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	firstInventorNationality;
+	
+	@Size(min = 0, max = 18, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	firstInventorIdNumber;
+    
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	firstInventorIsPublish;
+	
+	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	secondInventorName;
+	
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	secondInventorNationality;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	secondInventorIsPublish;
+	
+	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	thirdInventorName;
+	
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	thirdInventorNationality;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	thirdInventorIsPublish;
+	
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String patentProryStatementUrl;
+	
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String patentWritingUrl;
+	
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String authorizationNoticeUrl;
+	
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String patentCertificateUrl;
+	
+	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer		state;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		principal;
+	
+	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		comment;
+	
+	
+
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(Integer contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getPatentName() {
+		return patentName;
+	}
+
+	public void setPatentName(String patentName) {
+		this.patentName = patentName;
+	}
+
+	public Integer getPatentCatagory() {
+		return patentCatagory;
+	}
+
+	public void setPatentCatagory(Integer patentCatagory) {
+		this.patentCatagory = patentCatagory;
+	}
+
+	public String getPatentNumber() {
+		return patentNumber;
+	}
+
+	public void setPatentNumber(String patentNumber) {
+		this.patentNumber = patentNumber;
+	}
+
+	public Integer getPatentField() {
+		return patentField;
+	}
+
+	public void setPatentField(Integer patentField) {
+		this.patentField = patentField;
+	}
+
+	public String getPatentDes() {
+		return patentDes;
+	}
+
+	public void setPatentDes(String patentDes) {
+		this.patentDes = patentDes;
+	}
+
+	public String getFirstInventorName() {
+		return firstInventorName;
+	}
+
+	public void setFirstInventorName(String firstInventorName) {
+		this.firstInventorName = firstInventorName;
+	}
+
+	public String getFirstInventorNationality() {
+		return firstInventorNationality;
+	}
+
+	public void setFirstInventorNationality(String firstInventorNationality) {
+		this.firstInventorNationality = firstInventorNationality;
+	}
+
+	public String getFirstInventorIdNumber() {
+		return firstInventorIdNumber;
+	}
+
+	public void setFirstInventorIdNumber(String firstInventorIdNumber) {
+		this.firstInventorIdNumber = firstInventorIdNumber;
+	}
+
+	public Integer getFirstInventorIsPublish() {
+		return firstInventorIsPublish;
+	}
+
+	public void setFirstInventorIsPublish(Integer firstInventorIsPublish) {
+		this.firstInventorIsPublish = firstInventorIsPublish;
+	}
+
+	public String getSecondInventorName() {
+		return secondInventorName;
+	}
+
+	public void setSecondInventorName(String secondInventorName) {
+		this.secondInventorName = secondInventorName;
+	}
+
+	public String getSecondInventorNationality() {
+		return secondInventorNationality;
+	}
+
+	public void setSecondInventorNationality(String secondInventorNationality) {
+		this.secondInventorNationality = secondInventorNationality;
+	}
+
+	public Integer getSecondInventorIsPublish() {
+		return secondInventorIsPublish;
+	}
+
+	public void setSecondInventorIsPublish(Integer secondInventorIsPublish) {
+		this.secondInventorIsPublish = secondInventorIsPublish;
+	}
+
+	public String getThirdInventorName() {
+		return thirdInventorName;
+	}
+
+	public void setThirdInventorName(String thirdInventorName) {
+		this.thirdInventorName = thirdInventorName;
+	}
+
+	public String getThirdInventorNationality() {
+		return thirdInventorNationality;
+	}
+
+	public void setThirdInventorNationality(String thirdInventorNationality) {
+		this.thirdInventorNationality = thirdInventorNationality;
+	}
+
+	public Integer getThirdInventorIsPublish() {
+		return thirdInventorIsPublish;
+	}
+
+	public void setThirdInventorIsPublish(Integer thirdInventorIsPublish) {
+		this.thirdInventorIsPublish = thirdInventorIsPublish;
+	}
+
+	public String getPatentProryStatementUrl() {
+		return patentProryStatementUrl;
+	}
+
+	public void setPatentProryStatementUrl(String patentProryStatementUrl) {
+		this.patentProryStatementUrl = patentProryStatementUrl;
+	}
+
+	public String getPatentWritingUrl() {
+		return patentWritingUrl;
+	}
+
+	public void setPatentWritingUrl(String patentWritingUrl) {
+		this.patentWritingUrl = patentWritingUrl;
+	}
+
+	public String getAuthorizationNoticeUrl() {
+		return authorizationNoticeUrl;
+	}
+
+	public void setAuthorizationNoticeUrl(String authorizationNoticeUrl) {
+		this.authorizationNoticeUrl = authorizationNoticeUrl;
+	}
+
+	public String getPatentCertificateUrl() {
+		return patentCertificateUrl;
+	}
+
+	public void setPatentCertificateUrl(String patentCertificateUrl) {
+		this.patentCertificateUrl = patentCertificateUrl;
+	}
+	
+	
+}

+ 143 - 0
src/main/java/com/goafanti/patent/bo/InputPatentRegistration.java

@@ -0,0 +1,143 @@
+package com.goafanti.patent.bo;
+
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputPatentRegistration {
+	
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	acceptanceReceiveTime;
+
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	acceptanceIssueTime;
+	
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	acceptanceTrackingNumber;
+
+	@Size(min = 0, max = 8, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	acceptanceExpressCompany;
+	
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	authorizationReceiveTime;
+
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	authorizationIssueTime;
+
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	authorizationTrackingNumber;
+
+	@Size(min = 0, max = 8, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	authorizationExpressCompany;
+
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateRecieveTime;
+
+	@Size(min = 0, max = 10, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateIssueTime;
+
+	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateTrackingNumber;
+
+	@Size(min = 0, max = 8, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	certificateExpressCompany;
+
+	public String getAcceptanceReceiveTime() {
+		return acceptanceReceiveTime;
+	}
+
+	public void setAcceptanceReceiveTime(String acceptanceReceiveTime) {
+		this.acceptanceReceiveTime = acceptanceReceiveTime;
+	}
+
+	public String getAcceptanceIssueTime() {
+		return acceptanceIssueTime;
+	}
+
+	public void setAcceptanceIssueTime(String acceptanceIssueTime) {
+		this.acceptanceIssueTime = acceptanceIssueTime;
+	}
+
+	public String getAcceptanceTrackingNumber() {
+		return acceptanceTrackingNumber;
+	}
+
+	public void setAcceptanceTrackingNumber(String acceptanceTrackingNumber) {
+		this.acceptanceTrackingNumber = acceptanceTrackingNumber;
+	}
+
+	public String getAcceptanceExpressCompany() {
+		return acceptanceExpressCompany;
+	}
+
+	public void setAcceptanceExpressCompany(String acceptanceExpressCompany) {
+		this.acceptanceExpressCompany = acceptanceExpressCompany;
+	}
+
+	public String getAuthorizationReceiveTime() {
+		return authorizationReceiveTime;
+	}
+
+	public void setAuthorizationReceiveTime(String authorizationReceiveTime) {
+		this.authorizationReceiveTime = authorizationReceiveTime;
+	}
+
+	public String getAuthorizationIssueTime() {
+		return authorizationIssueTime;
+	}
+
+	public void setAuthorizationIssueTime(String authorizationIssueTime) {
+		this.authorizationIssueTime = authorizationIssueTime;
+	}
+
+	public String getAuthorizationTrackingNumber() {
+		return authorizationTrackingNumber;
+	}
+
+	public void setAuthorizationTrackingNumber(String authorizationTrackingNumber) {
+		this.authorizationTrackingNumber = authorizationTrackingNumber;
+	}
+
+	public String getAuthorizationExpressCompany() {
+		return authorizationExpressCompany;
+	}
+
+	public void setAuthorizationExpressCompany(String authorizationExpressCompany) {
+		this.authorizationExpressCompany = authorizationExpressCompany;
+	}
+
+	public String getCertificateRecieveTime() {
+		return certificateRecieveTime;
+	}
+
+	public void setCertificateRecieveTime(String certificateRecieveTime) {
+		this.certificateRecieveTime = certificateRecieveTime;
+	}
+
+	public String getCertificateIssueTime() {
+		return certificateIssueTime;
+	}
+
+	public void setCertificateIssueTime(String certificateIssueTime) {
+		this.certificateIssueTime = certificateIssueTime;
+	}
+
+	public String getCertificateTrackingNumber() {
+		return certificateTrackingNumber;
+	}
+
+	public void setCertificateTrackingNumber(String certificateTrackingNumber) {
+		this.certificateTrackingNumber = certificateTrackingNumber;
+	}
+
+	public String getCertificateExpressCompany() {
+		return certificateExpressCompany;
+	}
+
+	public void setCertificateExpressCompany(String certificateExpressCompany) {
+		this.certificateExpressCompany = certificateExpressCompany;
+	}
+	
+	
+	
+}

+ 301 - 0
src/main/java/com/goafanti/patent/bo/PatentInfoDetailBo.java

@@ -0,0 +1,301 @@
+package com.goafanti.patent.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class PatentInfoDetailBo {
+	private String	id;
+
+	private String	uid;
+
+	private String	unitName;
+
+	private String	orgCode;
+
+	private String	locationProvince;
+
+	private String	locationCity;
+
+	private String	locationArea;
+
+	private Integer	contacts;
+
+	private String	serialNumber;
+
+	private String	patentNumber;
+
+	private String	patentName;
+
+	private String	patentCatagory;
+
+	private Integer	patentState;
+
+	private Integer	patentField;
+
+	private String	patentDes;
+
+	private String	firstInventorName;
+
+	private String	firstInventorNationality;
+
+	private String	firstInventorIdNumber;
+
+	private Integer	firstInventorIsPublish;
+
+	private String	secondInventorName;
+
+	private String	secondInventorNationality;
+
+	private Integer	secondInventorIsPublish;
+
+	private String	thirdInventorName;
+
+	private String	thirdInventorNationality;
+
+	private Integer	thirdInventorIsPublish;
+
+	private String	patentProryStatementUrl;
+
+	private String	patentWritingUrl;
+
+	private String	authorizationNoticeUrl;
+
+	private String	patentCertificateUrl;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getLocationProvince() {
+		return locationProvince;
+	}
+
+	public void setLocationProvince(String locationProvince) {
+		this.locationProvince = locationProvince;
+	}
+
+	public String getLocationCity() {
+		return locationCity;
+	}
+
+	public void setLocationCity(String locationCity) {
+		this.locationCity = locationCity;
+	}
+
+	public String getLocationArea() {
+		return locationArea;
+	}
+
+	public void setLocationArea(String locationArea) {
+		this.locationArea = locationArea;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(Integer contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(String serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public String getPatentNumber() {
+		return patentNumber;
+	}
+
+	public void setPatentNumber(String patentNumber) {
+		this.patentNumber = patentNumber;
+	}
+
+	public String getPatentName() {
+		return patentName;
+	}
+
+	public void setPatentName(String patentName) {
+		this.patentName = patentName;
+	}
+
+	public String getPatentCatagory() {
+		return patentCatagory;
+	}
+
+	public void setPatentCatagory(String patentCatagory) {
+		this.patentCatagory = patentCatagory;
+	}
+
+	public Integer getPatentState() {
+		return patentState;
+	}
+
+	public void setPatentState(Integer patentState) {
+		this.patentState = patentState;
+	}
+
+	public Integer getPatentField() {
+		return patentField;
+	}
+
+	public void setPatentField(Integer patentField) {
+		this.patentField = patentField;
+	}
+
+	public String getPatentDes() {
+		return patentDes;
+	}
+
+	public void setPatentDes(String patentDes) {
+		this.patentDes = patentDes;
+	}
+
+	public String getFirstInventorName() {
+		return firstInventorName;
+	}
+
+	public void setFirstInventorName(String firstInventorName) {
+		this.firstInventorName = firstInventorName;
+	}
+
+	public String getFirstInventorNationality() {
+		return firstInventorNationality;
+	}
+
+	public void setFirstInventorNationality(String firstInventorNationality) {
+		this.firstInventorNationality = firstInventorNationality;
+	}
+
+	public String getFirstInventorIdNumber() {
+		return firstInventorIdNumber;
+	}
+
+	public void setFirstInventorIdNumber(String firstInventorIdNumber) {
+		this.firstInventorIdNumber = firstInventorIdNumber;
+	}
+
+	public Integer getFirstInventorIsPublish() {
+		return firstInventorIsPublish;
+	}
+
+	public void setFirstInventorIsPublish(Integer firstInventorIsPublish) {
+		this.firstInventorIsPublish = firstInventorIsPublish;
+	}
+
+	public String getSecondInventorName() {
+		return secondInventorName;
+	}
+
+	public void setSecondInventorName(String secondInventorName) {
+		this.secondInventorName = secondInventorName;
+	}
+
+	public String getSecondInventorNationality() {
+		return secondInventorNationality;
+	}
+
+	public void setSecondInventorNationality(String secondInventorNationality) {
+		this.secondInventorNationality = secondInventorNationality;
+	}
+
+	public Integer getSecondInventorIsPublish() {
+		return secondInventorIsPublish;
+	}
+
+	public void setSecondInventorIsPublish(Integer secondInventorIsPublish) {
+		this.secondInventorIsPublish = secondInventorIsPublish;
+	}
+
+	public String getThirdInventorName() {
+		return thirdInventorName;
+	}
+
+	public void setThirdInventorName(String thirdInventorName) {
+		this.thirdInventorName = thirdInventorName;
+	}
+
+	public String getThirdInventorNationality() {
+		return thirdInventorNationality;
+	}
+
+	public void setThirdInventorNationality(String thirdInventorNationality) {
+		this.thirdInventorNationality = thirdInventorNationality;
+	}
+
+	public Integer getThirdInventorIsPublish() {
+		return thirdInventorIsPublish;
+	}
+
+	public void setThirdInventorIsPublish(Integer thirdInventorIsPublish) {
+		this.thirdInventorIsPublish = thirdInventorIsPublish;
+	}
+
+
+	public String getPatentProryStatementUrl() {
+		return patentProryStatementUrl;
+	}
+
+	public void setPatentProryStatementUrl(String patentProryStatementUrl) {
+		this.patentProryStatementUrl = patentProryStatementUrl;
+	}
+
+	public String getPatentWritingUrl() {
+		return patentWritingUrl;
+	}
+
+	public void setPatentWritingUrl(String patentWritingUrl) {
+		this.patentWritingUrl = patentWritingUrl;
+	}
+
+	public String getAuthorizationNoticeUrl() {
+		return authorizationNoticeUrl;
+	}
+
+	public void setAuthorizationNoticeUrl(String authorizationNoticeUrl) {
+		this.authorizationNoticeUrl = authorizationNoticeUrl;
+	}
+
+	public String getPatentCertificateUrl() {
+		return patentCertificateUrl;
+	}
+
+	public void setPatentCertificateUrl(String patentCertificateUrl) {
+		this.patentCertificateUrl = patentCertificateUrl;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+	
+	
+
+}

+ 138 - 0
src/main/java/com/goafanti/patent/bo/PatentManageListBo.java

@@ -0,0 +1,138 @@
+package com.goafanti.patent.bo;
+
+import java.util.Date;
+
+public class PatentManageListBo {
+	private String	id;
+
+	private String	uid;
+
+	private Integer	serialNumber;
+
+	private String	patentNumber;
+
+	private String	office;
+	
+	private String locationProvince;
+
+	private String	unitName;
+    
+	private String	patentName;
+
+	private Integer	patentState;
+
+	private Date	createTime;
+
+	private Date	patentApplicationDate;
+
+	private Date	authorizedDate;
+
+	private String	author;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public String getPatentNumber() {
+		return patentNumber;
+	}
+
+	public void setPatentNumber(String patentNumber) {
+		this.patentNumber = patentNumber;
+	}
+
+	public String getOffice() {
+		return office;
+	}
+
+	public void setOffice(String office) {
+		this.office = office;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public String getLocationProvince() {
+		return locationProvince;
+	}
+
+	public void setLocationProvince(String locationProvince) {
+		this.locationProvince = locationProvince;
+	}
+
+	public String getPatentName() {
+		return patentName;
+	}
+
+	public void setPatentName(String patentName) {
+		this.patentName = patentName;
+	}
+
+	public Integer getPatentState() {
+		return patentState;
+	}
+
+	public void setPatentState(Integer patentState) {
+		this.patentState = patentState;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getPatentApplicationDate() {
+		return patentApplicationDate;
+	}
+
+	public void setPatentApplicationDate(Date patentApplicationDate) {
+		this.patentApplicationDate = patentApplicationDate;
+	}
+
+	public Date getAuthorizedDate() {
+		return authorizedDate;
+	}
+
+	public void setAuthorizedDate(Date authorizedDate) {
+		this.authorizedDate = authorizedDate;
+	}
+
+	public String getAuthor() {
+		return author;
+	}
+
+	public void setAuthor(String author) {
+		this.author = author;
+	}
+	
+	
+
+}

+ 1 - 1
src/main/java/com/goafanti/patent/bo/PatentRegistrationBo.java

@@ -2,7 +2,7 @@ package com.goafanti.patent.bo;
 
 
 public class PatentRegistrationBo {
-	 /**
+	 	/**
 	    * 受理通知书收到时间
 	    */
 	    private String acceptanceReceiveTime;

+ 123 - 59
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -13,14 +13,17 @@ 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.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.util.CellRangeAddress;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -29,21 +32,26 @@ import org.springframework.web.multipart.MultipartFile;
 import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.PatentInfoFields;
+import com.goafanti.common.enums.PatentInfoStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentCost;
 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.utils.DateUtils;
 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.patent.bo.InputPatentInfo;
 import com.goafanti.patent.bo.PatentApplicationFeeBo;
 import com.goafanti.patent.bo.PatentCompositeBo;
+import com.goafanti.patent.bo.PatentManageListBo;
 import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
 import com.goafanti.patent.bo.PatentPendingBo;
 import com.goafanti.patent.bo.PatentRecieveSendBo;
@@ -58,7 +66,7 @@ import com.goafanti.user.service.UserService;
 
 @Controller
 @RequestMapping(value = "/techservice/patent")
-public class PatentApiController extends BaseApiController {
+public class PatentApiController extends CertifyApiController {
 	@Resource
 	private PatentInfoService				patentInfoService;
 	@Resource
@@ -83,30 +91,28 @@ public class PatentApiController extends BaseApiController {
 	 * 用户端专利申请
 	 */
 	@RequestMapping(value = "/clientApplyPatent", method = RequestMethod.POST)
-	public Result clientApplyPatent(PatentInfo patentInfo) {
+	public Result clientApplyPatent(@Valid InputPatentInfo patentInfo, BindingResult bindingResult) {
 		Result res = new Result();
-		res = checkCertify(res, TokenManager.getUserId());
-		if (res.getError().isEmpty()) {
-			res.setData(patentInfoService.savePatentInfo(patentInfo, TokenManager.getUserId(),
-					TokenManager.getToken().getAid()));
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
 		}
-		return res;
-	}
 
-	/**
-	 * 删除专利记录
-	 * 
-	 * @param ids
-	 * @return
-	 */
-	@RequestMapping(value = "/deletePatent", method = RequestMethod.POST)
-	public Result deletePatent(@RequestParam(name = "ids[]", required = true) String[] ids) {
-		Result res = new Result();
-		List<String> id = new ArrayList<String>();
-		for (String s : ids) {
-			id.add(s);
+		if (!checkUserLogin(res)) {
+			return res;
 		}
-		res.setData(patentInfoService.batchDeleteByPrimaryKey(id));
+
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+
+		String aid = curUser.getAid();
+		PatentInfo pi = new PatentInfo();
+		BeanUtils.copyProperties(patentInfo, pi);
+		pi.setUid(TokenManager.getUserId());
+		res.setData(patentInfoService.savePatentInfo(pi, aid));
 		return res;
 	}
 
@@ -114,9 +120,22 @@ public class PatentApiController extends BaseApiController {
 	 * 用户端专利详情
 	 * 
 	 */
-	@RequestMapping(value = "/clientPatentInfo", method = RequestMethod.POST)
+	@RequestMapping(value = "/clientPatentInfo", method = RequestMethod.GET)
 	public Result clientPatentInfo(String pid) {
 		Result res = new Result();
+		if (!checkUserLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
+		} else {
+			PatentInfo pi = patentInfoService.selectByPrimaryKey(pid);
+			if (null != pi.getUid() && pi.getUid().equals(TokenManager.getUserId())) {
+				res.setData(pi);
+			} else {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
+			}
+		}
 		res.setData(patentInfoService.selectByPrimaryKey(pid));
 		return res;
 	}
@@ -124,34 +143,96 @@ public class PatentApiController extends BaseApiController {
 	/**
 	 * 用户端申请专利列表
 	 */
-	@RequestMapping(value = "/clientApplyList", method = RequestMethod.POST)
+	@RequestMapping(value = "/clientApplyList", method = RequestMethod.GET)
 	public Result clientApplyList(String patentNumber, String patentName, Integer patentCatagory, Integer patentState,
 			String pageNo, String pageSize) {
 		Result res = new Result();
-		res = checkCertify(res, TokenManager.getUserId());
-		if (res.getError().isEmpty()) {
-			Integer pNo = 1;
-			Integer pSize = 10;
+		if (!checkUserLogin(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(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
 		}
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
 		return res;
 	}
 
 	/**
-	 * 用户端申请专利当前流程/管理端专利详情-专利状态流转记录
+	 * 用户端logs
 	 */
-	@RequestMapping(value = "/patentProcess", method = RequestMethod.POST)
+	@RequestMapping(value = "/patentProcess", method = RequestMethod.GET)
 	public Result patentProcess(String pid) {
 		Result res = new Result();
-		List<PatentLog> patentLog = patentLogService.selectProcessByPid(pid);
-		res.setData(patentLog);
+		if (!checkUserLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
+			return res;
+		}
+		PatentInfo pi = patentInfoService.selectByPrimaryKey(pid);
+		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());
+				}
+			}
+			res.setData(list);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利d"));
+		}
+		return res;
+	}
+
+	/**
+	 * 用户确认申报材料
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/clientConfirm", method = RequestMethod.POST)
+	public Result clientConfirmApplicationMaterials(String pid) {
+		Result res = new Result();
+		if (!checkUserLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(pid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利d"));
+			return res;
+		}
+		PatentInfo p = new PatentInfo();
+		p.setId(pid);
+		p.setConfirmState(1);
+		res.setData(patentInfoService.updateByPrimaryKeySelective(p));
+		return res;
+	}
+
+	/**
+	 * 删除专利记录
+	 * 
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/deletePatent", method = RequestMethod.POST)
+	public Result deletePatent(@RequestParam(name = "ids[]", required = true) String[] ids) {
+		Result res = new Result();
+		List<String> id = new ArrayList<String>();
+		for (String s : ids) {
+			id.add(s);
+		}
+		res.setData(patentInfoService.batchDeleteByPrimaryKey(id));
 		return res;
 	}
 
@@ -219,7 +300,7 @@ public class PatentApiController extends BaseApiController {
 		res = checkCertify(res, uid);
 		if (res.getError().isEmpty()) {
 			String aid = userService.selectByPrimaryKey(uid).getAid();
-			res.setData(patentInfoService.savePatentInfo(patentInfo, uid, aid));
+			res.setData(patentInfoService.savePatentInfo(patentInfo, aid));
 		}
 		return res;
 	}
@@ -316,9 +397,7 @@ public class PatentApiController extends BaseApiController {
 	@RequestMapping(value = "/replyConfirm", method = RequestMethod.POST)
 	public Result replyConfirm(String pid, Integer patentState) {
 		Result res = new Result();
-		if (StringUtils.isBlank(patentInfoService.updateNoticeOfCorrection(res, pid, patentState))) {
-			res.getError().add(buildError("", "确认失败!"));
-		}
+		patentInfoService.updateNoticeOfCorrection(pid, patentState);
 		return res;
 	}
 
@@ -392,21 +471,6 @@ public class PatentApiController extends BaseApiController {
 	}
 
 	/**
-	 * 用户确认申报材料
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/clientConfirm", method = RequestMethod.POST)
-	public Result clientConfirmApplicationMaterials(String pid) {
-		Result res = new Result();
-		PatentInfo p = new PatentInfo();
-		p.setId(pid);
-		p.setConfirmState(1);
-		res.setData(patentInfoService.updateByPrimaryKeySelective(p));
-		return res;
-	}
-
-	/**
 	 * 专利综合管理报表导出
 	 * 
 	 * @throws ParseException
@@ -709,7 +773,7 @@ public class PatentApiController extends BaseApiController {
 	}
 
 	// 管理端申请专利列表(专利综合管理)
-	private Pagination<PatentCompositeBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
+	private Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
 			String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
 			throws ParseException {

+ 2 - 0
src/main/java/com/goafanti/patent/service/PatentCostService.java

@@ -15,5 +15,7 @@ public interface PatentCostService {
 
 	PatentCost insert(PatentCost patentCost);
 
+	PatentCost selectByPrimaryKey(String cid);
+
 
 }

+ 7 - 9
src/main/java/com/goafanti/patent/service/PatentInfoService.java

@@ -1,20 +1,18 @@
 package com.goafanti.patent.service;
 
-import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.patent.bo.PatentCompositeBo;
+import com.goafanti.patent.bo.PatentInfoDetailBo;
+import com.goafanti.patent.bo.PatentManageListBo;
 import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
 import com.goafanti.patent.bo.PatentPendingBo;
 
 public interface PatentInfoService {
 
-
 	PatentInfo insert(PatentInfo patentInfo);
 
 	int updateByPrimaryKeySelective(PatentInfo patentInfo);
@@ -24,10 +22,9 @@ public interface PatentInfoService {
 	Pagination<PatentInfo> getClientApplyList(String userId, String patentNumber, String patentName,
 			Integer parentCatagory, Integer patentState, Integer pNo, Integer pSize);
 
-	Pagination<PatentCompositeBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
+	Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			String[] createTime, String[] patentApplicationDate,  String author, Integer pNo,
-			Integer pSize)  throws ParseException;
+			String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize);
 
 	Pagination<PatentPendingBo> getManagePendingPaymentList(String locationProvince, Integer pNo, Integer pSize);
 
@@ -37,11 +34,12 @@ public interface PatentInfoService {
 
 	int batchDeleteByPrimaryKey(List<String> id);
 
-	PatentInfo savePatentInfo(PatentInfo patentInfo, String uid, String aid);
+	PatentInfo savePatentInfo(PatentInfo patentInfo, String aid);
 
 	void updatePatentInfo(PatentInfo patentInfo, PatentLog patentLog, Date recordTime);
 
-	String updateNoticeOfCorrection(Result res, String pid, Integer patentState);
+	void updateNoticeOfCorrection(String pid, Integer patentState);
 
+	PatentInfoDetailBo selectPatentInfoDetail(String pid);
 
 }

+ 5 - 0
src/main/java/com/goafanti/patent/service/impl/PatentCostServiceImpl.java

@@ -68,4 +68,9 @@ public class PatentCostServiceImpl extends BaseMybatisDao<PatentCostMapper> impl
 		return patentCost;
 	}
 
+	@Override
+	public PatentCost selectByPrimaryKey(String id) {
+		return patentCostMapper.selectByPrimaryKey(id);
+	}
+
 }

+ 87 - 71
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -11,13 +11,14 @@ import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.dao.PatentCostMapper;
 import com.goafanti.common.dao.PatentInfoMapper;
 import com.goafanti.common.dao.PatentLogMapper;
 import com.goafanti.common.dao.PatentRegistrationMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.PatentInfoStatus;
+import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.PatentCost;
@@ -29,7 +30,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.patent.bo.PatentCompositeBo;
+import com.goafanti.patent.bo.PatentInfoDetailBo;
+import com.goafanti.patent.bo.PatentManageListBo;
 import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
 import com.goafanti.patent.bo.PatentPendingBo;
 import com.goafanti.patent.service.PatentInfoService;
@@ -49,7 +51,6 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	@Autowired
 	OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 
-
 	@Override
 	public PatentInfo insert(PatentInfo patentInfo) {
 		patentInfoMapper.insert(patentInfo);
@@ -107,9 +108,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<PatentCompositeBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
+	public Pagination<PatentManageListBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
 			String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
-			String[] cDate, String[] pDate, String author, Integer pageNo, Integer pageSize) throws ParseException {
+			String[] cDate, String[] pDate, String author, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 		Date cStart = null;
 		Date cEnd = null;
@@ -117,12 +118,21 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		Date pEnd = null;
 
 		if (cDate != null && cDate.length > 0) {
-			cStart = StringUtils.isBlank(cDate[0]) ? null : DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
-		    cEnd = StringUtils.isBlank(cDate[1]) ? null : DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
+			try {
+				cStart = StringUtils.isBlank(cDate[0]) ? null : DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
+				cEnd = StringUtils.isBlank(cDate[1]) ? null
+						: DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
+			} catch (ParseException e) {
+			}
 		}
 		if (pDate != null && pDate.length > 0) {
-			pStart = StringUtils.isBlank(pDate[0]) ? null : DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
-			pEnd = StringUtils.isBlank(pDate[1]) ? null :  DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
+			try {
+				pStart = StringUtils.isBlank(pDate[0]) ? null : DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
+				pEnd = StringUtils.isBlank(pDate[1]) ? null
+						: DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
+			} catch (ParseException e) {
+			}
+			
 		}
 
 		if (cStart != null) {
@@ -184,7 +194,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 		}
-		return (Pagination<PatentCompositeBo>) findPage("findManagePatentListByPage", "findManagePatentCount", params,
+		return (Pagination<PatentManageListBo>) findPage("findManagePatentListByPage", "findManagePatentCount", params,
 				pageNo, pageSize);
 	}
 
@@ -273,15 +283,14 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	}
 
 	@Override
-	public PatentInfo savePatentInfo(PatentInfo patentInfo, String uid, String aid) {
+	public PatentInfo savePatentInfo(PatentInfo patentInfo, String aid) {
 		patentInfo.setId(UUID.randomUUID().toString());
-		patentInfo.setUid(uid);
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		patentInfo.setRecordTime(now.getTime());
 		patentInfo.setDeletedSign(0);
 		patentInfo.setConfirmState(0);
-		patentInfo.setPatentState(1);
+		patentInfo.setPatentState(PatentInfoStatus.CREATE.getCode());
 		patentInfo.setPrincipal(aid);
 		patentInfoMapper.insert(patentInfo);
 
@@ -301,9 +310,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setId(UUID.randomUUID().toString());
 		log.setPid(patentInfo.getId());
 		log.setRecordTime(patentInfo.getCreateTime());
-		log.setState(1);
+		log.setState(PatentInfoStatus.CREATE.getCode());
 		log.setPrincipal(aid);
-		if (TokenManager.getToken() instanceof  Admin) {
+		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 		}
 		patentLogMapper.insert(log);
@@ -311,79 +320,80 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	}
 
 	@Override
-	public void updatePatentInfo(PatentInfo patentInfo, PatentLog patentLog, Date recordTime) {
-		if (null != patentLog.getState() && recordTime != null) {
-			switch (patentLog.getState()) {
-			case 2:
-				patentInfo.setCreateTime(recordTime);
-				break;
-			case 3:
-				patentInfo.setPatentApplicationDate(recordTime);
-				break;
-			case 8:
-				patentInfo.setAuthorizedDate(recordTime);
-				break;
+	public void updatePatentInfo(PatentInfo p, PatentLog log, Date recordTime) {
+		if (null != log.getState() && recordTime != null && null != log.getPrincipal()) {
+			log.setId(UUID.randomUUID().toString());
+			log.setPid(p.getId());
+			log.setRecordTime(recordTime);
+			if (TokenManager.getToken() instanceof Admin) {
+				log.setOperator(TokenManager.getAdminId());
+			}
+			if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.DELIVERD) {
+				p.setCreateTime(recordTime);
+			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.ACCEPT) {
+				p.setPatentApplicationDate(recordTime);
+			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.AUTHORIZE) {
+				p.setAuthorizedDate(recordTime);
+			}
+
+			if (TechProjectStatus.getStatus(log.getState()) != TechProjectStatus.CIRCULATION) {
+				p.setPatentState(log.getState());
 			}
-			patentInfo.setPatentState(patentLog.getState());
-			patentInfo.setPrincipal(null == patentLog.getPrincipal() ? "" : patentLog.getPrincipal());
-			patentLog.setPid(patentInfo.getId());
-			patentLog.setId(UUID.randomUUID().toString());
-			patentLog.setRecordTime(recordTime);
-			patentLog.setOperator(TokenManager.getAdminId());
-			patentLogMapper.insert(patentLog);
+			p.setPrincipal(log.getPrincipal());
+			patentLogMapper.insert(log);
 		}
-		patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
-		if (8 == patentInfo.getPatentState()) {
+		patentInfoMapper.updateByPrimaryKeySelective(p);
+		if (PatentInfoStatus.getStatus(p.getPatentState()) == PatentInfoStatus.AUTHORIZE) {
 			OrgIntellectualProperty o = new OrgIntellectualProperty();
 			o.setId(UUID.randomUUID().toString());
-			o.setUid(patentInfo.getUid());
-			o.setPid(patentInfo.getId());
+			o.setUid(p.getUid());
+			o.setPid(p.getId());
 			o.setDeletedSign(0);
-			o.setIntellectualPropertyNumber(patentInfo.getPatentNumber());
-			o.setIntellectualPropertyName(patentInfo.getPatentName());
+			o.setIntellectualPropertyNumber(p.getPatentNumber());
+			o.setIntellectualPropertyName(p.getPatentName());
 			o.setCatagory(1);
 			o.setObtainWay(1);
-			o.setAuthorizationNumber(patentInfo.getPatentNumber());
-			o.setAuthorizationDate(patentInfo.getAuthorizedDate());
-			o.setEvaluationCategory((3 == patentInfo.getPatentCatagory()) ? 0 : 1);
+			o.setAuthorizationNumber(p.getPatentNumber());
+			o.setAuthorizationDate(p.getAuthorizedDate());
+			o.setEvaluationCategory((3 == p.getPatentCatagory()) ? 0 : 1);
 			orgIntellectualPropertyMapper.insert(o);
 		}
 
-		if (10 == patentInfo.getPatentState()) {
-			OrgIntellectualProperty o = orgIntellectualPropertyMapper
-					.selectOrgIntellectualPropertyByPid(patentInfo.getId());
-			Integer i = 0;
-			switch (patentInfo.getPatentCatagory()) {
-			case 0:
-				i = 0;
-				break;
-			case 1:
-				i = 2;
-				break;
-			case 2:
-				i = 3;
-				break;
-			case 3:
-				i = 11;
-				break;
+		if (PatentInfoStatus.getStatus(p.getPatentState()) == PatentInfoStatus.LICENSE) {
+			OrgIntellectualProperty o = orgIntellectualPropertyMapper.selectOrgIntellectualPropertyByPid(p.getId());
+			if (null != o) {
+				Integer i = 0;
+				switch (p.getPatentCatagory()) {
+				case 0:
+					i = 0;
+					break;
+				case 1:
+					i = 2;
+					break;
+				case 2:
+					i = 3;
+					break;
+				case 3:
+					i = 11;
+					break;
+				}
+				o.setCatagory(i);
+				orgIntellectualPropertyMapper.updateByPrimaryKeySelective(o);
 			}
-			o.setCatagory(i);
-			orgIntellectualPropertyMapper.updateByPrimaryKeySelective(o);
 		}
 	}
 
 	@Override
-	public  String updateNoticeOfCorrection(Result res, String pid, Integer patentState) {
+	public void updateNoticeOfCorrection(String pid, Integer patentState) {
 		PatentInfo patentInfo = new PatentInfo();
 		patentInfo.setId(pid);
-		if (patentState == 4) {
-			patentInfo.setPatentState(5);
-		} else if (patentState == 6) {
-			patentInfo.setPatentState(7);
-		} else {
-			return "";
-		}
+		if (patentState == PatentInfoStatus.REVIEWNOTICE.getCode()) {
+			patentInfo.setPatentState(PatentInfoStatus.REVIEWREPLY.getCode());
+		} else if (patentState == PatentInfoStatus.CORRECTIONNOTICE.getCode()) {
+			patentInfo.setPatentState(PatentInfoStatus.CORRECTIONREPLY.getCode());
+		} 
 		patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
+		
 		PatentLog patentLog = new PatentLog();
 		PatentInfo p = patentInfoMapper.selectByPrimaryKey(pid);
 		patentLog.setId(UUID.randomUUID().toString());
@@ -391,11 +401,17 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		patentLog.setState(p.getPatentState());
 		patentLog.setOperator(TokenManager.getAdminId());
 		patentLog.setPrincipal(p.getPrincipal());
+		
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		patentLog.setRecordTime(now.getTime());
+		
 		patentLogMapper.insert(patentLog);
-		return "success";
+	}
+
+	@Override
+	public PatentInfoDetailBo selectPatentInfoDetail(String id) {
+		return patentInfoMapper.selectPatentInfoDetail(id);
 	}
 
 }

+ 34 - 0
src/main/java/com/goafanti/techproject/bo/InputTechProject.java

@@ -54,6 +54,40 @@ public class InputTechProject {
 	
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String approvalUrl;
+	
+	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer		state;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		principal;
+	
+	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String		comment;
+
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
      
 	public String getId() {
 		return id;

+ 0 - 47
src/main/java/com/goafanti/techproject/bo/InputTechProjectLog.java

@@ -1,47 +0,0 @@
-package com.goafanti.techproject.bo;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.Size;
-
-import com.goafanti.common.constant.ErrorConstants;
-
-public class InputTechProjectLog {
-	
-	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer		state;
-
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		principal;
-	
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		comment;
-
-	public Integer getState() {
-		return state;
-	}
-
-	public void setState(Integer state) {
-		this.state = state;
-	}
-
-	public String getPrincipal() {
-		return principal;
-	}
-
-	public void setPrincipal(String principal) {
-		this.principal = principal;
-	}
-
-	public String getComment() {
-		return comment;
-	}
-
-	public void setComment(String comment) {
-		this.comment = comment;
-	}
-	
-	
-
-}

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

@@ -1,11 +1,11 @@
 package com.goafanti.techproject.controller;
 
-import java.io.IOException;
 import java.text.ParseException;
 import java.util.List;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 import org.springframework.beans.BeanUtils;
@@ -13,16 +13,15 @@ import org.springframework.stereotype.Controller;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.multipart.MultipartFile;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.CopyrightFields;
+import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.model.TechProject;
+import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.common.model.User;
-import com.goafanti.common.utils.FileUtils;
-import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.techproject.bo.InputTechProject;
@@ -40,6 +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){
+		Result res = new Result();
+		 res.setData(techWebsiteService.getDepartment(TokenManager.getUserId()));
+		 return res;
+	}
 
 	/**
 	 * 科技项目申报列表
@@ -135,7 +145,19 @@ public class TechProjectApiController extends CertifyApiController {
 		}
 		TechProject tp = techProjectService.selectByPrimaryKey(pid);
 		if (null != tp.getUid() && tp.getUid().equals(TokenManager.getUserId())){
-			res.setData(techProjectLogService.selectTechProjectLogByPid(pid));
+			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());
+				}
+			}
+			res.setData(list);
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目id"));
 		}
@@ -202,31 +224,40 @@ public class TechProjectApiController extends CertifyApiController {
 		}
 		
 		String sign = "tech_project";
-		res.setData(handleFile(res, "/techProject/", true, req, sign, uid));
+		res.setData(handleFiles(res, "/techProject/", true, req, sign, uid));
 		return res;
 	}
-
-	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
-			String uid) {
-		List<MultipartFile> files = getFiles(req);
-		MultipartFile mf = files.get(0);
-
-		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
-				StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
-		if (!files.isEmpty()) {
-			try {
-				mf.transferTo(toPrivateFile(fileName));
-				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
-			} catch (IllegalStateException | IOException e) {
-				LoggerUtils.error(getClass(), "文件上传失败", e);
-				res.getError().add(buildError("", "文件上传失败!"));
-				return "";
-			}
-		} else {
-			res.getError().add(buildError("", "文件上传失败!"));
-			return "";
+	
+	/**
+	 * 科技项目资料下载
+	 * @param id
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(String id, HttpServletResponse response){
+		Result res = new Result();
+		if (!checkUserLogin(res)) {
+			return res;
+		}
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
+			return res;
+		}
+		
+		TechProject t = techProjectService.selectByPrimaryKey(id);
+		if (null == t || !curUser.getId().equals(t.getUid())){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目ID"));
+			return res;
 		}
-		return fileName;
+		
+		downloadFile(response, t.getApprovalDownloadFileName(), t.getApprovalUrl());
+		return res;
 	}
 
+
 }

+ 27 - 23
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectMapper;
+import com.goafanti.common.enums.TechProjectStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
@@ -23,18 +24,19 @@ import com.goafanti.techproject.bo.TechProjectClientListBo;
 import com.goafanti.techproject.bo.TechProjectDetailBo;
 import com.goafanti.techproject.bo.TechProjectManageListBo;
 import com.goafanti.techproject.service.TechProjectService;
+
 @Service
 public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> implements TechProjectService {
 	@Autowired
-	private TechProjectMapper techProjectMapper;
+	private TechProjectMapper		techProjectMapper;
 	@Autowired
-	private TechProjectLogMapper techProjectLogMapper;
+	private TechProjectLogMapper	techProjectLogMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TechProjectClientListBo> listClientTechProject(String uid, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
-		
+
 		params.put("uid", uid);
 
 		if (pageNo == null || pageNo < 0) {
@@ -44,51 +46,53 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 		}
-		return (Pagination<TechProjectClientListBo>)findPage("findTechProjectClientListByPage",
+		return (Pagination<TechProjectClientListBo>) findPage("findTechProjectClientListByPage",
 				"findTechProjectClientCount", params, pageNo, pageSize);
 	}
 
 	@Override
 	public int updateTechProject(TechProject t, TechProjectLog log, Date recordTime) {
-		if (null != recordTime && null != log.getState()) {
+		if (null != recordTime && null != log.getState() && null != log.getPrincipal()) {
 			log.setId(UUID.randomUUID().toString());
 			log.setPid(t.getId());
 			log.setRecordTime(recordTime);
-			switch (log.getState()) {
-			case 1:
+			if (TokenManager.getToken() instanceof Admin) {
+				log.setOperator(TokenManager.getAdminId());
+			}
+			if (TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.DELIVERD) {
 				t.setCreateTime(recordTime);
-				break;
-			case 2:
+			} else if (TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.ACCEPT) {
 				t.setAcceptDate(recordTime);
-				break;
-			case 5:
+			} else if (TechProjectStatus.getStatus(log.getState()) == TechProjectStatus.APPRVOVED) {
 				t.setApprovedDate(recordTime);
-				break;
 			}
-			t.setState(log.getState());
+
+			if (TechProjectStatus.getStatus(log.getState()) != TechProjectStatus.CIRCULATION) {
+				t.setState(log.getState());
+			}
 			techProjectLogMapper.insert(log);
 		}
-		
+
 		return techProjectMapper.updateByPrimaryKeySelective(t);
 	}
 
 	@Override
-	public void saveTechProject(TechProject techProject,  String aid) {
+	public void saveTechProject(TechProject techProject, String aid) {
 		techProject.setId(UUID.randomUUID().toString());
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		techProject.setRecordTime(now.getTime());
-		techProject.setState(0);
+		techProject.setState(TechProjectStatus.CREATE.getCode());
 		techProject.setDeletedSign(0);
-	    techProjectMapper.insert(techProject);
-		
+		techProjectMapper.insert(techProject);
+
 		TechProjectLog log = new TechProjectLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setPid(techProject.getId());
 		log.setRecordTime(techProject.getRecordTime());
 		log.setPrincipal(aid);
-		log.setState(0);
-		if (TokenManager.getToken() instanceof  Admin) {
+		log.setState(TechProjectStatus.CREATE.getCode());
+		if (TokenManager.getToken() instanceof Admin) {
 			log.setOperator(TokenManager.getAdminId());
 		}
 		techProjectLogMapper.insert(log);
@@ -99,10 +103,10 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	public Pagination<TechProjectManageListBo> listManageTechProject(String province, String unitName, Integer pageNo,
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
-		if (!StringUtils.isBlank(province)){
+		if (!StringUtils.isBlank(province)) {
 			params.put("province", province);
 		}
-		if (!StringUtils.isBlank(unitName)){
+		if (!StringUtils.isBlank(unitName)) {
 			params.put("unitName", unitName);
 		}
 		if (pageNo == null || pageNo < 0) {
@@ -112,7 +116,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 		}
-		return (Pagination<TechProjectManageListBo>)findPage("findTechProjectManageListByPage",
+		return (Pagination<TechProjectManageListBo>) findPage("findTechProjectManageListByPage",
 				"findTechProjectManageCount", params, pageNo, pageSize);
 	}
 

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

@@ -843,26 +843,17 @@ public class UserApiController extends BaseApiController {
 	}
 	
 	
-	/**
-	 * 获取科技部门
-	 * @return
-	 */
-	@RequestMapping(value = "/getDepartment", method = RequestMethod.POST)
-	public Result getDepartment(String uid){
-		Result res = new Result();
-		 res.setData(techWebsiteService.getDepartment(null == uid ? TokenManager.getUserId() : uid));
-		 return res;
-	}
+	
 	
 	/**
 	 * 获取公司联系人
 	 * @param uid
 	 * @return
 	 */
-	@RequestMapping(value = "/getContacts", method = RequestMethod.POST)
-	public Result getContacts(String uid){
+	@RequestMapping(value = "/getContacts", method = RequestMethod.GET)
+	public Result getContacts(){
 		Result res = new Result();
-		res.setData(organizationIdentityService.selectContactsByUserId(StringUtils.isBlank(uid) ? TokenManager.getUserId() :uid ));
+		res.setData(organizationIdentityService.selectContactsByUserId(TokenManager.getUserId()));
 		return res;
 	}
 	

+ 11 - 0
src/main/webapp/WEB-INF/views/admin/set.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../header.jsp"%>
+<title>设置页面</title>
+<link href="${staticHost}/admin/set.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/admin/set.js"></script>
+</body>
+</html>