Explorar el Código

开票申请订单信息错误修复

沈静伟 hace 4 años
padre
commit
0976bb3b2b

+ 1 - 1
src/apps/tinvoiceapply/tinvoiceapply.java

@@ -163,7 +163,7 @@ public class tinvoiceapply extends PaoCust {
             if (!"手工".equalsIgnoreCase(getString("ftype"))) {
                 int i = 0;
                 while (tinvoicebillSet.getPao(i) != null) {
-                    if (!tinvoicebillSet.getPao(i).getString("status").equals("") && !tinvoicebillSet.getPao(i).getString("status").equals("3")) {
+                    if (!(tinvoicebillSet.getPao(i).getString("status").equals("") || tinvoicebillSet.getPao(i).getString("status").equals("22") || tinvoicebillSet.getPao(i).getString("status").equals("3"))) {
                         throw new P2AppException("", "已对接开票接口,不可进行反审核!");
                     }
                     i++;

+ 5 - 4
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/Tinvoiceapply.java

@@ -22,9 +22,8 @@ public class Tinvoiceapply extends Controller {
     }
 
     public String queryInvoiceApplyList() {
-        String[] sortmsg = {"t1.tinvoiceapplyid desc"};
-
-        String sort = "t1.tinvoiceapplyid desc";
+        String[] sortmsg = {"case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc "};
+        String sort = "case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc ";
         if (content.containsKey("sort") && Arrays.asList(sortmsg).contains(content.getString("sort"))) {
             sort = content.getString("sort");
         }
@@ -32,7 +31,9 @@ public class Tinvoiceapply extends Controller {
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
-                where = where + " and t1.finvoicename like'%" + whereObject.getString("condition") + "%'";
+                where = where + " and (t1.finvoicename like'%" + whereObject.getString("condition") + "%' " +
+                        "or exists(select tinvoicebillid from tinvoicebill where siteid=t1.siteid and tinvoiceapplyid=t1.tinvoiceapplyid and (invoicecode like'%" + whereObject.getString("condition") + "%' or invoiceno like'%" + whereObject.getString("condition") +
+                        "%')))";
             }
             if (whereObject.containsKey("fbegdate") && !"".equals(whereObject.getString("fbegdate"))) {
                 where = where + " and t1.createdate >='" + whereObject.getString("fbegdate") + "'";

+ 5 - 4
src/rest/openapi/restcontroller/wechatapp/tinvoiceapply/Tinvoiceapply_saler.java

@@ -22,9 +22,8 @@ public class Tinvoiceapply_saler extends Controller {
     }
 
     public String queryInvoiceApplyList() {
-        String[] sortmsg = {"t1.tinvoiceapplyid desc"};
-
-        String sort = "t1.tinvoiceapplyid desc";
+        String[] sortmsg = {"case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc "};
+        String sort = "case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc ";
         if (content.containsKey("sort") && Arrays.asList(sortmsg).contains(content.getString("sort"))) {
             sort = content.getString("sort");
         }
@@ -32,7 +31,9 @@ public class Tinvoiceapply_saler extends Controller {
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
-                where = where + " and t1.finvoicename like'%" + whereObject.getString("condition") + "%'";
+                where = where + " and (t1.finvoicename like'%" + whereObject.getString("condition") + "%' " +
+                        "or exists(select tinvoicebillid from tinvoicebill where siteid=t1.siteid and tinvoiceapplyid=t1.tinvoiceapplyid and (invoicecode like'%" + whereObject.getString("condition") + "%' or invoiceno like'%" + whereObject.getString("condition") +
+                        "%')))";
             }
             if (whereObject.containsKey("fbegdate") && !"".equals(whereObject.getString("fbegdate"))) {
                 where = where + " and t1.createdate >='" + whereObject.getString("fbegdate") + "'";