Browse Source

1.箱池动态-出场,返场计算超期箱使费,箱明细代理名称,箱使天数修改
2.pod场站修改,空箱返场查询接口条件修改

纪新园 5 months ago
parent
commit
d9730811bc

+ 25 - 20
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -669,7 +669,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getBusinessType, "SE")
-				.in(Bills::getMblno, mblno));
+				.in(Bills::getHblno, mblno));
 			if (!billsList.isEmpty()) {
 				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
 					.eq(Containers::getTenantId, AuthUtil.getTenantId())
@@ -830,7 +830,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				}
 				Bills bills = null;
 				if (!containersList.isEmpty()) {
-					List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
+					List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
 						&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
 					if (!containerItemList.isEmpty()) {
 						List<Long> billsIds = containerItemList.stream().map(Containers::getPid).distinct().collect(Collectors.toList());
@@ -847,7 +847,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
 					if (putBoxItem != null) {
 						putBoxItem.setPid(putBoxData.getId());
-						putBoxItem.setMblno(item.getMblno());
+						putBoxItem.setMblno(bills.getMblno());
 						putBoxItem.setBoxDynamics("空箱出场");
 						putBoxItem.setPolCyId(corps.getId());
 						putBoxItem.setPolCyCode(corps.getCode());
@@ -858,6 +858,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						putBoxItem.setHblno(bills.getHblno());
 						putBoxItem.setVoyage(bills.getVoyageNo());
 						putBoxItem.setShipNameId(bills.getVesselId());
+						putBoxItem.setAgentName(bills.getForeignAgencyCnName());
 						putBoxItem.setShipCname(bills.getVesselCnName());
 						putBoxItem.setShipEname(bills.getVesselEnName());
 						putBoxItem.setPolFreeBoxUseDays(bills.getPolFreeBoxUseDays());
@@ -873,9 +874,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						putBoxItem.setStatus("使用中");
 						putBoxItem.setPid(putBoxData.getId());
 						putBoxItem.setContainerNumber(item.getContainerNumber());
+						putBoxItem.setAgentName(bills.getForeignAgencyCnName());
 						putBoxItem.setBoxCode(item.getBoxCode());
 						putBoxItem.setBoxType(item.getBoxType());
-						putBoxItem.setMblno(item.getMblno());
+						putBoxItem.setMblno(bills.getMblno());
 						putBoxItem.setBoxDynamics("空箱出场");
 						putBoxItem.setPolCyId(corps.getId());
 						putBoxItem.setPolCyCode(corps.getCode());
@@ -903,12 +905,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBoxItem.setContainerNumber(item.getContainerNumber());
 					putBoxItem.setBoxCode(item.getBoxCode());
 					putBoxItem.setBoxType(item.getBoxType());
-					putBoxItem.setMblno(item.getMblno());
+					putBoxItem.setMblno(bills.getMblno());
 					putBoxItem.setBoxDynamics("空箱出场");
 					putBoxItem.setPolCyId(corps.getId());
 					putBoxItem.setPolCyCode(corps.getCode());
 					putBoxItem.setPolCyCname(corps.getCnName());
 					putBoxItem.setPolCyEname(corps.getEnName());
+					putBoxItem.setAgentName(bills.getForeignAgencyCnName());
 					putBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 					putBoxItem.setCorpId(bills.getCorpId());
 					putBoxItem.setCorpName(bills.getCorpCnName());
@@ -943,7 +946,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									.findFirst().orElse(null);
 								if (tradingBoxItem != null) {
 									tradingBoxItem.setPid(tradingBox.getId());
-									tradingBoxItem.setMblno(item.getMblno());
+									tradingBoxItem.setMblno(bills.getMblno());
 									tradingBoxItem.setBoxDynamics("空箱出场");
 									tradingBoxItem.setPortId(ports.getId());
 									tradingBoxItem.setPortCode(ports.getCode());
@@ -957,6 +960,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									tradingBoxItem.setPolCyCode(corps.getCode());
 									tradingBoxItem.setPolCyCname(corps.getCnName());
 									tradingBoxItem.setPolCyEname(corps.getEnName());
+									tradingBoxItem.setAgentName(bills.getForeignAgencyCnName());
 									if (ObjectUtils.isNotNull(item.getBoxStatusDate())) {
 										tradingBoxItem.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
 									} else {
@@ -984,9 +988,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 									tradingBoxItem.setBoxCondition("新");
 									tradingBoxItem.setBoxStatus("好");
 									tradingBoxItem.setPid(tradingBox.getId());
+									tradingBoxItem.setAgentName(bills.getForeignAgencyCnName());
 									tradingBoxItem.setContainerNumber(item.getContainerNumber());
 									tradingBoxItem.setCode(item.getBoxCode());
-									tradingBoxItem.setMblno(item.getMblno());
+									tradingBoxItem.setMblno(bills.getMblno());
 									tradingBoxItem.setBoxDynamics("空箱出场");
 									tradingBoxItem.setBoxType(cntrTypes.getCnName());
 									tradingBoxItem.setBoxTypeId(cntrTypes.getId());
@@ -1032,7 +1037,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 								tradingBoxItem.setPid(tradingBox.getId());
 								tradingBoxItem.setContainerNumber(item.getContainerNumber());
 								tradingBoxItem.setCode(item.getBoxCode());
-								tradingBoxItem.setMblno(item.getMblno());
+								tradingBoxItem.setMblno(bills.getMblno());
 								tradingBoxItem.setBoxDynamics("空箱出场");
 								tradingBoxItem.setBoxType(cntrTypes.getCnName());
 								tradingBoxItem.setBoxTypeId(cntrTypes.getId());
@@ -1041,6 +1046,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 								tradingBoxItem.setPortCname(ports.getCnName());
 								tradingBoxItem.setPortEname(ports.getEnName());
 								tradingBoxItem.setStationId(corps.getId());
+								tradingBoxItem.setAgentName(bills.getForeignAgencyCnName());
 								tradingBoxItem.setStationCode(corps.getCode());
 								tradingBoxItem.setStationCname(corps.getCnName());
 								tradingBoxItem.setStationEname(corps.getEnName());
@@ -1085,7 +1091,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBoxData.getBusType().equals(e.getBusType())).findFirst().orElse(null);
 				if (putBox1 != null) {*/
 					if (!containersList.isEmpty()) {
-						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
+						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
 							&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
 						for (Containers containers : containerItemList) {
 							containers.setPodStationId(corps.getId());
@@ -1648,10 +1654,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
-				.in(Bills::getMblno, mblnoList)
-				.eq(Bills::getBusinessType, "SE")
-				.apply("find_in_set(bill_type,'DD,MH')")
-			);
+				.in(Bills::getHblno, mblnoList)
+				.eq(Bills::getBusinessType, "SE"));
 			if (billsList.isEmpty()) {
 				throw new RuntimeException("未查到对应提单号海运进出口单据");
 			}
@@ -1702,7 +1706,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					throw new RuntimeException("箱号未在配箱信息中查到");
 				}
 				//查找OW明细提单号对应海运进出口单据
-				Bills bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblno()) && e.getId().equals(containers.getPid()))
+				Bills bills = billsList.stream().filter(e -> e.getHblno().equals(item.getMblno()) && e.getId().equals(containers.getPid()))
 					.findFirst().orElse(null);
 				if (bills == null) {
 					throw new RuntimeException("未查到提单号:" + item.getMblno() + "海运进出口单据");
@@ -1711,7 +1715,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
 				//对应海运进出口单据所属公司所有币别
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
-				Date polPickUpDate = item.getPolPickUpDate();
+				Date polPickUpDate = item.getPolStationEmptyContainerExitDate();
 				//起运港超期天数
 				if (ObjectUtils.isNotNull(polPickUpDate) && ObjectUtils.isNotNull(bills.getEtd())) {
 					//所属公司具体超期标准
@@ -1752,8 +1756,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 							feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
 							feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 							feeCenterList.add(feeCenterC);
+							item.setPolOverdueBoxUseDays(Integer.parseInt(days + ""));
 						}
-						item.setPodBoxUseDays(Integer.parseInt(days + ""));
 						putBoxItemsList.add(item);
 						if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 							TradingBoxItem tradingBoxItem = tradingBoxItemOldList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
@@ -1907,6 +1911,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		feeCenter.setBillCorpEnName(bills.getCorpEnName());
 		feeCenter.setBillShortName(bills.getCorpShortName());
 		feeCenter.setMblno(bills.getMblno());
+		feeCenter.setHblno(bills.getHblno());
 		feeCenter.setPolId(bills.getPolId());
 		feeCenter.setPolCode(bills.getPolCode());
 		feeCenter.setPolCnName(bills.getPolCnName());
@@ -3918,7 +3923,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.eq(Bills::getBusinessType, "SE")
-				.in(Bills::getMblno, mblno));
+				.in(Bills::getHblno, mblno));
 			if (!billsList.isEmpty()) {
 				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
 					.eq(Containers::getTenantId, AuthUtil.getTenantId())
@@ -4075,7 +4080,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
 					if (putBox1 == null) {*/
 					if (!containersList.isEmpty()) {
-						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
+						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
 							&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
 						if (containerItemList.isEmpty()) {
 							analysis.setResult("失败");
@@ -5257,7 +5262,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					throw new RuntimeException("请先维护基础资料-超期标准");
 				}
 				LocalDateTime ldt1 = item.getPodEmptyContainerReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
-				LocalDateTime ldt2 = billsHYJK.getEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+				LocalDateTime ldt2 = billsHYJK.getActualEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 				long days = ChronoUnit.DAYS.between(ldt2, ldt1);
 				//超期天数
 				int overdueDays = 0;
@@ -5282,8 +5287,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
 						feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 						feeCenterList.add(feeCenterC);
+						item.setPodBoxUseDays(Integer.parseInt(days + ""));
 					}
-					item.setPodBoxUseDays(Integer.parseInt(days + ""));
 					putBoxItemsList.add(item);
 					if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 						TradingBoxItem tradingBoxItem = tradingBoxItemOldList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);

+ 4 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.xml

@@ -165,10 +165,10 @@
             </if>
         </if>
         <if test='data.whether != null and data.whether != "" and data.whether == "0"'>
-            and sc.pod_station_id is null
+            and (sc.pod_station_id is null or sc.pod_station_id = 0)
         </if>
         <if test='data.whether != null and data.whether != ""  and data.whether == "1"'>
-            and sc.pod_station_id is not null
+            and sc.pod_station_id is not null  and sc.pod_station_id > 0
         </if>
         GROUP BY sc.id
     </select>
@@ -261,10 +261,10 @@
             </if>
         </if>
         <if test='data.whether != null and data.whether != "" and data.whether == "0"'>
-            and sc.pod_station_id is null
+            and (sc.pod_station_id is null or sc.pod_station_id = 0)
         </if>
         <if test='data.whether != null and data.whether != ""  and data.whether == "1"'>
-            and sc.pod_station_id is not null
+            and sc.pod_station_id is not null  and sc.pod_station_id > 0
         </if>
         GROUP BY sc.id
     </select>

+ 6 - 43
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -44,6 +44,8 @@ import org.springblade.los.basic.fees.entity.BFees;
 import org.springblade.los.basic.fees.service.IBFeesService;
 import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
+import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
 import org.springblade.los.business.release.entity.SeaReleaseBillItems;
@@ -144,6 +146,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 	private final IBCorpsService bCorpsService;
 
+	private final AmendsMapper amendsMapper;
+
 	@Override
 	public IPage<BillsVO> selectBillsPage(IPage<BillsVO> page, BillsVO bills) {
 		return page.setRecords(baseMapper.selectBillsPage(page, bills));
@@ -998,6 +1002,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 							item.setEtd(bill.getEtd());
 							item.setEta(bill.getEta());
 							item.setBillDate(bill.getBillDate());
+							item.setBusinessDate(bill.getBillDate());
 							item.setVesselId(bill.getVesselId());
 							item.setVesselCnName(bill.getVesselCnName());
 							item.setVesselEnName(bill.getVesselEnName());
@@ -1118,21 +1123,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			.eq(FeeCenter::getPid, detail.getId())
 			.eq(FeeCenter::getDc, "D")
 		));
-		/*List<Amends> amendsList = amendsMapper.selectList(new LambdaQueryWrapper<Amends>()
+		List<Amends> amendsList = amendsMapper.selectList(new LambdaQueryWrapper<Amends>()
 			.eq(Amends::getTenantId, AuthUtil.getTenantId())
 			.eq(Amends::getIsDeleted, 0)
 			.eq(Amends::getStatus, 3)
 			.eq(Amends::getOrigId, detail.getId()));
-		BigDecimal amountDr = new BigDecimal("0.00");
-		BigDecimal amountCr = new BigDecimal("0.00");
-		BigDecimal amountProfit;
-		BigDecimal amountDrUsd = new BigDecimal("0.00");
-		BigDecimal amountCrUsd = new BigDecimal("0.00");
-		BigDecimal amountProfitUsd;
-		BigDecimal amountDrLoc = new BigDecimal("0.00");
-		BigDecimal amountCrLoc = new BigDecimal("0.00");
-		BigDecimal amountProfitLoc;
-		String exrateType = currencyUtils.standardCurrency(detail.getBranchId());
 		if (!amendsList.isEmpty()) {
 			List<Long> ids = amendsList.stream().map(Amends::getId).distinct().collect(Collectors.toList());
 			List<FeeCenter> feeCenterAmendList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
@@ -1140,41 +1135,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.in(FeeCenter::getPid, ids));
 			detail.setFeeCenterAmendList(feeCenterAmendList.isEmpty() ? new ArrayList<>() : feeCenterAmendList);
-			for (FeeCenter item : feeCenterAmendList) {
-				if ("D".equals(item.getDc())) {
-					if (exrateType.equals(item.getCurCode())) {
-						amountDr = amountDr.add(item.getAmount());
-						amountDrLoc = amountDrLoc.add(item.getAmount());
-					} else {
-						amountDrUsd = amountDrUsd.add(item.getAmount());
-						amountDrLoc = amountDrLoc.add(item.getAmount().multiply(item.getExrate()));
-					}
-				} else {
-					if (exrateType.equals(item.getCurCode())) {
-						amountCr = amountCr.add(item.getAmount());
-						amountCrLoc = amountCrLoc.add(item.getAmount());
-					} else {
-						amountCrUsd = amountCrUsd.add(item.getAmount());
-						amountCrLoc = amountCrLoc.add(item.getAmount().multiply(item.getExrate()));
-					}
-				}
-			}
 		} else {
 			detail.setFeeCenterAmendList(new ArrayList<>());
 		}
-		amountProfit = amountDr.subtract(amountCr);
-		amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
-		amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
-		detail.setAmountDrAmend(amountDr);
-		detail.setAmountCrAmend(amountCr);
-		detail.setAmountProfitAmend(amountProfit);
-		detail.setAmountDrUsdAmend(amountDrUsd);
-		detail.setAmountCrUsdAmend(amountCrUsd);
-		detail.setAmountProfitUsdAmend(amountProfitUsd);
-		detail.setAmountDrLocAmend(amountDrLoc);
-		detail.setAmountCrLocAmend(amountCrLoc);
-		detail.setAmountProfitLocAmend(amountProfitLoc);*/
-		detail.setFeeCenterAmendList(new ArrayList<>());
 		return detail;
 	}