Selaa lähdekoodia

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

沈静伟 2 vuotta sitten
vanhempi
commit
2893401705

+ 4 - 1
src/custom/restcontroller/sale/cashbill/SQL/审核状态的收支凭证详情列表.sql

@@ -1,6 +1,7 @@
 select t1.billno,
        t3.enterprisename,
        t1.type,
+       if(t1.type=1,'收入','支出') type_ch,
        t2.accountname,
        t1.amount,
        t1.remarks,
@@ -8,10 +9,12 @@ select t1.billno,
        t1.checkby,
        t1.checkdate,
        t1.sa_accountclassid,
-       (t1.amount - t1.writeoffamount) unwriteoffamount
+       (t1.amount - t1.writeoffamount) unwriteoffamount,
+       t4.agentnum
 from sa_cashbill t1
          inner join sa_accountclass t2 on t1.sa_accountclassid = t2.sa_accountclassid and t1.siteid = t2.siteid
          inner join sys_enterprise t3 on t1.sys_enterpriseid = t3.sys_enterpriseid and t1.siteid = t3.siteid
+         LEFT JOIN sa_agents t4 ON t1.sys_enterpriseid = t4.sys_enterpriseid AND t1.siteid = t4.siteid
 where t1.status = '审核'
   and t1.siteid = $siteid$
   and $where$

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

@@ -826,7 +826,7 @@ public class cashbill extends Controller {
 
     @API(title = "审核状态的收支凭证详情列表", apiversion = R.ID20221022161304.v1.class)
     @CACHEING
-    public String query_cashnill_audit() throws YosException {
+    public String query_cashnill_audit() throws Exception {
 		/*
         过滤条件
          */
@@ -859,16 +859,51 @@ public class cashbill extends Controller {
             if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
                 where.append(" and t1.type = ").append(whereObject.getLong("type"));
             }
+            if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
+                where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
+            }
+            if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
+                where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
+            }
         }
+        boolean isExport = content.getBooleanValue("isExport");
         SQLFactory sqlFactory = new SQLFactory(this, "审核状态的收支凭证详情列表", pageSize, pageNumber, pageSorting);
+        if(isExport){
+            sqlFactory = new SQLFactory(this, "审核状态的收支凭证详情列表");
+        }
         sqlFactory.addParameter_SQL("where", where);
         sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
         sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
         sqlFactory.addParameter("siteid", siteid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
+        if (isExport) {
+            //去除不需要导出项
+            rows.getFieldList().remove("sa_accountclassid");
+            rows.getFieldList().remove("unwriteoffamount");
+            rows.getFieldList().remove("agentnum");
+            rows.getFieldList().remove("type");
+            Rows uploadRows = uploadExcelToObs("cashBill", "审核状态的收支凭证详情列表", rows, getTitleMap_audit());
+            return getSucReturnObject().setData(uploadRows).toString();
+        }
         return getSucReturnObject().setData(rows).toString();
     }
 
+    //返回导出的标题
+    public HashMap<String, String> getTitleMap_audit() {
+        HashMap<String, String> titleMap = new HashMap<>();
+        titleMap.put("billno", "凭证编号");
+        titleMap.put("enterprisename", "企业名称");
+        titleMap.put("type_ch", "收支类型");
+        titleMap.put("accountname", "账户名称");
+        titleMap.put("amount", "收支金额");
+        titleMap.put("remarks", "备注");
+        titleMap.put("source", "凭证来源");
+        titleMap.put("checkby", "审核人");
+        titleMap.put("checkdate", "审核时间");
+
+        return titleMap;
+    }
+
     @API(title = "资金流水账列表查询", apiversion = R.ID20230111103403.v1.class)
     @CACHEING
     public String query_cashBill() throws YosException, IOException {

+ 4 - 1
src/custom/restcontroller/webmanage/sale/accountclass/SQL/营销账户余额查询.sql

@@ -13,11 +13,14 @@ SELECT t1.sa_accountbalanceid,
        t3.phonenumber,
        t2.sa_accountclassid,
        t2.accountno,
-       t2.accountname
+       t2.accountname,
+       t4.agentnum
 FROM sa_accountbalance t1
          LEFT JOIN sa_accountclass t2 ON t1.sa_accountclassid = t2.sa_accountclassid
     AND t1.siteid = t2.siteid
          LEFT JOIN sys_enterprise t3 ON t1.sys_enterpriseid = t3.sys_enterpriseid
     AND t1.siteid = t3.siteid
+         LEFT JOIN sa_agents t4 ON t1.sys_enterpriseid = t4.sys_enterpriseid
+    AND t1.siteid = t4.siteid
 WHERE ($where$)
   and t1.siteid = $siteid$

+ 18 - 18
src/custom/restcontroller/webmanage/sale/databoard/databoard.java

@@ -85,22 +85,22 @@ public class databoard extends Controller {
         StringBuffer whereLast1 = new StringBuffer(" 1=1 and t1.sys_enterpriseid=" + sys_enterpriseid);
         StringBuffer whereLast2 = new StringBuffer(" 1=1 and t1.sys_enterpriseid=" + sys_enterpriseid);
 
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') >='").append(begindate).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') <='").append(enddate).append("' ");
         }
-        if (begindate1 != "") {
+        if (!begindate1.equals("")) {
             whereLast1.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') >='").append(begindate1).append("' ");
         }
-        if (enddate1 != "") {
+        if (!enddate1.equals("")) {
             whereLast1.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') <='").append(enddate1).append("' ");
         }
-        if (begindate2 != "") {
+        if (!begindate2.equals("")) {
             whereLast2.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') >='").append(begindate2).append("' ");
         }
-        if (enddate2 != "") {
+        if (!enddate2.equals("")) {
             whereLast2.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') <='").append(enddate2).append("' ");
         }
 
@@ -213,7 +213,7 @@ public class databoard extends Controller {
         StringBuffer whereLastYear = new StringBuffer(" 1=1 ");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and t1.checkdate >='").append(begindate).append(" 00:00:00'");
             Date date = sdf.parse(begindate);
             //创建Calendar实例
@@ -224,7 +224,7 @@ public class databoard extends Controller {
             cal.add(Calendar.YEAR, -1);
             whereLastYear.append(" and t1.checkdate >='").append(sdf.format(cal.getTime())).append(" 00:00:00'");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and t1.checkdate <='").append(enddate).append(" 23:59:59'");
             Date date = sdf.parse(enddate);
             //创建Calendar实例
@@ -429,10 +429,10 @@ public class databoard extends Controller {
         }
 
         StringBuffer where = new StringBuffer(" 1=1 ");
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
         }
 
@@ -500,7 +500,7 @@ public class databoard extends Controller {
         StringBuffer whereLastYear = new StringBuffer(" 1=1 ");
 
 
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
             Date date = sdf.parse(begindate);
             //创建Calendar实例
@@ -511,7 +511,7 @@ public class databoard extends Controller {
             cal.add(Calendar.YEAR, -1);
             whereLastYear.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(sdf.format(cal.getTime())).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
             Date date = sdf.parse(enddate);
             //创建Calendar实例
@@ -634,10 +634,10 @@ public class databoard extends Controller {
                 enddate = whereObject.getString("enddate");
             }
         }
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
         }
 
@@ -744,7 +744,7 @@ public class databoard extends Controller {
         StringBuffer whereLastYear = new StringBuffer(" 1=1 ");
 
 
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
             Date date = sdf.parse(begindate);
             //创建Calendar实例
@@ -755,7 +755,7 @@ public class databoard extends Controller {
             cal.add(Calendar.YEAR, -1);
             whereLastYear.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(sdf.format(cal.getTime())).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
             Date date = sdf.parse(enddate);
             //创建Calendar实例
@@ -847,10 +847,10 @@ public class databoard extends Controller {
         }
 
         StringBuffer where = new StringBuffer(" 1=1 ");
-        if (begindate != "") {
+        if (!begindate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
         }
-        if (enddate != "") {
+        if (!enddate.equals("")) {
             where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
         }
 

+ 16 - 2
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -771,6 +771,20 @@ public class OrderItems extends Controller {
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 where.append(" and DATE_FORMAT(t5.billdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
             }
+            if (whereObject.containsKey("begindate1") && !"".equals(whereObject.getString("begindate1"))) {
+                where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate1")).append("' ");
+            }
+            if (whereObject.containsKey("enddate1") && !"".equals(whereObject.getString("enddate1"))) {
+                where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate1")).append("' ");
+            }
+
+            if (whereObject.containsKey("begindate2") && !"".equals(whereObject.getString("begindate2"))) {
+                where.append(" and DATE_FORMAT(t5.checkdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate2")).append("' ");
+            }
+
+            if (whereObject.containsKey("enddate2") && !"".equals(whereObject.getString("enddate2"))) {
+                where.append(" and DATE_FORMAT(t5.checkdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate2")).append("' ");
+            }
             if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
                 where.append(" and t5.status ='").append(whereObject.getString("status")).append("' ");
             }
@@ -803,10 +817,10 @@ public class OrderItems extends Controller {
                             break;
                     }
                 }
-                if (begindate != "") {
+                if (!begindate.equals("")) {
                     where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') >='").append(begindate).append("' ");
                 }
-                if (enddate != "") {
+                if (!enddate.equals("")) {
                     where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') <='").append(enddate).append("' ");
                 }
 

+ 2 - 2
src/custom/restcontroller/webmanage/sale/order/SQL/订单_出库单列表.sql

@@ -1,3 +1,3 @@
-select t.* from (select t2.st_stockbillid,t2.billno,t2.status,t2.remarks from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_dispatch_items t3 on t1.sa_dispatch_itemsid=t3.sa_dispatch_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=1
+select t.* from (select t2.st_stockbillid,t2.billno,t2.status,t2.remarks,t2.billdate from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_dispatch_items t3 on t1.sa_dispatch_itemsid=t3.sa_dispatch_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=1
 union all
-select t2.st_stockbillid,t2.billno,t2.status,t2.remarks from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_aftersalesmag_items t3 on t1.sa_dispatch_itemsid=t3.sa_aftersalesmag_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=0) t where $where$
+select t2.st_stockbillid,t2.billno,t2.status,t2.remarks,t2.billdate from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_aftersalesmag_items t3 on t1.sa_dispatch_itemsid=t3.sa_aftersalesmag_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=0) t where $where$