|
@@ -3,8 +3,10 @@ package com.steerinfo.dil.service.impl;
|
|
import com.steerinfo.dil.feign.WmshboundFeign;
|
|
import com.steerinfo.dil.feign.WmshboundFeign;
|
|
import com.steerinfo.dil.mapper.TmsshipEntryWharyResultMapper;
|
|
import com.steerinfo.dil.mapper.TmsshipEntryWharyResultMapper;
|
|
import com.steerinfo.dil.mapper.TmsshipOutWharyResultMapper;
|
|
import com.steerinfo.dil.mapper.TmsshipOutWharyResultMapper;
|
|
|
|
+import com.steerinfo.dil.mapper.TmsshipShipLocationMapper;
|
|
import com.steerinfo.dil.model.TmsshipEntryWharyResult;
|
|
import com.steerinfo.dil.model.TmsshipEntryWharyResult;
|
|
import com.steerinfo.dil.model.TmsshipOutWharyResult;
|
|
import com.steerinfo.dil.model.TmsshipOutWharyResult;
|
|
|
|
+import com.steerinfo.dil.model.TmsshipShipLocation;
|
|
import com.steerinfo.dil.util.DataChange;
|
|
import com.steerinfo.dil.util.DataChange;
|
|
import com.steerinfo.dil.util.NoUtil;
|
|
import com.steerinfo.dil.util.NoUtil;
|
|
import com.steerinfo.framework.mapper.IBaseMapper;
|
|
import com.steerinfo.framework.mapper.IBaseMapper;
|
|
@@ -12,6 +14,7 @@ import com.steerinfo.framework.service.impl.BaseServiceImpl;
|
|
import com.steerinfo.dil.model.TmsshipLoadShipResult;
|
|
import com.steerinfo.dil.model.TmsshipLoadShipResult;
|
|
import com.steerinfo.dil.mapper.TmsshipLoadShipResultMapper;
|
|
import com.steerinfo.dil.mapper.TmsshipLoadShipResultMapper;
|
|
import com.steerinfo.dil.service.ITmsshipLoadShipResultService;
|
|
import com.steerinfo.dil.service.ITmsshipLoadShipResultService;
|
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -47,6 +50,10 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
TmsshipEntryWharyResultMapper tmsshipEntryWharyResultMapper;
|
|
TmsshipEntryWharyResultMapper tmsshipEntryWharyResultMapper;
|
|
@Autowired
|
|
@Autowired
|
|
TmsshipOutWharyResultMapper tmsshipOutWharyResultMapper;
|
|
TmsshipOutWharyResultMapper tmsshipOutWharyResultMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ TmsshipShipLocationMapper tmsshipShipLocationMapper;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
WmshboundFeign wmshboundFeign;
|
|
WmshboundFeign wmshboundFeign;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -60,21 +67,23 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public int insertLoadShip(Map<String,Object> map) {
|
|
public int insertLoadShip(Map<String,Object> map) {
|
|
|
|
+ int i=0;
|
|
Map<String,Object> mapVal = (Map<String, Object>) map.get("mapVal");
|
|
Map<String,Object> mapVal = (Map<String, Object>) map.get("mapVal");
|
|
Map<String,Object> rowMap = (Map<String, Object>) map.get("rowMap");
|
|
Map<String,Object> rowMap = (Map<String, Object>) map.get("rowMap");
|
|
TmsshipLoadShipResult tmsshipLoadShipResult = new TmsshipLoadShipResult();
|
|
TmsshipLoadShipResult tmsshipLoadShipResult = new TmsshipLoadShipResult();
|
|
TmsshipEntryWharyResult tmsshipEntryWharyResult = new TmsshipEntryWharyResult();
|
|
TmsshipEntryWharyResult tmsshipEntryWharyResult = new TmsshipEntryWharyResult();
|
|
BigDecimal orderId = new BigDecimal((Integer) rowMap.get("orderId"));
|
|
BigDecimal orderId = new BigDecimal((Integer) rowMap.get("orderId"));
|
|
- //BigDecimal batchId = getBatchId(rowMap);
|
|
|
|
BigDecimal batchId= DataChange.dataToBigDecimal(rowMap.get("batchId"));
|
|
BigDecimal batchId= DataChange.dataToBigDecimal(rowMap.get("batchId"));
|
|
Map<String,Object> ppMap = tmsshipLoadShipResultMapper.getPortAndPier(batchId);
|
|
Map<String,Object> ppMap = tmsshipLoadShipResultMapper.getPortAndPier(batchId);
|
|
BigDecimal pierId = (BigDecimal) ppMap.get("pierId");
|
|
BigDecimal pierId = (BigDecimal) ppMap.get("pierId");
|
|
Date noticeDeliveryTime = (Date) ppMap.get("noticeDeliveryTime");
|
|
Date noticeDeliveryTime = (Date) ppMap.get("noticeDeliveryTime");
|
|
|
|
+ BigDecimal startPortId = DataChange.dataToBigDecimal(ppMap.get("startPortId"));
|
|
String resultMemo = (String) mapVal.get("resultMemo");
|
|
String resultMemo = (String) mapVal.get("resultMemo");
|
|
// 抵港
|
|
// 抵港
|
|
Date resultPortDeclarationTime = new Date((Long) mapVal.get("resultPortDeclarationTime"));
|
|
Date resultPortDeclarationTime = new Date((Long) mapVal.get("resultPortDeclarationTime"));
|
|
String resultPortDeclarationName = (String) mapVal.get("resultPortDeclarationName");
|
|
String resultPortDeclarationName = (String) mapVal.get("resultPortDeclarationName");
|
|
Date resultArrivalTime = new Date((Long)mapVal.get("resultArrivalTime"));
|
|
Date resultArrivalTime = new Date((Long)mapVal.get("resultArrivalTime"));
|
|
|
|
+ tmsshipLoadShipResult.setResultArrivalPortTime(resultArrivalTime);
|
|
BigDecimal totalResultId = tmsshipTotalResultService.getResultTotalId(orderId);
|
|
BigDecimal totalResultId = tmsshipTotalResultService.getResultTotalId(orderId);
|
|
tmsshipEntryWharyResult.setTotalResultId(totalResultId);
|
|
tmsshipEntryWharyResult.setTotalResultId(totalResultId);
|
|
BigDecimal resultEntryId = tmsshipEntryWharyResultMapper.selectEntryId();
|
|
BigDecimal resultEntryId = tmsshipEntryWharyResultMapper.selectEntryId();
|
|
@@ -92,11 +101,10 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
tmsshipEntryWharyResult.setInsertUsername("admin");
|
|
tmsshipEntryWharyResult.setInsertUsername("admin");
|
|
tmsshipEntryWharyResult.setUpdateUsername("admin");
|
|
tmsshipEntryWharyResult.setUpdateUsername("admin");
|
|
tmsshipEntryWharyResult.setInsertUpdateRemark("无");
|
|
tmsshipEntryWharyResult.setInsertUpdateRemark("无");
|
|
- tmsshipEntryWharyResult.setDeleteName(null);
|
|
|
|
- tmsshipEntryWharyResult.setDeleteTime(null);
|
|
|
|
//离港
|
|
//离港
|
|
String resultOutWharyName = (String) mapVal.get("resultOutWharyName");
|
|
String resultOutWharyName = (String) mapVal.get("resultOutWharyName");
|
|
Date resultOutWharyTime = new Date((Long) mapVal.get("resultOutWharyTime"));
|
|
Date resultOutWharyTime = new Date((Long) mapVal.get("resultOutWharyTime"));
|
|
|
|
+ tmsshipLoadShipResult.setResultOutPortTime(resultOutWharyTime);
|
|
TmsshipOutWharyResult tmsshipOutWharyResult = new TmsshipOutWharyResult();
|
|
TmsshipOutWharyResult tmsshipOutWharyResult = new TmsshipOutWharyResult();
|
|
tmsshipOutWharyResult.setTotalResultId(totalResultId);
|
|
tmsshipOutWharyResult.setTotalResultId(totalResultId);
|
|
BigDecimal resultOutId = tmsshipOutWharyResultMapper.selectOutId();
|
|
BigDecimal resultOutId = tmsshipOutWharyResultMapper.selectOutId();
|
|
@@ -113,37 +121,32 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
tmsshipOutWharyResult.setInsertUsername("admin");
|
|
tmsshipOutWharyResult.setInsertUsername("admin");
|
|
tmsshipOutWharyResult.setUpdateUsername("admin");
|
|
tmsshipOutWharyResult.setUpdateUsername("admin");
|
|
tmsshipOutWharyResult.setInsertUpdateRemark("无");
|
|
tmsshipOutWharyResult.setInsertUpdateRemark("无");
|
|
- tmsshipOutWharyResult.setDeleteName(null);
|
|
|
|
- tmsshipOutWharyResult.setDeleteTime(null);
|
|
|
|
// 装船
|
|
// 装船
|
|
BigDecimal resultId = tmsshipLoadShipResultMapper.selectLoadId();
|
|
BigDecimal resultId = tmsshipLoadShipResultMapper.selectLoadId();
|
|
- //获得起运港
|
|
|
|
- BigDecimal downSwimPortId= DataChange.dataToBigDecimal(rowMap.get("downSwimPortId")) ;
|
|
|
|
|
|
|
|
|
|
+ //通过总实绩id查找船运起运港口
|
|
//根据港口和批次Id查询实时库存id
|
|
//根据港口和批次Id查询实时库存id
|
|
-// Map<String,Object> idMap=new HashMap<>();
|
|
|
|
-// idMap.put("batchId",batchId);
|
|
|
|
-// idMap.put("downSwimPortId",downSwimPortId);
|
|
|
|
-// Map<String,Object> gmMap = tmsshipLoadShipResultMapper.selectGmIdByPortId(idMap);
|
|
|
|
-// BigDecimal gmId=DataChange.dataToBigDecimal(gmMap.get("gmId"));
|
|
|
|
|
|
+ Map<String,Object> idMap=new HashMap<>();
|
|
|
|
+ idMap.put("batchId",batchId);
|
|
|
|
+ idMap.put("downSwimPortId",startPortId);
|
|
|
|
+ Map<String,Object> gmMap = tmsshipLoadShipResultMapper.selectGmIdByPortId(idMap);
|
|
|
|
+ BigDecimal gmId=DataChange.dataToBigDecimal(gmMap.get("gmId"));
|
|
|
|
+ tmsshipLoadShipResult.setRwarehouseMaterialId(gmId);
|
|
//获得实装数量
|
|
//获得实装数量
|
|
BigDecimal resultActualInstallations = new BigDecimal((String) mapVal.get("resultActualInstallations"));
|
|
BigDecimal resultActualInstallations = new BigDecimal((String) mapVal.get("resultActualInstallations"));
|
|
|
|
+ //装船时间
|
|
Date resultLoadShipDate = new Date((Long) mapVal.get("resultLoadShipDate"));
|
|
Date resultLoadShipDate = new Date((Long) mapVal.get("resultLoadShipDate"));
|
|
|
|
+ tmsshipLoadShipResult.setResultLoadShipDate(resultLoadShipDate);
|
|
|
|
+ //是否清场
|
|
String resultIsClear = (String) mapVal.get("resultIsClear");
|
|
String resultIsClear = (String) mapVal.get("resultIsClear");
|
|
|
|
+ tmsshipLoadShipResult.setResultIsclear(resultIsClear);
|
|
String resultNumber = noUtil.setResultNo("ZC",resultEntryId);
|
|
String resultNumber = noUtil.setResultNo("ZC",resultEntryId);
|
|
tmsshipLoadShipResult.setResultId(resultId);
|
|
tmsshipLoadShipResult.setResultId(resultId);
|
|
tmsshipLoadShipResult.setTotalResultId(totalResultId);
|
|
tmsshipLoadShipResult.setTotalResultId(totalResultId);
|
|
-
|
|
|
|
tmsshipLoadShipResult.setBatchId(batchId);
|
|
tmsshipLoadShipResult.setBatchId(batchId);
|
|
tmsshipLoadShipResult.setResultDeliveryDate(noticeDeliveryTime);
|
|
tmsshipLoadShipResult.setResultDeliveryDate(noticeDeliveryTime);
|
|
tmsshipLoadShipResult.setResultActualInstallations(resultActualInstallations);
|
|
tmsshipLoadShipResult.setResultActualInstallations(resultActualInstallations);
|
|
tmsshipLoadShipResult.setResultNumber(resultNumber);
|
|
tmsshipLoadShipResult.setResultNumber(resultNumber);
|
|
- //设置港存库实时库存id
|
|
|
|
-// tmsshipLoadShipResult.setRwarehouseMaterialId(gmId);
|
|
|
|
-// tmsshipLoadShipResult.setResultArrivalPortTime(resultArrivalTime);
|
|
|
|
-// tmsshipLoadShipResult.setResultOutPortTime(resultOutWharyTime);
|
|
|
|
-// tmsshipLoadShipResult.setResultLoadShipDate(resultLoadShipDate);
|
|
|
|
-// tmsshipLoadShipResult.setResultIsclear(resultIsClear);
|
|
|
|
// 设置常规字段
|
|
// 设置常规字段
|
|
tmsshipLoadShipResult.setInsertTime(new Date());
|
|
tmsshipLoadShipResult.setInsertTime(new Date());
|
|
tmsshipLoadShipResult.setInsertUsername("admin");
|
|
tmsshipLoadShipResult.setInsertUsername("admin");
|
|
@@ -151,10 +154,18 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
|
|
tmsshipLoadShipResult.setUpdateTime(new Date());
|
|
tmsshipLoadShipResult.setUpdateTime(new Date());
|
|
tmsshipLoadShipResult.setUpdateUsername("admin");
|
|
tmsshipLoadShipResult.setUpdateUsername("admin");
|
|
tmsshipLoadShipResult.setDeleted(new BigDecimal(0));
|
|
tmsshipLoadShipResult.setDeleted(new BigDecimal(0));
|
|
- tmsshipEntryWharyResultMapper.insertSelective(tmsshipEntryWharyResult);
|
|
|
|
- tmsshipOutWharyResultMapper.insertSelective(tmsshipOutWharyResult);
|
|
|
|
- int codeLoad = tmsshipLoadShipResultMapper.insertSelective(tmsshipLoadShipResult);
|
|
|
|
- return codeLoad;
|
|
|
|
|
|
+ i += tmsshipEntryWharyResultMapper.insertSelective(tmsshipEntryWharyResult);
|
|
|
|
+ i += tmsshipOutWharyResultMapper.insertSelective(tmsshipOutWharyResult);
|
|
|
|
+ //新增位置作业,未到闸
|
|
|
|
+ TmsshipShipLocation tmsshipShipLocation=new TmsshipShipLocation();
|
|
|
|
+ BigDecimal locationId = tmsshipShipLocationMapper.selectLocationId();
|
|
|
|
+ tmsshipShipLocation.setLocationId(locationId);
|
|
|
|
+ tmsshipShipLocation.setTotalResultId(totalResultId);
|
|
|
|
+ tmsshipShipLocation.setLocationStatus("未到闸船舶");
|
|
|
|
+ tmsshipShipLocation.setInsertTime(new Date());
|
|
|
|
+ i += tmsshipShipLocationMapper.insertSelective(tmsshipShipLocation);
|
|
|
|
+ i += tmsshipLoadShipResultMapper.insertSelective(tmsshipLoadShipResult);
|
|
|
|
+ return i;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|