Bläddra i källkod

商机下载轮询增加异常处理

will.chen 7 år sedan
förälder
incheckning
7e1b527dc6

+ 15 - 3
src/main/java/com/uas/erp/schedular/publicinquiry/task/EnterInquiryTask.java

@@ -295,9 +295,21 @@ public class EnterInquiryTask extends AbstractTask{
     private void saveInquiryEnRemind(List<InquiryEnRemind> downs) throws Exception {
     private void saveInquiryEnRemind(List<InquiryEnRemind> downs) throws Exception {
         Map<String, Object> model = new HashMap<String, Object>();
         Map<String, Object> model = new HashMap<String, Object>();
         model.put("inquiryEnRemind", downs);
         model.put("inquiryEnRemind", downs);
-        String sql = SqlTemplate.fromXmlFile("database/template/inquiryEnRemind.xml", model);
-        //System.out.println(sql);
-        jdbcTemplate.execute(sql);
+        try{
+            String sql = SqlTemplate.fromXmlFile("database/template/inquiryEnRemind.xml", model);
+            jdbcTemplate.execute(sql);
+        }catch (Exception e){
+            for(int i = 0; i < downs.size(); i=i+2){
+                try {
+                    List<InquiryEnRemind> tempList = downs.subList(i,i+2);
+                    model.put("inquiryEnRemind", tempList);
+                    String sql = SqlTemplate.fromXmlFile("database/template/inquiryEnRemind.xml", model);
+                    jdbcTemplate.execute(sql);
+                }catch (Exception e1){
+                    continue;
+                }
+            }
+        }
     }
     }
 
 
 }
 }

+ 2 - 2
src/main/resources/database/template/inquiryEnRemind.xml

@@ -16,8 +16,8 @@
                 if v_count = 0 then
                 if v_count = 0 then
                 v_id := businesschance_seq.nextval;
                 v_id := businesschance_seq.nextval;
                 Sp_GetMaxNumber('businesschance',2,v_code);
                 Sp_GetMaxNumber('businesschance',2,v_code);
-                v_prodTitle := ${detail.prodTitle} ||${detail.cmpCode} || ${detail.spec};
-                if nvl(${detail.needQty},' ') = ' ' then
+                v_prodTitle := ${detail.prodTitle} || ${detail.cmpCode} || ${detail.spec};
+                if ${detail.needQty} = null then
                 dbms_output.put_line('needQty is null');
                 dbms_output.put_line('needQty is null');
                 else
                 else
                 v_prodTitle := v_prodTitle || ',需求:' || ${detail.needQty};
                 v_prodTitle := v_prodTitle || ',需求:' || ${detail.needQty};