HRMS(Human Resource Management System)

--人员

per_people_f

--人员分配

per_all_assignments_f

--要素

 DECLARE
l_element_name VARCHAR2(240);
l_element_id NUMBER;
l_period_name VARCHAR2(240);
l_period_date DATE;
x_element_type_id NUMBER;
x_effective_start_date DATE;
x_effective_end_date DATE;
x_object_version_number NUMBER;
x_comment_id NUMBER;
x_processing_priority_warning BOOLEAN;
BEGIN
fnd_global.apps_initialize(user_id => 1510,
resp_id => 23991,
resp_appl_id => 800); l_element_name := 'BS交通补贴12';
l_period_name := '9 2016 日历月份'; BEGIN
SELECT ptp.end_date
INTO l_period_date
FROM per_time_periods ptp
WHERE ptp.period_name = l_period_name;
EXCEPTION
WHEN OTHERS THEN
l_period_date := NULL;
END; BEGIN
SELECT petf.element_type_id
INTO l_element_id
FROM pay_element_types_f petf
WHERE petf.element_name = l_element_name
AND l_period_date BETWEEN effective_start_date AND effective_end_date;
EXCEPTION
WHEN OTHERS THEN
l_element_id := NULL;
END; dbms_output.put_line('l_period_date:=' || l_period_date);
dbms_output.put_line('l_element_id:=' || l_element_id); IF (l_element_id IS NULL) THEN
dbms_output.put_line('Create'); pay_element_types_api.create_element_type(p_validate => FALSE,
p_effective_date => l_period_date,
p_classification_id => 118,
p_element_name => l_element_name,
p_input_currency_code => 'CNY',
p_output_currency_code => 'CNY',
p_multiple_entries_allowed_fla => 'Y',
p_processing_type => 'N',
p_business_group_id => 81,
p_element_type_id => x_element_type_id,
p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date,
p_object_version_number => x_object_version_number,
p_comment_id => x_comment_id,
p_processing_priority_warning => x_processing_priority_warning);
-- ELSE
-- pay_element_types_api.update_element_type();
END IF; IF x_processing_priority_warning THEN
dbms_output.put_line('x_processing_priority_warning');
END IF; dbms_output.put_line('x_element_type_id:=' || x_element_type_id);
dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
dbms_output.put_line('x_element_type_id:=' || x_object_version_number);
dbms_output.put_line('x_comment_id:=' || x_comment_id);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('导入要素异常!');
END;

创建要素

--链接

  /* IF (l_element_link_id IS NULL) THEN

       pay_element_link_api.create_element_link(p_validate                   => FALSE,
p_effective_date => l_period_date,
p_element_type_id => l_element_id,
p_business_group_id => 81,
p_costable_type => 'F',
p_payroll_id => l_payroll_id,
p_people_group_id => l_people_group_id,
p_cost_concat_segments => '01.000000.66010101.0000.00000000.0000.000000.00',
p_balance_concat_segments => '01.000000.22110101.0000.00000000.0000.000000.00',
p_cost_allocation_keyflex_id => 63,
p_balancing_keyflex_id => 76,
p_standard_link_flag => 'N',
p_element_link_id => x_element_link_id,
p_comment_id => x_comment_id,
p_object_version_number => x_object_version_number,
p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date); dbms_output.put_line('x_element_link_id:=' || x_element_link_id);
dbms_output.put_line('x_comment_id:=' || x_comment_id);
dbms_output.put_line('x_element_type_id:=' || x_object_version_number);
dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
END IF;*/

创建链接

--要素集

 DECLARE
l_element_name VARCHAR2(240);
l_element_id NUMBER;
l_period_name VARCHAR2(240);
l_period_date DATE;
l_assign_number VARCHAR2(240);
l_assignment_id NUMBER;
l_payroll_id NUMBER;
l_payroll VARCHAR2(240);
l_element_link_id NUMBER;
l_element_entry_id NUMBER;
l_people_group_id NUMBER;
x_element_link_id NUMBER;
x_effective_start_date DATE;
x_effective_end_date DATE;
x_object_version_number NUMBER;
x_comment_id NUMBER;
x_element_entry_id NUMBER;
x_create_warning BOOLEAN;
BEGIN fnd_global.apps_initialize(user_id => 1510,
resp_id => 23991,
resp_appl_id => 800); l_element_name := 'BS_FJJ_非计件日工';
l_period_name := '9 2016 日历月份';
l_assign_number := ''; BEGIN
SELECT ptp.end_date
INTO l_period_date
FROM per_time_periods ptp
WHERE ptp.period_name = l_period_name;
EXCEPTION
WHEN OTHERS THEN
l_period_date := NULL;
END; BEGIN
SELECT petf.element_type_id
INTO l_element_id
FROM pay_element_types_f petf
WHERE petf.element_name = l_element_name
AND l_period_date BETWEEN effective_start_date AND effective_end_date;
EXCEPTION
WHEN OTHERS THEN
l_element_id := NULL;
END; dbms_output.put_line('l_period_date:=' || l_period_date);
dbms_output.put_line('l_element_id:=' || l_element_id); BEGIN
SELECT paaf.payroll_id,
paaf.assignment_id,
paaf.people_group_id
INTO l_payroll_id,
l_assignment_id,
l_people_group_id
FROM per_all_assignments_f paaf
WHERE paaf.assignment_number = l_assign_number
AND l_period_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('没有分配信息');
WHEN too_many_rows THEN
dbms_output.put_line('存在多条分配信息');
END; dbms_output.put_line('l_payroll_id:=' || l_payroll_id);
dbms_output.put_line('l_assignment_id:=' || l_assignment_id);
dbms_output.put_line('l_people_group_id:=' || l_people_group_id); IF l_payroll_id IS NOT NULL THEN
BEGIN
SELECT pap.payroll_name
INTO l_payroll
FROM pay_all_payrolls_f pap
WHERE pap.payroll_id = l_payroll_id
AND l_period_date BETWEEN pap.effective_start_date AND pap.effective_end_date;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('没有有效工资单');
WHEN too_many_rows THEN
dbms_output.put_line('存在多工资单');
END; dbms_output.put_line('l_payroll:=' || l_payroll);
END IF; --IF l_payroll_id IS NULL THEN IF (l_element_id IS NOT NULL) THEN l_element_link_id := NULL;
BEGIN
SELECT pelf.element_link_id
INTO l_element_link_id
FROM pay_element_links_f pelf
WHERE pelf.element_type_id = l_element_id
AND pelf.payroll_id = l_payroll_id
--AND pelf.people_group_id = l_people_group_id
AND l_period_date BETWEEN pelf.effective_start_date AND pelf.effective_end_date
AND cuxhrpkg.show_record('PAY_PEOPLE_GROUPS',
NULL,
pelf.business_group_id,
pelf.people_group_id,
to_char(l_period_date,
'YYYYMMDD'),
'') = 'TRUE'
AND cuxhrpkg.show_ass(l_assignment_id,
pelf.people_group_id,
l_period_date) = 'TRUE'; EXCEPTION
WHEN OTHERS THEN
l_element_link_id := NULL;
END; dbms_output.put_line('l_element_link_id:=' || l_element_link_id); IF (l_element_link_id IS NOT NULL) THEN
BEGIN
SELECT ee.element_entry_id
--ee.object_version_number
INTO l_element_entry_id
-- l_object_version_number
FROM pay_element_entries_f ee,
pay_element_types_f et,
pay_element_links_f el
WHERE el.element_link_id = ee.element_link_id
AND el.element_link_id = l_element_link_id
AND el.element_type_id = et.element_type_id
AND ee.assignment_id = l_assignment_id
AND l_period_date BETWEEN ee.effective_start_date AND ee.effective_end_date
AND l_period_date BETWEEN el.effective_start_date AND el.effective_end_date
AND l_period_date BETWEEN et.effective_start_date AND et.effective_end_date
AND et.multiple_entries_allowed_flag = 'N'
AND ee.entry_type = 'E';
EXCEPTION
WHEN OTHERS THEN
l_element_entry_id := NULL;
END; dbms_output.put_line('l_element_entry_id:=' || l_element_entry_id);
END IF;
END IF; -- IF (l_element_id IS NOT NULL) THEN
IF (l_element_entry_id IS NULL) THEN
pay_element_entry_api.create_element_entry(p_effective_date => l_period_date,
p_business_group_id => 81,
p_assignment_id => l_assignment_id,
p_element_link_id => l_element_link_id,
p_entry_type => 'E',
p_creator_type => 'F',
p_cost_allocation_keyflex_id => NULL,
-- p_input_value_id1 => l_input_id, p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date,
p_element_entry_id => x_element_entry_id,
p_object_version_number => x_object_version_number,
p_create_warning => x_create_warning); dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
dbms_output.put_line('x_element_entry_id:=' || x_element_entry_id);
dbms_output.put_line('x_object_version_number:=' || x_object_version_number); END IF;
--dbms_output.put_line('l_payroll:=' || l_payroll);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('导入要素异常!');
END;

创建要素集

HR*创建人员要素链接的更多相关文章

  1. 在64位SQL Server中创建Oracle的链接服务器 Link Server

    有时候我们希望在一个sqlserver下访问另一个sqlserver数据库上的数据,或者访问其他oracle数据库上的数据,要想完成这些操作,我们首要的是创建数据库链接. 数据库链接能够让本地的一个s ...

  2. 在64位SQL Server中创建Oracle的链接服务器

    当我们同时使用SQL Server和Oracle来存储数据时,经常会用到跨库查询.为了方便使用跨库查询,一个最好的办法就是通过创建链接服务器来实现.既可以在SQL Server中创建Oracle的链接 ...

  3. openerp模块收藏 移除下拉选择列表中的“创建并编辑”链接(转载)

    移除下拉选择列表中的“创建并编辑”链接 原文:http://shine-it.net/index.php/topic,5990.0.html 有时希望下拉列表中列出的项是与主表某个字段关联的,用户只能 ...

  4. 利用CMake自己创建OpenCV静态链接库

    1.准备工作: 1)完成Visual Studio2012安装: 2)下载并解压CMake3.5.0: 3)下载并解压OpenCV2.4.12: 4)下载并解压TBB44_20160128oss. 2 ...

  5. VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池

    VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池 在上一节我们创建了完整克隆的自动专有桌面池,在创建过程比较缓慢,这次我们将学习创建Vi ...

  6. 如何创建一个要素数据类 IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口

    如何创建一个要素数据类 创建要素类用到了IFeatureWorkspace.CreateFeatureClass方法,在这个方法中有众多的参数,为了满足这些参数,我们要学习和了解下面的接口. IFie ...

  7. 宝塔控制面板创建ftp后链接不上的解决方法

    很多的新手在安装宝塔面板并且创建完ftp管理后链接ftp居然链接不上?有许多朋友都不知道本站q302博客也是基于宝塔控制面板管理的,本站在安装网站完成后也和你们一样ftp链接不上,后面经过多次测试之后 ...

  8. windows下创建文件夹链接

    mklink百度百科https://baike.baidu.com/item/mklink/566760?fr=aladdin 创建文件夹链接mklink /d "C:\Users\Admi ...

  9. VS2010创建C++静态链接库创建和使用

    VS2010创建C++静态链接库的方法: 1. 创建一个新项目,在已安装的模板中选择“常规”,在右边的类型下选择“空项目”,在名称和解决方案名称中输入 staLIB.点击确定. 2.在解决方案资源管理 ...

随机推荐

  1. Flask实战第67天:Flask+Celery实现邮件和短信异步发送

    之前在项目中我们发送邮件和 短信都是阻塞的,现在我们来利用Celery来优化它们 官方使用文档: http://flask.pocoo.org/docs/1.0/patterns/celery/ re ...

  2. Xamarin Android项目真机测试闪退

    Xamarin Android项目真机测试闪退 项目在模拟器中运行正常,但在真机上闪退.这是由于项目设置使用共享的Mono运行时.Visual Studio中,在项目属性-Android Option ...

  3. PIE.htc的使用

    文件下载:http://css3pie.com/download/ 使用: .pie_radius{ width:200px; height:200px; background-color:red; ...

  4. 【UOJ #179】线性规划 单纯形模板

    http://uoj.ac/problem/179 终于写出来了单纯性算法的板子,抄的网上大爷的qwq 辅助线性规划找非基变量时要加个随机化才能A,我也不知道为什么,卡精度吗? 2017-3-6UPD ...

  5. BZOJ 4443 [Scoi2015]小凸玩矩阵(二分答案+二分图匹配)

    [题目链接]http://www.lydsy.com/JudgeOnline/problem.php?id=4443 [题目大意] 从矩阵中选出N个数,其中任意两个数字不能在同一行或同一列 求选出来的 ...

  6. 【线段树】XIII Open Championship of Y.Kupala Grodno SU Grodno, Saturday, April 29, 2017 Problem J. Jedi Training

    题意:给你一个序列,支持两种操作:单点修改:询问一个区间中所有相邻位置下标奇偶性均不同的子序列中,和最大的是多少. 线段树每个结点维护四个值: 以奇数下标开始到奇数下标结束的最大子序列和: 以偶数下标 ...

  7. 【动态规划/递推】BZOJ1806[IOI2007]- Miners

    IOI历史上的著名水题,我这种蒟蒻都能写的东西. [思路] 用1.2.3分别代替三种食物,0表示当前矿井没有食物.f[i][a][b][c][d]当前第i个食物,矿1的食物顺序由上至下为a,b:矿2的 ...

  8. (原创)Stanford Machine Learning (by Andrew NG) --- (week 1) Linear Regression

    Andrew NG的Machine learning课程地址为:https://www.coursera.org/course/ml 在Linear Regression部分出现了一些新的名词,这些名 ...

  9. mybatis批量插入:oracle和mysql的区别

    一.oracle批量插入 <insert id="save" parameterType="java.util.List"> insert into ...

  10. django框架下celery+rabbitmq+flower完成异步任务

    [转载请注明出处:] http://www.cnblogs.com/yukityan/p/8035787.html 环境: ubuntu16.04 64位 安装: sudo apt-get insta ...