Browse Source

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccjgmwz 3 years ago
parent
commit
7844ba9d63

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

@@ -107,6 +107,15 @@ public class PurchaseReceiptReportController {
     public PurchaseOrder selectOrder(PurchaseReceiptReport purchaseReceiptReport){
         return purchaseReceiptReportService.selectOrder(purchaseReceiptReport);
     }
+    /**
+     * 根据客户名查合同编号
+     * @param customerName,contractNo
+     * @return
+     */
+    @GetMapping("/selectContractNo")
+    public List<PurchaseReceiptReport> selectContractNo(String customerName,String contractNo) {
+        return purchaseReceiptReportService.selectContractNo(customerName,contractNo);
+    }
 
 }
 

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

@@ -69,4 +69,10 @@ public interface IPurchaseReceiptReportService extends IService<PurchaseReceiptR
      * @param purchaseReceiptReport
      */
     PurchaseOrder selectOrder(PurchaseReceiptReport purchaseReceiptReport);
+    /**
+     * 根据客户名查合同编号
+     *
+     * @param customerName
+     */
+    List<PurchaseReceiptReport> selectContractNo(String customerName,String contractNo);
 }

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

@@ -150,7 +150,7 @@ public class FreightReceivingDispatchingServiceImpl extends ServiceImpl<FreightR
                 this.updateById(freightReceivingDispatching);
             }
             freightReceivingDispatchingCar.setGoodsIngPayable(freightReceivingDispatchingCar.getReciveNetWeight()*freightReceivingDispatchingList.get(0).getGoodsPrice());
-            freightReceivingDispatchingCar.setFreightIngPayable(freightReceivingDispatchingCar.getReciveNetWeight()*freightReceivingDispatchingList.get(0).getFreightUnitPrice()-freightReceivingDispatchingCar.getFreightDeductionAmount());
+            freightReceivingDispatchingCar.setFreightIngPayable(freightReceivingDispatchingCar.getReciveNetWeight()*freightReceivingDispatchingList.get(0).getFreightUnitPrice());
         }
 //        FreightReceivingDispatching freightReceivingDispatching = this.selectById(freightReceivingDispatchingCar.getInfoId());
 //        if (freightReceivingDispatching != null) {

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

@@ -157,12 +157,19 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
      */
     @Override
     public String replenishment(PurchaseReceiptReport purchaseReceiptReport) {
+        PurchaseReceiptReport purchaseReceiptReport1=this.selectById(purchaseReceiptReport.getId());
         if ("3".equals(purchaseReceiptReport.getCustomerConfirmationStatusFlag())) {
             // 未付金额不等0 可补货结转
             if (purchaseReceiptReport.getAmountNotPayable() != 0) {
-                this.updateById(purchaseReceiptReport);
+                purchaseReceiptReport1.setCarryForward("出"+purchaseReceiptReport.getCarryOverWeight()+"+"+purchaseReceiptReport.getContractNo());
+                //被结转条目净重要减去结转重量
+                purchaseReceiptReport1.setNetWeight(purchaseReceiptReport1.getNetWeight()-purchaseReceiptReport.getCarryOverWeight());
+                this.updateById(purchaseReceiptReport1);
                 PurchaseReceiptReport receiptReport = purchaseReceiptReport.getPurchaseReceiptReport();
                 receiptReport.setId(IdGenerator.generateUUID());
+                //净重为结转重量
+                receiptReport.setNetWeight(purchaseReceiptReport.getCarryOverWeight());
+                receiptReport.setCarryForward("入"+purchaseReceiptReport.getCarryOverWeight()+"+"+purchaseReceiptReport1.getContractNo());
                 this.insert(receiptReport);
             }
         } else {
@@ -361,4 +368,25 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
         return purchaseOrder;
     }
 
+    /**
+     * 根据客户名查合同编号
+     * @param customerName
+     */
+    @Override
+    public List<PurchaseReceiptReport> selectContractNo(String customerName,String contractNo) {
+        List<PurchaseReceiptReport> purchaseReceiptReportList=this.selectList(new EntityWrapper<PurchaseReceiptReport>()
+        .eq("customer_name",customerName)
+        .eq("delete_flag",0)
+        .orderBy("update_date",false)
+        .groupBy("contract_no"));
+        if (!CollectionUtils.isEmpty(purchaseReceiptReportList)){
+            for (PurchaseReceiptReport purchaseReceiptReport:purchaseReceiptReportList){
+                if (contractNo.equals(purchaseReceiptReport.getContractNo())){
+                    purchaseReceiptReportList.remove(purchaseReceiptReport);
+                }
+            }
+        }
+        return purchaseReceiptReportList;
+    }
+
 }

+ 22 - 60
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchaseClosingReportMapper.xml

@@ -11,6 +11,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -28,36 +39,6 @@
             </foreach>
             )
         </if>
-        <if test="statusFlag != null and statusFlag != ''">
-            status_flag =  #{statusFlag}
-        </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '3'
-                OR status_flag = '4'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
     </select>
     <!-- 获得采购平仓统计列表 -->
     <select id="getListByCondition" parameterType="Map"
@@ -91,6 +72,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -108,36 +100,6 @@
             </foreach>
             )
         </if>
-        <if test="statusFlag != null and statusFlag != ''">
-            status_flag =  #{statusFlag}
-        </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '3'
-                OR status_flag = '4'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
         ORDER BY close_position_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}

+ 22 - 58
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchaseReceiptReportMapper.xml

@@ -11,6 +11,17 @@
         WHERE
         comp_id = #{compId}
         and delete_flag = '0'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -28,35 +39,6 @@
             </foreach>
             )
         </if>
-        <if test="statusFlag != null and statusFlag != ''">
-            status_flag =  #{statusFlag}
-        </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '3'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
     </select>
     <!-- 获得采购入库统计列表 -->
     <select id="getListByCondition" parameterType="Map"
@@ -103,6 +85,17 @@
         WHERE
         comp_id = #{compId}
         and delete_flag = '0'
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -120,35 +113,6 @@
             </foreach>
             )
         </if>
-        <if test="statusFlag != null and statusFlag != ''">
-            status_flag =  #{statusFlag}
-        </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '3'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
         ORDER BY warehousing_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}

+ 22 - 54
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/SalesClosingReportMapper.xml

@@ -9,6 +9,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -26,33 +37,6 @@
             </foreach>
             )
         </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '4'
-                OR status_flag = '3'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
     </select>
     <!-- 获得销售平仓统计列表 -->
     <select id="getListByCondition" parameterType="Map"
@@ -86,6 +70,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -103,33 +98,6 @@
             </foreach>
             )
         </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '4'
-                OR status_flag = '3'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND amount_ing_payable-amount_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND amount_ing_payable-amount_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
         ORDER BY update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}

+ 22 - 52
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/SalesDeliveryReportMapper.xml

@@ -9,6 +9,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND collection_ing_payable-collection_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND collection_ing_payable-collection_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -26,32 +37,6 @@
             </foreach>
             )
         </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '4'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND collection_ing_payable-collection_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND collection_ing_payable-collection_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
     </select>
     <!-- 获得销售出库统计列表 -->
     <select id="getListByCondition" parameterType="Map"
@@ -90,6 +75,17 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND collection_ing_payable-collection_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND collection_ing_payable-collection_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''">
+            AND contract_no = #{contractNo}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -107,32 +103,6 @@
             </foreach>
             )
         </if>
-        <if test="searchType != null and searchType != ''">
-            <if test="searchType == 1 and roleFlag==1" >
-                AND status_flag = '1'
-                OR status_flag = '8'
-                OR status_flag = '11'
-            </if>
-            <if test="searchType == 1 and roleFlag==2" >
-                AND status_flag = '2'
-            </if>
-            <if test="searchType == 1 and roleFlag==3" >
-                AND status_flag = '7'
-            </if>
-            <if test="searchType == 1 and roleFlag==4" >
-                AND status_flag = '4'
-                OR status_flag = '9'
-            </if>
-            <if test="searchType == 2">
-                AND collection_ing_payable-collection_ed_payable>0
-            </if>
-            <if test="searchType == 3">
-                AND collection_ing_payable-collection_ed_payable=0
-            </if>
-        </if>
-        <if test="contractNo != null and contractNo != ''">
-            AND contract_no = #{contractNo}
-        </if>
         ORDER BY update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}