Browse Source

1.调试及修改用箱计划统计接口
2.海运出口保存-箱型箱量计算修改
3.预定舱,客户托书列表检索条件修改
4.海运出口-生成配箱信息默认POD堆场
5.箱池动态-空箱出场接口bug修改
6.批量修改场站,空箱返场模块接口调试及逻辑修改
7.计算POl,POD超期箱使费逻辑修改
8.箱管-海运进出口整体测试

纪新园 6 months ago
parent
commit
aacd1a07f6

+ 9 - 2
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/UseBoxPlanItemExcel.java

@@ -21,7 +21,9 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -98,6 +100,11 @@ public class UseBoxPlanItemExcel implements Serializable {
 	 */
 	@ExcelIgnore
 	private String tenantId;
+	/**
+	 * 所属公司
+	 */
+	@ExcelIgnore
+	private String branchId;
 
 	/**
 	 * 年
@@ -108,12 +115,12 @@ public class UseBoxPlanItemExcel implements Serializable {
 	 * 开始日期
 	 */
 	@ExcelIgnore
-	private Date startDate;
+	private String startDate;
 	/**
 	 * 结束日期
 	 */
 	@ExcelIgnore
-	private Date endDate;
+	private String endDate;
 
 
 }

+ 11 - 2
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/UseBoxPlanItemController.java

@@ -32,6 +32,7 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.box.excel.UseBoxPlanItemExcel;
+import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.excel.RTFDProfitExcel;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -85,17 +86,25 @@ public class UseBoxPlanItemController extends BladeController {
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入useBoxPlanItem")
 	public R<IPage<UseBoxPlanItemExcel>> page(UseBoxPlanItemExcel useBoxPlanItem, Query query) {
+		useBoxPlanItem.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			useBoxPlanItem.setBranchId(AuthUtil.getDeptId());
+		}
 		IPage<UseBoxPlanItemExcel> pages = useBoxPlanItemService.selectUseBoxPlanItemPage(Condition.getPage(query), useBoxPlanItem);
 		return R.data(pages);
 	}
 
 	/**
-	 * 导出 航线利润
+	 * 导出 用箱计划
 	 */
 	@GetMapping("/exportUseBoxPlanItem")
 	public void exportUseBoxPlanItem(UseBoxPlanItemExcel useBoxPlanItem, HttpServletResponse response) {
+		useBoxPlanItem.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			useBoxPlanItem.setBranchId(AuthUtil.getDeptId());
+		}
 		List<UseBoxPlanItemExcel> excelList = useBoxPlanItemService.exportUseBoxPlanItem(useBoxPlanItem);
-		ExcelUtil.export(response, "航线利润", "航线利润", excelList, UseBoxPlanItemExcel.class);
+		ExcelUtil.export(response, "用箱计划", "用箱计划", excelList, UseBoxPlanItemExcel.class);
 	}
 
 	/**

+ 10 - 4
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/UseBoxPlanItemMapper.xml

@@ -30,14 +30,17 @@
         SELECT
         plan.branch_name AS branchName,
         plan.week AS week,
+        plan.year AS year,
+        plan.start_date AS startDate,
+        plan.end_date AS endDate,
         item.branch_name AS podCname,
         item.price20gp AS price20gp,
         item.price40gp AS price40gp,
         item.price40hc AS price40hc,
         item.create_user_name AS createUserName,
-        item.createTime AS createTime,
+        item.create_time AS createTime,
         item.update_user_name AS updateUserName,
-        item.update_time AS updateTime,
+        item.update_time AS updateTime
         FROM
         container_use_box_plan_item item
         LEFT JOIN container_use_box_plan plan ON item.pid = plan.id
@@ -66,14 +69,17 @@
         SELECT
         plan.branch_name AS branchName,
         plan.week AS week,
+        plan.year AS year,
+        plan.start_date AS startDate,
+        plan.end_date AS endDate,
         item.branch_name AS podCname,
         item.price20gp AS price20gp,
         item.price40gp AS price40gp,
         item.price40hc AS price40hc,
         item.create_user_name AS createUserName,
-        item.createTime AS createTime,
+        item.create_time AS createTime,
         item.update_user_name AS updateUserName,
-        item.update_time AS updateTime,
+        item.update_time AS updateTime
         FROM
         container_use_box_plan_item item
         LEFT JOIN container_use_box_plan plan ON item.pid = plan.id

+ 84 - 23
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -679,6 +679,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getBusinessType, "SE")
 				.in(Bills::getMblno, mblno));
 			if (!billsList.isEmpty()) {
 				containersList = containersService.list(new LambdaQueryWrapper<Containers>()
@@ -841,8 +842,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				//放箱号明细数据处理
 				PutBoxItems putBoxItem;
 				if (!putBoxItemsList.isEmpty()) {
-					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()))
-						.findFirst().orElse(null);
+					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
+							e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
 					if (putBoxItem != null) {
 						putBoxItem.setPid(putBoxData.getId());
 						putBoxItem.setMblno(item.getMblno());
@@ -1026,7 +1027,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
 					&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
 					&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
-					"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
+					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())
@@ -1092,8 +1093,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 							.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 								Comparator.comparing(f -> f.getContainerNumber() + f.getCntrNo()))), ArrayList::new));
 						if (!containers.isEmpty()) {
-							long size = containers.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()) &&
-								boxList.contains(e.getCntrNo())).count();
+							long size = containers.stream().filter(e -> ObjectUtils.isNotNull(e.getContainerNumber()) &&
+								e.getContainerNumber().equals(item.getContainerNumber()) && boxList.contains(e.getCntrNo())).count();
 							item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(size + ""));
 							if (item.getOccupyNum() < 0) {
 								throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余操作占用小于本次导入箱数");
@@ -1135,8 +1136,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			if (!putBoxListOld.isEmpty()) {
 				List<PutBox> putBoxListNew = new ArrayList<>();
 				for (PutBox item : putBoxListOld) {
-					if ("OW(放)".equals(item.getBusType()) && ObjectUtils.isNotNull(item.getSrcId())) {
-						PutBox putBox = putBoxList.stream().filter(e -> e.getId().equals(item.getSrcId()) &&
+					if ("OW(放)".equals(item.getBusType()) && ObjectUtils.isNotNull(item.getSrcContainerNumber())) {
+						PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getSrcContainerNumber()) &&
 							!"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
 						if (putBox != null) {
 							item.setThisSuitcaseNum(ObjectUtils.isNull(item.getThisSuitcaseNum()) ? 0 : item.getThisSuitcaseNum());
@@ -1620,12 +1621,22 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			if (ObjectUtils.isNull(overdueProportion) || "获取数据失败".equals(overdueProportion)) {
 				throw new RuntimeException("超期箱使费比例");
 			}
+			BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0)
+				.eq(BCorps::getCode, "ZBYF"));
+			if (bCorps == null) {
+				throw new RuntimeException("基础资料未查到编码为‘ZBYF’往来单位");
+			}
 			for (TradingBoxItem item : tradingBoxItemOldList) {
 				//查找OW明细对应主表
 				TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
 				if (tradingBox == null) {
 					throw new RuntimeException("未查到OW单据");
 				}
+				if ("OW-F".equals(tradingBox.getType())){
+					continue;
+				}
 				//查找OW明细提单号对应海运进出口单据
 				Bills bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblno())).findFirst().orElse(null);
 				if (bills == null) {
@@ -1670,7 +1681,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 							FeeCenter feeCenterC = new FeeCenter();
 							BeanUtil.copyProperties(feeCenter, feeCenterC);
 							feeCenterC.setDc("C");
-							feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion)).setScale(2, RoundingMode.HALF_UP));
+							feeCenter.setCorpType("国内直接客户");
+							feeCenter.setCorpId(bCorps.getId());
+							feeCenter.setCorpCnName(bCorps.getCnName());
+							feeCenter.setCorpEnName(bCorps.getEnName());
+							feeCenter.setShortName(bCorps.getShortName());
+							feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion))
+								.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP));
 							feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
 							feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 							feeCenterList.add(feeCenterC);
@@ -1710,10 +1727,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 								   int overdueDays, String exrateType) {
 		FeeCenter feeCenter = new FeeCenter();
 		feeCenter.setBillType(bills.getBillType());
-		feeCenter.setCorpType("箱东");
-		feeCenter.setCorpId(tradingBox.getPurchaseCompanyId());
-		feeCenter.setCorpCnName(tradingBox.getPurchaseCompanyName());
-		feeCenter.setCorpEnName(tradingBox.getPurchaseCompanyName());
+		feeCenter.setCorpType("国内同行及代理");
+		feeCenter.setCorpId(bills.getCorpId());
+		feeCenter.setCorpCnName(bills.getCorpCnName());
+		feeCenter.setCorpEnName(bills.getCorpEnName());
+		feeCenter.setShortName(bills.getShortName());
 		feeCenter.setCreateTime(new Date());
 		feeCenter.setCreateUser(AuthUtil.getUserId());
 		feeCenter.setCreateUserName(AuthUtil.getUserName());
@@ -2914,7 +2932,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (containersHYJKList.isEmpty()) {
 			throw new RuntimeException("未查到配箱信息");
 		}
-		if ("HYJK".equals(podStationR.getBusinessType())) {
+		if ("SI".equals(podStationR.getBusinessType())) {
 			List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
 				.collect(Collectors.toList());
 			if (boxNum.isEmpty()) {
@@ -2979,28 +2997,28 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			if (businessType == null) {
 				throw new RuntimeException("未找到可用业务类型");
 			}
-			List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+			List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
 				.in(Bills::getId, billsIds));
-			if (billsHYJKList.isEmpty()) {
+			if (billsHYJKListFD.isEmpty()) {
 				throw new RuntimeException("未查到海运进口单据");
 			}
 			List<Long> idHYJKList = new ArrayList<>();
-			List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+			List<Bills> billsHYJKListZD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 				.eq(Bills::getTenantId, AuthUtil.getTenantId())
 				.eq(Bills::getIsDeleted, 0)
-				.in(Bills::getMasterId, billsIds));
-			if (!billsHYJKListFD.isEmpty()) {
+				.in(Bills::getMasterId, billsHYJKListFD.stream().map(Bills::getMasterId).collect(Collectors.toList())));
+			if (!billsHYJKListZD.isEmpty()) {
 				idHYJKList.addAll(billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList()));
 			}
-			List<Containers> containersHYJKListFD = containersService.list(new LambdaQueryWrapper<Containers>()
+			List<Containers> containersHYJKListZD = containersService.list(new LambdaQueryWrapper<Containers>()
 				.eq(Containers::getTenantId, AuthUtil.getTenantId())
 				.eq(Containers::getIsDeleted, 0)
 				.in(Containers::getPid, idHYJKList)
 				.in(Containers::getCntrNo, boxNum));
 			List<Containers> containersListNew = new ArrayList<>();
-			for (Bills billsHYJK : billsHYJKList){
+			for (Bills billsHYJK : billsHYJKListFD){
 				//目的港生成新放箱号单据
 				List<PutBox> putBoxNewList = new ArrayList<>();
 				//目的港生成新放箱号单据明细数据
@@ -3025,8 +3043,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					item.setUpdateUserName(AuthUtil.getUserName());
 					containersListNew.add(item);
 					//进口分单配箱信息处理
-					if (!containersHYJKListFD.isEmpty()) {
-						Containers containers = containersHYJKListFD.stream().filter(e -> e.getCntrNo().equals(item.getCntrNo()))
+					if (!containersHYJKListZD.isEmpty()) {
+						Containers containers = containersHYJKListZD.stream().filter(e -> e.getCntrNo().equals(item.getCntrNo()))
 							.findFirst().orElse(null);
 						if (containers != null) {
 							containers.setPodStationId(podStationR.getPodStationId());
@@ -3456,6 +3474,36 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				item.setUpdateUserName(AuthUtil.getUserName());
 			}
 			containersService.updateBatchById(containersHYJKList);
+			List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getId, billsIds));
+			if (billsHYJKList.isEmpty()) {
+				throw new RuntimeException("未查到海运出口单据");
+			}
+			List<Long> idHYJKList = billsHYJKList.stream().map(Bills::getMasterId).distinct().collect(Collectors.toList());
+			List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getId, idHYJKList));
+			if (!billsHYJKListFD.isEmpty()) {
+				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.in(Containers::getPid, billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList())));
+				if (!containersList.isEmpty()) {
+					for (Containers item : containersList) {
+						item.setPodStationId(podStationR.getPodStationId());
+						item.setPodStationCname(podStationR.getPodStationCname());
+						item.setPodStationEname(podStationR.getPodStationEname());
+						item.setPodStationCode(podStationR.getPodStationCode());
+						item.setUpdateTime(new Date());
+						item.setUpdateUser(AuthUtil.getUserId());
+						item.setUpdateUserName(AuthUtil.getUserName());
+					}
+					containersService.updateBatchById(containersList);
+				}
+			}
 		}
 		return R.data("操作成功");
 	}
@@ -5019,6 +5067,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (ObjectUtils.isNull(overdueProportion) || "获取数据失败".equals(overdueProportion)) {
 			throw new RuntimeException("超期箱使费比例");
 		}
+		BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
+			.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+			.eq(BCorps::getIsDeleted, 0)
+			.eq(BCorps::getCode, "ZBYF"));
+		if (bCorps == null) {
+			throw new RuntimeException("基础资料未查到编码为‘ZBYF’往来单位");
+		}
 		for (TradingBoxItem item : tradingBoxItemOldList) {
 			//查找OW明细对应主表
 			TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
@@ -5059,7 +5114,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						FeeCenter feeCenterC = new FeeCenter();
 						BeanUtil.copyProperties(feeCenter, feeCenterC);
 						feeCenterC.setDc("C");
-						feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion)).setScale(2, RoundingMode.HALF_UP));
+						feeCenterC.setCorpType("国内直接客户");
+						feeCenterC.setCorpId(bCorps.getId());
+						feeCenterC.setCorpCnName(bCorps.getCnName());
+						feeCenterC.setCorpEnName(bCorps.getEnName());
+						feeCenterC.setShortName(bCorps.getShortName());
+						feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion))
+							.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP));
 						feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
 						feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 						feeCenterList.add(feeCenterC);

+ 20 - 6
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BookingCabinController.java

@@ -78,13 +78,15 @@ public class BookingCabinController extends BladeController {
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getBusinessType, bills.getBusinessType())
 			.like(ObjectUtils.isNotNull(bills.getBillNo()), Bills::getBillNo, bills.getBillNo())
+			.like(ObjectUtils.isNotNull(bills.getMblno()), Bills::getMblno, bills.getMblno())
+			.like(ObjectUtils.isNotNull(bills.getHblno()), Bills::getHblno, bills.getHblno())
 			.like(ObjectUtils.isNotNull(bills.getBookingNo()), Bills::getBookingNo, bills.getBookingNo())
 			.and(ObjectUtils.isNotNull(bills.getCorpCnName()), i -> i.like(Bills::getCorpCnName, bills.getCorpCnName()).or()
 				.like(Bills::getCorpEnName, bills.getCorpCnName()))
 			.and(ObjectUtils.isNotNull(bills.getCarrierCnName()), i -> i.like(Bills::getCarrierCnName, bills.getCarrierCnName()).or()
 				.like(Bills::getCarrierEnName, bills.getCarrierCnName()).or().like(Bills::getCarrierArgreementNo, bills.getCarrierCnName()))
-			.and(ObjectUtils.isNotNull(bills.getPodCnName()), i -> i.like(Bills::getPodCnName, bills.getPodCnName()).or()
-				.like(Bills::getPodEnName, bills.getPodCnName()).or().like(Bills::getPodCode, bills.getPodCnName()))
+			.and(ObjectUtils.isNotNull(bills.getPodEnName()), i -> i.like(Bills::getPodCnName, bills.getPodEnName()).or()
+				.like(Bills::getPodEnName, bills.getPodEnName()).or().like(Bills::getPodCode, bills.getPodEnName()))
 			.and(ObjectUtils.isNotNull(bills.getPolEnName()), i -> i.like(Bills::getPolCnName, bills.getPolEnName()).or()
 				.like(Bills::getPolEnName, bills.getPolEnName()).or().like(Bills::getPolCode, bills.getPolEnName()))
 			.and(ObjectUtils.isNotNull(bills.getLineCnName()), i -> i.like(Bills::getLineCnName, bills.getLineCnName()).or()
@@ -119,18 +121,30 @@ public class BookingCabinController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getBusinessType()), Bills::getBusinessType, bills.getBusinessType())
 			.eq(ObjectUtils.isNotNull(bills.getSeaType()), Bills::getSeaType, bills.getSeaType())
 			.eq(ObjectUtils.isNotNull(bills.getStatus()), Bills::getStatus, bills.getStatus())
+			.eq(ObjectUtils.isNotNull(bills.getOperatorId()), Bills::getOperatorId, bills.getOperatorId())
+			.like(ObjectUtils.isNotNull(bills.getOperatorName()), Bills::getOperatorName, bills.getOperatorName())
+			.eq(ObjectUtils.isNotNull(bills.getCustomerServiceId()), Bills::getCustomerServiceId, bills.getCustomerServiceId())
+			.like(ObjectUtils.isNotNull(bills.getCustomerServiceName()), Bills::getCustomerServiceName, bills.getCustomerServiceName())
 			.orderByDesc(Bills::getCreateTime);
 		if (ObjectUtils.isNotNull(bills.getBillStatus())) {
 			if (1 == bills.getBillStatus()) {
-				// todo 录入
+				//录入
+				lambdaQueryWrapper.eq(Bills::getIssueStatus, "0");
 			} else if (2 == bills.getBillStatus()) {
-				// todo 提交
+				//提交
+				lambdaQueryWrapper.eq(Bills::getIssueStatus, "2");
 			} else if (3 == bills.getBillStatus()) {
-				// todo 受理
+				//受理
+				lambdaQueryWrapper.eq(Bills::getIssueStatus, "3");
 			} else if (4 == bills.getBillStatus()) {
-				// todo 待确认
+				//待确认
+				lambdaQueryWrapper.eq(Bills::getIssueStatus, "2");
 			} else if (5 == bills.getBillStatus()) {
+				//已提交
 				lambdaQueryWrapper.eq(Bills::getIssueStatus, "1");
+			} else if (6 == bills.getBillStatus()) {
+				//待审核
+				lambdaQueryWrapper.eq(Bills::getStatus, 0);
 			}
 		}
 		IPage<Bills> pages = billsService.page(Condition.getPage(query), lambdaQueryWrapper);

+ 3 - 6
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java

@@ -14,10 +14,7 @@ import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
 import org.springblade.los.excel.PodStationR;
 import org.springblade.los.excel.UpdatePodStationExcel;
 import org.springblade.los.statisticAnalysis.FeeSummaryRD;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -58,9 +55,9 @@ public class UpdatePodStationController {
 	/**
 	 * 批量修改pod场站信息
 	 */
-	@GetMapping("/batchUpdatePodStation")
+	@PostMapping("/batchUpdatePodStation")
 	@RepeatSubmit
-	public R batchUpdatePodStation(PodStationR podStationR) {
+	public R batchUpdatePodStation(@RequestBody PodStationR podStationR) {
 		return putBoxService.batchUpdatePodStation(podStationR);
 	}
 

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

@@ -90,7 +90,7 @@
         cn.bus_type as busType,
         sc.cntr_no as cntrNo,
         sc.cntr_type_code as cntrTypeCode,
-        sc.pod_station_cname as podStationName,
+        sc.pod_station_cname as podStationCname,
         sc.id as containersId,
         se.id as id,
         se.eta as eta,
@@ -115,6 +115,9 @@
         <if test="data.cntrNo != null and data.cntrNo != ''">
             and sc.cntr_no = #{data.cntrNo}
         </if>
+        <if test="data.podStationCname != null and data.podStationCname != ''">
+            and se.pod_station_cname like concat('%', #{data.podStationCname}, '%')
+        </if>
         <if test="data.mblno != null and data.mblno != ''">
             and se.mblno like concat('%', #{data.mblno}, '%')
         </if>
@@ -128,7 +131,7 @@
             and se.vessel_cn_name like concat('%', #{data.vesselCnName}, '%')
         </if>
         <if test="data.voyageNo != null and data.voyageNo != ''">
-            and se.data.voyage_no like concat('%', #{data.voyageNo}, '%')
+            and se.voyage_no like concat('%', #{data.voyageNo}, '%')
         </if>
         <if test="data.polName != null and data.polName != ''">
             and se.pol_cn_name like concat('%', #{data.polName}, '%')
@@ -136,11 +139,21 @@
         <if test="data.podName != null and data.podName != ''">
             and se.pod_cn_name like concat('%', #{data.podName}, '%')
         </if>
-        <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
-            and se.actual_etd &gt;= #{data.actualEtdList[0]}
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SE'">
+            <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+                and se.etd &gt;= #{data.actualEtdList[0]}
+            </if>
+            <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+                and se.etd &lt;= #{data.actualEtdList[1]}
+            </if>
         </if>
-        <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
-            and se.actual_etd &lt;= #{data.actualEtdList[1]}
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SI'">
+            <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+                and se.eta &gt;= #{data.actualEtdList[0]}
+            </if>
+            <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+                and se.eta &lt;= #{data.actualEtdList[1]}
+            </if>
         </if>
         <if test='data.whether != null and data.whether == "0"'>
             and sc.pod_station_cname is null
@@ -148,6 +161,7 @@
         <if test='data.whether != null and data.whether == "1"'>
             and sc.pod_station_cname is not null
         </if>
+        GROUP BY sc.id
     </select>
     <select id="updatePodStationList" resultType="org.springblade.los.excel.UpdatePodStationExcel">
         SELECT
@@ -163,7 +177,7 @@
         cn.bus_type as busType,
         sc.cntr_no as cntrNo,
         sc.cntr_type_code as cntrTypeCode,
-        sc.pod_station_cname as podStationName,
+        sc.pod_station_cname as podStationCname,
         sc.id as containersId,
         se.id as id,
         se.eta as eta,
@@ -193,11 +207,14 @@
         <if test="data.corpName != null and data.corpName != ''">
             and se.corp_cn_name like concat('%', #{data.corpName}, '%')
         </if>
+        <if test="data.podStationCname != null and data.podStationCname != ''">
+            and se.pod_station_cname like concat('%', #{data.podStationCname}, '%')
+        </if>
         <if test="data.vesselCnName != null and data.vesselCnName != ''">
             and se.vessel_cn_name like concat('%', #{data.vesselCnName}, '%')
         </if>
         <if test="data.voyageNo != null and data.voyageNo != ''">
-            and se.data.voyage_no like concat('%', #{data.voyageNo}, '%')
+            and se.voyage_no like concat('%', #{data.voyageNo}, '%')
         </if>
         <if test="data.polName != null and data.polName != ''">
             and se.pol_cn_name like concat('%', #{data.polName}, '%')
@@ -208,11 +225,21 @@
         <if test="data.billType != null and data.billType != ''">
             and se.bill_type = #{data.billType}
         </if>
-        <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
-            and se.actual_etd &gt;= #{data.actualEtdList[0]}
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SE'">
+            <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+                and se.etd &gt;= #{data.actualEtdList[0]}
+            </if>
+            <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+                and se.etd &lt;= #{data.actualEtdList[1]}
+            </if>
         </if>
-        <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
-            and se.actual_etd &lt;= #{data.actualEtdList[1]}
+        <if test="data.businessType != null and data.businessType != '' and data.businessType == 'SI'">
+            <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+                and se.eta &gt;= #{data.actualEtdList[0]}
+            </if>
+            <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+                and se.eta &lt;= #{data.actualEtdList[1]}
+            </if>
         </if>
         <if test='data.whether != null and data.whether == "0"'>
             and sc.pod_station_cname is null
@@ -220,6 +247,7 @@
         <if test='data.whether != null and data.whether == "1"'>
             and sc.pod_station_cname is not null
         </if>
+        GROUP BY sc.id
     </select>
 
 

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

@@ -37,20 +37,17 @@ import org.springblade.los.Util.ZrUtil;
 import org.springblade.los.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
 import org.springblade.los.basic.corps.entity.BCorps;
-import org.springblade.los.basic.corps.entity.BCorpsAttn;
 import org.springblade.los.basic.corps.mapper.CorpsAttnMapper;
 import org.springblade.los.basic.corps.mapper.CorpsMapper;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.cur.entity.BCurExrate;
 import org.springblade.los.basic.fees.entity.BFees;
 import org.springblade.los.basic.fees.service.IBFeesService;
-import org.springblade.los.basic.vessels.entity.BVessels;
 import org.springblade.los.basic.vessels.mapper.VesselsMapper;
 import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
-import org.springblade.los.business.mktSlot.entity.MktSlotQuotation;
 import org.springblade.los.business.release.entity.SeaReleaseBillItems;
 import org.springblade.los.business.sea.dto.WaitingBox;
 import org.springblade.los.business.sea.entity.*;
@@ -267,9 +264,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setUpdateUser(AuthUtil.getUserId());
 			bills.setUpdateTime(new Date());
 			bills.setUpdateUserName(AuthUtil.getUserName());
-			if (ObjectUtils.isNotNull(bills.getTemporaryId())){
+			if (ObjectUtils.isNotNull(bills.getTemporaryId())) {
 				Bills bills1 = baseMapper.selectById(bills.getTemporaryId());
-				if ("MM".equals(bills.getBillType())){
+				if ("MM".equals(bills.getBillType())) {
 					if (ObjectUtils.isNotNull(bills.getMblno())) {
 						bills1.setMblno(bills.getMblno());
 						bills1.setHblno(bills.getHblno());
@@ -281,7 +278,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						bills1.setCyTrailerTime(bills.getCyTrailerTime());
 						this.updateById(bills1);
 					}
-				}else if ("MH".equals(bills.getBillType())){
+				} else if ("MH".equals(bills.getBillType())) {
 					if (ObjectUtils.isNotNull(bills.getHblno())) {
 						bills1.setMblno(bills.getMblno());
 						bills1.setHblno(bills.getHblno());
@@ -305,92 +302,70 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		Integer other = 0;
 		BigDecimal teu = new BigDecimal("0.00");
 		StringBuilder boxTypeSum = new StringBuilder();
-		if (ObjectUtils.isNull(bills.getCfsQuantity()) || bills.getCfsQuantity().compareTo(new BigDecimal("0.00")) == 0) {
-			if (ObjectUtils.isNotNull(bills.getPreContainersList())) {
-				bills.setCfsMeasurement(new BigDecimal("0.00"));
-				bills.setCfsGrossWeight(new BigDecimal("0.00"));
-				bills.setCfsQuantity(new BigDecimal("0.00"));
-				BigDecimal measurementSum = bills.getPreContainersList().stream().map(PreContainers::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-				BigDecimal grossWeightSum = bills.getPreContainersList().stream().map(PreContainers::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-				BigDecimal quantitySum = bills.getPreContainersList().stream().map(PreContainers::getNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-				if (measurementSum.compareTo(new BigDecimal("0")) != 0) {
-					bills.setMeasurement(measurementSum);
-				}
-				if (grossWeightSum.compareTo(new BigDecimal("0")) != 0) {
-					bills.setGrossWeight(grossWeightSum);
-				}
-				if (quantitySum.compareTo(new BigDecimal("0")) != 0) {
-					bills.setQuantity(quantitySum);
+		if (ObjectUtils.isNotNull(bills.getPreContainersList())) {
+			bills.setTeu(teu.intValue());
+			for (PreContainers item : bills.getPreContainersList()) {
+				if (ObjectUtils.isNull(item.getCntrTypeCode())) {
+					throw new RuntimeException("箱型不能为空");
 				}
-				bills.setTeu(teu.intValue());
-				for (PreContainers item : bills.getPreContainersList()) {
-					if (ObjectUtils.isNull(item.getCntrTypeCode())) {
-						throw new RuntimeException("箱型不能为空");
-					}
-					if (item.getId() == null) {
-						item.setCreateTime(new Date());
-						item.setCreateUser(AuthUtil.getUserId());
-						item.setCreateUserName(AuthUtil.getUserName());
-						if (ObjectUtils.isNotNull(branchId)) {
-							item.setBranchId(branchId);
-							item.setCreateDept(deptId);
-							item.setCreateDeptName(deptName);
-						}
-					} else {
-						item.setUpdateUser(AuthUtil.getUserId());
-						item.setUpdateTime(new Date());
-						item.setUpdateUserName(AuthUtil.getUserName());
-					}
-					item.setPid(bills.getId());
-					if (item.getCntrTypeCode().contains("20")) {
-						V20 += item.getQuantity();
-					} else if (item.getCntrTypeCode().contains("45")) {
-						V45 += item.getQuantity();
-					} else if (item.getCntrTypeCode().contains("48")) {
-						V48 += item.getQuantity();
-					} else if (item.getCntrTypeCode().contains("40")) {
-						V40 += item.getQuantity();
-					} else if (item.getCntrTypeCode().contains("40") && item.getCntrTypeCode().contains("HC")) {
-						V40HC += item.getQuantity();
-					} else {
-						other += item.getQuantity();
-					}
-					boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
-					if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
-						teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(branchId)) {
+						item.setBranchId(branchId);
+						item.setCreateDept(deptId);
+						item.setCreateDeptName(deptName);
 					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
 				}
-				preContainersService.saveOrUpdateBatch(bills.getPreContainersList());
-				List<Long> idList = bills.getPreContainersList().stream().map(PreContainers::getId).collect(Collectors.toList());
-				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
-					.eq(Containers::getPid, idList)
-					.eq(Containers::getTenantId, AuthUtil.getTenantId())
-					.eq(Containers::getIsDeleted, 0));
-				if (!containersList.isEmpty()) {
-					for (Containers item : containersList) {
-						//BoxNumUtils.containerNumberVerification(item.getCntrNo());
-						item.setUpdateUser(AuthUtil.getUserId());
-						item.setUpdateUserName(AuthUtil.getUserName());
-						item.setUpdateTime(new Date());
-						item.setQuantity(new BigDecimal("0"));
-						item.setGrossWeight(new BigDecimal("0"));
-						item.setMeasurement(new BigDecimal("0"));
-						item.setNetWeight(new BigDecimal("0"));
-					}
-					containersService.updateBatchById(containersList);
+				item.setPid(bills.getId());
+				if (item.getCntrTypeCode().contains("20")) {
+					V20 += item.getQuantity();
+				} else if (item.getCntrTypeCode().contains("45")) {
+					V45 += item.getQuantity();
+				} else if (item.getCntrTypeCode().contains("48")) {
+					V48 += item.getQuantity();
+				} else if (item.getCntrTypeCode().contains("40")) {
+					V40 += item.getQuantity();
+				} else if (item.getCntrTypeCode().contains("40") && item.getCntrTypeCode().contains("HC")) {
+					V40HC += item.getQuantity();
+				} else {
+					other += item.getQuantity();
 				}
-				if (boxTypeSum.length() > 0) {
-					boxTypeSum = new StringBuilder(boxTypeSum.substring(0, boxTypeSum.length() - 1));
-					bills.setQuantityCntrDescr(boxTypeSum.toString());
+				boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
+				if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
+					teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
 				}
-				if ("263057".equals(AuthUtil.getTenantId())) {
-					bills.setCommodityDescr(bills.getPreContainersList().stream().map(PreContainers::getGoodsName)
-						.distinct().filter(Objects::nonNull).collect(Collectors.joining(",")));
+			}
+			preContainersService.saveOrUpdateBatch(bills.getPreContainersList());
+			List<Long> idList = bills.getPreContainersList().stream().map(PreContainers::getId).collect(Collectors.toList());
+			List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+				.eq(Containers::getPid, idList)
+				.eq(Containers::getTenantId, AuthUtil.getTenantId())
+				.eq(Containers::getIsDeleted, 0));
+			if (!containersList.isEmpty()) {
+				for (Containers item : containersList) {
+					//BoxNumUtils.containerNumberVerification(item.getCntrNo());
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					item.setUpdateTime(new Date());
+					item.setQuantity(new BigDecimal("0"));
+					item.setGrossWeight(new BigDecimal("0"));
+					item.setMeasurement(new BigDecimal("0"));
+					item.setNetWeight(new BigDecimal("0"));
 				}
+				containersService.updateBatchById(containersList);
+			}
+			if (boxTypeSum.length() > 0) {
+				boxTypeSum = new StringBuilder(boxTypeSum.substring(0, boxTypeSum.length() - 1));
+				bills.setQuantityCntrDescr(boxTypeSum.toString());
 			}
-		} else {
-			bills.setQuantityCntrDescr(null);
 		}
+
 		bills.setQuantityV20(V20);
 		bills.setQuantityV40(V40);
 		bills.setQuantityV40hc(V40HC);
@@ -3132,6 +3107,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (!containersList.isEmpty()) {
 			List<Containers> containersListNew = new ArrayList<>();
 			for (Containers item : containersList) {
+				if (ObjectUtils.isNull(item.getPodStationId())) {
+					throw new RuntimeException("请先维护配箱POD堆场信息");
+				}
 				item.setSrcId(item.getId());
 				item.setId(null);
 				item.setCreateTime(new Date());
@@ -4302,7 +4280,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 				int count = 1;
 				for (PreContainers item : preContainersList) {
-					FeeCenter feeCenter = this.addFeeCenterQuotation(copyBills, "D", count, fees,  item,
+					FeeCenter feeCenter = this.addFeeCenterQuotation(copyBills, "D", count, fees, item,
 						curExrateList, exrateType, "1");
 					if (feeCenter != null) {
 						feeCenter.setUnitNo(item.getCntrTypeCode());
@@ -4310,7 +4288,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						feeCenter.setBranchName(deptName);
 						feeCenters.add(feeCenter);
 					}
-					FeeCenter feeCenterD = this.addFeeCenterQuotation(copyBills, "C", count, feesD,  item,
+					FeeCenter feeCenterD = this.addFeeCenterQuotation(copyBills, "C", count, feesD, item,
 						curExrateList, exrateType, "2");
 					if (feeCenterD != null) {
 						feeCenterD.setUnitNo(item.getCntrTypeCode());
@@ -4897,7 +4875,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			feeCenter.setCorpCnName(bills.getCorpCnName());
 			feeCenter.setCorpEnName(bills.getCorpEnName());
 			feeCenter.setShortName(bills.getShortName());
-			feeCenter.setPrice(items.getSalesPrice());
+			feeCenter.setPrice(items.getOceanFreight());
 		} else if ("2".equals(type)) {
 			BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
 				.eq(BCorps::getTenantId, AuthUtil.getTenantId())

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java

@@ -389,6 +389,10 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 					containers.setPodCode(bills.getPodCode());
 					containers.setPodCnName(bills.getPodCnName());
 					containers.setPodEnName(bills.getPodEnName());
+					containers.setPodStationId(bills.getPodCyId());
+					containers.setPodStationCode(bills.getPodCyCode());
+					containers.setPodStationCname(bills.getPodCyCnName());
+					containers.setPodStationEname(bills.getPodCyEnName());
 					containers.setMblno(bills.getMblno());
 					containers.setHblno(bills.getHblno());
 					containers.setCommodityDescr(bills.getCommodityDescr());