NotepadAttr

news2024/11/24 4:57:51

EntityMyPKAttr

  • 目录
    • 概述
      • 需求:
    • 设计思路
    • 实现思路分析
      • 1.Notepads
      • 2.EntityMyPK
      • 3.EntityMyPKAttr
      • 4.EntitiesMyPK
      • 5.EntityMyPK
    • EntityMyPKAttr
    • EntitiesMyPK
      • WebContralBase
      • AtPara
      • Cash
      • ChartType
  • 参考资料和推荐阅读

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.Notepads

package bp.ccoa;

import bp.web.*;
import bp.en.*;
import java.util.*;

/** 
 记事本 s
*/
public class Notepads extends EntitiesMyPK
{
	/** 
	 查询前30个数据.
	 
	 @return 
	*/
	public final String RetrieveTop30() throws Exception {
		QueryObject qo = new QueryObject(this);
		qo.AddWhere(NotepadAttr.Rec, WebUser.getNo());
		//qo.addAnd();
		//qo.AddWhere(NotepadAttr.IsStar, 0);
		qo.Top = 30;
		qo.addOrderBy("RDT");
		qo.DoQuery();

		return this.ToJson("dt");
	}
	public final String RetrieveTop30Stars() throws Exception {
		QueryObject qo = new QueryObject(this);
		qo.AddWhere(NotepadAttr.Rec, WebUser.getNo());
		qo.addAnd();
		qo.AddWhere(NotepadAttr.IsStar, 1);
		qo.Top = 30;
		qo.addOrderBy("RDT");
		qo.DoQuery();

		return this.ToJson("dt");
	}
	/** 
	 记事本
	*/
	public Notepads(){
	}
	/** 
	 得到它的 Entity 
	*/
	@Override
	public Entity getGetNewEntity() {
		return new Notepad();
	}


		///#region 为了适应自动翻译成java的需要,把实体转换成List.
	/** 
	 转化成 java list,C#不能调用.
	 
	 @return List
	*/
	public final java.util.List<Notepad> ToJavaList() {
		return (java.util.List<Notepad>)(Object)this;
	}
	/** 
	 转化成list
	 
	 @return List
	*/
	public final ArrayList<Notepad> Tolist()  {
		ArrayList<Notepad> list = new ArrayList<Notepad>();
		for (int i = 0; i < this.size(); i++)
		{
			list.add((Notepad)this.get(i));
		}
		return list;
	}

		///#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}

2.EntityMyPK

package bp.ccoa;

import bp.da.*;
import bp.web.*;
import bp.en.*;

/** 
 日程
*/
public class Schedule extends EntityMyPK
{

		///#region 基本属性
	public final String getNianYue()
	{
		return this.GetValStrByKey(ScheduleAttr.NianYue);
	}
	public final void setNianYue(String value)
	 {
		this.SetValByKey(ScheduleAttr.NianYue, value);
	}
	/** 
	 组织编号
	*/
	public final String getOrgNo()
	{
		return this.GetValStrByKey(ScheduleAttr.OrgNo);
	}
	public final void setOrgNo(String value)
	 {
		this.SetValByKey(ScheduleAttr.OrgNo, value);
	}
	public final String getRec()
	{
		return this.GetValStrByKey(ScheduleAttr.Rec);
	}
	public final void setRec(String value)
	 {
		this.SetValByKey(ScheduleAttr.Rec, value);
	}
	public final String getRDT()
	{
		return this.GetValStrByKey(ScheduleAttr.RDT);
	}
	public final void setRDT(String value)
	 {
		this.SetValByKey(ScheduleAttr.RDT, value);
	}

		///#endregion


		///#region 构造方法
	/** 
	 权限控制
	*/
	@Override
	public UAC getHisUAC() {
		UAC uac = new UAC();
		if (WebUser.getIsAdmin())
		{
			uac.IsUpdate = true;
			return uac;
		}
		return super.getHisUAC();
	}
	/** 
	 日程
	*/
	public Schedule()  {
	}
	public Schedule(String mypk)throws Exception
	{
		this.setMyPK(mypk);
		this.Retrieve();
	}
	/** 
	 重写基类方法
	*/
	@Override
	public bp.en.Map getEnMap() {
		if (this.get_enMap() != null)
		{
			return this.get_enMap();
		}

		Map map = new Map("OA_Schedule", "日程");

		map.AddMyPK(true);
		map.AddTBString(ScheduleAttr.Name, null, "标题", true, false, 0, 300, 10, true);

		map.AddTBDate(ScheduleAttr.DTStart, null, "开始时间", true, false);
		map.AddTBDate(ScheduleAttr.DTEnd, null, "结束时间", true, false);

		map.AddTBString(ScheduleAttr.TimeStart, null, "TimeStart", true, false, 0, 10, 10);
		map.AddTBString(ScheduleAttr.TimeEnd, null, "TimeEnd", true, false, 0, 10, 10);

		map.AddTBString(ScheduleAttr.ChiXuTime, null, "持续时间", true, false, 0, 10, 10);


		map.AddTBDateTime(ScheduleAttr.DTAlert, null, "提醒时间", true, false);

		map.AddDDLSysEnum(ScheduleAttr.Repeats, 0, "重复", true, false, "Repeat", "@0=永不@1=每年@2=每月");

		map.AddTBString(ScheduleAttr.Local, null, "位置", true, false, 0, 300, 10, true);
		map.AddTBString(ScheduleAttr.MiaoShu, null, "描述", true, false, 0, 300, 10, true);

		map.AddTBString(ScheduleAttr.NianYue, null, "隶属年月", false, false, 0, 10, 10);

		map.AddTBString(ScheduleAttr.OrgNo, null, "OrgNo", false, false, 0, 100, 10);
		map.AddTBString(ScheduleAttr.Rec, null, "记录人", false, false, 0, 100, 10, true);
		map.AddTBDateTime(ScheduleAttr.RDT, null, "记录时间", false, false);


			//RefMethod rm = new RefMethod();
			//rm.Title = "方法参数"; // "设计表单";
			//rm.ClassMethodName = this.ToString() + ".DoParas";
			//rm.Visable = true;
			//rm.refMethodType = RefMethodType.RightFrameOpen;
			//rm.Target = "_blank";
			rm.GroupName = "开发接口";
			  map.AddRefMethod(rm);

			//rm = new RefMethod();
			//rm.Title = "方法内容"; // "设计表单";
			//rm.ClassMethodName = this.ToString() + ".DoDocs";
			//rm.Visable = true;
			//rm.refMethodType = RefMethodType.RightFrameOpen;
			//rm.Target = "_blank";
			rm.GroupName = "开发接口";
			//map.AddRefMethod(rm);

		this.set_enMap(map);
		return this.get_enMap();
	}

		///#endregion


		///#region 执行方法.
	@Override
	protected boolean beforeInsert() throws Exception {
		this.setMyPK(DBAccess.GenerGUID(0, null, null));
		this.setRec(WebUser.getNo());
		this.setOrgNo(WebUser.getOrgNo());

		this.setRDT(DataType.getCurrentDateTime());
		this.setNianYue(DataType.getCurrentYearMonth());

		return super.beforeInsert();
	}

		///#endregion 执行方法.
}

3.EntityMyPKAttr

package bp.ccoa;

import bp.en.*;

/** 
 日程 属性
*/
public class ScheduleAttr extends EntityMyPKAttr
{
	/** 
	 名称
	*/
	public static final String Name = "Name";
	/** 
	 功能ID
	*/
	public static final String DTStart = "DTStart";
	/** 
	 从
	*/
	public static final String TimeStart = "TimeStart";

	/** 
	 功能来源
	*/
	public static final String DTEnd = "DTEnd";
	/** 
	 时间从
	*/
	public static final String TimeEnd = "TimeEnd";
	/** 
	 持续时间
	*/
	public static final String ChiXuTime = "ChiXuTime";

	/** 
	 重复方式
	*/
	public static final String Repeats = "Repeats";
	/** 
	 位置
	*/
	public static final String Local = "Local";
	/** 
	 描述
	*/
	public static final String MiaoShu = "MiaoShu";
	/** 
	 提醒时间
	*/
	public static final String DTAlert = "DTAlert";
	/** 
	 组织编号
	*/
	public static final String OrgNo = "OrgNo";
	/** 
	 记录人
	*/
	public static final String Rec = "Rec";
	/** 
	 记录日期
	*/
	public static final String RDT = "RDT";
	/** 
	 年月.
	*/
	public static final String NianYue = "NianYue";

}

4.EntitiesMyPK

package bp.ccoa;

import bp.en.*;
import java.util.*;

/** 
 日程 s
*/
public class Schedules extends EntitiesMyPK
{
	/** 
	 查询事件到.
	 
	 param dtFrom
	 param dtTo
	 @return 
	*/
	public final String DTFromTo(String dtFrom, String dtTo) throws Exception {
		this.RetrieveAll();
		return this.ToJson("dt");
	}
	/** 
	 日程
	*/
	public Schedules() throws Exception {
	}
	/** 
	 得到它的 Entity 
	*/
	@Override
	public Entity getGetNewEntity() {
		return new Schedule();
	}

		///#region 为了适应自动翻译成java的需要,把实体转换成List.
	/** 
	 转化成 java list,C#不能调用.
	 
	 @return List
	*/
	public final java.util.List<Schedule> ToJavaList() {
		return (java.util.List<Schedule>)(Object)this;
	}
	/** 
	 转化成list
	 
	 @return List
	*/
	public final ArrayList<Schedule> Tolist()  {
		ArrayList<Schedule> list = new ArrayList<Schedule>();
		for (int i = 0; i < this.size(); i++)
		{
			list.add((Schedule)this.get(i));
		}
		return list;
	}

		///#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}

5.EntityMyPK

package bp.ccoa;

import bp.da.*;
import bp.web.*;
import bp.en.*;
import bp.sys.*;
/** 
 任务
*/
public class Task extends EntityMyPK
{

		///#region 基本属性
	/** 
	 组织编号
	*/
	public final String getOrgNo()
	{
		return this.GetValStrByKey(TaskAttr.OrgNo);
	}
	public final void setOrgNo(String value)
	 {
		this.SetValByKey(TaskAttr.OrgNo, value);
	}
	public final String getRec()
	{
		return this.GetValStrByKey(TaskAttr.Rec);
	}
	public final void setRec(String value)
	 {
		this.SetValByKey(TaskAttr.Rec, value);
	}
	public final String getRecName()
	{
		return this.GetValStrByKey(TaskAttr.RecName);
	}
	public final void setRecName(String value)
	 {
		this.SetValByKey(TaskAttr.RecName, value);
	}
	public final String getRDT()
	{
		return this.GetValStrByKey(TaskAttr.RDT);
	}
	public final void setRDT(String value)
	 {
		this.SetValByKey(TaskAttr.RDT, value);
	}
	/** 
	 日期
	*/
	public final String getRiQi()
	{
		return this.GetValStrByKey(TaskAttr.RiQi);
	}
	public final void setRiQi(String value)
	 {
		this.SetValByKey(TaskAttr.RiQi, value);
	}
	/** 
	 年月
	*/
	public final String getDTFrom()
	{
		return this.GetValStrByKey(TaskAttr.DTFrom);
	}
	public final void setDTFrom(String value)
	 {
		this.SetValByKey(TaskAttr.DTFrom, value);
	}
	public final String getDTTo()
	{
		return this.GetValStrByKey(TaskAttr.DTTo);
	}
	public final void setDTTo(String value)
	 {
		this.SetValByKey(TaskAttr.DTTo, value);
	}
	/** 
	 项目数
	*/
	public final int getRefEmpsNo()
	{
		return this.GetValIntByKey(TaskAttr.RefEmpsNo);
	}
	public final void setRefEmpsNo(int value)
	 {
		this.SetValByKey(TaskAttr.RefEmpsNo, value);
	}
	/** 
	 第几周?
	*/
	public final int getRefEmpsName()
	{
		return this.GetValIntByKey(TaskAttr.RefEmpsName);
	}
	public final void setRefEmpsName(int value)
	 {
		this.SetValByKey(TaskAttr.RefEmpsName, value);
	}
	/** 
	 负责人
	*/
	public final float getManager()
	{
		return this.GetValFloatByKey(TaskAttr.Manager);
	}
	public final void setManager(float value)
	 {
		this.SetValByKey(TaskAttr.Manager, value);
	}


		///#endregion


		///#region 构造方法
	/** 
	 权限控制
	*/
	@Override
	public UAC getHisUAC() {
		UAC uac = new UAC();
		if (WebUser.getIsAdmin())
		{
			uac.IsUpdate = true;
			return uac;
		}
		return super.getHisUAC();
	}
	/** 
	 任务
	*/
	public Task()  {
	}
	public Task(String mypk)throws Exception
	{
		this.setMyPK(mypk);
		this.Retrieve();
	}
	/** 
	 重写基类方法
	*/
	@Override
	public bp.en.Map getEnMap() {
		if (this.get_enMap() != null)
		{
			return this.get_enMap();
		}

		Map map = new Map("OA_Task", "任务");

		map.AddMyPK(true);

		map.AddTBString(TaskAttr.Title, null, "标题", false, false, 0, 500, 10);
		map.AddTBString(TaskAttr.Docs, null, "内容", false, false, 0, 4000, 10);

		map.AddTBString(TaskAttr.ParentNo, null, "父节点ID", false, false, 0, 50, 10);
		map.AddTBInt(TaskAttr.IsSubTask, 0, "是否是子任务", true, false);


		map.AddDDLSysEnum(TaskAttr.TaskPRI, 0, "优先级", true, false, "TaskPRI", "@0=高@1=中@2=低");
		map.AddDDLSysEnum(TaskAttr.TaskSta, 0, "状态", true, false, "TaskSta", "@0=未完成@1=已完成");

		map.AddTBDateTime(TaskAttr.DTFrom, null, "日期从", false, false);
		map.AddTBDateTime(TaskAttr.DTTo, null, "到", false, false);

		map.AddTBString(TaskAttr.ManagerEmpNo, null, "负责人", false, false, 0, 30, 10);
		map.AddTBString(TaskAttr.ManagerEmpName, null, "负责人名称", false, false, 0, 40, 10);

		map.AddTBString(TaskAttr.RefEmpsNo, null, "参与人编号", false, false, 0, 3000, 10);
		map.AddTBString(TaskAttr.RefEmpsName, null, "参与人名称", false, false, 0, 3000, 10);

		map.AddTBString(TaskAttr.RefLabelNo, null, "标签标号", false, false, 0, 3000, 10);
		map.AddTBString(TaskAttr.RefLabelName, null, "标签名称", false, false, 0, 3000, 10);

		map.AddTBString(TaskAttr.OrgNo, null, "组织编号", false, false, 0, 100, 10);
		map.AddTBString(TaskAttr.Rec, null, "记录人", false, false, 0, 100, 10);
		map.AddTBString(TaskAttr.RecName, null, "记录人名称", false, false, 0, 100, 10, true);
		map.AddTBDateTime(TaskAttr.RDT, null, "记录时间", false, false);

		this.set_enMap(map);
		return this.get_enMap();
	}

		///#endregion


		///#region 执行方法.
	@Override
	protected boolean beforeInsert() throws Exception {
		this.setMyPK(DBAccess.GenerGUID(0, null, null));
		this.setRec(WebUser.getNo());
		this.setRecName(WebUser.getName());
		if (bp.difference.SystemConfig.getCCBPMRunModel() != CCBPMRunModel.Single)
		{
			this.setOrgNo(WebUser.getOrgNo());
		}

		this.SetValByKey("RDT", DataType.getCurrentDateTime());

		return super.beforeInsert();
	}
	@Override
	protected boolean beforeUpdate() throws Exception {
		计算条数.
		//this.RefEmpsNo = DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS N FROM OA_TaskDtl WHERE RefPK='" + this.MyPK + "'");

		计算合计工作小时..
		//this.Manager = DBAccess.RunSQLReturnValInt("SELECT SUM(Hour) + Sum(Minute)/60.00 AS N FROM OA_TaskDtl WHERE RefPK='" + this.MyPK + "'");

		return super.beforeUpdate();
	}

		///#endregion 执行方法.
}

EntityMyPKAttr

	package bp.ccoa;

	import bp.en.*;

	/**
	 任务 属性
	*/
	public class TaskAttr extends EntityMyPKAttr
	{
		/**
		 模式
		*/
		public static final String TaskPRI = "TaskPRI";
		/**
		 内容1
		*/
		public static final String Docs = "Docs";
		public static final String Title = "Title";

		/**
		 内容2
		*/
		public static final String TaskSta = "TaskSta";
		/**
		 内容3
		*/
		public static final String ManagerEmpNo = "ManagerEmpNo";
		/**
		 负责人
		*/
		public static final String ManagerEmpName = "ManagerEmpName";

		public static final String RefLabelNo = "RefLabelNo";
		public static final String RefLabelName = "RefLabelName";

		/**
		 组织编号
		*/
		public static final String OrgNo = "OrgNo";
		/**
		 记录人
		*/
		public static final String Rec = "Rec";
		/**
		 记录人名称
		*/
		public static final String RecName = "RecName";
		/**
		 记录日期
		*/
		public static final String RDT = "RDT";
		/**
		 隶属日期
		*/
		public static final String RiQi = "RiQi";
		/**
		 年月
		*/
		public static final String DTFrom = "DTFrom";
		/**
		 项目数
		*/
		public static final String RefEmpsNo = "RefEmpsNo";
		/**
		 第几周
		*/
		public static final String RefEmpsName = "RefEmpsName";
		/**
		 年度
		*/
		public static final String DTTo = "DTTo";
		/**
		 负责人.
		*/
		public static final String Manager = "Manager";

		public static final String ParentNo = "ParentNo";
		public static final String IsSubTask = "IsSubTask";
	}

EntitiesMyPK

package bp.ccoa;

import bp.da.*;
import bp.web.*;
import bp.en.*;
import bp.port.*;
import bp.sys.*;
import java.util.*;

/** 
 任务 s
*/
public class Tasks extends EntitiesMyPK
{


		///#region 查询.
	/** 
	 所有的任务
	 
	 @return 
	*/
	public final String Task_AllTasks() throws Exception {
		QueryObject qo = new QueryObject(this);

		qo.addLeftBracket();
		qo.AddWhere(TaskAttr.Rec, WebUser.getNo());
		qo.addOr();
		qo.AddWhere(TaskAttr.RefEmpsNo, " like ", "%," + WebUser.getNo() + ",%");
		qo.addOr();
		qo.AddWhere(TaskAttr.ManagerEmpNo, " like ", "%," + WebUser.getNo() + ",%");
		qo.addRightBracket();
		qo.addAnd();
		qo.AddWhere(TaskAttr.IsSubTask, 0);

		if (bp.difference.SystemConfig.getCCBPMRunModel() == CCBPMRunModel.SAAS)
		{
			qo.addAnd();
			qo.AddWhere(TaskAttr.OrgNo, " = ", WebUser.getOrgNo());
		}
		qo.DoQuery();
		return this.ToJson("dt");
	}

	public final String TextBox_EmpPinYin(String key)
	{
		String whereSQL = " AND OrgNo='" + WebUser.getOrgNo() + "'";
		if (bp.difference.SystemConfig.getCCBPMRunModel() == CCBPMRunModel.Single)
		{
			whereSQL = "";
		}

		String sql = "";
		sql = "SELECT No, Name FROM Port_Emp WHERE (No like '%" + key + "%' or Name like '%" + key + "%' or PinYin like '%" + key + "%' )  " + whereSQL;
		DataTable dt = DBAccess.RunSQLReturnTable(sql);
		return bp.tools.Json.ToJson(dt);
	}

	public final String Selecter_DeptEmps() throws Exception {
		DataSet ds = new DataSet();

		Depts depts = new Depts();
		depts.RetrieveAll();

		Emps emps = new Emps();
		emps.RetrieveAll();

		ds.Tables.add(depts.ToDataTableField("Depts"));
		ds.Tables.add(emps.ToDataTableField("Emps"));

		return bp.tools.Json.ToJson(ds);

	}

		///#endregion 重写.


		///#region 重写.
	/** 
	 任务
	*/
	public Tasks()  {
	}
	/** 
	 得到它的 Entity 
	*/
	@Override
	public Entity getGetNewEntity() {
		return new Task();
	}

		///#endregion 重写.



		///#region 为了适应自动翻译成java的需要,把实体转换成List.
	/** 
	 转化成 java list,C#不能调用.
	 
	 @return List
	*/
	public final java.util.List<Task> ToJavaList() {
		return (java.util.List<Task>)(Object)this;
	}
	/** 
	 转化成list
	 
	 @return List
	*/
	public final ArrayList<Task> Tolist()  {
		ArrayList<Task> list = new ArrayList<Task>();
		for (int i = 0; i < this.size(); i++)
		{
			list.add((Task)this.get(i));
		}
		return list;
	}

		///#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}

WebContralBase

package bp.cloud.httphandler;

import bp.da.*;
import bp.difference.SystemConfig;
import bp.difference.handler.WebContralBase;
import bp.en.FieldTypeS;
import bp.en.QueryObject;
import bp.sys.MapAttr;
import bp.sys.MapAttrAttr;
import bp.sys.MapAttrs;
import bp.web.WebUser;
import bp.wf.Dev2Interface;
import bp.wf.WFState;
import bp.wf.data.MyJoinFlows;
import bp.wf.data.MyStartFlowAttr;
import bp.wf.data.MyStartFlows;

/**
 页面功能实体

 */
public class App_OneFlow extends WebContralBase
{
    /**
     构造函数

     */
    public App_OneFlow()
    {

    }
    /**
     获得菜单

     @return
     */
    public final String Default_Menu() throws Exception {
        if (WebUser.getNo() == null)
        {
            return "err@/App/index.htm";
        }
        //类别.
        DataTable dtSort = new DataTable("Sorts");
        dtSort.Columns.Add("No");
        dtSort.Columns.Add("Name");
        dtSort.Columns.Add("ICON");

        //菜单.
        DataTable dtMenu = new DataTable("Menus");
        dtMenu.Columns.Add("No");
        dtMenu.Columns.Add("Name");
        dtMenu.Columns.Add("SortNo");
        dtMenu.Columns.Add("ICON");
        dtMenu.Columns.Add("Url");
     ///#region 类别.
        DataRow dr = dtSort.NewRow();
        dr.setValue("No","01");
        dr.setValue("Name","本流程操作");
        dr.setValue("ICON","FlowCenter.png");
        dtSort.Rows.add(dr);

        dr = dtSort.NewRow();
        dr.setValue("No","02");
        dr.setValue("Name","本流程业务数据");
        dr.setValue("ICON","FlowSearch.png");
        dtSort.Rows.add(dr);
        dr = dtMenu.NewRow();
        dr.setValue("No","Todolist");
        dr.setValue("Name","待办");
        dr.setValue("SortNo","01");
        dr.setValue("Url","/App/OneFlow/Todolist.htm");
        dr.setValue("ICON","Todolist.png");
        dtMenu.Rows.add(dr);

        dr = dtMenu.NewRow();
        dr.setValue("No","Runing");
        dr.setValue("Name","未完成");
        dr.setValue("SortNo","01");
        dr.setValue("Url","/App/OneFlow/Runing.htm");
        dr.setValue("ICON","Runing.png");
        dtMenu.Rows.add(dr);

        dr = dtMenu.NewRow();
        dr.setValue("No","CC");
        dr.setValue("Name","抄送");
        dr.setValue("SortNo","01");
        dr.setValue("Url","/App/OneFlow/CC.htm");
        dr.setValue("ICON","CC.png");
        dtMenu.Rows.add(dr);

        dr = dtMenu.NewRow();
        dr.setValue("No","Draf");
        dr.setValue("Name","草稿");
        dr.setValue("SortNo","01");
        dr.setValue("Url","/App/OneFlow/Draf.htm");
        dr.setValue("ICON","Draft.png");
        dtMenu.Rows.add(dr);
        ///#endregion 流程中心-菜单.
        ///#region 流程查询-菜单.
        dr = dtMenu.NewRow();
        dr.setValue("No","MyStartFlows");
        dr.setValue("Name","我发起的");
        dr.setValue("SortNo","02");
        dr.setValue("Url","/App/OneFlow/RptSearch.htm?SearchType=My");
        dr.setValue("ICON","SearchMy.png");
        dtMenu.Rows.add(dr);



        dr = dtMenu.NewRow();
        dr.setValue("No","MyJoinFlows");
        dr.setValue("Name","我审批的");
        dr.setValue("SortNo","02");
        dr.setValue("Url","/App/OneFlow/RptSearch.htm?SearchType=MyJoin");
        dr.setValue("ICON","SearchMyCheck.png");
        dtMenu.Rows.add(dr);

        dr = dtMenu.NewRow();
        dr.setValue("No","Org");
        dr.setValue("Name","部门数据概况");
        dr.setValue("SortNo","02");
        dr.setValue("Url","/App/OneFlow/DataPanelDept.htm");
        dr.setValue("ICON","Organization.png");
        dtMenu.Rows.add(dr);

        dr = dtMenu.NewRow();
        dr.setValue("No","Org");
        dr.setValue("Name","组织数据概况");
        dr.setValue("SortNo","02");
        dr.setValue("Url","/App/OneFlow/DataPanelOrg.htm");
        dr.setValue("ICON","Organization.png");
        dtMenu.Rows.add(dr);



        if (WebUser.getIsAdmin() == true)
        {
            dr = dtMenu.NewRow();
            dr.setValue("No","MyDeptFlows");
            dr.setValue("Name","我部门发起的");
            dr.setValue("SortNo","02");
            dr.setValue("Url","/App/OneFlow/RptSearch.htm?SearchType=MyDept");
            dr.setValue("ICON","SearchMyDept.png");
            dtMenu.Rows.add(dr);

            dr = dtMenu.NewRow();
            dr.setValue("No","FX");
            dr.setValue("Name","综合分析");
            dr.setValue("SortNo","02");
            dr.setValue("Url","/WF/Comm/Group.htm?EnsName=BP.Cloud.GWFAdmins");
            dr.setValue("ICON","ZongHeFenXi.png");
            dtMenu.Rows.add(dr);

            dr = dtMenu.NewRow();
            dr.setValue("No","FlowDatas");
            dr.setValue("Name","数据运维");
            dr.setValue("SortNo","02");
            dr.setValue("Url","/WF/Comm/Search.htm?EnsName=BP.Cloud.GWFAdmins");
            dr.setValue("ICON","YunWei.png");
            dtMenu.Rows.add(dr);
        }
        ///#endregion 流程查询-菜单.
        ///#endregion 系统管理-菜单.

        //组装数据.
        DataSet ds = new DataSet();
        ds.Tables.add(dtSort);
        ds.Tables.add(dtMenu);

        //返回数据.
        return bp.tools.Json.ToJson(ds);
    }
    /**
     初始化Home

     @return
     */
    public final String Default_Init() throws Exception {
        java.util.Hashtable ht = new java.util.Hashtable();
        ht.put("UserNo", WebUser.getNo());
        ht.put("UserName", WebUser.getName());

        //系统名称.
        ht.put("SysName", SystemConfig.getSysName());
        ht.put("CustomerName", SystemConfig.getCustomerName());

        ht.put("Todolist_EmpWorks", bp.wf.Dev2Interface.getTodolistEmpWorks());
        ht.put("Todolist_Runing", bp.wf.Dev2Interface.getTodolistRuning());
        ht.put("Todolist_Sharing", bp.wf.Dev2Interface.getTodolistSharing());
        ht.put("Todolist_CCWorks", bp.wf.Dev2Interface.getTodolistCCWorks());
        ht.put("Todolist_Apply", bp.wf.Dev2Interface.getTodolistApply()); //申请下来的任务个数.
        ht.put("Todolist_Draft", bp.wf.Dev2Interface.getTodolistDraft()); //草稿数量.
        ht.put("Todolist_Complete", bp.wf.Dev2Interface.getTodolistComplete()); //完成数量.
        ht.put("UserDeptName", WebUser.getFK_DeptName());

        //我发起
        MyStartFlows myStartFlows = new MyStartFlows();
        QueryObject obj = new QueryObject(myStartFlows);
        obj.AddWhere(MyStartFlowAttr.Starter, WebUser.getNo());
        obj.addAnd();
        //运行中\已完成\挂起\退回\转发\加签\批处理\
        obj.addLeftBracket();
        obj.AddWhere("WFState=2 or WFState=3 or WFState=4 or WFState=5 or WFState=6 or WFState=8 or WFState=10");
        obj.addRightBracket();
        obj.DoQuery();
        ht.put("Todolist_MyStartFlow", myStartFlows.size());

        //我参与
        MyJoinFlows myFlows = new MyJoinFlows();
        obj = new QueryObject(myFlows);
        obj.AddWhere("Emps like '%" + WebUser.getNo() + "%'");
        obj.DoQuery();
        ht.put("Todolist_MyFlow", myFlows.size());

        return bp.tools.Json.ToJsonEntityModel(ht);
    }

    /**
     初始化待办.

     @return
     */
    public final String Todolist_Init() throws Exception {
        String fk_node = this.GetRequestVal("FK_Node");
        String showWhat = this.GetRequestVal("ShowWhat");
        DataTable dt = bp.wf.Dev2Interface.DB_GenerEmpWorksOfDataTable(WebUser.getNo(),this.getFK_Node(),showWhat,this.getDomain());
        return bp.tools.Json.ToJson(dt);
    }

    /**
     在途

     @return 运行中的流程
     */
    public final String Runing_Init() throws Exception {
        DataTable dt = null;
        boolean isContainFuture = this.GetRequestValBoolen("IsContainFuture");
        dt = bp.wf.Dev2Interface.DB_GenerRuning(WebUser.getNo(),this.getFK_Flow(),false,this.getDomain(), isContainFuture); //获得指定域的在途.
        return bp.tools.Json.ToJson(dt);
    }

    /**
     抄送

     @return
     */
    public final String CC_Init() throws Exception {
        String sta = this.GetRequestVal("Sta");
        if (DataType.IsNullOrEmpty(sta))
        {
            sta = "-1";
        }


        DataTable dt = null;
        if (sta.equals("-1"))
        {
            dt = Dev2Interface.DB_CCList("",this.getFK_Flow());
        }

        if (sta.equals("0"))
        {
            dt = bp.wf.Dev2Interface.DB_CCList_UnRead(WebUser.getNo(),null,this.getFK_Flow());
        }

        if (sta.equals("1"))
        {
            dt = bp.wf.Dev2Interface.DB_CCList_Read(null,this.getFK_Flow());
        }

        if (sta.equals("2"))
        {
            dt = bp.wf.Dev2Interface.DB_CCList_Delete(null,this.getFK_Flow());
        }

        return bp.tools.Json.ToJson(dt);
    }

    public final String Draf_Init()
    {
        DataTable dt = bp.wf.Dev2Interface.DB_GenerDraftDataTable(this.getFK_Flow());
        return bp.tools.Json.ToJson(dt);
    }

    /**
     获取本部门的数据统计

     @return
     */
    public final String DataPanelDept_GetGenerWorksByDept()
    {
        java.util.Hashtable ht = new java.util.Hashtable();
        String dbStr = SystemConfig.getAppCenterDBVarStr();
        Paras ps = new Paras();
        ps.SQL = "SELECT COUNT(*) AS count,WFState FROM WF_GenerWorkFlow Where WFState >1 AND FID=0 AND FK_Flow=" + dbStr + "FK_Flow AND FK_Dept=" + dbStr + "FK_Dept GROUP BY WFState";
        ps.Add("FK_Flow", this.getFK_Flow());
        ps.Add("FK_Dept", WebUser.getFK_Dept());
        DataTable dt = DBAccess.RunSQLReturnTable(ps);
        int allCount = 0;
        int count = 0;
        int wfstate = 0;
        for(DataRow dr : dt.Rows)
        {
            count = Integer.parseInt(dr.getValue(0).toString());
            wfstate = Integer.parseInt(dr.getValue(1).toString());
            allCount += count;
            if(wfstate == WFState.Complete.getValue())
            {
                ht.put("Dept_GWF_CompleteCounts", count);
            }
            if (wfstate == WFState.ReturnSta.getValue())
            {
                ht.put("Dept_GWF_ReturnCounts", count);
            }
            if (wfstate == WFState.Delete.getValue())
            {
                ht.put("Dept_GWF_DeleteCounts", count);
            }

        }
        //本部门的查询显示数量
        ps.SQL = "Select Count(DISTINCT WorkID) From(" + "SELECT DISTINCT G.WorkID From WF_GenerWorkFlow G,WF_GenerWorkerlist L Where  G.WorkID=L.WorkID AND G.WFState=2 AND G.FK_Flow=" + dbStr + "FK_Flow AND L.IsPass=0 AND L.FK_Dept=" + dbStr + "FK_Dept" +" UNION SELECT DISTINCT WorkID FROM WF_GenerWorkFlow Where WFState > 1 AND WFState!=3 AND FK_Flow =" + dbStr + "FK_Flow AND FK_Dept=" + dbStr + "FK_Dept) AS A";

        ps.Add("FK_Flow", this.getFK_Flow());
        ps.Add("FK_Dept", WebUser.getFK_Dept());
        int runingCount = DBAccess.RunSQLReturnValInt(ps);
        ht.put("Dept_GWF_RuningCounts", runingCount);
        ht.put("Dept_GWF_Counts", allCount);
        switch(SystemConfig.getAppCenterDBType()){
            case MySQL:
            case UX:
            case PostgreSQL:
                ht.put("Dept_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Flow='"+this.getFK_Flow()+"' AND FK_Dept='" +WebUser.getFK_Dept() + "' AND  STR_TO_DATE(SDT,'%Y-%m-%d %H:%i') <  NOW()"));
                break;
            case Oracle:
            case KingBaseR3:
            case KingBaseR6:
                ht.put("Dept_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Flow='"+this.getFK_Flow()+"' AND FK_Dept='" +WebUser.getFK_Dept() + "' AND  to_char(to_date(SDT,'yyyy-mm-dd,hh24:mi'),'yyyymmdd HH:mm')  < to_char(sysdate ,'yyyymmdd HH:mm')"));
                break;
            case MSSQL:
                ht.put("Dept_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Flow='"+this.getFK_Flow()+"' AND FK_Dept='" +WebUser.getFK_Dept() + "' AND  convert(varchar(100),SDT,120) < CONVERT(varchar(100), GETDATE(), 120)"));
                break;
            default:
                throw new RuntimeException(SystemConfig.getAppCenterDBType()+"还没增加该数据库类型的解析");
        }

        //个人的查询显示数量
        ps.clear();
        ps.SQL = "SELECT COUNT(DISTINCT WorkID) AS count,WFState FROM WF_GenerWorkFlow Where WFState >1 AND FK_Flow=" + dbStr + "FK_Flow AND (Emps like '%@"+WebUser.getNo()+",%'OR TodoEmps like '%"+WebUser.getNo()+",%')  GROUP BY WFState ";
        ps.Add("FK_Flow", this.getFK_Flow());
        //ps.Add("FK_Dept", WebUser.getFK_Dept());
        dt = DBAccess.RunSQLReturnTable(ps);
        allCount = 0;
        for (DataRow dr : dt.Rows)
        {
            count = Integer.parseInt(dr.getValue(0).toString());
            wfstate = Integer.parseInt(dr.getValue(1).toString());
            allCount += count;
            if (wfstate ==WFState.Runing.getValue())
            {
                ht.put("My_GWF_RuningCounts", count);
            }
            if (wfstate ==WFState.Complete.getValue())
            {
                ht.put("My_GWF_CompleteCounts", count);
            }
            if (wfstate == WFState.ReturnSta.getValue())
            {
                ht.put("My_GWF_ReturnCounts", count);
            }
            if (wfstate ==WFState.Delete.getValue())
            {
                ht.put("My_GWF_DeleteCounts", count);
            }

        }
        ht.put("My_GWF_Counts", allCount);
        switch(SystemConfig.getAppCenterDBType()){
            case MySQL:
            case UX:
            case PostgreSQL:
                ht.put("My_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Emp='" + WebUser.getNo() + "' AND FK_Flow='" + this.getFK_Flow() + "' AND  STR_TO_DATE(SDT,'%Y-%m-%d %H:%i') <  NOW()"));
                break;
            case Oracle:
            case KingBaseR3:
            case KingBaseR6:
                ht.put("My_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Emp='" + WebUser.getNo() + "' AND FK_Flow='" + this.getFK_Flow()+ "' AND  convert(varchar(100),SDT,120) < CONVERT(varchar(100), GETDATE(), 120)"));
                break;
            case MSSQL:
                ht.put("My_GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) FROM WF_GenerWorkerList WHERE  IsPass=0 AND FK_Emp='" + WebUser.getNo() + "' AND FK_Flow='" + this.getFK_Flow() + "' AND  convert(varchar(100),SDT,120) < CONVERT(varchar(100), GETDATE(), 120)"));
                break;
            default:
                throw new RuntimeException(SystemConfig.getAppCenterDBType()+"还没增加该数据库类型的解析");
        }

        return bp.tools.Json.ToJson(ht);
    }

    /**
     获取Rpt表的分析项

     @return
     */
    public final String DataPanelDept_GetAnalyseGroupByRpt() throws Exception {
        //获取的是系统字段WFState和表单中Int类型的字段
        MapAttrs mapattrs = new MapAttrs();
        QueryObject qo = new QueryObject(mapattrs);
        qo.AddWhere(MapAttrAttr.FK_MapData, "ND" + Integer.parseInt(this.getFK_Flow()) + "01");
        qo.addAnd();
        qo.AddWhereNotIn(MapAttrAttr.MyDataType, "1,4,6,7");
        qo.addAnd();
        qo.AddWhere(MapAttrAttr.UIVisible, true);
        qo.addAnd();
        qo.AddWhere(MapAttrAttr.LGType, "!=",FieldTypeS.Enum.getValue());

        qo.addOrderBy(MapAttrAttr.GroupID, MapAttrAttr.Idx);
        qo.DoQuery();
        //增加系统表的状态
        MapAttr attr = new MapAttr("ND" + Integer.parseInt(this.getFK_Flow()) + "Rpt_WFState");
        mapattrs.AddEntity(attr);
        return bp.tools.Json.ToJson(mapattrs.ToDataTableField());
    }

    public final String DataPanelDept_GetAnalyseBySpecifyField_DataSet() throws Exception {
        DataSet ds = new DataSet();
        String field = this.GetRequestVal("KeyOfEn");
        String groupBy = this.GetRequestVal("FK_NY");
        if (DataType.IsNullOrEmpty(field) || DataType.IsNullOrEmpty(groupBy))
        {
            throw new RuntimeException("分析条件,分析项不能为空");
        }

        DataTable dt;
        //流程状态,只分析发起数量和完成数量
        if (field.equals("WFState") == true)
        {
            String sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, WFState, count(OID) as Num FROM ND" + Integer.parseInt(this.getFK_Flow()) + "Rpt WHERE FK_Dept = 'ccs1'  AND FK_NY> DateName(year, GetDate()) + '-00' GROUP BY FK_NY ,WFState";
            dt = DBAccess.RunSQLReturnTable(sql);
        }
        else
        {
            //按照申请人的区分
            String sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, FlowStarter, sum(" + field+") as Num FROM ND" + Integer.parseInt(this.getFK_Flow()) + "Rpt WHERE FK_Dept = 'ccs1'  AND FK_NY> DateName(year, GetDate()) + '-00' GROUP BY FK_NY ,FlowStarter";
            dt = DBAccess.RunSQLReturnTable(sql);

        }
        return bp.tools.Json.ToJson(ds);
    }
    /**
     获取单个流程的本部门的数据分析

     @return
     */
    public final String DataPanelDept_GetAnalyseByFlowNoDept_DataSet() throws Exception {
        DataSet ds = new DataSet();
        //按照月份(统计的内容有发起数,完成数量,业务字段)
        //发起数量
        String dbSQL="";
        String sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, count(WorkID) AS Num FROM WF_GenerWorkFlow WHERE WFState >1 AND FK_Dept='" + WebUser.getFK_Dept()+"' AND FK_Flow='"+this.getFK_Flow()+ "'";
        switch(SystemConfig.getAppCenterDBType()){
            case MySQL:
            case PostgreSQL:
            case UX:
                dbSQL=" AND FK_NY>YEAR(CURDATE())+'-00' ";
                break;
            case Oracle:
            case KingBaseR3:
            case KingBaseR6:
                dbSQL=" AND FK_NY>to_char(sysdate, 'yyyy' )+'-00' ";
                break;
            case MSSQL:
                dbSQL=" AND FK_NY>DateName(year,GetDate())+'-00' ";
                break;
            default:
                throw new RuntimeException(SystemConfig.getAppCenterDBType()+"还没增加该数据库类型的解析");
        }
         sql+=dbSQL+ " GROUP BY FK_NY ";
        DataTable FlowStartByNY = DBAccess.RunSQLReturnTable(sql);
        FlowStartByNY.TableName = "FlowStartByNY";
        ds.Tables.add(FlowStartByNY);
        //完成数量
        sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState=3 AND FK_Dept='" + WebUser.getFK_Dept() + "' AND FK_Flow='" + this.getFK_Flow() + "'"+dbSQL+" GROUP BY FK_NY ";

        DataTable FlowCompleteByNY = DBAccess.RunSQLReturnTable(sql);
        FlowCompleteByNY.TableName = "FlowCompleteByNY";
        ds.Tables.add(FlowCompleteByNY);


        //按照人员
        //发起数量
        sql = "SELECT StarterName, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState >1 AND FK_Dept='" + WebUser.getFK_Dept() + "' AND FK_Flow='" + this.getFK_Flow() + "' GROUP BY StarterName ";
        DataTable FlowStartByEmp = DBAccess.RunSQLReturnTable(sql);
        FlowStartByEmp.TableName = "FlowStartByEmp";
        ds.Tables.add(FlowStartByEmp);
        //完成数量
        sql = "SELECT StarterName, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState=3 AND FK_Dept='" + WebUser.getFK_Dept() + "' AND FK_Flow='" + this.getFK_Flow() + "' GROUP BY StarterName ";
        DataTable FlowCompleteByEmp = DBAccess.RunSQLReturnTable(sql);
        FlowCompleteByEmp.TableName = "FlowCompleteByEmp";
        ds.Tables.add(FlowCompleteByEmp);

        return bp.tools.Json.ToJson(ds);
    }


    /**
     获取指定流程的数据统计

     @return
     */
    public final String DataPanelOrg_GetGenerWorksByFlowNo()
    {
        java.util.Hashtable ht = new java.util.Hashtable();
        String dbStr = SystemConfig.getAppCenterDBVarStr();
        Paras ps = new Paras();
        ps.SQL = "SELECT COUNT(*) AS count,WFState FROM WF_GenerWorkFlow Where WFState >1 AND FID=0 AND FK_Flow=" + dbStr + "FK_Flow GROUP BY WFState";
        ps.Add("FK_Flow", this.getFK_Flow());
        DataTable dt = DBAccess.RunSQLReturnTable(ps);
        int allCount = 0;
        int count = 0;
        int wfstate = 0;
        int returnCount = 0;
        for (DataRow dr : dt.Rows)
        {
            count = Integer.parseInt(dr.getValue(0).toString());
            wfstate = Integer.parseInt(dr.getValue(1).toString());
            allCount += count;
            if (wfstate == WFState.Complete.getValue())
            {
                ht.put("GWF_CompleteCounts", count);
            }
            if (wfstate == WFState.ReturnSta.getValue())
            {
                returnCount = count;
                ht.put("GWF_ReturnCounts", count);
            }

            if (wfstate == WFState.Delete.getValue())
            {
                ht.put("GWF_DeleteCounts", count);
            }

        }
        //本部门的查询显示数量
        ps.SQL = "SELECT Count(DISTINCT G.WorkID) From WF_GenerWorkFlow G,WF_GenerWorkerlist L Where  G.WorkID=L.WorkID AND G.WFState=2 AND G.FK_Flow=" + dbStr + "FK_Flow AND L.IsPass=0";
        ps.Add("FK_Flow", this.getFK_Flow());
        int runingCount = DBAccess.RunSQLReturnValInt(ps);
        ht.put("GWF_RuningCounts", runingCount + returnCount);
        ht.put("GWF_Counts", allCount);
        ht.put("GWF_OverCounts", DBAccess.RunSQLReturnValInt("SELECT COUNT(DISTINCT A.WorkID) FROM WF_GenerWorkFlow A,WF_GenerWorkerList B WHERE A.WorkID=B.WorkID AND A.WFState>1 AND  B.IsPass=0 AND B.FK_Flow='" + this.getFK_Flow() + "'  AND  convert(varchar(100),B.SDT,120) < CONVERT(varchar(100), GETDATE(), 120)"));

        return bp.tools.Json.ToJson(ht);
    }


    /**
     获取单个流程的数据分析

     @return
     */
    public final String DataPanelOrg_GetAnalyseByFlowNo_DataSet() throws Exception {
        DataSet ds = new DataSet();
        //按照月份(统计的内容有发起数,完成数量,业务字段)
        //发起数量
        String sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, count(WorkID) AS Num FROM WF_GenerWorkFlow WHERE WFState >1  AND FK_Flow='" + this.getFK_Flow() + "' AND FK_NY>DateName(year,GetDate())+'-00' GROUP BY FK_NY ";
        DataTable FlowStartByNY = DBAccess.RunSQLReturnTable(sql);
        FlowStartByNY.TableName = "FlowStartByNY";
        ds.Tables.add(FlowStartByNY);
        //完成数量
        sql = "SELECT SUBSTRING(FK_NY, 6, 2) AS FK_NY, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState=3 AND  FK_Flow='" + this.getFK_Flow() + "' AND FK_NY>DateName(year,GetDate())+'-00' GROUP BY FK_NY ";
        DataTable FlowCompleteByNY = DBAccess.RunSQLReturnTable(sql);
        FlowCompleteByNY.TableName = "FlowCompleteByNY";
        ds.Tables.add(FlowCompleteByNY);


        //按照部门
        //发起数量
        sql = "SELECT DeptName, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState >1  AND FK_Flow='" + this.getFK_Flow() + "' GROUP BY DeptName ";
        DataTable FlowStartByEmp = DBAccess.RunSQLReturnTable(sql);
        FlowStartByEmp.TableName = "FlowStartByDept";
        ds.Tables.add(FlowStartByEmp);
        //完成数量
        sql = "SELECT DeptName, count(WorkID) as Num FROM WF_GenerWorkFlow WHERE WFState=3  AND FK_Flow='" + this.getFK_Flow() + "' GROUP BY DeptName ";
        DataTable FlowCompleteByEmp = DBAccess.RunSQLReturnTable(sql);
        FlowCompleteByEmp.TableName = "FlowCompleteByDept";
        ds.Tables.add(FlowCompleteByEmp);

        return bp.tools.Json.ToJson(ds);
    }

}

AtPara

package bp.da;

import java.io.Serializable;
import java.util.*;

public class AtPara  implements Serializable
{
	/** 
	 工作
	*/
	public AtPara()throws Exception
	{
	}
	/** 
	 执行一个para
	 
	 param para
	*/
	public AtPara(String para)  {
		if (para == null)
		{
			return;
		}

		String[] strs = para.split("[@]", -1);
		for (String str : strs)
		{
			if (DataType.IsNullOrEmpty(str) == true)
			{
				continue;
			}
			String[] mystr = str.split("[=]", -1);
			if (mystr.length == 2)
			{
				this.SetVal(mystr[0], mystr[1]);
			}
			else
			{
				String v = "";
				for (int i = 1; i < mystr.length; i++)
				{
					if (i == 1)
					{
						v += mystr[i];
					}
					else
					{
						v += "=" + mystr[i];
					}
				}
				this.SetVal(mystr[0], v);
			}
		}
	}
	public final void SetVal(String key, String val)  {
		try
		{
			this.getHisHT().put(key, val);
		}
		catch (java.lang.Exception e)
		{
			this.getHisHT().put(key, val);
		}
	}
	public final String GetValStrByKey(String key)  {
		Object tempVar = this.getHisHT().get(key);
		String str = tempVar instanceof String ? (String)tempVar : null;
		if (str == null)
		{
			return "";
		}
		return str;
	}
	public final boolean GetValBoolenByKey(String key)  {
		if (this.GetValIntByKey(key) == 0)
		{
			return false;
		}
		return true;
	}
	public final boolean GetValBoolenByKey(String key, boolean isNullAsVal)  {
		String str = this.GetValStrByKey(key);
		if (DataType.IsNullOrEmpty(str) == true)
		{
			return isNullAsVal;
		}

		if (str.equals("0") == true)
		{
			return false;
		}
		return true;
	}

	public final float GetValFloatByKey(String key)
	{
		return GetValFloatByKey(key, 0);
	}


//ORIGINAL LINE: public float GetValFloatByKey(string key, float isNullAsVal = 0)
	public final float GetValFloatByKey(String key, float isNullAsVal)
	{
		try
		{
			return Float.parseFloat(this.GetValStrByKey(key));
		}
		catch (java.lang.Exception e)
		{
			return isNullAsVal;
		}
	}

	public final int GetValIntByKey(String key)  {
		return GetValIntByKey(key, 0);
	}


	public final int GetValIntByKey(String key, int isNullAsVal)  {
		String str = this.GetValStrByKey(key);
		if (str.equals("undefined") || DataType.IsNullOrEmpty(str))
		{
			return isNullAsVal;
		}

		return Integer.parseInt(str);

	}
	public final long GetValInt64ByKey(String key)
	{
		try
		{
			return Long.parseLong(this.GetValStrByKey(key));
		}
		catch (java.lang.Exception e)
		{
			return 0;
		}
	}
	private Hashtable _HisHT = null;
	public final Hashtable<String, String> getHisHT()
	{
		if (_HisHT == null)
		{
			_HisHT = new Hashtable();
		}
		return _HisHT;
	}

	public final void setHisHT(Hashtable ht){
		this._HisHT = ht;
	}
	public final String GenerAtParaStrs()
	{
		String s = "";
		for (Object key : this.getHisHT().keySet())
		{
			s += "@" + key + "=" + this._HisHT.get(key).toString();
		}
		return s;
	}
}

Cash

package bp.da;

import bp.difference.ContextHolderUtils;
import bp.difference.SystemConfig;

public class CashFrmTemplate {

    ///对实体的操作.

    /**
     * 放入表单
     * <p>
     * param frmID 表单ID
     * param ds 表单模版
     *
     * @throws Exception
     */
    public static void Put(String frmID, DataSet ds) throws Exception {
        if (ds == null) return;
        String json = bp.tools.Json.ToJson(ds);
        ContextHolderUtils.getRedisUtils().set(false, SystemConfig.getRedisCacheKey(frmID), json);
    }

    /**
     * 移除
     * <p>
     * param frmID 表单ID
     */
    public static void Remove(String frmID) {
        ContextHolderUtils.getRedisUtils().del(false, SystemConfig.getRedisCacheKey(frmID));
    }

    /**
     * 获得表单DataSet模式的模版数据
     * <p>
     * param frmID 表单ID
     *
     * @return 表单模版
     */
    public static DataSet GetFrmDataSetModel(String frmID) throws Exception {
        Object result = ContextHolderUtils.getRedisUtils().get(false, SystemConfig.getRedisCacheKey(frmID));
        if (result != null) {
            DataSet ds = bp.tools.Json.ToDataSet(result.toString());
            return ds;
        }
        return null;
    }

    /**
     * 获得表单json模式的模版数据
     * <p>
     * param frmID 表单ID
     *
     * @return json
     */

    /// 对实体的操作.

}

ChartType

package bp.da;



/** 
 图表类型
*/
public enum ChartType
{
	/** 
	 柱状图
	*/
	Histogram,
	/** 
	 丙状图
	*/
	Pie,
	/** 
	 折线图
	*/
	Line;

	public static final int SIZE = java.lang.Integer.SIZE;

	public int getValue()
	{
		return this.ordinal();
	}

	public static ChartType forValue(int value) 
	{
		return values()[value];
	}
}

参考资料和推荐阅读

  1. 暂无

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/157658.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

JS面试题--JS函数式编程

JS函数式编程 实现apply、call、bind 01_call函数的实现 // apply/call/bind的用法 // js模拟它们的实现? 难度// 给所有的函数添加一个hycall的方法 同个原型链 Function.prototype.hycall function (thisArg, ...args) {// 在这里可以去执行调用的那个函数(foo)// 问题: …

亚马逊云科技:“云”筹帷幄,打造数据驱动型企业

数据对提高企业生产和资源配置的效率、优化经济结构的作用日益凸显。工业和信息化部发布的《“十四五”大数据产业发展规划》已明确将数据作为新时代重要的生产要素和国家基础性战略资源。埃森哲研究显示&#xff0c;到2022年&#xff0c;90%的企业战略明确将把数据作为关键的企…

前端面试题回顾——React重要知识

文章目录React相关问题1. 函数式组件与Class组件有什么不同&#xff1f;2. 说说React的fiber架构&#xff1f;3. 协调4. 虚拟DOM (Virtual DOM)React相关问题 1. 函数式组件与Class组件有什么不同&#xff1f; 答&#xff1a; ① 函数式组件不需要继承&#xff0c;直接 “fun…

数据结构基础——认识数据结构与算法

目录 &#x1f354;什么是数据结构&#xff1f; &#x1f32d;1.数据的逻辑结构 &#x1f32d;NUM 1 : 集合 &#x1f32d;NUM 2 : 线性结构 &#x1f32d;NUM 2 : 树形结构 &#x1f32d;NUM 4 :图结构&#xff08;网状结构&#xff09;…

浅谈反弹shell

目录反弹shell总结一、文件描述符二、重定向1、输入重定向2、输出重定向3、错误输出重定向4、exec 绑定重定向三、实现反弹shell的几种方式方法一&#xff1a; find 反弹ubuntu find反弹shell失败的问题任务计划反弹shell失败的问题方法二&#xff1a;使用python反弹&#xff0…

Flink系列-4、Flink运行架构

版权声明&#xff1a;本文为博主原创文章&#xff0c;遵循 CC 4.0 BY-SA 版权协议&#xff0c;转载请附上原文出处链接和本声明。 大数据系列文章目录 官方网址&#xff1a;https://flink.apache.org/ 学习资料&#xff1a;https://flink-learning.org.cn/ 目录Flink基石Fli…

刚当上leader,我让组员去开会,他非说有更重要的会

☆ 职场上经常有那么一种情况就是组长喊组员开会&#xff0c;开周会&#xff0c;开晨会&#xff0c;开各种会&#xff0c;而更有一种常见的情况呢就是组长缺失威严&#xff0c;喊组员开会&#xff0c;组员不听话&#xff0c;说有更重要的会议&#xff0c;不想参加。 ☆ 本文将以…

VIT学习心得

来源&#xff1a;投稿 作者&#xff1a;橡皮 编辑&#xff1a;学姐 小声逼逼 在过去的两年里&#xff0c;Vision Transformer(ViT)是计算机视觉(cv)领域最有影响力的工作之一。「它推翻了2012年在Alex net中提出的CNN在CV领域的统治地位&#xff1a; 当能够获得足够多的预训练…

无接触式磁旋转编码器AS5040介绍

无接触式磁旋转编码器AS5040简介AS5040 是一款无接触式磁旋转编码器&#xff0c;用于精确测量整个360内的角度。此产品是一个片上系统&#xff0c;在单个封装内整合了集成式Hall 元件、模拟前端和数据信号处理功能。测量角度时&#xff0c;只需简单地配备1 个在芯片中心上方旋转…

Spring5的全细节回顾总结

概述&#xff1a; https://cntofu.com/book/95/33-what-new-in-the-spring-framework.md 这个不错。 轻量级javaee框架。 针对于bean的生命周期进行管理。 解决企业应用开发的复杂性。 核心&#xff1a; ​ IOC&#xff1a;控制反转&#xff0c;把创建对象的过程交给sprin…

第一天 Blender操作 | 大帅老猿threejs特训【超详细】

前言 这一天主要是基础理论的学习。 本人学习资料仓库 https://gitee.com/zhang_dezheng_hsr/three-demo.git YCY-TrainingCamp-S2: 在原有的文件上添加本人的学习记录 第一天 Blender操作 | 大帅老猿threejs特训【超详细】【我在掘金的同名文章】 一、大纲 二、THREE 基础概…

Linux查看某个应用的CPU/内存/网卡使用情况

1.查看CPU的使用率 # ps -ef | grep zabbix 进程号是1715 # top -p 1715 可以看到CPU的使用率是0 &#xff0c; 内存的使用率是0 2.查看内存真实使用了多少 #cat /proc/[pid]/status #cat /proc/1715/status VmPeak:进程所使用的虚拟内存的峰值 VmSize: 进程当前使用…

22.字符串初始化方法及赋值,字符串和指针总结

目录 初始化 1.字符数组初始化 2.指针指向文字常量区&#xff0c;初始化 3.指针指向堆区&#xff0c;堆区存放字符串 使用时赋值 1.字符数组&#xff0c;使用scanf或者strcpy 2.指针指向文字常量区 3.指针指向堆区&#xff0c;堆区存放字符串 初始化 1.字符数组初始化 …

各国家语言代码对照表

来源如下 Language Code Tablehttp://www.lingoes.cn/zh/translator/langcode.htm 详情如下 语言代码语言名称af南非语af-ZA南非语ar阿拉伯语ar-AE阿拉伯语(阿联酋)ar-BH阿拉伯语(巴林)ar-DZ阿拉伯语(阿尔及利亚)ar-EG阿拉伯语(埃及)ar-IQ阿拉伯语(伊拉克)ar-JO阿拉伯语(约旦…

万字详解 Linux 网络管理

万字详解 Linux 网络管理1.Linux处理数据包过程2.和网络相关的几个文件说明网卡配置文件ifcfg-*DNS配置文件/etc/resolv.conf&#xff08;CentOS6环境&#xff09;/etc/services3.网络接口配置和主机名ifconfigifcfghostname命令4.网关/路由5.网关/路由相关命令route命令配置永…

netty(1):NIO 基础之三大组件

1 三大组件 1.1 Channel & Buffer channel 有一点类似于 stream&#xff0c;它就是读写数据的双向通道&#xff0c;可以从 channel 将数据读入 buffer&#xff0c;也可以将 buffer 的数据写入 channel&#xff0c;而之前的 stream 要么是输入&#xff0c;要么是输出&…

如何用idea快速的debug本地程序

介绍大家都经常用idea开发, 开发过程中运行程序就会出现各种意料之外的异常, 如果解决这些异常, 尤其是三方jar包抛出的异常,就是一个很关键和棘手的问题.配置环境在第一个选项位置点开后会弹出配置页面,里面可以配置一些启动需要的环境变量.第二个是debug启动按钮第三个是程序…

SQL 优化方案(规范)

SQL优化1、SQL执行顺序2、前置条件2.1、使用explain分析SQL执行计划2.2、开启慢sql日志2.3、慢查询时间设置。默认情况下long_query_time的值为10秒&#xff0c;可以使用命令修改&#xff0c;也可以在my.cnf参数里面修改。3、基础Sql优化3.1、小表驱动大表3.2、高效的分页3.3、…

【linux入门】Linux基础知识学习笔记

文章目录【第一章-宏观知识】1.硬件和软件的关系2.操作系统 是什么、作用是什么3.常见的操作系统4.Linux的诞生5.Linux内核 是什么6.Linux发行版 是什么7.WSL是什么8.虚拟机快照9.FinalShell&#xff08;Xshell替代品&#xff09;【第二章-Linux基础命令】1.Linux目录结构2.什么…

Linux下ElasticSearch安装和基本使用

安装 下载安装目录:/home/es-7.12.0 es启动用户:zmsz 出于安全考虑,elasticsearch默认不允许以root账号运行,所有一定要创建一个其他用户执行启动命令,不然一定会报错!! 创建用户:useradd zmsz 设置密码:passwd zmsz下载解压 下载:官网 以最新版8.6为准,执行wget …