| | |
| | | for (PendingSettlementBusiness pendingSettlementBusiness : pendingSettlementBusinesses) { |
| | | ReceivableLineTruckPriceRule exactMatchingRule = ExactPricingRuleMatcher.findExactMatchingRule(receivableLineTruckPriceRules, pendingSettlementBusiness.getCustomerName(), pendingSettlementBusiness.getDepartureLocation(), pendingSettlementBusiness.getArrivalLocation(), pendingSettlementBusiness.getVehicleType()); |
| | | if (exactMatchingRule!=null) { |
| | | //应收数据 |
| | | pendingSettlementBusiness.setEstimatedTotalIncome(exactMatchingRule.getFreight()); |
| | | pendingSettlementBusiness.setCreateTime(date); |
| | | EstimatedReceivable estimatedReceivable = new EstimatedReceivable(); |
| | |
| | | estimatedReceivable.setEstimatedAmount(exactMatchingRule.getFreight()); |
| | | estimatedReceivable.setCurrency("人民币"); |
| | | estimatedReceivable.setIsConfirmed(1); |
| | | |
| | | estimatedReceivable.setFeeType(0); |
| | | estimatedReceivables.add(estimatedReceivable); |
| | | } |
| | | ReceivableLineTruckPriceRule exactMatchingRule2 = ExactPricingRuleMatcher.findExactMatchingRule(payableLineTruckPriceRules, pendingSettlementBusiness.getCarrierName(), pendingSettlementBusiness.getDepartureLocation(), pendingSettlementBusiness.getArrivalLocation(), pendingSettlementBusiness.getVehicleType()); |
| | | if (exactMatchingRule2!=null) { |
| | | pendingSettlementBusiness.setEstimatedTotalCost(exactMatchingRule2.getFreight()); |
| | | pendingSettlementBusiness.setCreateTime(date); |
| | | |
| | | EstimatedReceivable estimatedReceivable = new EstimatedReceivable(); |
| | | estimatedReceivable.setFeeSystemNo("YF"+datePart+RandomUtils.random(5)); |
| | | estimatedReceivable.setDispatchNo(pendingSettlementBusiness.getDispatchNo()); |
| | | estimatedReceivable.setCustomerName(pendingSettlementBusiness.getCustomerName()); |
| | | estimatedReceivable.setProjectName(pendingSettlementBusiness.getProjectName()); |
| | | estimatedReceivable.setOrderDate(pendingSettlementBusiness.getCreatedTime()); |
| | | estimatedReceivable.setFeeName("运费"); |
| | | estimatedReceivable.setEstimatedAmount(exactMatchingRule2.getFreight()); |
| | | estimatedReceivable.setCurrency("人民币"); |
| | | estimatedReceivable.setIsConfirmed(1); |
| | | estimatedReceivable.setFeeType(0); |
| | | estimatedReceivables.add(estimatedReceivable); |
| | | } |
| | | } |
| | | if (CollectionUtil.isNotEmpty(estimatedReceivables)){ |
| | |
| | | @TableField("fee_name") |
| | | private String feeName; |
| | | |
| | | /** 费用类型 */ |
| | | // @Excel(name = "费用类型") |
| | | |
| | | @TableField("fee_type") |
| | | private Integer feeType; |
| | | |
| | | |
| | | /** 预估费用金额 */ |
| | | @Excel(name = "预估费用金额") |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="deleted" column="deleted" /> |
| | | <result property="feeType" column="fee_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectEstimatedReceivableVo"> |
| | | select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted from estimated_receivable AS thisTab |
| | | select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted , thisTab.fee_type from estimated_receivable AS thisTab |
| | | </sql> |
| | | <sql id="selectEstimatedReceivableVoCount"> |
| | | select count(0) from estimated_receivable as thisTab |
| | |
| | | <if test="confirmBy != null and confirmBy != ''"> and thisTab.confirm_by = #{confirmBy}</if> |
| | | <if test="confirmTime != null "> and thisTab.confirm_time = #{confirmTime}</if> |
| | | <if test="deleted != null "> and thisTab.deleted = #{deleted}</if> |
| | | <if test="feeType != null "> and thisTab.fee_type = #{feeType}</if> |
| | | </sql> |
| | | |
| | | <!--查询--> |
| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | <if test="feeType != null">fee_type,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="feeSystemNo != null and feeSystemNo != ''">#{feeSystemNo},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="deleted != null">#{deleted},</if> |
| | | <if test="feeType != null">#{feeType},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertEstimatedReceivableBatch" parameterType="java.util.List" > |
| | | insert into estimated_receivable |
| | | <trim prefix="(" suffix=") values" suffixOverrides=","> |
| | | id,fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted, |
| | | fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted,fee_type, |
| | | </trim> |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | <trim prefix="(" suffix=") " suffixOverrides=","> |
| | | #{item.id},#{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted}, |
| | | #{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.feeType}, |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="deleted != null">deleted = #{deleted},</if> |
| | | <if test="feeType != null">fee_type = #{feeType},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="item.createTime != null">create_time = #{item.createTime},</if> |
| | | <if test="item.updateTime != null">update_time = #{item.updateTime},</if> |
| | | <if test="item.deleted != null">deleted = #{item.deleted},</if> |
| | | <if test="item.feeType != null">fee_type = #{item.feeType},</if> |
| | | </trim> |
| | | where id = #{item.id} |
| | | </foreach> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertPendingSettlementBusinessBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> |
| | | <insert id="insertPendingSettlementBusinessBatch" parameterType="java.util.List"> |
| | | insert into pending_settlement_business |
| | | <trim prefix="(" suffix=") values" suffixOverrides=","> |
| | | id,booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time, |
| | | booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time, |
| | | </trim> |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | <trim prefix="(" suffix=") " suffixOverrides=","> |
| | | #{item.id},#{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime}, |
| | | #{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime}, |
| | | </trim> |
| | | </foreach> |
| | | </insert> |