|
@@ -138,20 +138,14 @@ public class DilBatchServiceImpl implements IDilBatchService {
|
|
public int bindBatch(Map<String, Object> map) throws Exception {
|
|
public int bindBatch(Map<String, Object> map) throws Exception {
|
|
int i=0;
|
|
int i=0;
|
|
//校验
|
|
//校验
|
|
- if(map.get("batchInfactoryId")==null || map.get("batchIdOld")==null || map.get("batchId") ==null
|
|
|
|
- || map.get("userId") ==null || map.get("gmId")==null || map.get("portId")==null){
|
|
|
|
|
|
+ if( map.get("batchIdOld")==null || map.get("batchId") ==null || map.get("userId") ==null){
|
|
throw new Exception("数据异常,请检查是否输入正确数据!");
|
|
throw new Exception("数据异常,请检查是否输入正确数据!");
|
|
}
|
|
}
|
|
- //取值
|
|
|
|
- BigDecimal batchInfactoryId = DataChange.dataToBigDecimal(map.get("batchInfactoryId"));
|
|
|
|
- BigDecimal batchId = DataChange.dataToBigDecimal(map.get("batchId"));
|
|
|
|
- BigDecimal userId = DataChange.dataToBigDecimal(map.get("userId"));
|
|
|
|
- //更新批次中间表的关联批次
|
|
|
|
- DilBatchInfacotry dilBatchInfacotry=new DilBatchInfacotry();
|
|
|
|
- dilBatchInfacotry.setBatchInfacotryId(batchInfactoryId);
|
|
|
|
- dilBatchInfacotry.setBatchId(batchId);
|
|
|
|
- dilBatchInfacotry.setUpdateUsername(userId.toString());
|
|
|
|
- i+=dilBatchInfacotryMapper.updateByPrimaryKeySelective(dilBatchInfacotry);
|
|
|
|
|
|
+ if(dilBatchInfacotryMapper.checkForBind(map)==null){
|
|
|
|
+ throw new Exception("外轮船名不相等,请检查批次是否正确!");
|
|
|
|
+ }
|
|
|
|
+ //更新批次中间表的所有关联批次
|
|
|
|
+ i+=dilBatchInfacotryMapper.updateForBind(map);
|
|
//更新港存库、入库、出库的批次id
|
|
//更新港存库、入库、出库的批次id
|
|
wmshboundFeign.updateWmshGridMaterial(map);
|
|
wmshboundFeign.updateWmshGridMaterial(map);
|
|
return i;
|
|
return i;
|