diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index cab89072..3be1ce42 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoECommonController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoECommonController.java index 247dde46..f661088a 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoECommonController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoECommonController.java @@ -458,4 +458,22 @@ public class CoECommonController { return treeWeb.searchParentOrgId(orgId); } + + @Mapping("com.actionsoft.apps.coe.pal_search_user_tree_node") + public String searchUserInfo(UserContext me,String userName){ + BPMOrgTreeWeb treeWeb = new BPMOrgTreeWeb(me); + return treeWeb.searchUserIdByName(userName); + } + + @Mapping("com.actionsoft.apps.coe.pal_search_user_tree_parent_node") + public String searchParentUserId(UserContext me,String userid){ + BPMOrgTreeWeb treeWeb = new BPMOrgTreeWeb(me); + return treeWeb.searchParentUserId(userid); + } + + + + + + } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/components/web/BPMOrgTreeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/components/web/BPMOrgTreeWeb.java index 40ddc95f..b023be2a 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/components/web/BPMOrgTreeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/components/web/BPMOrgTreeWeb.java @@ -5,12 +5,8 @@ import com.actionsoft.apps.coe.pal.util.BpmOrgUtil; import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; import com.actionsoft.bpms.commons.mvc.view.ActionWeb; import com.actionsoft.bpms.commons.mvc.view.ResponseObject; -import com.actionsoft.bpms.org.cache.DepartmentCache; -import com.actionsoft.bpms.org.cache.RoleCache; -import com.actionsoft.bpms.org.model.CompanyModel; -import com.actionsoft.bpms.org.model.DepartmentModel; -import com.actionsoft.bpms.org.model.RoleModel; -import com.actionsoft.bpms.org.model.UserModel; +import com.actionsoft.bpms.org.cache.*; +import com.actionsoft.bpms.org.model.*; import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.util.UtilSerialize; import com.actionsoft.bpms.util.UtilString; @@ -324,6 +320,14 @@ public class BPMOrgTreeWeb extends ActionWeb { } obj.put("icon", icon); obj.put("leaf", true); + + + DepartmentModel departmentByUser = SDK.getORGAPI().getDepartmentByUser(model.getUID()); + String[] pathIdArr = departmentByUser.getPathIdOfCache().split("/"); + List pathIdList = new ArrayList<>(Arrays.asList(pathIdArr)); + pathIdList.add(departmentByUser.getCompanyId()); + pathIdList.add(model.getUID()); + obj.put("pathIdList",pathIdList); data.add(obj); } } @@ -391,4 +395,43 @@ public class BPMOrgTreeWeb extends ActionWeb { ro.setData(pathIds); return ro.toString(); } + + + + public String searchUserIdByName(String userName){ + ResponseObject ro = ResponseObject.newOkResponse(); + //部门 + + List companies = SDK.getORGAPI().getCompanys(); + List userModelList = UserCache.getAllUserList(); + + List result = new ArrayList<>(); + + result = userModelList.stream() + .filter(userModel -> userModel.getUserName().equals(userName)) + .map(UserModel::getUID) + .collect(Collectors.toList()); + ro.setData(result); + return ro.toString(); + } + + + public String searchParentUserId(String userid){ + + ResponseObject ro = ResponseObject.newOkResponse(); + DepartmentModel departmentByUser = SDK.getORGAPI().getDepartmentByUser(userid); + + String pathIdStr = departmentByUser.getPathIdOfCache(); + String[] pathIds = pathIdStr.split("/"); + + List datalist=new ArrayList<>(Arrays.asList(pathIds)); + datalist.add(userid); + + datalist.add(departmentByUser.getCompanyId()); + ro.setData(datalist); + return ro.toString(); + } + + + } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/publish/dao/PublishListHistory.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/publish/dao/PublishListHistory.java index a31b3265..d51fc27e 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/publish/dao/PublishListHistory.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/manage/publish/dao/PublishListHistory.java @@ -43,7 +43,7 @@ public final class PublishListHistory extends DaoObject paraMap.put("PALREPOSITORYID", model.getPalRepositoryId()); paraMap.put("ACTIONTYPE", model.getActionType()); paraMap.put("PUBLISHDESC", model.getPublishDesc()); - paraMap.put("TASKID", model.getTaskId()); + paraMap.put("TASKID",model.getTaskId()); return DBSql.update(sql, paraMap); } @@ -452,8 +452,8 @@ public final class PublishListHistory extends DaoObject * @return */ public String getLastPublishTaskIdByModelId(String repositoryId) { - //String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC"; - String sql="SELECT TASKID FROM (SELECT TASKID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID=? ORDER BY CREATEDATE DESC) WHERE ROWNUM=1"; + String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC"; + //String sql="SELECT TASKID FROM (SELECT TASKID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID=? ORDER BY CREATEDATE DESC) WHERE ROWNUM=1"; String taskId = DBSql.getObject(sql, new RowMapper() { @Override public String mapRow(ResultSet rs, int arg1) throws SQLException {