118 lines
5.2 KiB
Java
118 lines
5.2 KiB
Java
package com.awspaas.user.bpa.controller;
|
|
|
|
import com.actionsoft.bpms.bo.engine.BO;
|
|
import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance;
|
|
import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance;
|
|
import com.actionsoft.bpms.commons.database.RowMap;
|
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
|
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.DBSql;
|
|
import com.actionsoft.sdk.local.SDK;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.awspaas.user.bpa.util.PalUtil;
|
|
|
|
@Controller
|
|
public class GetOpenDataController {
|
|
@Mapping("com.awspaas.user.bpa.controller.GetOpenDataController.getHtmlPage")
|
|
//./w?sid=@sid&cmd=CLIENT_BPM_WORKLIST_PROCESSINST_CREATE_AJAX_PREPAGE&processGroupId=obj_049cd0b7cd864c078ae35e4a79dc0a76&processDefId=obj_19f3b1d5083841a6a44af73400d5305e
|
|
public String getHtmlPage(String sid,String processDefId){
|
|
ResponseObject ro = ResponseObject.newOkResponse();
|
|
UserContext userContext = UserContext.fromSessionId(sid);
|
|
ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance(processDefId, userContext.getUID(), "");
|
|
//SDK.getProcessAPI().start(processInstance);
|
|
TaskInstance taskInst = SDK.getProcessAPI().start(processInstance).fetchActiveTasks().get(0);
|
|
String formPage = SDK.getFormAPI().getFormPage(userContext, processInstance, taskInst, 1, 1, null, null);
|
|
return formPage;
|
|
}
|
|
|
|
|
|
// @Mapping("COE_PAL_OUTPUTREPORT_JSON_DATA")
|
|
@Mapping("com.actionsoft.apps.bpa.pal_report_json_data")
|
|
public String COEPALOutPutReportJsonData(UserContext me, String language, String templateOperate) {
|
|
PalUtil outPutReport = new PalUtil();
|
|
return outPutReport.jsonData(me.getSessionId(),language, templateOperate);
|
|
}
|
|
|
|
|
|
@Mapping("com.actionsoft.apps.bpa.getSjNumByprocess")
|
|
public JSONObject getSjNumByprocess(String sid, String bindid) {
|
|
JSONObject result = new JSONObject();
|
|
BO bo_eu_pal_pulbish_success = SDK.getBOAPI().query("BO_EU_PAL_PULBISH_SUCCESS", true).addQuery("BINDID = ", bindid).detail();
|
|
if (bo_eu_pal_pulbish_success!=null){
|
|
String processid = bo_eu_pal_pulbish_success.getString("PROCESSID");
|
|
String num = DBSql.getString("select count(user_id) AS NUMBERS from BO_ACT_DATAID where 1=1 AND PROCESSID = '" + processid + "'");
|
|
String read_num = DBSql.getString("select count(user_id) AS NUMBERS from BO_ACT_ALREADY_DATAID where 1=1 AND PROCESSID = '" + processid + "'");
|
|
Integer data = Integer.parseInt(num)+Integer.parseInt(read_num);
|
|
bo_eu_pal_pulbish_success.set("SENDNUMSJ",data);
|
|
SDK.getBOAPI().update("BO_EU_PAL_PULBISH_SUCCESS",bo_eu_pal_pulbish_success);
|
|
result.put("data",data);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
@Mapping("com.actionsoft.apps.bpa.IsHidden_Modeling_Guidance")
|
|
public String IsHidden_Modeling_Guidance(String sid) {
|
|
String property = SDK.getAppAPI().getProperty("com.awspaas.user.apps.app20221008163300", "JM_HIDDEN");
|
|
return property;
|
|
}
|
|
|
|
@Mapping("com.awspaas.user.bpa.controller.GetOpenDataController.GetName")
|
|
public JSONObject GetName(String sid, String boName, String zd_name, String name, String set_name) {
|
|
//String boName = getParameter(s,1);
|
|
// String zd_name = getParameter(s,2);
|
|
// String name = getParameter(s,3);
|
|
// String set_name = getParameter(s,4);
|
|
String names = zd_name.concat(" = ");
|
|
JSONObject result= new JSONObject();
|
|
if (boName.contains("BO_")&&( boName.lastIndexOf("1")!=(boName.length()-1))){
|
|
BO detail = SDK.getBOAPI().query(boName, true).addQuery(names, name).detail();
|
|
if (detail!=null){
|
|
String set_name1 = detail.getString(set_name);
|
|
System.out.println("数据>>>>>>>>>"+set_name1);
|
|
|
|
result.put("data",set_name1);
|
|
return result;
|
|
}else {
|
|
result.put("data","");
|
|
return result;
|
|
}
|
|
}else {
|
|
boName= boName.substring(0,boName.lastIndexOf("1"));
|
|
String sql = boName+"'" + name + "'";
|
|
System.out.println("sql = >>>>>>>>"+sql);
|
|
RowMap map = DBSql.getMap(sql);
|
|
System.out.println("map>>>>>>>>"+map);
|
|
if (map!=null){
|
|
String set_name1 = map.getString(set_name);
|
|
System.out.println("数据>>>>>>>>>"+set_name1);
|
|
result.put("data",set_name1);
|
|
return result;
|
|
}else {
|
|
result.put("data","");
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Mapping("com.awspaas.user.apps.app.controller.Delete_Pal_RePOSITORY")
|
|
public ResponseObject delete_pal(String sid,String plId) {
|
|
ResponseObject ro = ResponseObject.newOkResponse();
|
|
String sql = "DELETE FROM BO_EU_PAL_REPOSITORY";
|
|
int update = DBSql.update(sql);
|
|
if(update>0) {
|
|
ro.put("result", "ok");
|
|
}else {
|
|
ro.put("result", "error");
|
|
}
|
|
return ro;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|