多浏览器页签编辑权控制,处理出现先赋权再释放编辑权的场景

This commit is contained in:
446052889@qq.com 2025-02-08 15:51:41 +08:00
parent 24408e2659
commit 301a4d84d0
5 changed files with 20 additions and 15 deletions

View File

@ -1509,7 +1509,7 @@ public class CoEPALController {
coeRealtimeWeb.addRealtimeEvents(params);
//return "";
CoeDesignerWeb web = new CoeDesignerWeb(me);//释放用户锁
return web.releaseCheckoutRight(uuid);
return web.releaseCheckoutRight(uuid, UUIDGener.getObjectId());
}
// 复制操作时缓存数据
@ -2416,9 +2416,9 @@ public class CoEPALController {
*/
// @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_EDIT_RELEASELOCK")
@Mapping("com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock")
public String releaseCheckoutRight(UserContext me, String uuid) {
public String releaseCheckoutRight(UserContext me, String uuid, String browserId) {
CoeDesignerWeb web = new CoeDesignerWeb(me);
return web.releaseCheckoutRight(uuid);
return web.releaseCheckoutRight(uuid, browserId);
}
/**

View File

@ -308,7 +308,6 @@ public class CoeDesignerWeb extends ActionWeb {
checkoutTip = "<div id=\"checkoutTip\" style=\"display: block;\">" + " <div style=\"width: 36px; float: left;\"><img src=\"../apps/_bpm.platform/img/model/form_designer/lock.png\"></div>" + " <div style=\"width: 360px; float: left;\"> 您已在其他浏览器页签编辑该模型时锁定,最后一次保存日期" + " <br/><font color=\"green\" style=\"margin-left: 5px;\"><b>" + UtilDate.datetimeFormat(plModel.getModifyDate())
+ "</b></font>,点击此处<a style=\"text-decoration: none;\" href=\"#\" onclick=\"getCheckoutRight();return false;\">强行获取编辑权</a>" + " </div>" + "</div>";
} else {
releaseCheckoutRight(rUUID);
setCurrentCheckoutRight(rUUID, _uc.getUID(), browserId);
}
} else {// 本人加锁的前提下非当前人锁定时直接设定编辑权
@ -2759,6 +2758,7 @@ public class CoeDesignerWeb extends ActionWeb {
CheckoutModel checkoutModel = getCurrentCheckoutInfo(uuid);
if (checkoutModel == null) {
checkoutModel = new CheckoutModel();
checkoutModel.setId(CoEConstant.APP_ID + "_" + "designer_" + uuid);
checkoutModel.setAppId(CoEConstant.APP_ID);
}
checkoutModel.setUser(_uc.getUID());
@ -2801,18 +2801,22 @@ public class CoeDesignerWeb extends ActionWeb {
* @param uuid
* @return
*/
public String releaseCheckoutRight(String uuid) {
public String releaseCheckoutRight(String uuid, String browserId) {
ResponseObject ro = ResponseObject.newOkResponse();
PALRepositoryModel process = PALRepositoryCache.getCache().get(uuid);
if (process != null) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(process.getWsId(), process.getVersionId());
for (PALRepositoryModel p : list) {
CheckoutModel model = getCurrentCheckoutInfo(p.getId());
if (model != null && model.getUser().equals(_uc.getUID())) {
CheckoutCache.removeValue(CoEConstant.APP_ID + "_" + "designer_" + p.getId());
}
}
CheckoutModel model = getCurrentCheckoutInfo(uuid);
if (model != null && model.getUser().equals(_uc.getUID()) && browserId.equals(model.getExtend())) {
CheckoutCache.removeValue(CoEConstant.APP_ID + "_" + "designer_" + uuid);
}
// PALRepositoryModel process = PALRepositoryCache.getCache().get(uuid);
// if (process != null) {
// List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(process.getWsId(), process.getVersionId());
// for (PALRepositoryModel p : list) {
// CheckoutModel model = getCurrentCheckoutInfo(p.getId());
// if (model != null && model.getUser().equals(_uc.getUID())) {
// CheckoutCache.removeValue(CoEConstant.APP_ID + "_" + "designer_" + p.getId());
// }
// }
// }
return ro.toString();
}

View File

@ -1297,6 +1297,7 @@
<cmd-bean name="com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock">
<param name="uuid"/>
<param name="browserId"/>
</cmd-bean>
<cmd-bean name="com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_deptname_query">

View File

@ -228,7 +228,7 @@ $(function () {
// uuid: ruuid
// }
// });
navigator.sendBeacon("./jd?cmd=com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock&sid=" + CLB.sid + "&uuid=" + ruuid);
navigator.sendBeacon("./jd?cmd=com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock&sid=" + CLB.sid + "&uuid=" + ruuid + "&browserId=" + browserId);
};
// saveTimer();
intervalRefresh();