anderx 1 год назад
Родитель
Сommit
dc0aad7db3

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -244,4 +244,6 @@ public interface UserMapper {
                                       @Param("endTime")String endTime);
 
     List<AdminUserCount>selectListByaidAndDate(String  aid);
+
+    List<CustomerSimpleBo> getRestrictCustomerByName(@Param("name") String name, @Param("aid") String aid);
 }

+ 7 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2363,4 +2363,11 @@ inner join(
 		from user a where status =0 and source in(1,2,3) and aid= #{aid}
 		)x group by aid,dateTime
 	</select>
+	<select id="getRestrictCustomerByName" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
+		select distinct b.id,b.nickname
+		from restrict_project a left join user b on a.uid =b.id
+		where a.`type` in (1,2)
+		  and a.aid = #{aid}
+		  and b.nickname like concat('%',#{name},'%')
+	</select>
 </mapper>

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

@@ -280,6 +280,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		if(type == 0) res.setData(customerService.getPrivateCustomerByName(name));
 		if(type == 1) res.setData(customerService.getSignedCustomerByName(name));
 		if(type == 2) res.setData(customerService.getChannelCustomerByName(name));
+		if(type == 3) res.setData(customerService.getRestrictCustomerByName(name));
 		return res;
 	}
 

+ 2 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -584,9 +584,10 @@ public interface CustomerService {
 	 */
 	void updateAdminUserCount(String aid,Date transferTime);
 
-	void updateAdminUserCountByAid(String aid);
 
 	AdminUserCount getAdminUserCount(String aid, String startTime);
 
     Object importExcel(MultipartFile file);
+
+	Object getRestrictCustomerByName(String name);
 }

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

@@ -494,28 +494,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		}
 	}
 
-	@Override
-	public void updateAdminUserCountByAid(String aid) {
-		List<AdminUserCount> list = userMapper.selectListByaidAndDate(aid);
-			for (AdminUserCount e : list) {
-				String startTime=DateUtils.formatDate(e.getDateTime(),AFTConstants.YYYYMMDD);
-				AdminUserCount selectAUC = getAdminUserCount(aid, startTime);
 
-				if (selectAUC==null){
-					adminUserCountMapper.insertSelective(e);
-				}else {
-					AdminUserCount newAUC=new AdminUserCount();
-					newAUC.setId(selectAUC.getId());
-					if (e.getPrivateCount()==null)selectAUC.setPrivateCount(0);
-					if (e.getChannelCount()==null)selectAUC.setChannelCount(0);
-					if (e.getSignCount()==null)selectAUC.setSignCount(0);
-					newAUC.setPrivateCount(e.getPrivateCount());
-					newAUC.setChannelCount(e.getChannelCount());
-					newAUC.setSignCount(e.getSignCount());
-					adminUserCountMapper.updateByPrimaryKeySelective(newAUC);
-				}
-			}
-	}
 
 	/**
 	 * 用于处理异常多产生数据,删除多余数据修改原本数据
@@ -3127,6 +3106,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return pushUserName(list);
 	}
 
+	@Override
+	public List<CustomerSimpleBo> getRestrictCustomerByName(String name) {
+		return userMapper.getRestrictCustomerByName(name,TokenManager.getAdminId());
+	}
+
 	private Object pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();