Commit 007e7909 authored by 赵啸非's avatar 赵啸非

添加窗口同步修改通知

parent 38cdcf91
...@@ -176,29 +176,29 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -176,29 +176,29 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
} }
/** /* *//**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
*/ *//*
@Override @Override
protected void saveAfter(WindowBusinessEntity entity, Context context) throws AppException { protected void saveAfter(WindowBusinessEntity entity, Context context) throws AppException {
//通知php更新 //通知php更新
pushChangeMsg(entity); pushChangeMsg(entity);
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }*/
/** /* *//**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
*/ *//*
@Override @Override
protected void updateAfter(WindowBusinessEntity entity, Context context) throws AppException { protected void updateAfter(WindowBusinessEntity entity, Context context) throws AppException {
pushChangeMsg(entity); pushChangeMsg(entity);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }*/
private void pushChangeMsg(WindowBusinessEntity entity) { private void pushChangeMsg(WindowBusinessEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090");
......
...@@ -132,7 +132,16 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -132,7 +132,16 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
} }
return windowBusinessEntity; return windowBusinessEntity;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
windowBusinessService.save(windowBusinessEntities, context);
if (!ObjectUtils.isEmpty(windowBusinessEntities)) {
windowBusinessService.save(windowBusinessEntities, context);
WindowBusinessQuery condition = new WindowBusinessQuery();
condition.setWindowId(windowId);
condition.setSiteBusinessIdList(windowBusinessEntities.stream().map(i -> i.getId()).collect(Collectors.toList()));
pushChangeMsg(condition);
}
//批量推送
} }
/** /**
...@@ -272,4 +281,25 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -272,4 +281,25 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
} }
return successMsg.toString(); return successMsg.toString();
} }
private void pushChangeMsg(WindowBusinessQuery entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090");
phpUrl += "/api/window/winNameChange";
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", entity.getWindowId());
paramsMap.put("bussinessid", entity.getSiteBusinessIdList().stream().map(String::valueOf).collect(Collectors.joining(",")));
paramsMap.put("typeinfo", 1);
String resp = null;
try {
Map<String, String> header = new HashMap<>();
header.put(HEADER_CONTENT_TYPE, "application/json");
log.info("\n thirdPartyUrl=>{} \n reqbody=>{} ", phpUrl, JSON.toJSONString(paramsMap));
resp = HttpUtil.doPost(phpUrl, header, JSON.toJSONString(paramsMap, SerializerFeature.WriteMapNullValue));
log.info("thirdPartyUrl =>resp:{}", resp);
} catch (Exception e) {
log.error("异常:", e);
}
}
} }
\ No newline at end of file
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