Commit 8f16b596 by 阳浪

登录添加埋点

parent 19d686ae
...@@ -20,20 +20,19 @@ import java.util.List; ...@@ -20,20 +20,19 @@ import java.util.List;
* @create 2025-01-14 10:57:55 * @create 2025-01-14 10:57:55
*/ */
@RestController @RestController
@RequestMapping("/api/eventTrack")
public class EventTrackController { public class EventTrackController {
@Autowired @Autowired
private EventTrackService eventTrackService; private EventTrackService eventTrackService;
@GetMapping("/addEvent") @GetMapping("/api/eventTrack/addEvent")
public void addEvent(@RequestParam("type") String type, @RequestParam("businessId") Long businessId){ public void addEvent(@RequestParam("type") String type, @RequestParam("businessId") Long businessId){
eventTrackService.addEvent(type,businessId); eventTrackService.addEvent(type,businessId);
} }
@GetMapping("/getTodayNum") @GetMapping("/api/eventTrack/getTodayNum")
public EventTrackDayNumVo getTodayNum(@RequestParam(value = "date",required = false) String date){ public EventTrackDayNumVo getTodayNum(@RequestParam(value = "date",required = false) String date){
return eventTrackService.getTodayNum(date); return eventTrackService.getTodayNum(date);
} }
......
...@@ -67,17 +67,14 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -67,17 +67,14 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
eventTrack.setDeptName(authzUserGroupVo.getName()); eventTrack.setDeptName(authzUserGroupVo.getName());
} }
String key = "event_track_type"; String key = "event_track_type";
Response<List<Dictionary>> response = dictionaryFeignClients.listChildDictionary(key,false,1); List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1);
if(response!=null&&response.getData()!=null){ if(CollUtil.isNotEmpty(dictionaryList)){
List<Dictionary> dictionaryList = (List<Dictionary>)response.getData();
if(CollUtil.isNotEmpty(dictionaryList)){
Optional<Dictionary> optional = dictionaryList.stream().filter(d-> Objects.equals(d.getCode(),key+"_"+type)).findFirst(); Optional<Dictionary> optional = dictionaryList.stream().filter(d-> Objects.equals(d.getCode(),key+"_"+type)).findFirst();
if(optional!=null&&optional.isPresent()){ if(optional!=null&&optional.isPresent()){
Dictionary dictionary = optional.get(); Dictionary dictionary = optional.get();
eventTrack.setSubType(dictionary.getCnName()); eventTrack.setSubType(dictionary.getCnName());
eventTrack.setType(Integer.valueOf(dictionary.getDescription())); eventTrack.setType(Integer.valueOf(dictionary.getDescription()));
} }
}
} }
eventTrack.setId(idGenerator.generate()); eventTrack.setId(idGenerator.generate());
this.insert(eventTrack); this.insert(eventTrack);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment