⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cen_oper.new.h

📁 界面头文件
💻 H
字号:
extern int audit(), check_cen_oper(), get_normal_stop(), get_log_state();
static int chk_cen_oper(), set_oper_state(), set_oper_flag();
static int check_operbankid();
int	check_sys_role(), set_oper_default();

extern WINDOW *sql_win;
extern int do_query, do_insert, do_update, do_delete;
extern char G_oper_no[7];

S_center_oper cen_oper;

struct field_st cen_oper_form[] = {
{
	"oper_no",
	FLD_BEGIN + FLD_STRING + FLD_DIGITAL + FLD_UPD + FLD_CHK,
	17, 2, "",
	5, 24, 2,
	(void *)cen_oper.oper_no,
	chk_cen_oper,
	NULL,
},
{
	"oper_name",
	FLD_STRING,
	17, 2, "",
	5, 46, 10,
	(void *)cen_oper.oper_name,
	set_oper_flag,
	NULL
},
{
	"role_code",
	FLD_STRING,
	17, 2, "系统角色:???查询当前可用的角色代码",
	6, 24, 3,
	(void *)cen_oper.role_code,
	check_sys_role,
	NULL
},
{
	NULL,
	FLD_FORM + FLD_STRING,
	17, 2, "",
	6, 30, 30,
	(void *)pub.unit_name,
	NULL,
	NULL
},
{
	"bank_id",
	FLD_CHK + FLD_STRING,
	17, 2, "请输入操作员所属于的银行行号",
	7, 24, 11,
	(void *)cen_oper.bank_id,
	/*check_operbankid*/NULL,
	NULL
},
{
	NULL,
	FLD_FORM + FLD_STRING,
	17, 2, "",
	7, 39, 30,
	(void *)pub.bankname,
	NULL,
	NULL
},
{
	"use_flag",
	FLD_STRING,
	17, 2, "使用状态 : Y.正常 / N.禁止",
	9, 24, 1,
	(void *)cen_oper.use_flag,
	get_normal_stop,
	NULL
},
{
	NULL,
	FLD_FORM + FLD_STRING,
	17, 2, "",
	9, 28, 4,
	(void *)pub.normal_stop,
	set_oper_default,
	NULL
},
{
	"log_stat",
	FLD_UPD + FLD_INS + FLD_STRING,
	17, 2, "登录状态 : I.在线 / O.离线",
	11, 24, 1,
	(void *)cen_oper.log_stat,
	get_log_state,
	NULL
},
{
	NULL,
	FLD_FORM + FLD_STRING,
	17, 2, "",
	11, 28, 4,
	(void *)pub.log_state,
	NULL,
	NULL
},
{
	"father",
	FLD_UPD + FLD_INS + FLD_STRING,
	17, 2, "",
	11, 46, 2,
	(void *)cen_oper.father,
	check_cen_oper,
	NULL
},
{
	NULL,
	FLD_FORM + FLD_STRING,
	17, 2, "",
	11, 51, 10,
	(void *)pub.cen_oper_name,
	NULL,
	NULL
},
/*
 * 因显示格式与字段值有差异,因此增加FLD_FORM
 * 域用于显示,本域则置为FLD_SKIP,以便显示或
 * 输入时不使用,但构造insert,update语句时使用之。
 *
 * 因其值无需输入,为系统自动给出,因此应由前面
 * 某个字段中执行fieldcheck()予以设置,如
 * set_oper-default
 *
 * 为此,tool.c中有关FORM,VIEW,NOEDIT等的fieldcheck
 * 函数已放开执行。
 */
{
	"update_date",
	FLD_SKIP + FLD_STRING,
	0, 0, "",
	0, 0, 0,
	(void *)cen_oper.update_date,
	NULL,
	NULL
},
{
	"NULL",
	FLD_FORM + FLD_STRING,
	17, 2, "",
	13, 36, 10,
	(void *)pub.update_date,
	NULL,
	NULL
},
{
	"update_time",
	FLD_SKIP + FLD_STRING,
	0, 0, "",
	0, 0, 0,
	(void *)cen_oper.update_time,
	NULL,
	NULL
},
{
	"NULL",
	FLD_FORM + FLD_STRING,
	17, 2, "",
	13, 49, 8,
	(void *)pub.update_time,
	NULL,
	NULL
},
{
	"oper_pwd",
	FLD_END+FLD_SKIP + FLD_STRING,
	0, 0, "",
	0, 0, 0,
	(void *)cen_oper.oper_pwd,
	NULL,
	NULL
}
};

struct field_st *cen_oper_ptr=cen_oper_form;

struct screen_st cen_oper_st= {
	"cen_oper.view",
	{0, 0, 0, 0},
	0,
	cen_oper_form,
	0,
	"center_oper",
	audit,
	audit,
	audit,
	NULL
};

static int chk_cen_oper(char *id)
{
	int value;
	char que_str[100];

	if (!id[0]) return(0);

	if (do_query) return(0);

	sprintf(que_str,
		"select count(*) from center_oper where oper_no = \'%s\'",
		id);
#ifdef zgx010429_modi
	if (query_count(que_str)) return(E_CEN_OPER_EXIST/*26*/);	/* 中心柜员重复 */
#else
	if (query_count(que_str))
		if (do_insert)
			return(E_CEN_OPER_EXIST/*26*/);	/* 中心柜员重复 */
#endif

	return(0);
}

static int set_oper_state(char *str)
{
	if (do_insert) {
	    cen_oper.log_stat[0] = 'O';
	    strcpy(pub.log_state, "离线");
	    strcpy(cen_oper.father, G_oper_no);
	    check_cen_oper(G_oper_no);
	}
	return(0);
}

/*
 * 设置操作员缺省标志:use_flag
 */
static int set_oper_flag(char *nop)
{
	if (do_insert && !cen_oper.use_flag[0])
		cen_oper.use_flag[0] = 'Y';
	return(0);
}

/*
 * 设置操作员缺省信息:log_stat,update_date,update_time
 */
static int set_oper_default(char *nop)
{
	if (do_insert && !cen_oper.log_stat[0])
		cen_oper.log_stat[0] = 'O';
	if (do_insert && !cen_oper.father[0]) {
		strcpy(cen_oper.father, G_oper_no);
		check_cen_oper(cen_oper.father);
	}
	
	/*
	 * 新增操作员密码置为‘0000’
	 */
	if (do_insert && !cen_oper.oper_pwd[0]) {
		strcpy(cen_oper.oper_pwd, "0000");
		cy_oper(cen_oper.oper_pwd);
	}

	if (do_insert || do_update) {
		getdatef(cen_oper.update_date, "");
		gettimef(cen_oper.update_time, "");
	}

	str2date(pub.update_date, cen_oper.update_date, "/");
	str2time(pub.update_time, cen_oper.update_time, ":");

	return(0);
}

/*
 * 检察系统角色代码的合法性,并获取角色名称
 * ???查询,代码不合法时也弹出窗口查询
 */
int check_sys_role(role_code)
char *role_code;
{
	char role_name[11];
	char sel_role[4];
	char sql_str[256];
	char ret = 0;

	sel_role[0] = '\0';
	role_name[0] = '\0';

	DelSpace(role_code);

	if (get_role_name(role_code, role_name) < 0) {
		if (do_query) {
			pub.unit_name[0] = '\0';
			return(0);
		}
		goto inq_sel;
	}
	strcpy(pub.unit_name, role_name);
	return(0);
inq_sel:
	sprintf(sql_str, "select role_code, role_name from sys_role");
	ret = inq_select(sql_str,  sel_role, role_name);
	if (ret == 0) {
		strcpy(role_code, sel_role);
		strcpy(cen_oper.role_code, sel_role);
		strcpy(pub.unit_name, role_name);
		return(0);
	} else if (ret == -2) {
		cen_oper.role_code[0] = '\0';
		role_code[0] = '\0';
		pub.unit_name[0] = '\0';
		return(87);	/* 库中无计数 */
	} else if (ret == -3) {	/* ESC */
		cen_oper.role_code[0] = '\0';
		role_code[0] = '\0';
		pub.unit_name[0] = '\0';
		return(0);
	} else {
		cen_oper.role_code[0] = '\0';
		role_code[0] = '\0';
		pub.unit_name[0] = '\0';
		return(1);
	}
}

static int check_operbankid( char *id )
{
	int ret;
	char que_str[100];

	pub.bankname[0] = 0;

	if (!id[0]) return(0);

	if (do_insert || do_update) {
		sprintf(que_str,
		"select count(*) from bank_info where bank_id  = '%s' ", id);
		ret = query_count(que_str);
		if( !ret) return  32;
	}

	ret = get_bank_name(id,"00", pub.bankname);

	if (do_query) return(0);
	if (ret) return(32);	/* 无此联行行号 */

	return(0);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -