Browse Source

Merge branch 'test' of git@git.coding.net:aft/AFT.git into test

wanghui 8 years ago
parent
commit
4d55f2e6c0

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

@@ -56,7 +56,6 @@ import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.DistrictGlossory;
 import com.goafanti.common.model.OrgRatepay;
-import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentCost;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.PatentLog;

+ 18 - 11
src/main/java/com/goafanti/admin/controller/AdminPreviewApiController.java

@@ -94,12 +94,20 @@ public class AdminPreviewApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
 			return res;
 		}
-		PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
-		if (null == pi) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
-			return res;
-		}
 		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY) {
+			OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
+			if (null == ratepay) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税报表ID"));
+				return res;
+			}
+		} else {
+			PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
+			if (null == pi) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
+				return res;
+			}
+		}
 		if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
 				|| attachmentType == AttachmentType.AUTHORIZATION_NOTICE
 				|| attachmentType == AttachmentType.LAST_YEAR_RATEPAY
@@ -500,7 +508,7 @@ public class AdminPreviewApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 标准制定情况附件预览授权
 	 * @param id
@@ -508,15 +516,15 @@ public class AdminPreviewApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/standard", method = RequestMethod.GET)
-	public Result previewStandard(String id, String sign){
-		Result res  = new Result();
+	public Result previewStandard(String id, String sign) {
+		Result res = new Result();
 		if (StringUtils.isEmpty(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
 			return res;
 		}
-		
+
 		OrgStandard os = orgStandardService.selectByPrimaryKey(id);
-		if (null == os){
+		if (null == os) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
 			return res;
 		}
@@ -530,6 +538,5 @@ public class AdminPreviewApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
 
 }

+ 1 - 1
src/main/java/com/goafanti/cognizance/bo/InputApplyCognizance.java

@@ -12,7 +12,7 @@ public class InputApplyCognizance {
 	private String uid;
 	
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer contacts;
 	
 	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")

+ 1 - 1
src/main/java/com/goafanti/cognizance/bo/InputOrgCognizance.java

@@ -14,7 +14,7 @@ public class InputOrgCognizance {
 	private String	uid;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	contacts;
 
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")

+ 2 - 1
src/main/java/com/goafanti/common/controller/PreviewController.java

@@ -35,7 +35,6 @@ import com.goafanti.common.model.OrgStandard;
 import com.goafanti.common.model.OrgTechAchievement;
 import com.goafanti.common.model.OrgTechCenterDetail;
 import com.goafanti.common.model.OrgTechProduct;
-import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.PatentInfo;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.utils.DateUtils;
@@ -248,6 +247,8 @@ public class PreviewController extends BaseApiController {
 			downloadFile(response, pi.getAuthorizationNoticeDownloadFileName(), pi.getAuthorizationNoticeUrl());
 		} else if (attachmentType == AttachmentType.PATENT_CERTIFICATE) {
 			downloadFile(response, pi.getPatentCertificateDownloadFileName(), pi.getPatentCertificateUrl());
+		} else if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
+			downloadFile(response, pi.getPatentProryStatementDownloadFileName(), pi.getPatentProryStatementUrl());
 		}
 	}
 

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

@@ -349,7 +349,7 @@
     and oi.unit_name= #{unitName,jdbcType=VARCAHR}
   </if>
   <if test="principal != null">
-	group by c.id
+	group by c.id, oi.id
   </if>
 	order by c.serial_number DESC
   <if test="page_sql!=null">
@@ -359,7 +359,7 @@
   
   <select id="findManageContractCount" resultType="java.lang.Integer"
 		parameterType="String">
-   select count(1)
+   select count(distinct(c.id))
    from contract c 
 		LEFT JOIN organization_identity oi on oi.uid = c.uid
 		LEFT JOIN admin a on a.id = c.founder
@@ -397,9 +397,6 @@
    <if test="unitName !=null">
     and oi.unit_name= #{unitName,jdbcType=VARCAHR}
   </if>
-  <if test="principal != null">
-	group by c.id
-  </if>
   </select>
   
   <select id="selectContractDetail" parameterType="java.lang.String" resultType="com.goafanti.contract.bo.ContractDetail">

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

@@ -339,7 +339,7 @@
 	    and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
 	</if>
 	<if test="principal != null">
-		group by ci.id
+		group by ci.id,oi.id
 	</if>
 	order by ci.serial_number desc
   	<if test="page_sql!=null">
@@ -348,7 +348,7 @@
   </select>
   
   <select id="findListCount" resultType="java.lang.Integer"  parameterType="String">
-  	select count(*)
+  	select count(distinct(ci.id))
 	from copyright_info ci 
 	left join organization_identity oi on ci.uid = oi.uid
 	<if test="principal != null">
@@ -394,9 +394,6 @@
 	<if test="authEndTime != null">
 	    and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
 	</if>
-	<if test="principal != null">
-		group by ci.id
-	</if>
   </select>
   
   <update id="deleteByPrimaryKeys" parameterType="java.util.List">

+ 3 - 6
src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml

@@ -347,7 +347,7 @@
 		and i.licence_province = #{locationProvince, jdbcType=INTEGER}
 	</if>
 	<if test="principal != null">
-		group by c.id
+		group by c.id,i.id
 	</if>
      order by c.serial_number desc
 	<if test="page_sql!=null">
@@ -356,7 +356,7 @@
   </select>
   
    <select id="findCognizanceBoCount" resultType="java.lang.Integer" parameterType="String">
-  	select count(1)
+  	select count(distinct(c.id))
 	from org_cognizance c 
 	LEFT JOIN organization_identity i on c.uid = i.uid
 	<if test="principal != null">
@@ -378,9 +378,6 @@
 	<if test="locationProvince != null">
 		and i.licence_province = #{locationProvince, jdbcType=INTEGER}
 	</if>
-	<if test="principal != null">
-		group by c.id
-	</if>
 	</select>
 	
 	
@@ -562,7 +559,7 @@
 	from user u 
 	LEFT JOIN organization_identity i  on u.id = i.uid 
 	LEFT JOIN admin a on a.id = u.aid
-	where u.type = 1 and u.lvl = 1
+	where u.type = 1 and u.lvl > 0
 	<if test="unitName != null">
 	    and i.unit_name like  CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
 	</if>

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

@@ -188,7 +188,7 @@
 			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
 		<if test="principal != null">
-			group by p.id
+			group by p.id,o.id,c.id
 		</if>
 		order by p.serial_number DESC
 		<if test="page_sql!=null">
@@ -198,7 +198,7 @@
 
 	<select id="findApplicationFeeCount" resultType="java.lang.Integer"
 		parameterType="java.lang.String">
-		select count(1)
+		select count(distinct(p.id))
 		from patent_info p
 		LEFT JOIN organization_identity o on o.uid = p.uid
 		LEFT JOIN patent_cost c on p.id = c.pid
@@ -217,9 +217,6 @@
 			and p.patent_application_date <![CDATA[ < ]]>
 			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
-		<if test="principal != null">
-			group by p.id
-		</if>
 	</select>
 	
  <insert id="batchInsert" parameterType="com.goafanti.common.model.PatentCost">

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

@@ -677,7 +677,7 @@
 			#{locationProvince,jdbcType=INTEGER}
 		</if>
 		<if test="principal != null">
-			group by p.id
+			group by p.id, o.id
 		</if>
 		ORDER BY p.serial_number DESC
 		<if test="page_sql!=null">
@@ -687,7 +687,7 @@
 
 	<select id="findManagePatentCount" resultType="java.lang.Integer"
 		parameterType="String">
-		select count(1)
+		select count(distinct(p.id))
 		from patent_info p
 		LEFT JOIN organization_identity o on
 		p.uid = o.uid
@@ -753,9 +753,6 @@
 			and
 			o.licence_province=#{locationProvince,jdbcType=INTEGER}
 		</if>
-		<if test="principal != null">
-			group by p.id
-		</if>
 	</select>
 
 	<select id="findManagePendingPaymentListByPage" resultType="com.goafanti.patent.bo.PatentPendingBo"
@@ -783,7 +780,7 @@
 			#{locationProvince,jdbcType=INTEGER}
 		</if>
 		<if test="principal != null">
-			group by p.id
+			group by p.id,o.id,c.id
 		</if>
 		ORDER BY p.serial_number DESC
 		<if test="page_sql!=null">
@@ -793,7 +790,7 @@
 
 	<select id="findManagePendingPaymentCount" resultType="java.lang.Integer"
 		parameterType="String">
-		select count(1)
+		select count(distinct(p.id))
 		from patent_info p 
 		INNER JOIN patent_cost c on p.id = c.pid
 		LEFT JOIN organization_identity o on p.uid = o.id 
@@ -808,9 +805,6 @@
 			and o.licence_province =
 			#{locationProvince,jdbcType=INTEGER}
 		</if>
-		<if test="principal != null">
-			group by p.id
-		</if>
 	</select>
 
 	<select id="findNoticeOfCorrectionListByPage" parameterType="String"
@@ -876,7 +870,7 @@
 			o.licence_province=#{locationProvince,jdbcType=INTEGER}
 		</if>
 		<if test="principal != null">
-			group by p.id
+			group by p.id,o.id
 		</if>
 		order by p.serial_number DESC
 		<if test="page_sql!=null">
@@ -886,7 +880,7 @@
 
 	<select id="findNoticeOfCorrectionCount" resultType="java.lang.Integer"
 		parameterType="String">
-		select count(1)
+		select count(distinct(p.id))
 		FROM patent_info p
 		LEFT JOIN organization_identity o ON o.uid = p.uid
     	LEFT JOIN admin a on a.id = p.author

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

@@ -235,7 +235,7 @@
 		</if>
 		 where p.deleted_sign = 0
 		<if test="principal != null">
-			group by p.id
+			group by p.id,o.id,r.id
 		</if>
 		order by p.serial_number DESC
 		<if test="page_sql!=null">
@@ -244,7 +244,7 @@
   </select>
   
   <select id="findRecieveSendCount" resultType="java.lang.Integer">
-  	select count(1)
+  	select count(distinct(p.id))
 	from patent_info p 
 	LEFT  JOIN patent_registration r  on p.id = r.pid
 	LEFT JOIN organization_identity o on o.uid = p.uid 

+ 3 - 6
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -394,7 +394,7 @@
     	and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')  
     </if>
      <if test="principal != null">
-		group by p.id
+		group by p.id,i.id
 	</if>
     order by p.serial_number desc
    <if test="page_sql!=null">
@@ -403,7 +403,7 @@
   </select>
   
   <select id="findTechProjectManageCount" resultType="java.lang.Integer" parameterType="String">
- 	select count(1)  
+ 	select count(distinct(p.id))  
 	 	FROM  tech_project p
 		LEFT JOIN organization_identity i on i.uid = p.uid
 		LEFT JOIN tech_website w on p.department = w.id 
@@ -426,9 +426,6 @@
     <if test="unitName != null" >
     	and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')  
     </if>
-     <if test="principal != null">
-		group by p.id
-	</if>
   </select>
   
   <select id="selectProjectDetail" resultType="com.goafanti.techproject.bo.TechProjectDetailBo" parameterType="java.lang.String">
@@ -506,7 +503,7 @@
 		and tpl.principal = #{principal,jdbcType=VARCHAR}
 	</if>
 	 <if test="_parameter != null">
-		group by tp.id
+		group by tp.id,oi.id
 	</if> 
   </select>
   

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

@@ -47,7 +47,7 @@ public class InputContract {
 	private Integer status;
 	
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer contacts;
 
 	public String getUid() {

+ 1 - 1
src/main/java/com/goafanti/contract/bo/InputSaveContract.java

@@ -14,7 +14,7 @@ public class InputSaveContract {
 	private String	uid;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	contacts;
 
 	private Integer	serialNumber;

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

@@ -17,7 +17,7 @@ public class InputCopyright {
 	private String	principal;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	contact;
 
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")

+ 1 - 1
src/main/java/com/goafanti/demand/bo/InputDemand.java

@@ -106,7 +106,7 @@ public class InputDemand {
 	private String		employerContactsMailbox;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		contacts;
 
 	@Max(value = 2, message = "{" + ErrorConstants.PARAM_ERROR + "}")

+ 1 - 1
src/main/java/com/goafanti/patent/bo/InputPatentInfo.java

@@ -16,7 +16,7 @@ public class InputPatentInfo {
 	private String	uid;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	contacts;
 
 	@Size(min = 0, max = 64, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")

+ 1 - 1
src/main/java/com/goafanti/techproject/bo/InputTechProject.java

@@ -16,7 +16,7 @@ public class InputTechProject {
 	private String		uid;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		contacts;
 
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")

+ 1 - 1
src/main/java/com/goafanti/user/bo/InputOrganizationIdentity.java

@@ -139,7 +139,7 @@ public class InputOrganizationIdentity {
 	private Date		issuingDate;
 
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		cogContacts;
 
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")