Forráskód Böngészése

凯和对账单导出修改

lazhaoqian 3 éve
szülő
commit
1efc4b06ee

+ 14 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/ExportFinancial.java

@@ -44,6 +44,11 @@ public class ExportFinancial {
      */
     private BigDecimal fAmount;
 
+    /**
+     * 运输条款
+     */
+    private String fServiceitems;
+
     public Long getRankNo() {
         return rankNo;
     }
@@ -116,6 +121,14 @@ public class ExportFinancial {
         this.fAmount = fAmount;
     }
 
+    public String getfServiceitems() {
+        return fServiceitems;
+    }
+
+    public void setfServiceitems(String fServiceitems) {
+        this.fServiceitems = fServiceitems;
+    }
+
     @Override
     public String toString() {
         return "ExportFinancial{" +
@@ -128,6 +141,7 @@ public class ExportFinancial {
                 ", specification='" + specification + '\'' +
                 ", fUnitPrice=" + fUnitPrice +
                 ", fAmount=" + fAmount +
+                ", fServiceitems=" + fServiceitems +
                 '}';
     }
 }

+ 24 - 20
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -1773,6 +1773,7 @@ public class TFeeServiceImpl implements ITFeeService {
         sheet.setColumnWidth(6, 256 * 15);
         sheet.setColumnWidth(7, 100 * 35);
         sheet.setColumnWidth(8, 256 * 15);
+        sheet.setColumnWidth(9, 256 * 15);
         //3.设置样式以及字体样式
         HSSFCellStyle titleStyle = ExcelUtils.createTitleCellStyle(wb);
         HSSFCellStyle contentStyle = ExcelUtils.createContentCellStyle(wb);
@@ -1784,7 +1785,7 @@ public class TFeeServiceImpl implements ITFeeService {
         //创建第一行,索引从0开始(标题行)
         HSSFRow row0 = sheet.createRow(rowNum++);
         row0.setHeight((short) 800);// 设置行高
-        for (int i = 0; i < 9; i++) {
+        for (int i = 0; i < 10; i++) {
             HSSFCell tempCell = row0.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
@@ -1793,19 +1794,19 @@ public class TFeeServiceImpl implements ITFeeService {
         c00.setCellValue(title);
         c00.setCellStyle(titleStyle);
         // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始)
-        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 9));//标题合并单元格操作,总列数为9
         //第2行
         HSSFRow row1 = sheet.createRow(rowNum++);
         row1.setHeight((short) 500);
         String message1 = "客户确认单";
-        for (int i = 0; i < 9; i++) {
+        for (int i = 0; i < 10; i++) {
             HSSFCell tempCell = row1.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
         HSSFCell c01 = row1.createCell(0);
         c01.setCellValue(message1);
         c01.setCellStyle(subheadingStyle);
-        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 8));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 9));//标题合并单元格操作,总列数为9
 
         //第3行
         HSSFRow row2 = sheet.createRow(rowNum++);
@@ -1815,18 +1816,18 @@ public class TFeeServiceImpl implements ITFeeService {
         c02.setCellValue(message2);
         c02.setCellStyle(contentStyle);
         //第3行
-        for (int i = 1; i < 9; i++) {
+        for (int i = 1; i < 10; i++) {
             HSSFCell tempCell = row2.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
         HSSFCell c03 = row2.createCell(1);
         c03.setCellValue(corpName);
         c03.setCellStyle(contentStyle);
-        sheet.addMergedRegion(new CellRangeAddress(2, 2, 1, 8));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(2, 2, 1, 9));//标题合并单元格操作,总列数为9
         //合并单元格
         sheet.addMergedRegion(new CellRangeAddress(3, 3, 1, 2));
         sheet.addMergedRegion(new CellRangeAddress(3, 3, 3, 4));
-        sheet.addMergedRegion(new CellRangeAddress(3, 3, 5, 8));
+        sheet.addMergedRegion(new CellRangeAddress(3, 3, 5, 9));
         //第4行
         HSSFRow row3 = sheet.createRow(rowNum++);
         for (int i = 0; i < 1; i++) {
@@ -1841,7 +1842,7 @@ public class TFeeServiceImpl implements ITFeeService {
             HSSFCell tempCell = row3.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
-        for (int i = 5; i < 9; i++) {
+        for (int i = 5; i < 10; i++) {
             HSSFCell tempCell = row3.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
@@ -1870,7 +1871,7 @@ public class TFeeServiceImpl implements ITFeeService {
         c053.setCellStyle(contentStyle);
         //第5行
         HSSFRow row4 = sheet.createRow(rowNum++);
-        for (int i = 0; i < 9; i++) {
+        for (int i = 0; i < 10; i++) {
             HSSFCell tempCell = row4.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
@@ -1879,11 +1880,11 @@ public class TFeeServiceImpl implements ITFeeService {
         HSSFCell c04 = row4.createCell(0);
         c04.setCellValue(message4);
         c04.setCellStyle(contentStyle);
-        sheet.addMergedRegion(new CellRangeAddress(4, 4, 0, 8));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(4, 4, 0, 9));//标题合并单元格操作,总列数为9
         //第四行
         HSSFRow row5 = sheet.createRow(rowNum++);
         row5.setHeight((short) 500);
-        String[] row_third = {"序号", "提单号", "始发港", "目的港", "货名", "箱量", "规格", "单价", "合计"};
+        String[] row_third = {"序号", "提单号", "始发港", "目的港","运输条款", "货名", "箱量", "规格", "单价", "合计"};
         for (int i = 0; i < row_third.length; i++) {
             HSSFCell tempCell = row5.createCell(i);
             tempCell.setCellValue(row_third[i]);
@@ -1896,7 +1897,7 @@ public class TFeeServiceImpl implements ITFeeService {
                 HSSFRow tempRow = sheet.createRow(rowNum++);
                 tempRow.setHeight((short) 500);
                 //循环单元格填入数据
-                for (int j = 0; j < 9; j++) {
+                for (int j = 0; j < 10; j++) {
                     HSSFCell tempCell = tempRow.createCell(j);
                     tempCell.setCellStyle(contentStyle);
                     String cellValue = "";
@@ -1913,18 +1914,21 @@ public class TFeeServiceImpl implements ITFeeService {
                         //目的港
                         cellValue = list.get(i).getDestinationPort();
                     } else if (j == 4) {
+                        //运输条款
+                        cellValue = list.get(i).getfServiceitems();
+                    } else if (j == 5) {
                         //货名
                         cellValue = list.get(i).getGoodName();
-                    } else if (j == 5) {
+                    } else if (j == 6) {
                         //箱量
                         cellValue = list.get(i).getfCnTrCount().toString();
-                    } else if (j == 6) {
+                    } else if (j == 7) {
                         //规格
                         cellValue = list.get(i).getSpecification();
-                    } else if (j == 7) {
+                    } else if (j == 8) {
                         //单价
                         cellValue = list.get(i).getfUnitPrice().toString();
-                    } else if (j == 8) {
+                    } else if (j == 9) {
                         //合计
                         cellValue = list.get(i).getfAmount().toString();
                     }
@@ -1935,7 +1939,7 @@ public class TFeeServiceImpl implements ITFeeService {
         }
         //倒数第二行
         HSSFRow row6 = sheet.createRow(rowNum++);
-        for (int i = 0; i < 9; i++) {
+        for (int i = 0; i < 10; i++) {
             HSSFCell tempCell = row6.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
@@ -1944,12 +1948,12 @@ public class TFeeServiceImpl implements ITFeeService {
         HSSFCell c06 = row6.createCell(0);
         c06.setCellValue(message6);
         c06.setCellStyle(contentStyle);
-        HSSFCell c061 = row6.createCell(8);
+        HSSFCell c061 = row6.createCell(9);
         c061.setCellValue(fAmount.toString());
         c061.setCellStyle(contentStyle);
         //最后一行
         HSSFRow row7 = sheet.createRow(rowNum++);
-        for (int i = 0; i < 9; i++) {
+        for (int i = 0; i < 10; i++) {
             HSSFCell tempCell = row7.createCell(i);
             tempCell.setCellStyle(contentStyle);
         }
@@ -1960,7 +1964,7 @@ public class TFeeServiceImpl implements ITFeeService {
         HSSFCell c07 = row7.createCell(0);
         c07.setCellValue(message7);
         c07.setCellStyle(endStyle);
-        sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 8));//标题合并单元格操作,总列数为9
+        sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 9));//标题合并单元格操作,总列数为9
         //导出excel
 
         String fileName = "客户对账单.xls";

+ 8 - 6
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -2289,8 +2289,9 @@
         tp.goodName AS goodName,
         IFNULL(tp.fCnTrCount,0) AS fCnTrCount,
         tp.specification AS specification,
-        IFNULL(tp.fUnitPrice,0) AS fUnitPrice,
-        IFNULL(tp.fAmount,0) AS fAmount
+        ROUND(IFNULL(tp.fUnitPrice,0),2) AS fUnitPrice,
+        ROUND(IFNULL(tp.fAmount,0),2) AS fAmount,
+		tp.fServiceitems AS fServiceitems
         FROM
         (
             SELECT
@@ -2304,18 +2305,18 @@
 	            WHEN temp.fCnTrCount != 0 THEN temp.fAmount/temp.fCnTrCount
 	        ELSE 0
 	        END AS fUnitPrice,
-	        IFNULL(temp.fAmount,0) AS fAmount
+	        IFNULL(temp.fAmount,0) AS fAmount,
+			sd.dict_label fServiceitems
             FROM
             (
                 SELECT
 	            td.f_srcpid AS pId,
-	            IFNULL(SUM(tr.f_cntrcount),0) AS fCnTrCount,
-	            IFNULL(SUM(tf.f_amount),0) AS fAmount
+	            IFNULL(tr.f_cntrcount,0) AS fCnTrCount,
+	            IFNULL(SUM(td.f_amt),0) AS fAmount
                 FROM
 	            t_fee_do td
 	            LEFT JOIN
 	            t_warehousebills tw ON tw.f_id = td.f_srcpid
-	            LEFT JOIN t_warehousebillsfees tf ON tf.f_id = td.f_srcid
 	            LEFT JOIN t_warehousebills_cntr tr ON tr.f_pid = tw.f_id
 	            WHERE td.f_pid = #{id}
 	            GROUP BY td.f_srcpid
@@ -2326,6 +2327,7 @@
             LEFT JOIN t_warehousebills_cntr tc ON tc.f_pid = tw.f_id
             LEFT JOIN t_cntr tr ON tr.f_id = tc.f_cntrid
             LEFT JOIN t_goods tg ON tc.f_goodsid = tg.f_id
+			LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems AND sd.dict_type = 'f_serviceitems'
         )tp,
         (SELECT @rank:= 0) b
     </select>