|
@@ -60,7 +60,7 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int insertLoadShip(Map<String,Object> map) throws Exception {
|
|
|
int i=0;
|
|
|
Map<String,Object> mapVal = (Map<String, Object>) map.get("mapVal");
|
|
@@ -122,7 +122,7 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
|
//查询实时库存
|
|
|
Map<String,Object> gmMap = tmsshipLoadShipResultMapper.selectGmIdByPortId(idMap);
|
|
|
if (gmMap==null) {
|
|
|
- return -2;
|
|
|
+ throw new Exception("没有港存库实时库存,无法装船!");
|
|
|
}else {
|
|
|
BigDecimal gmId = DataChange.dataToBigDecimal(gmMap.get("gmId"));
|
|
|
tmsshipLoadShipResult.setRwarehouseMaterialId(gmId);
|
|
@@ -143,7 +143,10 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
|
outBoundMap.put("portId",rowMap.get("downSwimPortId"));
|
|
|
outBoundMap.put("batchId",rowMap.get("batchId"));
|
|
|
outBoundMap.put("resultMaterialNumber",resultActualInstallations);
|
|
|
- wmshboundFeign.addResult(outBoundMap);
|
|
|
+ RESTfulResult resTfulResult=wmshboundFeign.addResult(outBoundMap);
|
|
|
+ if(!resTfulResult.getStatus().equals("succeed")){
|
|
|
+ throw new Exception("下游港口出库失败:"+resTfulResult.getData());
|
|
|
+ }
|
|
|
}
|
|
|
String resultNumber = noUtil.setResultNo("ZC",resultEntryId);
|
|
|
tmsshipLoadShipResult.setResultId(resultId);
|
|
@@ -224,6 +227,15 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
|
public int deleteLoadShip(BigDecimal resultId) {
|
|
|
TmsshipLoadShipResult tmsshipLoadShipResult = selectLoadShip(resultId);
|
|
|
tmsshipLoadShipResult.setDeleted(new BigDecimal(1));
|
|
|
+ //返还装船库存
|
|
|
+ List<Map<String,Object>> list =tmsshipLoadShipResultMapper.selectLoadShip(resultId);
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ Map<String,Object> mapValue=new HashMap<>();
|
|
|
+ mapValue.put("batchId",list.get(0).get("realBatchId"));
|
|
|
+ mapValue.put("portId",list.get(0).get("startPortId"));
|
|
|
+ mapValue.put("resultMaterialNumber",list.get(0).get("resultActualInstallations"));
|
|
|
+ wmshboundFeign.addWarehousingResult(mapValue);
|
|
|
+ }
|
|
|
return tmsshipLoadShipResultMapper.updateByPrimaryKeySelective(tmsshipLoadShipResult);
|
|
|
}
|
|
|
|