Browse Source

1.专利批量创建;
2.合同详情-科技项目列表;
3.合同详情-高企记录;
4.合同详情-软著列表;
5.合同管理--批量创建专利;
6.合同流转状态下拉

Antiloveg 8 years ago
parent
commit
b37a16865a

+ 1 - 1
schema/2017-05-08.sql

@@ -29,7 +29,7 @@ CREATE TABLE `contract_log` (
   `id` VARCHAR(36) NOT NULL,
   `cid` VARCHAR(36) NULL COMMENT '合同表主键',
   `record_time` DATETIME NULL COMMENT '状态变更录入时间',
-  `state` INT(1) NULL COMMENT '状态',
+  `status` INT(1) NULL COMMENT '状态',
   `principal` VARCHAR(36) NULL COMMENT '负责人',
   `operator` VARCHAR(36) NULL COMMENT '操作人',
   `comment` VARCHAR(128) NULL COMMENT '备注',

+ 10 - 0
schema/permission.sql

@@ -401,6 +401,16 @@ values
 
 
 
+insert into `permission`(`id`, `url`, `name`) 
+values
+(UUID(), 'ContractStatus0', '合同管理流转状态--草稿'),
+(UUID(), 'ContractStatus1', '合同管理流转状态--签订'),
+(UUID(), 'ContractStatus2', '合同管理流转状态--分发流转'),
+(UUID(), 'ContractStatus3', '合同管理流转状态--完成(已结款)');
+
+
+
+
 
 
 

+ 65 - 2
src/main/java/com/goafanti/admin/controller/AdminContractApiController.java

@@ -1,6 +1,8 @@
 package com.goafanti.admin.controller;
 
 import java.text.ParseException;
+import java.util.Map;
+import java.util.TreeMap;
 
 import javax.annotation.Resource;
 import javax.validation.Valid;
@@ -16,10 +18,12 @@ import com.goafanti.admin.service.AdminService;
 import com.goafanti.cognizance.bo.LatelyCogRecord;
 import com.goafanti.cognizance.service.OrgCognizanceService;
 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.ContractFields;
 import com.goafanti.common.enums.ContractLogFields;
+import com.goafanti.common.enums.ContractStatus;
 import com.goafanti.common.enums.OrgCognizanceStatus;
 import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.User;
@@ -31,6 +35,7 @@ import com.goafanti.contract.bo.InputSaveContract;
 import com.goafanti.contract.service.ContractLogService;
 import com.goafanti.contract.service.ContractService;
 import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.patent.service.PatentInfoService;
 import com.goafanti.techproject.service.TechProjectService;
 import com.goafanti.user.service.UserService;
@@ -56,6 +61,30 @@ public class AdminContractApiController extends CertifyApiController {
 	private TechProjectService		techProjectService;
 
 	/**
+	 * 合同管理--创建专利
+	 */
+	@RequestMapping(value = "/createPatent", method = RequestMethod.POST)
+	public Result createPatent(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合同ID", "合同ID"));
+			return res;
+		}
+		Contract c = contractService.selectByPrimaryKey(id);
+		if (null == c) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
+			return res;
+		}
+
+		if (c.getPatentNum() >= 1 && c.getPatentNum() <= 30) {
+			patentInfoService.batchInsertContractRecord(c);
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利数量"));
+		}
+		return res;
+	}
+
+	/**
 	 * 合同详情-科技项目列表
 	 */
 	@RequestMapping(value = "/techProject", method = RequestMethod.GET)
@@ -240,6 +269,16 @@ public class AdminContractApiController extends CertifyApiController {
 		res.setData(contractLogService.selectContractLogByCid(cid));
 		return res;
 	}
+	
+	/**
+	 * 合同流转状态下拉
+	 */
+	@RequestMapping(value = "/status", method = RequestMethod.GET)
+	public Result status(){
+		Result res = new Result();
+		res.setData(disposeStatus());
+		return res;
+	}
 
 	/**
 	 * 流转分发
@@ -253,8 +292,8 @@ public class AdminContractApiController extends CertifyApiController {
 					ContractLogFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
-		if (StringUtils.isBlank(recordTimeFormattedDate)){
+
+		if (StringUtils.isBlank(recordTimeFormattedDate)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到流转分发时间", "流转分发时间"));
 			return res;
 		}
@@ -306,5 +345,29 @@ public class AdminContractApiController extends CertifyApiController {
 		}
 		return res;
 	}
+	
+	private Object disposeStatus() {
+		Map<String, String> status = new TreeMap<String, String>();
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			for (ContractStatus p : ContractStatus.values()) {
+				status.put(p.getCode().toString(), p.getDesc());
+				status.remove(ContractStatus.OTHER.getCode().toString());
+			}
+		} else {
+			if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CREATE.getCode())) {
+				status.put(ContractStatus.CREATE.getCode().toString(), ContractStatus.CREATE.getDesc());
+			}
+			if (TokenManager.hasPermission("ContractStatus" + ContractStatus.SIGN.getCode())) {
+				status.put(ContractStatus.SIGN.getCode().toString(), ContractStatus.SIGN.getDesc());
+			}
+			if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CIRCULATION.getCode())) {
+				status.put(ContractStatus.CIRCULATION.getCode().toString(), ContractStatus.CIRCULATION.getDesc());
+			}
+			if (TokenManager.hasPermission("ContractStatus" + ContractStatus.COMPLETE.getCode())) {
+				status.put(ContractStatus.COMPLETE.getCode().toString(), ContractStatus.COMPLETE.getDesc());
+			}
+		}
+		return status;
+	}
 
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/PatentCostMapper.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 
+import java.util.List;
+
 import com.goafanti.common.model.PatentCost;
 
 public interface PatentCostMapper {
@@ -14,4 +16,6 @@ public interface PatentCostMapper {
     int updateByPrimaryKeySelective(PatentCost record);
 
     int updateByPrimaryKey(PatentCost record);
+
+	void batchInsert(List<PatentCost> pc);
 }

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

@@ -43,5 +43,7 @@ public interface PatentInfoMapper {
 	List<PatentExpireBO> selectExpireRecord();
 
 	List<PatentContractListBo> listContractPatentByContractId(String contractId);
+
+	void batchInsert(List<PatentInfo> pi);
 	
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/PatentRegistrationMapper.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 
+import java.util.List;
+
 import com.goafanti.common.model.PatentRegistration;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.patent.bo.PatentRecieveSendBo;
@@ -19,4 +21,6 @@ public interface PatentRegistrationMapper {
 
 	Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize);
 
+	void batchInsert(List<PatentRegistration> pr);
+
 }

+ 1 - 1
src/main/java/com/goafanti/common/enums/NoticeReadStatus.java

@@ -9,7 +9,7 @@ public enum NoticeReadStatus {
 	
 	UNREAD(0, "通知未读"),
 	READED(1, "通知已读"),
-	OTHER(5, "其他");
+	OTHER(2, "其他");
 
 	private NoticeReadStatus(Integer code, String desc) {
 		this.code = code;

+ 56 - 0
src/main/java/com/goafanti/common/enums/PatentAnnualFeeStatus.java

@@ -0,0 +1,56 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentAnnualFeeStatus {
+	UNPAID(0, "未缴年登印费"),
+	PAID(1, "已缴年登印费"),
+	OTHER(2, "其他");
+
+	private PatentAnnualFeeStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentAnnualFeeStatus> status = new HashMap<Integer, PatentAnnualFeeStatus>();
+
+	static {
+		for (PatentAnnualFeeStatus value : PatentAnnualFeeStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentAnnualFeeStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentAnnualFeeStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+
+}

+ 56 - 0
src/main/java/com/goafanti/common/enums/PatentPaymentStatus.java

@@ -0,0 +1,56 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum PatentPaymentStatus {
+	UNPAID(0, "未缴费"),
+	PAID(1, "已缴费"),
+	OTHER(2, "其他");
+
+	private PatentPaymentStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentPaymentStatus> status = new HashMap<Integer, PatentPaymentStatus>();
+
+	static {
+		for (PatentPaymentStatus value : PatentPaymentStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static PatentPaymentStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static PatentPaymentStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+
+}

+ 22 - 0
src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml

@@ -217,4 +217,26 @@
 			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
 	</select>
+	
+	<insert id="batchInsert" 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 
+    <foreach item="item" index="index" collection="list" separator=",">
+      (
+      	#{item.id,jdbcType=VARCHAR}, 
+      	#{item.pid,jdbcType=VARCHAR},
+		#{item.annualFee,jdbcType=INTEGER},
+		#{item.annualFeeState,jdbcType=INTEGER}, 
+		#{item.applicationFee,jdbcType=INTEGER}, 
+		#{item.trialFee,jdbcType=INTEGER},
+		#{item.printingFee,jdbcType=INTEGER}, 
+		#{item.funds,jdbcType=INTEGER},
+		#{item.reimbursement,jdbcType=INTEGER},
+		#{item.paymentState,jdbcType=INTEGER}
+	  )
+    </foreach>
+  </insert>
 </mapper>

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

@@ -1002,5 +1002,62 @@
   	left join admin a on a.id = pi.principal
   	where contract_id = #{contractId,jdbcType=VARCHAR}
   </select>
+  
+   <insert id="batchInsert" parameterType="com.goafanti.common.model.PatentInfo">
+    insert into patent_info (id,
+		uid, serial_number,
+		patent_number, patent_name, patent_catagory,
+		patent_state, patent_field, patent_des,
+		patent_prory_statement_url,
+		patent_writing_url,
+		authorization_notice_url, patent_certificate_url,
+		patent_application_date, first_inventor_name,
+		first_inventor_nationality, first_inventor_id_number,
+		first_inventor_is_publish, second_inventor_name,
+		second_inventor_nationality, second_inventor_is_publish,
+		third_inventor_name, third_inventor_nationality,
+		third_inventor_is_publish, create_time, author, authorized_date,
+		office, principal, confirm_state, record_time, deleted_sign, contacts, founder,
+		contract_id)
+	values 
+    <foreach item="item" index="index" collection="list" separator=",">
+      (
+      	#{item.id,jdbcType=VARCHAR}, #{item.uid,jdbcType=VARCHAR},
+		#{item.serialNumber,jdbcType=INTEGER},
+		#{item.patentNumber,jdbcType=VARCHAR},
+		#{item.patentName,jdbcType=VARCHAR}, 
+		#{item.patentCatagory,jdbcType=INTEGER},
+		#{item.patentState,jdbcType=INTEGER}, 
+		#{item.patentField,jdbcType=INTEGER},
+		#{item.patentDes,jdbcType=VARCHAR},
+		#{item.patentProryStatementUrl,jdbcType=VARCHAR},
+		#{item.patentWritingUrl,jdbcType=VARCHAR},
+		#{item.authorizationNoticeUrl,jdbcType=VARCHAR},
+		#{item.patentCertificateUrl,jdbcType=VARCHAR},
+		#{item.patentApplicationDate,jdbcType=TIMESTAMP},
+		#{item.firstInventorName,jdbcType=VARCHAR},
+		#{item.firstInventorNationality,jdbcType=VARCHAR},
+		#{item.firstInventorIdNumber,jdbcType=VARCHAR},
+		#{item.firstInventorIsPublish,jdbcType=INTEGER},
+		#{item.secondInventorName,jdbcType=VARCHAR},
+		#{item.secondInventorNationality,jdbcType=VARCHAR},
+		#{item.secondInventorIsPublish,jdbcType=INTEGER},
+		#{item.thirdInventorName,jdbcType=VARCHAR},
+		#{item.thirdInventorNationality,jdbcType=VARCHAR},
+		#{item.thirdInventorIsPublish,jdbcType=INTEGER},
+		#{item.createTime,jdbcType=TIMESTAMP}, 
+		#{item.author,jdbcType=VARCHAR},
+		#{item.authorizedDate,jdbcType=TIMESTAMP},
+		#{item.office,jdbcType=VARCHAR},
+		#{item.principal,jdbcType=VARCHAR}, 
+		#{item.confirmState,jdbcType=INTEGER},
+		#{item.recordTime,jdbcType=TIMESTAMP},
+		#{item.deletedSign,jdbcType=INTEGER},
+		#{item.contacts,jdbcType=INTEGER}, 
+		#{item.founder,jdbcType=VARCHAR},
+		#{item.contractId,jdbcType=VARCHAR}
+	)
+    </foreach>
+  </insert>
 
 </mapper>

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

@@ -234,4 +234,27 @@
 		and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
 	</if>
   </select>
+  
+  <insert id="batchInsert" parameterType="com.goafanti.common.model.PatentRegistration">
+     insert into patent_registration (id, pid, acceptance_receive_time, 
+      acceptance_issue_time, acceptance_tracking_number, 
+      acceptance_express_company, authorization_receive_time, 
+      authorization_issue_time, authorization_tracking_number, 
+      authorization_express_company, certificate_recieve_time, 
+      certificate_issue_time, certificate_tracking_number, 
+      certificate_express_company)
+	values 
+    <foreach item="item" index="index" collection="list" separator=",">
+      (
+      #{item.id,jdbcType=VARCHAR}, #{item.pid,jdbcType=VARCHAR}, #{item.acceptanceReceiveTime,jdbcType=TIMESTAMP}, 
+      #{item.acceptanceIssueTime,jdbcType=TIMESTAMP}, #{item.acceptanceTrackingNumber,jdbcType=VARCHAR}, 
+      #{item.acceptanceExpressCompany,jdbcType=VARCHAR}, #{item.authorizationReceiveTime,jdbcType=TIMESTAMP}, 
+      #{item.authorizationIssueTime,jdbcType=TIMESTAMP}, #{item.authorizationTrackingNumber,jdbcType=VARCHAR}, 
+      #{item.authorizationExpressCompany,jdbcType=VARCHAR}, #{item.certificateRecieveTime,jdbcType=TIMESTAMP}, 
+      #{item.certificateIssueTime,jdbcType=TIMESTAMP}, #{item.certificateTrackingNumber,jdbcType=VARCHAR}, 
+      #{item.certificateExpressCompany,jdbcType=VARCHAR}
+      )
+    </foreach>
+  </insert>
+  
 </mapper>

+ 3 - 3
src/main/java/com/goafanti/contract/bo/InputContract.java

@@ -20,11 +20,11 @@ public class InputContract {
 	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	depict;
 	
-	@Max(value = 99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Max(value = 30, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	patentNum;
 	
-	@Max(value = 99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Max(value = 30, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	copyrightNum;
 	
@@ -32,7 +32,7 @@ public class InputContract {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	cognizanceYear;
 	
-	@Max(value = 99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Max(value = 30, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	techProjectNum;
 	

+ 2 - 0
src/main/java/com/goafanti/contract/service/ContractService.java

@@ -18,4 +18,6 @@ public interface ContractService {
 
 	ContractDetail selectContractDetail(String id);
 
+	Contract selectByPrimaryKey(String id);
+
 }

+ 5 - 0
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -214,4 +214,9 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 		return contractMapper.selectContractDetail(id);
 	}
 
+	@Override
+	public Contract selectByPrimaryKey(String id) {
+		return contractMapper.selectByPrimaryKey(id);
+	}
+
 }

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

@@ -3,6 +3,7 @@ package com.goafanti.patent.service;
 import java.util.Date;
 import java.util.List;
 
+import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -52,4 +53,6 @@ public interface PatentInfoService {
 
 	List<PatentContractListBo> listContractPatentByContractId(String contractId);
 
+	void batchInsertContractRecord(Contract c);
+
 }

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

@@ -27,8 +27,11 @@ import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.IntellectualPropertyType;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.enums.PatentAnnualFeeStatus;
 import com.goafanti.common.enums.PatentInfoStatus;
+import com.goafanti.common.enums.PatentPaymentStatus;
 import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.common.model.OrganizationIdentity;
@@ -363,9 +366,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			if (TokenManager.getToken() instanceof Admin) {
 				log.setOperator(TokenManager.getAdminId());
 			}
-			if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.DELIVERD) {
-				p.setCreateTime(recordTime);
-			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.ACCEPT) {
+			if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.ACCEPT) {
 				p.setPatentApplicationDate(recordTime);
 			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.AUTHORIZE) {
 				p.setAuthorizedDate(recordTime);
@@ -505,7 +506,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		log.setPrincipal(aid);
 		log.setComment(patentInfo.getPatentDes());
 		patentLogMapper.insert(log);
-		
+
 		createNotice(patentInfo, log);
 		return p;
 	}
@@ -517,7 +518,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
-		patentInfo.setRecordTime(now.getTime());
+		patentInfo.setCreateTime(now.getTime());
 
 		patentInfoMapper.insert(patentInfo);
 
@@ -535,6 +536,59 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		return patentInfo;
 	}
 
+	@Override
+	public List<PatentContractListBo> listContractPatentByContractId(String contractId) {
+		return patentInfoMapper.listContractPatentByContractId(contractId);
+	}
+
+	@Override
+	public void batchInsertContractRecord(Contract contract) {
+		List<PatentInfo> pi = new ArrayList<>();
+		List<PatentRegistration> pr = new ArrayList<>();
+		List<PatentCost> pc = new ArrayList<>();
+		List<PatentLog> pl = new ArrayList<>();
+		for (int i = 0; i < contract.getPatentNum(); i++) {
+			PatentInfo p = new PatentInfo();
+			PatentLog l = new PatentLog();
+			PatentRegistration r = new PatentRegistration();
+			PatentCost c = new PatentCost();
+			
+			p.setId(UUID.randomUUID().toString());
+			p.setUid(contract.getUid());
+			p.setContractId(contract.getId());
+			p.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+			p.setFounder(TokenManager.getAdminId());
+			p.setPrincipal(TokenManager.getAdminId());
+			p.setPatentState(PatentInfoStatus.CREATE.getCode());
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			p.setCreateTime(now.getTime());
+			
+			l.setId(UUID.randomUUID().toString());
+			l.setPid(p.getId());
+			l.setPrincipal(TokenManager.getAdminId());
+			l.setOperator(TokenManager.getAdminId());
+			l.setRecordTime(now.getTime());
+			l.setState(PatentInfoStatus.CREATE.getCode());
+			
+			r.setId(UUID.randomUUID().toString());
+			r.setPid(p.getId());
+			
+			c.setId(UUID.randomUUID().toString());
+			c.setPid(p.getId());
+			c.setAnnualFeeState(PatentAnnualFeeStatus.UNPAID.getCode());
+			c.setPaymentState(PatentPaymentStatus.UNPAID.getCode());
+			pi.add(p);
+			pr.add(r);
+			pc.add(c);
+			pl.add(l);
+		}
+		patentInfoMapper.batchInsert(pi);
+		patentRegistrationMapper.batchInsert(pr);
+		patentCostMapper.batchInsert(pc);
+		patentLogMapper.batchInsert(pl);
+	}
+
 	private void createNotice(PatentInfo p, PatentLog l) {
 		PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
 
@@ -559,9 +613,4 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 		noticeMapper.insert(n);
 	}
 
-	@Override
-	public List<PatentContractListBo> listContractPatentByContractId(String contractId) {
-		return patentInfoMapper.listContractPatentByContractId(contractId);
-	}
-
 }