jflow部分代码重构

Survive by day and develop by night.
talk for import biz , show your perfect code,full busy,skip hardness,make a better result,wait for change,challenge Survive.
happy for hardess to solve denpendies.

目录

在这里插入图片描述

概述

需求:

设计思路

实现思路分析

1.jflow代码分析

代码:

package bp.app.handler;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashMap;


import bp.da.DataTable;
import bp.da.DataType;
import bp.difference.ContextHolderUtils;
import bp.difference.SystemConfig;
import bp.difference.handler.WebContralBase;
import bp.port.Emp;
import bp.tools.HttpClientUtil;
import bp.web.WebUser;
import bp.wf.GenerWorkFlow;
import bp.wf.WFSta;
import net.sf.json.JSONArray;
import org.apache.axis.encoding.Base64;
import org.apache.http.protocol.HttpContext;

import net.sf.json.JSONObject;

public class ZYApp  extends WebContralBase {
	/** 
	 初始化数据
	 
	 @param mycontext
	*/
	public ZYApp(HttpContext mycontext)
	{
		this.context = mycontext;
	}
	public ZYApp()
	{
	}
	/**
	 * 根据约定自动跳转
	 * @return
	 * @throws Exception
	 */
	public String Auto_Comm() throws Exception{
		String FK_Flow=this.GetRequestVal("OpenFlow");
		String MapData=this.GetRequestVal("OpenMapData");
		String billNo=this.GetRequestVal("ajbh");
		String FID=this.GetRequestVal("FID");

		if(billNo.equals("@BillNo")){
			if(!DataType.IsNullOrEmpty(FID)) {
				GenerWorkFlow generWorkFlow = new GenerWorkFlow(Long.parseLong(FID));
				billNo = generWorkFlow.getBillNo();
			}
			else{
				GenerWorkFlow generWorkFlow = new GenerWorkFlow(this.getWorkID());
				billNo = generWorkFlow.getBillNo();
			}
		}

		if(!DataType.IsNullOrEmpty(MapData)){
			DataTable dt=bp.da.DBAccess.RunSQLReturnTable("select * from "+MapData+" where BillNo='"+billNo+"'");
			if(dt.Rows.size()>0){
				if(!DataType.IsNullOrEmpty(FK_Flow)){
					GenerWorkFlow gwf=new GenerWorkFlow(Long.parseLong(dt.Rows.get(0).get("OID").toString()));
					if(gwf.getWFSta()== WFSta.Complete){
						return "/WF/MyView.htm?FK_Flow="+FK_Flow+"&WorkID="+dt.Rows.get(0).get("OID")+"&BillNo="+billNo;
					}
					return "/WF/MyFlow.htm?FK_Flow="+FK_Flow+"&WorkID="+dt.Rows.get(0).get("OID")+"&BillNo="+billNo;
				}
				else{
					return "err@缺少参数";
				}
			}
			else{
				if(!DataType.IsNullOrEmpty(FK_Flow)){
					return "/WF/MyFlow.htm?FK_Flow="+FK_Flow+"&BillNo="+billNo;
				}
				else{
					return "err@缺少参数";
				}
			}
		}
		else{
			return "err@缺少参数";
		}
	}
}

参考资料和推荐阅读

  1. 暂无

欢迎阅读,各位老铁,如果对你有帮助,点个赞加个关注呗!~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

执于代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值