Commit 673cbc8d by 宋祥
parents 03e14556 cac4cbc1
...@@ -374,14 +374,13 @@ public class ServiceHGWD001D extends TreeService { ...@@ -374,14 +374,13 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("filePath", dbWd001.getFilePath()); leafMap.put("filePath", dbWd001.getFilePath());
if (!isManager && !isSpare) { if (!isManager && !isSpare) {
leafMap.put("isAuth", "1"); leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
} else { } else {
leafMap.put("isAuth", "0"); leafMap.put("isAuth", "0");
leafMap.put("downloadFlag", "1");
} }
// 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
results.add(leafMap); results.add(leafMap);
} }
// 设置叶子节点 // 设置叶子节点
...@@ -472,8 +471,12 @@ public class ServiceHGWD001D extends TreeService { ...@@ -472,8 +471,12 @@ public class ServiceHGWD001D extends TreeService {
*/ */
public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) { public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) {
List<String> childIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare); //查询子级目录 List<String> childIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare); //查询子级目录
List<HGWD003> dbWd003List = null;
// 已授权人员信息 // 已授权人员信息
List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds); if (!isSpare){
dbWd003List = HGWDTools.HgWd003.list(childIds);
}
List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode); List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode);
int dbWd099s = fWd099s == null ? 0 : fWd099s.size(); int dbWd099s = fWd099s == null ? 0 : fWd099s.size();
int count = 0; int count = 0;
......
...@@ -4,8 +4,10 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,8 +4,10 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum; import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools; import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
...@@ -13,8 +15,10 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools; ...@@ -13,8 +15,10 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
...@@ -25,6 +29,7 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -25,6 +29,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -83,6 +88,9 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -83,6 +88,9 @@ public class ServiceHGWD001E extends ServiceEPBase {
} }
Map<String, List<Map<String, Object>>> edcm01Map = edcm01List.stream().collect(Collectors.groupingBy(map -> map.get("codesetCode").toString(), Collectors.toList())); Map<String, List<Map<String, Object>>> edcm01Map = edcm01List.stream().collect(Collectors.groupingBy(map -> map.get("codesetCode").toString(), Collectors.toList()));
List<HGWD001> hgwd001s = new ArrayList<>(); List<HGWD001> hgwd001s = new ArrayList<>();
List<User> users = DaoBase.getInstance().query("HGWD003A.query",new HashMap<String, Object>(){{
put("userId", UserSessionUtils.getUserId());
}});
// 写入数据 // 写入数据
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001(); HGWD001 hgwd001 = new HGWD001();
...@@ -99,7 +107,7 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -99,7 +107,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001.setFileIdPath(wd001.getFileIdPath() + "/" + wd001.getFileId()); hgwd001.setFileIdPath(wd001.getFileIdPath() + "/" + wd001.getFileId());
} }
if (hgwd001.getId() == null || hgwd001.getId() == 0) { if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001); this.add(hgwd001,users);
} else { } else {
List<Map<String, Object>> mapList = edcm01Map.get("hggp.hgwd.fileType"); List<Map<String, Object>> mapList = edcm01Map.get("hggp.hgwd.fileType");
this.modify(hgwd001,mapList); this.modify(hgwd001,mapList);
...@@ -118,7 +126,7 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -118,7 +126,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
/** /**
* 新增操作 * 新增操作
*/ */
public void add(HGWD001 hgwd001) { public void add(HGWD001 hgwd001, List<User> users) {
hgwd001.setFileId(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID)); hgwd001.setFileId(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID));
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1); hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
DaoUtils.insert(HGWD001.INSERT, hgwd001); DaoUtils.insert(HGWD001.INSERT, hgwd001);
...@@ -132,6 +140,18 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -132,6 +140,18 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.addHGWD001A(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
if (CollectionUtils.isNotEmpty(users)){
User user = users.get(0);
HGWD003 fWd003 = new HGWD003();
fWd003.setUserId(user.getUserId());
fWd003.setUserName(user.getUserId());
fWd003.setExtId(user.getExtId());
fWd003.setOrgId(user.getDepCode());
fWd003.setOrgCname(user.getDepName());
fWd003.setFileId(hgwd001.getFileId());
DaoUtils.insert(HGWD003.INSERT, fWd003);
}
} }
/** /**
......
...@@ -496,7 +496,7 @@ public class HGWDTools { ...@@ -496,7 +496,7 @@ public class HGWDTools {
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY, List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String, Object>() {{ new HashMap<String, Object>() {{
put("bizType", bizType==null?"WD":bizType); put("bizType", bizType==null?"WD":bizType);
put("status", "HGWD002".equals(pageCode)?1:0); put("status", "HGWD002".equals(pageCode)?1:null);
put("bizIds", bizIds); put("bizIds", bizIds);
}} }}
); );
......
...@@ -809,6 +809,7 @@ function uploadFileCallback(data) { ...@@ -809,6 +809,7 @@ function uploadFileCallback(data) {
}else { }else {
JSColorbox.close(); JSColorbox.close();
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
editCallback();
} }
}, },
......
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