Browse Source

1.报表打印增加字段
2.调箱进场增加判断是否同港口调拨
3.放箱号类型统一
4.主单提取成本接口新计算逻辑修改

纪新园 1 week ago
parent
commit
16661bd176

+ 7 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -1558,7 +1558,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					count++;
 					if (ObjectUtils.isNotNull(item.getCntrNo()) || ObjectUtils.isNotNull(item.getSealNo())) {
 						cntrSealNo.append(item.getCntrNo()).append("  ").append(item.getSealNo()).append("  ");
-						cntrSealNo.append(item.getCntrNo()).append("  ").append(item.getSealNo()).append("<br/>");
+						cntrSealNos.append(item.getCntrNo()).append("  ").append(item.getSealNo()).append("<br/>");
 					}
 				}
 				bills.setCntryString(text.toString());
@@ -1749,12 +1749,15 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					.eq(Containers::getIsDeleted, 0)
 					.eq(Containers::getPid, bills.getId()));
 				StringBuilder cntrSealNo = new StringBuilder();
+				StringBuilder cntrSealNos = new StringBuilder();
 				for (Containers item : containersList) {
 					if (ObjectUtils.isNotNull(item.getCntrNo()) || ObjectUtils.isNotNull(item.getSealNo())) {
 						cntrSealNo.append(item.getCntrNo()).append("/").append(item.getSealNo()).append("<br/>");
+						cntrSealNos.append(item.getCntrNo()).append("/").append(item.getSealNo()).append("<br/>");
 					}
 				}
 				bills.setCntrSealNo(cntrSealNo.toString());
+				bills.setCntrSealNos(cntrSealNos.toString());
 				bills.setDept(dept);
 				map.put(MagicValues.DATA, bills);
 			} else {
@@ -1846,12 +1849,15 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					.eq(Containers::getIsDeleted, 0)
 					.eq(Containers::getPid, bills.getId()));
 				StringBuilder cntrSealNo = new StringBuilder();
+				StringBuilder cntrSealNos = new StringBuilder();
 				for (Containers item : containersList) {
 					if (ObjectUtils.isNotNull(item.getCntrNo()) || ObjectUtils.isNotNull(item.getSealNo())) {
 						cntrSealNo.append(item.getCntrNo()).append("/").append(item.getSealNo()).append("<br/>");
+						cntrSealNos.append(item.getCntrNo()).append("/").append(item.getSealNo()).append("<br/>");
 					}
 				}
 				bills.setCntrSealNo(cntrSealNo.toString());
+				bills.setCntrSealNos(cntrSealNos.toString());
 				map.put(MagicValues.DATA, bills);
 			} else {
 				map.put(MagicValues.DATA, null);

+ 72 - 65
blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java

@@ -1438,61 +1438,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						} else {
 							putBoxes.add(putBox);
 						}
-						//箱档案数据处理
-						Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
-						if (archives != null) {
-							archives.setContainerNumberOw(item.getContainerNumber());
-							archives.setContainerNumberTypeOw(putBox.getBusType());
-							if (!archives.getTypeName().equals(item.getBoxType())) {
-								throw new RuntimeException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
-							}
-							archives.setBoxStatus(item.getBoxStatus());
-							archives.setUpdateTime(new Date());
-							archives.setUpdateUser(AuthUtil.getUserId());
-							archives.setUpdateUserName(AuthUtil.getUserName());
-							archives.setStatus("待使用");
-							archives.setNewDate(item.getApproachExitDate());
-							archives.setBoxDynamics("调箱进场");
-							archives.setWhetherTransfer("1");
-							archives.setAddressId(item.getPortId());
-							archives.setAddressCode(item.getPortCode());
-							archives.setAddressCname(item.getPortCname());
-							archives.setAddressEname(item.getPortEname());
-							archives.setStationId(item.getStationId());
-							archives.setStationCode(item.getStationCode());
-							archives.setStationCname(item.getStationCname());
-							archives.setStationEname(item.getStationEname());
-						} else {
-							if (!"OW(拿)".equals(putBox.getBusType())) {
-								throw new RuntimeException("箱档案中未查到箱号:" + item.getBoxCode());
-							}
-							archives = new Archives();
-							archives.setCode(item.getBoxCode());
-							archives.setCreateTime(new Date());
-							archives.setCreateUser(AuthUtil.getUserId());
-							archives.setCreateUserName(AuthUtil.getUserName());
-							archives.setStatus("待使用");
-							archives.setBoxStatus(item.getBoxStatus());
-							archives.setNewDate(item.getApproachExitDate());
-							archives.setBoxDynamics("调箱进场");
-							archives.setWhetherTransfer("1");
-							archives.setBoxBelongsTo("SOC");
-							archives.setContainerNumber(item.getContainerNumber());
-							archives.setContainerNumberType(putBox.getBusType());
-							archives.setContainerNumberOw(item.getContainerNumber());
-							archives.setContainerNumberTypeOw(putBox.getBusType());
-							archives.setTypeName(item.getBoxType());
-							archives.setBoxType(putBox.getBusType());
-							archives.setAddressId(item.getPortId());
-							archives.setAddressCode(item.getPortCode());
-							archives.setAddressCname(item.getPortCname());
-							archives.setAddressEname(item.getPortEname());
-							archives.setStationId(item.getStationId());
-							archives.setStationCode(item.getStationCode());
-							archives.setStationCname(item.getStationCname());
-							archives.setStationEname(item.getStationEname());
-						}
-						archivesArrayList.add(archives);
 						if (ObjectUtils.isNotNull(putBox.getBoxType()) && !putBox.getBoxType().equals(item.getBoxType())) {
 							throw new RuntimeException("放箱号:" + item.getContainerNumber() + "箱型不符合");
 						}
@@ -1558,10 +1503,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							putBoxItem.setBoxEastName(putBox.getBoxEastName());
 						}
 						putBoxItems.add(putBoxItem);
+						boolean samePort = true;
 						if (!tradingBoxList.isEmpty()) {
 							TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
 								.findFirst().orElse(null);
 							if (tradingBox != null) {
+								if (tradingBox.getPolId().equals(tradingBox.getPodId())){
+									samePort = false;
+								}
 								if (!tradingBoxes.isEmpty()) {
 									if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
 										tradingBoxes.add(tradingBox);
@@ -1606,7 +1555,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 										} else if ("OW-F".equals(tradingBox.getType())) {
 											tradingBoxItem.setBoxCategory("OW(放)");
 										}
-//										putBoxItem.setBoxClass(putBox.getBusType());
+										tradingBoxItem.setBoxSource(putBox.getBusType());
 										tradingBoxItem.setBoxCondition("新");
 										tradingBoxItem.setBoxStatus(item.getBoxStatus());
 										tradingBoxItem.setPid(tradingBox.getId());
@@ -1645,6 +1594,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 									} else if ("OW-F".equals(tradingBox.getType())) {
 										tradingBoxItem.setBoxCategory("OW(放)");
 									}
+									tradingBoxItem.setBoxSource(putBox.getBusType());
 									tradingBoxItem.setBoxBelongsTo("SOC");
 									tradingBoxItem.setBoxCondition("新");
 									tradingBoxItem.setBoxStatus(item.getBoxStatus());
@@ -1681,11 +1631,70 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 								tradingBoxItem.setBoxEastName(tradingBox.getPurchaseCompanyName());
 								tradingBoxItems.add(tradingBoxItem);
 							} else {
-								throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
+								throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到调箱单据");
 							}
 						} else {
-							throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
+							throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到调箱单据");
+						}
+						//箱档案数据处理
+						Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
+						if (archives != null) {
+							archives.setContainerNumberOw(item.getContainerNumber());
+							archives.setContainerNumberTypeOw(putBox.getBusType());
+							if (!archives.getTypeName().equals(item.getBoxType())) {
+								throw new RuntimeException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
+							}
+							archives.setBoxStatus(item.getBoxStatus());
+							archives.setUpdateTime(new Date());
+							archives.setUpdateUser(AuthUtil.getUserId());
+							archives.setUpdateUserName(AuthUtil.getUserName());
+							archives.setStatus("待使用");
+							archives.setNewDate(item.getApproachExitDate());
+							archives.setBoxDynamics("调箱进场");
+							if (samePort){
+								archives.setWhetherTransfer("1");
+							}
+							archives.setAddressId(item.getPortId());
+							archives.setAddressCode(item.getPortCode());
+							archives.setAddressCname(item.getPortCname());
+							archives.setAddressEname(item.getPortEname());
+							archives.setStationId(item.getStationId());
+							archives.setStationCode(item.getStationCode());
+							archives.setStationCname(item.getStationCname());
+							archives.setStationEname(item.getStationEname());
+						} else {
+							if (!"OW(拿)".equals(putBox.getBusType())) {
+								throw new RuntimeException("箱档案中未查到箱号:" + item.getBoxCode());
+							}
+							archives = new Archives();
+							archives.setCode(item.getBoxCode());
+							archives.setCreateTime(new Date());
+							archives.setCreateUser(AuthUtil.getUserId());
+							archives.setCreateUserName(AuthUtil.getUserName());
+							archives.setStatus("待使用");
+							archives.setBoxStatus(item.getBoxStatus());
+							archives.setNewDate(item.getApproachExitDate());
+							archives.setBoxDynamics("调箱进场");
+							if (samePort){
+								archives.setWhetherTransfer("1");
+							}
+							archives.setBoxBelongsTo("SOC");
+							archives.setContainerNumber(item.getContainerNumber());
+							archives.setContainerNumberType(putBox.getBusType());
+							archives.setContainerNumberOw(item.getContainerNumber());
+							archives.setContainerNumberTypeOw(putBox.getBusType());
+							archives.setTypeName(item.getBoxType());
+							archives.setBoxType(putBox.getBusType());
+							archives.setAddressId(item.getPortId());
+							archives.setAddressCode(item.getPortCode());
+							archives.setAddressCname(item.getPortCname());
+							archives.setAddressEname(item.getPortEname());
+							archives.setStationId(item.getStationId());
+							archives.setStationCode(item.getStationCode());
+							archives.setStationCname(item.getStationCname());
+							archives.setStationEname(item.getStationEname());
 						}
+						archivesArrayList.add(archives);
 					} else {
 						throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
 					}
@@ -1725,7 +1734,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						if (!tradingBoxes.isEmpty()) {
 							TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
 							if (tradingBox != null) {
-								long count1 = 0;
+								long count1;
 								if (ObjectUtils.isNotNull(tradingBox.getCode())) {
 									count1 = itemsListJC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()) &&
 										!tradingBox.getCode().contains(e.getBoxCode())).count();
@@ -1745,10 +1754,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 									tradingBox.setCode(itemsListZJ.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
 										.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
 								}
-									tradingBox.setActualBoxNumber(tradingBox.getSuitcaseNum() + Integer.parseInt(count1 + ""));
-									if (Objects.equals(tradingBox.getActualBoxNumber(), tradingBox.getBoxNumber())){
-										tradingBox.setStatus(1);
-									}
+								tradingBox.setActualBoxNumber(tradingBox.getActualBoxNumber() + Integer.parseInt(count1 + ""));
+								if (Objects.equals(tradingBox.getActualBoxNumber(), tradingBox.getBoxNumber())) {
+									tradingBox.setStatus(1);
+								}
 								tradingBoxMapper.updateById(tradingBox);
 							}
 						}
@@ -1922,7 +1931,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							archives.setStatus("使用中");
 							archives.setNewDate(item.getApproachExitDate());
 							archives.setBoxDynamics("调箱出场");
-							archives.setWhetherTransfer("1");
 							archives.setAddressId(item.getPortId());
 							archives.setAddressCode(item.getPortCode());
 							archives.setAddressCname(item.getPortCname());
@@ -1943,7 +1951,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							archives.setStatus("使用中");
 							archives.setNewDate(item.getApproachExitDate());
 							archives.setBoxDynamics("调箱出场");
-							archives.setWhetherTransfer("1");
 							archives.setBoxBelongsTo("SOC");
 							archives.setContainerNumber(item.getContainerNumber());
 							archives.setContainerNumberType(putBoxData.getBusType());

+ 10 - 5
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -1775,7 +1775,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 							archives1.setLeasingCompany(tradingBox.getPurchaseCompanyName());
 							archives1.setLeaseCommencementDate(tradingBox.getEffectiveDate());
 						} else if ("DL".equals(tradingBox.getType())) {
-							archives1.setBoxSource("代理");
+							archives1.setBoxSource("代理");
 							archives1.setContainerNumberType("代理箱");
 							archives1.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
 							archives1.setLeasingCompany(tradingBox.getPurchaseCompanyName());
@@ -1834,7 +1834,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 						archives1.setLeasingCompany(tradingBox.getPurchaseCompanyName());
 						archives1.setLeaseCommencementDate(tradingBox.getEffectiveDate());
 					} else if ("DL".equals(tradingBox.getType())) {
-						archives1.setBoxSource("代理");
+						archives1.setBoxSource("代理");
 						archives1.setContainerNumberType("代理箱");
 						archives1.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
 						archives1.setLeasingCompany(tradingBox.getPurchaseCompanyName());
@@ -1853,7 +1853,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				} else if ("ZR".equals(tradingBox.getType())) {
 					archivesTrajectory.setStatus("租入");
 				} else if ("DL".equals(tradingBox.getType())) {
-					archivesTrajectory.setStatus("代理");
+					archivesTrajectory.setStatus("代理");
 				}
 				archivesTrajectory.setPortId(detail.getPolId());
 				archivesTrajectory.setPortCode(detail.getPolCode());
@@ -2176,10 +2176,16 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				String code;
 				if ("自有箱".equals(putBoxOld.getBusType())) {
 					code = "FXH-ZY";
+					putBox.setSrcId(tradingBox.getId());
+					putBox.setSrcNo(tradingBox.getSysNo());
 				} else if ("代理箱".equals(putBoxOld.getBusType())) {
 					code = "FXH-DL";
+					putBox.setSrcId(tradingBox.getId());
+					putBox.setSrcNo(tradingBox.getSysNo());
 				} else if ("OW(拿),OW(放)".contains(putBoxOld.getBusType())) {
 					code = "FXH-OW";
+					putBox.setSrcId(putBoxOld.getSrcId());
+					putBox.setSrcNo(putBoxOld.getSrcNo());
 				} else {
 					code = "FXH-ZY";
 				}
@@ -2219,8 +2225,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setBoxType(putBoxOld.getBoxType());
 				putBox.setTotalNum(tradingBox.getBoxNumber());
 				putBox.setRemainingNum(tradingBox.getBoxNumber());
-				putBox.setSrcId(putBoxOld.getSrcId());
-				putBox.setSrcNo(putBoxOld.getSrcNo());
+
 				putBox.setSrcContainerNumber(putBoxOld.getContainerNumber());
 				putBox.setEffectiveStartDate(putBoxOld.getEffectiveStartDate());
 				putBox.setEffectiveEndDate(putBoxOld.getEffectiveEndDate());

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/agency/mapper/AgencyFeeSettingMapper.xml

@@ -61,10 +61,10 @@
         FROM (
         SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
         ) numbers
-        WHERE numbers.n &gt;= 1 + (LENGTH(#{polId}) - LENGTH(REPLACE(#{polId}, ',', '')))
+        WHERE numbers.n &lt;= 1 + (LENGTH(#{polId}) - LENGTH(REPLACE(#{polId}, ',', '')))
         ) input_values
         WHERE FIND_IN_SET(input_values.value, los_agency_fee_setting.pol_id) > 0
-        ) and DATE_FORMAT(validity_period_start,'%Y-%m-%d') &gt;= #{date} and DATE_FORMAT(validity_period_end,'%Y-%m-%d') &lt;= #{date}
+        ) and DATE_FORMAT(validity_period_start,'%Y-%m-%d') &lt;= #{date} and DATE_FORMAT(validity_period_end,'%Y-%m-%d') &gt;= #{date}
         and tenant_id = #{tenantId} and is_deleted = 0
     </select>
 

+ 10 - 7
blade-service/blade-los/src/main/java/org/springblade/los/finance/agency/service/impl/AgencyFeeSettingServiceImpl.java

@@ -137,6 +137,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 			throw new RuntimeException("未查到分单单据信息");
 		}
 		List<Long> fDIdList = billsListFD.stream().map(Bills::getId).collect(Collectors.toList());
+		idList.addAll(fDIdList);
 		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
 			.eq(Containers::getTenantId, AuthUtil.getTenantId())
 			.eq(Containers::getIsDeleted, 0)
@@ -365,7 +366,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 						feeCenterC.setFeeCode(feeCenter.getFeeCode());
 						feeCenterC.setFeeCnName(feeCenter.getFeeCnName());
 						feeCenterC.setFeeEnName(feeCenter.getFeeEnName());
-						feeCenterC.setUnitNo(feeCenter.getUnitNo());
+						feeCenterC.setUnitNo("JOB");
 						feeCenterC.setCurCode(feeCenter.getCurCode());
 						feeCenterC.setExrate(feeCenter.getExrate());
 						feeCenterC.setDc("C");
@@ -407,7 +408,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 										}
 									} else {
 										//非调拨箱
-										if ("代理箱".equals(archives.getBoxType())) {
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getBasicDfSelfOperatedAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {
@@ -430,7 +431,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 								} else {
 									//非自营箱 无需判断是否调拨
 									if ("DF合营".equals(item.getCabinType())) {
-										if ("代理箱".equals(archives.getBoxType())) {
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getBasicDfJointVentureAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {
@@ -450,7 +451,8 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 											}
 										}
 									} else {
-										if ("代理箱".equals(archives.getBoxType())) {
+										//非DF箱
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getBasicOpenCsaAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {
@@ -487,7 +489,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 										}
 									} else {
 										//非调拨箱
-										if ("代理箱".equals(archives.getBoxType())) {
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getNotBasicDfSelfOperatedAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {
@@ -510,7 +512,7 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 								} else {
 									//非自营箱 无需判断是否调拨
 									if ("DF合营".equals(item.getCabinType())) {
-										if ("代理箱".equals(archives.getBoxType())) {
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getNotBasicDfJointVentureAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {
@@ -530,7 +532,8 @@ public class AgencyFeeSettingServiceImpl extends ServiceImpl<AgencyFeeSettingMap
 											}
 										}
 									} else {
-										if ("代理箱".equals(archives.getBoxType())) {
+										//非DF箱
+										if ("代理箱".equals(archives.getContainerNumberType())) {
 											if (new BigDecimal("0.00").compareTo(agencyFeeSetting.getNotBasicOpenCsaAgent()) == 0) {
 												amountPrice = amountPrice.add(price);
 											} else {