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

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

@@ -238,6 +238,9 @@
     select 
     <include refid="Base_Column_List" />
     from org_ratepay
-    where uid = #{0} and year = #{1} and deleted_sign = 0
+    where 
+    	uid = #{0} 
+    and year = #{1} 
+    and deleted_sign = 0
   </select>
 </mapper>

+ 16 - 13
src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java

@@ -129,17 +129,6 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 				u.setId(uid);
 				u.setLvl(1);
 				userMapper.updateByPrimaryKeySelective(u);
-				Calendar now = Calendar.getInstance();
-				if (null != o.getLastYearTaxReportUrl()
-						&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1)) {
-					OrgRatepay r = new OrgRatepay();
-					r.setId(UUID.randomUUID().toString());
-					r.setUid(uid);
-					r.setYear(now.get(Calendar.YEAR) - 1);
-					r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
-					r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
-					orgRatepayMapper.insert(r);
-				}
 			}
 			return organizationIdentityMapper.updateByPrimaryKeySelective(o);
 		}
@@ -180,8 +169,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			user.setLvl(UserLevel.GENERAL.getCode());
 			userMapper.updateByPrimaryKeySelective(user);
 			createNotice(user, oi.getAuditStatus());
-		}
-		if (IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())) {
+		} else {
 			/*
 			 * if (UserLevel.GENERAL.getCode().equals(level)) {
 			 * user.setLvl(UserLevel.CERTIFIED.getCode()); }
@@ -190,6 +178,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 			user.setAid(aid);
 			user.setMid(mid);
 			userMapper.updateByPrimaryKeySelective(user);
+			disposeRatePay(oi, oi.getUid());
 			createNotice(user, oi.getAuditStatus());
 		}
 		return organizationIdentityMapper.updateByPrimaryKeySelective(oi);
@@ -356,4 +345,18 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		return bo;
 	}
 
+	private void disposeRatePay(OrganizationIdentity o, String uid) {
+		Calendar now = Calendar.getInstance();
+		if (null != o.getLastYearTaxReportUrl()
+				&& null == orgRatepayMapper.selectRatepayByUidAndYear(uid, now.get(Calendar.YEAR) - 1)) {
+			OrgRatepay r = new OrgRatepay();
+			r.setId(UUID.randomUUID().toString());
+			r.setUid(uid);
+			r.setYear(now.get(Calendar.YEAR) - 1);
+			r.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+			r.setTaxReturnUrl(o.getLastYearTaxReportUrl());
+			orgRatepayMapper.insert(r);
+		}
+	}
+
 }