Bläddra i källkod

途宝报单新需求

wangzhuo 1 år sedan
förälder
incheckning
d929162807

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wx/OrderBillsPlansController.java

@@ -161,5 +161,15 @@ public class OrderBillsPlansController {
         return orderBillsPlansService.deleteTmsAttachMngs(attachId);
     }
 
+    /**
+     * 提交报账单
+     * @param orderNo
+     * @return
+     */
+    @GetMapping("/up-receipts/{orderNo}")
+    public AjaxResult upReceipts(@PathVariable(value = "orderNo") Long orderNo) {
+        return orderBillsPlansService.upReceipts(orderNo);
+    }
+
 
 }

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderBillsPlans.java

@@ -144,4 +144,14 @@ public class OrderBillsPlans {
     @TableField(jdbcType = JdbcType.CHAR)
     private String ifStarted;
 
+    // 绕路里程
+    @TableField(jdbcType = JdbcType.DOUBLE)
+    private Double detourEmptyMile;
+    @TableField(jdbcType = JdbcType.DOUBLE)
+    private Double detourLoadMile;
+
+
+    @TableField(jdbcType = JdbcType.CHAR)
+    private String ifOrder2ed;
+
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/WfTaskList.java

@@ -50,5 +50,6 @@ public class WfTaskList {
     private String ifLoaded;
     private String ifUnLoaded;
     private String ifStarted;
+    private String ifOrder2ed;
 
 }

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderBillsPlansVo.java

@@ -60,4 +60,9 @@ public class OrderBillsPlansVo extends OrderBillsPlans {
      */
     private String flowType;
 
+    /**
+     * 审核意见
+     */
+    private String audit2Desc;
+
 }

+ 14 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderBillsPlansMapper.java

@@ -194,4 +194,18 @@ public interface OrderBillsPlansMapper {
      */
     Integer theAuditFailed(String orderNo);
     Integer theAuditFailedTaskList(@Param("actId") String actId, @Param("entityId") Long entityId);
+
+    /**
+     * 提交报账单
+     * @param orderNo
+     * @return
+     */
+    int upReceipts(Long orderNo);
+
+    /**
+     * 审核意见
+     * @param entityId
+     * @param audit2Desc
+     */
+    void addAReviewComment(@Param("entityId") Long entityId, @Param("audit2Desc") String audit2Desc, @Param("lineNo") Long lineNo);
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderBillsPlansService.java

@@ -94,4 +94,11 @@ public interface IOrderBillsPlansService {
      * @return
      */
     AjaxResult audit(OrderBillsPlansVo orderBillsPlansVo);
+
+    /**
+     * 提交报账单
+     * @param orderNo
+     * @return
+     */
+    AjaxResult upReceipts(Long orderNo);
 }

+ 33 - 69
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderBillsPlansServiceImpl.java

@@ -109,55 +109,24 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
             }
         }
 
-        List<WfTaskList> orderBillsPlansList = new ArrayList<>();
-//        try {
+        List<WfTaskList> orderBillsPlansList;
 
         orderBillsPlansList = orderBillsPlansMapper.getOrderBillsPlansLsit(map);
-//        } catch (Exception a) {
-//            System.out.println("aa");
-//        }
+
         for (WfTaskList wfTaskList : orderBillsPlansList) {
-//            Long status317 = wfTaskList.getStatus317();
-//            Long status376 = wfTaskList.getStatus376();
-//            if (status317 == null || status376 == null) {
-//                break;
-//            }
-
-//            if (status317 == 2) {
-//                wfTaskList.setBillStatusName("里程待提交");
-//            } else if (status376 == 2 || status376 == 0) {
-//                wfTaskList.setBillStatusName("费用待提交");
-//            } else if (status376 == 6) {
-//                wfTaskList.setBillStatusName("报单完成");
-//            }
 
             if ("BD".equals(type)) {
-//                if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded())) {
-//                    if ("S".equals(wfTaskList.getIfStarted())) {
-//                        wfTaskList.setBillStatusName("费用已提交");
-//                    } else if ("A".equals(wfTaskList.getIfStarted())) {
-//                        wfTaskList.setBillStatusName("审核通过");
-//                    } else if ("B".equals(wfTaskList.getIfStarted())) {
-//                        wfTaskList.setBillStatusName("审核驳回");
-//                    } else if ("F".equals(wfTaskList.getIfStarted())) {
-//                        wfTaskList.setBillStatusName("里程已提交");
-//                    }
-//                } else {
-//                    wfTaskList.setBillStatusName("里程待提交");
-//                }
-
-//                if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded())) {
-//                    wfTaskList.setBillStatusName("里程已提交");
-//                } else {
-//                    wfTaskList.setBillStatusName("里程待提交");
-//                }
-
-                if ("F".equals(wfTaskList.getIfLoaded()) && "F".equals(wfTaskList.getIfUnLoaded())) {
+
+                if ("F".equals(wfTaskList.getIfLoaded()) && "F".equals(wfTaskList.getIfUnLoaded()) && "F".equals(wfTaskList.getIfOrder2ed())) {
                     wfTaskList.setBillStatusName("未装车");
-                } else if ("T".equals(wfTaskList.getIfLoaded()) && "F".equals(wfTaskList.getIfUnLoaded())) {
+                } else if ("T".equals(wfTaskList.getIfLoaded()) && "F".equals(wfTaskList.getIfUnLoaded()) && "F".equals(wfTaskList.getIfOrder2ed())) {
                     wfTaskList.setBillStatusName("未卸车");
-                } else if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded())) {
+                } else if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded()) && "F".equals(wfTaskList.getIfOrder2ed())) {
                     wfTaskList.setBillStatusName("已卸车");
+                } else if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded()) && "S".equals(wfTaskList.getIfOrder2ed())) {
+                    wfTaskList.setBillStatusName("已提交");
+                } else if ("T".equals(wfTaskList.getIfLoaded()) && "T".equals(wfTaskList.getIfUnLoaded()) && "O".equals(wfTaskList.getIfOrder2ed())) {
+                    wfTaskList.setBillStatusName("已审核");
                 }
             } else if ("BX".equals(type)) {
 
@@ -295,38 +264,10 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
         // 更新LoadBills
         Integer y = orderBillsPlansMapper.updateLoadBillsByEntityID(orderBillsPlansVo);
 
-        // 根据登录名去匹配EMPLS 里面的EMPL  找到 EMPLID
-        String userName = SecurityUtils.getLoginUser().getUsername();
-        Empls empls = emplsMapper.getEmplsByEmpl(userName);
-
-
-        // 更新明细
-//        List<ItemsVo> itemsVoList = orderBillsPlansVo.getItemsVoList();
-
-        // if (itemsVoList == null || itemsVoList.size() == 0) {
-        //     return AjaxResult.success();
-        // }
-
-        // 删除所有明细
-        // Integer t = orderBillsPlansMapper.deleteLoadFeeItemsByEntityId(orderBillsPlansVo.getLoadBillsEntityId());
-        //
-        // Long lineNo = 1L;
-        // for (ItemsVo itemsVo : itemsVoList) {
-        //     itemsVo.setLineNo(lineNo);
-        //     Integer x = orderBillsPlansMapper.insertLoadFeeItems(orderBillsPlansVo, itemsVo, empls);
-        //     lineNo++;
-        // }
-
         for (LoadFeeItems loadFeeItems : orderBillsPlansVo.getLoadFeeItemsList()) {
-
-            // if (loadFeeItems.getAmt() == 0)
-            //     break;
-
             orderBillsPlansMapper.updateOrderBillsPlansBySysidEntityidLineno(loadFeeItems);
-
         }
 
-
         return AjaxResult.success();
     }
 
@@ -488,10 +429,33 @@ public class OrderBillsPlansServiceImpl implements IOrderBillsPlansService {
             orderBillsPlansMapper.theAuditFailedTaskList(actId.toString(), orderBillsPlansVo.getEntityId());
         }
 
+
+        // 审核意见
+        orderBillsPlansMapper.addAReviewComment(orderBillsPlansVo.getEntityId(),
+                                                orderBillsPlansVo.getAudit2Desc(),
+                                                orderBillsPlansVo.getLineNo());
+
+        if (i == 1) {
+            return AjaxResult.success("ok");
+        } else {
+            return AjaxResult.success("no");
+        }
+    }
+
+    /**
+     * 提交报账单
+     * @param orderNo
+     * @return
+     */
+    @Override
+    public AjaxResult upReceipts(Long orderNo) {
+        int i = orderBillsPlansMapper.upReceipts(orderNo);
+
         if (i == 1) {
             return AjaxResult.success("ok");
         } else {
             return AjaxResult.success("no");
         }
+
     }
 }

+ 47 - 25
ruoyi-system/src/main/resources/mapper/system/OrderBillsPlansMapper.xml

@@ -24,7 +24,12 @@
 
         <if test="ifDetour != null and 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},
         </if>
         driverassdesc = #{driverassdesc}
@@ -70,7 +75,7 @@
         set gasstation1 = #{gasstation1},
             gasstation2 = #{gasstation2},
             gasstation3 = #{gasstation3}
-        where SrcEntityID = #{entityId}
+        where SrcEntityID = #{entityId} and SrcLineNo = #{lineNo}
     </update>
     <update id="submitAudit">
         update OrderBillsPlans
@@ -99,6 +104,13 @@
     <update id="theAuditFailedTaskList">
         UPDATE wf_TaskList SET status= 0 WHERE SYSID = '1' AND ACTID =#{actId} AND ENTITYID = #{entityId}
     </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 from LoadFeeItems where sysid = 1 and entityid = #{entityId}
@@ -144,6 +156,7 @@
         , p.ifLoaded ifLoaded
         , p.ifUnLoaded ifUnLoaded
         , p.ifStarted ifStarted
+        , p.ifOrder2ed ifOrder2ed
         from wf_TaskList t
         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)
@@ -161,13 +174,19 @@
             <if test="type == 'BD'">
                 and t.ActID=317
                 <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 test="flowType == '未卸车'">
-                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'F'
+                    and p.ifLoaded = 'T' and p.ifUnLoaded = 'F' and p.ifOrder2ed = 'F'
                 </if>
                 <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 test="type == 'BX'">
@@ -210,15 +229,15 @@
     </select>
 
     <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.orderNo
              , p.loadQty
@@ -233,22 +252,24 @@
              , p.remarks
              , p.driverassdesc
 
-             , dr1.Empl        driver1Name
-             , dr1.mobile      driver1mobile
+             , dr1.Empl          driver1Name
+             , dr1.mobile        driver1mobile
 
              , p.sysId
-             , b.entityId      loadBillsEntityId
-             , b.sysId         loadBillsSysId
+             , b.entityId        loadBillsEntityId
+             , b.sysId           loadBillsSysId
              , 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
                  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)
@@ -317,6 +338,7 @@
              , o.loadDate loadDate
              , o.unLoadQty unLoadQty
              , o.unLoadDate unLoadDate
+             , o.ifOrder2ed ifOrder2ed
         FROM OrderBillsPlans o
                  INNER JOIN LoadBills b
                             ON