|  | @@ -24,7 +24,12 @@
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          <if test="ifDetour != null and ifDetour != ''">
 |  |          <if test="ifDetour != null and ifDetour != ''">
 | 
											
												
													
														|  |              ifDetour = #{ifDetour},
 |  |              ifDetour = #{ifDetour},
 | 
											
												
													
														|  | -            detourMile = #{detourMile},
 |  | 
 | 
											
												
													
														|  | 
 |  | +            <if test="detourEmptyMile != null and detourEmptyMile != '' or detourEmptyMile == 0">
 | 
											
												
													
														|  | 
 |  | +                detourEmptyMile = #{detourEmptyMile},
 | 
											
												
													
														|  | 
 |  | +            </if>
 | 
											
												
													
														|  | 
 |  | +            <if test="detourLoadMile != null and detourLoadMile != '' or detourLoadMile == 0">
 | 
											
												
													
														|  | 
 |  | +                detourLoadMile = #{detourLoadMile},
 | 
											
												
													
														|  | 
 |  | +            </if>
 | 
											
												
													
														|  |              detourDesc = #{detourDesc},
 |  |              detourDesc = #{detourDesc},
 | 
											
												
													
														|  |          </if>
 |  |          </if>
 | 
											
												
													
														|  |          driverassdesc = #{driverassdesc}
 |  |          driverassdesc = #{driverassdesc}
 | 
											
										
											
												
													
														|  | @@ -70,7 +75,7 @@
 | 
											
												
													
														|  |          set gasstation1 = #{gasstation1},
 |  |          set gasstation1 = #{gasstation1},
 | 
											
												
													
														|  |              gasstation2 = #{gasstation2},
 |  |              gasstation2 = #{gasstation2},
 | 
											
												
													
														|  |              gasstation3 = #{gasstation3}
 |  |              gasstation3 = #{gasstation3}
 | 
											
												
													
														|  | -        where SrcEntityID = #{entityId}
 |  | 
 | 
											
												
													
														|  | 
 |  | +        where SrcEntityID = #{entityId} and SrcLineNo = #{lineNo}
 | 
											
												
													
														|  |      </update>
 |  |      </update>
 | 
											
												
													
														|  |      <update id="submitAudit">
 |  |      <update id="submitAudit">
 | 
											
												
													
														|  |          update OrderBillsPlans
 |  |          update OrderBillsPlans
 | 
											
										
											
												
													
														|  | @@ -99,6 +104,13 @@
 | 
											
												
													
														|  |      <update id="theAuditFailedTaskList">
 |  |      <update id="theAuditFailedTaskList">
 | 
											
												
													
														|  |          UPDATE wf_TaskList SET status= 0 WHERE SYSID = '1' AND ACTID =#{actId} AND ENTITYID = #{entityId}
 |  |          UPDATE wf_TaskList SET status= 0 WHERE SYSID = '1' AND ACTID =#{actId} AND ENTITYID = #{entityId}
 | 
											
												
													
														|  |      </update>
 |  |      </update>
 | 
											
												
													
														|  | 
 |  | +    <update id="upReceipts">
 | 
											
												
													
														|  | 
 |  | +        update OrderBillsPlans set IfOrder2ed = 'S' where sysId = '1' and OrderNo = #{orderNo}
 | 
											
												
													
														|  | 
 |  | +    </update>
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    <update id="addAReviewComment">
 | 
											
												
													
														|  | 
 |  | +        update loadbills set audit2Desc = #{audit2Desc} where SrcEntityID = #{entityId} and SrcLineNo = #{lineNo}
 | 
											
												
													
														|  | 
 |  | +    </update>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      <delete id="deleteLoadFeeItemsByEntityId">
 |  |      <delete id="deleteLoadFeeItemsByEntityId">
 | 
											
												
													
														|  |          delete from LoadFeeItems where sysid = 1 and entityid = #{entityId}
 |  |          delete from LoadFeeItems where sysid = 1 and entityid = #{entityId}
 | 
											
										
											
												
													
														|  | @@ -144,6 +156,7 @@
 | 
											
												
													
														|  |          , p.ifLoaded ifLoaded
 |  |          , p.ifLoaded ifLoaded
 | 
											
												
													
														|  |          , p.ifUnLoaded ifUnLoaded
 |  |          , p.ifUnLoaded ifUnLoaded
 | 
											
												
													
														|  |          , p.ifStarted ifStarted
 |  |          , p.ifStarted ifStarted
 | 
											
												
													
														|  | 
 |  | +        , p.ifOrder2ed ifOrder2ed
 | 
											
												
													
														|  |          from wf_TaskList t
 |  |          from wf_TaskList t
 | 
											
												
													
														|  |          Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
 |  |          Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
 | 
											
												
													
														|  |          Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
 |  |          Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
 | 
											
										
											
												
													
														|  | @@ -161,13 +174,19 @@
 | 
											
												
													
														|  |              <if test="type == 'BD'">
 |  |              <if test="type == 'BD'">
 | 
											
												
													
														|  |                  and t.ActID=317
 |  |                  and t.ActID=317
 | 
											
												
													
														|  |                  <if test="flowType == '未装车'">
 |  |                  <if test="flowType == '未装车'">
 | 
											
												
													
														|  | -                    and p.ifLoaded = 'F' and p.ifUnLoaded = 'F'
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    and p.ifLoaded = 'F' and p.ifUnLoaded = 'F' and p.ifOrder2ed = 'F'
 | 
											
												
													
														|  |                  </if>
 |  |                  </if>
 | 
											
												
													
														|  |                  <if test="flowType == '未卸车'">
 |  |                  <if test="flowType == '未卸车'">
 | 
											
												
													
														|  | -                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'F'
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'F' and p.ifOrder2ed = 'F'
 | 
											
												
													
														|  |                  </if>
 |  |                  </if>
 | 
											
												
													
														|  |                  <if test="flowType == '已卸车'">
 |  |                  <if test="flowType == '已卸车'">
 | 
											
												
													
														|  | -                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'T'
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'T' and p.ifOrder2ed = 'F'
 | 
											
												
													
														|  | 
 |  | +                </if>
 | 
											
												
													
														|  | 
 |  | +                <if test="flowType == '已提交'">
 | 
											
												
													
														|  | 
 |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'T' and p.ifOrder2ed = 'S'
 | 
											
												
													
														|  | 
 |  | +                </if>
 | 
											
												
													
														|  | 
 |  | +                <if test="flowType == '已审核'">
 | 
											
												
													
														|  | 
 |  | +                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'T' and p.IfOrder2ed = 'O'
 | 
											
												
													
														|  |                  </if>
 |  |                  </if>
 | 
											
												
													
														|  |              </if>
 |  |              </if>
 | 
											
												
													
														|  |              <if test="type == 'BX'">
 |  |              <if test="type == 'BX'">
 | 
											
										
											
												
													
														|  | @@ -210,15 +229,15 @@
 | 
											
												
													
														|  |      </select>
 |  |      </select>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      <select id="getOrderBillsPlansByid" resultType="com.ruoyi.system.domain.OrderBillsPlans">
 |  |      <select id="getOrderBillsPlansByid" resultType="com.ruoyi.system.domain.OrderBillsPlans">
 | 
											
												
													
														|  | -        Select g.CName         goodsCName
 |  | 
 | 
											
												
													
														|  | -             , p.LoadAddr      loadAddr
 |  | 
 | 
											
												
													
														|  | -             , l.SName         loadFactory
 |  | 
 | 
											
												
													
														|  | -             , p.LoadAttn      loadAttn
 |  | 
 | 
											
												
													
														|  | -             , p.LoadAttnTel   loadAttnTel
 |  | 
 | 
											
												
													
														|  | -             , p.UnLoadAddr    unLoadAddr
 |  | 
 | 
											
												
													
														|  | -             , ul.SName        unLoadFactory
 |  | 
 | 
											
												
													
														|  | -             , p.UnLoadAttn    unLoadAttn
 |  | 
 | 
											
												
													
														|  | -             , p.UNLoadAttnTel unLoadAttnTel
 |  | 
 | 
											
												
													
														|  | 
 |  | +        Select g.CName           goodsCName
 | 
											
												
													
														|  | 
 |  | +             , p.LoadAddr        loadAddr
 | 
											
												
													
														|  | 
 |  | +             , l.SName           loadFactory
 | 
											
												
													
														|  | 
 |  | +             , p.LoadAttn        loadAttn
 | 
											
												
													
														|  | 
 |  | +             , p.LoadAttnTel     loadAttnTel
 | 
											
												
													
														|  | 
 |  | +             , p.UnLoadAddr      unLoadAddr
 | 
											
												
													
														|  | 
 |  | +             , ul.SName          unLoadFactory
 | 
											
												
													
														|  | 
 |  | +             , p.UnLoadAttn      unLoadAttn
 | 
											
												
													
														|  | 
 |  | +             , p.UNLoadAttnTel   unLoadAttnTel
 | 
											
												
													
														|  |               , p.planRemarks
 |  |               , p.planRemarks
 | 
											
												
													
														|  |               , p.orderNo
 |  |               , p.orderNo
 | 
											
												
													
														|  |               , p.loadQty
 |  |               , p.loadQty
 | 
											
										
											
												
													
														|  | @@ -233,22 +252,24 @@
 | 
											
												
													
														|  |               , p.remarks
 |  |               , p.remarks
 | 
											
												
													
														|  |               , p.driverassdesc
 |  |               , p.driverassdesc
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -             , dr1.Empl        driver1Name
 |  | 
 | 
											
												
													
														|  | -             , dr1.mobile      driver1mobile
 |  | 
 | 
											
												
													
														|  | 
 |  | +             , dr1.Empl          driver1Name
 | 
											
												
													
														|  | 
 |  | +             , dr1.mobile        driver1mobile
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |               , p.sysId
 |  |               , p.sysId
 | 
											
												
													
														|  | -             , b.entityId      loadBillsEntityId
 |  | 
 | 
											
												
													
														|  | -             , b.sysId         loadBillsSysId
 |  | 
 | 
											
												
													
														|  | 
 |  | +             , b.entityId        loadBillsEntityId
 | 
											
												
													
														|  | 
 |  | +             , b.sysId           loadBillsSysId
 | 
											
												
													
														|  |               , b.billStatus
 |  |               , b.billStatus
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -             , p.detourMile    detourMile
 |  | 
 | 
											
												
													
														|  | -             , p.detourDesc    detourDesc
 |  | 
 | 
											
												
													
														|  | -             , p.ifDetour      ifDetour
 |  | 
 | 
											
												
													
														|  | -             , p.CarRegNo      carRegNo
 |  | 
 | 
											
												
													
														|  | 
 |  | +             , p.detourEmptyMile detourEmptyMile
 | 
											
												
													
														|  | 
 |  | +             , p.detourLoadMile  detourLoadMile
 | 
											
												
													
														|  | 
 |  | +             , p.detourDesc      detourDesc
 | 
											
												
													
														|  | 
 |  | +             , p.ifDetour        ifDetour
 | 
											
												
													
														|  | 
 |  | +             , p.CarRegNo        carRegNo
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -             , p.ifLoaded      ifLoaded
 |  | 
 | 
											
												
													
														|  | -             , p.ifUnLoaded    ifUnLoaded
 |  | 
 | 
											
												
													
														|  | -             , p.ifStarted     ifStarted
 |  | 
 | 
											
												
													
														|  | 
 |  | +             , p.ifLoaded        ifLoaded
 | 
											
												
													
														|  | 
 |  | +             , p.ifUnLoaded      ifUnLoaded
 | 
											
												
													
														|  | 
 |  | +             , p.ifStarted       ifStarted
 | 
											
												
													
														|  | 
 |  | +             , p.ifOrder2ed      ifOrder2ed
 | 
											
												
													
														|  |          from OrderBillsPlans p
 |  |          from OrderBillsPlans p
 | 
											
												
													
														|  |                   Left join Empls e on (e.SysID = p.SysID and e.EmplID = p.TransactID)
 |  |                   Left join Empls e on (e.SysID = p.SysID and e.EmplID = p.TransactID)
 | 
											
												
													
														|  |                   Left join Empls dr1 on (dr1.SysID = p.SysID and dr1.EmplID = p.DRIVER1ID)
 |  |                   Left join Empls dr1 on (dr1.SysID = p.SysID and dr1.EmplID = p.DRIVER1ID)
 | 
											
										
											
												
													
														|  | @@ -317,6 +338,7 @@
 | 
											
												
													
														|  |               , o.loadDate loadDate
 |  |               , o.loadDate loadDate
 | 
											
												
													
														|  |               , o.unLoadQty unLoadQty
 |  |               , o.unLoadQty unLoadQty
 | 
											
												
													
														|  |               , o.unLoadDate unLoadDate
 |  |               , o.unLoadDate unLoadDate
 | 
											
												
													
														|  | 
 |  | +             , o.ifOrder2ed ifOrder2ed
 | 
											
												
													
														|  |          FROM OrderBillsPlans o
 |  |          FROM OrderBillsPlans o
 | 
											
												
													
														|  |                   INNER JOIN LoadBills b
 |  |                   INNER JOIN LoadBills b
 | 
											
												
													
														|  |                              ON
 |  |                              ON
 |