Jelajahi Sumber

修改火运单号编码

liyg 2 tahun lalu
induk
melakukan
273400b4b5

+ 15 - 13
src/main/java/com/steerinfo/dil/service/impl/TmstrainLoadingResultServiceImpl.java

@@ -94,7 +94,7 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
         BigDecimal maxId = tmstrainTotalResultMapper.selectMaxId();
         tmstrainTotalResult.setId(maxId); //获取添加火运总实绩主键ID
         //生成火运单号
-        tmstrainTotalResult.setTransportNum(DataChange.generateEightDigitsNumber("TRAIN", maxId.intValue()));
+        tmstrainTotalResult.setTransportNum(DataChange.generateEightDigitsNumber("W", maxId.intValue()));
         //添加火运装车实绩ID
         tmstrainTotalResult.setLoadingId(loadingId);
         return tmstrainTotalResultMapper.insertSelective(tmstrainTotalResult);
@@ -189,20 +189,22 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
             result.setResultWagonNo((String) map.get("wagonNo"));//车皮号
             //取得发站名,查询是否存在该站台,如果存在则绑定,否则新增该站台再绑定
             String sendStationName=(String) map.get("sendStation");//发站名
-            BigDecimal sendStationId=tmstrainLoadingResultMapper.getSendStationId(sendStationName);
-            if(sendStationId==null){
-               //如果没有该站,新增
-                sendStationId=tmstrainLoadingResultMapper.getMaxSendStationId().add(new BigDecimal(1));
-                Map<String,Object> station=new HashMap<>();
-                station.put("arrivalId",sendStationId);
-                station.put("arrivalName",sendStationName);
-                station.put("insertTime",new Date());
-                station.put("updateTime",new Date());
-                if(tmstrainLoadingResultMapper.addSendStation(station)<=0){
-                    throw new Exception("添加发站失败");
+            if(sendStationName!=null){
+                BigDecimal sendStationId=tmstrainLoadingResultMapper.getSendStationId(sendStationName);
+                if(sendStationId==null){
+                    //如果没有该站,新增
+                    sendStationId=tmstrainLoadingResultMapper.getMaxSendStationId().add(new BigDecimal(1));
+                    Map<String,Object> station=new HashMap<>();
+                    station.put("arrivalId",sendStationId);
+                    station.put("arrivalName",sendStationName);
+                    station.put("insertTime",new Date());
+                    station.put("updateTime",new Date());
+                    if(tmstrainLoadingResultMapper.addSendStation(station)<=0){
+                        throw new Exception("添加发站失败");
+                    }
                 }
+                result.setSendStationId(sendStationId);
             }
-            result.setSendStationId(sendStationId);
             //添加常规字段
             addRegularField(result);
             //通过车皮号计算车皮标重

+ 0 - 68
src/main/resources/com/steerinfo/dil/mapper/TmstrainMeasureCommissionMapper.xml

@@ -436,74 +436,6 @@
                )
              </if>
          )
-
-    <where>
-      <if test="purchaseOrderNo != null">
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultWagonNo != null">
-        and
-        <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
-          "resultWagonNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultLoadingDate != null">
-        and
-        <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
-          "resultLoadingDate" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultClass != null">
-        and
-        <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
-          "resultClass" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          materialName like '%${item}%'
-        </foreach>
-      </if>
-      <if test="sendStationName != null">
-        and
-        <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
-          "sendStationName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="arrivalStationName != null">
-        and
-        <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
-          arrivalStationName like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultBillableTonnage != null">
-        and
-        <foreach collection="resultBillableTonnage" item="item" open="(" separator="or" close=")">
-          "resultBillableTonnage" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultIsclear != null">
-        and
-        <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
-          "resultIsclear" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultRemarks != null">
-        and
-        <foreach collection="resultRemarks" item="item" open="(" separator="or" close=")">
-          "resultRemarks" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
     <include refid="orderBy"></include>
     <if test="orderField == null  ">
       order by "insertTime" desc