Commit 2a121af0 by liuyang

2024-09-23 文档库:新增、变更、删除发送通知当前目录的用户

parent aad91f0c
......@@ -231,7 +231,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
if (StringUtils.isNotEmpty(changeContent)) {
strFileName.append(",").append("变更内容:").append(changeContent);
}
HGWDTools.interaction(hgwd001,strFileName.toString());
//获取文件下的权限人员
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId());
//排除登录用户
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()))
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目发布通知",hgwd001.getProjName()),strFileName.toString(),userIds);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "发布成功")});
......@@ -276,7 +282,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_1);
DaoUtils.insert(HGWD099.UPDATE, hgwd099);
}
HGWDTools.interaction(hgwd001,strFileName.substring(0,strFileName.length()-1));
//获取文件下的权限人员
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId());
//排除登录用户
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()))
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目变更附件通知",hgwd001.getProjName()),strFileName.substring(0,strFileName.length()-1),userIds);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
......
......@@ -111,7 +111,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
HGWDTools.HgWd001.updateStatus(hgwd001);
}
}
HGWDTools.interaction(hgwd001,strFileName.substring(0, strFileName.length() - 1));
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//排除登录用户
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()))
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目新增附件通知",hgwd001.getProjName()),strFileName.substring(0, strFileName.length() - 1), userIds);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
......@@ -132,29 +137,39 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
DaoUtils.update(HGWD099.DELETE, hgdm099); //逻辑删除
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setAcceId(hgdm099.getId().toString());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
List<HGWD099> list = MapUtils.toDaoEPBases(resultRows, HGWD099.class);
if (CollectionUtils.isNotEmpty(list)){
List<String> bizNames =list.stream().map(HGWD099::getDocName).distinct().collect(Collectors.toList());
HGWD001 hgwd001 = HGWDTools.HgWd001.get(list.get(0).getBizId());
list.forEach(hgwd099 -> {
DaoUtils.update(HGWD099.DELETE, hgwd099.toMap()); //逻辑删除
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgwd099.getDocName());
hgwd001a.setChangeEndCode(hgwd099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setAcceId(hgwd099.getId().toString());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
});
//获取文件下的权限人员
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId());
//排除登录用户
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()))
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目删除附件通知",hgwd001.getProjName()),String.format("删除附件名称:%s",String.join(",",bizNames)),userIds);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
......
......@@ -325,21 +325,32 @@ public class HGWDTools {
* @param changeContent 变更内容
*/
public static void interaction(HGWD001 hgwd001, String changeContent){
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()) && item.getIsProjectManager() == 1)
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
interaction(String.format("[%s]项目通知", hgwd001.getProjName()), changeContent, userIds);
}
}
/**
* 附件上传通知
* @param projName 待变更的项目名称
* @param changeContent 变更内容
* @param userIds 用户ID集合
*/
public static void interaction(String projName, String changeContent, List<String> userIds){
try {
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()) && item.getIsProjectManager() == 1)
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
if (userIds.size()>0){
DcOpenApi.interactionAdd(
String.format("[%s]项目通知", hgwd001.getProjName()),
changeContent,
String.join(",",userIds));
}
if (userIds.size()>0){
DcOpenApi.interactionAdd(
projName,
changeContent,
String.join(",",userIds)
);
}
} catch (IOException e) {
e.printStackTrace();
......
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