移动kms知识文件,以及修改insert报错代码
This commit is contained in:
parent
348cc955d3
commit
4a228ac936
@ -1,87 +0,0 @@
|
||||
package com.awspaas.user.apps.docview;
|
||||
|
||||
import javax.ws.rs.DefaultValue;
|
||||
import javax.ws.rs.FormParam;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.MatrixParam;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.HandlerType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
|
||||
|
||||
@Controller(type = HandlerType.RESTFUL, apiName = "helloapi", desc = "这是RESTful API示例")
|
||||
@Path("/hello")
|
||||
public class BpaHttpApi {
|
||||
|
||||
@GET
|
||||
public String sayHello() {
|
||||
return "hello,world! - get";
|
||||
}
|
||||
|
||||
@POST
|
||||
public String sayHelloPost() {
|
||||
return "hello,world!- post ";
|
||||
}
|
||||
|
||||
|
||||
@Path("/param/{name}")
|
||||
@GET
|
||||
public String sayHelloparam(@PathParam("name") String name) {
|
||||
return "hello,world!-param " + name;
|
||||
}
|
||||
|
||||
@Path("/param2/{name}/{name2}")
|
||||
@GET
|
||||
public String sayHelloparam2(@PathParam("name") String name, @PathParam("name2") String name2) {
|
||||
return "hello,world!-param2 " + name + "," + name2;
|
||||
}
|
||||
|
||||
@Path("/QueryParam")
|
||||
@GET
|
||||
public String sayHelloQueryParam(@QueryParam("name") String name) {
|
||||
return "hello,world!-QueryParam " + name;
|
||||
}
|
||||
|
||||
@Path("/QueryParam2")
|
||||
@GET
|
||||
public String sayHelloQueryParam2(@QueryParam("name") String name, @QueryParam("name2") String name2) {
|
||||
return "hello,world!-QueryParam2 " + name + "," + name2;
|
||||
}
|
||||
|
||||
@Path("/FormParam")
|
||||
@GET //表单submit提交里的form参数。 postman 是在body里传参模拟
|
||||
public Response sayHelloFormParam(@FormParam("name") String name) {
|
||||
return Response.ok("hello,world!-FormParam " + name).build();
|
||||
}
|
||||
|
||||
@Path("/MatrixParam")
|
||||
@GET
|
||||
public Response sayHelloMatrixParam(@MatrixParam("name") String name, @MatrixParam("name2") String name2) {
|
||||
return Response.ok("hello,world!-MatrixParam " + name + " " + name2).build();
|
||||
}
|
||||
|
||||
@Path("/DefaultValue")
|
||||
@GET
|
||||
public Response sayHelloDefaultValue(@DefaultValue("name") String name, @DefaultValue("name2") String name2) {
|
||||
name = "abc";
|
||||
name2 = "123";
|
||||
return Response.ok("hello,world!-DefaultValue " + name + " " + name2).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
@Produces({MediaType.APPLICATION_JSON}) //此类后台可以接收json格式的String参数
|
||||
public String sayHelloPostBody(@RequestBody String str) {
|
||||
System.out.println("----------");
|
||||
return "hello,world!- post " + str;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.awspaas.user.bpa.aslp;
|
||||
|
||||
import com.actionsoft.apps.resource.interop.aslp.ASLP;
|
||||
import com.actionsoft.apps.resource.interop.aslp.Meta;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.cc.RDSAPI;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.Map;
|
||||
|
||||
public class RemoveOtherBasicDataAslp implements ASLP {
|
||||
@Override
|
||||
@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'"})
|
||||
public ResponseObject call(Map<String, Object> params) {
|
||||
ResponseObject ro = ResponseObject.newWarnResponse("结果未知");
|
||||
String sid = (String) params.get("sid");
|
||||
if (!SDK.getPortalAPI().checkSession(sid)) {
|
||||
ro = ResponseObject.newErrResponse("sid无效");
|
||||
return ro;
|
||||
}
|
||||
String CC_ID = "58372e80-6456-40d7-9822-ec0f4e2cd7a7";
|
||||
RDSAPI rdsapi;
|
||||
Connection connection = null;
|
||||
rdsapi = SDK.getCCAPI().getRDSAPI(CC_ID);
|
||||
connection = rdsapi.open();
|
||||
int update = DBSql.update("delete from aws_bpa limit 300000");
|
||||
if (update!=0){
|
||||
return ResponseObject.newOkResponse();
|
||||
}else {
|
||||
return ro;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.awspaas.user.bpa.controller;
|
||||
|
||||
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class OpenSlowController {
|
||||
@Mapping("com.actionsoft.apps.openLoadingPage")
|
||||
public String openLoadingPage(UserContext me, String pageType){
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
if(UtilString.isNotEmpty(pageType)){
|
||||
//根据类型跳转不同的页面
|
||||
}
|
||||
//给个默认
|
||||
String targetUrl = "./w?sid="+me.getSessionId()+"&cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=65ba5adc-26f0-4824-9d41-c095d3d0b13a&taskId=";
|
||||
map.put("sid", me.getSessionId());
|
||||
map.put("targetUrl", targetUrl);
|
||||
return HtmlPageTemplate.merge("com.awspaas.user.apps.new_performance_indicator_library", "LoadingPage.html", map);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
public class BatchRefreshKnowJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
DBSql.getMaps("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE" +
|
||||
" ISPUBLISH = 1 AND ISUSE = 1 AND ISSTOP = 0 AND EXT4 IS NULL" +
|
||||
" PLCATEGORY = 'process'and PLMETHODID !='process.framework'" +
|
||||
"and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试'" +
|
||||
",'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试')" +
|
||||
" and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e',"
|
||||
+ " 'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09',"
|
||||
+ " '36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5',"
|
||||
+ " '98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093',"
|
||||
+ " '79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c',"
|
||||
+ " '42c09260-c1d3-44b7-ac3d-f8280e04c294')");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.cache.CacheIndex;
|
||||
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||
import com.actionsoft.bpms.commons.cache.ListValueIndex;
|
||||
import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class DimensionCache extends Cache<String, DimensionModel> {
|
||||
public DimensionCache(CachePluginProfile configuration) {
|
||||
super(configuration);
|
||||
registeIndex(DimensionParentIndex.class, (CacheIndex)new DimensionParentIndex());
|
||||
}
|
||||
|
||||
public List<DimensionModel> getDimensionListOfParent(String parentDimensionId) {
|
||||
List<DimensionModel> list = iteratorToList(getCache().getByIndex(DimensionParentIndex.class, parentDimensionId));
|
||||
return list;
|
||||
}
|
||||
|
||||
protected void load() {
|
||||
DimensionDao dimensionDao = new DimensionDao();
|
||||
IDaoQuery<DimensionModel> iDaoQuery = dimensionDao.query();
|
||||
List<DimensionModel> dimensionModels = iDaoQuery.list();
|
||||
for (DimensionModel dimensionModel : dimensionModels)
|
||||
put(dimensionModel.getId(), (DimensionModel) dimensionModel, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static DimensionCache getCache() {
|
||||
return (DimensionCache)CacheManager.getCache(DimensionCache.class);
|
||||
}
|
||||
|
||||
class DimensionParentIndex extends ListValueIndex<String, DimensionModel> {
|
||||
public String key(DimensionModel t) {
|
||||
return t.getParentId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,160 @@
|
||||
/* */ package com.awspaas.user.bpa.job;
|
||||
/* */
|
||||
/* */ import com.actionsoft.bpms.bo.engine.SQLNullValue;
|
||||
/* */ import com.actionsoft.bpms.commons.database.RowMapper;
|
||||
/* */ import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
||||
/* */ import com.actionsoft.bpms.util.DBSql;
|
||||
/* */ import com.actionsoft.bpms.util.UUIDGener;
|
||||
/* */ import com.actionsoft.bpms.util.UtilString;
|
||||
/* */ import com.actionsoft.exception.AWSDataAccessException;
|
||||
/* */ import com.actionsoft.exception.AWSException;
|
||||
/* */ import java.io.Serializable;
|
||||
/* */ import java.sql.Connection;
|
||||
/* */ import java.sql.ResultSet;
|
||||
/* */ import java.sql.SQLException;
|
||||
/* */ import java.util.HashMap;
|
||||
/* */ import java.util.Iterator;
|
||||
/* */ import java.util.List;
|
||||
/* */ import java.util.Map;
|
||||
/* */
|
||||
/* */ public class DimensionDao extends DaoObject<DimensionModel> {
|
||||
/* */ public int insert(Connection conn, DimensionModel model) throws AWSDataAccessException {
|
||||
/* 40 */ if (UtilString.isEmpty(model.getId()))
|
||||
/* 41 */ model.setId(UUIDGener.getUUID());
|
||||
/* 43 */ Map<String, Object> paraMap = new HashMap<>();
|
||||
/* 44 */ paraMap.put("ID", model.getId());
|
||||
/* 45 */ paraMap.put("DIMENSIONNAME", model.getDimensionName());
|
||||
/* 46 */ paraMap.put("CREATEUSER", model.getCreateUser());
|
||||
/* 47 */ paraMap.put("CREATETIME", model.getCreateTime());
|
||||
/* 48 */ paraMap.put("HOTSPOTDEFID", model.getHotspotDefId());
|
||||
/* 49 */ paraMap.put("ISENABLED", Integer.valueOf(model.getIsEnabled()));
|
||||
/* 50 */ paraMap.put("ISEXAMINE", Integer.valueOf(model.getIsExamine()));
|
||||
/* 52 */ if (model.getMemo() == null) {
|
||||
/* 53 */ paraMap.put("MEMO", SQLNullValue.newInstance(12));
|
||||
/* */ } else {
|
||||
/* 55 */ paraMap.put("MEMO", model.getMemo());
|
||||
/* */ }
|
||||
/* 58 */ paraMap.put("PARENTID", model.getParentId());
|
||||
/* 59 */ paraMap.put("SHOWTYPE", Integer.valueOf(model.getShowType()));
|
||||
/* 61 */ if (model.getLastUpdate() == null) {
|
||||
/* 62 */ paraMap.put("LASTUPDATE", SQLNullValue.newInstance(91));
|
||||
/* */ } else {
|
||||
/* 64 */ paraMap.put("LASTUPDATE", model.getLastUpdate());
|
||||
/* */ }
|
||||
/* 67 */ paraMap.put("ORDERINDEX", Integer.valueOf(model.getOrderIndex()));
|
||||
/* 69 */ int result = 0;
|
||||
/* 70 */ if (conn == null) {
|
||||
/* 71 */ result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap);
|
||||
/* */ } else {
|
||||
/* 73 */ result = DBSql.update(conn, DBSql.getInsertStatement(entityName(), paraMap), paraMap);
|
||||
/* */ }
|
||||
/* 75 */ if (result == 1)
|
||||
/* 76 */ DimensionCache.getCache().put(model.getId(), (DimensionModel) model);
|
||||
/* 78 */ return result;
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public int insert(DimensionModel model) throws AWSDataAccessException {
|
||||
/* 83 */ return insert((Connection)null, model);
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public int update(Connection conn, DimensionModel model) throws AWSDataAccessException {
|
||||
/* 96 */ if (UtilString.isEmpty(model.getId()))
|
||||
/* 97 */ throw new AWSDataAccessException("Method getId() Does Not Allow Empty");
|
||||
/* 99 */ Map<String, Object> paraMap = new HashMap<>();
|
||||
/* 100 */ paraMap.put("DIMENSIONNAME", model.getDimensionName());
|
||||
/* 101 */ paraMap.put("CREATEUSER", model.getCreateUser());
|
||||
/* 102 */ paraMap.put("CREATETIME", model.getCreateTime());
|
||||
/* 103 */ paraMap.put("HOTSPOTDEFID", model.getHotspotDefId());
|
||||
/* 104 */ paraMap.put("ISENABLED", Integer.valueOf(model.getIsEnabled()));
|
||||
/* 105 */ paraMap.put("ISEXAMINE", Integer.valueOf(model.getIsExamine()));
|
||||
/* 106 */ paraMap.put("MEMO", model.getMemo());
|
||||
/* 107 */ paraMap.put("PARENTID", model.getParentId());
|
||||
/* 108 */ paraMap.put("SHOWTYPE", Integer.valueOf(model.getShowType()));
|
||||
/* 109 */ if (model.getLastUpdate() == null) {
|
||||
/* 110 */ paraMap.put("LASTUPDATE", SQLNullValue.newInstance(91));
|
||||
/* */ } else {
|
||||
/* 112 */ paraMap.put("LASTUPDATE", model.getLastUpdate());
|
||||
/* */ }
|
||||
/* 115 */ paraMap.put("ORDERINDEX", Integer.valueOf(model.getOrderIndex()));
|
||||
/* 117 */ int result = 0;
|
||||
/* 118 */ if (conn == null) {
|
||||
/* 119 */ result = update(model.getId(), paraMap);
|
||||
/* */ } else {
|
||||
/* 121 */ result = update(conn, model.getId(), paraMap);
|
||||
/* */ }
|
||||
/* 123 */ if (result == 1)
|
||||
/* 124 */ DimensionCache.getCache().put(model.getId(), (DimensionModel) model);
|
||||
/* 126 */ return result;
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public int update(DimensionModel model) throws AWSDataAccessException {
|
||||
/* 131 */ return update((Connection)null, model);
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public String entityName() {
|
||||
/* 136 */ return "APP_ACT_KMS_DIMENSION";
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public RowMapper<DimensionModel> rowMapper() {
|
||||
/* 141 */ return new RowMapper<DimensionModel>() {
|
||||
/* */ public DimensionModel mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
/* 144 */ return DimensionDao.this.record2Model(rs);
|
||||
/* */ }
|
||||
/* */ };
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public DimensionModel record2Model(ResultSet rs) {
|
||||
/* 150 */ DimensionModel dimensionModel = new DimensionModel();
|
||||
/* */ try {
|
||||
/* 152 */ dimensionModel.setId(rs.getString("ID"));
|
||||
/* 153 */ dimensionModel.setCreateTime(rs.getTimestamp("CREATETIME"));
|
||||
/* 154 */ dimensionModel.setCreateUser(rs.getString("CREATEUSER"));
|
||||
/* 155 */ dimensionModel.setDimensionName(rs.getString("DIMENSIONNAME"));
|
||||
/* 156 */ dimensionModel.setHotspotDefId(rs.getString("HOTSPOTDEFID"));
|
||||
/* 157 */ dimensionModel.setIsEnabled(rs.getInt("ISENABLED"));
|
||||
/* 158 */ dimensionModel.setIsExamine(rs.getInt("ISEXAMINE"));
|
||||
/* 159 */ dimensionModel.setLastUpdate(rs.getTimestamp("LASTUPDATE"));
|
||||
/* 160 */ dimensionModel.setMemo(rs.getString("MEMO"));
|
||||
/* 161 */ String parentId = rs.getString("PARENTID");
|
||||
/* 162 */ dimensionModel.setParentId((parentId == null) ? "" : parentId.trim());
|
||||
/* 163 */ dimensionModel.setShowType(rs.getInt("SHOWTYPE"));
|
||||
/* 164 */ dimensionModel.setOrderIndex(rs.getInt("ORDERINDEX"));
|
||||
/* 165 */ } catch (Exception e) {
|
||||
/* 166 */ e.printStackTrace();
|
||||
/* 167 */ throw new AWSException(e);
|
||||
/* */ }
|
||||
/* 169 */ return dimensionModel;
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public int delete(List<String> dimensionIdList) throws AWSDataAccessException {
|
||||
/* 182 */ StringBuilder sqlWhere = new StringBuilder("(");
|
||||
/* 183 */ for (int i = 0; i < dimensionIdList.size(); i++)
|
||||
/* 184 */ sqlWhere.append("'" + (String)dimensionIdList.get(i) + "',");
|
||||
/* 186 */ String sqlWhere1 = sqlWhere.substring(0, sqlWhere.lastIndexOf(","));
|
||||
/* 187 */ sqlWhere1 = sqlWhere1 + ")";
|
||||
/* 188 */ String sql = "DELETE FROM " + entityName() + " WHERE " + pkFieldName() + " IN " + sqlWhere1;
|
||||
/* 190 */ int result = DBSql.update(sql);
|
||||
/* 192 */ DimensionCache dimensionCache = DimensionCache.getCache();
|
||||
/* 193 */ for (String id : dimensionIdList)
|
||||
/* 194 */ dimensionCache.remove(id);
|
||||
/* 196 */ return result;
|
||||
/* */ }
|
||||
/* */
|
||||
/* */ public void fillDescendantDimensions(String id, List<String> dimensionIds) {
|
||||
/* 207 */ Iterator<DimensionModel> iterator = DimensionCache.getCache().iterator();
|
||||
/* 208 */ while (iterator.hasNext()) {
|
||||
/* 209 */ DimensionModel dimensionModel = iterator.next();
|
||||
/* 210 */ if (id.equals(dimensionModel.getParentId())) {
|
||||
/* 211 */ dimensionIds.add(dimensionModel.getId());
|
||||
/* 212 */ String id1 = dimensionModel.getId();
|
||||
/* 213 */ fillDescendantDimensions(id1, dimensionIds);
|
||||
/* */ }
|
||||
/* */ }
|
||||
/* */ }
|
||||
/* */ }
|
||||
|
||||
|
||||
/* Location: C:\Users\12976\Desktop\com.actionsoft.apps.kms.jar!\com\actionsoft\apps\kms\dao\DimensionDao.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.1.3
|
||||
*/
|
||||
@ -0,0 +1,184 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.bpms.commons.mvc.model.IModelBean;
|
||||
import com.actionsoft.bpms.commons.mvc.model.ModelBean;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class DimensionModel extends ModelBean implements IModelBean, Cloneable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String ID = "ID";
|
||||
|
||||
public static final String DIMENSIONNAME = "DIMENSIONNAME";
|
||||
|
||||
public static final String PARENTID = "PARENTID";
|
||||
|
||||
public static final String SHOWTYPE = "SHOWTYPE";
|
||||
|
||||
public static final String ISEXAMINE = "ISEXAMINE";
|
||||
|
||||
public static final String MEMO = "MEMO";
|
||||
|
||||
public static final String CREATEUSER = "CREATEUSER";
|
||||
|
||||
public static final String CREATETIME = "CREATETIME";
|
||||
|
||||
public static final String LASTUPDATE = "LASTUPDATE";
|
||||
|
||||
public static final String HOTSPOTDEFID = "HOTSPOTDEFID";
|
||||
|
||||
public static final String ISENABLED = "ISENABLED";
|
||||
|
||||
public static final String ORDERINDEX = "ORDERINDEX";
|
||||
|
||||
private String id;
|
||||
|
||||
private String dimensionName;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private int showType;
|
||||
|
||||
private int isExamine;
|
||||
|
||||
private String memo;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp lastUpdate;
|
||||
|
||||
private String hotspotDefId;
|
||||
|
||||
private int isEnabled;
|
||||
|
||||
private int orderIndex;
|
||||
|
||||
private boolean hasPerm = true;
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDimensionName() {
|
||||
if (this.dimensionName == null)
|
||||
/* 55 */ this.dimensionName = "";
|
||||
/* 57 */ return this.dimensionName;
|
||||
}
|
||||
|
||||
public void setDimensionName(String dimensionName) {
|
||||
/* 61 */ this.dimensionName = dimensionName;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
/* 65 */ if (this.parentId == null)
|
||||
/* 66 */ this.parentId = "";
|
||||
/* 68 */ return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
/* 72 */ this.parentId = parentId;
|
||||
}
|
||||
|
||||
public int getShowType() {
|
||||
/* 76 */ return this.showType;
|
||||
}
|
||||
|
||||
public void setShowType(int showType) {
|
||||
/* 80 */ this.showType = showType;
|
||||
}
|
||||
|
||||
public int getIsExamine() {
|
||||
/* 84 */ return this.isExamine;
|
||||
}
|
||||
|
||||
public void setIsExamine(int isExamine) {
|
||||
/* 88 */ this.isExamine = isExamine;
|
||||
}
|
||||
|
||||
public String getMemo() {
|
||||
/* 92 */ if (this.memo == null)
|
||||
/* 93 */ this.memo = "";
|
||||
/* 95 */ return this.memo;
|
||||
}
|
||||
|
||||
public void setMemo(String memo) {
|
||||
/* 99 */ this.memo = memo;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
/* 103 */ if (this.createUser == null)
|
||||
/* 104 */ this.createUser = "";
|
||||
/* 106 */ return this.createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
/* 110 */ this.createUser = createUser;
|
||||
}
|
||||
|
||||
public Timestamp getCreateTime() {
|
||||
/* 114 */ return this.createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Timestamp createTime) {
|
||||
/* 118 */ this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdate() {
|
||||
/* 122 */ return this.lastUpdate;
|
||||
}
|
||||
|
||||
public void setLastUpdate(Timestamp lastUpdate) {
|
||||
/* 126 */ this.lastUpdate = lastUpdate;
|
||||
}
|
||||
|
||||
public String getHotspotDefId() {
|
||||
/* 130 */ if (this.hotspotDefId == null)
|
||||
/* 131 */ this.hotspotDefId = "";
|
||||
/* 133 */ return this.hotspotDefId;
|
||||
}
|
||||
|
||||
public void setHotspotDefId(String hotspotDefId) {
|
||||
/* 137 */ this.hotspotDefId = hotspotDefId;
|
||||
}
|
||||
|
||||
public int getIsEnabled() {
|
||||
/* 141 */ return this.isEnabled;
|
||||
}
|
||||
|
||||
public void setIsEnabled(int isEnabled) {
|
||||
/* 145 */ this.isEnabled = isEnabled;
|
||||
}
|
||||
|
||||
public int getOrderIndex() {
|
||||
/* 149 */ return this.orderIndex;
|
||||
}
|
||||
|
||||
public void setOrderIndex(int orderIndex) {
|
||||
/* 153 */ this.orderIndex = orderIndex;
|
||||
}
|
||||
|
||||
public boolean isHasPerm() {
|
||||
/* 157 */ return this.hasPerm;
|
||||
}
|
||||
|
||||
public void setHasPerm(boolean hasPerm) {
|
||||
/* 161 */ this.hasPerm = hasPerm;
|
||||
}
|
||||
|
||||
public DimensionModel clone() {
|
||||
try {
|
||||
/* 167 */ return (DimensionModel)super.clone();
|
||||
/* 168 */ } catch (CloneNotSupportedException e) {
|
||||
/* 169 */ e.printStackTrace();
|
||||
/* 170 */ return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,155 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.commons.login.constant.LoginConst;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.server.SSOUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class KnowMoveOther implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
//UserContext uc = UserContext.fromUID("admin");
|
||||
String sessionId = new SSOUtil().registerClientSessionNoPassword("admin", LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
|
||||
List<PALRepositoryModel> palRepositoryModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getAllCoeProcessLevelByWsId("7d3ca852-a0bd-42e6-80b1-3dcea6f55083");
|
||||
if (palRepositoryModels.size()>0){
|
||||
for (PALRepositoryModel palRepositoryModel:
|
||||
palRepositoryModels) {
|
||||
boolean publish = palRepositoryModel.isPublish();
|
||||
if (publish) {
|
||||
//in ('org.role','data.form','process.flowchart','process.epc','control.policy','process.evc','control.kpi')
|
||||
if (palRepositoryModel.getMethodId().equals("org.role") ||
|
||||
palRepositoryModel.getMethodId().equals("data.form") ||
|
||||
palRepositoryModel.getMethodId().equals("process.flowchart") ||
|
||||
palRepositoryModel.getMethodId().equals("process.epc") ||
|
||||
palRepositoryModel.getMethodId().equals("control.policy") ||
|
||||
palRepositoryModel.getMethodId().equals("process.evc") ||
|
||||
palRepositoryModel.getMethodId().equals("control.kpi")) {
|
||||
String ext4 = palRepositoryModel.getExt4();
|
||||
if (ext4 != null) {
|
||||
String pal_sql = "select * from APP_ACT_COE_PAL_REPOSITORY where ID = '" + palRepositoryModel.getId() + "'";
|
||||
RowMap map = DBSql.getMap(pal_sql);
|
||||
if (map != null) {
|
||||
String parentId = map.getString("PLPARENTID");
|
||||
System.err.println("parentId>>>>>>>>>>>>>>>>" + parentId);
|
||||
//PALRepositoryModel palRepositoryModel_parent = PALRepositoryCache.getCache().get(parentId);
|
||||
String pal_parent_sql = "select * from APP_ACT_COE_PAL_REPOSITORY where ID = '" + parentId + "'";
|
||||
RowMap ext41 = DBSql.getMap(pal_parent_sql);
|
||||
if (ext41 != null) {
|
||||
|
||||
String parent_sql = "select DIMENSIONID FROM APP_ACT_KMS_PUBLISH WHERE CARDID = '" + ext4 + "'";
|
||||
String parent_demensionid = DBSql.getString(parent_sql);
|
||||
if (parent_demensionid.equals(ext41.getString("EXT4"))) {
|
||||
|
||||
} else {
|
||||
System.out.println("PLname>>>>>>>>>>>>>>"+palRepositoryModel.getName());
|
||||
//先取消发布知识
|
||||
execute(sessionId, ext4);
|
||||
JSONArray dimensionIDArray = new JSONArray(new LinkedList<>());
|
||||
dimensionIDArray.add(ext41.getString("EXT4"));
|
||||
JSONArray knwlIDArray = new JSONArray(new LinkedList<>());
|
||||
knwlIDArray.add(ext4);
|
||||
publishKnow(dimensionIDArray, knwlIDArray, sessionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
String name = palRepositoryModel.getName();
|
||||
double version = palRepositoryModel.getVersion();
|
||||
BigDecimal bd = new BigDecimal(version);
|
||||
String versions = bd.setScale(1, BigDecimal.ROUND_DOWN).toString();
|
||||
String card_name = name+"V"+versions;
|
||||
String card_sql = "select * from APP_ACT_KMS_card where cardname = '"+card_name+"'";
|
||||
RowMap map = DBSql.getMap(card_sql);
|
||||
if (map!=null){
|
||||
String id = map.getString("ID");
|
||||
int update = DBSql.update("update APP_ACT_COE_PAL_REPOSITORY set EXT4 = '" + id + "' where id = '" + palRepositoryModel.getId() + "'");
|
||||
System.out.println("更新空的EXT4到pal资产库中"+update);
|
||||
//先取消发布知识
|
||||
String pal_sql = "select * from APP_ACT_COE_PAL_REPOSITORY where ID = '" + palRepositoryModel.getId() + "'";
|
||||
RowMap mapss = DBSql.getMap(pal_sql);
|
||||
String parentId = mapss.getString("PLPARENTID");
|
||||
System.err.println("palRepositoryModel.getId()>>>>>>>>>>>>>>>>"+palRepositoryModel.getId()+">>>>>>>>>>>>parentId>>>>>>>>>>>>>>>>" + parentId);
|
||||
//PALRepositoryModel palRepositoryModel_parent = PALRepositoryCache.getCache().get(parentId);
|
||||
String pal_parent_sql = "select * from APP_ACT_COE_PAL_REPOSITORY where ID = '" + parentId + "'";
|
||||
RowMap ext41 = DBSql.getMap(pal_parent_sql);
|
||||
System.out.println("PLname>>>>>>>>>>>>>>"+palRepositoryModel.getName());
|
||||
execute(sessionId, id);
|
||||
JSONArray dimensionIDArray = new JSONArray(new LinkedList<>());
|
||||
dimensionIDArray.add(ext41.getString("EXT4"));
|
||||
JSONArray knwlIDArray = new JSONArray(new LinkedList<>());
|
||||
knwlIDArray.add(id);
|
||||
publishKnow(dimensionIDArray, knwlIDArray, sessionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 先取消发布知识,然后重新发布知识
|
||||
* @param sid
|
||||
* @param knwlId
|
||||
*/
|
||||
public void execute(String sid,String knwlId) {
|
||||
// 调用App
|
||||
String sourceAppId = "com.awspaas.user.apps.new_performance_indicator_library";
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.kms/CancelPublishKnwl";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
//sid,如果为空,则需要传createUser参数,非必填
|
||||
params.put("sid", sid);
|
||||
//知识ID,必填
|
||||
params.put("knwlId", knwlId);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//取消发布知识(全部维度)
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
boolean ok = ro.isOk();
|
||||
System.out.println("取消发布成功>>>>>>>>>>"+ok);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布知识
|
||||
* @return
|
||||
*/
|
||||
public void publishKnow(JSONArray dimensionIDArray,JSONArray knwlIDArray,String sid) {
|
||||
// 调用App
|
||||
String sourceAppId = "com.awspaas.user.apps.new_performance_indicator_library";
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.kms/PublishKnwl";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
//要发布到的维度ID的JSON数组字符串,必填
|
||||
params.put("dimensionIDArray", dimensionIDArray);
|
||||
|
||||
//要发布的知识ID的JSON数组字符串,必填
|
||||
params.put("knwlIDArray", knwlIDArray);
|
||||
//sid,必填
|
||||
params.put("sid", sid);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//发布知识
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
boolean ok = ro.isOk();
|
||||
System.out.println("移动知识文件>>>>>>>>>"+ro);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RemovedimensionJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
String dimension_sql = "select * from APP_ACT_KMS_DIMENSION where ID not IN ('obj_6adcee05d6f740868b2ef901dbeb85ee') and ID != 'obj_6adcee05d6f740868b2ef901dbeb85ee'";
|
||||
List<RowMap> maps = DBSql.getMaps(dimension_sql);
|
||||
for (RowMap map: maps) {
|
||||
String id = map.getString("ID");
|
||||
List<RowMap> maps1 = DBSql.getMaps("select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '" + id + "'");
|
||||
System.out.println("maps1>>>>>>>>>>>>>>>>"+maps1);
|
||||
if (maps1.size()>0){
|
||||
|
||||
}else {
|
||||
int update = DBSql.update("delete from APP_ACT_KMS_DIMENSION where ID = '" + id + "'");
|
||||
System.out.println("删除无用的知识维度>>>>>>>>>>>>>>>"+update+"><<<<<<<<<<<<"+map.getString("DIMENSIONNAME"));
|
||||
//DimensionCache.getCache().reload();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,221 @@
|
||||
package com.awspaas.user.bpa.job;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.cc.RDSAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.bpa.util.UtilUrls;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Connection;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class SaveMoreData implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
|
||||
String CC_ID = "58372e80-6456-40d7-9822-ec0f4e2cd7a7";
|
||||
RDSAPI rdsapi;
|
||||
Connection connection = null;
|
||||
rdsapi = SDK.getCCAPI().getRDSAPI(CC_ID);
|
||||
connection = rdsapi.open();
|
||||
|
||||
DBSql.update("delete from BO_EU_BPA_SPAN");
|
||||
List<RowMap> maps = DBSql.getMaps("select * from APP_ACT_BPAD_P_VER_ACTIVITY order by CAST(EXT1 as int) asc");
|
||||
|
||||
JSONArray jsonArray_new = new JSONArray(new LinkedList<>());
|
||||
JSONObject jsonObject = new JSONObject(new LinkedHashMap());
|
||||
List<BO> boss = SDK.getBOAPI().query("BO_EU_OTHER_SYSTEM_PAGE", true).addQuery("WORKFLOWID = ", maps.get(0).getString("ID").trim()).orderBy("PAGES").desc().list();
|
||||
/*if (boss!=null&&boss.size()>0){
|
||||
String pages = boss.get(0).getString("PAGES");
|
||||
last_page = Integer.parseInt(pages);
|
||||
size = last_page+1;
|
||||
}else {
|
||||
String soap_page = SDK.getAppAPI().getProperty("com.awspaas.user.apps.performance_indicator_library", "soap_page");//这里是获取配置的SOAP接口传的多少页,如果3500左右不够可以自行往上增加
|
||||
|
||||
size = Integer.valueOf(soap_page);
|
||||
}*/
|
||||
|
||||
for (int c= 0;c<maps.size();c++) {
|
||||
int size = 2;
|
||||
int last_page = 1;
|
||||
String soap_page = SDK.getAppAPI().getProperty("com.awspaas.user.apps.performance_indicator_library", "soap_page");//这里是获取配置的SOAP接口传的多少页,如果3500左右不够可以自行往上增加
|
||||
size = Integer.valueOf(soap_page);
|
||||
for (int j = last_page; j < size; j++) {
|
||||
|
||||
int tale = Integer.valueOf(maps.get(c).getString("ID").trim());
|
||||
|
||||
jsonObject.put("workflowId", tale);
|
||||
// jsonObject.put("workflowId",bo.getString("WORKFLOWID"));
|
||||
//jsonObject.put("createDateStart","2019-07-01 00:00:00");//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
|
||||
//jsonObject.put("createDateEnd","2023-09-01 00:00:00");//processExecutionContext.getProcessInstance().getCreateUser()
|
||||
jsonObject.put("pageIndex", j);
|
||||
jsonObject.put("pageSize", 1000);
|
||||
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" +
|
||||
" <soapenv:Header/>" +
|
||||
" <soapenv:Body>" +
|
||||
" <web:getFlowListByWfId>" +
|
||||
" <web:in0>" +
|
||||
"" + jsonObject + "" +
|
||||
" </web:in0>" +
|
||||
" </web:getFlowListByWfId>" +
|
||||
" </soapenv:Body>" +
|
||||
"</soapenv:Envelope>";
|
||||
|
||||
System.out.println("参数===============" + xmlStr);
|
||||
//System.out.println("参数==============="+xmls);
|
||||
//HttpClientUtil httpClientUtil = new HttpClientUtil();
|
||||
int timeout = 600000;
|
||||
// HttpURLConnection 发送SOAP请求
|
||||
System.out.println("HttpURLConnection 发送SOAP请求");
|
||||
|
||||
String postSoap = UtilUrls.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, "");
|
||||
|
||||
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(postSoap);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
/*
|
||||
System.out.println("resultString=>>>>>>>>>>"+resultString);
|
||||
*/
|
||||
//if (!StringUtils.isEmpty(resultString)){
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("datas");
|
||||
JSONArray jsonArray = JSONArray.parseArray(datas);
|
||||
System.out.println("jsonArray>>>>>>>>>>>>>"+jsonArray.size());
|
||||
if (jsonArray != null && jsonArray.size() != 0) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
// JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId")
|
||||
JSONObject end_process = new JSONObject(new LinkedHashMap<>());
|
||||
end_process.put("processinstid", JSONObject.parseObject(jsonArray.get(i).toString()).get("requestId").toString().trim());//流程实例id
|
||||
end_process.put("processdefid", JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId").toString().trim());//流程定义id
|
||||
RowMap workflowId = DBSql.getMap("select * from APP_ACT_BPAD_P_VER_ACTIVITY where ID = '" + JSONObject.parseObject(jsonArray.get(i).toString()).get("workflowId") + "'");
|
||||
if (workflowId!=null) {
|
||||
end_process.put("processdefverid", workflowId.getString("PROCESSVERSION"));//流程版本定义
|
||||
} else {
|
||||
end_process.put("processdefverid", "1");
|
||||
}
|
||||
end_process.put("starttime", JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));//开始时间
|
||||
end_process.put("endtime", JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate"));//结束时间
|
||||
end_process.put("createtime", JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));//创建时间
|
||||
|
||||
|
||||
UserModel operatorWorkCode = SDK.getORGAPI().getUser(JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode").toString());
|
||||
if (operatorWorkCode != null) {
|
||||
end_process.put("createuser", JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode"));//创建人
|
||||
UserContext userContext = UserContext.fromUID(JSONObject.parseObject(jsonArray.get(i).toString()).get("operatorWorkCode").toString());
|
||||
end_process.put("createuserorgid", userContext.getCompanyModel().getId());//公司id
|
||||
end_process.put("createuserdeptid", userContext.getDepartmentModel().getId());//部门id
|
||||
end_process.put("createuserroleid", userContext.getRoleModel().getId());//角色id
|
||||
} else {
|
||||
end_process.put("createuser", "admin");//创建人
|
||||
UserContext userContext = UserContext.fromUID("admin");
|
||||
end_process.put("createuserorgid", userContext.getCompanyModel().getId());//公司id
|
||||
end_process.put("createuserdeptid", userContext.getDepartmentModel().getId());//部门id
|
||||
end_process.put("createuserroleid", userContext.getRoleModel().getId());//角色id
|
||||
}
|
||||
end_process.put("activitydefid", JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeName").toString());//角色id
|
||||
|
||||
if (JSONObject.parseObject(jsonArray.get(i).toString()).get("status").equals("未操作")){
|
||||
end_process.put("controlstate","active");
|
||||
end_process.put("state", "1");
|
||||
}else if (JSONObject.parseObject(jsonArray.get(i).toString()).get("status").equals("提交")||JSONObject.parseObject(jsonArray.get(i).toString()).get("status").equals("归档")){
|
||||
end_process.put("controlstate","complete");
|
||||
end_process.put("state", "1");
|
||||
}
|
||||
end_process.put("begintime", JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate"));//开始时间
|
||||
end_process.put("taskinstid", JSONObject.parseObject(jsonArray.get(i).toString()).get("id"));//流程实例id
|
||||
|
||||
end_process.put("actionname", JSONObject.parseObject(jsonArray.get(i).toString()).get("nodeName"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date beginDate = null;
|
||||
try {
|
||||
beginDate = sdf.parse(JSONObject.parseObject(jsonArray.get(i).toString()).get("operateDate").toString());
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (UtilString.isNotEmpty(JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate").toString())) {
|
||||
Date endDate = null;
|
||||
try {
|
||||
endDate = sdf.parse(JSONObject.parseObject(jsonArray.get(i).toString()).get("receiveDate").toString());
|
||||
if (endDate!=null){
|
||||
long dates = (endDate.getTime() - beginDate.getTime()) / (1000 * 60*60);
|
||||
end_process.put("executecosttime", dates);//开始时间-结束时间如果结束时间为空,则这个时间也为空
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
end_process.put("executecosttime", "");//开始时间-结束时间如果结束时间为空,则这个时间也为空
|
||||
}
|
||||
end_process.put("timedur", "");
|
||||
end_process.put("warningtimedur", "");
|
||||
String id = UUIDGener.getUUID();
|
||||
String sql = "insert into aws_bpa (ID,processinstid,processdefid,processdefverid,starttime,endtime," +
|
||||
"createtime,createuser," +
|
||||
"createuserorgid,createuserdeptid,createuserroleid," +
|
||||
"controlstate,executecosttime,timedur,warningtimedur" +
|
||||
",actionname,activitydefid,begintime,state,taskinstid" +
|
||||
") values ('"+id+"', '"+end_process.getString("processinstid")+"', " +
|
||||
"'"+end_process.getString("processdefid")+"'," +
|
||||
" '"+end_process.getString("processdefverid")+"'," +
|
||||
" '"+end_process.getString("starttime")+"', " +
|
||||
"'"+end_process.getString("endtime")+"'," +
|
||||
"'"+end_process.getString("createtime")+"'" +
|
||||
",'"+end_process.getString("createuser")+"'" +
|
||||
",'"+end_process.getString("createuserorgid")+"'," +
|
||||
"'"+end_process.getString("createuserdeptid")+"'" +
|
||||
",'"+end_process.getString("createuserroleid")+"'," +
|
||||
"'"+end_process.getString("controlstate")+"'," +
|
||||
"'"+end_process.getString("executecosttime")+"'," +
|
||||
"'"+end_process.getString("timedur")+"'," +
|
||||
"'"+end_process.getString("warningtimedur")+"'," +
|
||||
"'"+end_process.getString("actionname")+"'" +
|
||||
",'"+end_process.getString("activitydefid")+" '," +
|
||||
"'"+end_process.getString("createtime")+"'," +
|
||||
"'"+ end_process.getString("state")+"'" +
|
||||
",'"+end_process.getString("taskinstid")+"')";
|
||||
|
||||
int update = DBSql.update(connection, sql
|
||||
);
|
||||
System.out.println("是否插入一条数据>>>>>>>>>>" + update);
|
||||
BO bo = new BO();
|
||||
bo.set("STATE",JSONObject.parseObject(jsonArray.get(i).toString()).get("status"));
|
||||
SDK.getBOAPI().createDataBO("BO_EU_BPA_SPAN",bo,UserContext.fromUID("admin"));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -199,7 +199,7 @@ public class UpdateSreJob implements IJob {
|
||||
dataMap.put("NODECATEGORY", PLMETHODID);
|
||||
dataMap.put("ITSYSVAL", ITSYSVAL);
|
||||
dataMap.put("ACTIVITYNUMBER", ACTIVITYNUMBER);
|
||||
dataMap.put("ACTIVITYDESC", ACTIVITYDESC);
|
||||
// dataMap.put("ACTIVITYDESC", ACTIVITYDESC);
|
||||
dataMap.put("ROLE", ROLE);
|
||||
dataMap.put("ROLENAME", ROLENAME);
|
||||
dataMap.put("POST", POST);
|
||||
@ -211,7 +211,7 @@ public class UpdateSreJob implements IJob {
|
||||
try {
|
||||
DBSql.update("UPDATE BO_EU_PAL_FILENODE6 SET"
|
||||
+ " NODENAME=:NODENAME, NODETYPE=:NODETYPE, PLNAME=:PLNAME, NODECATEGORY=:NODECATEGORY, ITSYSVAL=:ITSYSVAL, "
|
||||
+ " ACTIVITYNUMBER=:ACTIVITYNUMBER, ACTIVITYDESC=:ACTIVITYDESC, ROLE=:ROLE, POST=:POST, ROLENAME=:ROLENAME, POSTNAME=:POSTNAME, MODIFYDATETIME=:MODIFYDATETIME, UPDATEDATE=:UPDATEDATE "
|
||||
+ " ACTIVITYNUMBER=:ACTIVITYNUMBER, ROLE=:ROLE, POST=:POST, ROLENAME=:ROLENAME, POSTNAME=:POSTNAME, MODIFYDATETIME=:MODIFYDATETIME, UPDATEDATE=:UPDATEDATE "
|
||||
+ " WHERE PLID=:PLID AND NODEID=:NODEID", dataMap);
|
||||
} catch (Exception e) {
|
||||
BO bo = new BO();
|
||||
@ -235,7 +235,7 @@ public class UpdateSreJob implements IJob {
|
||||
dataMap.put("NODECATEGORY", PLMETHODID);
|
||||
dataMap.put("ITSYSVAL", ITSYSVAL);
|
||||
dataMap.put("ACTIVITYNUMBER", ACTIVITYNUMBER);
|
||||
dataMap.put("ACTIVITYDESC", ACTIVITYDESC);
|
||||
// dataMap.put("ACTIVITYDESC", ACTIVITYDESC);
|
||||
dataMap.put("ROLE", ROLE);
|
||||
dataMap.put("POST", POST);
|
||||
dataMap.put("ROLENAME", ROLENAME);
|
||||
@ -245,8 +245,8 @@ public class UpdateSreJob implements IJob {
|
||||
//System.err.println("同步节点信息===========>"+dataMap);
|
||||
try {
|
||||
DBSql.update("INSERT INTO BO_EU_PAL_FILENODE6"
|
||||
+ " (ID, NODEID, NODENAME, NODETYPE, PLID, PLNAME, NODECATEGORY, ITSYSVAL, ACTIVITYNUMBER, ACTIVITYDESC, ROLE, POST, ROLENAME, POSTNAME, MODIFYDATETIME) "
|
||||
+ " VALUES(:uuId, :NODEID, :NODENAME, :NODETYPE, :PLID, :PLNAME, :NODECATEGORY, :ITSYSVAL, :ACTIVITYNUMBER, :ACTIVITYDESC, :ROLE, :POST, :ROLENAME, :POSTNAME, :MODIFYDATETIME)", dataMap);
|
||||
+ " (ID, NODEID, NODENAME, NODETYPE, PLID, PLNAME, NODECATEGORY, ITSYSVAL, ACTIVITYNUMBER, ROLE, POST, ROLENAME, POSTNAME, MODIFYDATETIME) "
|
||||
+ " VALUES(:uuId, :NODEID, :NODENAME, :NODETYPE, :PLID, :PLNAME, :NODECATEGORY, :ITSYSVAL, :ACTIVITYNUMBER, :ROLE, :POST, :ROLENAME, :POSTNAME, :MODIFYDATETIME)", dataMap);
|
||||
} catch (Exception e) {
|
||||
BO bo = new BO();
|
||||
bo.set("PLID", FILEID);
|
||||
|
||||
@ -6,6 +6,7 @@ import com.actionsoft.apps.resource.plugin.profile.ASLPPluginProfile;
|
||||
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
|
||||
import com.actionsoft.apps.resource.plugin.profile.AtFormulaPluginProfile;
|
||||
import com.actionsoft.apps.resource.plugin.profile.HttpASLP;
|
||||
import com.awspaas.user.bpa.aslp.RemoveOtherBasicDataAslp;
|
||||
import com.awspaas.user.bpa.aslp.UpdatePptxAndExcelAslp;
|
||||
import com.awspaas.user.bpa.at.GetOrgPostByName;
|
||||
import com.awspaas.user.bpa.at.getSJNumsByprocess;
|
||||
@ -25,6 +26,7 @@ public class Plugins implements PluginListener {
|
||||
getSJNumsByprocess.class.getName(), "获取已阅和待阅的总人数", "获取已阅和待阅的总人数"));
|
||||
|
||||
list.add(new ASLPPluginProfile("UpdatePptxAndExcelAslp", UpdatePptxAndExcelAslp.class.getName(), "根据上传的文件进行更新相关的excel或者ppt", (HttpASLP)null));
|
||||
list.add(new ASLPPluginProfile("RemoveOtherBasicDataAslp", RemoveOtherBasicDataAslp.class.getName(), "删除指定的三十万数据", (HttpASLP)null));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user