Antiloveg 8 years ago
parent
commit
eeeef00385
20 changed files with 273 additions and 224 deletions
  1. 18 47
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  2. 20 52
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  3. 2 0
      src/main/java/com/goafanti/cognizance/service/OrgActivityCostService.java
  4. 6 0
      src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java
  5. 7 0
      src/main/java/com/goafanti/cognizance/service/impl/OrgActivityCostServiceImpl.java
  6. 55 52
      src/main/java/com/goafanti/cognizance/service/impl/OrgAnnualReportServiceImpl.java
  7. 98 32
      src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java
  8. 2 0
      src/main/java/com/goafanti/common/dao/OrgActivityCostMapper.java
  9. 7 0
      src/main/java/com/goafanti/common/mapper/OrgActivityCostMapper.xml
  10. 2 2
      src/main/java/com/goafanti/common/mapper/PatentInfoMapper.xml
  11. 5 0
      src/main/java/com/goafanti/common/model/Admin.java
  12. 2 0
      src/main/java/com/goafanti/common/model/AftUser.java
  13. 2 1
      src/main/java/com/goafanti/common/model/User.java
  14. 9 27
      src/main/java/com/goafanti/patent/controller/PatentApiController.java
  15. 4 1
      src/main/java/com/goafanti/patent/service/PatentInfoService.java
  16. 30 6
      src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java
  17. 1 1
      src/main/resources/props/config_dev.properties
  18. 1 1
      src/main/resources/props/config_local.properties
  19. 1 1
      src/main/resources/props/config_prod.properties
  20. 1 1
      src/main/resources/props/config_test.properties

+ 18 - 47
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -566,6 +567,11 @@ public class AdminApiController extends BaseApiController {
 		}
 
 		if (StringUtils.isBlank(orgActivityCost.getId())) {
+			if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(orgActivityCost.getAid(),
+					TokenManager.getUserId())){
+				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目费用详情已录入!"));
+				return res;
+			}
 			OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
 			orgActivityCost.setStartDate(ac.getStartDate());
 			orgActivityCost.setEndDate(ac.getEndDate());
@@ -863,30 +869,10 @@ public class AdminApiController extends BaseApiController {
 		if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, uid)) {
 			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
 		}
-
-		OrgCognizance c = new OrgCognizance();
-		c.setId(UUID.randomUUID().toString());
-		c.setUid(uid);
-		c.setContacts(contacts);
-		c.setComment(comment);
-		c.setConsultant(consultant);
-		c.setYear(year);
-		c.setDeletedSign(0);
-		c.setState(state);
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		c.setRecordTime(now.getTime());
-		orgCognizanceService.insert(c);
-
-		OrgCognizanceLog log = new OrgCognizanceLog();
-		log.setId(UUID.randomUUID().toString());
-		log.setCid(c.getId());
-		log.setRecordTime(c.getCreateTime());
-		log.setState(state);
-		log.setComment(comment);
-		log.setPrincipal(userService.selectByPrimaryKey(uid).getAid());
-		log.setOperator(TokenManager.getAdminId());
-		orgCognizanceLogService.insert(log);
+		
+		String aid = userService.selectByPrimaryKey(uid).getAid();
+		orgCognizanceService.insertCognizance(contacts, comment, year,  state, aid, uid);
+		
 		return res;
 	}
 
@@ -950,28 +936,13 @@ public class AdminApiController extends BaseApiController {
 	public Result disposeCognizanceDetail(OrgCognizance cog, OrgCognizanceLog log, String recordTimeFormattedDate)
 			throws ParseException {
 		Result res = new Result();
-		if (null != log.getState()) {
-			cog.setState(log.getState());
-			switch (log.getState()) {
-			case 1:
-				cog.setCreateTime(log.getRecordTime());
-				break;
-			case 2:
-				cog.setAcceptDate(log.getRecordTime());
-				break;
-			case 5:
-				cog.setIssuingDate(log.getRecordTime());
-				break;
-			}
-			log.setId(UUID.randomUUID().toString());
-			log.setCid(cog.getId());
-			log.setOperator(TokenManager.getAdminId());
-			if (!StringUtils.isBlank(recordTimeFormattedDate)) {
-				log.setRecordTime(DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd"));
-			}
-			orgCognizanceLogService.insert(log);
+		Date recordTime = null;
+		if (!StringUtils.isBlank(recordTimeFormattedDate)) {
+			recordTime = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
 		}
-		orgCognizanceService.updateByPrimaryKeySelective(cog);
+		orgCognizanceService.updateCognizance(cog, log, recordTime, TokenManager.getAdminId());
+		
+		
 		return res;
 	}
 
@@ -1014,7 +985,7 @@ public class AdminApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeAble", method = RequestMethod.POST)
 	public Result disposeAble(UserAbility u) {
 		Result res = new Result();
-		if (null == u.getId()) {
+		if (StringUtils.isBlank(u.getId())) {
 			u.setId(UUID.randomUUID().toString());
 			userAbilityService.insert(u);
 		} else {
@@ -1069,7 +1040,7 @@ public class AdminApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
 	public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
 		Result res = new Result();
-		if (null == orgAnnualReport.getId()) {
+		if (StringUtils.isBlank(orgAnnualReport.getId())) {
 			if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
 					orgAnnualReport.getUid())) {
 				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));

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

@@ -151,26 +151,7 @@ public class CognizanceApiController extends BaseApiController {
 			orgActivity.setUid(TokenManager.getUserId());
 			orgActivityService.insert(orgActivity);
 		} else {
-			orgActivityService.updateByPrimaryKeySelective(orgActivity);
-			Boolean flag = false;
-			OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
-			if (null != cost) {
-				if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
-					cost.setActivityNumber(orgActivity.getActivityNumber());
-					flag = true;
-				}
-				if (null == orgActivity.getStartDate()) {
-					cost.setStartDate(orgActivity.getStartDate());
-					flag = true;
-				}
-				if (null == orgActivity.getEndDate()) {
-					cost.setEndDate(orgActivity.getEndDate());
-					flag = true;
-				}
-			}
-			if (flag) {
-				orgActivityCostService.updateByPrimaryKeySelective(cost);
-			}
+			orgActivityService.updateOrgActivity(orgActivity);
 		}
 		res.setData(orgActivity);
 		return res;
@@ -232,7 +213,13 @@ public class CognizanceApiController extends BaseApiController {
 		if (!StringUtils.isBlank(signDateFormattedDate)) {
 			orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
 		}
-		if (null == orgActivityCost.getId()) {
+		if (StringUtils.isBlank(orgActivityCost.getId())) {
+			if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(orgActivityCost.getAid(),
+					TokenManager.getUserId())){
+				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目费用详情已录入!"));
+				return res;
+			}
+			
 			OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
 			orgActivityCost.setStartDate(ac.getStartDate());
 			orgActivityCost.setEndDate(ac.getEndDate());
@@ -343,7 +330,7 @@ public class CognizanceApiController extends BaseApiController {
 			orgIntellectualProperty
 					.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
 		}
-		if (null == orgIntellectualProperty.getId()) {
+		if (StringUtils.isBlank(orgIntellectualProperty.getId())) {
 			orgIntellectualProperty.setId(UUID.randomUUID().toString());
 			orgIntellectualProperty.setUid(TokenManager.getUserId());
 			orgIntellectualProperty.setEvaluationCategory(
@@ -496,7 +483,7 @@ public class CognizanceApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
 	public Result disposeRatepay(OrgRatepay orgRatepay) {
 		Result res = new Result();
-		if (null == orgRatepay.getId()) {
+		if (StringUtils.isBlank(orgRatepay.getId())) {
 			if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())) {
 				orgRatepay.setId(UUID.randomUUID().toString());
 				orgRatepay.setUid(TokenManager.getUserId());
@@ -561,7 +548,7 @@ public class CognizanceApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
 	public Result disposeFinance(OrgFinance orgFinance) {
 		Result res = new Result();
-		if (null == orgFinance.getId()) {
+		if (StringUtils.isBlank(orgFinance.getId())) {
 			if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())) {
 				orgFinance.setId(UUID.randomUUID().toString());
 				orgFinance.setUid(TokenManager.getUserId());
@@ -658,7 +645,7 @@ public class CognizanceApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
 	public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
 		Result res = new Result();
-		if (null == achievement.getId()) {
+		if (StringUtils.isBlank(achievement.getId())) {
 			achievement.setId(UUID.randomUUID().toString());
 			achievement.setUid(TokenManager.getUserId());
 			achievement.setDeletedSign(0);
@@ -722,7 +709,7 @@ public class CognizanceApiController extends BaseApiController {
 		if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
 			honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
 		}
-		if (null == honor.getId()) {
+		if (StringUtils.isBlank(honor.getId())) {
 			honor.setId(UUID.randomUUID().toString());
 			honor.setUid(TokenManager.getUserId());
 			honor.setDeletedSign(0);
@@ -777,7 +764,7 @@ public class CognizanceApiController extends BaseApiController {
 		if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
 			orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
 		}
-		if (null == orgTechCenter.getId()) {
+		if (StringUtils.isBlank(orgTechCenter.getId())) {
 			orgTechCenter.setId(UUID.randomUUID().toString());
 			orgTechCenter.setUid(TokenManager.getUserId());
 			orgTechCenter.setDeletedSign(0);
@@ -829,7 +816,7 @@ public class CognizanceApiController extends BaseApiController {
 		if (!StringUtils.isBlank(termTimeFormattedDate)) {
 			orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
 		}
-		if (null == orgTechCenterDetail.getId()) {
+		if (StringUtils.isBlank(orgTechCenterDetail.getId())) {
 			orgTechCenterDetail.setId(UUID.randomUUID().toString());
 			orgTechCenterDetail.setDeletedSign(0);
 			orgTechCenterDetailService.inset(orgTechCenterDetail);
@@ -902,29 +889,10 @@ public class CognizanceApiController extends BaseApiController {
 		if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, TokenManager.getUserId())){
 			res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
 		}
+		String aid = TokenManager.getToken().getAid();
+		orgCognizanceService.insertCognizance(contacts, comment, year,  state, aid, TokenManager.getUserId());
 		
-		OrgCognizance c = new OrgCognizance();
-		c.setId(UUID.randomUUID().toString());
-		c.setUid(TokenManager.getUserId());
-		c.setContacts(contacts);
-		c.setComment(comment);
-		c.setDeletedSign(0);
-		c.setYear(year);
-		c.setState(state);
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		c.setRecordTime(now.getTime());
-		orgCognizanceService.insert(c);
-
-		OrgCognizanceLog log = new OrgCognizanceLog();
-		log.setId(UUID.randomUUID().toString());
-		log.setCid(c.getId());
 		
-		log.setRecordTime(c.getCreateTime());
-		log.setState(state);
-		log.setComment(comment);
-		log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
-		orgCognizanceLogService.insert(log);
 		return res;
 	}
 
@@ -1012,12 +980,12 @@ public class CognizanceApiController extends BaseApiController {
 	@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
 	public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
 		Result res = new Result();
-		if (null == orgAnnualReport.getId()) {
+		if (StringUtils.isBlank(orgAnnualReport.getId())) {
 			if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
 					TokenManager.getUserId())) {
 				res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
 				return res;
-			} else {
+			} 
 				orgAnnualReport.setId(UUID.randomUUID().toString());
 				orgAnnualReport.setUid(TokenManager.getUserId());
 				Calendar now = Calendar.getInstance();
@@ -1026,7 +994,7 @@ public class CognizanceApiController extends BaseApiController {
 				orgAnnualReport.setLastUpdateTime(orgAnnualReport.getCreateTime());
 				orgAnnualReport.setDeletedSign(0);
 				orgAnnualReportService.insert(orgAnnualReport);
-			}
+			
 		} else {
 			Calendar now = Calendar.getInstance();
 			now.set(Calendar.MILLISECOND, 0);

+ 2 - 0
src/main/java/com/goafanti/cognizance/service/OrgActivityCostService.java

@@ -21,4 +21,6 @@ public interface OrgActivityCostService {
 
 	int batchDeleteByAid(List<String> id);
 
+	OrgActivityCost selectOrgActivityCostByUidAndAid(String aid, String userId);
+
 }

+ 6 - 0
src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java

@@ -1,6 +1,7 @@
 package com.goafanti.cognizance.service;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 import com.goafanti.cognizance.bo.CognizanceBo;
@@ -10,6 +11,7 @@ import com.goafanti.cognizance.bo.CognizanceManageCostBo;
 import com.goafanti.cognizance.bo.CognizanceOrgInfoBo;
 import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.common.model.OrgCognizance;
+import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.core.mybatis.page.Pagination;
 
 public interface OrgCognizanceService {
@@ -36,5 +38,9 @@ public interface OrgCognizanceService {
 
 	CognizanceDetailBo selectCognizanceDetailBo(String uid, String cid, Integer year);
 
+	void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid);
+
+	void insertCognizance(Integer contacts, String comment, Integer year, Integer state, String aid, String uid);
+
 
 }

+ 7 - 0
src/main/java/com/goafanti/cognizance/service/impl/OrgActivityCostServiceImpl.java

@@ -91,4 +91,11 @@ public class OrgActivityCostServiceImpl extends BaseMybatisDao<OrgActivityCostMa
 	public int batchDeleteByAid(List<String> aid) {
 		return orgActivityCostMapper.batchDeleteByAid(aid);
 	}
+
+
+	@Override
+	public OrgActivityCost selectOrgActivityCostByUidAndAid(String aid, String uid) {
+		// TODO Auto-generated method stub
+		return orgActivityCostMapper.selectOrgActivityCostByUidAndAid(aid, uid);
+	}
 }

+ 55 - 52
src/main/java/com/goafanti/cognizance/service/impl/OrgAnnualReportServiceImpl.java

@@ -18,26 +18,28 @@ import com.goafanti.common.dao.OrgAnnualReportMapper;
 import com.goafanti.common.model.OrgAnnualReport;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+
 @Service
-public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMapper> implements OrgAnnualReportService {
+public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMapper>
+		implements OrgAnnualReportService {
 	@Autowired
-	private OrgAnnualReportMapper   orgAnnualReportMapper;
+	private OrgAnnualReportMapper orgAnnualReportMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<OrgAnnualReport> listOrgAnnualReport(Integer year, Integer state, Integer pageNo, Integer pageSize,
-			String uid) {
+	public Pagination<OrgAnnualReport> listOrgAnnualReport(Integer year, Integer state, Integer pageNo,
+			Integer pageSize, String uid) {
 		Map<String, Object> params = new HashMap<>();
-		
-		if (year != null){
+
+		if (year != null) {
 			params.put("year", year);
 		}
-		
-		if (state != null){
+
+		if (state != null) {
 			params.put("state", state);
 		}
-		
-		if (!StringUtils.isBlank(uid)){
+
+		if (!StringUtils.isBlank(uid)) {
 			params.put("uid", uid);
 		}
 
@@ -48,8 +50,8 @@ public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMa
 		if (pageSize == null || pageSize < 0) {
 			pageSize = 10;
 		}
-		return  (Pagination<OrgAnnualReport>)findPage("findOrgAnnualReportListByPage",
-				"findOrgAnnualReportCount", params, pageNo, pageSize);
+		return (Pagination<OrgAnnualReport>) findPage("findOrgAnnualReportListByPage", "findOrgAnnualReportCount",
+				params, pageNo, pageSize);
 	}
 
 	@Override
@@ -67,9 +69,7 @@ public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMa
 	public int updateByPrimaryKeySelective(OrgAnnualReport orgAnnualReport) {
 		return orgAnnualReportMapper.updateByPrimaryKeySelective(orgAnnualReport);
 	}
-    
-	
-	
+
 	@Override
 	public AnnualReportPropertyRightBo selectAnnualReportPropertyRightBoByYearAndUid(Integer year, String uid) {
 		return orgAnnualReportMapper.selectAnnualReportPropertyRightBoByYearAndUid(year, uid);
@@ -95,49 +95,52 @@ public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMa
 		AnnualReportBo report = new AnnualReportBo();
 
 		AnnualReportPropertyRightBo p = orgAnnualReportMapper.selectAnnualReportPropertyRightBoByYearAndUid(year, uid);
-		report.setInventionPatent(null == p.getInventionPatent() ? 0 : p.getInventionPatent());
-		report.setDefensePatent(null == p.getDefensePatent() ? 0 : p.getDefensePatent());
-		report.setNationalCrop(null == p.getNationalCrop() ? 0 : p.getNationalCrop());
-		report.setNewPlantCariety(null == p.getNewPlantCariety() ? 0 : p.getNewPlantCariety());
-		report.setNationalDrug(null == p.getNationalDrug() ? 0 : p.getNationalDrug());
-		report.setChineseMedicine(null == p.getChineseMedicine() ? 0 : p.getChineseMedicine());
-		report.setUtilityPatent(null == p.getUtilityPatent() ? 0 : p.getUtilityPatent());
-		report.setCircuitDesign(null == p.getCircuitDesign() ? 0 : p.getCircuitDesign());
-		report.setExteriorPatent(null == p.getExteriorPatent() ? 0 : p.getExteriorPatent());
-		report.setSoftwareWorks(null == p.getSoftwareWorks() ? 0 : p.getSoftwareWorks());
+		if (null != p) {
+			report.setInventionPatent(null == p.getInventionPatent() ? 0 : p.getInventionPatent());
+			report.setDefensePatent(null == p.getDefensePatent() ? 0 : p.getDefensePatent());
+			report.setNationalCrop(null == p.getNationalCrop() ? 0 : p.getNationalCrop());
+			report.setNewPlantCariety(null == p.getNewPlantCariety() ? 0 : p.getNewPlantCariety());
+			report.setNationalDrug(null == p.getNationalDrug() ? 0 : p.getNationalDrug());
+			report.setChineseMedicine(null == p.getChineseMedicine() ? 0 : p.getChineseMedicine());
+			report.setUtilityPatent(null == p.getUtilityPatent() ? 0 : p.getUtilityPatent());
+			report.setCircuitDesign(null == p.getCircuitDesign() ? 0 : p.getCircuitDesign());
+			report.setExteriorPatent(null == p.getExteriorPatent() ? 0 : p.getExteriorPatent());
+			report.setSoftwareWorks(null == p.getSoftwareWorks() ? 0 : p.getSoftwareWorks());
+		}
 
 		BigDecimal t = orgAnnualReportMapper.selectAnnualReportTerritoryByYearAndUid(year, uid);
 		report.setTerritory(null == t ? new BigDecimal(0) : t);
 
 		AnnualReportMainBo m = orgAnnualReportMapper.selectAnnualReportMainBoByYearAndUid(year, uid);
-		report.setUid(m.getUid());
-		report.setUnitName(m.getUnitName());
-		report.setOrgCode(m.getOrgCode());
-		report.setLocationProvince(m.getLocationProvince());
-		report.setLocationCity(m.getLocationCity());
-		report.setLocationArea(m.getLocationArea());
-		report.setListed(m.getListed().toString());
-		if (null != m.getListedDate()) {
-			report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
+		if (null != m) {
+			report.setUid(m.getUid());
+			report.setUnitName(m.getUnitName());
+			report.setOrgCode(m.getOrgCode());
+			report.setLocationProvince(m.getLocationProvince());
+			report.setLocationCity(m.getLocationCity());
+			report.setLocationArea(m.getLocationArea());
+			report.setListed(m.getListed().toString());
+			if (null != m.getListedDate()) {
+				report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
+			}
+			report.setListedType(m.getListedType().toString());
+			report.setStockCode(m.getStockCode());
+			report.setFirmTotal(null == m.getFirmTotal() ? 0 : m.getFirmTotal());
+			report.setTechTotal(null == m.getTechTotal() ? 0 : m.getTechTotal());
+			report.setNewEmployment(null == m.getNewEmployment() ? 0 : m.getNewEmployment());
+			report.setGraduateNumber(null == m.getGraduateNumber() ? 0 : m.getGraduateNumber());
+			report.setSalesRevenue(null == m.getSalesRevenue() ? new BigDecimal(0) : m.getSalesRevenue());
+			report.setGrossProfit(null == m.getGrossProfit() ? new BigDecimal(0) : m.getGrossProfit());
+			report.setNetAsset(null == m.getNetAsset() ? new BigDecimal(0) : m.getNetAsset());
+			report.setCertificateNumber(m.getCertificateNumber());
+			if (null != m.getIssuingDate()) {
+				report.setIssuingDate(DateFormatUtils.format(m.getIssuingDate(), "yyyy-MM-dd"));
+			}
+			report.setContacts(m.getContacts());
+			report.setResearchCost(null == m.getResearchCost() ? new BigDecimal(0) : m.getResearchCost());
+			report.setTotalRevenue(null == m.getTotalRevenue() ? new BigDecimal(0) : m.getTotalRevenue());
+			report.setLastYearRevenue(null == m.getLastYearRevenue() ? new BigDecimal(0) : m.getLastYearRevenue());
 		}
-		report.setListedType(m.getListedType().toString());
-		report.setStockCode(m.getStockCode());
-		report.setFirmTotal(null == m.getFirmTotal() ? 0 : m.getFirmTotal());
-		report.setTechTotal(null == m.getTechTotal() ? 0 : m.getTechTotal());
-		report.setNewEmployment(null == m.getNewEmployment() ? 0 : m.getNewEmployment());
-		report.setGraduateNumber(null == m.getGraduateNumber() ? 0 : m.getGraduateNumber());
-		report.setSalesRevenue(null == m.getSalesRevenue() ? new BigDecimal(0) : m.getSalesRevenue());
-		report.setGrossProfit(null == m.getGrossProfit() ? new BigDecimal(0) : m.getGrossProfit());
-		report.setNetAsset(null == m.getNetAsset() ? new BigDecimal(0) : m.getNetAsset());
-		report.setCertificateNumber(m.getCertificateNumber());
-		if (null != m.getIssuingDate()) {
-			report.setIssuingDate(DateFormatUtils.format(m.getIssuingDate(), "yyyy-MM-dd"));
-		}
-		report.setContacts(m.getContacts());
-		report.setResearchCost(null == m.getResearchCost() ? new BigDecimal(0) : m.getResearchCost());
-		report.setTotalRevenue(null == m.getTotalRevenue() ? new BigDecimal(0) : m.getTotalRevenue());
-		report.setLastYearRevenue(null == m.getLastYearRevenue() ? new BigDecimal(0) : m.getLastYearRevenue());
-
 		return report;
 	}
 

+ 98 - 32
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -1,9 +1,12 @@
 package com.goafanti.cognizance.service.impl;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,14 +19,18 @@ import com.goafanti.cognizance.bo.CognizanceManageCostBo;
 import com.goafanti.cognizance.bo.CognizanceOrgInfoBo;
 import com.goafanti.cognizance.bo.CognizanceResearchCostBo;
 import com.goafanti.cognizance.service.OrgCognizanceService;
+import com.goafanti.common.dao.OrgCognizanceLogMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.model.OrgCognizance;
+import com.goafanti.common.model.OrgCognizanceLog;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 @Service
 public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper> implements OrgCognizanceService {
 	@Autowired
 	private OrgCognizanceMapper orgCognizanceMapper;
+	@Autowired
+	private OrgCognizanceLogMapper orgCognizanceLogMapper;
 
 	@Override
 	public OrgCognizance insert(OrgCognizance c) {
@@ -60,45 +67,52 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	@Override
 	public CognizanceDetailBo selectCognizanceDetailBo(String uid, String cid, Integer year){
 		CognizanceDetailBo cog = new CognizanceDetailBo();
-		CognizanceOrgInfoBo orgInfo = orgCognizanceMapper.selectCognizanceOrgInfoBoByUidAndCid(uid, cid);
 		
-		cog.setUid(null == orgInfo.getUid() ? "" : orgInfo.getUid());
-		cog.setCid(null == orgInfo.getCid() ? "" : orgInfo.getCid());
-		cog.setUnitName(null == orgInfo.getUnitName() ? "" : orgInfo.getUnitName());
-		cog.setOrgCode(null == orgInfo.getOrgCode() ? "" : orgInfo.getOrgCode());
-		cog.setPostalAddress(null == orgInfo.getPostalAddress() ? "" : orgInfo.getPostalAddress());
-		//联系人
-		cog.setContacts(null == orgInfo.getContacts() ? "" : orgInfo.getContacts().toString());
+		CognizanceOrgInfoBo orgInfo = orgCognizanceMapper.selectCognizanceOrgInfoBoByUidAndCid(uid, cid);
+		if (null != orgInfo){
+			cog.setUid(null == orgInfo.getUid() ? "" : orgInfo.getUid());
+			cog.setCid(null == orgInfo.getCid() ? "" : orgInfo.getCid());
+			cog.setUnitName(null == orgInfo.getUnitName() ? "" : orgInfo.getUnitName());
+			cog.setOrgCode(null == orgInfo.getOrgCode() ? "" : orgInfo.getOrgCode());
+			cog.setPostalAddress(null == orgInfo.getPostalAddress() ? "" : orgInfo.getPostalAddress());
+			cog.setContacts(null == orgInfo.getContacts() ? "" : orgInfo.getContacts().toString());//联系人
+			cog.setTechnicalField1(null == orgInfo.getTechnicalField1() ? 0 : orgInfo.getTechnicalField1());
+			cog.setTechnicalField2(null == orgInfo.getTechnicalField2() ? 0 : orgInfo.getTechnicalField2());
+			cog.setTechnicalField3(null == orgInfo.getTechnicalField3() ? 0 : orgInfo.getTechnicalField3());
+			cog.setBasicResearchCost(
+					null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
+			cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
+		}
 		
-		cog.setTechnicalField1(null == orgInfo.getTechnicalField1() ? 0 : orgInfo.getTechnicalField1());
-		cog.setTechnicalField2(null == orgInfo.getTechnicalField2() ? 0 : orgInfo.getTechnicalField2());
-		cog.setTechnicalField3(null == orgInfo.getTechnicalField3() ? 0 : orgInfo.getTechnicalField3());
-		cog.setBasicResearchCost(
-				null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
-		cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
 		CognizanceResearchCostBo researchCost = orgCognizanceMapper.selectCognizanceResearchCostBoByUidAndYear(year,
 				uid);
-		cog.setResearchCost(
-				null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
-		cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
+		if (null != researchCost) {
+			cog.setResearchCost(
+					null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
+			cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
+		}
+		
 		CognizanceManageCostBo manageCost = orgCognizanceMapper.selectCognizanceManageCostBoByUidAndYear(year, uid);
+		if (null != manageCost) {
+			cog.setNetAsset1(null == manageCost.getNetAsset1() ? new BigDecimal(0) : manageCost.getNetAsset1());
+			cog.setNetAsset2(null == manageCost.getNetAsset2() ? new BigDecimal(0) : manageCost.getNetAsset2());
+			cog.setNetAsset3(null == manageCost.getNetAsset3() ? new BigDecimal(0) : manageCost.getNetAsset3());
+			cog.setSalesRevenue1(null == manageCost.getSalesRevenue1() ? new BigDecimal(0) : manageCost.getSalesRevenue1());
+			cog.setSalesRevenue2(null == manageCost.getSalesRevenue2() ? new BigDecimal(0) : manageCost.getSalesRevenue2());
+			cog.setSalesRevenue3(null == manageCost.getSalesRevenue3() ? new BigDecimal(0) : manageCost.getSalesRevenue3());
+			cog.setGrossProfit1(null == manageCost.getGrossProfit1() ? new BigDecimal(0) : manageCost.getGrossProfit1());
+			cog.setGrossProfit2(null == manageCost.getGrossProfit2() ? new BigDecimal(0) : manageCost.getGrossProfit2());
+			cog.setGrossProfit3(null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
+		}
 		
-		cog.setNetAsset1(null == manageCost.getNetAsset1() ? new BigDecimal(0) : manageCost.getNetAsset1());
-		cog.setNetAsset2(null == manageCost.getNetAsset2() ? new BigDecimal(0) : manageCost.getNetAsset2());
-		cog.setNetAsset3(null == manageCost.getNetAsset3() ? new BigDecimal(0) : manageCost.getNetAsset3());
-		cog.setSalesRevenue1(null == manageCost.getSalesRevenue1() ? new BigDecimal(0) : manageCost.getSalesRevenue1());
-		cog.setSalesRevenue2(null == manageCost.getSalesRevenue2() ? new BigDecimal(0) : manageCost.getSalesRevenue2());
-		cog.setSalesRevenue3(null == manageCost.getSalesRevenue3() ? new BigDecimal(0) : manageCost.getSalesRevenue3());
-		cog.setGrossProfit1(null == manageCost.getGrossProfit1() ? new BigDecimal(0) : manageCost.getGrossProfit1());
-		cog.setGrossProfit2(null == manageCost.getGrossProfit2() ? new BigDecimal(0) : manageCost.getGrossProfit2());
-		cog.setGrossProfit3(null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
-
 		CognizanceCatagoryBo catagory = orgCognizanceMapper.selectCognizanceCatagoryBoByUidAndYear(year, uid);
-		cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
-		cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
-		cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
-		cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
-		cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
+		if (null != catagory){
+			cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
+			cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
+			cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
+			cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
+			cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
+		}
 		BigDecimal revenue = orgCognizanceMapper.selectLastYearRevenueByUidAndYear(year, uid);
 		cog.setLastYearRevenue(null == revenue ? new BigDecimal(0) : revenue);
 		return cog;
@@ -143,4 +157,56 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 	public int batchDeleteByPrimaryKey(List<String> id) {
 		return orgCognizanceMapper.batchDeleteByPrimaryKey(id);
 	}
+
+	@Override
+	public void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid) {
+		if (null != log.getState()) {
+			log.setRecordTime(recordTime);
+			cog.setState(log.getState());
+			switch (log.getState()) {
+			case 1:
+				cog.setCreateTime(log.getRecordTime());
+				break;
+			case 2:
+				cog.setAcceptDate(log.getRecordTime());
+				break;
+			case 5:
+				cog.setIssuingDate(log.getRecordTime());
+				break;
+			}
+			log.setId(UUID.randomUUID().toString());
+			log.setCid(cog.getId());
+			log.setOperator(aid);
+			orgCognizanceLogMapper.insert(log);
+		}
+		orgCognizanceMapper.updateByPrimaryKeySelective(cog);
+		
+	}
+
+	@Override
+	public void insertCognizance(Integer contacts, String comment, Integer year, Integer state, String aid, String uid) {
+		OrgCognizance c = new OrgCognizance();
+		c.setId(UUID.randomUUID().toString());
+		c.setUid(uid);
+		c.setContacts(contacts);
+		c.setComment(comment);
+		c.setDeletedSign(0);
+		c.setYear(year);
+		c.setState(state);
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		c.setRecordTime(now.getTime());
+		orgCognizanceMapper.insert(c);
+
+		OrgCognizanceLog log = new OrgCognizanceLog();
+		log.setId(UUID.randomUUID().toString());
+		log.setCid(c.getId());
+		
+		log.setRecordTime(c.getCreateTime());
+		log.setState(state);
+		log.setComment(comment);
+		log.setPrincipal(aid);
+		orgCognizanceLogMapper.insert(log);
+		
+	}
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/OrgActivityCostMapper.java

@@ -22,4 +22,6 @@ public interface OrgActivityCostMapper {
 	OrgActivityCost selectOrgActivityCostByAid(String aid);
 
 	int batchDeleteByAid(List<String> aid);
+
+	OrgActivityCost selectOrgActivityCostByUidAndAid(String aid, String uid);
 }

+ 7 - 0
src/main/java/com/goafanti/common/mapper/OrgActivityCostMapper.xml

@@ -339,4 +339,11 @@
 		#{item}
 	</foreach>
   </update>
+  
+  <select id="selectOrgActivityCostByUidAndAid" resultMap="BaseResultMap" >
+    select 
+    <include refid="Base_Column_List" />
+    from org_activity_cost
+    where aid = #{0} and uid = #{1} and deleted_sign = 0
+  </select>
 </mapper>

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

@@ -79,8 +79,8 @@
       #{thirdInventorName,jdbcType=VARCHAR}, #{thirdInventorNationality,jdbcType=VARCHAR}, 
       #{thirdInventorIsPublish,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{author,jdbcType=VARCHAR}, 
       #{authorizedDate,jdbcType=TIMESTAMP},
-      #{office,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP},
-      #{confirmState,jdbcType=INTEGER}, #{deletedSign,jdbcType=INTEGER})
+      #{office,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{confirmState,jdbcType=INTEGER}, #{recordTime,jdbcType=TIMESTAMP},
+       #{deletedSign,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentInfo" >
     insert into patent_info

+ 5 - 0
src/main/java/com/goafanti/common/model/Admin.java

@@ -95,4 +95,9 @@ public class Admin extends BaseModel implements AftUser{
     public void setNumber(Integer number) {
         this.number = number;
     }
+
+	@Override
+	public String getAid() {
+		return null;
+	}
 }

+ 2 - 0
src/main/java/com/goafanti/common/model/AftUser.java

@@ -8,4 +8,6 @@ public interface AftUser {
 	 String getPassword();
 	 
 	 Date getCreateTime();
+	 
+	 String getAid();
 }

+ 2 - 1
src/main/java/com/goafanti/common/model/User.java

@@ -140,7 +140,8 @@ public class User extends BaseModel implements AftUser{
 	public void setLvl(Integer lvl) {
 		this.lvl = lvl;
 	}
-
+    
+	@Override
 	public String getAid() {
 		return aid;
 	}

+ 9 - 27
src/main/java/com/goafanti/patent/controller/PatentApiController.java

@@ -8,7 +8,7 @@ import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
+import java.util.TreeMap;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -88,7 +88,7 @@ public class PatentApiController extends BaseApiController {
 		Result res = new Result();
 		res = checkCertify(res, TokenManager.getUserId());
 		if (res.getError().isEmpty()) {
-			res.setData(patentInfoService.savePatentInfo(patentInfo, TokenManager.getUserId())); 
+			res.setData(patentInfoService.savePatentInfo(patentInfo, TokenManager.getUserId(), TokenManager.getToken().getAid())); 
 		}
 		return res;
 	}
@@ -187,7 +187,7 @@ public class PatentApiController extends BaseApiController {
 	public Result getUnitNames() {
 		Result res = new Result();
 		List<OrganizationIdentity> list = organizationIdentityServivce.selectAllOrgIndentity();
-		Map<String, String> map = new LinkedHashMap<String, String>();
+		Map<String, String> map = new TreeMap<String, String>();
 		for (OrganizationIdentity o : list) {
 			map.put(o.getUid(), o.getUnitName());
 		}
@@ -218,7 +218,8 @@ public class PatentApiController extends BaseApiController {
 		Result res = new Result();
 		res = checkCertify(res, uid);
 		if (res.getError().isEmpty()) {
-			res.setData(patentInfoService.savePatentInfo(patentInfo, uid));
+			String aid = userService.selectByPrimaryKey(uid).getAid();
+			res.setData(patentInfoService.savePatentInfo(patentInfo, uid, aid));
 		}
 		return res;
 	}
@@ -274,8 +275,8 @@ public class PatentApiController extends BaseApiController {
 	@RequestMapping(value = "/confirmPayment", method = RequestMethod.POST)
 	public Result confirmPayment(String cid) {
 		Result res = new Result();
-		if (null == cid) {
-			res.getError().add(buildError("确认缴费失败!"));
+		if (StringUtils.isBlank(cid)) {
+			res.getError().add(buildError("", "确认缴费失败!"));
 			return res;
 		}
 		PatentCost patentCost = new PatentCost();
@@ -312,28 +313,9 @@ public class PatentApiController extends BaseApiController {
 	@RequestMapping(value = "/replyConfirm", method = RequestMethod.POST)
 	public Result replyConfirm(String pid, Integer patentState) {
 		Result res = new Result();
-		PatentInfo patentInfo = new PatentInfo();
-		patentInfo.setId(pid);
-		if (patentState == 4) {
-			patentInfo.setPatentState(5);
-		} else if (patentState == 6) {
-			patentInfo.setPatentState(7);
-		} else {
-			res.getError().add(buildError("通知答复确认失败!"));
-			return res;
+		if (StringUtils.isBlank(patentInfoService.updateNoticeOfCorrection(res, pid, patentState))){
+			res.getError().add(buildError("", "确认失败!"));
 		}
-		patentInfoService.updateByPrimaryKeySelective(patentInfo);
-		PatentLog patentLog = new PatentLog();
-		PatentInfo p = patentInfoService.selectByPrimaryKey(pid);
-		patentLog.setId(UUID.randomUUID().toString());
-		patentLog.setPid(pid);
-		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());
-		patentLogService.insert(patentLog);
 		return res;
 	}
 

+ 4 - 1
src/main/java/com/goafanti/patent/service/PatentInfoService.java

@@ -4,6 +4,7 @@ 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;
@@ -37,9 +38,11 @@ public interface PatentInfoService {
 
 	int batchDeleteByPrimaryKey(List<String> id);
 
-	PatentInfo savePatentInfo(PatentInfo patentInfo, String uid);
+	PatentInfo savePatentInfo(PatentInfo patentInfo, String uid, String aid);
 
 	void updatePatentInfo(PatentInfo patentInfo, PatentLog patentLog, Date recordTime);
 
+	String updateNoticeOfCorrection(Result res, String pid, Integer patentState);
+
 
 }

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

@@ -11,6 +11,7 @@ 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;
@@ -22,7 +23,6 @@ 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.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -280,7 +280,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 	}
 
 	@Override
-	public PatentInfo savePatentInfo(PatentInfo patentInfo, String uid) {
+	public PatentInfo savePatentInfo(PatentInfo patentInfo, String uid, String aid) {
 		patentInfo.setId(UUID.randomUUID().toString());
 		patentInfo.setUid(uid);
 		Calendar now = Calendar.getInstance();
@@ -289,9 +289,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		patentInfo.setDeletedSign(0);
 		patentInfo.setConfirmState(0);
 		patentInfo.setPatentState(1);
-		User u = userMapper.selectByPrimaryKey(uid);
-		String p = (null == u ? "" : u.getAid());
-		patentInfo.setPrincipal(p);
+		patentInfo.setPrincipal(aid);
 		patentInfoMapper.insert(patentInfo);
 
 		PatentRegistration patentRegistration = new PatentRegistration();
@@ -311,7 +309,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setPid(patentInfo.getId());
 		log.setRecordTime(patentInfo.getCreateTime());
 		log.setState(1);
-		log.setPrincipal(p);
+		log.setPrincipal(aid);
 		patentLogMapper.insert(log);
 		return patentInfo;
 	}
@@ -378,4 +376,30 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		}
 	}
 
+	@Override
+	public  String updateNoticeOfCorrection(Result res, 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 "";
+		}
+		patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
+		PatentLog patentLog = new PatentLog();
+		PatentInfo p = patentInfoMapper.selectByPrimaryKey(pid);
+		patentLog.setId(UUID.randomUUID().toString());
+		patentLog.setPid(pid);
+		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";
+	}
+
 }

+ 1 - 1
src/main/resources/props/config_dev.properties

@@ -51,7 +51,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.6
+static.host=//afts.hnzhiming.com/1.0.7
 
 upload.path=/data/wwwroot/aft/upload
 upload.private.path=/data/upload

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.6
+static.host=//afts.hnzhiming.com/1.0.7
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc

+ 1 - 1
src/main/resources/props/config_prod.properties

@@ -51,4 +51,4 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.6
+static.host=//afts.hnzhiming.com/1.0.7

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//aftts.hnzhiming.com/1.0.6
+static.host=//aftts.hnzhiming.com/1.0.7
 
 upload.path=/data/aft/public/upload
 upload.private.path=/data/aft/private/upload