接口平台业务撤销

This commit is contained in:
lixuebo 2019-08-31 15:17:00 +08:00
parent 98dff6580e
commit 48ad4bd19b
2 changed files with 15 additions and 71 deletions

View File

@ -1,13 +1,19 @@
package com.tenwa.flow.action.comm;
import com.amarsoft.app.flow.FlowAction;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.JavaMethod;
import com.amarsoft.context.ASUser;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.stereotype.Controller;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@ -66,8 +72,16 @@ public class FlowController extends HttpServlet {
if (sResult.indexOf("success")==-1) {
throw new Exception( "Ìá½»Á÷³Ìʧ°Ü" );
}
}else if("delete".equals(type)){
JBOTransaction tx = JBOFactory.createJBOTransaction();
FlowAction flowAction = new FlowAction();
flowAction.setObjectNo(request.getParameter("flowunid"));
flowAction.setObjectType(request.getParameter("objecttype"));
flowAction.setFlowNo(request.getParameter("flowno"));
flowAction.delete(tx);
tx.commit();
}
result = sResult;
result = sResult==null?"SUCCESS":sResult;
} catch ( Exception e ) {
e.printStackTrace();
result = "ERR-9999";

View File

@ -1,70 +0,0 @@
package com.tenwa.lease.app.quartzmession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jbo.sys.LM_APPROVAL_OPINION_LOG;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.alibaba.fastjson.JSON;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.tenwa.gps.HttpClientSUtil;
import com.tenwa.httpclient.resources.GPSConfigure;
/**
* 接口平台业务推送审批结果
* @author Administrator
*
*/
public class ApprovalOpinionPush implements Job {
private static String interfacePlatformUrl = GPSConfigure.get("TYuserAccount");
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx = null;
try {
tx = JBOFactory.createJBOTransaction();
BizObjectManager laolBm = JBOFactory.getBizObjectManager(LM_APPROVAL_OPINION_LOG.CLASS_NAME,tx);
List<BizObject> laolBoList = laolBm.createQuery("PUSH_NUMBER<3 and PUSH_STATUS is null").getResultList(true);
for(BizObject laolBo:laolBoList){
Map<String,String> params = new HashMap<String,String>();
params.put("applicationNo",laolBo.getAttribute("APPLICATION_NO").toString());
params.put("flowunid",laolBo.getAttribute("FLOWUNID").toString());
params.put("processNode",laolBo.getAttribute("PROCESS_NODE").toString());
params.put("approveOpinion",laolBo.getAttribute("APPROVE_OPINION").toString());
params.put("approveStatus",laolBo.getAttribute("APPROVE_STATUS").toString());
params.put("approveTime",laolBo.getAttribute("APPROVE_ENDTIME").toString());
String jsonString = JSON.toJSONString(params);
Map<String,String> result = HttpClientSUtil.doPostJson(interfacePlatformUrl,jsonString);
String status = result.get("status");
String data = result.get("data");
if(!"200".equals(status)){
laolBo.setAttributeValue("PUSH_STATUS","PUSH");
}
laolBo.setAttributeValue("PUSH_NUMBER",Integer.valueOf(laolBo.getAttribute("APPROVE_OPINION").toString())+1);
laolBm.saveObject(laolBo);
}
} catch (Exception e) {
e.printStackTrace();
try {
tx.rollback();
} catch (JBOException e1) {
e1.printStackTrace();
}
}finally{
try {
tx.commit();
} catch (JBOException e1) {
e1.printStackTrace();
}
}
}
}