|
@@ -17,10 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* TmsshipUnloadShipResult服务实现:
|
|
* TmsshipUnloadShipResult服务实现:
|
|
@@ -82,59 +79,62 @@ public class TmsshipUnloadShipResultServiceImpl implements ITmsshipUnloadShipRes
|
|
if (userId != null) {
|
|
if (userId != null) {
|
|
userName = tmsshipLoadShipResultMapper.getUserNameByUserId(userId);
|
|
userName = tmsshipLoadShipResultMapper.getUserNameByUserId(userId);
|
|
}
|
|
}
|
|
- TmsshipUnloadShipResult tmsshipUnloadShipResult = new TmsshipUnloadShipResult();
|
|
|
|
- BigDecimal resultId = selectMaxId();
|
|
|
|
- BigDecimal orderId = new BigDecimal((Integer) unloadMap.get("orderId"));
|
|
|
|
- BigDecimal totalResultId = tmsshipTotalResultService.getResultTotalId(orderId);
|
|
|
|
- //修改船舶状态
|
|
|
|
- TmsshipTotalResult tmsshipTotalResult=new TmsshipTotalResult();
|
|
|
|
- tmsshipTotalResult.setResultId(totalResultId);
|
|
|
|
- tmsshipTotalResult.setShipStatus(new BigDecimal(1));
|
|
|
|
- tmsshipTotalResultMapper.updateByPrimaryKeySelective(tmsshipTotalResult);
|
|
|
|
- if(mapVal.get("resultArrivalDate") != null && !"null".equals(mapVal.get("resultArrivalDate"))){
|
|
|
|
- Date resultArrivalDate = new Date((Long) mapVal.get("resultArrivalDate"));
|
|
|
|
- tmsshipUnloadShipResult.setResultArrivalDate(resultArrivalDate);
|
|
|
|
|
|
+ List<BigDecimal> orderIds=tmsshipTotalResultMapper.selectAllByCapacity(unloadMap);
|
|
|
|
+ for(BigDecimal orderId:orderIds){
|
|
|
|
+ TmsshipUnloadShipResult tmsshipUnloadShipResult = new TmsshipUnloadShipResult();
|
|
|
|
+ BigDecimal resultId = selectMaxId();
|
|
|
|
+ BigDecimal totalResultId = tmsshipTotalResultService.getResultTotalId(orderId);
|
|
|
|
+ //修改船舶状态
|
|
|
|
+ TmsshipTotalResult tmsshipTotalResult=new TmsshipTotalResult();
|
|
|
|
+ tmsshipTotalResult.setResultId(totalResultId);
|
|
|
|
+ tmsshipTotalResult.setShipStatus(new BigDecimal(1));
|
|
|
|
+ tmsshipTotalResultMapper.updateByPrimaryKeySelective(tmsshipTotalResult);
|
|
|
|
+ if(mapVal.get("resultArrivalDate") != null && !"null".equals(mapVal.get("resultArrivalDate"))){
|
|
|
|
+ Date resultArrivalDate = new Date((Long) mapVal.get("resultArrivalDate"));
|
|
|
|
+ tmsshipUnloadShipResult.setResultArrivalDate(resultArrivalDate);
|
|
|
|
+ }
|
|
|
|
+ if(mapVal.get("resultStartTime") != null && !"null".equals(mapVal.get("resultStartTime"))){
|
|
|
|
+ Date resultStartTime = new Date((Long) mapVal.get("resultStartTime"));
|
|
|
|
+ tmsshipUnloadShipResult.setResultStartTime(resultStartTime);
|
|
|
|
+ }
|
|
|
|
+ if(mapVal.get("resultEndTime") != null && !"null".equals(mapVal.get("resultEndTime"))){
|
|
|
|
+ Date resultEndTime = new Date((Long) mapVal.get("resultEndTime"));
|
|
|
|
+ tmsshipUnloadShipResult.setResultEndTime(resultEndTime);
|
|
|
|
+ }
|
|
|
|
+ String resultStatus = (String) mapVal.get("resultStatus");
|
|
|
|
+ // 设置属性值
|
|
|
|
+ tmsshipUnloadShipResult.setResultId(resultId);
|
|
|
|
+ tmsshipUnloadShipResult.setTotalResultId(totalResultId);
|
|
|
|
+ tmsshipUnloadShipResult.setResultStatus(resultStatus);
|
|
|
|
+ // 设置常规字段
|
|
|
|
+ tmsshipUnloadShipResult.setInsertTime(new Date());
|
|
|
|
+ tmsshipUnloadShipResult.setUpdateTime(new Date());
|
|
|
|
+ if (userName != null) {
|
|
|
|
+ tmsshipUnloadShipResult.setInsertUsername(userName);
|
|
|
|
+ tmsshipUnloadShipResult.setUpdateUsername(userName);
|
|
|
|
+ }
|
|
|
|
+ tmsshipUnloadShipResult.setInsertUpdateRemark("无");
|
|
|
|
+ tmsshipUnloadShipResult.setDeleted(new BigDecimal(0));
|
|
|
|
+ //锁定船只
|
|
|
|
+ OmsshipInstructionsCapacity omsshipInstructionsCapacity=new OmsshipInstructionsCapacity();
|
|
|
|
+ omsshipInstructionsCapacity.setInstructionsCapacityId(DataChange.dataToBigDecimal(unloadMap.get("instructionsCapacityId")));
|
|
|
|
+ //锁定
|
|
|
|
+ omsshipInstructionsCapacity.setDeleted(new BigDecimal(3));
|
|
|
|
+ omsshipInstructionsCapacityMapper.updateByPrimaryKeySelective(omsshipInstructionsCapacity);
|
|
|
|
+ // 新增出库实绩
|
|
|
|
+ Map<String,Object> totalId = new HashMap<>();
|
|
|
|
+ totalId.put("totalResultId",totalResultId);
|
|
|
|
+ List<Map<String,Object>> tmsshipLoadShipResults = tmsshipLoadShipResultMapper.getBatchIdForOut(totalId);
|
|
|
|
+ Map<String,Object> tmsshipLoadShipResult = tmsshipLoadShipResults.get(0);
|
|
|
|
+ Map<String,Object> mapValue = new HashMap<>();
|
|
|
|
+ mapValue.put("batchId",tmsshipLoadShipResult.get("batchId"));
|
|
|
|
+ mapValue.put("portId",portId);
|
|
|
|
+ mapValue.put("resultMaterialNumber",tmsshipLoadShipResult.get("resultMaterialNumber"));
|
|
|
|
+ mapValue.put("resultStartTime",mapVal.get("resultStartTime"));
|
|
|
|
+ wmshboundFeign.addWarehousingResult(mapValue);
|
|
|
|
+ tmsshipUnloadShipResultMapper.insert(tmsshipUnloadShipResult);
|
|
}
|
|
}
|
|
- if(mapVal.get("resultStartTime") != null && !"null".equals(mapVal.get("resultStartTime"))){
|
|
|
|
- Date resultStartTime = new Date((Long) mapVal.get("resultStartTime"));
|
|
|
|
- tmsshipUnloadShipResult.setResultStartTime(resultStartTime);
|
|
|
|
- }
|
|
|
|
- if(mapVal.get("resultEndTime") != null && !"null".equals(mapVal.get("resultEndTime"))){
|
|
|
|
- Date resultEndTime = new Date((Long) mapVal.get("resultEndTime"));
|
|
|
|
- tmsshipUnloadShipResult.setResultEndTime(resultEndTime);
|
|
|
|
- }
|
|
|
|
- String resultStatus = (String) mapVal.get("resultStatus");
|
|
|
|
- // 设置属性值
|
|
|
|
- tmsshipUnloadShipResult.setResultId(resultId);
|
|
|
|
- tmsshipUnloadShipResult.setTotalResultId(totalResultId);
|
|
|
|
- tmsshipUnloadShipResult.setResultStatus(resultStatus);
|
|
|
|
- // 设置常规字段
|
|
|
|
- tmsshipUnloadShipResult.setInsertTime(new Date());
|
|
|
|
- tmsshipUnloadShipResult.setUpdateTime(new Date());
|
|
|
|
- if (userName != null) {
|
|
|
|
- tmsshipUnloadShipResult.setInsertUsername(userName);
|
|
|
|
- tmsshipUnloadShipResult.setUpdateUsername(userName);
|
|
|
|
- }
|
|
|
|
- tmsshipUnloadShipResult.setInsertUpdateRemark("无");
|
|
|
|
- tmsshipUnloadShipResult.setDeleted(new BigDecimal(0));
|
|
|
|
- //锁定船只
|
|
|
|
- OmsshipInstructionsCapacity omsshipInstructionsCapacity=new OmsshipInstructionsCapacity();
|
|
|
|
- omsshipInstructionsCapacity.setInstructionsCapacityId(DataChange.dataToBigDecimal(unloadMap.get("instructionsCapacityId")));
|
|
|
|
- //锁定
|
|
|
|
- omsshipInstructionsCapacity.setDeleted(new BigDecimal(3));
|
|
|
|
- omsshipInstructionsCapacityMapper.updateByPrimaryKeySelective(omsshipInstructionsCapacity);
|
|
|
|
- // 新增出库实绩
|
|
|
|
- Map<String,Object> totalId = new HashMap<>();
|
|
|
|
- totalId.put("totalResultId",totalResultId);
|
|
|
|
- List<Map<String,Object>> tmsshipLoadShipResults = tmsshipLoadShipResultMapper.getBatchIdForOut(totalId);
|
|
|
|
- Map<String,Object> tmsshipLoadShipResult = tmsshipLoadShipResults.get(0);
|
|
|
|
- Map<String,Object> mapValue = new HashMap<>();
|
|
|
|
- mapValue.put("batchId",tmsshipLoadShipResult.get("batchId"));
|
|
|
|
- mapValue.put("portId",portId);
|
|
|
|
- mapValue.put("resultMaterialNumber",tmsshipLoadShipResult.get("resultMaterialNumber"));
|
|
|
|
- mapValue.put("resultStartTime",mapVal.get("resultStartTime"));
|
|
|
|
- wmshboundFeign.addWarehousingResult(mapValue);
|
|
|
|
- return tmsshipUnloadShipResultMapper.insert(tmsshipUnloadShipResult);
|
|
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|