Commit 89eb6a6a authored by 赵啸非's avatar 赵啸非

添加批量新增窗口业务接口

parent bf460185
...@@ -3,6 +3,7 @@ package com.mortals.xhx.common.utils; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.common.utils;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.xhx.module.site.service.SiteService; import com.mortals.xhx.module.site.service.SiteService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.apachecommons.CommonsLog;
/** /**
* @author: zxfei * @author: zxfei
...@@ -10,6 +11,7 @@ import lombok.AllArgsConstructor; ...@@ -10,6 +11,7 @@ import lombok.AllArgsConstructor;
* @description: * @description:
**/ **/
@AllArgsConstructor @AllArgsConstructor
@CommonsLog
public class SyncTreeSiteThread implements Runnable { public class SyncTreeSiteThread implements Runnable {
private SiteService siteService; private SiteService siteService;
...@@ -18,6 +20,7 @@ public class SyncTreeSiteThread implements Runnable { ...@@ -18,6 +20,7 @@ public class SyncTreeSiteThread implements Runnable {
@Override @Override
public void run() { public void run() {
log.info("刷新站点树");
siteService.setSiteTree(siteService.siteTree(context), context); siteService.setSiteTree(siteService.siteTree(context), context);
} }
......
...@@ -66,7 +66,7 @@ public class BusinessController extends BasePhpCRUDJsonMappingController<Busines ...@@ -66,7 +66,7 @@ public class BusinessController extends BasePhpCRUDJsonMappingController<Busines
@PostMapping(value = "addBusinessToSite") @PostMapping(value = "addBusinessToSite")
public String addBusinessToSite(@RequestBody Map<String, Object> map) { public String addBusinessToSite(@RequestBody Map<String, Object> map) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<String, Object>(); Map<String, Object> model = new HashMap<>();
String businessIds=(String)map.get("businessIds"); String businessIds=(String)map.get("businessIds");
Long siteId= DataUtil.converObj2Long(map.get("siteId")); Long siteId= DataUtil.converObj2Long(map.get("siteId"));
try { try {
......
...@@ -153,6 +153,13 @@ public class SiteServiceImpl extends AbstractCRUDServiceImpl<SiteDao, SiteEntity ...@@ -153,6 +153,13 @@ public class SiteServiceImpl extends AbstractCRUDServiceImpl<SiteDao, SiteEntity
} }
@Override
protected void updateAfter(SiteEntity entity, Context context) throws AppException {
//刷新站点树
new Thread(new SyncTreeSiteThread(this,context)).start();
super.updateAfter(entity, context);
}
@Override @Override
protected void saveAfter(SiteEntity entity, Context context) throws AppException { protected void saveAfter(SiteEntity entity, Context context) throws AppException {
//刷新站点树 //刷新站点树
......
...@@ -49,7 +49,7 @@ public class WindowController extends BasePhpCRUDJsonMappingController<WindowSer ...@@ -49,7 +49,7 @@ public class WindowController extends BasePhpCRUDJsonMappingController<WindowSer
@PostMapping(value = "addBusinessToWindow") @PostMapping(value = "addBusinessToWindow")
public String addBusinessToSite(@RequestBody Map<String, Object> map) { public String addBusinessToSite(@RequestBody Map<String, Object> map) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<String, Object>(); Map<String, Object> model = new HashMap<>();
String businessIds=(String)map.get("businessIds"); String businessIds=(String)map.get("businessIds");
Long windowId= DataUtil.converObj2Long(map.get("windowId")); Long windowId= DataUtil.converObj2Long(map.get("windowId"));
try { try {
......
This diff is collapsed.
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