eis/inc/dao/ShiftDAO.h

256 lines
8.9 KiB
C++
Raw Permalink 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.

/*********************************************************************
*
* 文 件: ShiftDAO.h 班组模块数据访问接口,默认提供Proc方式实现
*
* 版权所有: Shanghai Baosight Software Co., Ltd.
*
* 概述:
*
*
*
* 版本历史
* 1.0 2010-06-22 echo_li 初次建立
* 2010-08-10 liliang 增加停机数据访问接口
* %USER%
*********************************************************************/
#ifndef SHIFTDAO_H_
#define SHIFTDAO_H_
#include <map>
#include <vector>
#include <string>
#include <dao/DbStandardDBAX.h>
#include "base/TCMTime.h"
using namespace std;
struct S_LOVSHIFT
{
string shift;
string nextShift;
int offset;
int duration;
int daychange;
};
struct S_TURN
{
int dayno;
string shiftNo;
string turnNo;
};
struct S_SHIFTINFO
{
S_TURN turn;//班组结构体
string prodDay;//生产日期
string startTime;//开始时间
string endTime;//结束时间
int duration;//持续时间
};
struct S_PRODUCTINFO
{
int inCoilNum; //输入钢卷数
int outCoilNum; //产出钢卷数
int inCoilWeight; //输入钢卷重量
int outCoilWeight; //产出钢卷重量
int coilLengthOut; //产出钢卷总长度
};
struct S_LINEDOWNINFO
{
int totalDownTimes; //停机时间
int totalDownNum;//停机次数
};
typedef vector<S_LOVSHIFT> V_LOVSHIFT;
typedef map<int,vector<S_TURN> > M_LOVTURNLIST;
namespace baosight{
class ShiftDAO{
public:
/**********************************************************************
* 概述: 获取班组轮换顺序
* 函数名: GetTurnList
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* lovTurnList: M_LOVTURNLIST &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short GetTurnList(M_LOVTURNLIST& lovTurnList);
/**********************************************************************
* 概述: 获取班信息配置
* 函数名: GetLovShift
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* lovShift: V_LOVSHIFT &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short GetLovShift(V_LOVSHIFT& lovShift);
/**********************************************************************
* 概述: 获取班信息配置
* 函数名: GetLovShift
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* lovShift: V_LOVSHIFT &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short GetLoopDays();
/**********************************************************************
* 概述: 设置活动班标志
* 函数名: SetActShift
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* shift: const S_TURN &
* flag: int
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short SetActShift(const S_TURN& shift,int flag = 0);
/**********************************************************************
* 概述: 设置当前班信息
* 函数名: SetCurrentShiftData
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* shiftInfo: S_SHIFTINFO
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short SetCurrentShiftData(S_SHIFTINFO shiftInfo) = 0;
/**********************************************************************
* 概述: 获取最后一班的结束时间
* 函数名: GetLastShiftEndTime
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* time: string &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short GetLastShiftEndTime(string& time) = 0;
/**********************************************************************
* 概述: 更新上一班数据
* 函数名: UpdatePreShiftData
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* shiftInfo: const S_SHIFTINFO &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short UpdatePreShiftData(const S_SHIFTINFO& shiftInfo)=0;
/**********************************************************************
* 概述: 统计班信息
* 函数名: StatShiftProdInfo
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* shiftInfo: const S_SHIFTINFO &
* proInfo: S_PRODUCTINFO &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
* 1.1 2010-10-27 liliang 增加参数flag用于判断是否统计过渡卷,默认不统计过渡卷
*
**********************************************************************/
virtual short StatShiftProdInfo(const S_SHIFTINFO& shiftInfo,S_PRODUCTINFO& proInfo,short flag = 0)=0;
/**********************************************************************
* 概述: 统计停机信息
* 函数名: StatLineInfo
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* shiftInfo: const S_SHIFTINFO &
* lineInfo: S_LINEDOWNINFO &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
virtual short StatLineInfo(const S_SHIFTINFO& shiftInfo,S_LINEDOWNINFO& lineInfo);
/**********************************************************************
* 概述: 插入停机记录
* 函数名: InsertLineStop
* 返回值: short 成功返回0失败返回-1
* 参数列表: 参数类型 取值范围 描述
* stopTime: string 停机开始时间
* shiftInfo: const S_SHIFTINFO & 停机所在班信息
*
* 版本历史
* 1.0 2010-08-10 echo_li 初次建立
*
**********************************************************************/
virtual short InsertLineStop(string stopTime,const S_SHIFTINFO& shiftInfo,string secName = "PS");
/**********************************************************************
* 概述: 开机更新停机记录
* 函数名: UpdateLineStop
* 返回值: long
* 参数列表: 参数类型 取值范围 描述
* startTime: string 停机结束时间
* shiftNo: string 停机所在班
*
* 版本历史
* 1.0 2010-08-10 echo_li 初次建立
*
**********************************************************************/
virtual long UpdateLineStop(string startTime,string shiftNo,string secName = "PS");
virtual long UpdateLineStop(string startTime,string shiftNo,char *coilId,string secName = "PS");
/**********************************************************************
* 概述: 按指定时间分割停机记录
* 函数名: DevideDisTurbance
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
* devideTime: string 停机分割时间
* shiftInfo: const S_SHIFTINFO & 分割所在的班信息
*
* 版本历史
* 1.0 2010-08-10 echo_li 初次建立
*
**********************************************************************/
virtual short DevideDisTurbance(string devideTime,const S_SHIFTINFO& shiftInfo);
/**********************************************************************
* 概述: 获取当前生产线的运行状态
* 函数名: LineStatus 成功返回生产线状态,失败返回-1
* 返回值: short
* 参数列表: 参数类型 取值范围 描述
*
* 版本历史
* 1.0 2010-08-10 echo_li 初次建立
*
**********************************************************************/
virtual short LineStatus(string secName);
virtual short addNewCrew( const string& crew) =0;
protected:
void InitMember();
public:
ShiftDAO();
~ShiftDAO();
protected:
char* mp_dbMessage;
char m_dbWhere[200];
char m_dbOrder[100];
int m_dbCode;
};
}
#endif