Browse Source

Merge remote-tracking branch 'origin/master' into feature-huj-0815

Hu Jie 7 years ago
parent
commit
a67754bc0a

+ 1 - 1
src/main/java/com/uas/erp/schedular/b2b/task/QuotationDownTask.java

@@ -175,7 +175,7 @@ public class QuotationDownTask extends AbstractTask {
      * @return
      */
     private List<QuotationDown> getQuotationReply() {
-        List<QuotationDown> downs = jdbcTemplate.queryForBeanList("select b2b_id_id,qu_id,qu_custuu,qu_fromdate,qu_todate,qu_minbuyqty,qu_minqty,qu_leadtime,qu_brand,qu_prodcode from QuotationDown where QU_SENDSTATUS='待上传' and qu_source<>'平台商机' order by qu_code,qu_detno",
+        List<QuotationDown> downs = jdbcTemplate.queryForBeanList("select b2b_id_id,qu_id,qu_custuu,qu_fromdate,qu_todate,qu_minbuyqty,qu_minqty,qu_leadtime,qu_brand,qu_prodcode from QuotationDown where QU_SENDSTATUS='待上传' and nvl(qu_source,' ')<>'平台商机' order by qu_code,qu_detno",
                 QuotationDown.class);
         for (QuotationDown down : downs) {
             List<QuotationDownDetail> details = jdbcTemplate.queryForBeanList("select * from QuotationDownDetail where qd_quid=?",

+ 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>