浏览代码

提交代码

zyf 2 年之前
父节点
当前提交
6854c3cd0f

+ 17 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -90,6 +91,22 @@ public interface TmstruckLeaveFactoryResultMapper extends IBaseMapper<TmstruckLe
     */
     String querynote(String orderNumber);
 
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-09-21
+     * @Description:用于获取时间导致的变化
+    */
+    Date queryDate(String orderNumber);
+
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:2022-09-21
+     * @Description:用于获取对应的备注的一部分
+    */
+    String querypartOfNote(String orderNumber);
+
     /**
      * @author:zyf
      * @version:1.0

+ 23 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckSelfMachineService.java

@@ -3,13 +3,17 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.mapper.TmstruckEnfactoryResultMapper;
 import com.steerinfo.dil.mapper.TmstruckLeaveFactoryResultMapper;
 import com.steerinfo.dil.service.ITmstruckSelfMachineService;
+import org.checkerframework.checker.regex.RegexUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @author luobang
@@ -49,7 +53,25 @@ public class TmstruckSelfMachineService implements ITmstruckSelfMachineService {
     public Map<String, Object> getDeliveryOrder(String orderNumber) {
         //1.根据运输订单号查询主干信息
         Map<String,Object> map = tmstruckLeaveFactoryResultMapper.getDeliveryOrder(orderNumber);
-        map.put("note",tmstruckLeaveFactoryResultMapper.querynote(orderNumber));
+        //备注信息的查找以及修改
+        String note=tmstruckLeaveFactoryResultMapper.querynote(orderNumber);
+        Date date=tmstruckLeaveFactoryResultMapper.queryDate(orderNumber);
+        if (date!=null&&!("".equals(date))){
+            map.put("note",note);
+        }else {
+            String regex="\\d{1,2}\\.\\d{1,2}";
+            Pattern pattern=Pattern.compile(regex);
+            Matcher matcher=pattern.matcher(note);
+            StringBuffer stringBuffer=new StringBuffer();
+            stringBuffer.append(note);
+            String partOfNote = tmstruckLeaveFactoryResultMapper.querypartOfNote(orderNumber);
+            while (matcher.find()){
+                String group = matcher.group();
+                /*note=note.replace(group,partOfNote);*/
+                note=matcher.replaceAll(partOfNote);
+            }
+            map.put("note",note);
+        }
         map.put("orderNumber",orderNumber);
         if(map !=null){
             List<Map<String, Object>> deliveryOrderMaterialList = tmstruckLeaveFactoryResultMapper.getDeliveryOrderMaterial(orderNumber);

+ 1 - 1
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -1935,7 +1935,7 @@
                     NVL(R_CARRIER.CARRIER_ID,0) "carrierIds",
                     OO.CAN_WORK     "canwork",
                     OO.ORDER_STATUS              "carStatus",
-                    DECODE(OO.PRINTNUMBER,0,'已打印','未打印') "isPrintDelivery",
+                    DECODE(OO.PRINTNUMBER,1,'已打印','未打印') "isPrintDelivery",
                     DECODE(ASO.SALE_ORDER_STATUS,1,'销售订单已上报',
                                                  2,'销售已提交',
                                                  4,'财务已审批',

+ 17 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -1325,6 +1325,23 @@
           on aso.SALE_ORDER_ID =  asom.sale_order_id
          where oo.order_number = #{orderNumber}
     </select>
+    <select id="queryDate" resultType="java.util.Date">
+        select WOR.INSERT_TIME
+        from OMSTRUCK_ORDER OO
+        LEFT JOIN WMSP_OUTBOUND_RESULT WOR
+        ON WOR.BILL_LADING_ID=OO.ORDER_ID
+        where OO.ORDER_NUMBER=#{orderNumber}
+        and to_char(WOR.INSERT_TIME,'yyyy-MM-dd HH24:MI:SS')
+        between to_char(trunc(OO.INSERT_TIME , 'dd'),'yyyy-MM-dd HH24:mi:ss')
+        and to_char(trunc(OO.INSERT_TIME , 'dd')+1+8/24,'yyyy-MM-dd HH24:mi:ss')
+    </select>
+    <select id="querypartOfNote" resultType="java.lang.String">
+        select extract(month from OO.INSERT_TIME+1)
+        ||'.'||
+        extract(DAY from OO.INSERT_TIME +1) "partOfNote"
+        from OMSTRUCK_ORDER OO
+        where OO.ORDER_NUMBER=#{orderNumber}
+    </select>
     <select id="queryNumber" resultType="java.math.BigDecimal">
         select oom.order_material_number  "materialNumber"
         from omstruck_order oo