Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zyf 2 gadi atpakaļ
vecāks
revīzija
674936fbb4
23 mainītis faili ar 742 papildinājumiem un 381 dzēšanām
  1. 7 1
      pom.xml
  2. 2 21
      src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java
  3. 16 0
      src/main/java/com/steerinfo/dil/controller/TmstruckSmsRusultController.java
  4. 22 2
      src/main/java/com/steerinfo/dil/controller/TmstruckTimeTaskResultController.java
  5. 1 1
      src/main/java/com/steerinfo/dil/controller/TmstruckWeightResultController.java
  6. 6 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.java
  7. 22 7
      src/main/java/com/steerinfo/dil/model/TmstruckTimeTaskResult.java
  8. 1 1
      src/main/java/com/steerinfo/dil/service/ITmstruckLeaveFactoryResultService.java
  9. 2 0
      src/main/java/com/steerinfo/dil/service/ITmstruckSmsRusultService.java
  10. 3 0
      src/main/java/com/steerinfo/dil/service/ITmstruckTimeTaskResultService.java
  11. 2 2
      src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java
  12. 4 6
      src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java
  13. 1 1
      src/main/java/com/steerinfo/dil/service/impl/TmstruckLoadResultServiceImpl.java
  14. 14 5
      src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java
  15. 27 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckSmsRusultServiceImpl.java
  16. 200 3
      src/main/java/com/steerinfo/dil/service/impl/TmstruckTimeTaskResultServiceImpl.java
  17. 1 1
      src/main/resources/application-dev.yml
  18. 0 1
      src/main/resources/application-prod.yml
  19. 73 53
      src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml
  20. 8 10
      src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml
  21. 2 1
      src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml
  22. 325 264
      src/main/resources/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.xml
  23. 3 1
      src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

+ 7 - 1
pom.xml

@@ -123,6 +123,12 @@
             <artifactId>httpclient</artifactId>
             <version>4.5.13</version>
         </dependency>
+        <!-- 系统配置接口 -->
+        <dependency>
+            <groupId>com.steerinfo</groupId>
+            <artifactId>systemui</artifactId>
+            <version>1.0</version>
+        </dependency>
         <!-- fastJson转换-->
         <dependency>
             <groupId>com.alibaba</groupId>
@@ -157,7 +163,7 @@
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
 <!--                        <param>MEASURE_JSON_DATA</param>-->
-                        <param>DIL_CID_CAPACITY</param>
+                        <param>TMSTRUCK_TIME_TASK_RESULT</param>
                     </tables>
                 </configuration>
                 <executions>

+ 2 - 21
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -749,40 +749,21 @@ public class StatisticalReportController extends BaseRESTfulController {
     public RESTfulResult getInwardSaleSteelOrder(@RequestBody(required=false) Map<String,Object> map,
                                                   String startTime,
                                                   String endTime,
-                                                  String carrierSsoId,
-                                                  String receiveName,
-                                                  String materialName,
-                                                  String specification,
                                                   String remark,
                                                   String capacityNo,
-                                                  String carrierName,
-                                                  String consigneeName,
-                                                  String saler
+                                                  String consigneeName
+
     ){
         DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
-        if(carrierSsoId != null){
-            if(!"null".equals(carrierSsoId) && carrierSsoId != null){
-                map.put("carrierSsoId", carrierSsoId);
-            }
-        }
-        if (receiveName != null && !"null".equals(receiveName)) {
-            map.put("receivName","%" + receiveName + "%");
-        }
         if (remark != null && !"".equals(remark) && !"null".equals(remark)) {
             map.put("remark","%" + remark + "%");
         }
         if (capacityNo != null && !"".equals(capacityNo) && !"null".equals(capacityNo)) {
             map.put("capacityNum","%" + capacityNo + "%");
         }
-        if (carrierName != null && !"".equals(carrierName) && !"null".equals(carrierName)) {
-            map.put("carrierNames","%" + carrierName + "%");
-        }
         if (consigneeName != null && !"".equals(consigneeName) && !"null".equals(consigneeName)) {
             map.put("consigneeNames","%" + consigneeName + "%");
         }
-        if (saler != null && !"".equals(saler) && !"null".equals(saler)) {
-            map.put("salers",saler);
-        }
         //分页数据
         List<Map<String, Object>> report = statisticalReportService.getInwardSaleSteelOrder(map);
         return success(report);

+ 16 - 0
src/main/java/com/steerinfo/dil/controller/TmstruckSmsRusultController.java

@@ -62,4 +62,20 @@ public class TmstruckSmsRusultController extends BaseRESTfulController{
         return success(pageList);
     }
 
+    @PostMapping("/sendMeaage")
+    public RESTfulResult sendMeaage(@RequestParam String mobile,
+                                    @RequestParam String content){
+        int i = 0;
+        try {
+             i = tmstruckSmsRusultService.sendMessage(mobile,content);
+        } catch (Exception e) {
+            return failed(e.getMessage());
+        }
+        if(i == 0){
+            return failed("发送失败");
+        }
+        return success("发送成功");
+    }
+
+
 }

+ 22 - 2
src/main/java/com/steerinfo/dil/controller/TmstruckTimeTaskResultController.java

@@ -196,10 +196,27 @@ public class TmstruckTimeTaskResultController extends BaseRESTfulController {
         return success(i);
     }
 
+
+
+    @ApiOperation(value="修改计时时长")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
+    })
+    @PostMapping("/modifyTimeTaskResult")
+    public RESTfulResult modifyTimeTaskResult(@RequestBody(required=false) Map<String,Object> mapValue) throws Exception{
+        int i = 0;
+        try{
+            i=tmstruckTimeTaskResultService.modifyTimeTaskResult(mapValue);
+        }catch (Exception e){
+            return failed(e.getMessage());
+        }
+        return success(i);
+    }
+
     @ApiOperation(value="查询计时作业")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
-            @ApiImplicitParam(name = "apiId(456)", value = "动态表头", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId(458)", value = "动态表头", required = false, dataType = "Integer"),
             @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
             @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
             @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
@@ -214,11 +231,14 @@ public class TmstruckTimeTaskResultController extends BaseRESTfulController {
                                           String startTime,
                                           String endTime
     ){
+        if (mapValue==null){
+            mapValue=new HashMap<>();
+        }
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (con!=null&&!con.equals("undifined")&&!con.equals("")){
             mapValue.put("con","%" + con + "%");
         }
-        if (userId!=null&&!userId.equals("undifined")&&!con.equals("")){
+        if (userId!=null&&!userId.equals("undifined")&&!userId.equals("")){
             mapValue.put("userId",userId);
         }
         PageHelper.startPage(pageNum,pageSize);

+ 1 - 1
src/main/java/com/steerinfo/dil/controller/TmstruckWeightResultController.java

@@ -89,7 +89,7 @@ public class TmstruckWeightResultController extends BaseRESTfulController {
         if (orderType!=null) {
             mapValue.put("orderTypee", orderType);
         }
-        if (con!=null&&!"null".equals(con)){
+        if (con!=null&&!"null".equals(con)&&!"".equals(con)){
             mapValue.put("con",con);
         }
         if (userId!=null){

+ 6 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.java

@@ -42,4 +42,10 @@ public interface TmstruckTimeTaskResultMapper extends IBaseMapper<TmstruckTimeTa
 
     Map<String,Object> getRequirementInfo(BigDecimal orderId1);
 
+    //查找计时开始时间
+    List<Map<String,Object>> getStartTimeTask(Map<String,Object> map);
+
+    //查找总时长
+    Map<String,Object> getResultValue(String orderNumber);
+
 }

+ 22 - 7
src/main/java/com/steerinfo/dil/model/TmstruckTimeTaskResult.java

@@ -10,31 +10,31 @@ import java.util.Date;
 @ApiModel(value="计时作业实绩表")
 public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
     /**
-     * 主键id(TIME_TASK_RESULT_ID,DECIMAL,38)
+     * 主键id(TIME_TASK_RESULT_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="主键id",required=true)
     private BigDecimal timeTaskResultId;
 
     /**
-     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,38)
+     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="总实绩ID",required=false)
     private BigDecimal resultTotalId;
 
     /**
-     * 作业时长(RESULT_VALUE,DECIMAL,10)
+     * 作业时长(RESULT_VALUE,DECIMAL,0)
      */
     @ApiModelProperty(value="作业时长",required=false)
     private BigDecimal resultValue;
 
     /**
-     * 度量单位ID(RESULT_UOM_ID,DECIMAL,38)
+     * 度量单位ID(RESULT_UOM_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="度量单位ID",required=false)
     private BigDecimal resultUomId;
 
     /**
-     * 记录时间类型:(0:计时开始申请时间;1:计时开始确认时间;2:计时结束申请时间;3:计时结束确认时间;4:暂停开始申请时间;5:暂停开始确认时间;6:暂停结束申请时间;7:暂停结束确认时间)(RESULT_TIME_TYPE,DECIMAL,38)
+     * 记录时间类型:(0:计时开始申请时间;1:计时开始确认时间;2:计时结束申请时间;3:计时结束确认时间;4:暂停开始申请时间;5:暂停开始确认时间;6:暂停结束申请时间;7:暂停结束确认时间)(RESULT_TIME_TYPE,DECIMAL,0)
      */
     @ApiModelProperty(value="记录时间类型:(0:计时开始申请时间;1:计时开始确认时间;2:计时结束申请时间;3:计时结束确认时间;4:暂停开始申请时间;5:暂停开始确认时间;6:暂停结束申请时间;7:暂停结束确认时间)",required=false)
     private BigDecimal resultTimeType;
@@ -46,7 +46,7 @@ public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
     private Date resultTime;
 
     /**
-     * 扫码开始作业点ID(RESULT_START_NODE_ID,DECIMAL,38)
+     * 扫码开始作业点ID(RESULT_START_NODE_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="扫码开始作业点ID",required=false)
     private BigDecimal resultStartNodeId;
@@ -64,7 +64,7 @@ public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
     private String resultStartLatitudeVal;
 
     /**
-     * 扫码结束作业点ID(RESULT_END_NODE_ID,DECIMAL,38)
+     * 扫码结束作业点ID(RESULT_END_NODE_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="扫码结束作业点ID",required=false)
     private BigDecimal resultEndNodeId;
@@ -129,6 +129,12 @@ public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="废除时间",required=false)
     private Date deleteTime;
 
+    /**
+     * 依照合同预估时间(RESULT_ABOUT_TIME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="依照合同预估时间",required=false)
+    private String resultAboutTime;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -301,6 +307,14 @@ public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
         this.deleteTime = deleteTime;
     }
 
+    public String getResultAboutTime() {
+        return resultAboutTime;
+    }
+
+    public void setResultAboutTime(String resultAboutTime) {
+        this.resultAboutTime = resultAboutTime == null ? null : resultAboutTime.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -327,6 +341,7 @@ public class TmstruckTimeTaskResult implements IBasePO<BigDecimal> {
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
         sb.append(", deleteName=").append(deleteName);
         sb.append(", deleteTime=").append(deleteTime);
+        sb.append(", resultAboutTime=").append(resultAboutTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 1 - 1
src/main/java/com/steerinfo/dil/service/ITmstruckLeaveFactoryResultService.java

@@ -34,7 +34,7 @@ public interface ITmstruckLeaveFactoryResultService {
     //新增进厂实绩 派单时新增
     int addLeaveFactory(Map<String,Object> mapValue);
 
-    Map<String, Object> getTruckFactoryResult(String nu);
+    Map<String, Object> getTruckFactoryResult(String orderNumber);
 
     // APP查询出厂信息
     List<Map<String, Object>> getLeaveFactoryList(String orderNumber);

+ 2 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckSmsRusultService.java

@@ -22,6 +22,8 @@ import java.util.Map;
  */
 public interface ITmstruckSmsRusultService{
 
+ int sendMessage(String mobile, String content) throws Exception;
+
  //查询短信实绩
  List<Map<String,Object>> getSmsResult(Map<String,Object> map);
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckTimeTaskResultService.java

@@ -62,6 +62,9 @@ public interface ITmstruckTimeTaskResultService {
     //生成账单
     int genernateInwardTime(Map<String,Object> map);
 
+    //修改计时时长
+    int modifyTimeTaskResult(Map<String, Object> mapValue) throws Exception;
+
 
     //修改计时作业
 //    int updateTimeTaskResult(Map<String,Object> map);

+ 2 - 2
src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java

@@ -256,13 +256,13 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
      * @throws Exception
      */
     public int steelOrderEnFactory(Map<String, Object> map, Map<String, Object> selectMap,BigDecimal resultTotalId) throws Exception{
-        if(!"OK".equals(selectMap.get("insertUpdateRemark"))){
+        if(!"OK".equals(selectMap.get("insertUpdateRemark")) && DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 1){
             throw new Exception("钢材科未确认进厂!");
         }
         //发送空委托
         map.put("firstMC", 1); //空委托依据
         int checkMeasureCommission = tmstruckMeasureCommissionService.addSteelMeasureCommission(map);
-        if(checkMeasureCommission == 1){
+        if(checkMeasureCommission == 1 && DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 1){
             //查询是否拼装
             Map<String, Object> isSpellingMap = tmstruckEnfactoryResultMapper.getSteelIsSpelling(resultTotalId);
             int isSpelling = DataChange.dataToBigDecimal(isSpellingMap.get("isSpelling")).intValue();

+ 4 - 6
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -31,8 +31,6 @@ import java.util.*;
 @Service(value = "tmstruckLeaveFactoryResultService")
 public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFactoryResultService {
 
-    @Autowired
-    private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
 
     @Autowired
     private TmstruckLeaveFactoryResultMapper tmstruckLeaveFactoryResultMapper;
@@ -105,8 +103,8 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
     }
 
     @Override
-    public Map<String, Object> getTruckFactoryResult(String nu) {
-        return tmstruckLeaveFactoryResultMapper.getTruckFactoryResult(nu);
+    public Map<String, Object> getTruckFactoryResult(String orderNumber) {
+        return tmstruckLeaveFactoryResultMapper.getTruckFactoryResult(orderNumber);
     }
 
     /**
@@ -240,13 +238,13 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
                             tmstruckSmsRusultService.generaSendMessage(mobile,capacityNum,orderId);
                     }
                     //销售厂外监控
-                    Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult(orderNumber);
+                    Map<String, Object> parem = getTruckFactoryResult(orderNumber);
                     parem.put("turnOf","0");
                     otmsFeign.createTotalResult(parem);
                     // 调用结算
                     bmsTruckFeign.addDetailsOrder(orderId);
                 }catch (Exception ex){
-
+                    System.out.println(ex.getMessage());
                 }
                 break;
             case 2:

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

@@ -329,7 +329,7 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
             String warehouseName = utilsMapper.queryWarehouseName(DataChange.dataToBigDecimal(map.get("warehouseId")));
             map.put("warehouseName",warehouseName);
         }
-//        int i = tmstruckMeasureCommissionService.addMeasureCommissionForLoding(map);
+        i =  tmstruckMeasureCommissionService.addMeasureCommissionForLoding(map);
         return 1;
     }
 

+ 14 - 5
src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java

@@ -11,6 +11,7 @@ import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.HTTPRequestUtils;
 import com.steerinfo.dil.util.getRequestUtils;
 import io.swagger.models.auth.In;
+import org.apache.http.ParseException;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -105,13 +106,22 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 String url = "http://172.16.33.122:44325/api/logistics/modifyLoadPlace";
                 String ysdd = (String) map.get("orderNumber");
                 String memo = (String) map.get("insertUpdateRemark");
-                String sendUrl = url + "?ysdd=" + ysdd + "&loadingPace=" + loadingPace;
+                Map<String, Object> loadMap = new HashMap<>();
+                loadMap.put("ysdd",ysdd);
+                loadMap.put("loadingPace",loadingPace);
                 if (memo != null) {
-                    sendUrl += "&memo=" + memo;
+                    loadMap.put("memo",memo);
+                }
+                JSONObject json = new JSONObject(loadMap);
+                String sendUrl = url ;
+                String jsonData = null;
+                try {
+                    jsonData = HTTPRequestUtils.send(sendUrl, json,"utf-8");
+                } catch (ParseException e) {
+                    e.printStackTrace();
                 }
-                String jsonData = getRequestUtils.doGet(sendUrl);
                 System.out.println(sendUrl);
-                System.out.println("委托已发送" + jsonData);
+                System.out.println("装货点已发送" + json);
                 MeasureJsonData measureJsonData = new MeasureJsonData();
                 BigDecimal measureId = measureJsonDataMapper.selectMaxId();
                 //设置主键id
@@ -582,7 +592,6 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("data", sendMap);
         String jsonData = null;
-
         try {
             jsonData = HTTPRequestUtils.send(daGangUrl, jsonObject, "utf-8");
         } catch (IOException e) {

+ 27 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckSmsRusultServiceImpl.java

@@ -89,6 +89,33 @@ public class TmstruckSmsRusultServiceImpl  implements ITmstruckSmsRusultService
         }
     }
 
+    @Override
+    public int sendMessage(String mobile,String content) throws Exception{
+        String url = "http://www.btom.cn:8080/simpleinter/sendSMS?appId=EUCP-EMY-SMS1-10QNI&";
+        String tmpTmp = MD5Util.formatTimeTmp();
+        String sign = MD5Util.sign("EUCP-EMY-SMS1-10QNI","EE20B0B28B75E567");
+        String mobile1 = mobile;
+        String content1 = "【达州钢铁】您好!" + content + "退订";
+        String sendUrl = url+"timestamp=" + tmpTmp + "&sign=" + sign + "&mobiles=" + mobile1 + "&content=" + content1;
+        String jsonData = null;
+        JSONObject jsonObject = new JSONObject();
+        jsonData = HTTPRequestUtils.send(sendUrl,jsonObject,"utf-8");
+        if(!"null".equals(jsonData)){
+            System.out.println(jsonData);
+            HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
+            String code = (String) hashMap.get("code");
+            System.out.println(hashMap.get("code"));
+            if("SUCCESS".equals(code)){
+                return 1;
+            }else{
+                return 0;
+            }
+        }else{
+            return 0;
+        }
+    }
+
+
     @Override
     public List<Map<String, Object>> getSmsResult(Map<String, Object> map) {
         return tmstruckSmsRusultMapper.selectSmsResult(map);

+ 200 - 3
src/main/java/com/steerinfo/dil/service/impl/TmstruckTimeTaskResultServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.dil.service.impl;
 
+import com.alibaba.druid.sql.visitor.functions.If;
 import com.steerinfo.dil.feign.AmsFeign;
 import com.steerinfo.dil.feign.BmsTruckFeign;
 import com.steerinfo.dil.feign.OmsFeign;
@@ -15,6 +16,8 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.xml.crypto.Data;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -48,6 +51,8 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
     private BmsTruckFeign bmsTruckFeign;
     @Autowired
     private AmsFeign amsFeign;
+    private static final String TwoHour="16吨吊车,12吨吊车,35吨吊车,25吨吊车,70吨吊车,80吨吊车";
+    private static final String FourHour="220吨吊车,130吨吊车,120吨吊车,150吨吊车,100吨吊车";
 
 
 
@@ -310,6 +315,39 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
                 long dateTime1 = resultTime2.getTime() - resultTime1.getTime();
                 BigDecimal dateTime3 = new BigDecimal(dateTime1 / (1000 * 60));
                 int Time1 = dateTime3.intValue() - resultPauseTime.intValue();
+                Map<String, Object> requirementInfo = tmstruckTimeTaskResultMapper.getRequirementInfo(orderId);
+                String capacityTypeName =(String) requirementInfo.get("capacityTypeName");
+                if (capacityTypeName.contains("吊车")) {
+                    //100吨以下
+                    int hours=Time1/60;
+                    BigDecimal minutes=new BigDecimal(Time1%60);
+                    int hour = Integer.parseInt(String.valueOf(hours));
+                    if (TwoHour.contains(capacityTypeName)) {
+                        //判断是否小于2个小时
+                        if (hour<2&&hour>=0){
+                            //设置为两个小时
+                            tmstruckTimeTaskResult.setResultAboutTime(2+"小时");
+                        }else {
+                            //设置实际作业时长-dateTime3
+                            tmstruckTimeTaskResult.setResultAboutTime(hour+"小时"+minutes+"分钟");
+                        }
+                        //如果为100吨以上吊车
+                    }else if (FourHour.contains(capacityTypeName)){
+                        //1、如实际使用时间不足4小时按照(使用时间+4小时)进行最终结算
+                        if (hour<0) {
+                            tmstruckTimeTaskResult.setResultAboutTime("4小时");
+                        }
+                        else if (hour<4&&hour>=0){
+                             //计算小时和分钟
+                            tmstruckTimeTaskResult.setResultAboutTime(4+hours+"小时"+minutes+"分钟");
+                        }else if (hour>=4&&hour<8){
+                               //2、如实际使用时间超出4小时加上车辆往返时间4小时超过8小时的按8小时计算
+                                tmstruckTimeTaskResult.setResultAboutTime(8+"小时");
+                        }else if (hour>=8){
+                            tmstruckTimeTaskResult.setResultAboutTime(hour+"小时"+minutes+"分钟");
+                        }
+                    }
+                }
                 tmstruckTimeTaskResult.setTimeTaskResultId(tmstruckTimeTaskResult.getTimeTaskResultId());
                 tmstruckTimeTaskResult.setResultValue(new BigDecimal((Time1)));
                 tmstruckTimeTaskResult.setResultUomId(new BigDecimal(900));
@@ -318,14 +356,50 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
                 }
                 i += tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult);
                 map.put("Time1",Time1);
-                genernateInwardTime(map);
+               genernateInwardTime(map);
             } else {
+                //用于计时结束判断
                 Map<String, Object> timeMaps = utilsMapper.FristTimeTask(map);
                 Date resultTime2 = (Date) timeMaps.get("resultTime");
                 Map<String, Object> timeStatus = utilsMapper.getTimeStatus(map);
                 Date resultTime1 = (Date) timeStatus.get("resultTime");
                 long dateTime1 = resultTime2.getTime() - resultTime1.getTime();
                 BigDecimal dateTime3 = new BigDecimal(dateTime1 / (1000 * 60));
+                //如果车辆类型为吊车,则进行以下判断
+                //如果车辆类型为100 吨以下吨位吊车作业时间以2小时为起点计算,超过2小时以实际作业时间计算
+                Map<String, Object> requirementInfo = tmstruckTimeTaskResultMapper.getRequirementInfo(orderId);
+                String capacityTypeName =(String) requirementInfo.get("capacityTypeName");
+                if (capacityTypeName.contains("吊车")) {
+                    //100吨以下
+                    BigDecimal hours=new BigDecimal(dateTime1 / (1000*60*60));
+                    BigDecimal minutes=new BigDecimal(dateTime3.intValue()%60);
+                    int hour = Integer.parseInt(String.valueOf(hours));
+                    if (TwoHour.contains(capacityTypeName)) {
+                        //判断是否小于2个小时
+                        if (hour<2&&hour>0){
+                            //设置为两个小时
+                            tmstruckTimeTaskResult.setResultAboutTime(2+"小时");
+                        }else {
+                            //设置实际作业时长-dateTime3
+                            tmstruckTimeTaskResult.setResultAboutTime(hour+"小时"+minutes+"分钟");
+                        }
+                        //如果为100吨以上吊车
+                    }else if (FourHour.contains(capacityTypeName)){
+                        //1、如实际使用时间不足4小时按照(使用时间+4小时)进行最终结算
+                        if (hour<0) {
+                            tmstruckTimeTaskResult.setResultAboutTime("4小时");
+                        }
+                        else if (hour<4&&hour>0){
+                            //计算小时和分钟
+                            tmstruckTimeTaskResult.setResultAboutTime(4+hours.intValue()+"小时"+minutes+"分钟");
+                        }else if (hour>=4&&hour<8){
+                            //2、如实际使用时间超出4小时加上车辆往返时间4小时超过8小时的按8小时计算
+                            tmstruckTimeTaskResult.setResultAboutTime(8+"小时");
+                        }else if (hour>=8){
+                            tmstruckTimeTaskResult.setResultAboutTime(hours+"小时"+minutes+"分钟");
+                        }
+                    }
+                }
                 tmstruckTimeTaskResult.setTimeTaskResultId(tmstruckTimeTaskResult.getTimeTaskResultId());
                 tmstruckTimeTaskResult.setResultValue(dateTime3);
                 tmstruckTimeTaskResult.setResultUomId(new BigDecimal(900));
@@ -333,8 +407,8 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
                     tmstruckTimeTaskResult.setUpdateUsername(personnelSsoId);
                 }
                 i += tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult);
-                map.put("Time1",dateTime3);
-                 genernateInwardTime(map);
+              map.put("Time1",dateTime3);
+               genernateInwardTime(map);
             }
             Map<String, Object> orderMes = utilsMapper.getOrderTypeByOrderNumber(orderNumber);
             BigDecimal orderType =DataChange.dataToBigDecimal(orderMes.get("orderType"));
@@ -408,4 +482,127 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
 
         return i;
     }
+
+    //修改计时时长
+    @Transactional(rollbackFor = {Exception.class})
+    @Override
+    public int modifyTimeTaskResult(Map<String, Object> mapValue) throws Exception {
+        String orderNumber =(String) mapValue.get("orderNumber");
+        int i=0;
+        Date resultTimeNew = null;
+        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String resultTime1 = (String) mapValue.get("resultTime");
+        try {
+             resultTimeNew = simpleDateFormat.parse( resultTime1);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        long resultTime;
+        BigDecimal resultValueNew=null;
+        BigDecimal resultTimeEnd=null;
+        TmstruckTimeTaskResult tmstruckTimeTaskResult=new TmstruckTimeTaskResult();
+        //查找计时开始时间
+        List<Map<String, Object>> startTimeTaskIdList = tmstruckTimeTaskResultMapper.getStartTimeTask(mapValue);
+        Map<String,Object> map = tmstruckTimeTaskResultMapper.getResultValue(orderNumber);
+        BigDecimal orderId =DataChange.dataToBigDecimal(map.get("orderId"));
+        BigDecimal timeTaskResultId = DataChange.dataToBigDecimal(map.get("timeTaskResultId"));
+        BigDecimal resultValue =DataChange.dataToBigDecimal(map.get("resultValue"));
+        if (startTimeTaskIdList.size() != 1) {
+            //根据运输订单查找是否有多条计时开始时间
+            throw new Exception("计时开始超过一条或者没有计时开始时间");
+        } else {
+            Map<String, Object> stringObjectMap = startTimeTaskIdList.get(0);
+           //获取计时总时长的实绩id
+            Date resultTimeOld =(Date)stringObjectMap.get("resultTime");
+            BigDecimal timeTaskResultIdStart = DataChange.dataToBigDecimal(stringObjectMap.get("timeTaskResultId"));
+            if (DataChange.dataToBigDecimal(mapValue.get("resultType")).intValue()==1) {
+                //修改计时开始时间
+                //获取修改之前的计时开始时间,如果修改之前的计时开始时间大于修改之后的修改时间就date(resultTimeOld)-date(resultTimeNew)
+                //resultValue+相差时长
+                if (resultTimeOld.getTime()>resultTimeNew.getTime()) {
+                    resultTime = resultTimeOld.getTime() - resultTimeNew.getTime();
+                    resultTimeEnd = new BigDecimal(resultTime / (1000 * 60));
+                    resultValueNew = resultTimeEnd.add(resultValue);
+                }
+                //获取修改之前的计时开始时间,如果修改之前的计时开始时间大于修改之后的修改时间就date(resultTimeNew)-date(resultTimeOld)
+                //resultValue-相差时长
+                if (resultTimeNew.getTime()>resultTimeOld.getTime()) {
+                    resultTime = resultTimeNew.getTime() - resultTimeOld.getTime();
+                    resultTimeEnd = new BigDecimal(resultTime / (1000 * 60));
+                    resultValueNew = resultValue.subtract(resultTimeEnd);
+                }
+                tmstruckTimeTaskResult.setTimeTaskResultId(timeTaskResultIdStart);
+                tmstruckTimeTaskResult.setResultTime(resultTimeNew);
+                i+= tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult);
+            }else if (DataChange.dataToBigDecimal(mapValue.get("resultType")).intValue()==3){
+                //修改计时结束时间
+                //获取修改之后的计时结束时间,如果修改之前的计时结束时间大于修改之后的修改时间就date(resultTimeOld)-date(resultTimeNew)
+                //resultValue-相差时长
+                if (resultTimeOld.getTime()>resultTimeNew.getTime()) {
+                    resultTime = resultTimeOld.getTime() - resultTimeNew.getTime();
+                    resultTimeEnd = new BigDecimal(resultTime / (1000 * 60));
+                    resultValueNew=resultValue.subtract(resultTimeEnd);
+                }
+                //获取修改之后的计时结束时间,如果修改之前的计时结束时间大于修改之后的修改时间就date(resultTimeNew)-date(resultTimeOld)
+                //resultValue+相差时长
+                if (resultTimeNew.getTime()>resultTimeOld.getTime()) {
+                    resultTime = resultTimeNew.getTime() - resultTimeOld.getTime();
+                    System.out.println(resultTime);
+                    resultTimeEnd = new BigDecimal(resultTime / (1000 * 60));
+                    //新的计时时长
+                    resultValueNew=resultValue.add(resultTimeEnd);
+                }
+                tmstruckTimeTaskResult.setTimeTaskResultId(timeTaskResultIdStart);
+                tmstruckTimeTaskResult.setResultTime(resultTimeNew);
+                i+= tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult);
+            }else {
+                throw new Exception("暂停时长不支持修改");
+            }
+            TmstruckTimeTaskResult tmstruckTimeTaskResult1=new TmstruckTimeTaskResult();
+            tmstruckTimeTaskResult1.setTimeTaskResultId(timeTaskResultId);
+            Map<String, Object> requirementInfo = tmstruckTimeTaskResultMapper.getRequirementInfo(orderId);
+            String capacityTypeName =(String) requirementInfo.get("capacityTypeName");
+            if (capacityTypeName.contains("吊车")) {
+                //100吨以下
+                if (resultValueNew==null){
+                    throw new Exception("请确认是否修改了计时开始/结束时间");
+                }
+                BigDecimal hours=new BigDecimal(resultValueNew.intValue() / 60);
+                BigDecimal minutes=new BigDecimal(resultValueNew.intValue()%60);
+                int hour = Integer.parseInt(String.valueOf(hours));
+                if (TwoHour.contains(capacityTypeName)) {
+                    //判断是否小于2个小时
+                    if (hour<2&&hour>0){
+                        //设置为两个小时
+                        tmstruckTimeTaskResult1.setResultAboutTime(2+"小时");
+                    }else {
+                        //设置实际作业时长-dateTime3
+                        tmstruckTimeTaskResult1.setResultAboutTime(hour+"小时"+minutes+"分钟");
+                    }
+                    //如果为100吨以上吊车
+                }else if (FourHour.contains(capacityTypeName)){
+                    //1、如实际使用时间不足4小时按照(使用时间+4小时)进行最终结算
+                    if (hour<0) {
+                        tmstruckTimeTaskResult1.setResultAboutTime("4小时");
+                    }
+                    else if (hour<4&&hour>=0){
+                        //计算小时和分钟
+                        tmstruckTimeTaskResult1.setResultAboutTime(4+hours.intValue()+"小时"+minutes+"分钟");
+                    }else if (hour>=4&&hour<8){
+                        //2、如实际使用时间超出4小时加上车辆往返时间4小时超过8小时的按8小时计算
+                        tmstruckTimeTaskResult1.setResultAboutTime(8+"小时");
+                    }else if (hour>=8){
+                        tmstruckTimeTaskResult1.setResultAboutTime(hours+"小时"+minutes+"分钟");
+                    }
+                }
+            }
+
+            tmstruckTimeTaskResult1.setInsertUpdateRemark("管理员修改时间");
+            tmstruckTimeTaskResult1.setUpdateTime(new Date());
+            tmstruckTimeTaskResult1.setResultValue(resultValueNew);
+            tmstruckTimeTaskResult1.setUpdateUsername("admin");
+             i+=tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult1);
+        }
+        return i;
+    }
 }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -48,4 +48,4 @@ openfeign:
   OTMSFeign:
     url: ${OTMSFEIGN_URL:172.16.33.166:8038}
 server:
-  port: 8088
+  port: 8008

+ 0 - 1
src/main/resources/application-prod.yml

@@ -4,7 +4,6 @@ spring:
     url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
     password: Dil123789
     username: dil
-
     driver-class-name: oracle.jdbc.OracleDriver
   application:
     name: dil-tms-truck-dev

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

@@ -2255,59 +2255,79 @@
     </select>
 
     <select id="getInwardSaleSteelOrder" resultType="java.util.Map">
-        SELECT DISTINCT
-               ASO.SALE_ORDER_ID "saleOrderId",
-               ASM.SALE_MATERIAL_ID "saleMaterialId",
-               ASO.SALE_NUMBER "saleOrderNo",
-               ASM.MATERIAL_NUMBER "materialNum",
-               ASM.EAS_PRIMARY_ID "closeEntryId",
-               ASM.DELETED "deletedStatus",
-               RM.MATERIAL_ID "materialId",
-               RM.MATERIAL_NAME "materialName",
-               RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialSpe",
-               RAS.ARRIVAL_NAME "sendStationName",
-               RAS2.ARRIVAL_NAME "toTheStationName",
-               TPAR.SEND_STATION_ID "sendStationId",
-               ASM.MATERIAL_WEIGHT "materialWeight",
-               rc.CONSIGNEE_COMPANY_NAME "consigneeName",
-               RS.SHIPPER_NAME "shipperName",
-               r_cap.capacity_id "capacityId",
-               r_cap.capacity_number "capacityNo",
-               r_carrier.carrier_id "carrierId",
-               r_carrier.carrier_name "carrierName",
-               oo.ORDER_ID "orderId",
-               NVL(r_carrier.carrier_id,0) "carrierIds",
-               NVL(r_cap.capacity_id,0) "capacityIds"
-        FROM AMS_SALE_ORDER ASO
-                 LEFT JOIN AMS_SALE_MATERIAL ASM
-                           ON ASO.SALE_ORDER_ID = ASM.SALE_ORDER_ID
-                 LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
-                           ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
-                 LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
-                           ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
-                 LEFT JOIN RMS_MATERIAL rm
-                           ON rm.MATERIAL_ID = ASM.MATERIAL_ID
-                 left join TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
-                           ON TPAR.RAIL_PLAN_ID = ASO.SALE_ORDER_ID
-                 LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
-                           ON RAS.ARRIVAL_ID = TPAR.SEND_STATION_ID
-                 LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
-                           ON RAS.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
-                 left join RMS_CONSIGNEE RC
-                           ON ASO.receive_id = RC.CONSIGNEE_ID
-                 left join RMS_SHIPPER RS
-                           ON RS.SHIPPER_ID = ASO.SHIPPER_ID
-                 left join omstruck_order oo
-                           on oo.order_plan_id = asom.sale_order_material_id
-                 left join ams_dispatch_sale_order adso
-                           on adso.sale_order_material_id = asom.sale_order_material_id
-                 left join rms_carrier r_carrier
-                           on r_carrier.carrier_id = adso.carrier_id
-                 left join rms_capacity r_cap
-                           on r_cap.capacity_id = oo.capacity_id
-        WHERE ASO.SALE_TYPE = 4
-          AND ASO.DELETED = 0
-        order by oo.ORDER_ID desc
+        SELECT * FROM (SELECT DISTINCT
+                           ASO.SALE_ORDER_ID "saleOrderId",
+                           ASM.SALE_MATERIAL_ID "saleMaterialId",
+                           ASO.SALE_NUMBER "saleOrderNo",
+                           ASM.MATERIAL_NUMBER "materialNum",
+                           ASM.EAS_PRIMARY_ID "closeEntryId",
+                           ASM.DELETED "deletedStatus",
+                           RM.MATERIAL_ID "materialId",
+                           RM.MATERIAL_NAME "materialName",
+                           RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialSpe",
+                           RAS.ARRIVAL_NAME "sendStation",
+                           RAS2.ARRIVAL_NAME "toTheStation",
+                           TPAR.SEND_STATION_ID "sendStationId",
+                           ASM.MATERIAL_WEIGHT "materialWeight",
+                           rc.CONSIGNEE_COMPANY_NAME "consigneeName",
+                           RS.SHIPPER_NAME "shipperName",
+                           r_cap.capacity_id "capacityId",
+                           r_cap.capacity_number "capacityNo",
+                           r_carrier.carrier_id "carrierId",
+                           r_carrier.carrier_name "carrierName",
+                           oo.ORDER_ID "orderId",
+                           NVL( r_carrier.carrier_id, 0 ) "carrierIds",
+                           NVL( r_cap.capacity_id, 0 ) "capacityIds",
+                            RDOINDEP.ORG_NAME "transInDep",
+                           RDOOUTDEP.ORG_NAME "transOutDep",
+                           RISWINOF.INWARD_WAREHOUSE_NAME "transInWarehouse",
+                           oo.ORDER_NUMBER  "orderNumber",
+                           TWR.RESULT_NET_WEIGHT    "netWeight"
+                       FROM
+                           AMS_SALE_ORDER ASO
+                               LEFT JOIN AMS_SALE_MATERIAL ASM ON ASO.SALE_ORDER_ID = ASM.SALE_ORDER_ID
+                               LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
+                               LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
+                               LEFT JOIN RMS_MATERIAL rm ON rm.MATERIAL_ID = ASM.MATERIAL_ID
+                               LEFT JOIN TMSTRAIN_PLEASE_APPROVE_RESULT TPAR ON TPAR.RAIL_PLAN_ID = ASM.SALE_MATERIAL_ID
+                               LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS ON RAS.ARRIVAL_ID = TPAR.SEND_STATION_ID
+                               LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2 ON RAS2.ARRIVAL_ID = TPAR.TO_THE_STATION_ID
+                               LEFT JOIN RMS_CONSIGNEE RC ON ASO.receive_id = RC.CONSIGNEE_ID
+                               LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
+                               LEFT JOIN omstruck_order oo ON oo.order_plan_id = asom.sale_order_material_id
+                               LEFT JOIN ams_dispatch_sale_order adso ON adso.sale_order_material_id = asom.sale_order_material_id
+                               LEFT JOIN rms_carrier r_carrier ON r_carrier.carrier_id = 3642
+                               LEFT JOIN rms_capacity r_cap ON r_cap.capacity_id = oo.capacity_id
+                               LEFT JOIN RMS_DEP_ORG RDOINDEP ON RDOINDEP.ORG_CODE = ASO.TRANSFER_IN_DEP
+                               LEFT JOIN RMS_DEP_ORG RDOOUTDEP ON RDOOUTDEP.ORG_CODE = ASO.TRANSFER_OUT_DEP
+                               LEFT JOIN RMS_INWARD_STEEL_WAREHOUSE RISWINOF ON RISWINOF.INWARD_WAREHOUSE_CODE = ASM.TRANSFER_IN_OF_WAREHOUSE
+                               LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
+                               LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                                         AND TWR.MATERIAL_ID = ASM.MATERIAL_ID
+                       WHERE
+                           ASO.SALE_TYPE = 4
+                         AND ASO.DELETED = 0
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASO.INSERT_TIME
+        </if>
+        <if test="carrierSsoId != null">
+            and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASO.INSERT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASO.INSERT_TIME
+        </if>
+        <if test="remark != null" >
+            and  RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION LIKE #{remark}
+        </if>
+        <if test="capacityNum != null">
+            and  r_cap.capacity_number like #{capacityNum}
+        </if>
+        <if test="consigneeNames != null">
+            and RC.CONSIGNEE_COMPANY_NAME like #{consigneeNames}
+        </if>
+        ORDER BY
+        oo.ORDER_ID DESC)
     </select>
 
 </mapper>

+ 8 - 10
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -710,10 +710,8 @@
              )
         where rownum = 1
     </select>
-    <select id="getTruckFactoryResult" resultType="java.util.Map">
-                
+    <select id="getTruckFactoryResult" resultType="java.util.Map" parameterType="string">
                 SELECT   * from(
-                
                  SELECT
                     -- 出厂时间
                     to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss')  "resultOutGateTime",
@@ -739,10 +737,10 @@
                     RS.SUPPLIER_NAME  "supplierName" ,
                     -- 发货单位
                     RS2.SHIPPER_NAME "shipperName"
-                   
-                    
-                    
-                    
+
+
+
+
                 FROM
                     -- 出厂实绩
                     TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
@@ -762,17 +760,17 @@
                     LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON    ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
                     --收货地址
                     left join RMS_RECEIVE_PLACE RRP  on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
-                    
+
                     left join RMS_RECEIVE_ADDRESS RRA on RRP.ADDRESS_ID=RRA.ADDRESS_ID
                     -- 收货单位
                     LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
-                    
+
                 WHERE
                     -- 判断出厂实绩的出厂时间不为空
                     TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
                     --   并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
                     AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
-                    
+
                     )
     </select>
 

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

@@ -1472,7 +1472,8 @@
 
     SELECT *
     FROM (
-    SELECT RM.MATERIAL_NAME           "materialName",
+    SELECT
+    distinct RM.MATERIAL_NAME           "materialName",
     OO.ORDER_NUMBER            "orderNumber",
     RC.CAPACITY_NUMBER         "capacityNumber",
     OOM.ORDER_MATERIAL_NUMBER  "orderMaterialNumber",

+ 325 - 264
src/main/resources/com/steerinfo/dil/mapper/TmstruckTimeTaskResultMapper.xml

@@ -22,29 +22,30 @@
     <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
     <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
     <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
+    <result column="RESULT_ABOUT_TIME" jdbcType="VARCHAR" property="resultAboutTime" />
   </resultMap>
   <sql id="columns">
-    TIME_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE, 
-    RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL, RESULT_START_LATITUDE_VAL, 
-    RESULT_END_NODE_ID, RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL, RESULT_MEMO, 
-    INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
-    DELETE_NAME, DELETE_TIME
+    TIME_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE,
+    RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL, RESULT_START_LATITUDE_VAL,
+    RESULT_END_NODE_ID, RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL, RESULT_MEMO,
+    INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+    DELETE_NAME, DELETE_TIME, RESULT_ABOUT_TIME
   </sql>
   <sql id="columns_alias">
-    t.TIME_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_VALUE, t.RESULT_UOM_ID, t.RESULT_TIME_TYPE, 
-    t.RESULT_TIME, t.RESULT_START_NODE_ID, t.RESULT_START_LONGITUDE_VAL, t.RESULT_START_LATITUDE_VAL, 
-    t.RESULT_END_NODE_ID, t.RESULT_END_LONGITUDE_VAL, t.RESULT_END_LATITUDE_VAL, t.RESULT_MEMO, 
-    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
-    t.DELETE_NAME, t.DELETE_TIME
+    t.TIME_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_VALUE, t.RESULT_UOM_ID, t.RESULT_TIME_TYPE,
+    t.RESULT_TIME, t.RESULT_START_NODE_ID, t.RESULT_START_LONGITUDE_VAL, t.RESULT_START_LATITUDE_VAL,
+    t.RESULT_END_NODE_ID, t.RESULT_END_LONGITUDE_VAL, t.RESULT_END_LATITUDE_VAL, t.RESULT_MEMO,
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
+    t.DELETE_NAME, t.DELETE_TIME, t.RESULT_ABOUT_TIME
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRUCK_TIME_TASK_RESULT
+    SELECT <include refid="columns" /> FROM TMSTRUCK_TIME_TASK_RESULT
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_TIME_TASK_RESULT t
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_TIME_TASK_RESULT t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="timeTaskResultId != null">
         and TIME_TASK_RESULT_ID = #{timeTaskResultId}
       </if>
@@ -105,10 +106,13 @@
       <if test="deleteTime != null">
         and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
       </if>
+      <if test="resultAboutTime != null and resultAboutTime != ''">
+        and RESULT_ABOUT_TIME = #{resultAboutTime}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="timeTaskResultId != null">
         and TIME_TASK_RESULT_ID = #{timeTaskResultId}
       </if>
@@ -169,90 +173,98 @@
       <if test="deleteTime != null">
         and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
       </if>
+      <if test="resultAboutTime != null and resultAboutTime != ''">
+        and RESULT_ABOUT_TIME LIKE '%${resultAboutTime}%'
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from TMSTRUCK_TIME_TASK_RESULT
     where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from TMSTRUCK_TIME_TASK_RESULT
-    where 1!=1 
-      <if test="resultTotalId != null">
-        or RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="resultValue != null">
-        or RESULT_VALUE = #{resultValue}
-      </if>
-      <if test="resultUomId != null">
-        or RESULT_UOM_ID = #{resultUomId}
-      </if>
-      <if test="resultTimeType != null">
-        or RESULT_TIME_TYPE = #{resultTimeType}
-      </if>
-      <if test="resultTime != null">
-        or TO_CHAR(RESULT_TIME,'yyyy-MM-dd') = '#{resultTime}'
-      </if>
-      <if test="resultStartNodeId != null">
-        or RESULT_START_NODE_ID = #{resultStartNodeId}
-      </if>
-      <if test="resultStartLongitudeVal != null and resultStartLongitudeVal != ''">
-        or RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal}
-      </if>
-      <if test="resultStartLatitudeVal != null and resultStartLatitudeVal != ''">
-        or RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal}
-      </if>
-      <if test="resultEndNodeId != null">
-        or RESULT_END_NODE_ID = #{resultEndNodeId}
-      </if>
-      <if test="resultEndLongitudeVal != null and resultEndLongitudeVal != ''">
-        or RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal}
-      </if>
-      <if test="resultEndLatitudeVal != null and resultEndLatitudeVal != ''">
-        or RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal}
-      </if>
-      <if test="resultMemo != null and resultMemo != ''">
-        or RESULT_MEMO = #{resultMemo}
-      </if>
-      <if test="insertUsername != null and insertUsername != ''">
-        or INSERT_USERNAME = #{insertUsername}
-      </if>
-      <if test="insertTime != null">
-        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-      </if>
-      <if test="updateUsername != null and updateUsername != ''">
-        or UPDATE_USERNAME = #{updateUsername}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-      </if>
-      <if test="deleteName != null and deleteName != ''">
-        or DELETE_NAME = #{deleteName}
-      </if>
-      <if test="deleteTime != null">
-        or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
-      </if>
+    where 1!=1
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="resultValue != null">
+      or RESULT_VALUE = #{resultValue}
+    </if>
+    <if test="resultUomId != null">
+      or RESULT_UOM_ID = #{resultUomId}
+    </if>
+    <if test="resultTimeType != null">
+      or RESULT_TIME_TYPE = #{resultTimeType}
+    </if>
+    <if test="resultTime != null">
+      or TO_CHAR(RESULT_TIME,'yyyy-MM-dd') = '#{resultTime}'
+    </if>
+    <if test="resultStartNodeId != null">
+      or RESULT_START_NODE_ID = #{resultStartNodeId}
+    </if>
+    <if test="resultStartLongitudeVal != null and resultStartLongitudeVal != ''">
+      or RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal}
+    </if>
+    <if test="resultStartLatitudeVal != null and resultStartLatitudeVal != ''">
+      or RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal}
+    </if>
+    <if test="resultEndNodeId != null">
+      or RESULT_END_NODE_ID = #{resultEndNodeId}
+    </if>
+    <if test="resultEndLongitudeVal != null and resultEndLongitudeVal != ''">
+      or RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal}
+    </if>
+    <if test="resultEndLatitudeVal != null and resultEndLatitudeVal != ''">
+      or RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal}
+    </if>
+    <if test="resultMemo != null and resultMemo != ''">
+      or RESULT_MEMO = #{resultMemo}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="deleteName != null and deleteName != ''">
+      or DELETE_NAME = #{deleteName}
+    </if>
+    <if test="deleteTime != null">
+      or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
+    </if>
+    <if test="resultAboutTime != null and resultAboutTime != ''">
+      or RESULT_ABOUT_TIME = #{resultAboutTime}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
-    insert into TMSTRUCK_TIME_TASK_RESULT (TIME_TASK_RESULT_ID, RESULT_TOTAL_ID, 
-      RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE, 
-      RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL, 
-      RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID, 
-      RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL, 
-      RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
-      DELETE_NAME, DELETE_TIME)
-    values (#{timeTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, 
-      #{resultValue,jdbcType=DECIMAL}, #{resultUomId,jdbcType=DECIMAL}, #{resultTimeType,jdbcType=DECIMAL}, 
-      #{resultTime,jdbcType=TIMESTAMP}, #{resultStartNodeId,jdbcType=DECIMAL}, #{resultStartLongitudeVal,jdbcType=VARCHAR}, 
-      #{resultStartLatitudeVal,jdbcType=VARCHAR}, #{resultEndNodeId,jdbcType=DECIMAL}, 
-      #{resultEndLongitudeVal,jdbcType=VARCHAR}, #{resultEndLatitudeVal,jdbcType=VARCHAR}, 
-      #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
-      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
-      #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP})
+    insert into TMSTRUCK_TIME_TASK_RESULT (TIME_TASK_RESULT_ID, RESULT_TOTAL_ID,
+                                           RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE,
+                                           RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL,
+                                           RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID,
+                                           RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL,
+                                           RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
+                                           UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                                           DELETE_NAME, DELETE_TIME, RESULT_ABOUT_TIME
+    )
+    values (#{timeTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
+            #{resultValue,jdbcType=DECIMAL}, #{resultUomId,jdbcType=DECIMAL}, #{resultTimeType,jdbcType=DECIMAL},
+            #{resultTime,jdbcType=TIMESTAMP}, #{resultStartNodeId,jdbcType=DECIMAL}, #{resultStartLongitudeVal,jdbcType=VARCHAR},
+            #{resultStartLatitudeVal,jdbcType=VARCHAR}, #{resultEndNodeId,jdbcType=DECIMAL},
+            #{resultEndLongitudeVal,jdbcType=VARCHAR}, #{resultEndLatitudeVal,jdbcType=VARCHAR},
+            #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+            #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+            #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultAboutTime,jdbcType=VARCHAR}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
     insert into TMSTRUCK_TIME_TASK_RESULT
@@ -317,6 +329,9 @@
       <if test="deleteTime != null">
         DELETE_TIME,
       </if>
+      <if test="resultAboutTime != null">
+        RESULT_ABOUT_TIME,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="timeTaskResultId != null">
@@ -379,29 +394,33 @@
       <if test="deleteTime != null">
         #{deleteTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="resultAboutTime != null">
+        #{resultAboutTime,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
     update TMSTRUCK_TIME_TASK_RESULT
     set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      RESULT_VALUE = #{resultValue,jdbcType=DECIMAL},
-      RESULT_UOM_ID = #{resultUomId,jdbcType=DECIMAL},
-      RESULT_TIME_TYPE = #{resultTimeType,jdbcType=DECIMAL},
-      RESULT_TIME = #{resultTime,jdbcType=TIMESTAMP},
-      RESULT_START_NODE_ID = #{resultStartNodeId,jdbcType=DECIMAL},
-      RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal,jdbcType=VARCHAR},
-      RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal,jdbcType=VARCHAR},
-      RESULT_END_NODE_ID = #{resultEndNodeId,jdbcType=DECIMAL},
-      RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal,jdbcType=VARCHAR},
-      RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal,jdbcType=VARCHAR},
-      RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
-      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP}
+        RESULT_VALUE = #{resultValue,jdbcType=DECIMAL},
+        RESULT_UOM_ID = #{resultUomId,jdbcType=DECIMAL},
+        RESULT_TIME_TYPE = #{resultTimeType,jdbcType=DECIMAL},
+        RESULT_TIME = #{resultTime,jdbcType=TIMESTAMP},
+        RESULT_START_NODE_ID = #{resultStartNodeId,jdbcType=DECIMAL},
+        RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal,jdbcType=VARCHAR},
+        RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal,jdbcType=VARCHAR},
+        RESULT_END_NODE_ID = #{resultEndNodeId,jdbcType=DECIMAL},
+        RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal,jdbcType=VARCHAR},
+        RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal,jdbcType=VARCHAR},
+        RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+        RESULT_ABOUT_TIME = #{resultAboutTime,jdbcType=VARCHAR}
     where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
@@ -464,151 +483,161 @@
       <if test="deleteTime != null">
         DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="resultAboutTime != null">
+        RESULT_ABOUT_TIME = #{resultAboutTime,jdbcType=VARCHAR},
+      </if>
     </set>
     where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
     where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into TMSTRUCK_TIME_TASK_RESULT 
-      (TIME_TASK_RESULT_ID, 
-      RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID, 
-      RESULT_TIME_TYPE, RESULT_TIME, 
-      RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL, 
-      RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID, 
-      RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL, 
-      RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK, DELETE_NAME, 
-      DELETE_TIME)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.timeTaskResultId,jdbcType=DECIMAL}, 
-      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultValue,jdbcType=DECIMAL}, #{item.resultUomId,jdbcType=DECIMAL}, 
-      #{item.resultTimeType,jdbcType=DECIMAL}, #{item.resultTime,jdbcType=TIMESTAMP}, 
-      #{item.resultStartNodeId,jdbcType=DECIMAL}, #{item.resultStartLongitudeVal,jdbcType=VARCHAR}, 
-      #{item.resultStartLatitudeVal,jdbcType=VARCHAR}, #{item.resultEndNodeId,jdbcType=DECIMAL}, 
-      #{item.resultEndLongitudeVal,jdbcType=VARCHAR}, #{item.resultEndLatitudeVal,jdbcType=VARCHAR}, 
-      #{item.resultMemo,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, 
-      #{item.deleteTime,jdbcType=TIMESTAMP} from dual  
-   </foreach> )
+    insert into TMSTRUCK_TIME_TASK_RESULT
+    (TIME_TASK_RESULT_ID,
+    RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID,
+    RESULT_TIME_TYPE, RESULT_TIME,
+    RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL,
+    RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID,
+    RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL,
+    RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, DELETE_NAME,
+    DELETE_TIME, RESULT_ABOUT_TIME
+    )
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.timeTaskResultId,jdbcType=DECIMAL},
+    #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultValue,jdbcType=DECIMAL}, #{item.resultUomId,jdbcType=DECIMAL},
+    #{item.resultTimeType,jdbcType=DECIMAL}, #{item.resultTime,jdbcType=TIMESTAMP},
+    #{item.resultStartNodeId,jdbcType=DECIMAL}, #{item.resultStartLongitudeVal,jdbcType=VARCHAR},
+    #{item.resultStartLatitudeVal,jdbcType=VARCHAR}, #{item.resultEndNodeId,jdbcType=DECIMAL},
+    #{item.resultEndLongitudeVal,jdbcType=VARCHAR}, #{item.resultEndLatitudeVal,jdbcType=VARCHAR},
+    #{item.resultMemo,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+    #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+    #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
+    #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultAboutTime,jdbcType=VARCHAR}
+    from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRUCK_TIME_TASK_RESULT
-     set
-       TIME_TASK_RESULT_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.timeTaskResultId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_TOTAL_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_VALUE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultValue,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_UOM_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultUomId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_TIME_TYPE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTimeType,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,RESULT_START_NODE_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartNodeId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_START_LONGITUDE_VAL=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLongitudeVal,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_START_LATITUDE_VAL=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLatitudeVal,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_END_NODE_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndNodeId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_END_LONGITUDE_VAL=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLongitudeVal,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_END_LATITUDE_VAL=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLatitudeVal,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_MEMO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-       ,DELETE_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-       </foreach>
-       ,DELETE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case TIME_TASK_RESULT_ID" close="end">
-          when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
-       </foreach>
-     where TIME_TASK_RESULT_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.timeTaskResultId,jdbcType=DECIMAL}
-     </foreach> 
+    update TMSTRUCK_TIME_TASK_RESULT
+    set
+    TIME_TASK_RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.timeTaskResultId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TOTAL_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_VALUE=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultValue,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_UOM_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultUomId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TIME_TYPE=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTimeType,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,RESULT_START_NODE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartNodeId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_START_LONGITUDE_VAL=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLongitudeVal,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_START_LATITUDE_VAL=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLatitudeVal,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_END_NODE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndNodeId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_END_LONGITUDE_VAL=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLongitudeVal,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_END_LATITUDE_VAL=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLatitudeVal,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_MEMO=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETE_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,RESULT_ABOUT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
+      when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultAboutTime,jdbcType=VARCHAR}
+    </foreach>
+    where TIME_TASK_RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.timeTaskResultId,jdbcType=DECIMAL}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from TMSTRUCK_TIME_TASK_RESULT
-    where TIME_TASK_RESULT_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    where TIME_TASK_RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
+
+
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
-<!--  通过运输订单号查询总实绩ID -->
+  <!--  通过运输订单号查询总实绩ID -->
   <select id="getResultTotalIdByOrderNum" resultType="java.util.Map">
     SELECT TTR.RESULT_TOTAL_ID "resultTotalId"
     FROM OMSTRUCK_ORDER OO
-    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-    ON TTR.ORDER_ID = OO.ORDER_ID
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON TTR.ORDER_ID = OO.ORDER_ID
     WHERE OO.ORDER_NUMBER = #{orderNumber}
   </select>
 
@@ -617,11 +646,11 @@
   <select id="getLastTimeout" parameterType="java.math.BigDecimal" resultType="java.util.Map">
     select *
     from(
-        SELECT TTTR.RESULT_TIME "resultTime"
-        FROM TMSTRUCK_TIME_TASK_RESULT TTTR
-        WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
-          AND TTTR.RESULT_TIME_TYPE = 5
-        ORDER BY "resultTime" DESC
+          SELECT TTTR.RESULT_TIME "resultTime"
+          FROM TMSTRUCK_TIME_TASK_RESULT TTTR
+          WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
+            AND TTTR.RESULT_TIME_TYPE = 5
+          ORDER BY "resultTime" DESC
         )
     where rownum = 1
   </select>
@@ -639,7 +668,7 @@
     where rownum = 1
   </select>
 
-<!--  查询用车单位确认开始时间-->
+  <!--  查询用车单位确认开始时间-->
   <select id="getStartTime" parameterType="java.math.BigDecimal" resultType="java.util.Map">
     SELECT TTTR.RESULT_TIME "resultTime"
     FROM TMSTRUCK_TIME_TASK_RESULT TTTR
@@ -647,7 +676,7 @@
       AND TTTR.RESULT_TIME_TYPE = 0
   </select>
 
-<!--  查询所有确认暂停结束时间-->
+  <!--  查询所有确认暂停结束时间-->
   <select id="getAllTimeout" resultType="java.util.Map">
     SELECT TTTR.RESULT_VALUE "resultValue"
     FROM TMSTRUCK_TIME_TASK_RESULT TTTR
@@ -672,6 +701,7 @@
     OO.ORDER_NUMBER "orderNumber",
     CONCAT(TTTR.RESULT_VALUE,RUOM.UNIT_OF_MEASURE_NAME) AS "resultTime",
     RCT.CAPACITY_TYPE_NAME "capacityTypeName",
+    TTTR.RESULT_ABOUT_TIME "aboutTime",
     TTTR.INSERT_TIME "insertTime",
     RP.PERSONNEL_NAME  "personName",
     (
@@ -731,7 +761,7 @@
       or RS.SHIPPER_NAME LIKE #{con}
     </if>
     <if test="userId!=null">
-      AND oo.INSERT_USERNAME LIKE #{userId}
+      AND  instr(AIR.INSERT_USERNAME,#{userId}) > 0
     </if>
     <if test="oneDate != null">
       and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
@@ -747,13 +777,13 @@
         </foreach>
       </if>
       <if test="capacityNumber != null">
-      and
+        and
         <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
           "capacityNumber" like '%${item}%'
         </foreach>
       </if>
       <if test="driverName != null">
-      and
+        and
         <foreach collection="driverName" item="item" open="(" separator="or" close=")">
           "driverName" like '%${item}%'
         </foreach>
@@ -806,38 +836,69 @@
       order by "insertTime" desc
     </if>
   </select>
-<!--  根据运输订单id查找实绩是否已经计时结束-->
+  <!--  根据运输订单id查找实绩是否已经计时结束-->
   <select id="CountTimeTaskByOrderId" resultType="java.lang.Integer" parameterType="java.math.BigDecimal">
     select COUNT(*)
     from OMSTRUCK_ORDER OO
-    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-    ON TTR.ORDER_ID=OO.ORDER_ID
-    LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
-    ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON TTR.ORDER_ID=OO.ORDER_ID
+           LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
+                     ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
     WHERE OO.ORDER_ID=#{orderId} and TTTR.RESULT_TIME_TYPE=3 and TTTR.RESULT_VALUE IS not NULL
   </select>
 
-    <select id="selectInwardDueTimeByOrderId" resultType="java.util.Map" parameterType="java.math.BigDecimal">
-      select AIR.DUE_DATE  "dueTime",
-             AIR.INSERT_UPDATE_REMARK "remark"
-      from OMSTRUCK_ORDER OO
-      left join AMSTRUCK_INWARD_PLAN AIP
-                       on AIP.PLAN_ID=OO.ORDER_PLAN_ID
-             left join AMSTRUCK_REQUIREMENT_PLAN ARP
-                       on ARP.PLAN_ID=AIP.PLAN_ID
-             left join AMSTRUCK_INWARD_REQUIREMENT AIR
-                       on AIR.REQUIREMENT_ID=ARP.REQUIREMENT_ID
-      where OO.ORDER_ID=#{orderId}
-    </select>
+  <select id="selectInwardDueTimeByOrderId" resultType="java.util.Map" parameterType="java.math.BigDecimal">
+    select AIR.DUE_DATE  "dueTime",
+           AIR.INSERT_UPDATE_REMARK "remark"
+    from OMSTRUCK_ORDER OO
+           left join AMSTRUCK_INWARD_PLAN AIP
+                     on AIP.PLAN_ID=OO.ORDER_PLAN_ID
+           left join AMSTRUCK_REQUIREMENT_PLAN ARP
+                     on ARP.PLAN_ID=AIP.PLAN_ID
+           left join AMSTRUCK_INWARD_REQUIREMENT AIR
+                     on AIR.REQUIREMENT_ID=ARP.REQUIREMENT_ID
+    where OO.ORDER_ID=#{orderId}
+  </select>
+  <!--获取需求信息-->
   <select id="getRequirementInfo" resultType="java.util.Map" parameterType="decimal">
-      select AIR.CAPACITY_TYPE_ID "capacityTypeId" ,AIR.REQUIREMENT_TYPE "requirementType" from OMSTRUCK_ORDER OO
-      left join AMSTRUCK_INWARD_PLAN AIP
-      on aip.PLAN_ID = OO.ORDER_PLAN_ID
-      LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
-      ON ARP.PLAN_ID = AIP.PLAN_ID
-      LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
-      ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
-      where oo.ORDER_ID = #{orderId1}
+    select AIR.CAPACITY_TYPE_ID "capacityTypeId" ,
+           AIR.REQUIREMENT_TYPE "requirementType",
+           RCT.CAPACITY_TYPE_NAME "capacityTypeName"
+    from OMSTRUCK_ORDER OO
+           left join AMSTRUCK_INWARD_PLAN AIP
+                     on aip.PLAN_ID = OO.ORDER_PLAN_ID
+           LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
+                     ON ARP.PLAN_ID = AIP.PLAN_ID
+           LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
+                     ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
+           LEFT JOIN RMS_CAPACITY_TYPE RCT
+                     ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+    where oo.ORDER_ID = #{orderId1}
+  </select>
+
+<!-- 查找计时开始时间-->
+  <select id="getStartTimeTask" resultType="java.util.Map" parameterType="java.util.Map">
+    select TTTR.TIME_TASK_RESULT_ID "timeTaskResultId",
+           TTTR.RESULT_TIME "resultTime"
+    from OMSTRUCK_ORDER OO
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON OO.ORDER_ID=TTR.ORDER_ID
+    LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
+    ON TTTR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
+    WHERE  TTTR.RESULT_TIME_TYPE = #{resultType} and OO.ORDER_NUMBER = #{orderNumber}
+  </select>
+
+<!-- 查找计时总时长-->
+  <select id="getResultValue" resultType="java.util.Map" parameterType="java.lang.String">
+    select TTTR.RESULT_VALUE "resultValue",
+            TTTR.TIME_TASK_RESULT_ID "timeTaskResultId",
+           OO.ORDER_ID "orderId"
+    from OMSTRUCK_ORDER OO
+     LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON OO.ORDER_ID=TTR.ORDER_ID
+    LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
+    ON TTR.RESULT_TOTAL_ID= TTTR.RESULT_TOTAL_ID
+    WHERE  TTTR.RESULT_TIME_TYPE= 3 AND OO.ORDER_NUMBER=#{orderNumber}
   </select>
 
 </mapper>

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

@@ -878,7 +878,9 @@
     <select id="getInFactoryUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
         SELECT *
         FROM (
-        SELECT TUR.RESULT_ID             "resultId",
+        SELECT
+               distinct
+               TUR.RESULT_ID             "resultId",
         OO.ORDER_NUMBER || RC.CAPACITY_NUMBER || RW.WAREHOUSE_NAME || RM.MATERIAL_NAME "mohu",
         OO.ORDER_NUMBER           "orderNumber",
         RC.CAPACITY_NUMBER        "capacityNumber",