zhangyuewww 2 yıl önce
ebeveyn
işleme
c2c3a37f11

+ 14 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranSettlementReport.java

@@ -123,6 +123,10 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      * 货损
      */
     private Double cargoDamage;
+    /**
+     * 粮食单价
+     */
+    private Double grainPrice;
     /**
      * 预计单价(元/吨)
      */
@@ -216,9 +220,13 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      */
     private String workflowId;
     /**
-     * 手动修改标识(1是)
+     * 手动修改结算重量标识(1是)
      */
     private String manualFlag;
+    /**
+     * 手动修改扣款标识(1是)
+     */
+    private String manualIdentification;
     /**
      * 银行卡号
      */
@@ -328,7 +336,11 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      */
     @TableField(exist = false)
     private String titleNoOther;
-
+    /**
+     * 车辆状态
+     */
+    @TableField(exist = false)
+    private String carType;
 
     @Override
     protected Serializable pkVal() {

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutInfo.java

@@ -471,6 +471,11 @@ public class WarehouseInOutInfo extends BaseModel<WarehouseInOutInfo> {
      */
     @TableField(exist = false)
     private String taskNo;
+    /**
+     * 粮食单价
+     */
+    @TableField(exist = false)
+    private Double grainPrice;
 
 
     @Override

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousingOrder.java

@@ -455,6 +455,11 @@ public class WarehousingOrder extends BaseModel<WarehousingOrder> {
      */
     @TableField(exist = false)
     private Double price;
+    /**
+     * 身份证号码
+     */
+    @TableField(exist = false)
+    private String customerNumberCard;
 
     @Override
     protected Serializable pkVal() {

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

@@ -153,6 +153,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
         pageView.put("taskNo", tranSettlementReport.getTaskNo());
         pageView.put("processNo", tranSettlementReport.getProcessNo());
         pageView.put("carId", tranSettlementReport.getCarId());
+        pageView.put("carType", tranSettlementReport.getCarType());
         pageView.put("contractNo", tranSettlementReport.getContractNo());
         pageView.put("roleFlag", tranSettlementReport.getRoleFlag());
         pageView.put("statusFlag", tranSettlementReport.getStatusFlag());

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

@@ -360,6 +360,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                             .eq("customer_name", warehousingOrder1.getGoodsSource())
                             .eq("contract_no", warehousingOrder1.getContractNo())
                             .eq("goods_name", warehousingOrder1.getGoodsName())
+                            .eq("customer_number_card", warehousingOrder1.getCustomerNumberCard())
                             .ne("status", "待结算")
                             .ge("settlement_date", beforeDay));
                     WarehousingOrder warehousingOrder = new WarehousingOrder();
@@ -895,6 +896,25 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                     warehousingOrder1.setStatusFlag("");
                     warehousingOrder1.setStatus("");
                     this.updateById(warehousingOrder1);
+                    if ("收购入库".equals(warehousingOrder1.getInType())) {
+                        List<PaymentManagement> paymentManagementList = paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
+                                .eq("order_id", warehousingOrder1.getId())
+                                .eq("delete_flag", 0));
+                        if (!CollectionUtils.isEmpty(paymentManagementList)) {
+                            for (PaymentManagement paymentManagement : paymentManagementList) {
+                                //入库单未付为0时
+                                if (warehousingOrder1.getAmountNotPayable() == 0) {
+                                    paymentManagement.setStatus("全部付款");
+                                    paymentManagement.setStatusFlag("5");
+                                }
+                                else {
+                                    paymentManagement.setStatus("部分付款");
+                                    paymentManagement.setStatusFlag("4");
+                                }
+                                paymentManagementService.updateById(paymentManagement);
+                            }
+                        }
+                    }
                 }
             }
             //预付款分配

+ 5 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -1185,7 +1185,7 @@
                        AND exi.expenses_type = '1'
                        AND exi.expenses_purpose = '1'
                        AND exi.delete_flag = '0'
-                 )- (
+                 )+ (
                      SELECT
                          IFNULL( SUM( eai.distribution_money ), 0 )
                      FROM
@@ -1199,14 +1199,12 @@
                          cmi1.id = cmi.id
                  ))/ (
                     SELECT
-                        IFNULL( SUM( wioi.net_weight ), 1 )
+                        IFNULL( SUM( sprr.net_weight ), 1 )
                     FROM
-                        warehouse_in_out_info wioi
+                        stock_purchase_receipt_report sprr
                     WHERE
-                        wioi.contract_no = cmi.contract_no
-                      AND wioi.status_flag = '3'
-                      AND wioi.in_out_type = '采购入库'
-                      AND wioi.delete_flag = '0'
+                        sprr.contract_no = cmi.contract_no
+                      AND sprr.delete_flag = '0'
                 ) AS price
         FROM
             contract_management_info cmi

+ 18 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TranSettlementReportMapper.xml

@@ -23,6 +23,14 @@
         <if test="tranTypeKey != null and tranTypeKey != ''">
             AND tran_type_key = #{tranTypeKey}
         </if>
+        <if test="carType != null and carType != ''">
+            <if test="carType == 1">
+                AND loading_weight is not null  and unloading_weight is null
+            </if>
+            <if test="carType == 2">
+                AND unloading_weight is not null
+            </if>
+        </if>
         <if test="taskNo != null and taskNo != ''">
             AND task_no = #{taskNo}
         </if>
@@ -70,6 +78,7 @@
         batch_id as batchId,
         phone,
         name as name,
+        grain_price as grainPrice,
         service_charge as serviceCharge,
         amount_actually_paid as amountActuallyPaid,
         tax_point as taxPoint,
@@ -88,7 +97,7 @@
         loss_weight as lossWeight,
         actual_loss as actualLoss,
         cargo_damage as cargoDamage,
-        manual_flag as ManualFlag,
+        manual_flag as manualFlag,
         transport_price as transportPrice,
         settlement_price as settlementPrice,
         settlement_weight as settlementWeight,
@@ -122,6 +131,14 @@
         <if test="tranTypeKey != null and tranTypeKey != ''">
             AND tran_type_key = #{tranTypeKey}
         </if>
+        <if test="carType != null and carType != ''">
+            <if test="carType == 1">
+                AND loading_weight is not null  and unloading_weight is null
+            </if>
+            <if test="carType == 2">
+                AND unloading_weight is not null
+            </if>
+        </if>
         <if test="taskNo != null and taskNo != ''">
             AND task_no = #{taskNo}
         </if>

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

@@ -230,6 +230,7 @@
         SELECT
             pm.warehouse_name as warehouseName,
             pm.customer_name as goodsSource,
+            pm.customer_number_card as customerNumberCard,
             pm.comp_id as compId,
             pm.contract_no as contractNo,
             pm.settlement_date as updateDate,