Commit 15aa9ec5 authored by “yiyousong”'s avatar “yiyousong”
parents 0a0ab876 004353a9
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>true</skipUi>
<profiles.holidayUrl>https://timor.tech/api/holiday/year/</profiles.holidayUrl> <profiles.holidayUrl>https://timor.tech/api/holiday/year/</profiles.holidayUrl>
</properties> </properties>
</profile> </profile>
......
...@@ -40,6 +40,8 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -40,6 +40,8 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
@Override @Override
protected void findAfter(SiteMatterEntity params, PageInfo pageInfo, Context context, List<SiteMatterEntity> list) throws AppException { protected void findAfter(SiteMatterEntity params, PageInfo pageInfo, Context context, List<SiteMatterEntity> list) throws AppException {
if (!ObjectUtils.isEmpty(list)) {
List<Long> matterIdlist = list.stream().map(item -> item.getMatterId()).collect(Collectors.toList()); List<Long> matterIdlist = list.stream().map(item -> item.getMatterId()).collect(Collectors.toList());
Map<Long, MatterEntity> matterEntityMap = matterService.find(new MatterQuery().idList(matterIdlist)).parallelStream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n)); Map<Long, MatterEntity> matterEntityMap = matterService.find(new MatterQuery().idList(matterIdlist)).parallelStream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list.forEach(item -> { list.forEach(item -> {
...@@ -54,6 +56,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -54,6 +56,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
} }
} }
}); });
}
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
} }
......
...@@ -168,37 +168,37 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -168,37 +168,37 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
*/ */
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
Arrays.asList(ids).forEach(id -> { /* Arrays.asList(ids).forEach(id -> {
WindowBusinessEntity windowBusinessEntity = this.get(id, context); WindowBusinessEntity windowBusinessEntity = this.get(id, context);
pushChangeMsg(windowBusinessEntity); pushChangeMsg(windowBusinessEntity);
}); });*/
super.removeBefore(ids, context); super.removeBefore(ids, context);
} }
/** /* *//**
* @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");
......
...@@ -10,6 +10,7 @@ import com.mortals.framework.model.PageInfo; ...@@ -10,6 +10,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.HttpUtil; import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.business.model.BusinessEntity; import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessQuery; import com.mortals.xhx.module.business.model.BusinessQuery;
...@@ -132,7 +133,24 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -132,7 +133,24 @@ 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());
if (!ObjectUtils.isEmpty(windowBusinessEntities)) {
windowBusinessService.save(windowBusinessEntities, context); windowBusinessService.save(windowBusinessEntities, context);
WindowBusinessQuery condition = new WindowBusinessQuery();
condition.setWindowId(windowId);
condition.setSiteBusinessIdList(windowBusinessEntities.stream().map(i -> i.getSiteBusinessId()).collect(Collectors.toList()));
Runnable runnable = new Runnable() {
@Override
public void run() {
pushChangeMsg(condition);
}
};
ThreadPool.getInstance().execute(runnable);
}
//批量推送
} }
/** /**
...@@ -220,25 +238,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -220,25 +238,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
pushChangeMsg(entity.getId()); pushChangeMsg(entity.getId());
} }
private void pushChangeMsg(Long windowId) {
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", windowId);
paramsMap.put("typeinfo", 1);
phpUrl += "/api/window/winNameChange";
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);
}
}
/** /**
...@@ -272,4 +271,46 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -272,4 +271,46 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
} }
return successMsg.toString(); return successMsg.toString();
} }
private void pushChangeMsg(Long windowId) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/api/window/winNameChange";
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("windowid", windowId);
paramsMap.put("typeinfo", 1);
phpUrl += "/api/window/winNameChange";
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);
}
}
private void pushChangeMsg(WindowBusinessQuery entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
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", 2);
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
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</plugin> </plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor"> <plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" /> <property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" /> <property name="showSql" value="true" />
</plugin> </plugin>
</plugins> </plugins>
</configuration> </configuration>
\ No newline at end of file
...@@ -20,9 +20,12 @@ POST {{baseUrl}}/matter/list ...@@ -20,9 +20,12 @@ POST {{baseUrl}}/matter/list
Content-Type: application/json Content-Type: application/json
{ {
"siteId": 22, "siteId": 1,
"matterName": "%%",
"page": 1, "page": 1,
"size": 2 "size": 10,
"deptCode":"zyl",
"source": ""
} }
###微官网事项列表 ###微官网事项列表
......
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