Antiloveg лет назад: 8
Родитель
Сommit
f6adeb44a2

+ 12 - 4
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -489,9 +489,9 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到保存提交方式", "保存提交方式"));
 			return res;
 		}
-		
+
 		UserIdentity idd = userIdentityService.selectUserIdentityByUserId(userIdentity.getUid());
-		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())){
+		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())) {
 			res.getError().add(buildError("", "审核中,无法保存或提交!"));
 			return res;
 		}
@@ -597,9 +597,9 @@ public class AdminApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "保存提交方式"));
 			return res;
 		}
-		
+
 		OrganizationIdentity idd = organizationIdentityService.selectOrgIdentityByUserId(orgIdentity.getUid());
-		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())){
+		if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())) {
 			res.getError().add(buildError("", "审核中,无法保存或提交!"));
 			return res;
 		}
@@ -1017,6 +1017,14 @@ public class AdminApiController extends CertifyApiController {
 		if (!checkCertify(res, orgIntellectualProperty.getUid()).getError().isEmpty()) {
 			return res;
 		}
+
+		OrgIntellectualProperty p = orgIntellectualPropertyService.findByUidAndIntellectualPropertyNumber(
+				orgIntellectualProperty.getUid(), orgIntellectualProperty.getIntellectualPropertyNumber());
+		if (null != p) {
+			res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
+			return res;
+		}
+
 		if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
 			try {
 				orgIntellectualProperty.setAuthorizationDate(

+ 12 - 6
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -1602,15 +1602,21 @@ public class CognizanceApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (!checkUserLogin(res)) {
-			return res;
-		}
-
 		User curUser = TokenManager.getUserToken();
 		if (!checkCertify(res, curUser)) {
 			return res;
 		}
-
+		
+		if (StringUtils.isBlank(orgIntellectualProperty.getIntellectualPropertyNumber())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "知识产权编号", "知识产权编号"));
+			return res;
+		}
+		
+		OrgIntellectualProperty p = orgIntellectualPropertyService.findByUidAndIntellectualPropertyNumber(TokenManager.getUserId(), orgIntellectualProperty.getIntellectualPropertyNumber());
+		if (null != p){
+			res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
+			return res;
+		}
 		if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
 			try {
 				orgIntellectualProperty.setAuthorizationDate(
@@ -1723,7 +1729,7 @@ public class CognizanceApiController extends CertifyApiController {
 		if (StringUtils.isBlank(otp.getId())) {
 			OrgTechProduct product = orgTechProductService.findBySerialNumberAndUid(otp.getSerialNumber(),
 					TokenManager.getUserId());
-			if (null != product){
+			if (null != product) {
 				res.getError().add(buildError("", "产品编号重复,无法保存!"));
 				return res;
 			}

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

@@ -31,4 +31,6 @@ public interface OrgIntellectualPropertyService {
 
 	List<OrgIntellectualProperty> selectIntellectualPropertyList(Integer year, String uid);
 
+	OrgIntellectualProperty findByUidAndIntellectualPropertyNumber(String userId, String intellectualPropertyNumber);
+
 }

+ 16 - 10
src/main/java/com/goafanti/cognizance/service/impl/OrgIntellectualPropertyServiceImpl.java

@@ -39,29 +39,29 @@ public class OrgIntellectualPropertyServiceImpl extends BaseMybatisDao<OrgIntell
 		Map<String, Object> params = new HashMap<>();
 		Date sDate = null;
 		Date eDate = null;
-		if (!StringUtils.isBlank(uid)){
+		if (!StringUtils.isBlank(uid)) {
 			params.put("uid", uid);
 		}
-		
-		if (!StringUtils.isBlank(startDate)){
+
+		if (!StringUtils.isBlank(startDate)) {
 			try {
 				sDate = DateUtils.parseDate(startDate, AFTConstants.YYYYMMDD);
 			} catch (ParseException e) {
 			}
 		}
-		
-		if (!StringUtils.isBlank(endDate)){
+
+		if (!StringUtils.isBlank(endDate)) {
 			try {
-				eDate = DateUtils.addDays(DateUtils.parseDate(endDate, AFTConstants.YYYYMMDD),1);
+				eDate = DateUtils.addDays(DateUtils.parseDate(endDate, AFTConstants.YYYYMMDD), 1);
 			} catch (ParseException e) {
 			}
 		}
-		
-		if (null != sDate){
+
+		if (null != sDate) {
 			params.put("sDate", sDate);
 		}
-		
-		if (null != eDate){
+
+		if (null != eDate) {
 			params.put("eDate", eDate);
 		}
 
@@ -134,4 +134,10 @@ public class OrgIntellectualPropertyServiceImpl extends BaseMybatisDao<OrgIntell
 		return orgIntellectualPropertyMapper.selectIntellectualPropertyList(year, uid);
 	}
 
+	@Override
+	public OrgIntellectualProperty findByUidAndIntellectualPropertyNumber(String uid,
+			String intellectualPropertyNumber) {
+		return orgIntellectualPropertyMapper.findByUidAndIntellectualPropertyNumber(uid, intellectualPropertyNumber);
+	}
+
 }

+ 11 - 6
src/main/java/com/goafanti/common/dao/OrgIntellectualPropertyMapper.java

@@ -2,22 +2,24 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.cognizance.bo.AnnualReportPropertyRightBo;
 import com.goafanti.cognizance.bo.OrgIntellectualPropertyDetailBo;
 import com.goafanti.common.model.OrgIntellectualProperty;
 
 public interface OrgIntellectualPropertyMapper {
-    int deleteByPrimaryKey(String id);
+	int deleteByPrimaryKey(String id);
 
-    int insert(OrgIntellectualProperty record);
+	int insert(OrgIntellectualProperty record);
 
-    int insertSelective(OrgIntellectualProperty record);
+	int insertSelective(OrgIntellectualProperty record);
 
-    OrgIntellectualProperty selectByPrimaryKey(String id);
+	OrgIntellectualProperty selectByPrimaryKey(String id);
 
-    int updateByPrimaryKeySelective(OrgIntellectualProperty record);
+	int updateByPrimaryKeySelective(OrgIntellectualProperty record);
 
-    int updateByPrimaryKey(OrgIntellectualProperty record);
+	int updateByPrimaryKey(OrgIntellectualProperty record);
 
 	int batchDeleteByPrimaryKey(List<String> id);
 
@@ -32,4 +34,7 @@ public interface OrgIntellectualPropertyMapper {
 	AnnualReportPropertyRightBo selectIntellectualPropertyCount(Integer year, String uid);
 
 	Integer findIntellectualPropertyNum(String uid);
+
+	OrgIntellectualProperty findByUidAndIntellectualPropertyNumber(@Param("uid") String uid,
+			@Param("intellectualPropertyNumber") String intellectualPropertyNumber);
 }

+ 1 - 1
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -310,7 +310,7 @@
   	<if test="uid != null">
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
-  	<if test="username != null">
+  	<if test="unitName != null">
   		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   	order by do.serial_number desc

+ 9 - 0
src/main/java/com/goafanti/common/mapper/OrgIntellectualPropertyMapper.xml

@@ -388,4 +388,13 @@
   		deleted_sign = 0
   	and uid = #{uid,jdbcType=VARCHAR}
   </select>
+  
+   <select id="findByUidAndIntellectualPropertyNumber" resultMap="BaseResultMap" >
+    select 
+    <include refid="Base_Column_List" />
+    from org_intellectual_property
+    where uid = #{uid,jdbcType=VARCHAR}
+    and intellectual_Property_number = #{intellectualPropertyNumber,jdbcType=VARCHAR}
+    and deleted_sign = 0
+  </select>
 </mapper>

+ 1 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -361,6 +361,7 @@
 	LEFT JOIN user_identity i on u.id = i.uid
    
     where u.aid = #{aid,jdbcType=VARCHAR}
+    order by u.number desc
   </select>
   
   <select id="findUserByNameAndMobile" resultType="java.lang.String">