zoujiajian 2 tahun lalu
induk
melakukan
53043487f3

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/views/CorpCustomerAcquisitionLinkExtraCustomerView.java

@@ -29,7 +29,7 @@ public class CorpCustomerAcquisitionLinkExtraCustomerView {
 	private String linkName;
 
 	@DbField("cc.service_id")
-	private Integer serviceId;
+	private Long serviceId;
 
 	@DbField("cc.duty_date")
 	private String dutyDate;

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/views/SysCorpFollowView.java

@@ -54,6 +54,12 @@ public class SysCorpFollowView {
 	@DbIgnore
 	List<SysCorpFollowRelateView> subList;
 
+	public String getShowName() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(name).append("(").append(followName).append(")");
+		return sb.toString();
+	}
+
 
 	@Getter
 	@Setter

+ 7 - 7
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowDynamicConfigServiceImpl.java

@@ -10,8 +10,8 @@ import com.cyksj.mapper.corp.CorpTagMapper;
 import com.cyksj.model.dto.CorpFollowActiveCodeDto;
 import com.cyksj.model.entity.CorpFollowConfig;
 import com.cyksj.model.entity.CorpTag;
-import com.cyksj.model.entity.SysCorpFollowRelate;
 import com.cyksj.model.request.corp.CorpFollowContact;
+import com.cyksj.model.views.SysCorpFollowView;
 import com.cyksj.service.corp.CorpFollowDynamicConfigService;
 import com.cyksj.service.corp.WxCorpOps;
 import com.ejlchina.searcher.BeanSearcher;
@@ -63,7 +63,7 @@ public class CorpFollowDynamicConfigServiceImpl implements CorpFollowDynamicConf
 	@Override
 	public String createCorpFollowActiveCode(List<String> followIds, List<Integer> userIndxList, String state, Boolean isDuty) throws Exception {
 		List<CorpFollowActiveCodeDto> codeList = new ArrayList<>();
-		List<SysCorpFollowRelate> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowRelate.class, MapUtils.builder().build());
+		List<SysCorpFollowView> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowView.class, MapUtils.builder().build());
 		Integer type = 1;
 		if (!isDuty) {
 			//不是值班 多人生成一个二维码
@@ -73,7 +73,7 @@ public class CorpFollowDynamicConfigServiceImpl implements CorpFollowDynamicConf
 			}
 			String serviceNames = null;
 			if (corpFollowServiceDtos != null) {
-				serviceNames = corpFollowServiceDtos.stream().filter(cs -> followIds.contains(cs.getFollowId())).map(SysCorpFollowRelate::getName).collect(Collectors.joining(","));
+				serviceNames = corpFollowServiceDtos.stream().filter(cs -> followIds.contains(cs.getFollowId())).map(SysCorpFollowView::getShowName).collect(Collectors.joining(","));
 			}
 			if (StrUtil.isEmpty(serviceNames)) {
 				throw BusinessRuntimeException.getInstance("存在被删除的客服,请刷新页面重试");
@@ -81,16 +81,16 @@ public class CorpFollowDynamicConfigServiceImpl implements CorpFollowDynamicConf
 			CorpFollowActiveCodeDto corpFollowActiveCodeDto = createCorpFollowActiveCode(followIds, userIndxList, state, type, serviceNames);
 			codeList.add(corpFollowActiveCodeDto);
 		} else {
-			Map<String, List<SysCorpFollowRelate>> csMap = null;
+			Map<String, List<SysCorpFollowView>> csMap = null;
 			if (corpFollowServiceDtos != null) {
-				csMap = corpFollowServiceDtos.stream().filter(cs -> followIds.contains(cs.getFollowId())).collect(Collectors.groupingBy(SysCorpFollowRelate::getFollowId));
+				csMap = corpFollowServiceDtos.stream().filter(cs -> followIds.contains(cs.getFollowId())).collect(Collectors.groupingBy(SysCorpFollowView::getFollowId));
 			}
 			if (csMap == null || csMap.keySet().size() != followIds.size()) {
 				throw BusinessRuntimeException.getInstance("存在被删除的客服,请刷新页面重试");
 			}
 			for (String followId : followIds) {
-				SysCorpFollowRelate corpFollowServiceDto = csMap.get(followId).get(0);
-				CorpFollowActiveCodeDto corpFollowActiveCodeDto = createCorpFollowActiveCode(List.of(followId), List.of(Integer.parseInt(corpFollowServiceDto.getId().toString())), state, type, corpFollowServiceDto.getName());
+				SysCorpFollowView corpFollowServiceDto = csMap.get(followId).get(0);
+				CorpFollowActiveCodeDto corpFollowActiveCodeDto = createCorpFollowActiveCode(List.of(followId), List.of(Integer.parseInt(corpFollowServiceDto.getSid().toString())), state, type, corpFollowServiceDto.getName());
 				codeList.add(corpFollowActiveCodeDto);
 			}
 		}

+ 3 - 6
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CmsCorpFollowActiveCodeController.java

@@ -13,10 +13,7 @@ import com.cyksj.mapper.manage.coupon.CouponMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.corp.Attachments;
 import com.cyksj.model.request.corp.CorpFollowContact;
-import com.cyksj.model.views.CorpActiveCodeGoodsOrderView;
-import com.cyksj.model.views.CorpActiveCodeOrderView;
-import com.cyksj.model.views.CorpActiveCodeUserDayDataView;
-import com.cyksj.model.views.CorpFollowActiveCodeView;
+import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.corp.CorpFollowDynamicConfigService;
 import com.cyksj.service.corp.CorpFollowService;
@@ -93,8 +90,8 @@ public class CmsCorpFollowActiveCodeController {
 	 * 可选客服配置
 	 */
 	@GetMapping("/get/available/follow")
-	public Result<List<SysCorpFollowRelate>> getAvailableFollow() {
-		List<SysCorpFollowRelate> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowRelate.class, MapUtils.builder().build());
+	public Result<List<SysCorpFollowView>> getAvailableFollow() {
+		List<SysCorpFollowView> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowView.class, MapUtils.builder().build());
 		return GatewayResponse.SUCCESS.newBuilder().toResult(corpFollowServiceDtos);
 	}
 

+ 8 - 7
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpCustomerAcquistionLinkController.java

@@ -12,6 +12,7 @@ import com.cyksj.mapper.corp.CorpTagMapper;
 import com.cyksj.mapper.corp.CorpWelcomeTemplateMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.views.CorpCustomerAcquisitionLinkExtraCustomerView;
+import com.cyksj.model.views.SysCorpFollowView;
 import com.cyksj.service.corp.CorpCustomerAcquisitionLinkService;
 import com.cyksj.service.sys.SysConfigService;
 import com.ejlchina.searcher.BeanSearcher;
@@ -90,27 +91,27 @@ public class CorpCustomerAcquistionLinkController {
     public Result<SearchResult<CorpCustomerAcquisitionLink>> get() throws Exception {
         SearchResult<CorpCustomerAcquisitionLink> search = beanSearcher.search(CorpCustomerAcquisitionLink.class, MapUtils.flatBuilder(request.getParameterMap()).build());
 
-        List<SysCorpFollowRelate> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowRelate.class, MapUtils.builder().build());
+        List<SysCorpFollowView> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowView.class, MapUtils.builder().build());
 
         search.getDataList().forEach(e -> {
             try {
                 List<String> userStrList = corpFollowServiceDtos.stream().filter(cf -> {
                     try {
-                        return Jsons.parseList(e.getUserList(), Long.class).contains(cf.getId());
+                        return Jsons.parseList(e.getUserList(), Long.class).contains(cf.getSid());
                     } catch (Exception ex) {
                     }
                     return false;
-                }).map(SysCorpFollowRelate::getName).collect(Collectors.toList());
+                }).map(SysCorpFollowView::getShowName).collect(Collectors.toList());
                 e.setUserStrList(userStrList);
 
                 if (StrUtil.isNotEmpty(e.getChooseDutyUsers())) {
                     List<String> dutyUserList = corpFollowServiceDtos.stream().filter(cf -> {
                         try {
-                            return Jsons.parseList(e.getChooseDutyUsers(), Long.class).contains(cf.getId());
+                            return Jsons.parseList(e.getChooseDutyUsers(), Long.class).contains(cf.getSid());
                         } catch (Exception ex) {
                         }
                         return false;
-                    }).map(SysCorpFollowRelate::getName).collect(Collectors.toList());
+                    }).map(SysCorpFollowView::getShowName).collect(Collectors.toList());
 
                     e.setChooseDutyUserList(dutyUserList);
                 }
@@ -183,8 +184,8 @@ public class CorpCustomerAcquistionLinkController {
                 .orderBy(CorpCustomerAcquisitionLinkExtraCustomerView::getAcId).asc()
                 .orderBy(CorpCustomerAcquisitionLinkExtraCustomerView::getCreatedTime).desc()
                 .build());
-        List<SysCorpFollowRelate> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowRelate.class, MapUtils.builder().build());
-        Map<Long, List<SysCorpFollowRelate>> serviceMap = corpFollowServiceDtos.stream().collect(Collectors.groupingBy(SysCorpFollowRelate::getId));
+        List<SysCorpFollowView> corpFollowServiceDtos = beanSearcher.searchAll(SysCorpFollowView.class, MapUtils.builder().build());
+        Map<Long, List<SysCorpFollowView>> serviceMap = corpFollowServiceDtos.stream().collect(Collectors.groupingBy(SysCorpFollowView::getSid));
         search.getDataList().forEach(e->{
             Optional.ofNullable(serviceMap.get(e.getServiceId()))
                     .ifPresent(service -> e.setServiceName(service.get(0).getName()));