Explorar o código

相关重复数据的处理

anderx %!s(int64=7) %!d(string=hai) anos
pai
achega
df3d23352a

+ 6 - 2
src/main/java/com/goafanti/common/dao/OrganizationAnnualReportMapper.java

@@ -94,11 +94,15 @@ public interface OrganizationAnnualReportMapper {
      */
     int updateByPrimaryKey(OrganizationAnnualReport record);
 
-	int checkYear(Integer year);
+    int checkYear(@Param("uid")String uid, @Param("year")Integer year);
 
-	int checkAnnual(@Param("id")String id, @Param("year")Integer year);
+    int checkAnnual(@Param("id")String id, @Param("uid")String uid, @Param("year")Integer year);
 
 	int selectOrgAnnualCount(String uid);
 
 	int selectOrgYearProjectCount(String uid);
+
+	
+
+	
 }

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

@@ -338,11 +338,11 @@
       aid = #{aid,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <select id="checkYear" parameterType="integer" resultType="integer">
-  	select count(*) from organization_annual_report where year = #{year,jdbcType=INTEGER} 
+  <select id="checkYear"  resultType="integer">
+  	select count(*) from organization_annual_report where uid = #{uid,jdbcType=VARCHAR} and  year = #{year,jdbcType=INTEGER} 
   </select>
   <select id="checkAnnual"  resultType="integer">
-  	select count(*) from organization_annual_report where id != #{id,jdbcType=VARCHAR} and year = #{year,jdbcType=INTEGER}  
+  	select count(*) from organization_annual_report where id!= #{id,jdbcType=VARCHAR} and uid = #{uid,jdbcType=VARCHAR} and year = #{year,jdbcType=INTEGER}  
   </select>
   <select id="selectOrgAnnualList" resultMap="BaseResultMap">
    select 

+ 1 - 1
src/main/java/com/goafanti/customer/controller/OrganizationAnnualReportController.java

@@ -48,7 +48,7 @@ public class OrganizationAnnualReportController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "年份"));
 			return res;
 		}
-		if (adminOrgAnnualReportService.checkYear(o.getYear())) {
+		if (adminOrgAnnualReportService.checkYear(o)) {
 			res.getError().add(buildError("", "年份已存在", "年份已存在"));
 			return res;
 		}

+ 3 - 3
src/main/java/com/goafanti/customer/service/AdminOrgAnnualReportService.java

@@ -16,9 +16,7 @@ public interface AdminOrgAnnualReportService {
 
 	Pagination<OrganizationAnnualReport> selectListOrgAnnual(OrganizationAnnualReport o, Integer pNo, Integer pSize);
 
-	boolean checkAnnual(OrganizationAnnualReport o);
-	
-	boolean checkYear(Integer year);
+	boolean checkYear(OrganizationAnnualReport o);
 
 	int addOrgYearProject(OrganizationYearProject o);
 
@@ -30,4 +28,6 @@ public interface AdminOrgAnnualReportService {
 
 	Pagination<OrganizationYearProject> selectListOrgYearProject(OrganizationYearProject o, Integer pNo, Integer pSize);
 
+	boolean checkAnnual(OrganizationAnnualReport o);
+
 }

+ 5 - 5
src/main/java/com/goafanti/customer/service/impl/AdminOrgAnnualReportServiceImpl.java

@@ -48,7 +48,7 @@ public class AdminOrgAnnualReportServiceImpl  extends BaseMybatisDao<Organizatio
 	public int updateOrgAnnual(OrganizationAnnualReport o) {
 		CustomerOrganizationDetailBo bo=userMapper.findOrganizationCustomerDetail(o.getUid());
 		customerService.countIntegrity(bo);
-		return organizationAnnualReportMapper.updateByPrimaryKey(o);
+		return organizationAnnualReportMapper.updateByPrimaryKeySelective(o);
 		
 	}
 
@@ -64,14 +64,14 @@ public class AdminOrgAnnualReportServiceImpl  extends BaseMybatisDao<Organizatio
 		
 	}
 	@Override
-	public boolean checkYear(Integer year) {
-		int i=organizationAnnualReportMapper.checkYear(year);
+	public boolean checkYear(OrganizationAnnualReport o) {
+		int i=organizationAnnualReportMapper.checkYear(o.getUid(),o.getYear());
 		if(i>0)return true;
 		return false;
 	}
 	@Override
 	public boolean checkAnnual(OrganizationAnnualReport o) {
-		int i=organizationAnnualReportMapper.checkAnnual(o.getId(),o.getYear());
+		int i=organizationAnnualReportMapper.checkAnnual(o.getId(),o.getUid(),o.getYear());
 		if(i>0)return true;
 		return false;
 	}
@@ -99,7 +99,7 @@ public class AdminOrgAnnualReportServiceImpl  extends BaseMybatisDao<Organizatio
 	public int updateOrgYearProject(OrganizationYearProject o) {
 		CustomerOrganizationDetailBo bo=userMapper.findOrganizationCustomerDetail(o.getUid());
 		customerService.countIntegrity(bo);
-		return organizationYearProjectMapper.updateByPrimaryKey(o);
+		return organizationYearProjectMapper.updateByPrimaryKeySelective(o);
 	}
 
 	@SuppressWarnings("unchecked")

+ 1 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -365,7 +365,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		//完整资料总数
 		int max=10;
 		int number=0;
-		if(bo.getIndustry()!=null)number+=1;
+		if(null!=bo.getIndustry())number+=1;
 		if(bo.getLocationProvince()!=null)number+=1;
 		if(StringUtils.isNotBlank(bo.getBusinessScope()))number+=1;
 		if(bo.getRegisteredCapital()!=null)number+=1;