xuezizhuo 11 mēneši atpakaļ
vecāks
revīzija
2ad44d9a07

+ 15 - 8
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/ProductInvoiceServiceImpl.java

@@ -248,14 +248,21 @@ public class ProductInvoiceServiceImpl implements IProductInvoiceService {
         //查询发货货品详情
         List<ProductCodeListVO> productCodeListVOS = productOutboundRecordMapper.selectOutboundProduct(productInvoice.getNoticeNumber());
         vo.setProductCodeListVOList(productCodeListVOS);
-        //查询累计欠款
-        List<Customer> customerList = customerMapper.customerList(new Customer());
-        for (Customer customer : customerList){
-            if(customer.getId() == productInvoice.getCustomerId()){
-                vo.setAmounts(customer.getAmounts());
-                break;
-            }
-        }
+        //查询客户累计欠款
+        Customer customer = customerMapper.selectCustomerById(productInvoice.getCustomerId());
+        vo.setAmounts(customer.getAmount());
+
+
+//        List<Customer> customerList = customerMapper.customerList(new Customer());
+//        for (Customer customer : customerList){
+//            if(customer.getId() == productInvoice.getCustomerId()){
+//                vo.setAmounts(customer.getAmounts());
+//                break;
+//            }
+//        }
+
+
+
         return vo;
     }
 

+ 4 - 4
zkqy-custom-business/src/main/resources/mapper/business/FinishedProductInvoiceMapper.xml

@@ -122,10 +122,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN {DBNAME}.customer c ON src.customer_id = c.id
             left join {DBNAME}.customer_settlement_unit csu on src.settlement_unit_id = csu.id
         where src.del_flag = '0'
-        <if test="customerId != null "> and customer_id = #{customerId}</if>
-        <if test="settlementUnitId != null "> and settlement_unit_id = #{settlementUnitId}</if>
-        <if test="invoiceNumber != null  and invoiceNumber != ''"> and invoice_number = #{invoiceNumber}</if>
-        <if test="startTime != null and endTime != null">and invoice_date BETWEEN #{startTime} AND #{endTime}</if>
+        <if test="customerId != null "> and src.customer_id = #{customerId}</if>
+        <if test="settlementUnitId != null "> and src.settlement_unit_id = #{settlementUnitId}</if>
+        <if test="invoiceNumber != null  and invoiceNumber != ''"> and src.invoice_number = #{invoiceNumber}</if>
+        <if test="startTime != null and endTime != null">and src.invoice_date BETWEEN #{startTime} AND #{endTime}</if>
     </select>
 
     <select id="selectBillingDetails">

+ 1 - 1
zkqy-ui/src/views/orderMange/customerMange/index.vue

@@ -176,7 +176,7 @@
       <el-table-column label="累计欠款" align="center" prop="amounts">
         <template slot-scope="scope">
           <span :style="{color: scope.row.amounts > 0 ? 'red' : 'black'}">
-            {{ scope.row.amounts }}
+            {{ scope.row.amount }}
           </span>
         </template>
       </el-table-column>