Commit 010be5cf authored by 赵啸非's avatar 赵啸非

修改站点名称同步修改窗口站点

parent c6b8b131
...@@ -79,8 +79,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -79,8 +79,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}else{ }else{
entity.setCustUrl(""); entity.setCustUrl("");
} }
return super.infoAfter(id, model, entity, context); return super.infoAfter(id, model, entity, context);
} }
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.dept.service.impl; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.dept.service.impl;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
...@@ -62,6 +63,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -62,6 +63,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
private WindowBusinessService windowBusinessService; private WindowBusinessService windowBusinessService;
@Override @Override
protected String getExtKey(DeptEntity data) { protected String getExtKey(DeptEntity data) {
return data.getDeptNumber(); return data.getDeptNumber();
...@@ -165,4 +167,20 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -165,4 +167,20 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
condition.put("source", SourceEnum.政务网.getValue()); condition.put("source", SourceEnum.政务网.getValue());
this.dao.delete(condition); this.dao.delete(condition);
} }
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void updateAfter(DeptEntity entity, Context context) throws AppException {
List<WindowEntity> windowEntityList = windowService.find(new WindowQuery().deptId(entity.getId()));
windowEntityList.forEach(item->{
item.setDeptName(entity.getName());
});
windowService.update(windowEntityList,context);
super.updateAfter(entity, context);
}
} }
\ No newline at end of file
...@@ -32,11 +32,13 @@ import com.mortals.xhx.module.model.model.ModelEntity; ...@@ -32,11 +32,13 @@ import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery; import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService; import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.site.dao.SiteDao; import com.mortals.xhx.module.site.dao.SiteDao;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.*;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.model.vo.SiteAreaVo; import com.mortals.xhx.module.site.model.vo.SiteAreaVo;
import com.mortals.xhx.module.site.service.SiteBusinessService;
import com.mortals.xhx.module.site.service.SiteService; import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.model.WindowQuery;
import com.mortals.xhx.module.window.service.WindowService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
...@@ -77,12 +79,36 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -77,12 +79,36 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
private UserService userService; private UserService userService;
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Autowired
private MattersService mattersService;
@Autowired @Autowired
private MatterService matterService; private MatterService matterService;
@Autowired
private WindowService windowService;
@Autowired
private SiteBusinessService siteBusinessService;
@Override
protected void updateBefore(SiteEntity entity, Context context) throws AppException {
//校验下前后名称是否一直 如果不一致 同步修改所以关联
SiteEntity siteEntity = this.get(entity.getId(), context);
if(!siteEntity.getSiteName().equals(entity.getSiteName())){
//todo
}
//更新窗口名称
List<WindowEntity> windowEntityList = windowService.find(new WindowQuery().siteId(entity.getId()));
windowEntityList.forEach(item->item.setSiteName(entity.getSiteName()));
windowService.update(windowEntityList,context);
//更新站点业务名称
List<SiteBusinessEntity> siteBusinessEntities = siteBusinessService.find(new SiteBusinessQuery().siteId(entity.getId()));
siteBusinessEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteBusinessService.update(siteBusinessEntities,context);
super.updateBefore(entity, context);
}
@Override @Override
protected void validData(SiteEntity entity, Context context) throws AppException { protected void validData(SiteEntity entity, Context context) throws AppException {
if (ObjectUtils.isEmpty(entity.getAreaCode())) { if (ObjectUtils.isEmpty(entity.getAreaCode())) {
...@@ -242,9 +268,10 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -242,9 +268,10 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
userPdu.setPage(1); userPdu.setPage(1);
userPdu.setSize(-1); userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu); Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData()); userService.updateUserList(list.getData().getData());
} }
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
...@@ -506,4 +533,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -506,4 +533,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet()); Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet());
return firstList.parallelStream().filter(item -> !secondSet.contains(item.getMatterNo())).collect(Collectors.toList()); return firstList.parallelStream().filter(item -> !secondSet.contains(item.getMatterNo())).collect(Collectors.toList());
} }
} }
\ 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