Commit 0efb9a92 by liuyang

2024-09-23 1、文件版本bug修复 2、发布通知内容变更

parent 65130dd9
...@@ -191,12 +191,20 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -191,12 +191,20 @@ public class ServiceHGWD001 extends ServiceEPBase {
HGWD001 hgwd001 = HGWDTools.HgWd001.get(fileId); HGWD001 hgwd001 = HGWDTools.HgWd001.get(fileId);
hgwd001.setRemark(changeContent); hgwd001.setRemark(changeContent);
List<HGWD099> listByBizId = HGWDTools.HgWd099.queryByBiz("WD",fileId).stream().filter(hgwd099 -> hgwd099.getStatus()==1).collect(Collectors.toList()); List<HGWD099> listByBizId = HGWDTools.HgWd099.queryByBiz("WD",fileId).stream().filter(hgwd099 -> hgwd099.getStatus()==0).collect(Collectors.toList());
if (listByBizId.size()>0){ if (listByBizId.size()>0){
List<String> docNames = listByBizId.stream().map(HGWD099::getDocName).collect(Collectors.toList()); List<String> docIds = listByBizId.stream().map(HGWD099::getDocId).collect(Collectors.toList());
strFileName.append("发布前文件名称:").append(String.join(",", docNames)).append(", "); List<HGWD001A> hgwd001AList =HGWDTools.HgWd001.listByDocIds(docIds);
if (!StringUtils.isEmpty(hgwd001AList)){
List<String> changeStart = hgwd001AList.stream().map(HGWD001A::getChangeStart).collect(Collectors.toList());
if (!StringUtils.isEmpty(changeStart)){
strFileName.append("发布前文件名称:").append(String.join(",", changeStart)).append(", ");
} }
strFileName.append("新发布的文件名称:"); List<String> changeEnd = hgwd001AList.stream().map(HGWD001A::getChangeEnd).collect(Collectors.toList());
strFileName.append("新发布文件名称:").append(String.join(",", changeEnd));
}
}
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGWD099 hgwd099 = new HGWD099(); HGWD099 hgwd099 = new HGWD099();
...@@ -211,8 +219,6 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -211,8 +219,6 @@ public class ServiceHGWD001 extends ServiceEPBase {
AssertUtils.isEmpty(hgwd003s, "您不是该项目的项目经理管理员,无法发布!"); AssertUtils.isEmpty(hgwd003s, "您不是该项目的项目经理管理员,无法发布!");
DaoUtils.update(HgWdSqlConstant.HgWd099.RELEASE_DATE, hgwd099); //发布附件 DaoUtils.update(HgWdSqlConstant.HgWd099.RELEASE_DATE, hgwd099); //发布附件
strFileName.append(hgwd099.getDocName()).append(",");
//添加变更记录 //添加变更记录
HGWD001A hgwd001a = initHgwd001a(hgwd001, hgwd099, ChangeTypeEnum.RELEASE.getCode()); HGWD001A hgwd001a = initHgwd001a(hgwd001, hgwd099, ChangeTypeEnum.RELEASE.getCode());
HGWDTools.HgWd001.addHGWD001A(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
...@@ -223,7 +229,7 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -223,7 +229,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
DaoUtils.update(HGWD001.RELEASE_DATE, hgwd001); DaoUtils.update(HGWD001.RELEASE_DATE, hgwd001);
} }
if (StringUtils.isNotEmpty(changeContent)) { if (StringUtils.isNotEmpty(changeContent)) {
strFileName.append("变更内容:").append(changeContent); strFileName.append(",").append("变更内容:").append(changeContent);
} }
HGWDTools.interaction(hgwd001,strFileName.toString()); HGWDTools.interaction(hgwd001,strFileName.toString());
......
...@@ -104,6 +104,7 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -104,6 +104,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setChangeEnd(hgdm099.getDocName()); hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeEndCode(hgdm099.getDocId()); hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setAcceId(hgdm099.getId().toString());
HGWDTools.HgWd001.addHGWD001A(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
......
...@@ -92,6 +92,9 @@ ...@@ -92,6 +92,9 @@
<isNotEmpty prepend=" AND " property="acceId"> <isNotEmpty prepend=" AND " property="acceId">
ACCE_ID = #acceId# ACCE_ID = #acceId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEndCodes">
CHANGE_END_CODE IN <iterate close=")" open="(" conjunction="," property="changeEndCodes">#changeEndCodes[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -128,6 +128,9 @@ ...@@ -128,6 +128,9 @@
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus# #deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus#
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD099
</selectKey>
) )
</insert> </insert>
...@@ -158,7 +161,6 @@ ...@@ -158,7 +161,6 @@
DOC_NAME = #docName#, <!-- 文件名称 --> DOC_NAME = #docName#, <!-- 文件名称 -->
DOC_TYPE = #docType#, <!-- 文件类型 --> DOC_TYPE = #docType#, <!-- 文件类型 -->
STATUS = #status#, STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间--> RELEASE_DATE = #releaseDate#, <!--发布时间-->
OPER_STATUS = #operStatus#, OPER_STATUS = #operStatus#,
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
......
...@@ -76,6 +76,19 @@ public class HGWDTools { ...@@ -76,6 +76,19 @@ public class HGWDTools {
return DaoBase.getInstance().query(HGWD001.QUERY, queryMap); return DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
} }
/** 查询变更后的变更记录
* @param docIds 附件ID
* @return
*/
public static List<HGWD001A> listByDocIds(List<String> docIds) {
if (CollectionUtils.isEmpty(docIds)){
return null;
}
Map queryMap = new HashMap();
queryMap.put("changeEndCodes", docIds);
return DaoBase.getInstance().query(HGWD001A.QUERY, queryMap);
}
/** /**
* @param fileIds * @param fileIds
* @return * @return
...@@ -278,7 +291,7 @@ public class HGWDTools { ...@@ -278,7 +291,7 @@ public class HGWDTools {
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList()); .filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
if (userIds.size()>0){ if (userIds.size()>0){
DcOpenApi.interactionAdd( DcOpenApi.interactionAdd(
String.format("[%s]项目变更", hgwd001.getProjName()), String.format("[%s]项目通知", hgwd001.getProjName()),
changeContent, changeContent,
String.join(",",userIds)); String.join(",",userIds));
} }
......
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