Browse Source

收入和支出凭证导入模板增加归属日期(不填则默认当前日期)及支出凭证,收入凭证,信用调整,增加操作记录

hu 1 year ago
parent
commit
b55101988f

+ 22 - 8
src/custom/restcontroller/sale/cashbill/IncomeExportExcel.java

@@ -106,7 +106,8 @@ public class IncomeExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 11000);// 设置 备注 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 3, (short) 11000);// 设置 备注 宽度
     }
     
     
@@ -121,8 +122,9 @@ public class IncomeExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 11000);// 设置 备注 宽度
-        sheet.setColumnWidth((short) 6, (short) 8000);// 设置 错误信息 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
+        sheet.setColumnWidth((short) 7, (short) 8000);// 设置 错误信息 宽度
     }
     /**
      * 2022-07-14 17:42:03
@@ -156,7 +158,7 @@ public class IncomeExportExcel {
         cellStyle2.setWrapText(true);
 
    	 /*第一行*/
-       sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5));
+       sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
 
        /*第一行塞值*/
        row = sheet.createRow(0);
@@ -164,7 +166,7 @@ public class IncomeExportExcel {
        cell.setCellStyle(cellStyle4);
        cell.setCellValue("收入凭证导入");
        /*第二行*/
-       sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 5));
+       sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));
        /*第二行塞值*/
        row = sheet.createRow(1);
        cell = row.createCell(0);// ID
@@ -195,6 +197,10 @@ public class IncomeExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle2);
         cell.setCellValue("备注");
        
 
@@ -223,6 +229,10 @@ public class IncomeExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle3);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle3);
         cell.setCellValue("备注");
         
     }
@@ -253,7 +263,7 @@ public class IncomeExportExcel {
         
 
       	 /*第一行*/
-          sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
+          sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 7));
 
           /*第一行塞值*/
           row = sheet.createRow(0);
@@ -261,7 +271,7 @@ public class IncomeExportExcel {
           cell.setCellStyle(cellStyle3);
           cell.setCellValue("收入凭证导入");
           /*第二行*/
-          sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));
+          sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
           /*第二行塞值*/
           row = sheet.createRow(1);
           cell = row.createCell(0);// ID
@@ -292,9 +302,13 @@ public class IncomeExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle2);
         cell.setCellValue("备注");
 
-          cell = row.createCell(6);
+          cell = row.createCell(7);
           cell.setCellStyle(cellStyle2);
           cell.setCellValue("错误信息");         
       

+ 22 - 8
src/custom/restcontroller/sale/cashbill/PayExportExcel.java

@@ -106,7 +106,8 @@ public class PayExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 11000);// 设置 备注 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
     }
     
     
@@ -121,8 +122,9 @@ public class PayExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 11000);// 设置 备注 宽度
-        sheet.setColumnWidth((short) 6, (short) 8000);// 设置 错误信息 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
+        sheet.setColumnWidth((short) 7, (short) 8000);// 设置 错误信息 宽度
     }
     /**
      * 2022-07-14 17:42:03
@@ -156,7 +158,7 @@ public class PayExportExcel {
         cellStyle2.setWrapText(true);
 
    	 /*第一行*/
-       sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5));
+       sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
 
        /*第一行塞值*/
        row = sheet.createRow(0);
@@ -164,7 +166,7 @@ public class PayExportExcel {
        cell.setCellStyle(cellStyle4);
        cell.setCellValue("支出凭证导入");
        /*第二行*/
-       sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 5));
+       sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));
        /*第二行塞值*/
        row = sheet.createRow(1);
        cell = row.createCell(0);// ID
@@ -195,6 +197,10 @@ public class PayExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle2);
         cell.setCellValue("备注");
        
 
@@ -223,6 +229,10 @@ public class PayExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle3);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle3);
         cell.setCellValue("备注");
         
     }
@@ -253,7 +263,7 @@ public class PayExportExcel {
         
 
       	 /*第一行*/
-          sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
+          sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 7));
 
           /*第一行塞值*/
           row = sheet.createRow(0);
@@ -261,7 +271,7 @@ public class PayExportExcel {
           cell.setCellStyle(cellStyle3);
           cell.setCellValue("支出凭证导入");
           /*第二行*/
-          sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));
+          sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
           /*第二行塞值*/
           row = sheet.createRow(1);
           cell = row.createCell(0);// ID
@@ -292,9 +302,13 @@ public class PayExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
+        cell.setCellValue(" 归属日期");
+
+        cell = row.createCell(6);
+        cell.setCellStyle(cellStyle2);
         cell.setCellValue("备注");
 
-          cell = row.createCell(6);
+          cell = row.createCell(7);
           cell.setCellStyle(cellStyle2);
           cell.setCellValue("错误信息");         
       

+ 22 - 5
src/custom/restcontroller/sale/cashbill/cashbill.java

@@ -97,9 +97,9 @@ public class cashbill extends Controller {
         try {
 
             // 华为云
-            e = getPostExcelFactory(content.getLong("attachmentid"));
+            //e = getPostExcelFactory(content.getLong("attachmentid"));
             // 本地
-            //e = getPostExcelFactory();
+            e = getPostExcelFactory();
 
             // Rows keyRow = dbConnect.runSqlQuery("select fagentnum,faddress from tagents
             // where 1=2");
@@ -111,6 +111,7 @@ public class cashbill extends Controller {
             keys.add("amount");
             keys.add("type");
             keys.add("typemx");
+            keys.add("period");
             keys.add("remarks");
             Rows accountclassRows = dbConnect.runSqlQuery("select sa_accountclassid,accountname from sa_accountclass where siteid='" + siteid + "' and isused=1");
             RowsMap accountclassRowsMap = accountclassRows.toRowsMap("accountname");
@@ -224,7 +225,12 @@ public class cashbill extends Controller {
                     sqlFactoryupload.addParameter("ownerid", 0);
                     sqlFactoryupload.addParameter("source", "");
                     sqlFactoryupload.addParameter("sourcenote", "");
-                    sqlFactoryupload.addParameter("period", "");
+                    if(StringUtils.isBlank(row.getString("period"))){
+                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                        sqlFactoryupload.addParameter("period",sdf.format(new Date()));
+                    }else{
+                        sqlFactoryupload.addParameter("period",row.getString("period"));
+                    }
 
                     sqllist.add(sqlFactoryupload.getSQL());
                     i++;
@@ -240,6 +246,7 @@ public class cashbill extends Controller {
                 map.put("amount", "金额");
                 map.put("type", "分类");
                 map.put("typemx", "分类明细");
+                map.put("period", "归属日期");
                 map.put("remarks", "备注");
                 map.put("msg", "错误信息");
                 ArrayList<String> colNameList = new ArrayList<String>();
@@ -249,6 +256,7 @@ public class cashbill extends Controller {
                 colNameList.add("amount");
                 colNameList.add("type");
                 colNameList.add("typemx");
+                colNameList.add("period");
                 colNameList.add("remarks");
                 colNameList.add("msg");
                 keytypemap.put("agentnum", String.class);
@@ -256,6 +264,7 @@ public class cashbill extends Controller {
                 keytypemap.put("amount", String.class);
                 keytypemap.put("type", String.class);
                 keytypemap.put("typemx", String.class);
+                keytypemap.put("period", String.class);
                 keytypemap.put("remarks", String.class);
                 keytypemap.put("msg", String.class);
                 rowserr.setFieldList(colNameList);
@@ -335,6 +344,12 @@ public class cashbill extends Controller {
             sqlFactory.addParameter("period", period);
             content.put("sa_cashbillid", sa_cashbillid);
             sqlList.add(sqlFactory.getSQL());
+            if(type==1){
+                sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "新增", "收入凭证新增成功").getSQL());
+            }else{
+                sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "新增", "支出凭证新增成功").getSQL());
+            }
+
         } else {
             Rows rowscount = dbConnect.runSqlQuery(
                     "select status from sa_cashbill where sa_cashbillid=" + sa_cashbillid);
@@ -358,7 +373,9 @@ public class cashbill extends Controller {
             sqlFactory.addParameter("sourcenote", "");
             sqlFactory.addParameter("period", period);
             sqlList.add(sqlFactory.getSQL());
+            sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "更新", "收支凭证更新成功").getSQL());
         }
+
         dbConnect.runSqlUpdate(sqlList);
         return queryCashbillMain();
     }
@@ -1204,7 +1221,7 @@ public class cashbill extends Controller {
                 } else {
                     datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
                 }
-                if (i1 == 6) {
+                if (i1 == 7) {
                     datarow.getCell(i1).setCellStyle(xssfCellStyle1);
                 }
             }
@@ -1248,7 +1265,7 @@ public class cashbill extends Controller {
                 } else {
                     datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
                 }
-                if (i1 == 6) {
+                if (i1 == 7) {
                     datarow.getCell(i1).setCellStyle(xssfCellStyle1);
                 }
             }

+ 2 - 0
src/custom/restcontroller/sale/creditbill/creditbill.java

@@ -53,6 +53,7 @@ public class creditbill extends Controller {
             sqlFactory.addParameter("username", username);
             content.put("sa_creditbillid", sa_creditbillid);
             sqlList.add(sqlFactory.getSQL());
+            sqlList.add(DataContrlLog.createLog(this, "sa_creditbill", sa_creditbillid, "新增", "信用额度调整单新增成功").getSQL());
         } else {
             Rows rowscount = dbConnect
                     .runSqlQuery("select status from sa_creditbill where sa_creditbillid=" + sa_creditbillid);
@@ -71,6 +72,7 @@ public class creditbill extends Controller {
             sqlFactory.addParameter("userid", userid);
             sqlFactory.addParameter("username", username);
             sqlList.add(sqlFactory.getSQL());
+            sqlList.add(DataContrlLog.createLog(this, "sa_creditbill", sa_creditbillid, "更新", "信用额度调整单更新成功").getSQL());
         }
         dbConnect.runSqlUpdate(sqlList);
         return queryCreditbillMain();