Commit 018fa269 authored by “yiyousong”'s avatar “yiyousong”
parents 67f025a2 31d20a6e
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import cn.hutool.core.collection.ListUtil;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
...@@ -21,10 +22,7 @@ import com.mortals.xhx.module.window.model.WindowBusinessEntity; ...@@ -21,10 +22,7 @@ import com.mortals.xhx.module.window.model.WindowBusinessEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService; import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -42,11 +40,15 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -42,11 +40,15 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
@Override @Override
protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException { protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException {
Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context); Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
list.forEach(item->{ Iterator iterator = list.iterator();
while (iterator.hasNext()){
WindowBusinessEntity item = (WindowBusinessEntity) iterator.next();
if(!ObjectUtils.isEmpty(item.getWindowId())&&!ObjectUtils.isEmpty(collect.get(item.getWindowId()))){ if(!ObjectUtils.isEmpty(item.getWindowId())&&!ObjectUtils.isEmpty(collect.get(item.getWindowId()))){
item.setFromnum(collect.get(item.getWindowId()).getFromnum()); item.setFromnum(collect.get(item.getWindowId()).getFromnum());
}else {
iterator.remove();
}
} }
});
super.findAfter(entity, pageInfo, context, list); super.findAfter(entity, pageInfo, context, list);
} }
} }
\ No newline at end of file
...@@ -56,7 +56,7 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -56,7 +56,7 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
@Override @Override
protected void findAfter(WindowEntity params, PageInfo pageInfo, Context context, List<WindowEntity> list) throws AppException { protected void findAfter(WindowEntity params, PageInfo pageInfo, Context context, List<WindowEntity> list) throws AppException {
Map<Long, List<WorkmanEntity>> workmanCollect = workmanService.find(new WorkmanQuery()).stream().filter(f->f.getWindowId()!=null).collect(Collectors.groupingBy(x -> x.getWindowId())); Map<Long, List<WorkmanEntity>> workmanCollect = workmanService.find(new WorkmanQuery()).stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId()));
Map<Long, List<WindowBusinessEntity>> windowBusinessCollect = windowBusinessService.find(new WindowBusinessQuery()) Map<Long, List<WindowBusinessEntity>> windowBusinessCollect = windowBusinessService.find(new WindowBusinessQuery())
.stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId())); .stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId()));
...@@ -120,4 +120,22 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -120,4 +120,22 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
windowBusinessService.save(windowBusinessEntities, context); windowBusinessService.save(windowBusinessEntities, context);
} }
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
if (!ObjectUtils.isEmpty(ids)) {
//级联删除窗口业务
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
windowBusinessQuery.setWindowIdList(Arrays.asList(ids));
List<WindowBusinessEntity> windowBusinessEntities = windowBusinessService.find(windowBusinessQuery);
windowBusinessService.removeList(windowBusinessEntities, context);
//级联删除窗口事项
WindowMatterQuery windowMatterQuery = new WindowMatterQuery();
windowMatterQuery.setWindowIdList(Arrays.asList(ids));
List<WindowMatterEntity> windowMatterEntities = windowMatterService.find(windowMatterQuery);
windowMatterService.removeList(windowMatterEntities, context);
}
super.removeAfter(ids, context, result);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.window.web; package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController; import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.window.model.WindowEntity; import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import com.mortals.xhx.module.window.service.WindowService; import com.mortals.xhx.module.window.service.WindowService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -15,7 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -15,7 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 站点部门窗口 * 站点部门窗口
...@@ -29,6 +33,9 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe ...@@ -29,6 +33,9 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private WindowBusinessService windowBusinessService;
public WindowController() { public WindowController() {
super.setFormClass(WindowForm.class); super.setFormClass(WindowForm.class);
......
...@@ -93,7 +93,7 @@ project_deploy() { ...@@ -93,7 +93,7 @@ project_deploy() {
project_ui_deploy() { project_ui_deploy() {
writelog "${PROJECT_NAME}_ui_deploy" writelog "${PROJECT_NAME}_ui_deploy"
clear_ui_deploy ${PROJECT_UI_EXECPATH} clear_ui_deploy ${PROJECT_UI_EXECPATH}
tar -zvx ./${PROJECT_UI_FILENAME} -C ${PUBLISH_PATH} tar -zvxf ./${PROJECT_UI_FILENAME} -C ${PUBLISH_PATH}
writelog "${PROJECT_NAME}_ui_deploy_finish" writelog "${PROJECT_NAME}_ui_deploy_finish"
} }
......
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