|
@@ -1,11 +1,17 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.process.PushProcess;
|
|
|
+import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.vo.PushVO;
|
|
|
+import com.diagbot.vo.StandConvert;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
/**
|
|
|
* @Description: 推送facade
|
|
|
* @author: zhoutg
|
|
@@ -16,13 +22,39 @@ public class PushFacade {
|
|
|
|
|
|
@Autowired
|
|
|
PushProcess pushProcess;
|
|
|
+ @Autowired
|
|
|
+ CommonFacade commonFacade;
|
|
|
+ @Autowired
|
|
|
+ NeoFacade neoFacade;
|
|
|
/**
|
|
|
* 推送业务
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
public PushDTO pushFac(PushVO pushVo) {
|
|
|
- PushDTO process = pushProcess.process(pushVo);
|
|
|
+ Map<String, Object> debug = new LinkedHashMap<>();
|
|
|
+ WordCrfDTO wordCrfDTO = new WordCrfDTO();
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
+
|
|
|
+ // 模型处理数据
|
|
|
+ long crfStart = System.currentTimeMillis();
|
|
|
+ wordCrfDTO = commonFacade.crf_process(pushVo);
|
|
|
+ CoreUtil.getDebugStr(crfStart, "模型处理耗时", debug);
|
|
|
+
|
|
|
+ // 标准词转换
|
|
|
+ long standStart = System.currentTimeMillis();
|
|
|
+ StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
|
|
|
+ Map<String, Map<String, String>> standConvertMap = neoFacade.standConvertCrf(standConvert);
|
|
|
+ commonFacade.dataTypeSet(wordCrfDTO, standConvertMap);
|
|
|
+ CoreUtil.getDebugStr(standStart, "标准词转换耗时", debug);
|
|
|
+
|
|
|
+ // 推送
|
|
|
+ long pushStart = System.currentTimeMillis();
|
|
|
+ PushDTO process = pushProcess.process(pushVo,standConvertMap,wordCrfDTO);
|
|
|
+ CoreUtil.getDebugStr(pushStart, "推送耗时", debug);
|
|
|
+ process.setDebug(debug);
|
|
|
+
|
|
|
+ CoreUtil.getDebugStr(l1, "本次调用总计耗时", debug);
|
|
|
return process;
|
|
|
}
|
|
|
|