Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
傅伟强-富德
/
test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0d00fdd6
authored
Jan 09, 2019
by
傅伟强-富德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test.txt
1 parent
a4b46d45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
139 additions
and
0 deletions
test.txt
test.txt
View file @
0d00fdd
...
...
@@ -228,3 +228,142 @@ select * from RN_POLICY_SERVICER_CHG_RECORD rnpscr
where rnpscr.policy_no='0046001110026725'
order by rnpscr.UPDATED_DATE DESC
)where rownum <= 1
/**
* MethodName: quitAssign
* Description: [保单离职交接规则]
*@param grasSysTempList
*@return String
*
* @author Mamba
* @date 2019年1月8日 下午2:26:28
*/
private List<Map<String, String>> quitAssign(List<String> policyNoList, List<JSONObject> policyList)
{
//key:应缴日(1812)年份加月份 value{现服务人员代码,服务人员代码}
Map<String, Map> map = new HashMap<String, Map>();
//{现服务人员代码,服务人员代码}
Map<String, String> policyMap = new HashMap<String, String>();
//最后符合条件的保单信息
List<Map<String, String>> policySuccessList = new ArrayList<>();
Map<String, String> policySuccessMap = null;
Date nowDate = new Date();
//获取当前年份
int nowYear = DateUtil.getYear(nowDate);
int nowMonth = DateUtil.getMonth(nowDate);
for (String item : policyNoList)
{
for (JSONObject policyJson : policyList)
{
String policyNo = policyJson.getString("policyNo");
String servicerNo = policyJson.getString("servicerNo");
if (item.equals(policyNo))
{
policySuccessMap = new HashMap<>();
/**
* 处理离职交接规则
*/
StaffInfo staffInfo = staffInfoService.selectByPrimaryKey(servicerNo);
int month=0;
int year=0;
if(staffInfo!=null){
Date leaveDate=DateUtil.formatDate(staffInfo.getLeaveDate(),"yyyy-MM-dd");
month = DateUtil.getMonth(leaveDate);
year = DateUtil.getYear(leaveDate);
}
//1:先判断该保单的现服务人员是否在当月或者上月离职 人员离职时间:STAFF_INFO.LEAVE_DATE
if (nowYear==year && (nowMonth==month || nowMonth==(month-1)))
{
//2:离职人员名下所有已实收及未收保单均要交接,并计入新接收人考核; ---这点可以不管,只是解释离职人员名下的保单都可以交接
//3.离职人员名下未收件交接遵循“应缴月为同一个月份的保单只能交接给同一个人,不允许分别交接给多个人员”;未收件:保单缴费状态为1的时候为未收件,即POLICY_PREM_INFO.PREM_STATUS=1
//例如:A人员当月离职,他12月名下有3笔保单,分别为1,2,3,分别会出现两种情况,1:A人员应缴日在12月的保单从未有过交接记录 2:A人员应缴日在12月的保单存在交接记录
//情况1:上传文件中,把1,2,3分别分配给B,C,D,文件格式如下:
//那么这种情况,1先分给了B,那根据规则同一月保单只能分配给同一人,那么2,3保单就只能B
//校验如下,校验保单交出服务人员是否和该保单现服务人员相同,若不相同则没有发生保单离职交接记录
//注:数据库获取保单服务人员交接记录表,该保单最近一次交接记录,获取交出服务人员字段 RN_POLICY_SERVICER_CHG_RECORD.EARLIER_AGENT
RNPolicyServicerChgRecord record =changeService.queryLastTimeServicerChg(policyNo);
/**保 原 接收
* p1 H1 H2
* p2 H1 H3
*/
//交出服务人员代码
String outSer = null;
//接收服务人员代码
String receiveSer = null;
//数据库获取保单应缴日,得到应缴月
PolicyPremInfo policyPremInfo= premInfoService.selectByPolicyNo(policyNo);
Date premDueDate=DateUtil.formatDate(policyPremInfo.getPremDueDate(),"yyyy-MM-dd");
int premDueMonth = DateUtil.getMonth(premDueDate);
int premDueYear = DateUtil.getYear(premDueDate);
//根据保单号从数据库取现服务人员
RNPolicyServiceInfo rnPolicyServiceInfo=servicerInfoService.selectByPolicyNo(policyNo);
//现服务人员代码
String nowServicerNo=rnPolicyServiceInfo.getServiceNo();
if (record==null)
{
//情况一:没有记录,根据应缴月从map中取值(应缴月值应该每次去查保单的应缴日),从值中取该保单号的现服务人员,
Map<String, String> m = map.get(String.valueOf(premDueYear)+String.valueOf(premDueMonth));
//现服务人员代码
String nowServicer = null;
//准备交接的服务人员代码
String servicer = null;
/**
* map H1:H2
*/
for (Map.Entry<String, String> s : m.entrySet())
{
if (s.getKey().equals(nowServicerNo))//H1==1
{
nowServicer = s.getKey();
servicer = s.getValue();//H2
}
}
//情况1:如果没值,那就符合条件
//情况2:如果有值,根据同月只能分配给同一人员原则,这里就设置为map中的服务人员
if(nowServicer!=null){
servicerNo = servicer;
}
}
else
{
outSer=record.getEarlierAgent();
receiveSer = record.getNextAgent();
//情况二:若保单交出服务人员和该保单现服务人员相同,则说明之前有发生过保单离职交接,那根据一个月中只能分给同一个服务人员原则,那只能分配给接收服务人员
//grasSysTemp.setServicerNo(ReceiveSer);
servicerNo = receiveSer;
}
policyMap.put(nowServicerNo, servicerNo);
map.put(String.valueOf(premDueYear)+String.valueOf(premDueMonth), policyMap);
}
/**
* end
*/
policySuccessMap.put("policyNo", policyNo);
policySuccessMap.put("servicerNo", servicerNo);
policySuccessList.add(policySuccessMap);
break;
}
}
}
return policySuccessList;
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment