|
|
@@ -209,13 +209,20 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
//明细数据
|
|
|
List<TradingBoxItem> tradingBoxItemList = tradingBox.getTradingBoxItemsList();
|
|
|
- int boxNumber = 0;
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList) && tradingBoxItemList.size() > 0) {
|
|
|
//箱号拼接字符串
|
|
|
List<String> codes = tradingBoxItemList.stream().map(TradingBoxItem::getCode).distinct().collect(Collectors.toList());
|
|
|
tradingBox.setCode(String.join(",", codes));
|
|
|
+ StringBuilder boxTypeNumber = new StringBuilder();
|
|
|
+ List<String> boxType = tradingBoxItemList.stream().map(TradingBoxItem::getBoxType).distinct().collect(Collectors.toList());
|
|
|
+ for (String boxType_ : boxType) {
|
|
|
+ List<TradingBoxItem> boxTypeSize = tradingBoxItemList.stream().filter(e -> e.getBoxType().equals(boxType_)).collect(Collectors.toList());
|
|
|
+ if (ObjectUtils.isNotNull(boxTypeSize) && boxTypeSize.size() > 0) {
|
|
|
+ boxTypeNumber.append(boxType_).append("✖").append(boxTypeSize).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tradingBox.setBoxTypeNumber(boxTypeNumber.toString());
|
|
|
for (TradingBoxItem tradingBoxItem : tradingBoxItemList) {
|
|
|
- boxNumber += GeneralToolsUtils.boxNumber(tradingBoxItem.getBoxType());
|
|
|
if ("BUY".equals(tradingBox.getType())) {
|
|
|
tradingBoxItem.setBoxSource("购买");
|
|
|
tradingBoxItem.setStatus("待使用");
|
|
|
@@ -274,30 +281,31 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
Archives archives = new Archives();
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
BeanUtil.copy(archivesR, archives);
|
|
|
+ } else {
|
|
|
+ archives.setCode(tradingBoxItem.getCode());
|
|
|
+ archives.setName(tradingBoxItem.getBoxType());
|
|
|
+ archives.setVolume(tradingBoxItem.getVolume());
|
|
|
+ archives.setGorssWeight(tradingBoxItem.getGrossWeight());
|
|
|
+ archives.setTypeId(tradingBoxItem.getBoxTypeId());
|
|
|
+ archives.setAddressId(tradingBoxItem.getAddressId());
|
|
|
+ archives.setAddress(tradingBoxItem.getAddress());
|
|
|
+ archives.setNewDate(tradingBoxItem.getNewDate());
|
|
|
+ archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
|
|
|
+ archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
|
|
|
+ archives.setBoxSource(tradingBoxItem.getBoxSource());
|
|
|
+ archives.setBoxStatus(tradingBoxItem.getBoxStatus());
|
|
|
+ archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
|
|
|
+ archives.setTare(tradingBoxItem.getTare());
|
|
|
+ archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
|
|
|
+ archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
|
|
|
+ archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
|
|
|
+ archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
|
|
|
+ archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
|
|
|
+ archives.setBoxAge(tradingBoxItem.getBoxAge());
|
|
|
+ archives.setPurchaseDate(tradingBox.getPurchaseDate());
|
|
|
+ archives.setContractNo(tradingBox.getContractNo());
|
|
|
}
|
|
|
- archives.setCode(tradingBoxItem.getCode());
|
|
|
- archives.setName(tradingBoxItem.getBoxType());
|
|
|
- archives.setVolume(tradingBoxItem.getVolume());
|
|
|
- archives.setGorssWeight(tradingBoxItem.getGrossWeight());
|
|
|
archives.setStatus(tradingBoxItem.getStatus());
|
|
|
- archives.setTypeId(tradingBoxItem.getBoxTypeId());
|
|
|
- archives.setAddressId(tradingBoxItem.getAddressId());
|
|
|
- archives.setAddress(tradingBoxItem.getAddress());
|
|
|
- archives.setNewDate(tradingBoxItem.getNewDate());
|
|
|
- archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
|
|
|
- archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
|
|
|
- archives.setBoxSource(tradingBoxItem.getBoxSource());
|
|
|
- archives.setBoxStatus(tradingBoxItem.getBoxStatus());
|
|
|
- archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
|
|
|
- archives.setTare(tradingBoxItem.getTare());
|
|
|
- archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
|
|
|
- archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
|
|
|
- archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
|
|
|
- archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
|
|
|
- archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
|
|
|
- archives.setBoxAge(tradingBoxItem.getBoxAge());
|
|
|
- archives.setPurchaseDate(tradingBox.getPurchaseDate());
|
|
|
- archives.setContractNo(tradingBox.getContractNo());
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
@@ -321,7 +329,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
archivesFilesMapper.insert(archivesFiles);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//记录箱轨迹信息
|
|
|
ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
|
|
|
if ("BUY".equals(tradingBox.getType())) {
|
|
|
@@ -348,7 +355,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
tradingBox.setTradingBoxItemsList(tradingBoxItemList);
|
|
|
}
|
|
|
- tradingBox.setBoxNumber(boxNumber);
|
|
|
+ tradingBox.setBoxNumber(tradingBoxItemList.size());
|
|
|
baseMapper.updateById(tradingBox);
|
|
|
//费用明细
|
|
|
List<TradingBoxFees> tradingBoxFeesList = tradingBox.getTradingBoxFeesList();
|
|
|
@@ -425,13 +432,21 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
//明细数据
|
|
|
List<TradingBoxItem> tradingBoxItemList = tradingBox.getTradingBoxItemsList();
|
|
|
- int boxNumber = 0;
|
|
|
if (ObjectUtils.isNotNull(tradingBoxItemList) && tradingBoxItemList.size() > 0) {
|
|
|
//箱号拼接字符串
|
|
|
List<String> codes = tradingBoxItemList.stream().map(TradingBoxItem::getCode).distinct().collect(Collectors.toList());
|
|
|
tradingBox.setCode(String.join(",", codes));
|
|
|
+
|
|
|
+ StringBuilder boxTypeNumber = new StringBuilder();
|
|
|
+ List<String> boxType = tradingBoxItemList.stream().map(TradingBoxItem::getBoxType).distinct().collect(Collectors.toList());
|
|
|
+ for (String boxType_ : boxType) {
|
|
|
+ List<TradingBoxItem> boxTypeSize = tradingBoxItemList.stream().filter(e -> e.getBoxType().equals(boxType_)).collect(Collectors.toList());
|
|
|
+ if (ObjectUtils.isNotNull(boxTypeSize) && boxTypeSize.size() > 0) {
|
|
|
+ boxTypeNumber.append(boxType_).append("✖").append(boxTypeSize).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tradingBox.setBoxTypeNumber(boxTypeNumber.toString());
|
|
|
for (TradingBoxItem tradingBoxItem : tradingBoxItemList) {
|
|
|
- boxNumber += GeneralToolsUtils.boxNumber(tradingBoxItem.getBoxType());
|
|
|
if (tradingBox.getType().equals("ZR")) {
|
|
|
tradingBoxItem.setBoxSource("租入");
|
|
|
} else if (tradingBox.getType().equals("ZC")) {
|
|
|
@@ -576,7 +591,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
}
|
|
|
tradingBox.setTradingBoxItemsList(tradingBoxItemList);
|
|
|
}
|
|
|
- tradingBox.setBoxNumber(boxNumber);
|
|
|
+ tradingBox.setBoxNumber(tradingBoxItemList.size());
|
|
|
baseMapper.updateById(tradingBox);
|
|
|
//费用明细
|
|
|
List<TradingBoxFees> tradingBoxFeesList = tradingBox.getTradingBoxFeesList();
|
|
|
@@ -591,6 +606,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
tradingBoxFees.setCreateUser(AuthUtil.getUserId());
|
|
|
tradingBoxFees.setCreateTime(new Date());
|
|
|
tradingBoxFees.setTenantId(AuthUtil.getTenantId());
|
|
|
+ tradingBoxFees.setPid(tradingBox.getId());
|
|
|
tradingBoxFeesMapper.insert(tradingBoxFees);
|
|
|
} else {
|
|
|
tradingBoxFees.setUpdateUser(AuthUtil.getUserId());
|
|
|
@@ -922,6 +938,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
|
|
|
archives.setBoxSource("租入");
|
|
|
archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
|
|
|
archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
|
|
|
+ archives.setStatus("待使用");
|
|
|
if (ObjectUtils.isNotNull(archivesR)) {
|
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|