Merge remote-tracking branch 'origin/apps_dev' into apps_dev

This commit is contained in:
Mr-wang 2023-10-17 09:15:01 +08:00
commit 4c1e931f11
9 changed files with 120 additions and 168 deletions

View File

@ -900,14 +900,6 @@ public class CoEPALController {
return we.saveImportCoeWorkspace(wsFileName, replaceChoice, source);
}
// 流程资产 选择用户
// @Mapping("COE_PAL_WS_USERLIST")
@Mapping("com.actionsoft.apps.coe.pal_ws_userlist")
public String coePALWSUserList(UserContext me, String users, String removeUserIds) {
CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me);
return web.toPALWSUserList(users, removeUserIds);
}
// 停用启用流程资产
// @Mapping("COE_PAL_WS_STOPOROPEN")
@Mapping("com.actionsoft.apps.coe.pal_ws_stoporopen")

View File

@ -5,6 +5,8 @@ import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.database.RowMapper;
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
import com.actionsoft.bpms.org.cache.UserCache;
import com.actionsoft.bpms.org.model.UserModel;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilString;
@ -12,6 +14,7 @@ import com.actionsoft.exception.AWSDataAccessException;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -48,20 +51,30 @@ public class CoeCooperationMemberDao extends DaoObject<CoeCooperationMemberModel
}
/**
* 获取小组的用户
* 获取小组的用户 todo
* @param teamId
* @param roleType "0":管理员"1":设计人员"2":浏览人员"3":自定义角色
* @return
*/
public List<String> getCooperationAdminUsers(String teamId, String roleType) {
String sql = "SELECT m.USERID FROM " + entityName() + " m, " + CoeCooperationRoleModel.DATABASE_ENTITY+ " r, ORGUSER o WHERE m.TEAMID = ? AND m.TEAMID = r.TEAMID AND m.ROLEID = r.ID AND r.ROLETYPE = ? AND o.USERID = m.USERID AND o.CLOSED = '0' ORDER BY o.USERNAME";
String sql = "SELECT m.USERID FROM " + entityName() + " m, " + CoeCooperationRoleModel.DATABASE_ENTITY+ " r WHERE m.TEAMID = ? AND m.TEAMID = r.TEAMID AND m.ROLEID = r.ID AND r.ROLETYPE = ? ";
try {
return DBSql.query(sql, new RowMapper<String>() {
List<String> list = DBSql.query(sql, new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int arg1) throws SQLException {
return rs.getString(1);
}
}, new Object[]{teamId, roleType});
List<String> result = new ArrayList<>();
for (String userId : list) {
UserModel user = UserCache.getModel(userId);
if (user == null || user.isClosed()) {
continue;
}
result.add(userId);
}
Collections.sort(result);
return result;
} catch (AWSDataAccessException e) {
e.printStackTrace(System.err);
}

View File

@ -239,7 +239,7 @@ public class SynchronousOrgJob implements IJob {
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
// todo
List<RowMap> orgdepartmentList = DBSql.getMaps(conn, "select DISTINCT(POSITION_NAME) from ORGUSER WHERE DEPARTMENTID=?", departmentId);
JSONArray shapes = new JSONArray();

View File

@ -10,10 +10,14 @@ import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUser;
import com.actionsoft.bpms.commons.database.RowMapper;
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
import com.actionsoft.bpms.commons.mvc.model.PlatformMetaModelBean;
import com.actionsoft.bpms.commons.pagination.SQLPagination;
import com.actionsoft.bpms.org.cache.UserCache;
import com.actionsoft.bpms.org.model.UserModel;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.conf.server.AWSServerConf;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
@ -426,6 +430,7 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
if (!isUp) {
upOrDown = "DESC";
}
// todo
String sql = "SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0" + " ORDER BY " + sortFiled + " " + upOrDown;
if (isPaging) {
sql = SQLPagination.getPaginitionSQL(sql, start, limit);
@ -446,6 +451,7 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
public List<CoeUserModel> searchUser(String name) {
String sortFiled = CoeUserModel.FIELD_USER_NAME;
String upOrDown = "ASC";
// todo
StringBuilder sql = new StringBuilder("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID ");
String namelike = "";
if (StringUtil.containSpecialChar(name)) {
@ -479,13 +485,16 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
// 获取所有的记录条数
public int getCoeUserCount() {
try {
String sql = "SELECT COUNT(*) AS number FROM APP_ACT_COE_USER cu ,ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0";
return DBSql.getInt(sql, "number");
} catch (AWSDataAccessException e) {
e.printStackTrace();
List<CoeUserModel> list = new CoeUser().getCoeUsers();
int count = 0;
for (CoeUserModel model : list) {
UserModel user = UserCache.getModel(model.getUserId());
if (user == null || user.isClosed()) {
continue;
}
count++;
}
return 0;
return count;
}
public Map<String, Object> getCoeWorkSpaceVersions(String versionId) {

View File

@ -25,6 +25,7 @@ import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.org.cache.UserCache;
import com.actionsoft.bpms.org.model.UserModel;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.fs.DCContext;
@ -1654,50 +1655,6 @@ public class CoeWorkSpaceWeb extends ActionWeb {
return ro.toString();
}
/**
* 流程库属性-选择用户页面
*
* @param users
* @return
*/
public String toPALWSUserList(String users, String removeUserIds) {
String[] userArray = null;
if (users != null) {
userArray = users.split(",");
}
Map allUsers = CoeUserDaoFactory.createUser().getInstanceWithUserName(CoeUserModel.FIELD_ID);
JSONArray jsonArray = new JSONArray();
for (int i = 0; allUsers != null && i < allUsers.size(); i++) {
CoeUserModel userModel = (CoeUserModel) allUsers.get(new Integer(i));
if (removeUserIds != null && removeUserIds.contains(userModel.getUserId())) {
continue;
}
String isAdmin = userModel.getIsAdmin() == 0 ? "" : "";
String isChecked = "";
if (userArray != null && isExist(userArray, userModel.getUserId())) {
isChecked = "checked";
} else if (userArray == null || userArray.length == 0) {
if (userModel.getUserId().equals(_uc.getUID())) {
isChecked = "checked";
}
}
JSONObject object = new JSONObject();
object.put("id", userModel.getUserId());
object.put("userName", userModel.getUserName());
object.put("isChecked", isChecked);
object.put("isAdmin", isAdmin);
object.put("name", userModel.getUserId() + "&lt" + userModel.getUserName() + "&gt");
jsonArray.add(object);
}
Map<String, Object> macroLibraries = new HashMap<String, Object>();
macroLibraries.put("sid", super.getContext().getSessionId());
macroLibraries.put("userList", jsonArray);
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.ws.userlist.html", macroLibraries);
}
/**
* 判断某个id是否在数组中
*
@ -1910,12 +1867,16 @@ public class CoeWorkSpaceWeb extends ActionWeb {
Map allUsers = CoeUserDaoFactory.createUser().getInstanceWithUserName(CoeUserModel.FIELD_ID);
for (int i = 0; allUsers != null && i < allUsers.size(); i++) {
CoeUserModel userModel = (CoeUserModel) allUsers.get(new Integer(i));
UserModel user = UserCache.getModel(userModel.getUserId());
if (user == null || user.isClosed()) {
continue;
}
if (userModel.getIsAdmin() == 0 || (HighSecurityUtil.isON() && HighSecurityUtil.isSecAdminUser(userModel.getUserId()))) {
continue;
}
JSONObject object = new JSONObject();
object.put("value", userModel.getUserId());
object.put("label", userModel.getUserId() + "<" + userModel.getUserName() + ">");
object.put("label", userModel.getUserId() + "<" + user.getUserName() + ">");
object.put("path", SDK.getORGAPI().getDepartmentByUser(userModel.getUserId()).getPathNameI18NOfCache());
adminOptions.add(object);
}

View File

@ -50,26 +50,6 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
// super.setEntityName(CoeUserModel.DATABASE_ENTITY);
}
public PlatformMetaModelBean getInstanceById(String id) {
CoeUserModel model = new CoeUserModel();
try {
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", o." + model.FIELD_USER_NAME + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID AND cu." + model.FIELD_ID + "=?";
return DBSql.getObject(sql, new RowMapper<CoeUserModel>() {
@Override
public CoeUserModel mapRow(ResultSet rs, int arg1) throws SQLException {
CoeUserModel model = new CoeUserModel();
model.setId(rs.getString(model.FIELD_ID));
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
model.setUserId(rs.getString(model.FIELD_USER_ID) + "<" + rs.getString(model.FIELD_USER_NAME) + ">");
return model;
}
}, id);
} catch (Exception sqle) {
sqle.printStackTrace();
}
return model;
}
/**
* 根据用户Id获取用户信息
*
@ -78,8 +58,12 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
*/
public PlatformMetaModelBean getInstanceByUserId(String userId) {
CoeUserModel model = new CoeUserModel();
UserModel userModel = UserCache.getModel(userId);
if (userModel == null) {
return model;
}
try {
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", o." + model.FIELD_USER_NAME + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID AND cu." + model.FIELD_USER_ID + "=?";
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu WHERE cu." + model.FIELD_USER_ID + "=?";
return DBSql.getObject(sql, new RowMapper<CoeUserModel>() {
@Override
public CoeUserModel mapRow(ResultSet rs, int arg1) throws SQLException {
@ -87,7 +71,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
model.setId(rs.getString(model.FIELD_ID));
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
model.setUserId(rs.getString(model.FIELD_USER_ID));
model.setUserName(rs.getString(model.FIELD_USER_NAME));
model.setUserName(userModel.getUserName());
return model;
}
}, userId);
@ -153,7 +137,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
sorttype = "DESC";
}
StringBuilder sqlbufer = new StringBuilder();
sqlbufer.append(sql.append("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0 ").toString());
sqlbufer.append(sql.append("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu ").toString());
if ((sortname != null) && (!sortname.equals(""))) {
sqlbufer.append(" ORDER BY cu.").append(sortname).append(" ").append(sorttype);
}
@ -164,7 +148,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
model.setId(rs.getString(model.FIELD_ID));
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
model.setUserId(rs.getString(model.FIELD_USER_ID));
model.setUserName(rs.getString(model.FIELD_USER_NAME));
model.setUserName("");
return model;
}
}));
@ -260,14 +244,19 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
}
public boolean validateIsAccessCOE(String userid) {
String sql = "select u1.USERID from APP_ACT_COE_USER u1,ORGUSER u2 where u1.USERID=? and u1.USERID=u2.USERID and u2.CLOSED=0";
String sql = "select u1.USERID from APP_ACT_COE_USER u1 where u1.USERID=?";
String id = DBSql.getObject(sql, new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int arg1) throws SQLException {
return rs.getString(1);
}
}, userid);
if (id != null && !"".equals(id)) {
if (UtilString.isNotEmpty(id)) {
UserModel user = UserCache.getModel(id);
if (user == null || user.isClosed()) {
return false;
}
return true;
}
return false;

View File

@ -61,7 +61,7 @@ public class TaskController {
@Mapping("com.yili_pal_portal_open")
public String openPALConsole(String code) throws Exception {
ResponseObject ro = ResponseObject.newOkResponse();
Connection open = DBSql.open();
String userid = "";
@ -81,7 +81,7 @@ public class TaskController {
//System.out.println("userid》》》》》》》》》》"+json.getString("employeenumber"));
userid = json.getString("employeenumber");
try {
setUserLog("", userid, "1");
setUserLog("", userid, "1",open);
} catch (Exception e) {
}
}
@ -99,7 +99,7 @@ public class TaskController {
String portal_url = "https://bpm.yili.com:8088" + "/portal/r/or?cmd=com.actionsoft.apps.skins.mportal3_home_page&id=5af46cd5-a1bc-4125-a144-86d1a199eec1&sid=" + sessionId + "&oauthName=oauthLogin&code=" + code;
//ro.put("new_url",url);
DBSql.close(open);
return portal_url;
}
@ -111,11 +111,10 @@ public class TaskController {
* @param userid
* @param logType
*/
public void setUserLog(String processInstId, String userid, String logType) {
Connection open = DBSql.open();
public void setUserLog(String processInstId, String userid, String logType,Connection conn) {
System.err.println("用户登录记录存入日志========>" + userid + "_类型:" + logType);
if (UtilString.isNotEmpty(userid)) {
try {
//待阅更新已读记录
if ("3".equals(logType)) {
String dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
@ -138,14 +137,14 @@ public class TaskController {
String sqly = "SELECT PROCESSID,USER_ID,USERDEP,READTIMES,DATAID,TITLE,SENDTYPE,READSTATE,READCOUNT,ID FROM BO_ACT_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' ";
RowMap mapsy = DBSql.getMap(open,sqly);
RowMap mapsy = DBSql.getMap(conn,sqly);
if (null != mapsy && !mapsy.isEmpty()) {
String alsqly = "SELECT USER_ID FROM BO_ACT_ALREADY_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' ";
RowMap alsqlyMap = DBSql.getMap(open,alsqly);
RowMap alsqlyMap = DBSql.getMap(conn,alsqly);
if(alsqlyMap==null){
String sql = "insert into BO_ACT_ALREADY_DATAID (ID,PROCESSID,USER_ID,READTIMES,DATAID,TITLE,READSTATE) values ('%s', '%s', '%s', '%s', '%s', '%s','%s')";
String id = UUIDGener.getUUID();
int update = DBSql.update(open,String.format(sql, id, mapsy.getString("PROCESSID"), mapsy.getString("USER_ID"), dateTime, mapsy.getString("DATAID"),mapsy.getString("TITLE"),mapsy.getString("READSTATE")));
int update = DBSql.update(conn,String.format(sql, id, mapsy.getString("PROCESSID"), mapsy.getString("USER_ID"), dateTime, mapsy.getString("DATAID"),mapsy.getString("TITLE"),mapsy.getString("READSTATE")));
/* ProcessInstance boProcessInstance = SDK.getProcessAPI()
.createBOProcessInstance("obj_1a2207bf57eb4ed982ed24b9ed80e260", "admin", "OA已阅日志");
@ -162,7 +161,7 @@ public class TaskController {
if(update!=0){
System.out.println("count==========="+update);
String sql1 = "DELETE FROM BO_ACT_DATAID WHERE PROCESSID='"+processInstId+"'AND USER_ID='"+userid+"'";
DBSql.update(open,sql1);
DBSql.update(conn,sql1);
//SDK.getBOAPI().remove("BO_ACT_DATAID",mapsy.getString("ID"));
}
@ -184,12 +183,6 @@ public class TaskController {
bo.set("LOGTYPE", Integer.valueOf(logType));
SDK.getBOAPI().createDataBO("BO_EU_USER_LOGIN_LOG", bo, UserContext.fromUID("admin"));
DBSql.close(open);
} catch (Exception e) {
DBSql.close(open);
e.printStackTrace();
}
}
}
@ -203,11 +196,12 @@ public class TaskController {
*/
@Mapping("com.yili_form_page_open")
public String openFormPage(UserContext me, RequestParams params) {
Connection conn = DBSql.open();
//System.out.println("进入表单了===========");
//System.out.println("参数输出==========="+params.asMap());
//打开待办时记录日志
try {
setUserLog("", me.getUID(), "2");
setUserLog("", me.getUID(), "2",conn);
} catch (Exception e) {
}
String sessionId = me.getSessionId();
@ -262,6 +256,7 @@ public class TaskController {
//System.err.println("单点登录页面链接--->"+formURL);
//return portalUrl+"/r"+formURL.substring(1);
////System.out.println("输出表单==========="+formPage);
DBSql.close(conn);
return formPage;
}
@ -329,7 +324,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("PUBLISHFILEID") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
String methodId = DBSql.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("PUBLISHFILEID") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -449,7 +444,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("STOPFILEID") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql
.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("STOPFILEID") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -566,7 +561,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.get("CHANGEDFILEIDNEW") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
String methodId = DBSql.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("CHANGEDFILEIDNEW") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -690,15 +685,42 @@ public class TaskController {
// jsonObject);
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId)
.addQuery("OPTIONTYPE IS NOT NULL", null).detail();
List<BO> bo_act_dataid = SDK.getBOAPI().query("BO_ACT_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).list();
if (bo_act_dataid.size() > 0) {
BO bo_act_dataid = SDK.getBOAPI().query("BO_ACT_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).detail();
if (bo_act_dataid!=null) {
System.out.println("查询未读数据=============" + processInstId + "USER_ID=========" + usercode);
for (BO bo : bo_act_dataid) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("action", "read");
jsonObject.put("status", "1");
jsonObject.put("dataid", bo_act_dataid.getString("DATAID"));
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>"
+ " <web:in0>" + "<![CDATA[" + jsonObject + "]]>" + " </web:in0>"
+ " </web:service>" + " </soapenv:Body>" + "</soapenv:Envelope>";
HttpClient client = new HttpClient();
int timeout = 10000;
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
UtilUrl uc=new UtilUrl();
String s = uc.doPostSoap(readurl, xmlStr, "");
System.err.println(instanceById.getTitle() + "OA待阅PC端阅读返回=======>" + s);
String nums = DBSql.getString(conn,
"select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'");
if (UtilString.isNotEmpty(nums)) {
Integer read_num = Integer.valueOf(nums);
read_num += 1;
DBSql.update(conn,"update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
+ processInstId + "'");
}
} else {
BO actAlreadyDataid = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).detail();
if(actAlreadyDataid!=null){
System.out.println("查询已读数据=============" + processInstId + "USER_ID=========" + usercode);
JSONObject jsonObject = new JSONObject();
jsonObject.put("action", "read");
jsonObject.put("status", "1");
jsonObject.put("dataid", bo.getString("DATAID"));
jsonObject.put("dataid", actAlreadyDataid.getString("DATAID"));
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>"
+ " <web:in0>" + "<![CDATA[" + jsonObject + "]]>" + " </web:in0>"
@ -709,51 +731,21 @@ public class TaskController {
UtilUrl uc=new UtilUrl();
String s = uc.doPostSoap(readurl, xmlStr, "");
System.err.println(instanceById.getTitle() + "OA待阅PC端阅读返回=======>" + s);
String nums = DBSql.getString(
String nums = DBSql.getString(conn,
"select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'");
if (UtilString.isNotEmpty(nums)) {
Integer read_num = Integer.valueOf(nums);
read_num += 1;
DBSql.update("update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
DBSql.update(conn,"update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
+ processInstId + "'");
}
}
} else {
List<BO> actAlreadyDataid = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).list();
if (actAlreadyDataid.size() > 0) {
System.out.println("查询已读数据=============" + processInstId + "USER_ID=========" + usercode);
for (BO bo : actAlreadyDataid) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("action", "read");
jsonObject.put("status", "1");
jsonObject.put("dataid", bo.getString("DATAID"));
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>"
+ " <web:in0>" + "<![CDATA[" + jsonObject + "]]>" + " </web:in0>"
+ " </web:service>" + " </soapenv:Body>" + "</soapenv:Envelope>";
HttpClient client = new HttpClient();
int timeout = 10000;
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
UtilUrl uc=new UtilUrl();
String s = uc.doPostSoap(readurl, xmlStr, "");
System.err.println(instanceById.getTitle() + "OA待阅PC端阅读返回=======>" + s);
String nums = DBSql.getString(
"select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'");
if (UtilString.isNotEmpty(nums)) {
Integer read_num = Integer.valueOf(nums);
read_num += 1;
DBSql.update("update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
+ processInstId + "'");
}
}
}
}
// 用户打开阅览界面日志
setUserLog(processInstId, me.getUID(), "3");
//setUserLog(processInstId, me.getUID(), "3");
long have_time = System.currentTimeMillis();
@ -919,7 +911,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("PUBLISHFILEID") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
String methodId = DBSql.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("PUBLISHFILEID") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -1105,7 +1097,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("STOPFILEID") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql
.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("STOPFILEID") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -1281,7 +1273,7 @@ public class TaskController {
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("CHANGEDFILEIDNEW") + "'" + ") ORDER BY FILENAME ASC";
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
String methodId = DBSql.getString(conn,"select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
+ bo.getString("CHANGEDFILEIDNEW") + "'");
if (UtilString.isNotEmpty(methodId)) {
if (methodId.equals("control.policy")) {
@ -1399,14 +1391,13 @@ public class TaskController {
String mobileurl = portalUrl + "/r/or?cmd=com.yili_process_page_phone&processInstId=" + processInstId
+ "&taskInstId=" + taskInstId;
HttpClientUtils httpClientUtil = new HttpClientUtils();
List<BO> bo_act_dataid = SDK.getBOAPI().query("BO_ACT_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).list();
if (bo_act_dataid.size() > 0) {
for (BO bo : bo_act_dataid) {
BO bo_act_dataid = SDK.getBOAPI().query("BO_ACT_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).detail();
if (bo_act_dataid!=null) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("status", "1");
jsonObject.put("action", "read");
jsonObject.put("dataid", bo.getString("DATAID"));
jsonObject.put("dataid", bo_act_dataid.getString("DATAID"));
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>"
+ " <web:in0>" + "<![CDATA[" + jsonObject + "]]>" + " </web:in0>"
@ -1416,25 +1407,23 @@ public class TaskController {
UtilUrl uc=new UtilUrl();
String s = uc.doPostSoap(readurl, xmlStr, "");
//System.err.println(instanceById.getTitle()+"_OA待阅移动端阅读返回=======>"+s);
String nums = DBSql.getString(
String nums = DBSql.getString(conn,
"select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'");
if (UtilString.isNotEmpty(nums)) {
Integer read_num = Integer.valueOf(nums);
read_num += 1;
DBSql.update("update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
DBSql.update(conn,"update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
+ processInstId + "'");
}
}
} else {
List<BO> alreadyDataid = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).list();
if (alreadyDataid.size() > 0) {
for (BO bo : alreadyDataid) {
BO alreadyDataid = SDK.getBOAPI().query("BO_ACT_ALREADY_DATAID").addQuery("PROCESSID=", processInstId)
.addQuery("USER_ID=", usercode).detail();
if (alreadyDataid!=null) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("status", "1");
jsonObject.put("action", "read");
jsonObject.put("dataid", bo.getString("DATAID"));
jsonObject.put("dataid", alreadyDataid.getString("DATAID"));
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.yili.weaver.com.cn\">\n"
+ " <soapenv:Header/>" + " <soapenv:Body>" + " <web:service>"
+ " <web:in0>" + "<![CDATA[" + jsonObject + "]]>" + " </web:in0>"
@ -1444,21 +1433,20 @@ public class TaskController {
UtilUrl uc=new UtilUrl();
String s = uc.doPostSoap(readurl, xmlStr, "");
System.err.println(instanceById.getTitle() + "_OA待阅移动端阅读返回=======>" + s);
String nums = DBSql.getString(
String nums = DBSql.getString(conn,
"select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'");
if (UtilString.isNotEmpty(nums)) {
Integer read_num = Integer.valueOf(nums);
read_num += 1;
DBSql.update("update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
DBSql.update(conn,"update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + "' where PROCESSID = '"
+ processInstId + "'");
}
}
}
}
System.out.println("插入待阅日志开始========================");
// 用户打开阅览界面日志
setUserLog(processInstId, me.getUID(), "3");
//setUserLog(processInstId, me.getUID(), "3");
System.out.println("插入待阅日志结束========================");
/*
* JSONObject jsonObject = new JSONObject(); SimpleDateFormat sdf = new

View File

@ -669,7 +669,7 @@ public class UpfileWeb extends ActionWeb {
}
}
/**
* 压缩附件下载功能