hu 2 лет назад
Родитель
Сommit
dc393cbabc

+ 1 - 1
src/custom/restcontroller/webmanage/sale/databoard/SQL/财务统计_季.sql

@@ -1 +1 @@
- select   type,DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%m') m,sum(amount) typestatistics from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by  type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%m')
+ select   if(type=0,'支出','收入') type,DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%m') m,sum(amount) typestatistics from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by  type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%m')

+ 1 - 1
src/custom/restcontroller/webmanage/sale/databoard/SQL/财务统计_年度.sql

@@ -1 +1 @@
- select   type,DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%m') m,sum(amount) typestatistics from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by  type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%m')
+ select   if(type=0,'支出','收入') type,DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%m') m,sum(amount) typestatistics from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by  type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%m')

+ 1 - 1
src/custom/restcontroller/webmanage/sale/databoard/SQL/财务统计_月.sql

@@ -1 +1 @@
- select DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%d') d,sum(amount) typestatistics,type from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%d')
+ select DATE_FORMAT(checkdate,'%Y') y,DATE_FORMAT(checkdate,'%d') d,sum(amount) typestatistics,if(type=0,'支出','收入') type from sa_cashbill where status='审核' and $where$ and siteid =$siteid$  group by type,DATE_FORMAT(checkdate,'%Y'),DATE_FORMAT(checkdate,'%d')

+ 7 - 5
src/custom/restcontroller/webmanage/sale/databoard/databoard.java

@@ -515,7 +515,7 @@ public class databoard extends Controller {
                     if (row.getString("y").equals(new SimpleDateFormat("yyyy").format(new Date()))) {
                         dataTrans.setName(row.getString("y") + "-" + row.getString("d") + "-" + row.getString("type"));
                         dataTrans.setType(row.getString("type"));
-                        dataTrans.setDay(row.getString("d"));
+                        dataTrans.setMonth(row.getString("d"));
                         dataTrans.setYear(row.getString("y"));
                         dataTrans.setValue(row.getBigDecimal("typestatistics"));
                         list.add(dataTrans);
@@ -554,6 +554,8 @@ public class databoard extends Controller {
             default:
                 break;
         }
+
+        list.sort(Comparator.comparingLong(o -> Long.parseLong(o.getMonth())));
         return getSucReturnObject().setData(list).toString();
     }
 
@@ -796,7 +798,7 @@ public class databoard extends Controller {
 
     public static List<DataTrans> supplementDate_cashbill(int year, List<DataTrans> params) {
         String[] monthAndDay = new String[]{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"};
-        String[] types = new String[]{"0", "1"};
+        String[] types = new String[]{"支出", "收入"};
         List<DataTrans> list = new ArrayList<>();
         if (params.isEmpty()) {
             for (String type : types) {
@@ -837,7 +839,7 @@ public class databoard extends Controller {
 
     public static List<DataTrans> supplementDate_cashbill_month(int year, List<DataTrans> params) {
         String[] monthAndDay = new String[]{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"};
-        String[] types = new String[]{"0", "1"};
+        String[] types = new String[]{"支出", "收入"};
         List<DataTrans> list = new ArrayList<>();
         if (params.isEmpty()) {
             for (String type : types) {
@@ -845,7 +847,7 @@ public class databoard extends Controller {
                     DataTrans dataTrans = new DataTrans();
                     String date = year + "-" + s + "-" + type;
                     dataTrans.setName(date);
-                    dataTrans.setDay(s);
+                    dataTrans.setMonth(s);
                     dataTrans.setType(type);
                     dataTrans.setYear(String.valueOf(year));
                     dataTrans.setValue(BigDecimal.ZERO);
@@ -886,7 +888,7 @@ public class databoard extends Controller {
         for (int i = 1; i <= 3; i++) {
             monthAndDay[i - 1] = String.format("%02d", current + i);
         }
-        String[] types = new String[]{"0", "1"};
+        String[] types = new String[]{"支出", "收入"};
         List<DataTrans> list = new ArrayList<>();
         if (params.isEmpty()) {
             for (String type : types) {