|
@@ -379,39 +379,51 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
cmBehaviorRecordPo.setRegion(region);
|
|
cmBehaviorRecordPo.setRegion(region);
|
|
- // if (flag) {
|
|
|
|
- recordMapper.insertRecord(cmBehaviorRecordPo);
|
|
|
|
-
|
|
|
|
- int recordId = cmBehaviorRecordPo.getRecordID();
|
|
|
|
- if (cmBehaviorRecordPo.getShopId() != null) {
|
|
|
|
- if (14 != cmBehaviorRecordPo.getPageType()) {
|
|
|
|
- if (StringUtils.isNotBlank(cmBehaviorRecordPo.getPageLabel())) {
|
|
|
|
- List<String> strList = new ArrayList<>();
|
|
|
|
- // 页面标签在含有多个,包含 , 是可分割,进行分割作为关键词
|
|
|
|
- if (cmBehaviorRecordPo.getPageLabel().contains(",")) {
|
|
|
|
- String[] split = cmBehaviorRecordPo.getPageLabel().split(",");
|
|
|
|
- for (String s : split) {
|
|
|
|
- strList.add(s);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- strList.add(cmBehaviorRecordPo.getPageLabel());
|
|
|
|
- }
|
|
|
|
- // 供应商id
|
|
|
|
- List<Integer> shopIds = recordMapper.shopIds(strList);
|
|
|
|
- if (shopIds.size() > 0) {
|
|
|
|
- for (Integer shopId : shopIds) {
|
|
|
|
- recordMapper.insertShopId(recordId, shopId);
|
|
|
|
- }
|
|
|
|
|
|
+ recordMapper.insertRecord(cmBehaviorRecordPo);
|
|
|
|
+ // 内容库 行为记录
|
|
|
|
+ if ("8".equals(cmBehaviorRecordPo.getAccessSource())) {
|
|
|
|
+ // 查询机构信息
|
|
|
|
+ CmClubPo club = recordMapper.getClubByUserId(Integer.parseInt(cmBehaviorRecordPo.getUserId()));
|
|
|
|
+ if ( null == club ) {
|
|
|
|
+ CmBehaviorInfo cmBehaviorInfo = new CmBehaviorInfo();
|
|
|
|
+ cmBehaviorInfo.setClubId(null == club.getClubId() ? 0 : club.getClubId());
|
|
|
|
+ cmBehaviorInfo.setSpId(null == club.getSpId() ? 0 : club.getSpId());
|
|
|
|
+ cmBehaviorInfo.setOperateObject(1);
|
|
|
|
+ cmBehaviorInfo.setType(8);
|
|
|
|
+ cmBehaviorInfo.setLabel(StringUtils.isNotBlank(cmBehaviorRecordPo.getPageLabel()) ? cmBehaviorRecordPo.getPageLabel() : "");
|
|
|
|
+ recordMapper.insertBehaviorInfo(cmBehaviorInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 处理关联供应商
|
|
|
|
+ int recordId = cmBehaviorRecordPo.getRecordID();
|
|
|
|
+ if (cmBehaviorRecordPo.getShopId() != null) {
|
|
|
|
+ if (14 != cmBehaviorRecordPo.getPageType()) {
|
|
|
|
+ if (StringUtils.isNotBlank(cmBehaviorRecordPo.getPageLabel())) {
|
|
|
|
+ List<String> strList = new ArrayList<>();
|
|
|
|
+ // 页面标签在含有多个,包含 , 是可分割,进行分割作为关键词
|
|
|
|
+ if (cmBehaviorRecordPo.getPageLabel().contains(",")) {
|
|
|
|
+ String[] split = cmBehaviorRecordPo.getPageLabel().split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ strList.add(s);
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ strList.add(cmBehaviorRecordPo.getPageLabel());
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- Integer id = recordMapper.selShopId(cmBehaviorRecordPo.getShopId());
|
|
|
|
- if (id != null) {
|
|
|
|
- recordMapper.insertShopId(recordId, cmBehaviorRecordPo.getShopId());
|
|
|
|
|
|
+ // 供应商id
|
|
|
|
+ List<Integer> shopIds = recordMapper.shopIds(strList);
|
|
|
|
+ if (shopIds.size() > 0) {
|
|
|
|
+ for (Integer shopId : shopIds) {
|
|
|
|
+ recordMapper.insertShopId(recordId, shopId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ Integer id = recordMapper.selShopId(cmBehaviorRecordPo.getShopId());
|
|
|
|
+ if (id != null) {
|
|
|
|
+ recordMapper.insertShopId(recordId, cmBehaviorRecordPo.getShopId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- //}
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|