eis/inc/cda/ScheduleDAO.h

470 lines
19 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************
*
* 文 件: ScheduleDAO.h //TODO请概述文件功能
*
* 版权所有: Shanghai Baosight Software Co., Ltd.
*
* 概述://TODO请添加本文件包含功能详细描述
* //TODO
* //TODO
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
* %USER%
*********************************************************************/
#ifndef SCHEDULEDAO_H_
#define SCHEDULEDAO_H_
#include <log4cplus/LOG.h>
#include <string>
#include <cda/PmgDefine.h>
#include <glob/GlobDefine.h>
#include <dao/MaterialInfo.h>
#include <dao/DbStandardDBAX.h>
#include <cda/CusCopyProcess.h>
#include <common/UserConst.h>
using namespace std;
using namespace log4cplus;
namespace baosight{
/*********************************************************************
* 类 名: ScheduleDAO
* 版权所有: Shanghai Baosight Software Co., Ltd.
* 类 职 责:
* :
* :
* 版本历史
* 1.0 2010-08-27 echo_li 增加注释
*
*********************************************************************/
class ScheduleDAO{
public:
/**********************************************************************
* 概述: //TODO:插入计划头
* 函数名: InsertScheduleHeader
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* header : [IN/OUT] S_ScheduleHeader & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short InsertScheduleHeader(S_ScheduleHeader& header);
/**********************************************************************
* 概述: //TODO:插入计划
* 函数名: InsertSchedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilInfo : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
* preCoil : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short InsertSchedule(S_COILINFO& coilInfo,const char* preCoil = NULL);
/**********************************************************************
* 概述: //TODO:更新计划
* 函数名: UpdateProdschedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* info : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short UpdateProdschedule(S_COILINFO& info);
virtual short UpdateProdschedule( MU_CODE& phMu, const string& planno = "");
/**********************************************************************
* 概述: //TODO:插入过渡卷
* 函数名: InsertDummySche
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilInfo : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short InsertDummySche(S_COILINFO& coilInfo);
/**********************************************************************
* 概述: //TODO:插入剪切计划
* 函数名: InsertCutSchedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* muCode : [IN/OUT] const MU_CODE & //TODO:参数取值范围 <//TODO:参数描述>
* divLen : [IN/OUT] const S_DIVLEN & //TODO:参数取值范围 <//TODO:参数描述>
* mode : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short InsertCutSchedule(const MU_CODE& muCode,const S_DIVLEN& divLen,int mode);
/**********************************************************************
* 概述: //TODO:0删除钢卷1删除正常计划 2,删除过渡卷计划
* 函数名: DeleteSchedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* pInfo : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
* flag : [IN/OUT] short //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short DeleteSchedule(S_COILINFO& pInfo,short flag = 0);
/**********************************************************************
* 概述: 删除钢卷计划
* 函数名: DeleteCoil
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* coilId: const char * 钢卷号
*
* 版本历史
* 1.0 2010-09-01 echo_li 初次建立
*
**********************************************************************/
virtual short DeleteCoil(const char* coilId);
virtual short DeleteScheduleByCoil( const string& coilid);
virtual short DeleteScheduleByPlanNo(const string& planNo);
/**********************************************************************
* 概述: 删除计划
* 函数名: DeletePlan
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* planNo: const char *
*
* 版本历史
* 1.0 2010-09-01 echo_li 初次建立
*
**********************************************************************/
virtual short DeletePlan(const char* planNo);
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: GetCoilItem
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilInfo : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short GetCoilItem(S_COILINFO& coilInfo);
virtual int GetCoilStatus( const string& coilid);
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: GetCoilItem
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilSeq : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
* coilInfo : [IN/OUT] S_COILINFO & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short GetCoilItem(int coilSeq,S_COILINFO& coilInfo);
/**********************************************************************
* 概述: //TODO:根据钢卷号获取钢卷序号
* 函数名: GetCoilSeq
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilId : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int GetCoilSeq(const char* coilId);
/**********************************************************************
* 概述: //TODO:根据序号获取钢卷号
* 函数名: GetCoilId
* 返回值: std::string //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilSeq : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual string GetCoilId(int coilSeq);
/**********************************************************************
* 概述: //TODO:获取最大的钢卷序号
* 函数名: GetMaxCoilSeq
* 返回值: int //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual int GetMaxCoilSeq();
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: GetRollItem
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* rollInfo : [IN/OUT] S_ROLLINFO & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short GetRollItem(S_ROLLINFO& rollInfo);
/**********************************************************************
* 概述: //TODO:调整计划顺序
* 函数名: MoveCoil
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* start : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
* end : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
* dest : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
* flag : [IN/OUT] int //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short MoveCoil(int start,int end,int dest,int flag);
/**********************************************************************
* 概述: //TODO:复制原始数据
* 函数名: CopyCoil
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* srcCoil : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
* destEntCoil : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
* destExtCoil : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short CopyCoil(const char* srcCoil,const char* destEntCoil,const char* destExtCoil);
/**********************************************************************
* 概述: //TODO:载入过渡卷
* 函数名: LoadDummy
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* dummy : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
* sche : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short LoadDummy(const char* dummy,const char* sche);//过渡卷装载
/**********************************************************************
* 概述: //TODO:获取插入钢卷的序号
* 函数名: PutCoilAtEndOfProdSchedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* majNo : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
* minNo : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
* coilSeq : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
* next : [IN/OUT] short & //TODO:参数取值范围 <//TODO:参数描述>
* preCoil : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short PutCoilAtEndOfProdSchedule(long& majNo,long& minNo,long& coilSeq,short& next,const char* preCoil = NULL);
/**********************************************************************
* 概述: //TODO:获取新的MuId
* 函数名: GetNewMeId
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* newMeId : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
* newBasId : [IN/OUT] short & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short GetNewMeId(long& newMeId , short& newBasId);
/**********************************************************************
* 概述: //TODO:执行SQL语句
* 函数名: Execute
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* fullSql : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short Execute(const char* fullSql);
/**********************************************************************
* 概述: //TODO:检查计划中是否存在该卷
* 函数名: CheckCoilInSchedule
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilId : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short CheckCoilInSchedule(const string& coilId);
//rmbai 2012-03-21
virtual short CheckCoilInDummy(const string& coilId);
//2011-07-26 rmbai 处理返修卷的钢卷号
virtual short ReSetProdMaterialInfo(const char* coilId);
//2011-07-26 rmbai 获得当前钢卷在T_MU表中的MUTYP='PH'的数量
virtual short GetCountMaterialInfo(const char* coilid);
/**********************************************************************
* 概述: //TODO:检查钢卷是否是孤过渡卷
* 函数名: CheckCoilIsDummy
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilId : [IN/OUT] const char * //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short CheckCoilIsDummy(const char* coilId);
/**********************************************************************
* 概述: 检查钢种是否存在
* 函数名: CheckSteelGrade
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* steelGrea: const char * 待检查的钢种
*
* 版本历史
* 1.0 2010-08-23 echo_li 初次建立
*
**********************************************************************/
virtual short CheckSteelGrade(const char* steelGrea);
/**********************************************************************
* 概述: 从接受电文表中读取AccessFlag标志为
* 函数名: ReadTeleData
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* eventNo: int &
* teledata: string &
*
* 版本历史
* 1.0 2010-08-27 echo_li 初次建立
*
**********************************************************************/
virtual short ReadTeleData(int& eventNo,string& teledata);
/**********************************************************************
* 概述: 更新电文发送标志
* 函数名: UpdateTeleData
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* seq: int 电文序号
* accessFlag: int 更新标志
*
* 版本历史
* 1.0 2010-08-30 echo_li 初次建立
*
**********************************************************************/
virtual short UpdateTeleData(int seq,int accessFlag);
/**********************************************************************
* 概述: 设置生产实绩的应答状态
* 函数名: UpdateProdStatus
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* extId: char *
* flag: char*
*
* 版本历史
* 1.0 2010-11-18 echo_li 初次建立
*
**********************************************************************/
virtual short UpdateProdStatus(char* extId,char* flag);
/**********************************************************************
* 概述: 是否存在material的信息
* 函数名: CheckMaterial
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* coilid: const string&
* :
*
* 版本历史
* 1.0 2012-03-19 Yllin 初次建立
*
**********************************************************************/
virtual short CheckMaterial(const string& coilid);
protected:
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: InitMember
* 返回值: void //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
void InitMember();
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: GetMaxMajMinNO
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* majNo : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
* minNO : [IN/OUT] long & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2011-06-10 fuxiandong //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual short GetMaxMajMinNO(long& majNo,long& minNO);
/**********************************************************************
* 概述: //TODO:请添加函数描述
* 函数名: GetMuId
* 返回值: short //TODO:返回值描述
* 参数列表: 参数类型 取值范围 描述
* coilId : [IN/OUT] string & //TODO:参数取值范围 <//TODO:参数描述>
* muTyp : [IN/OUT] string & //TODO:参数取值范围 <//TODO:参数描述>
*
* 版本历史
* 1.0 2012-04-06 rmbai //TODO请添加本次主要修改内容
*
**********************************************************************/
virtual long GetMuId(const string &coilId,const string &muTyp);
//修改卷号
virtual short RenameCoil(const MU_CODE& muCode,const MU_CODE& EnMuCode,int dummyFlag);
//检查卷号是否存在
virtual short CheckCoil(char* coilId,int dummyFlag);
public:
ScheduleDAO();
~ScheduleDAO();
protected:
char* mp_dbMessage;
char m_dbWhere[200];
char m_dbOrder[100];
MaterialInfo m_matInfo;
CopyProcess* mp_copy;
};
}
#endif