Commit 7923bd7e authored by 赵啸非's avatar 赵啸非

添加删除站点后通知门户服务更新

No related merge requests found
...@@ -12,6 +12,7 @@ import com.mortals.framework.util.DataUtil; ...@@ -12,6 +12,7 @@ import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.key.Constant; import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.SyncTreeSiteThread; import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery; import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
...@@ -55,6 +56,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -55,6 +56,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
private AreaService areaService; private AreaService areaService;
@Autowired @Autowired
private ModelService modelService; private ModelService modelService;
@Autowired
private IUserFeign userFeign;
@Override @Override
protected void validData(SiteEntity entity, Context context) throws AppException { protected void validData(SiteEntity entity, Context context) throws AppException {
...@@ -182,6 +185,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -182,6 +185,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected void saveAfter(SiteEntity entity, Context context) throws AppException { protected void saveAfter(SiteEntity entity, Context context) throws AppException {
//刷新站点树 //刷新站点树
new Thread(new SyncTreeSiteThread(this, context)).start(); new Thread(new SyncTreeSiteThread(this, context)).start();
userFeign.synchSiteAuth();
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
...@@ -189,6 +194,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -189,6 +194,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override @Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
new Thread(new SyncTreeSiteThread(this, context)).start(); new Thread(new SyncTreeSiteThread(this, context)).start();
userFeign.synchSiteAuth();
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
......
...@@ -15,6 +15,7 @@ import java.util.List; ...@@ -15,6 +15,7 @@ import java.util.List;
/** /**
* 用户信息业务 Feign接口 * 用户信息业务 Feign接口
*
* @author zxfei * @author zxfei
* @date 2022-07-06 * @date 2022-07-06
*/ */
...@@ -48,7 +49,7 @@ public interface IUserFeign extends IFeign { ...@@ -48,7 +49,7 @@ public interface IUserFeign extends IFeign {
* @return * @return
*/ */
@GetMapping(value = "/user/delete") @GetMapping(value = "/user/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization); Rest<Void> delete(Long[] ids, @RequestHeader("Authorization") String authorization);
/** /**
...@@ -58,7 +59,7 @@ public interface IUserFeign extends IFeign { ...@@ -58,7 +59,7 @@ public interface IUserFeign extends IFeign {
* @return * @return
*/ */
@PostMapping(value = "/user/save") @PostMapping(value = "/user/save")
Rest<RespData<UserPdu>> save(@RequestBody UserPdu userPdu,@RequestHeader("Authorization") String authorization); Rest<RespData<UserPdu>> save(@RequestBody UserPdu userPdu, @RequestHeader("Authorization") String authorization);
@PostMapping(value = "/login/login") @PostMapping(value = "/login/login")
...@@ -75,6 +76,9 @@ public interface IUserFeign extends IFeign { ...@@ -75,6 +76,9 @@ public interface IUserFeign extends IFeign {
Rest<String> getToken(@RequestParam(value = "userKey") String userKey); Rest<String> getToken(@RequestParam(value = "userKey") String userKey);
@PostMapping(value = "/user/synchSiteAuth")
Rest<String> synchSiteAuth();
} }
...@@ -83,15 +87,15 @@ public interface IUserFeign extends IFeign { ...@@ -83,15 +87,15 @@ public interface IUserFeign extends IFeign {
class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> { class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> {
@Override @Override
public IUserFeign create(Throwable t) { public IUserFeign create(Throwable t) {
log.error("feign error",t); log.error("feign error", t);
return new IUserFeign() { return new IUserFeign() {
@Override @Override
public Rest<RespData<List<UserPdu>>> list(UserPdu userPdu) { public Rest<RespData<List<UserPdu>>> list(UserPdu userPdu) {
return Rest.fail("暂时无法获取用户信息业务列表,请稍后再试!"); return Rest.fail("暂时无法获取用户信息业务列表,请稍后再试!");
} }
@Override @Override
public Rest<UserPdu> info(Long id) { public Rest<UserPdu> info(Long id) {
return Rest.fail("暂时无法获取用户信息业务详细,请稍后再试!"); return Rest.fail("暂时无法获取用户信息业务详细,请稍后再试!");
} }
...@@ -115,6 +119,11 @@ class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> { ...@@ -115,6 +119,11 @@ class UserFeignFallbackFactory implements FallbackFactory<IUserFeign> {
return Rest.fail("token获取失败"); return Rest.fail("token获取失败");
} }
@Override
public Rest<String> synchSiteAuth() {
return Rest.fail("同步请求失败,稍后再试!");
}
}; };
} }
......
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