albertshaw лет назад: 8
Родитель
Сommit
b4d011c143

+ 2 - 0
schema/2017-03-22.sql

@@ -0,0 +1,2 @@
+ALTER TABLE `copyright_info` 
+ADD COLUMN `copyright_number` VARCHAR(18) NULL COMMENT '软著证书编号';

+ 1 - 0
src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java

@@ -92,6 +92,7 @@ public class AdminCopyrightApiController extends CertifyApiController {
 
 		CopyrightInfo ci = new CopyrightInfo();
 		CopyrightLog cl = new CopyrightLog();
+		BeanUtils.copyProperties(oci, ci);
 		BeanUtils.copyProperties(inputInfo, ci);
 		BeanUtils.copyProperties(inputInfo, cl);
 		ci.setId(oci.getId());

+ 18 - 5
src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml

@@ -18,13 +18,14 @@
     <result column="in_urgent" jdbcType="INTEGER" property="inUrgent" />
     <result column="authorized_date" jdbcType="TIMESTAMP" property="authorizedDate" />
     <result column="certificate_url" jdbcType="VARCHAR" property="certificateUrl" />
+    <result column="copyright_number" jdbcType="VARCHAR" property="copyrightNumber" />
     <result column="application_url" jdbcType="VARCHAR" property="applicationUrl" />
     <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
   </resultMap>
   <sql id="Base_Column_List">
     id, uid, serial_number, create_time, accept_time, principal, contact, copyright_info, 
     copyright_name, status, work_issue, comment, outsource, in_urgent, authorized_date, 
-    certificate_url, application_url, delete_sign
+    certificate_url, application_url, delete_sign, copyright_number
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select 
@@ -42,14 +43,16 @@
       contact, copyright_info, copyright_name, 
       status, work_issue, comment, 
       outsource, in_urgent, authorized_date, 
-      certificate_url, application_url, delete_sign
+      certificate_url, copyright_number, application_url, delete_sign
       )
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{acceptTime,jdbcType=TIMESTAMP}, #{principal,jdbcType=VARCHAR}, 
       #{contact,jdbcType=INTEGER}, #{copyrightInfo,jdbcType=VARCHAR}, #{copyrightName,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{workIssue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, 
       #{outsource,jdbcType=VARCHAR}, #{inUrgent,jdbcType=INTEGER}, #{authorizedDate,jdbcType=TIMESTAMP}, 
-      #{certificateUrl,jdbcType=VARCHAR}, #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}
+      #{certificateUrl,jdbcType=VARCHAR}, 
+      #{copyrightNumber,jdbcType=VARCHAR}, 
+      #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightInfo">
@@ -103,6 +106,9 @@
       <if test="certificateUrl != null">
         certificate_url,
       </if>
+      <if test="copyrightNumber != null">
+        copyright_number,
+      </if>
       <if test="applicationUrl != null">
         application_url,
       </if>
@@ -159,6 +165,9 @@
       <if test="certificateUrl != null">
         #{certificateUrl,jdbcType=VARCHAR},
       </if>
+      <if test="copyrightNumber != null">
+        #{copyrightNumber,jdbcType=VARCHAR},
+      </if>
       <if test="applicationUrl != null">
         #{applicationUrl,jdbcType=VARCHAR},
       </if>
@@ -215,6 +224,9 @@
       <if test="certificateUrl != null">
         certificate_url = #{certificateUrl,jdbcType=VARCHAR},
       </if>
+      <if test="copyrightNumber != null">
+        copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
+      </if>
       <if test="applicationUrl != null">
         application_url = #{applicationUrl,jdbcType=VARCHAR},
       </if>
@@ -241,6 +253,7 @@
       in_urgent = #{inUrgent,jdbcType=INTEGER},
       authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
       certificate_url = #{certificateUrl,jdbcType=VARCHAR},
+      copyright_number = #{copyrightNumber,jdbcType=VARCHAR},
       application_url = #{applicationUrl,jdbcType=VARCHAR},
       delete_sign = #{deleteSign,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
@@ -250,7 +263,7 @@
   	select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime, 
 	ci.accept_time as acceptTime, ci.contact,
 	ci.copyright_name as copyrightName, ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, 
-	ci.authorized_date as authorizedDate, ci.work_issue as workIssue,
+	ci.authorized_date as authorizedDate, ci.work_issue as workIssue, ci.copyright_number as copyrightNumber,
 	oi.location_province as province,oi.unit_name as unitName, 
 	concat(oi.first_contacts,'  ', oi.first_mobile) as firstContact,
 	concat(oi.second_contacts,'  ', oi.second_mobile) as secondContact,
@@ -349,7 +362,7 @@
   <select id="findByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightInfoDetail">
     select ci.id,ci.uid,ci.serial_number as serialNumber, ci.create_time as createTime, 
 	ci.accept_time as acceptTime, ci.contact, ci.copyright_name as copyrightName, ci.copyright_info as copyrightInfo, 
-	ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate, 
+	ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate, ci.copyright_number as copyrightNumber,  
 	ci.work_issue as workIssue,ci.application_url as applicationUrl,ci.certificate_url as certificateUrl,
 	oi.location_province as province, oi.location_city as city,oi.location_area as area, oi.postcode,
 	oi.unit_name as unitName, oi.org_code as orgCode,

+ 228 - 215
src/main/java/com/goafanti/common/model/CopyrightInfo.java

@@ -2,230 +2,243 @@ package com.goafanti.common.model;
 
 import java.util.Date;
 
-public class CopyrightInfo extends BaseModel{
-    /**
+public class CopyrightInfo extends BaseModel {
+	/**
 	 * 
 	 */
-	private static final long serialVersionUID = 1L;
-
-    /**
-    * 用户主键
-    */
-    private String uid;
-
-    /**
-    * 编号
-    */
-    private Integer serialNumber;
-
-    /**
-    * 创建时间
-    */
-    private Date createTime;
-
-    /**
-    * 受理时间
-    */
-    private Date acceptTime;
-
-    /**
-    * 负责人
-    */
-    private String principal;
-
-    /**
-    * 联系人
-    */
-    private Integer contact;
-
-    /**
-    * 软著简介
-    */
-    private String copyrightInfo;
-
-    /**
-    * 软著名字
-    */
-    private String copyrightName;
-
-    /**
-    * 申请状态
-    */
-    private Integer status;
-
-    /**
-    * 派单信息
-    */
-    private String workIssue;
-
-    /**
-    * 备注
-    */
-    private String comment;
-
-    /**
-    * 外包公司
-    */
-    private String outsource;
-
-    /**
-    * 加急天数
-    */
-    private Integer inUrgent;
-
-    /**
-    * 下证日
-    */
-    private Date authorizedDate;
-
-    /**
-    * 证书附件地址
-    */
-    private String certificateUrl;
-
-    /**
-    * 申请书附件地址
-    */
-    private String applicationUrl;
-
-    /**
-    * 删除标记
-    */
-    private Integer deleteSign;
-
-    public String getUid() {
-        return uid;
-    }
-
-    public void setUid(String uid) {
-        this.uid = uid;
-    }
-
-    public Integer getSerialNumber() {
-        return serialNumber;
-    }
-
-    public void setSerialNumber(Integer serialNumber) {
-        this.serialNumber = serialNumber;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getAcceptTime() {
-        return acceptTime;
-    }
-
-    public void setAcceptTime(Date acceptTime) {
-        this.acceptTime = acceptTime;
-    }
-
-    public String getPrincipal() {
-        return principal;
-    }
-
-    public void setPrincipal(String principal) {
-        this.principal = principal;
-    }
-
-    public Integer getContact() {
-        return contact;
-    }
-
-    public void setContact(Integer contact) {
-        this.contact = contact;
-    }
-
-    public String getCopyrightInfo() {
-        return copyrightInfo;
-    }
-
-    public void setCopyrightInfo(String copyrightInfo) {
-        this.copyrightInfo = copyrightInfo;
-    }
-
-    public String getCopyrightName() {
-        return copyrightName;
-    }
-
-    public void setCopyrightName(String copyrightName) {
-        this.copyrightName = copyrightName;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public String getWorkIssue() {
-        return workIssue;
-    }
-
-    public void setWorkIssue(String workIssue) {
-        this.workIssue = workIssue;
-    }
-
-    public String getComment() {
-        return comment;
-    }
-
-    public void setComment(String comment) {
-        this.comment = comment;
-    }
-
-    public String getOutsource() {
-        return outsource;
-    }
-
-    public void setOutsource(String outsource) {
-        this.outsource = outsource;
-    }
-
-    public Integer getInUrgent() {
-        return inUrgent;
-    }
+	private static final long	serialVersionUID	= 1L;
 
-    public void setInUrgent(Integer inUrgent) {
-        this.inUrgent = inUrgent;
-    }
+	/**
+	 * 用户主键
+	 */
+	private String				uid;
+
+	/**
+	 * 编号
+	 */
+	private Integer				serialNumber;
+
+	/**
+	 * 创建时间
+	 */
+	private Date				createTime;
+
+	/**
+	 * 受理时间
+	 */
+	private Date				acceptTime;
+
+	/**
+	 * 负责人
+	 */
+	private String				principal;
+
+	/**
+	 * 联系人
+	 */
+	private Integer				contact;
+
+	/**
+	 * 软著简介
+	 */
+	private String				copyrightInfo;
+
+	/**
+	 * 软著名字
+	 */
+	private String				copyrightName;
+
+	/**
+	 * 申请状态
+	 */
+	private Integer				status;
+
+	/**
+	 * 派单信息
+	 */
+	private String				workIssue;
+
+	/**
+	 * 备注
+	 */
+	private String				comment;
+
+	/**
+	 * 外包公司
+	 */
+	private String				outsource;
+
+	/**
+	 * 加急天数
+	 */
+	private Integer				inUrgent;
+
+	/**
+	 * 下证日
+	 */
+	private Date				authorizedDate;
+
+	/**
+	 * 证书附件地址
+	 */
+	private String				certificateUrl;
+
+	/**
+	 * 申请书附件地址
+	 */
+	private String				applicationUrl;
+
+	/**
+	 * 删除标记
+	 */
+	private Integer				deleteSign;
+
+	/**
+	 * 申请号/专利号
+	 */
+	private String				copyrightNumber;
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getAcceptTime() {
+		return acceptTime;
+	}
+
+	public void setAcceptTime(Date acceptTime) {
+		this.acceptTime = acceptTime;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public Integer getContact() {
+		return contact;
+	}
+
+	public void setContact(Integer contact) {
+		this.contact = contact;
+	}
+
+	public String getCopyrightInfo() {
+		return copyrightInfo;
+	}
+
+	public void setCopyrightInfo(String copyrightInfo) {
+		this.copyrightInfo = copyrightInfo;
+	}
+
+	public String getCopyrightName() {
+		return copyrightName;
+	}
+
+	public void setCopyrightName(String copyrightName) {
+		this.copyrightName = copyrightName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getWorkIssue() {
+		return workIssue;
+	}
+
+	public void setWorkIssue(String workIssue) {
+		this.workIssue = workIssue;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getOutsource() {
+		return outsource;
+	}
+
+	public void setOutsource(String outsource) {
+		this.outsource = outsource;
+	}
+
+	public Integer getInUrgent() {
+		return inUrgent;
+	}
+
+	public void setInUrgent(Integer inUrgent) {
+		this.inUrgent = inUrgent;
+	}
+
+	public Date getAuthorizedDate() {
+		return authorizedDate;
+	}
+
+	public void setAuthorizedDate(Date authorizedDate) {
+		this.authorizedDate = authorizedDate;
+	}
 
-    public Date getAuthorizedDate() {
-        return authorizedDate;
-    }
+	public String getCertificateUrl() {
+		return certificateUrl;
+	}
 
-    public void setAuthorizedDate(Date authorizedDate) {
-        this.authorizedDate = authorizedDate;
-    }
+	public void setCertificateUrl(String certificateUrl) {
+		this.certificateUrl = certificateUrl;
+	}
 
-    public String getCertificateUrl() {
-        return certificateUrl;
-    }
+	public String getApplicationUrl() {
+		return applicationUrl;
+	}
 
-    public void setCertificateUrl(String certificateUrl) {
-        this.certificateUrl = certificateUrl;
-    }
+	public void setApplicationUrl(String applicationUrl) {
+		this.applicationUrl = applicationUrl;
+	}
 
-    public String getApplicationUrl() {
-        return applicationUrl;
-    }
+	public Integer getDeleteSign() {
+		return deleteSign;
+	}
 
-    public void setApplicationUrl(String applicationUrl) {
-        this.applicationUrl = applicationUrl;
-    }
+	public void setDeleteSign(Integer deleteSign) {
+		this.deleteSign = deleteSign;
+	}
 
-    public Integer getDeleteSign() {
-        return deleteSign;
-    }
+	public String getCopyrightNumber() {
+		return copyrightNumber;
+	}
 
-    public void setDeleteSign(Integer deleteSign) {
-        this.deleteSign = deleteSign;
-    }
+	public void setCopyrightNumber(String copyrightNumber) {
+		this.copyrightNumber = copyrightNumber;
+	}
 }

+ 14 - 1
src/main/java/com/goafanti/copyright/bo/CopyrightInfoSummary.java

@@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 public class CopyrightInfoSummary {
 
 	private String	id;
-	
+
 	private String	uid;
 	/**
 	 * 省份
@@ -77,6 +77,11 @@ public class CopyrightInfoSummary {
 	private Integer	inUrgent;
 
 	/**
+	 * 申请号/专利号
+	 */
+	private String	copyrightNumber;
+
+	/**
 	 * 下证日
 	 */
 	private Date	authorizedDate;
@@ -277,4 +282,12 @@ public class CopyrightInfoSummary {
 		this.uid = uid;
 	}
 
+	public String getCopyrightNumber() {
+		return copyrightNumber;
+	}
+
+	public void setCopyrightNumber(String copyrightNumber) {
+		this.copyrightNumber = copyrightNumber;
+	}
+
 }

+ 10 - 0
src/main/java/com/goafanti/copyright/bo/InputCopyright.java

@@ -37,6 +37,8 @@ public class InputCopyright {
 	private String	comment;
 	@Size(min = 0, max = 60, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	outsource;
+	@Size(min = 0, max = 18, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	copyrightNumber;
 
 	@Max(value = 30, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
@@ -132,4 +134,12 @@ public class InputCopyright {
 	public void setRecordTime(Date recordTime) {
 		this.recordTime = recordTime;
 	}
+
+	public String getCopyrightNumber() {
+		return copyrightNumber;
+	}
+
+	public void setCopyrightNumber(String copyrightNumber) {
+		this.copyrightNumber = copyrightNumber;
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java

@@ -87,6 +87,7 @@ public class CopyrightApiController extends CertifyApiController {
 
 		CopyrightInfo ci = new CopyrightInfo();
 		CopyrightLog cl = new CopyrightLog();
+		BeanUtils.copyProperties(oci, ci);
 		BeanUtils.copyProperties(inputInfo, ci);
 		ci.setId(oci.getId());
 		ci.setUid(oci.getUid());

+ 22 - 4
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.Calendar;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateUtils;
@@ -14,9 +15,11 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.CopyrightLogMapper;
+import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
 import com.goafanti.common.enums.CopyrightStatus;
 import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
 import com.goafanti.copyright.bo.CopyrightLogBO;
 import com.goafanti.copyright.service.CopyrightInfoService;
@@ -27,9 +30,11 @@ import com.goafanti.core.shiro.token.TokenManager;
 @Service
 public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper> implements CopyrightInfoService {
 	@Autowired
-	private CopyrightInfoMapper	copyrightInfoMapper;
+	private CopyrightInfoMapper				copyrightInfoMapper;
 	@Autowired
-	private CopyrightLogMapper	copyrightLogMapper;
+	private CopyrightLogMapper				copyrightLogMapper;
+	@Autowired
+	private OrgIntellectualPropertyMapper	orgIntellectualPropertyMapper;
 
 	@Override
 	public CopyrightInfo insert(CopyrightInfo copyrightInfo) {
@@ -55,10 +60,23 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 			copyrightLogMapper.insertSelective(copyrightLog);
 			if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.ACCEPT) {
 				copyrightInfo.setAcceptTime(copyrightLog.getRecordTime());
-			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.AUTHORIZED) {
-				copyrightInfo.setAuthorizedDate(copyrightLog.getRecordTime());
 			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.DELIVERD) {
 				copyrightInfo.setCreateTime(copyrightLog.getRecordTime());
+			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.AUTHORIZED) {
+				copyrightInfo.setAuthorizedDate(copyrightLog.getRecordTime());
+				OrgIntellectualProperty o = new OrgIntellectualProperty();
+				o.setId(UUID.randomUUID().toString());
+				o.setUid(copyrightInfo.getUid());
+				o.setPid(copyrightInfo.getId());
+				o.setDeletedSign(0);
+				o.setIntellectualPropertyNumber(copyrightInfo.getCopyrightNumber());
+				o.setIntellectualPropertyName(copyrightInfo.getCopyrightName());
+				o.setCatagory(4);
+				o.setObtainWay(1);
+				o.setAuthorizationNumber(copyrightInfo.getCopyrightNumber());
+				o.setAuthorizationDate(copyrightInfo.getAuthorizedDate());
+				o.setEvaluationCategory(1);
+				orgIntellectualPropertyMapper.insert(o);
 			}
 		}
 		copyrightInfoMapper.updateByPrimaryKeySelective(copyrightInfo);