Browse Source

商机下载轮询,增加跟进人信息

will.chen 7 years ago
parent
commit
ee31417e70
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/main/resources/database/template/inquiryEnRemind.xml

+ 7 - 0
src/main/resources/database/template/inquiryEnRemind.xml

@@ -7,6 +7,8 @@
         v_prodTitle varchar2(500);
         v_cu_code  varchar2(50);
         v_tmpCount number;
+        v_domancode varchar2(50);
+        v_doman varchar2(50);
     </declare>
     <body>
         <iterator loop="inquiryEnRemind" var="detail">
@@ -33,6 +35,11 @@
                 insert into businesschance(bc_id,bc_fromid,bc_code,bc_description,bc_from,bc_nichehouse,bc_currentprocess,bc_date7,bc_status,bc_statuscode,bc_recorder,bc_recorddate,bc_custname,bc_contact,bc_tel,bc_desc7,bc_desc9,bc_desc10,bc_desc11,bc_desc13,bc_date13,bc_desc14,bc_custcode)
                 values(v_id,${detail.itemId},v_code,v_prodTitle,'平台商机','平台商机库','样品报价', add_months(${detail.date},2),'已审核','AUDITED','自动转入',sysdate,${detail.enName},${detail.userName},${detail.userTel},${detail.prodTitle},${detail.spec},${detail.cmpCode},${detail.inbrand},
                 ${detail.needQty},${detail.endDate},${detail.enUU},v_cu_code);
+                select count(*) into v_count from product left join productsaler on ps_prcode=pr_code where pr_orispeccode=${detail.cmpCode};
+                if v_count > 0 then
+                select ps_emcode,ps_emname into v_domancode,v_doman from productsaler left join product on pr_code=ps_prcode where pr_orispeccode=${detail.cmpCode} and rownum=1 order by ps_data desc;
+                update businesschance set bc_domancode=v_domancode,bc_doman=v_doman where bc_id=v_id;
+                end if;
                 end if;
             </block>
         </iterator>