Explorar el Código

Merge remote-tracking branch 'origin/develop' into develop

shenjingwei hace 1 día
padre
commit
8f5249a707

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

@@ -7021,6 +7021,10 @@ public class R {
         }
     }
 
+    public static class ID2026012614304002 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 7 - 1
src/custom/restcontroller/sale/cashbill/cashbill.java

@@ -901,6 +901,12 @@ public class cashbill extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where.append(" and t1.checkdate <='").append(getDate_Str(whereObject.getDate("enddate"), 1)).append("' ");
             }
+            if (whereObject.containsKey("begindate2") && !"".equals(whereObject.getString("begindate2"))) {
+                where.append(" and t1.billdate >='").append(whereObject.getString("begindate2")).append("' ");
+            }
+            if (whereObject.containsKey("enddate2") && !"".equals(whereObject.getString("enddate2"))) {
+                where.append(" and t1.billdate <='").append(getDate_Str(whereObject.getDate("enddate2"))).append("' ");
+            }
         }
 ////        boolean isExport = content.getBooleanValue("isExport");
 //        SQLFactory sqlFactory = new SQLFactory(this, "审核状态的收支凭证详情列表", pageSize, pageNumber, pageSorting);
@@ -912,7 +918,7 @@ public class cashbill extends Controller {
 //        sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
 //        sqlFactory.addParameter("siteid", siteid);
 //        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
-        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_cashbill", "billno", "type", "amount","discountamount", "remarks", "balance", "source", "checkby", "checkdate", "sa_accountclassid");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_cashbill", "billno", "type", "amount","discountamount", "remarks", "balance", "source", "checkby", "checkdate", "sa_accountclassid","billdate");
         querySQL.setTableAlias("t1");
         querySQL.addQueryFields("type_ch", "if(t1.type=1,'收入','支出')");
         querySQL.addQueryFields("unwriteoffamount", "t1.amount - t1.writeoffamount");

+ 3 - 0
src/custom/restcontroller/sale/creditbill/SQL/营销账户类别列表查询2.sql

@@ -0,0 +1,3 @@
+select t1.sa_accountclassid,t1.accountno,t1.accountname,t1.isorder,ifnull(t2.creditquota,0) creditquota,t2.sys_enterpriseid from sa_accountclass t1
+left join sa_accountbalance t2 on t1.sa_accountclassid=t2.sa_accountclassid and t2.sys_enterpriseid in $sys_enterpriseid$ and t1.accountno='01'
+where t1.isused=1 and t1.siteid=$siteid$  and t1.sa_accountclassid not in (select sa_accountclassid from sa_creditbilldetail where sa_creditbillid=$sa_creditbillid$ and sys_enterpriseid in $sys_enterpriseid$ and siteid=$siteid$)

+ 38 - 6
src/custom/restcontroller/sale/creditbill/creditbill.java

@@ -91,18 +91,50 @@ public class creditbill extends Controller {
                         "or t2.erpagentnum like '%" + whereObject.getString("condition") + "%')";
             }
         }
+
+        long sa_creditbillid = content.getLongValue("sa_creditbillid");
 //        SQLFactory sqlFactory = new SQLFactory(this, "合作企业档案列表查询", pageSize, pageNumber, pageSorting);
 //        sqlFactory.addParameter_SQL("where", where);
 //        Rows rows = dbConnect.runSqlQuery(sqlFactory);
-        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_enterprise", "sys_enterpriseid", "enterprisename","abbreviation",
-                "province","city","county","address","contact","phonenumber","taxno");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_enterprise", "sys_enterpriseid", "enterprisename", "abbreviation",
+                "province", "city", "county", "address", "contact", "phonenumber", "taxno");
         querySQL.setTableAlias("t1");
-        querySQL.addJoinTable(JOINTYPE.left, "sys_dataextend", "t2", "t1.sys_enterpriseid = t2.ownerid and t2.ownertable = 'sys_enterprise' and t1.siteid = t2.siteid","erpagentnum");
-        querySQL.addJoinTable(JOINTYPE.inner, "sa_agents", "t3", "t1.sys_enterpriseid=t3.sys_enterpriseid and t1.siteid=t3.siteid","agentnum");
+        querySQL.addJoinTable(JOINTYPE.left, "sys_dataextend", "t2", "t1.sys_enterpriseid = t2.ownerid and t2.ownertable = 'sys_enterprise' and t1.siteid = t2.siteid", "erpagentnum");
+        querySQL.addJoinTable(JOINTYPE.inner, "sa_agents", "t3", "t1.sys_enterpriseid=t3.sys_enterpriseid and t1.siteid=t3.siteid", "agentnum");
         querySQL.setSiteid(siteid);
         querySQL.setWhere(where);
         querySQL.setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();
+
+        ArrayList<Long> sys_enterpriseids = rows.toArrayList("sys_enterpriseid", new ArrayList<>());
+        sys_enterpriseids.add(0l);
+        SQLFactory sqlFactory = new SQLFactory(this, "营销账户类别列表查询2");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter_in("sys_enterpriseid", sys_enterpriseids);
+        sqlFactory.addParameter("sa_creditbillid", sa_creditbillid);
+        RowsMap accountRowsMap = dbConnect.runSqlQuery(sqlFactory).toRowsMap("sys_enterpriseid");
+
+        for (Row row : rows) {
+            Long sys_enterpriseid = row.getLong("sys_enterpriseid");
+            if (accountRowsMap.containsKey(String.valueOf(sys_enterpriseid))) {
+                Rows accountRows = accountRowsMap.get(row.getString("sys_enterpriseid"));
+                row.put("accountname", accountRows.get(0).getString("accountname"));
+                row.put("accountno", accountRows.get(0).getString("accountno"));
+                row.put("creditquota", accountRows.get(0).getBigDecimal("creditquota"));
+                row.put("oldcreditquota", accountRows.get(0).getBigDecimal("creditquota"));
+                row.put("isorder", accountRows.get(0).getString("isorder"));
+                row.put("sa_accountclassid", accountRows.get(0).getString("sa_accountclassid"));
+            }
+            row.putIfAbsent("creditquota", 0);
+            row.putIfAbsent("oldcreditquota", 0);
+            row.putIfAbsent("accountname", "");
+            row.putIfAbsent("accountno", "");
+            row.putIfAbsent("isorder", "");
+            row.putIfAbsent("sa_accountclassid", "");
+
+        }
+
+
         return getSucReturnObject().setData(rows).toString();
     }
 
@@ -146,9 +178,9 @@ public class creditbill extends Controller {
         sqlFactory.addParameter_SQL("where", where);
         sqlFactory.addParameter("siteid", siteid);
 //        Rows rows = dbConnect.runSqlQuery(sqlFactory);
-        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_site_parameter",  "sys_site_parameterid");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_site_parameter", "sys_site_parameterid");
         querySQL.setTableAlias("t0");
-        querySQL.addJoinTable(JOINTYPE.right, sqlFactory, "t1", "t0.siteid='111'","*");
+        querySQL.addJoinTable(JOINTYPE.right, sqlFactory, "t1", "t0.siteid='111'", "*");
         querySQL.setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();
         return getSucReturnObject().setData(rows).toString();

+ 48 - 0
src/custom/restcontroller/system/helptools/tools.java

@@ -0,0 +1,48 @@
+package restcontroller.system.helptools;
+
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.data.SQLFactory;
+import common.data.UpdateSQL;
+import restcontroller.R;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+
+public class tools extends Controller {
+    public tools(JSONObject content) throws YosException {
+        super(content);
+    }
+
+    /**
+     * 刷数据用
+     * 可核销数量canoffqty,待核销数量tobeoffqty
+     *
+     * @return
+     * @throws YosException
+     */
+    @API(title = "刷数据(可核销数量canoffqty,待核销数量tobeoffqty )", apiversion = R.ID2026012614304002.v1.class)
+    public String refershData() throws YosException {
+        JSONArray jsonArray = content.getJSONArray("items");
+        ArrayList<String> sqlList = new ArrayList();
+        for (Object obj : jsonArray) {
+            JSONObject jsonObject = (JSONObject) obj;
+            String sa_orderitemsid = jsonObject.getString("sa_orderitemsid");
+            BigDecimal canoffqty = jsonObject.getBigDecimal("canoffqty");
+            BigDecimal tobeoffqty = jsonObject.getBigDecimal("tobeoffqty");
+            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_orderitems");
+            updateSQL.setValue("canoffqty", canoffqty);
+            updateSQL.setValue("tobeoffqty", tobeoffqty);
+            updateSQL.setWhere("sa_orderitemsid", sa_orderitemsid);
+            sqlList.add(updateSQL.getSQL());
+        }
+        dbConnect.runSqlUpdate(sqlList);
+
+        return getSucReturnObject().toString();
+    }
+
+
+}

+ 1 - 1
src/custom/restcontroller/webmanage/sale/salearea/salearea.java

@@ -463,7 +463,7 @@ public class salearea extends Controller {
 
     public QuerySQL getAgentList(String where) throws YosException {
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_agents","sys_enterpriseid", "isservice",
-                "sa_agentsid","agentnum","priceadjustment","type","signdate","createby","createdate","islimitaccessories","islimitorder","signingstate","aftersalesphonenumber","toagentnum");
+                "sa_agentsid","agentnum","priceadjustment","type","signdate","createby","createdate","islimitaccessories","islimitorder","signingstate","aftersalesphonenumber","toagentnum","signdate");
         querySQL.setTableAlias("t1");
         querySQL.addJoinTable(JOINTYPE.inner, "sys_enterprise", "t2", "t1.siteid = t2.siteid and t1.sys_enterpriseid = t2.sys_enterpriseid",
                 "enterprisename","abbreviation", "phonenumber", "contact", "province", "city", "county", "address", "limitreturnday", "freefreightamount", "invoicingpoint","saleclassauth");