|
@@ -1,5 +1,6 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.diagbot.biz.push.entity.Item;
|
|
|
import com.diagbot.client.PushNewServiceClient;
|
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
@@ -7,7 +8,6 @@ import com.diagbot.dto.PushNewDTO;
|
|
|
import com.diagbot.dto.PushPlanDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.enums.DiagnoseTypeEnum;
|
|
|
-import com.diagbot.enums.DiseasePushTypeEnum;
|
|
|
import com.diagbot.enums.RedisEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -66,19 +66,36 @@ public class PushFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public PushDTO pushFac(PushVO pushVO) {
|
|
|
- String pushVersion = redisUtil.getByKeyAndField(RedisEnum.pushVersion.getName(),
|
|
|
+ // 获取pushMode
|
|
|
+ Integer pushModel = redisUtil.getByKeyAndField(RedisEnum.pushModel.getName(),
|
|
|
RedisEnum.hospitalId_.getName() + pushVO.getHospitalId());
|
|
|
- if (StringUtil.isNotBlank(pushVersion) && "old".equals(pushVersion)) {
|
|
|
- // 使用5.0推送
|
|
|
- return processAggreate(pushVO);
|
|
|
- } else {
|
|
|
- // 使用新版推送
|
|
|
- return pushNewFac(pushVO);
|
|
|
+ switch (pushModel) {
|
|
|
+ case 0: // 使用新版推送
|
|
|
+ return pushNewFac(pushVO, "0");
|
|
|
+ case 1: // 使用5.0推送
|
|
|
+ return processAggreate(pushVO);
|
|
|
+ case 2: // 走科室对应的模型,如果找不到,使用5.0推理
|
|
|
+ List<Item> deptList = pushVO.getDept();
|
|
|
+ String modelType = "0";
|
|
|
+ if (ListUtil.isNotEmpty(deptList)) {
|
|
|
+ if (StringUtil.isNotBlank(deptList.get(0).getUniqueName())) {
|
|
|
+ modelType = redisUtil.getByKeyAndField(RedisEnum.deptPush.getName(),
|
|
|
+ deptList.get(0).getUniqueName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (modelType == null || "0".equals(modelType)) {
|
|
|
+ return processAggreate(pushVO);
|
|
|
+ } else {
|
|
|
+ return pushNewFac(pushVO, modelType);
|
|
|
+ }
|
|
|
+ default: // 默认使用新版推送
|
|
|
+ return pushNewFac(pushVO, "0");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 5.0 推送总入口
|
|
|
+ *
|
|
|
* @param pushVo
|
|
|
* @return
|
|
|
*/
|
|
@@ -88,7 +105,8 @@ public class PushFacade {
|
|
|
pushVo.setAgeNum(CoreUtil.convertAge(pushVo.getAge()));
|
|
|
}
|
|
|
PushDTO pushDTO = new PushDTO();
|
|
|
- Integer pushMode = tranHospitalInfoFacade.getPushMode(pushVo.getHospitalId());
|
|
|
+ pushDTO = this.pushFacIcss(pushVo);
|
|
|
+ /*Integer pushMode = tranHospitalInfoFacade.getPushMode(pushVo.getHospitalId());
|
|
|
//全科推送,走5.0
|
|
|
if (pushMode.equals(DiseasePushTypeEnum.gp.getKey())) {
|
|
|
pushDTO = this.pushFacIcss(pushVo);
|
|
@@ -97,7 +115,7 @@ public class PushFacade {
|
|
|
//pushDTO = this.pushFac(pushVo);
|
|
|
// 2021/2/22 同老楼确认专科也走5.0
|
|
|
pushDTO = this.pushFacIcss(pushVo);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
return pushDTO;
|
|
|
}
|
|
@@ -123,7 +141,7 @@ public class PushFacade {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- public PushDTO pushNewFac(PushVO pushVo) {
|
|
|
+ public PushDTO pushNewFac(PushVO pushVo, String modelType) {
|
|
|
PushDTO pushDTO = new PushDTO();
|
|
|
Map<String, Object> debug = new LinkedHashMap<>();
|
|
|
debug.put("大数据推送地址", pushUrl);
|
|
@@ -149,7 +167,7 @@ public class PushFacade {
|
|
|
try {
|
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
|
invokeParams.put("wordCrfDTO", wordCrfDTO);
|
|
|
- invokeParams.put("pushNewVO", generatePushVo(wordCrfDTO));
|
|
|
+ invokeParams.put("pushNewVO", generatePushVo(wordCrfDTO, modelType));
|
|
|
pushDTO = DataFacade.get("pushAll", invokeParams, PushDTO.class);
|
|
|
} catch (Exception e) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "推送服务出错" + e.getMessage());
|
|
@@ -190,6 +208,7 @@ public class PushFacade {
|
|
|
|
|
|
/**
|
|
|
* 诊断去重、合并处理
|
|
|
+ *
|
|
|
* @param pushDTO
|
|
|
*/
|
|
|
public void dealDisease(PushDTO pushDTO, WordCrfDTO wordCrfDTO, int length, boolean hasDiseaseFlag) {
|
|
@@ -257,17 +276,17 @@ public class PushFacade {
|
|
|
* 生成新版推送入参
|
|
|
*
|
|
|
* @param wordCrfDTO
|
|
|
+ * @param modelType 模型类型
|
|
|
* @return
|
|
|
*/
|
|
|
- public PushNewVO generatePushVo(WordCrfDTO wordCrfDTO) {
|
|
|
+ public PushNewVO generatePushVo(WordCrfDTO wordCrfDTO, String modelType) {
|
|
|
PushNewVO pushNewVO = new PushNewVO();
|
|
|
pushNewVO.setChief(wordCrfDTO.getChief());
|
|
|
pushNewVO.setPresent(wordCrfDTO.getSymptom());
|
|
|
pushNewVO.setAge(wordCrfDTO.getAgeNum());
|
|
|
pushNewVO.setSex(wordCrfDTO.getSex());
|
|
|
- String pushType = redisUtil.getByKeyAndField(RedisEnum.hospitalPushType.getName(), String.valueOf(wordCrfDTO.getHospitalId()));
|
|
|
- if (StringUtil.isNotBlank(pushType)) {
|
|
|
- pushNewVO.setHospitalType(pushType);
|
|
|
+ if (StringUtil.isNotBlank(modelType)) {
|
|
|
+ pushNewVO.setHospitalType(modelType);
|
|
|
}
|
|
|
return pushNewVO;
|
|
|
}
|