Commit 85cacb44 authored by 赵啸非's avatar 赵啸非

修改工作人员导入

parent d97c09f0
......@@ -37,8 +37,8 @@ import java.util.Map;
* @author: zxfei
* @date: 2022/4/20 9:24
*/
@Aspect
@Component
//@Aspect
//@Component
@Slf4j
//@Order(1)
@Profile({"default", "develop", "test"})
......
......@@ -34,15 +34,18 @@ import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.site.dao.SiteDao;
import com.mortals.xhx.module.site.model.*;
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.*;
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 com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -82,11 +85,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Autowired
private MatterService matterService;
@Autowired
private WindowService windowService;
@Autowired
private SiteBusinessService siteBusinessService;
@Autowired
private SiteThemeMatterService siteThemeMatterService;
@Autowired
private SiteMatterService siteMatterService;
@Autowired
private WorkmanService workmanService;
@Override
......@@ -95,18 +107,39 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
SiteEntity siteEntity = this.get(entity.getId(), context);
if(!siteEntity.getSiteName().equals(entity.getSiteName())){
//todo
//更新关联站点名称
updateAssociateSiteName(entity, context);
//通知设备更新站点信息
}
super.updateBefore(entity, context);
}
//更新窗口名称
private void updateAssociateSiteName(SiteEntity entity, Context context) {
List<WindowEntity> windowEntityList = windowService.find(new WindowQuery().siteId(entity.getId()));
windowEntityList.forEach(item->item.setSiteName(entity.getSiteName()));
windowService.update(windowEntityList,context);
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);
siteBusinessService.update(siteBusinessEntities, context);
//更新站点主题事项名称
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(new SiteMatterQuery().siteId(entity.getId()));
siteMatterEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteMatterService.update(siteMatterEntities, context);
//更新站点主题事项名称
List<SiteThemeMatterEntity> siteThemeMatterEntities = siteThemeMatterService.find(new SiteThemeMatterQuery().siteId(entity.getId()));
siteThemeMatterEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteThemeMatterService.update(siteThemeMatterEntities, context);
//更新工作人员站点
List<WorkmanEntity> workmanEntities = workmanService.find(new WorkmanQuery().siteId(entity.getId()));
workmanEntities.forEach(item->item.setSiteName(entity.getSiteName()));
workmanService.update(workmanEntities, context);
}
@Override
......
......@@ -186,4 +186,5 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
super.doImportDataBefore(list, updateSupport, context);
}
}
\ 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