Browse Source

代收合同导出

zhangyuewww 3 years ago
parent
commit
ba2a56fdd2

+ 9 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java

@@ -446,22 +446,27 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
     @TableField(exist = false)
     private Double invoiced;
     /**
-     * 应付金额
+     * 代收合同已完成
+     */
+    @TableField(exist = false)
+    private Double completed;
+    /**
+     * 代收合同应付金额
      */
     @TableField(exist = false)
     private Double amountIngPayable;
     /**
-     * 已收金额
+     * 代收合同已收金额
      */
     @TableField(exist = false)
     private Double amountEdCollectionable;
     /**
-     * 应收金额
+     * 代收合同应收金额
      */
     @TableField(exist = false)
     private Double amountNotCollectable;
     /**
-     * 已付金额
+     * 代收合同已付金额
      */
     @TableField(exist = false)
     private Double amountEdPayableNew;

+ 9 - 11
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -1007,7 +1007,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         row0.setHeightInPoints(25);
         cell = row0.createCell(1);
         cell.setCellStyle(styleTitle);
-        cell.setCellValue("合同信息");
+        cell.setCellValue("代收合同信息");
         sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 1, (short) 13));
         cell = row0.createCell(2);
         cell.setCellStyle(styleTitle);
@@ -1089,8 +1089,6 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         if (CollectionUtils.isNotEmpty(contractManagementInfos)) {
             for (int i = 0; i < contractManagementInfos.size(); i++) {
                 ContractManagementInfo contractManagementInfo = contractManagementInfos.get(i);
-                ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>()
-                        .eq("contract_id",contractManagementInfo.getId()));
                 HSSFRow rowx = sheet.createRow((int) rownum);
                 rowx.setHeightInPoints(20);
                 cell = rowx.createCell(1);
@@ -1112,24 +1110,24 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 cell.setCellValue(editFloat(contractManagementInfo.getWeight()));
                 cell.setCellStyle(contextstyle);
                 HSSFDataFormat format1 = wb.createDataFormat(); // 此处设置数据格式
-                contextstyle.setDataFormat(format1.getFormat("0.000"));
+                contextstyle.setDataFormat(format1.getFormat("0.00"));
                 cell = rowx.createCell(7);
-                cell.setCellValue(editFloat(contractManagementInfo.getCompletedQuantity()));
+                cell.setCellValue(editDouble(contractManagementInfo.getCompleted()));
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(8);
                 cell.setCellValue(editDouble(contractManagementInfo.getAmountIngPayable()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(9);
-                cell.setCellValue(editString(contractManagementInfo.getAmountEdPayable()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellValue(editDouble(contractManagementInfo.getAmountEdPayableNew()));
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(10);
                 cell.setCellValue(editDouble(contractManagementInfo.getAmountNotCollectable()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(11);
                 cell.setCellValue(editDouble(contractManagementInfo.getAmountEdCollectionable()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(12);
-                cell.setCellValue(editFloat(Float.valueOf(String.valueOf(contractProcessInfo.getGoodsName()!=null?contractProcessInfo.getGoodsName():"0"))));
+                cell.setCellValue(editDouble(contractManagementInfo.getInvoiced()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
                 cell.setCellValue(editString(contractManagementInfo.getStatus()!=null?contractManagementInfo.getStatus():contractManagementInfo.getApproveStatus()));

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -45,6 +45,7 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo">
         SELECT
         m.id,
+        m.comp_id as compId,
         m.contract_no as contractNo,
         g.goods_name as goodsName,
         g.grade as grade,
@@ -75,6 +76,11 @@
         p.mildew_grain as contractExpenditure,
         p.water_content as expenses,
         p.goods_name as invoiced,
+        (SELECT IFNULL(sum(col.net_weight),0)
+        FROM collection_warehousing_record col
+        WHERE col.delete_flag = '0'
+        AND col.contract_no=m.contract_no
+        AND col.comp_id = m.comp_id) as completed,
         (SELECT IFNULL(sum(col.amount_ing_payable),0)
         FROM collection_warehousing_record col
         WHERE col.delete_flag = '0'