Antiloveg 8 years ago
parent
commit
f17dde5eee

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

@@ -829,11 +829,11 @@ public class AdminPatentApiController extends CertifyApiController {
 	 */
 	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
-	public Result exportComposite(String contractId,
+	public Result exportComposite(@RequestParam(name = "contractId", required = false) String contractId,
 			@RequestParam(name = "serialNumber", required = false) String serialNumber, String patentNumber,
-			String office, Integer locationProvince, String unitName, String uid,
-			@RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName,
-			@RequestParam(name = "patentState", required = false) String patentState,
+			String office, @RequestParam(name = "locationProvince", required = false) Integer locationProvince,
+			String unitName, String uid, @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 {
@@ -1017,8 +1017,8 @@ public class AdminPatentApiController extends CertifyApiController {
 
 	private void exportComosites(HttpServletResponse response, List<PatentManageListBo> composites) {
 		String sheetName = "专利综合管理报表";
-		HSSFWorkbook workbook = createWorkbook(sheetName,
-				new String[] { "编号", "申请号/专利号", "事务所", "省份", "公司名称", "专利名称", "专利状态", "派单日", "申请日", "授权日", "资料撰写人" });
+		HSSFWorkbook workbook = createWorkbook(sheetName, new String[] { "编号", "申请号/专利号", "合同编号", "事务所", "省份", "公司名称",
+				"专利名称", "专利状态", "派单日", "申请日", "授权日", "资料撰写人" });
 		HSSFSheet sheet = workbook.getSheet(sheetName);
 
 		// 将查询出的数据设置到sheet对应的单元格中
@@ -1028,16 +1028,17 @@ public class AdminPatentApiController extends CertifyApiController {
 			HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
 			row.createCell(0).setCellValue(null == obj.getSerialNumber() ? "" : obj.getSerialNumber().toString());
 			row.createCell(1).setCellValue(obj.getPatentNumber());
-			row.createCell(2).setCellValue(obj.getOffice());
+			row.createCell(2).setCellValue(obj.getContractNumber());
+			row.createCell(3).setCellValue(obj.getOffice());
 			Integer locationProvince = obj.getLocationProvince();
-			row.createCell(3).setCellValue(null == locationProvince ? "" : getProvince(districtMap, locationProvince));
-			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(obj.getCreateTimeFormattedDate());
-			row.createCell(8).setCellValue(obj.getPatentApplicationFormattedDate());
+			row.createCell(4).setCellValue(null == locationProvince ? "" : getProvince(districtMap, locationProvince));
+			row.createCell(5).setCellValue(obj.getUnitName());
+			row.createCell(6).setCellValue(obj.getPatentName());
+			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.getAuthor());
+			row.createCell(10).setCellValue(obj.getPatentApplicationFormattedDate());
+			row.createCell(11).setCellValue(obj.getAuthor());
 		}
 		FileUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
 

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

@@ -648,7 +648,7 @@
 		</if>
 		<if test="cStart != null">
 			and
-			p.create_time <![CDATA[ > ]]>
+			p.create_time <![CDATA[ >= ]]>
 			#{cStart,jdbcType=TIMESTAMP}
 		</if>
 		<if test="cEnd != null">
@@ -658,7 +658,7 @@
 		</if>
 		<if test="pStart != null">
 			and
-			p.patent_application_date <![CDATA[ > ]]>
+			p.patent_application_date <![CDATA[ >= ]]>
 			#{pStart,jdbcType=TIMESTAMP}
 		</if>
 		<if test="pEnd != null">

+ 21 - 10
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -153,7 +153,7 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 			} catch (ParseException e) {
 			}
 		}
-		c.setStatus(ContractStatus.CIRCULATION.getCode());
+		c.setStatus(ContractStatus.SIGN.getCode());
 		c.setSignDate(signDate);
 		c = disposeContract(c);
 		contractMapper.insert(c);
@@ -161,6 +161,11 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 		clog.setStatus(ContractStatus.SIGN.getCode());
 		clog.setRecordTime(signDate);
 
+		/*
+		 * ContractLog log = new ContractLog(); log.setCid(c.getId());
+		 * log.setComment(c.getComment()); log.set
+		 */
+
 		List<ContractLog> logs = new ArrayList<>();
 		List<Notice> notice = new ArrayList<>();
 		logs.add(clog);
@@ -168,6 +173,7 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 		for (int i = 0; i < principals.length; i++) {
 			ContractLog log = disposeContractLog(c);
 			log.setPrincipal(principals[i]);
+			log.setStatus(ContractStatus.CIRCULATION.getCode());
 			logs.add(log);
 			notice.add(createNotice(c, log));
 		}
@@ -194,7 +200,6 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 	@Override
 	public void updateSubmit(Contract c, String[] principals, String signDateFormattedDate) {
 		Date signDate = null;
-		Boolean flag = false;
 		if (!StringUtils.isBlank(signDateFormattedDate)) {
 			try {
 				signDate = DateUtils.parseDate(signDateFormattedDate, AFTConstants.YYYYMMDDHHMMSS);
@@ -202,22 +207,28 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 			}
 		}
 
-		if (null != c.getStatus() && c.getStatus().equals(ContractStatus.CIRCULATION.getCode())) {
-			c.setStatus(ContractStatus.SIGN.getCode());
-			flag = true;
-		}
+		c.setStatus(ContractStatus.SIGN.getCode());
 
 		c.setSignDate(signDate);
 		contractMapper.updateByPrimaryKeySelective(c);
+		
+		ContractLog l = new ContractLog();
+		l.setCid(c.getId());
+		l.setComment(c.getComment());
+		l.setOperator(TokenManager.getAdminId());
+		l.setPrincipal(TokenManager.getAdminId());
+		l.setRecordTime(signDate);
+		l.setStatus(ContractStatus.SIGN.getCode());
+		
 
 		List<ContractLog> logs = new ArrayList<>();
 		List<Notice> notice = new ArrayList<>();
-
+		
+		logs.add(l);
+		
 		for (int i = 0; i < principals.length; i++) {
 			ContractLog log = disposeContractLog(c);
-			if (flag) {
-				log.setStatus(ContractStatus.CIRCULATION.getCode());
-			}
+			log.setStatus(ContractStatus.CIRCULATION.getCode());
 			log.setPrincipal(principals[i]);
 			log.setOperator(TokenManager.getAdminId());
 			logs.add(log);

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

@@ -230,7 +230,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			pageNo = 1;
 		}
 
-		if (pageSize == null || pageSize < 0 || pageSize > 10) {
+		if (pageSize == null || pageSize < 0 || pageSize > 1000) {
 			pageSize = 10;
 		}
 		return (Pagination<PatentManageListBo>) findPage("findManagePatentListByPage", "findManagePatentCount", params,