Commit 109448f2 by liuyang

2024-09-04 文档库消息模板调整

parent 052589a5
...@@ -84,13 +84,15 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -84,13 +84,15 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
HGWD001 hgwd001 = HGWDTools.HgWd001.get(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_FILE_ID));
StringBuilder strFileName = new StringBuilder();
strFileName.append("本次上传文件名称:");
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGWD099 hgdm099 = new HGWD099(); HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow); hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0); hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099); DaoUtils.insert(HGWD099.INSERT, hgdm099);
//项目文件 strFileName.append(hgdm099.getDocName()).append(",");
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) { if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode()); hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
...@@ -107,9 +109,9 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -107,9 +109,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001); HGWDTools.HgWd001.updateStatus(hgwd001);
} }
interaction(hgwd001,hgdm099.getDocName());
} }
HGWDTools.interaction(hgwd001,strFileName.substring(0, strFileName.length() - 1));
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -160,30 +162,4 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -160,30 +162,4 @@ public class ServiceHGWD099 extends ServiceEPBase {
return inInfo; return inInfo;
} }
/**
* 附件上传通知
* @param hgwd001 待变更的项目名称
* @param newName 变更后附件名称
*/
public void interaction(HGWD001 hgwd001,String newName){
try {
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//当前登录用户是否是设计人员,是设计人员则通知项目经理
List<HGWD003> hgwd003s = listByFile.stream().filter(hgwd003 -> hgwd003.getUserId().equals(UserSessionUtils.getUserId()) && hgwd003.getIsProjectManager() == 0).collect(Collectors.toList());
if (hgwd003s.size()>0){
HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(hgwd003 -> hgwd003.getIsProjectManager() == 1).map(hgwd003 -> hgwd003.getUserId().replace(hgpz009.getLoginPrefix(),"")).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(userIds)){
DcOpenApi.interactionAdd(
String.format("[%s]项目上传附件请审核发布", hgwd001.getProjName()),
String.format("上传附件名称[%s]",newName),String.join(",",userIds));
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
} }
...@@ -4,9 +4,13 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -4,9 +4,13 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant; import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoBase; 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.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant; import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099; import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
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;
...@@ -15,13 +19,12 @@ import com.baosight.hggp.hg.wd.domain.HGWD003; ...@@ -15,13 +19,12 @@ import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099; import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ProjectInfo; import com.baosight.iplat4j.core.ProjectInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList; import java.io.IOException;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -246,5 +249,42 @@ public class HGWDTools { ...@@ -246,5 +249,42 @@ public class HGWDTools {
return results; return results;
} }
public static List<HGWD099> queryByBiz(String bizType, String bizId) {
AssertUtils.isNull(bizType, "业务类型不能为空!");
AssertUtils.isNull(bizId, "业务ID不能为空!");
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{put("bizType",bizType); put("bizId",bizId);}}
);
return results;
}
}
/**
* 附件上传通知
* @param hgwd001 待变更的项目名称
* @param changeContent 变更内容
*/
public static void interaction(HGWD001 hgwd001, String changeContent){
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(item -> item.getUserId().replace(hgpz009.getLoginPrefix(),""))
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
if (userIds.size()>0){
DcOpenApi.interactionAdd(
String.format("[%s]项目变更", hgwd001.getProjName()),
changeContent,
String.join(",",userIds));
}
}
} catch (IOException e) {
e.printStackTrace();
}
} }
} }
...@@ -492,6 +492,7 @@ $(function () { ...@@ -492,6 +492,7 @@ $(function () {
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId; let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId); inEiInfo.set("inqu_status-0-fileId", parentId);
$("#inqu_status-0-changeContent").val('');
//inEiInfo.set("inqu_status-0-isProjectManager", "1"); //inEiInfo.set("inqu_status-0-isProjectManager", "1");
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val()); //inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, { EiCommunicator.send("HGWD003", "query", inEiInfo, {
...@@ -921,6 +922,7 @@ function uploadFileCallback(data) { ...@@ -921,6 +922,7 @@ function uploadFileCallback(data) {
inEiInfo.set("result-0-docType", data.docType); inEiInfo.set("result-0-docType", data.docType);
inEiInfo.set("result-0-bizType", data.bizType); inEiInfo.set("result-0-bizType", data.bizType);
inEiInfo.set("result-0-ndocId", data.ndocId); inEiInfo.set("result-0-ndocId", data.ndocId);
inEiInfo.set("inqu_status-0-fileId", data.bizId);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001"; let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
let methodName = data.operType == "add" ? "insert" : "updateFile"; let methodName = data.operType == "add" ? "insert" : "updateFile";
...@@ -975,6 +977,7 @@ function updateRelease() { ...@@ -975,6 +977,7 @@ function updateRelease() {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result")); inEiInfo.addBlock(JSUtils.checkedRows2Block("result"));
inEiInfo.set("inqu_status-0-changeContent", changeContent); inEiInfo.set("inqu_status-0-changeContent", changeContent);
inEiInfo.set("inqu_status-0-fileId", IPLATUI.EFTree.categoryTree.selectTreeNode.fileId);
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, { EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) { onSuccess(response) {
if (response.status != -1) { if (response.status != -1) {
...@@ -1052,8 +1055,7 @@ function changeResord() { ...@@ -1052,8 +1055,7 @@ function changeResord() {
"&efParentFormEname=HGWD001", "&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>变更记录</div>", title: "<div style='text-align: center;'>变更记录</div>",
width: "80%", width: "80%",
height: "80%", height: "80%"
callbackName: uploadFileCallback
}); });
} }
......
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