|
@@ -361,6 +361,7 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
|
|
* @param map
|
|
* @param map
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
|
|
+ @Transactional(rollbackFor = {Exception.class})
|
|
@Override
|
|
@Override
|
|
public int updateTmstrainLoadingResult(Map<String,Object> map) throws Exception{
|
|
public int updateTmstrainLoadingResult(Map<String,Object> map) throws Exception{
|
|
TmstrainLoadingResult tmstrainLoadingResult=new TmstrainLoadingResult();
|
|
TmstrainLoadingResult tmstrainLoadingResult=new TmstrainLoadingResult();
|
|
@@ -368,11 +369,11 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
|
|
BigDecimal resultId=DataChange.dataToBigDecimal(map.get("resultId"));
|
|
BigDecimal resultId=DataChange.dataToBigDecimal(map.get("resultId"));
|
|
Integer resultType=(Integer) map.get("resultType");
|
|
Integer resultType=(Integer) map.get("resultType");
|
|
if(wagonNo==null || wagonNo.length()!=7 || calculateWagonWeight(wagonNo)<=0){
|
|
if(wagonNo==null || wagonNo.length()!=7 || calculateWagonWeight(wagonNo)<=0){
|
|
- return -1;
|
|
|
|
|
|
+ throw new Exception("车皮号异常");
|
|
}else if(resultId==null){
|
|
}else if(resultId==null){
|
|
- return -2;
|
|
|
|
|
|
+ throw new Exception("主键为空");
|
|
}else if(resultType==0){
|
|
}else if(resultType==0){
|
|
- return -3;
|
|
|
|
|
|
+ throw new Exception("类型异常");
|
|
}
|
|
}
|
|
//国产矿未配单仅支持修改部分字段,并且不重新发委托
|
|
//国产矿未配单仅支持修改部分字段,并且不重新发委托
|
|
List<Map<String,Object>> results=tmstrainLoadingResultMapper.selectByResultId(resultId);
|
|
List<Map<String,Object>> results=tmstrainLoadingResultMapper.selectByResultId(resultId);
|
|
@@ -407,7 +408,7 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
|
|
BigDecimal materialId=DataChange.dataToBigDecimal(record.get("materialId"));
|
|
BigDecimal materialId=DataChange.dataToBigDecimal(record.get("materialId"));
|
|
BigDecimal supplierId=DataChange.dataToBigDecimal(record.get("supplierId"));
|
|
BigDecimal supplierId=DataChange.dataToBigDecimal(record.get("supplierId"));
|
|
if(purchaseOrderId==null || batchId==null ||materialId==null ||supplierId==null){
|
|
if(purchaseOrderId==null || batchId==null ||materialId==null ||supplierId==null){
|
|
- return -4;
|
|
|
|
|
|
+ throw new Exception("采购订单号异常");
|
|
}
|
|
}
|
|
tmstrainLoadingResult.setBatchId(batchId);
|
|
tmstrainLoadingResult.setBatchId(batchId);
|
|
tmstrainLoadingResult.setPurchaseOrderRailPlanId(purchaseOrderId);
|
|
tmstrainLoadingResult.setPurchaseOrderRailPlanId(purchaseOrderId);
|
|
@@ -428,8 +429,12 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
|
|
}else{
|
|
}else{
|
|
throw new Exception("没有用户id,请登录再操作!");
|
|
throw new Exception("没有用户id,请登录再操作!");
|
|
}
|
|
}
|
|
- int count=0;
|
|
|
|
- //发送计量委托
|
|
|
|
|
|
+ //更新
|
|
|
|
+ int count=tmstrainLoadingResultMapper.updateByPrimaryKeySelective(tmstrainLoadingResult);
|
|
|
|
+ if(count <= 0){
|
|
|
|
+ throw new Exception("修改失败");
|
|
|
|
+ }
|
|
|
|
+ //修改成功,发送计量委托
|
|
List<Map<String, Object>> resultIdList = new ArrayList<>();
|
|
List<Map<String, Object>> resultIdList = new ArrayList<>();
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
Map<String, Object> map2 = new HashMap<>();
|
|
Map<String, Object> map2 = new HashMap<>();
|
|
@@ -438,9 +443,8 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
|
|
map2.put("resultIdList",resultIdList);
|
|
map2.put("resultIdList",resultIdList);
|
|
count = tmstrainMeasureCommissionService.batchSendMeasureCommission(map2);
|
|
count = tmstrainMeasureCommissionService.batchSendMeasureCommission(map2);
|
|
if(count<=0)
|
|
if(count<=0)
|
|
- return -5;
|
|
|
|
- //更新
|
|
|
|
- return tmstrainLoadingResultMapper.updateByPrimaryKeySelective(tmstrainLoadingResult);
|
|
|
|
|
|
+ throw new Exception("发送计量委托失败");
|
|
|
|
+ return count;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|