Antiloveg 8 years ago
parent
commit
10e4bdd876

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


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

@@ -2,12 +2,20 @@ 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;
@@ -20,6 +28,7 @@ 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;
@@ -28,10 +37,16 @@ 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.PatentRegistrationBo;
+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;
@@ -204,6 +219,25 @@ public class AdminPatentApiController extends CertifyApiController {
 				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;
+	}
 
 	/**
 	 * 待缴费专利管理列表
@@ -364,6 +398,301 @@ public class AdminPatentApiController extends CertifyApiController {
 		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();
@@ -416,5 +745,100 @@ public class AdminPatentApiController extends CertifyApiController {
 		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;
+		}
 
 }

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

@@ -54,16 +54,20 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	private TechProjectLogService	techProjectLogService;
 	@Resource
 	private UserService				userService;
-	
+
 	/**
 	 * 获取科技部门
+	 * 
 	 * @return
 	 */
 	@RequestMapping(value = "/getDepartment", method = RequestMethod.GET)
-	public Result getDepartment(String uid){
+	public Result getDepartment(String uid) {
 		Result res = new Result();
-		 res.setData(techWebsiteService.getDepartment(uid));
-		 return res;
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		res.setData(techWebsiteService.getDepartment(uid));
+		return res;
 	}
 
 	/**
@@ -187,8 +191,8 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/updateTechProject", method = RequestMethod.POST)
-	public Result updateTechProject(@Valid InputTechProject techProject,
-			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(),

+ 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;
 	}
 

+ 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;
+	}
+}

+ 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 - 746
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>

+ 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;
+	}
+	
+	
+}

+ 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;
+	}
+	
+	
+
+}

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

@@ -12,10 +12,10 @@ public class PatentManageListBo {
 	private String	patentNumber;
 
 	private String	office;
+	
+	private String locationProvince;
 
 	private String	unitName;
-
-    private String locationProvince;
     
 	private String	patentName;
 

+ 123 - 58
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,19 +32,23 @@ 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;
@@ -59,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
@@ -77,7 +84,6 @@ public class PatentApiController extends BaseApiController {
 	@Resource
 	private UserService						userService;
 
-
 	@Value(value = "${upload.private.path}")
 	private String							uploadPrivatePath	= null;
 
@@ -85,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()) {
-			patentInfo.setUid(TokenManager.getUserId());
-			res.setData(patentInfoService.savePatentInfo(patentInfo, 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;
 	}
 
@@ -116,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;
 	}
@@ -126,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;
 	}
 
@@ -196,7 +275,7 @@ public class PatentApiController extends BaseApiController {
 		res.setData(map);
 		return res;
 	}
-	
+
 	/**
 	 * 获取管理员
 	 */
@@ -228,7 +307,8 @@ public class PatentApiController extends BaseApiController {
 
 	/**
 	 * 管理端专利详情修改保存
-	 * @throws ParseException 
+	 * 
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/managePatentInfo", method = RequestMethod.POST)
 	public Result managePatentInfo(String patentNumber, String patentName, String patentCatagory, String patentField,
@@ -248,7 +328,7 @@ public class PatentApiController extends BaseApiController {
 		patentInfo.setPatentCertificateUrl(patentCertificateUrl);
 		Date recordTime = null;
 		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
-			 recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
+			recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
 		}
 		patentInfoService.updatePatentInfo(patentInfo, patentLog, recordTime);
 
@@ -391,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

+ 3 - 0
src/main/java/com/goafanti/patent/service/PatentInfoService.java

@@ -6,6 +6,7 @@ import java.util.List;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.patent.bo.PatentInfoDetailBo;
 import com.goafanti.patent.bo.PatentManageListBo;
 import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
 import com.goafanti.patent.bo.PatentPendingBo;
@@ -39,4 +40,6 @@ public interface PatentInfoService {
 
 	void updateNoticeOfCorrection(String pid, Integer patentState);
 
+	PatentInfoDetailBo selectPatentInfoDetail(String pid);
+
 }

+ 6 - 0
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -30,6 +30,7 @@ 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.PatentInfoDetailBo;
 import com.goafanti.patent.bo.PatentManageListBo;
 import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
 import com.goafanti.patent.bo.PatentPendingBo;
@@ -408,4 +409,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		patentLogMapper.insert(patentLog);
 	}
 
+	@Override
+	public PatentInfoDetailBo selectPatentInfoDetail(String id) {
+		return patentInfoMapper.selectPatentInfoDetail(id);
+	}
+
 }