Kaynağa Gözat

批量反审核及去除反审核判断

hu 4 ay önce
ebeveyn
işleme
86e8ef2d2b

+ 3 - 3
src/custom/beans/accountbalance/Accountbalance.java

@@ -175,7 +175,7 @@ public class Accountbalance extends BaseClass {
             Rows accountclassrows = controller.dbConnect.runSqlQuery("select * from sa_accountclass where siteid='" + controller.siteid + "' and  sa_accountclassid=" + sa_accountclassid);
             if (!accountclassrows.isEmpty()) {
                 String content = "您的" + accountclassrows.get(0).getString("accountname") + "已收入【" + cashbillEntity.getAmount() + "】元";
-                new Accountbalance().sendMsg(controller, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
+                //new Accountbalance().sendMsg(controller, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
             }
 
         } else {
@@ -266,7 +266,7 @@ public class Accountbalance extends BaseClass {
             Rows accountclassrows = dbConnect.runSqlQuery("select * from sa_accountclass where siteid='" + userInfo.getSiteId() + "' and  sa_accountclassid=" + sa_accountclassid);
             if (!accountclassrows.isEmpty()) {
                 String content = "您的" + accountclassrows.get(0).getString("accountname") + "已支出【" + cashbillEntity.getAmount() + "】元";
-                new Accountbalance().sendMsg(dbConnect, userInfo, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
+                //new Accountbalance().sendMsg(dbConnect, userInfo, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
             }
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("siteid",userInfo.getSiteId());
@@ -348,7 +348,7 @@ public class Accountbalance extends BaseClass {
             Rows accountclassrows = controller.dbConnect.runSqlQuery("select * from sa_accountclass where siteid='" + controller.siteid + "' and  sa_accountclassid=" + sa_accountclassid);
             if (!accountclassrows.isEmpty()) {
                 String content = "您的" + accountclassrows.get(0).getString("accountname") + "已支出【" + cashbillEntity.getAmount() + "】元";
-                new Accountbalance().sendMsg(controller, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
+                //new Accountbalance().sendMsg(controller, content, cashbillEntity.getOwnerid(), sys_enterpriseid);
             }
         } else {
             sqlFactory.addParameter("status", "新建");

+ 2 - 2
src/custom/beans/stockbill/bills/XSCK.java

@@ -67,7 +67,7 @@ public class XSCK extends BasicBill {
              */
         } else {
             if (billRow.getBoolean("isreceiver")) {
-                throw new YosException("经销商已经确认收货,不可进行反审核");
+                //throw new YosException("经销商已经确认收货,不可进行反审核");
             }
             /*
               库存校验
@@ -107,7 +107,7 @@ public class XSCK extends BasicBill {
                     if(ischeck){
                         throw new YosException("存在商品已完全出库,无法审核");
                     }else{
-                        throw new YosException("存在商品已完全出库,无法反审核");
+                        //throw new YosException("存在商品已完全出库,无法反审核");
                     }
 
                 }

+ 5 - 0
src/custom/restcontroller/R.java

@@ -6946,6 +6946,11 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2025121320093303 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 27 - 0
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -533,6 +533,33 @@ public class stockbill extends Controller {
         return getSucReturnObject().setData(result).toString();
     }
 
+    @API(title = "批量反审核(仅刷数据)", apiversion = R.ID2025121320093303.v1.class)
+    public String uncheck_pl() throws YosException {
+        JSONArray st_stockbillids = content.getJSONArray("st_stockbillids");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_stockbill", "billno","st_stockbillid");
+        querySQL.setTableAlias("t1");
+        querySQL.setSiteid(siteid);
+        querySQL.setWhere("t1.st_stockbillid",st_stockbillids);
+        Rows stockbillrows = querySQL.query();
+        BatchDeleteErr batchDeleteErr = BatchDeleteErr.create(this, stockbillrows.size());
+        for (Row row : stockbillrows) {
+            long st_stockbillid =row.getLong("st_stockbillid");
+            String billno=row.getString("billno");
+            try {
+                Stockbill.check(this, st_stockbillid, false);
+            }catch (Exception e){
+                batchDeleteErr.addErr(billno,e.getMessage());
+            }
+
+        }
+        HashMap<String,Object> result=new HashMap<>();
+        String success= "共审核"+st_stockbillids.size()+"张出入库单,其中失败"+ batchDeleteErr.size()+"张!";
+        result.put("success",success);
+        result.put("errinfo",batchDeleteErr.getReturnObject());
+        return getSucReturnObject().setData(result).toString();
+    }
+
+
     @API(title = "反审核", apiversion = R.ID20230719154203.v1.class)
     @CACHEING_CLEAN(apiClass = {stockbill.class, stockbillitems.class, Order.class, OrderItems.class, stockbill.class, restcontroller.sale.stockbill.stockbill.class})
     public String uncheck() throws YosException {