沈静伟 il y a 4 ans
Parent
commit
7eb2efa0f1

+ 0 - 77
src/apps/mysaorder/mysaorder.java

@@ -1,77 +0,0 @@
-package mysaorder;
-
-import baseclass.PaoCust;
-import p2.p2server.P2Server;
-import p2.pao.PaoRemote;
-import p2.pao.PaoSet;
-import p2.pao.PaoSetRemote;
-import p2.util.P2Exception;
-
-import java.util.Calendar;
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Vector;
-
-public class mysaorder extends PaoCust {
-
-
-    @Override
-    public void init() throws P2Exception {
-        super.init();
-        PaoSetRemote doclinks = P2Server.getP2Server().getPaoSet("doclinks", getUserInfo());
-        doclinks.setWhere("ownertable='"+getName()+"' and ownerid="+getUniqueIDValue());
-        doclinks.reset();
-        if(doclinks.isEmpty())return;
-        int index=0;
-        while(doclinks.getPao(index)!=null){
-            System.out.println(doclinks.getPao(index).getString("document"));
-            index+=1;
-        }
-    }
-
-    @Override
-    public void add() throws P2Exception {
-        super.add();
-        Calendar instance = Calendar.getInstance();
-        int i = instance.get(Calendar.YEAR);
-        int i1 = instance.get(Calendar.MONTH);
-        int i2 = instance.get(Calendar.DAY_OF_MONTH);
-        Random random=new Random();
-        String fbill=i+""+i1+""+i2+""+Math.abs(random.nextInt(10000));
-        setValue("SAORDERBILL",fbill);
-    }
-
-
-    public void mysaorderadd(PaoSetRemote itemset){
-        System.out.println("mysaorder mysaorderadd");
-    }
-    public void additems(PaoSetRemote itemset) throws P2Exception {
-        Vector selection = itemset.getSelection();
-        Iterator<PaoRemote> iterator = selection.iterator();
-        PaoSetRemote mysaorderdetail = getPaoSet("MYSAORDERDETAIL");
-        while(iterator.hasNext()){
-            PaoRemote next = iterator.next();
-            PaoRemote remote = mysaorderdetail.addAtEnd();
-            remote.setValue("name",next.getString("FERPITEMNAME"));
-        }
-    }
-
-    @Override
-    public void fieldAction(Object paoField, String fieldname) throws P2Exception {
-
-    }
-
-
-    public void print() throws P2Exception {
-        System.out.println(getString("SAORDERBILL"));
-    }
-
-    /**
-     * ¹¹Ô캯Êý
-     *
-     * @param arg0
-     */
-    public mysaorder(PaoSet arg0) {
-        super(arg0);
-    }
-}

+ 0 - 27
src/apps/mysaorder/mysaorderAppBean.java

@@ -1,27 +0,0 @@
-package mysaorder;
-
-import baseclass.AppBeanCust;
-import p2.util.P2Exception;
-import p2.webclient.system.beans.DataBean;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-public class mysaorderAppBean extends AppBeanCust {
-
-
-    public void PRINT() throws P2Exception {
-        DataBean results_showlist = app.getDataBean("results_showlist");
-        if(app.onListTab()){
-            Vector selection = results_showlist.getSelection();
-            Iterator<mysaorder> iterator = selection.iterator();
-            while(iterator.hasNext()){
-                mysaorder next = iterator.next();
-            }
-        }else{
-            mysaorder mysaorder= (mysaorder)results_showlist.getPao();
-            mysaorder.delete();
-        }
-    }
-
-}

+ 0 - 22
src/apps/mysaorder/mysaorderDataBean.java

@@ -1,22 +0,0 @@
-package mysaorder;
-
-import p2.util.P2Exception;
-import p2.webclient.system.beans.DataBean;
-
-public class mysaorderDataBean extends DataBean {
-    @Override
-    public int TOGGLEDELETEROW() throws P2Exception {
-        super.TOGGLEDELETEROW();
-        parent.save();
-        for(int i=0;i<getPaoSet().count();i++){
-            getPaoSet().getPao(i).setValue("frownum",i+1);
-        }
-        parent.save();
-        return 1;
-    }
-
-    @Override
-    public int ADDROW() throws P2Exception {
-        return super.ADDROW();
-    }
-}

+ 0 - 55
src/apps/mysaorderdetail/mysaorderdetail.java

@@ -1,55 +0,0 @@
-package mysaorderdetail;
-
-import baseclass.PaoCust;
-import p2.pao.PaoRemote;
-import p2.pao.PaoSet;
-import p2.pao.PaoSetRemote;
-import p2.util.P2Exception;
-
-import java.util.Vector;
-
-public class mysaorderdetail extends PaoCust {
-
-
-    @Override
-    public void init() throws P2Exception {
-        super.init();
-    }
-
-    /**
-     * ¹¹Ô캯Êý
-     *
-     * @param arg0
-     */
-    public mysaorderdetail(PaoSet arg0) {
-        super(arg0);
-    }
-
-    public void mysaorderadd(PaoSetRemote itemset) throws P2Exception {
-        Vector<PaoRemote> selection = itemset.getSelection();
-        for(int i=0;i<selection.size();i++){
-            PaoRemote remote = selection.get(i);
-            PaoRemote remote1 = getThisPaoSet().addAtEnd();
-            remote1.setValue("NAME",remote.getString("FERPITEMNAME"));
-        }
-        getOwner().getThisPaoSet().save();
-    }
-    @Override
-    public void add() throws P2Exception {
-        super.add();
-        setValue("frownum",getThisPaoSet().count()+1);
-        if(getOwner()!=null){
-            setValue("fparent",getOwner().getInt("mysaorderid"));
-        }
-    }
-
-    @Override
-    public void fieldAction(Object paoField, String fieldname) throws P2Exception {
-
-    }
-
-    @Override
-    public void fieldValidate(Object paoField, String fieldname) throws P2Exception {
-
-    }
-}

+ 10 - 7
src/apps/sainvoice/sainvoiceAppBean.java

@@ -1,5 +1,6 @@
 package sainvoice;
 
+import openapi.base.parameter.parameter;
 import p2.p2server.P2Server;
 import p2.pao.PaoRemote;
 import p2.pao.PaoSet;
@@ -58,13 +59,15 @@ public class sainvoiceAppBean extends AppBeanCust {
         Long id = sainvoice.getUniqueIDValue();
         this.SAVE();
         byrefresh();
-        boolean issuccess = new UploadDataToERP(sainvoice, getPaoSet().getUserInfo()).upload();
-//        if (!issuccess) {
-//            ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反复核,请检查!"));
-//            UNRECHECK();
-//        }else{
-//            sainvoice.sendmail();
-//        }
+        if (!parameter.isdebug) {
+            boolean issuccess = new UploadDataToERP(sainvoice, getPaoSet().getUserInfo()).upload();
+            if (!issuccess) {
+                ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反复核,请检查!"));
+                UNRECHECK();
+            } else {
+                sainvoice.sendmail();
+            }
+        }
         return super.RECHECK();
     }
 

+ 10 - 7
src/apps/saorder/SaorderAppBean.java

@@ -2,6 +2,7 @@ package saorder;
 
 import baseclass.AppBeanCust;
 import baseclass.PaoCust;
+import openapi.base.parameter.parameter;
 import p2.p2server.P2Server;
 import p2.pao.PaoRemote;
 import p2.pao.PaoSet;
@@ -368,13 +369,15 @@ public class SaorderAppBean extends AppBeanCust {
             }
             Long id = saorder.getUniqueIDValue();
             this.SAVE();
-            boolean issuccess = new UploadDataToERP(saorder, getPaoSet().getUserInfo()).upload();
-//            if (!issuccess) {
-//                ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反审核,请检查!"));
-//                UNCHECK();
-//            } else {
-//                saorder.sendMail();
-//            }
+            if (!parameter.isdebug) {
+                boolean issuccess = new UploadDataToERP(saorder, getPaoSet().getUserInfo()).upload();
+                if (!issuccess) {
+                    ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反审核,请检查!"));
+                    UNCHECK();
+                } else {
+                    saorder.sendMail();
+                }
+            }
             byrefresh();
         }
         return super.CHECK();

+ 8 - 5
src/apps/taftersalesmag/taftersalesmagAppBean.java

@@ -2,6 +2,7 @@ package taftersalesmag;
 
 import baseclass.AppBeanCust;
 import baseclass.PaoCust;
+import openapi.base.parameter.parameter;
 import p2.pao.PaoSet;
 import p2.util.P2AppException;
 import p2.util.P2Exception;
@@ -96,11 +97,13 @@ public class taftersalesmagAppBean extends AppBeanCust {
             taftersalesmag.recheckvalidate(true);
             taftersalesmag.recheck(true);
             this.SAVE();
-            boolean issuccess = new UploadDataToERP(taftersalesmag, getPaoSet().getUserInfo()).upload();
-//            if (!issuccess) {
-//                ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反复核,请检查!"));
-//                UNRECHECK();
-//            }
+            if (!parameter.isdebug) {
+                boolean issuccess = new UploadDataToERP(taftersalesmag, getPaoSet().getUserInfo()).upload();
+//                if (!issuccess) {
+//                    ((PaoSet) getPaoSet()).addWarning(new P2AppException("", "上传ERP失败,当前单据将自动反复核,请检查!"));
+//                    UNRECHECK();
+//                }
+            }
         }
         byrefresh();
         return super.RECHECK();

+ 28 - 34
src/apps/tbankpaybillsboc/tbankpaybillsboc.java

@@ -106,29 +106,23 @@ public class tbankpaybillsboc extends PaoCust {
             cashbill.setValue("fstatus", "审核", 11l);// 状态
             cashbill.setValue("fsourceid", getUniqueIDValue(), 11l);// 状态
             cashbill.setValue("fsourceobject", getName(), 11l);// 状态
-			PaoSetRemote taccbal = cashbill.getPaoSet("$taccbal", "taccbal",
-					"fagentnum='" + fagentnum + "'and faccclsnum='01'");
-			PaoRemote taccbalpao = null;
-			if (taccbal.isEmpty()) {
-				taccbalpao = taccbal.addAtEnd();
-				taccbalpao.setValue("fagentnum", fagentnum);
-				taccbalpao.setValue("faccclsnum", "01");
-				taccbalpao.setValue("fbalance", getDouble("txnamt"));
-			} else {
-				taccbalpao = taccbal.getPao(0);
-				taccbalpao.setValue("fbalance", baseclass.tools.Math.add(
-						taccbalpao.getDouble("fbalance"), getDouble("txnamt")));
-			}
-            setValue("fstatus", "已入账(系统)", 11l);
-            if("NB".equals(getString("siteid"))) {
-                cashbill.createAssignment(getMailByHrGroup(getString("siteid")+"1002"), "RECBILL", "中行银企直连收入凭证待审", "单号:" + cashbill.getString("fbillnum"));
+            PaoSetRemote taccbal = cashbill.getPaoSet("$taccbal", "taccbal",
+                    "fagentnum='" + fagentnum + "'and faccclsnum='01'");
+            PaoRemote taccbalpao = null;
+            if (taccbal.isEmpty()) {
+                taccbalpao = taccbal.addAtEnd();
+                taccbalpao.setValue("fagentnum", fagentnum);
+                taccbalpao.setValue("faccclsnum", "01");
+                taccbalpao.setValue("fbalance", getDouble("txnamt"));
+            } else {
+                taccbalpao = taccbal.getPao(0);
+                taccbalpao.setValue("fbalance", baseclass.tools.Math.add(
+                        taccbalpao.getDouble("fbalance"), getDouble("txnamt")));
             }
-
+            setValue("fstatus", "已入账(系统)", 11l);
+            cashbill.createAssignment(getMailByHrGroup(getString("siteid") + "1002"), "RECBILL", "中行银企直连收入凭证待审", "单号:" + cashbill.getString("fbillnum"));
         } else {
-            if("NB".equals(getString("siteid"))) {
-                sendEmail(getMailByHrGroup(getString("siteid")+"1002"), "中行银企直连对接异常", "找不到匹配的经销商信息。付款人:" + getString("ACNTNAME") + ";付款银行:" + getString("IBKNAME") + "付款账号:" + getString("ACTACN") + ";付款金额:" + getString("TXNAMT"));
-            }
-
+            sendEmail(getMailByHrGroup(getString("siteid") + "1002"), "中行银企直连对接异常", "找不到匹配的经销商信息。付款人:" + getString("ACNTNAME") + ";付款银行:" + getString("IBKNAME") + "付款账号:" + getString("ACTACN") + ";付款金额:" + getString("TXNAMT"));
         }
     }
 
@@ -172,19 +166,19 @@ public class tbankpaybillsboc extends PaoCust {
         cashbill.setValue("fstatus", "审核", 11l);// 状态
         cashbill.setValue("fsourceid", getUniqueIDValue(), 11l);// 状态
         cashbill.setValue("fsourceobject", getName(), 11l);// 状态
-		PaoSetRemote taccbal = cashbill.getPaoSet("$taccbal", "taccbal",
-				"fagentnum='" + fagentnum + "'and faccclsnum='01'");
-		PaoRemote taccbalpao = null;
-		if (taccbal.isEmpty()) {
-			taccbalpao = taccbal.addAtEnd();
-			taccbalpao.setValue("fagentnum", fagentnum);
-			taccbalpao.setValue("faccclsnum", "01");
-			taccbalpao.setValue("fbalance", getDouble("txnamt"));
-		} else {
-			taccbalpao = taccbal.getPao(0);
-			taccbalpao.setValue("fbalance", baseclass.tools.Math.add(
-					taccbalpao.getDouble("fbalance"), getDouble("txnamt")));
-		}
+        PaoSetRemote taccbal = cashbill.getPaoSet("$taccbal", "taccbal",
+                "fagentnum='" + fagentnum + "'and faccclsnum='01'");
+        PaoRemote taccbalpao = null;
+        if (taccbal.isEmpty()) {
+            taccbalpao = taccbal.addAtEnd();
+            taccbalpao.setValue("fagentnum", fagentnum);
+            taccbalpao.setValue("faccclsnum", "01");
+            taccbalpao.setValue("fbalance", getDouble("txnamt"));
+        } else {
+            taccbalpao = taccbal.getPao(0);
+            taccbalpao.setValue("fbalance", baseclass.tools.Math.add(
+                    taccbalpao.getDouble("fbalance"), getDouble("txnamt")));
+        }
         setValue("fstatus", "已入账(人工)", 11l);
 
     }

+ 1 - 1
src/rest/openapi/base/parameter/parameter.java

@@ -16,7 +16,7 @@ public class parameter {
     public static ArrayList<String> tokenlist = new ArrayList<String>(16);
     public static HashMap<String, String> siteidList = new HashMap<>(16);
     public static HashMap<String, String> usertypeList = new HashMap<>(16);
-    public static boolean isdebug = false;
+    public static boolean isdebug = true;
     public static String serverUrl = null;
 
     public static String getAttchDownUrl() {