Commit 3d57fb9e authored by 赵啸非's avatar 赵啸非

添加窗口无人值守

parent e11061f7
...@@ -46,12 +46,24 @@ public interface UploadService extends IService { ...@@ -46,12 +46,24 @@ public interface UploadService extends IService {
*/ */
void fileDownload(String fileName, Boolean delete, HttpServletResponse response); void fileDownload(String fileName, Boolean delete, HttpServletResponse response);
/**
* 预览
* @param fileName
* @param response
*/
void preview(String fileName, HttpServletResponse response); void preview(String fileName, HttpServletResponse response);
/**
* 上传
* @param fileName
* @param response
*/
void uploadDownload(String fileName, HttpServletResponse response); void uploadDownload(String fileName, HttpServletResponse response);
/**
* 刪除
* @param fileName
*/
void deleteFile(String fileName); void deleteFile(String fileName);
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.mortals.framework.model.Context; ...@@ -6,6 +6,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.BusinessTypeEnum;
import com.mortals.xhx.common.code.IsBusinessEnum; import com.mortals.xhx.common.code.IsBusinessEnum;
import com.mortals.xhx.module.business.model.BusinessEntity; import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessMatterEntity; import com.mortals.xhx.module.business.model.BusinessMatterEntity;
...@@ -24,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -24,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -47,10 +45,51 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -47,10 +45,51 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Autowired @Autowired
private BusinessMatterService businessMatterService; private BusinessMatterService businessMatterService;
/**
* @param params
* @param pageInfo
* @param context
* @return
* @throws AppException
*/
@Override
protected SiteBusinessEntity findBefore(SiteBusinessEntity params, PageInfo pageInfo, Context context) throws AppException {
if (!ObjectUtils.isEmpty(params.getIdNotList())) {
Set<Long> notIdSet = params.getIdNotList().stream().collect(Collectors.toSet());
//排除掉了父级,但是子集存在,需要吧父id排除到notlist外
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
siteBusinessQuery.setIdList(params.getIdNotList());
List<SiteBusinessEntity> rootSiteBusiness = this.find(siteBusinessQuery).stream().filter(f -> f.getIsBusiness() == IsBusinessEnum.一级业务.getValue()).collect(Collectors.toList());
for (SiteBusinessEntity root : rootSiteBusiness) {
SiteBusinessQuery query = new SiteBusinessQuery();
query.setParentId(root.getId());
List<SiteBusinessEntity> childSiteBusiness = this.find(query, context);
//判断排除的id是否包含所有
Boolean bool = false;
for (SiteBusinessEntity child : childSiteBusiness) {
if (!notIdSet.contains(child.getId())) {
bool = true;
break;
}
}
if (bool) {
//排除掉父id
notIdSet.remove(root.getId());
}
}
params.setIdNotList(notIdSet.stream().collect(Collectors.toList()));
}
return super.findBefore(params, pageInfo, context);
}
@Override @Override
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException { protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
if (!ObjectUtils.isEmpty(params.getIdNotList())) { if (!ObjectUtils.isEmpty(params.getIdNotList())) {
//排除掉已经存在的ids //排除掉已经存在的ids
log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList())); log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList()));
Iterator<SiteBusinessEntity> iterator = list.iterator(); Iterator<SiteBusinessEntity> iterator = list.iterator();
...@@ -66,7 +105,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -66,7 +105,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
if (ObjectUtils.isEmpty(childs)) { if (ObjectUtils.isEmpty(childs)) {
//子节点已经全部选中,删除父节点 //子节点已经全部选中,删除父节点
iterator.remove(); iterator.remove();
pageInfo.setTotalResult(pageInfo.getTotalResult()-1); pageInfo.setTotalResult(pageInfo.getTotalResult() - 1);
} else { } else {
childs.stream().forEach(item1 -> { childs.stream().forEach(item1 -> {
......
...@@ -4,9 +4,9 @@ POST {{baseUrl}}/site/business/list ...@@ -4,9 +4,9 @@ POST {{baseUrl}}/site/business/list
Content-Type: application/json Content-Type: application/json
{ {
"idNotList": [], "idNotList": [11,18,17,14,27,26],
"siteId": 1, "siteId": 1,
"page":3, "page":1,
"size":10 "size":10
} }
......
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