|
@@ -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);
|
|
|
//通过车皮号计算车皮标重
|