luobang 2 лет назад
Родитель
Сommit
a8770f75d5

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.java

@@ -92,4 +92,6 @@ public interface TmstruckEnfactoryResultMapper extends IBaseMapper<TmstruckEnfac
 
     Map<String, Object> selectEnFactoryResultIdSteel(BigDecimal resultTotalId);
 
+    Map<String, Object> selectEnFactoryResultIdGatepost(BigDecimal resultTotalId);
+
 }

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

@@ -179,7 +179,11 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
             selectMap = tmstruckEnfactoryResultMapper.selectEnFactoryResultIdSteel(resultTotalId);
         }
         if(selectMap == null){
-            throw new Exception("该车已进厂!!");
+            if (orderType == 20 || orderType == 12 || orderType == 13 || orderType == 14) {
+                selectMap = tmstruckEnfactoryResultMapper.selectEnFactoryResultIdGatepost(resultTotalId);
+            }else{
+                throw new Exception("该车已进厂!!");
+            }
         }else{
             if(orderType != 1) {
                 BigDecimal segmentSqe = DataChange.dataToBigDecimal(selectMap.get("segmentSqe"));

+ 4 - 3
src/main/java/com/steerinfo/dil/service/impl/TmstruckTotalResultServiceImpl.java

@@ -260,9 +260,10 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
                     newResult.setResultGrossWeightTime(oldResult.getResultGrossWeightTime());
                     newResult.setMaterialId(oldResult.getMaterialId());
                     newResult.setResultPoundNo(oldResult.getResultPoundNo());
-//                    newResult.setResultTarePlaceId(oldResult.getResultTarePlaceId());
-//                    newResult.setResultTareWeight(oldResult.getResultTareWeight());
-//                    newResult.setResultTareWeightTime(oldResult.getResultTareWeightTime());
+                    newResult.setResultTarePlaceId(oldResult.getResultTarePlaceId());
+                    newResult.setResultTareWeight(oldResult.getResultTareWeight());
+                    newResult.setResultTareWeightTime(oldResult.getResultTareWeightTime());
+                    newResult.setResultNetWeight(oldResult.getResultNetWeight());
                 }
                 tmstruckWeightResultMapper.updateByPrimaryKeySelective(newResult);
             }catch (Exception e){

+ 11 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml

@@ -1562,5 +1562,16 @@
               order by TER.SEGMEN_SQE)
         where rownum = 1
     </select>
+    <select id="selectEnFactoryResultIdGatepost" resultType="java.util.Map">
+        select *
+        from (select TER.RESULT_ID       "resultId",
+                     TER.SEGMEN_SQE      "segmentSqe", --进厂的路段顺序号
+                     TER.RESULT_ENTRY_GATE_TIME,
+                     TER.INSERT_UPDATE_REMARK   "insertUpdateRemark"
+              from TMSTRUCK_ENFACTORY_RESULT TER
+              where TER.RESULT_TOTAL_ID = #{resultTotalId}
+              order by TER.SEGMEN_SQE desc)
+        where rownum = 1
+    </select>
 
 </mapper>