zxz il y a 3 ans
Parent
commit
49d3105576

+ 12 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java

@@ -2,12 +2,15 @@ package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
 import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * <p>
  * 付款管理 前端控制器
@@ -46,6 +49,15 @@ public class PaymentManagementController {
     public String payMoney(@RequestBody PaymentManagement paymentManagement){
         return paymentManagementService.payMoney(paymentManagement);
     }
+    /**
+     * 合同编号下拉列表
+     * @param compId
+     * @return
+     */
+    @GetMapping("/selectContractNoList")
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        return paymentManagementService.selectContractNoList(compId);
+    }
     /**
      * 收款
      * @param paymentManagement

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IPaymentManagementService.java

@@ -1,9 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 付款管理 服务类
@@ -50,6 +53,12 @@ public interface IPaymentManagementService extends IService<PaymentManagement> {
      * @param paymentManagement
      */
     String editCollect(PaymentManagement paymentManagement);
+    /**
+     * 合同编号下拉列表
+     *
+     * @param compId
+     */
+    List<ContractManagementInfo> selectContractNoList(String compId);
 
     /**
      * 删除

+ 38 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java

@@ -52,6 +52,8 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
     private ICommonCompanyService commonCompanyService;
     @Autowired
     private IIdentityAuthenticationInfoService iIdentityAuthenticationInfoService;
+    @Autowired
+    private IContractManagementInfoService ContractManagementInfoService;
 
 
     /**
@@ -82,6 +84,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         pageView.put("pageSize", paymentManagement.getPageSize());
         pageView.put("warehouseName",paymentManagement.getWarehouseName());
         pageView.put("customerPhone",paymentManagement.getCustomerPhone());
+        pageView.put("contractNo", paymentManagement.getContractNo());
         pageView.put("currentPage", paymentManagement.getCurrentPage());
         pageView.put("managementType",paymentManagement.getManagementType());
         pageView.put("businessKeys", businessKeys);
@@ -244,6 +247,41 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         }
         return "OK";
     }
+    /**
+     * 合同编号下拉列表
+     *
+     * @param compId
+     */
+    @Override
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        //查销售合同
+        List<ContractManagementInfo> contractManagementInfoList = ContractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                .eq("comp_id", compId)
+                .eq("contract_type", "1")
+                .eq("delete_flag", "0")
+                .orderBy("update_date", false));
+        for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
+            Float money = 0.0f;
+            Float collectMoney = 0.0f;
+            //查收款管理列表
+            List<PaymentManagement> paymentManagementList = this.selectList(new EntityWrapper<PaymentManagement>()
+                    .eq("contract_no", contractManagementInfo.getContractNo())
+                    .eq("delete_flag", "0"));
+            if (!CollectionUtils.isEmpty(paymentManagementList)) {
+                for (PaymentManagement paymentManagement : paymentManagementList) {
+                    money = money + paymentManagement.getAmountNotPayable();
+                    collectMoney = collectMoney + paymentManagement.getAmountNotCollectable();
+                }
+                //有未付/未收金额
+                if (money > 0 || collectMoney > 0) {
+                    contractManagementInfo.setReportStatus("待付款");
+                } else {
+                    contractManagementInfo.setReportStatus("已付款");
+                }
+            }
+        }
+        return contractManagementInfoList;
+    }
     /**
      * 添加备注
      * @param paymentManagement

+ 7 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -134,8 +134,14 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 paymentManagement1.setGrossWeight(weighingManagement.getGrossWeight());
                 paymentManagement1.setTare(weighingManagement1.getTare());
                 paymentManagement1.setNetWeight(weighingManagement.getNetWeight());
-                //应收
+                //计算应收
                 paymentManagement1.setCalculationCollectable(weighingManagement1.getContractPrice()*weighingManagement.getNetWeight());
+                //实际应收
+                paymentManagement.setActualCollectionment(paymentManagement1.getCalculationCollectable());
+                //未收
+                paymentManagement1.setAmountNotCollectable(paymentManagement1.getCalculationCollectable());
+                //已收
+                paymentManagement1.setAmountEdCollectionable(0.0f);
                 paymentManagement1.setManagementType("3");
                 paymentManagement1.setWarehouseName(weighingManagement1.getWarehouseName());
                 paymentManagementService.insert(paymentManagement1);

+ 8 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -37,6 +37,9 @@
             </foreach>
             )
         </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="statusSet != null and statusSet.size > 0">
             or (
             <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
@@ -58,7 +61,7 @@
         goods_name as goodsName,
         car_no as carNo,
         type,
---         contract_no as contractNo,
+        contract_no as contractNo,
         net_weight as netWeight,
         gross_weight as grossWeight,
         tare,
@@ -70,6 +73,7 @@
         calculation_collectable as calculationCollectable,
         actual_collectionment as actualCollectionment,
         amount_ed_collectionable as amountEdCollectionable,
+        amount_not_collectable as amountNotCollectable,
         management_type as managementType,
         customer_name as customerName,
         collection_date as collectionDate,
@@ -109,6 +113,9 @@
             </foreach>
             )
         </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="statusSet != null and statusSet.size > 0">
             or (
             <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">