Browse Source

1.费用信息增加编号重复判断
2.海运进出口保存同步客户订舱信息增加判断只有出口同步
3.OW拿、放增加提单号,分单号检索条件
4.场站api出场同步接口同步单据信息增加提单号,分单号
5.成本中心增加单独保存主表信息接口
6.决策分析报表打印接口,开船日期为空问题修改及起运,目的港取英文
7.业务利润报表接口增加合计利润等字段

纪新园 1 month ago
parent
commit
67f7817da3

+ 10 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java

@@ -688,6 +688,16 @@ public class TradingBox implements Serializable {
 	 */
 	@ApiModelProperty(value = "放箱号优先等级")
 	private String priorityLevel;
+	/**
+	 * 提单号
+	 */
+	@ApiModelProperty(value = "提单号")
+	private String mblno;
+	/**
+	 * 分单号
+	 */
+	@ApiModelProperty(value = "分单号")
+	private String hblno;
 
 	/**
 	 * 临时数据

+ 27 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceStatisticsReport.java

@@ -1,5 +1,7 @@
 package org.springblade.los.statisticAnalysis;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -59,6 +61,12 @@ public class FinanceStatisticsReport {
 	private BigDecimal realAmountDrUsd;
 	//未收美元
 	private BigDecimal notReceivedDrUsd;
+	//合计应收
+	private BigDecimal amountDrLoc;
+	//实际合计应收
+	private BigDecimal realAmountDrLoc;
+	//实际未收
+	private BigDecimal notReceivedLoc;
 	//应付(CNY)
 	private BigDecimal amountCr;
 	//实付实收(CNY)
@@ -71,10 +79,28 @@ public class FinanceStatisticsReport {
 	private BigDecimal realAmountCrUsd;
 	//未付美元
 	private BigDecimal notReceivedCrUsd;
+	//合计应付
+	private BigDecimal amountCrLoc;
+	//实际合计应付
+	private BigDecimal realAmountCrLoc;
+	//实际未付
+	private BigDecimal notReceivedCrLoc;
 	//人民币利润
 	private BigDecimal amountProfit;
-	//人民币利润
+	//美金利润
 	private BigDecimal amountProfitUsd;
+	//单票利润
+	private BigDecimal amountProfitLoc;
+	//实际单票利润
+	private BigDecimal realAmountProfitLoc;
+	//HKD利润
+	private BigDecimal amountProfitHkd;
+	//VND利润
+	private BigDecimal amountProfitVnd;
+	//SGD利润
+	private BigDecimal amountProfitSgd;
+	//其他利润
+	private BigDecimal amountProfitOther;
 	//应收海运费
 	private BigDecimal oceanFreightDr;
 	//应付海运费

+ 13 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/service/impl/BFeesServiceImpl.java

@@ -79,6 +79,12 @@ public class BFeesServiceImpl extends ServiceImpl<FeesMapper, BFees> implements
 				.eq(BFees::getCnName, bFees.getCnName())) > 0) {
 				throw new RuntimeException("名称已存在");
 			}
+			if (baseMapper.selectCount(new LambdaQueryWrapper<BFees>()
+				.eq(BFees::getTenantId, AuthUtil.getTenantId())
+				.eq(BFees::getIsDeleted, 0)
+				.eq(BFees::getCode, bFees.getCode())) > 0) {
+				throw new RuntimeException("费用编码已存在");
+			}
 			bFees.setCreateDept(deptId);
 			bFees.setCreateDeptName(deptName);
 		} else {
@@ -89,6 +95,13 @@ public class BFeesServiceImpl extends ServiceImpl<FeesMapper, BFees> implements
 				.eq(BFees::getCnName, bFees.getCnName())) > 0) {
 				throw new RuntimeException("名称已存在");
 			}
+			if (baseMapper.selectCount(new LambdaQueryWrapper<BFees>()
+				.eq(BFees::getTenantId, AuthUtil.getTenantId())
+				.eq(BFees::getIsDeleted, 0)
+				.apply("id != " + bFees.getId())
+				.eq(BFees::getCode, bFees.getCode())) > 0) {
+				throw new RuntimeException("费用编码已存在");
+			}
 			bFees.setUpdateUser(AuthUtil.getUserId());
 			bFees.setUpdateTime(new Date());
 			bFees.setUpdateUserName(AuthUtil.getUserName());

+ 37 - 20
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java

@@ -605,8 +605,6 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 	public R getReportDataStatistics(ReportDataStatisticsVO reportDataStatisticsVO) throws ParseException {
 		Map<String, Object> map = new HashMap<>();
 		Map<String, Object> mapData = new HashMap<>();
-		mapData.put("etdStart", reportDataStatisticsVO.getEtdStart());
-		mapData.put("etdEnd", reportDataStatisticsVO.getEtdEnd());
 		mapData.put("user", AuthUtil.getUserName());
 		R<Dept> res = sysClient.getDept(Long.parseLong(AuthUtil.getDeptId()));
 		Dept dept;
@@ -630,6 +628,8 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		if (MagicValues.PAYMENT_DETAILS.equals(reportDataStatisticsVO.getReportCode()) &&
 			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
 			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			mapData.put("etdStart", reportDataStatisticsVO.getEtdStart());
+			mapData.put("etdEnd", reportDataStatisticsVO.getEtdEnd());
 			FeeSummaryQ feeSummaryQ = new FeeSummaryQ();
 			BeanUtil.copyProperties(reportDataStatisticsVO, feeSummaryQ);
 			feeSummaryQ.setTenantId(AuthUtil.getTenantId());
@@ -700,13 +700,13 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 								report.setEtd(formatter.format(bills.getActualEta()));
 							}
 						}
-						if (ObjectUtils.isNotNull(bills.getHblno())){
+						if (ObjectUtils.isNotNull(bills.getHblno())) {
 							report.setHblNo(bills.getHblno());
-						}else{
+						} else {
 							report.setHblNo(bills.getMblno());
 						}
-						report.setPol(bills.getPolCnName());
-						report.setPod(bills.getPodCnName());
+						report.setPol(bills.getPolEnName());
+						report.setPod(bills.getPodEnName());
 						report.setExrate(exrate);
 						report.setQuantityCntrDescr(bills.getQuantityCntrDescr());
 						report.setSalesman(bills.getSrcCnName());
@@ -729,6 +729,8 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		} else if (MagicValues.NOT_PAYMENT_DETAILS.equals(reportDataStatisticsVO.getReportCode()) &&
 			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
 			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			mapData.put("etdStart", reportDataStatisticsVO.getEtdStart());
+			mapData.put("etdEnd", reportDataStatisticsVO.getEtdEnd());
 			FeeSummaryQ feeSummaryQ = new FeeSummaryQ();
 			BeanUtil.copyProperties(reportDataStatisticsVO, feeSummaryQ);
 			feeSummaryQ.setTenantId(AuthUtil.getTenantId());
@@ -809,13 +811,13 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 								report.setEtd(formatter.format(bills.getActualEta()));
 							}
 						}
-						if (ObjectUtils.isNotNull(bills.getHblno())){
+						if (ObjectUtils.isNotNull(bills.getHblno())) {
 							report.setHblNo(bills.getHblno());
-						}else{
+						} else {
 							report.setHblNo(bills.getMblno());
 						}
-						report.setPol(bills.getPolCnName());
-						report.setPod(bills.getPodCnName());
+						report.setPol(bills.getPolEnName());
+						report.setPod(bills.getPodEnName());
 						report.setExrate(exrate);
 						report.setQuantityCntrDescr(bills.getQuantityCntrDescr());
 						report.setSalesman(bills.getSrcCnName());
@@ -838,6 +840,8 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		} else if (MagicValues.OPERATING_PROFIT.equals(reportDataStatisticsVO.getReportCode()) &&
 			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
 			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			mapData.put("etdStart", reportDataStatisticsVO.getStatisticsDateStart());
+			mapData.put("etdEnd", reportDataStatisticsVO.getStatisticsDateEnd());
 			FinanceProfitDtoList financeProfit = new FinanceProfitDtoList();
 			BeanUtil.copyProperties(reportDataStatisticsVO, financeProfit);
 			financeProfit.setTenantId(AuthUtil.getTenantId());
@@ -1021,11 +1025,12 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 					exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
 					report.setEtd(formatter.format(formatter.parse(item.getStatisticsDate())));*/
 				}
-				if (ObjectUtils.isNotNull(item.getHblNo())){
+				if (ObjectUtils.isNotNull(item.getHblNo())) {
 					report.setHblNo(item.getHblNo());
-				}else{
+				} else {
 					report.setHblNo(item.getMblNo());
 				}
+				report.setEtd(item.getStatisticsDate());
 				report.setPol(item.getPol());
 				report.setPod(item.getPod());
 				report.setExrate(exrate);
@@ -1049,6 +1054,18 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 				report.setOceanFreightDr(item.getOceanFreightDr());
 				report.setOceanFreightCr(item.getOceanFreightCr());
 				report.setOceanFreightProfit(item.getOceanFreightProfit());
+				report.setAmountDrLoc(item.getAmountDrLoc());
+				report.setRealAmountDrLoc(item.getRealAmountDrLoc());
+				report.setNotReceivedLoc(item.getNotReceivedLoc());
+				report.setAmountCrLoc(item.getAmountCrLoc());
+				report.setRealAmountCrLoc(item.getRealAmountCrLoc());
+				report.setNotReceivedCrLoc(item.getNotReceivedCrLoc());
+				report.setAmountProfitLoc(item.getAmountProfitLoc());
+				report.setRealAmountProfitLoc(item.getRealAmountProfitLoc());
+				report.setAmountProfitHkd(item.getAmountProfitHkd());
+				report.setAmountProfitVnd(item.getAmountProfitVnd());
+				report.setAmountProfitSgd(item.getAmountProfitSgd());
+				report.setAmountProfitOther(item.getAmountProfitOther());
 				financeStatisticsReportList.add(report);
 			}
 			if (!financeStatisticsReportList.isEmpty()) {
@@ -1317,12 +1334,12 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		//未收其他
 		item.setNotReceivedDrOther(amountDrOther.subtract(realAmountDrOther));
 		//合计应收
-		BigDecimal amountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc()))
-			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		BigDecimal amountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc())).
+			reduce(BigDecimal.ZERO, (x, y) -> x.add((y.getAmount().multiply(y.getExrate()))), BigDecimal::add);
 		item.setAmountDrLoc(amountDrLoc.setScale(2, RoundingMode.HALF_UP));
 		//实际合计应收
-		BigDecimal realAmountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc()))
-			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		BigDecimal realAmountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc())).
+			reduce(BigDecimal.ZERO, (x, y) -> x.add((y.getStlTtlAmount().multiply(y.getExrate()))), BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
 		item.setRealAmountDrLoc(realAmountDrLoc.setScale(2, RoundingMode.HALF_UP));
 		//未收合计
 		item.setNotReceivedLoc(amountDrLoc.subtract(realAmountDrLoc));
@@ -1387,12 +1404,12 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		//未付其他
 		item.setNotReceivedCrOther(amountCrOther.subtract(realAmountCrOther));
 		//合计应付
-		BigDecimal amountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc()))
-			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		BigDecimal amountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc())).
+			reduce(BigDecimal.ZERO, (x, y) -> x.add((y.getAmount().multiply(y.getExrate()))), BigDecimal::add);
 		item.setAmountCrLoc(amountCrLoc.setScale(2, RoundingMode.HALF_UP));
 		//实际合计应付
-		BigDecimal realAmountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc()))
-			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		BigDecimal realAmountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc())).
+			reduce(BigDecimal.ZERO, (x, y) -> x.add((y.getStlTtlAmount().multiply(y.getExrate()))), BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
 		item.setRealAmountCrLoc(realAmountCrLoc.setScale(2, RoundingMode.HALF_UP));
 		//未付合计
 		item.setNotReceivedCrLoc(amountCrLoc.subtract(realAmountCrLoc));

+ 9 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java

@@ -190,6 +190,15 @@ public class RouteCostController extends BladeController {
 	public R submit(@Valid @RequestBody RouteCost routeCost) {
 		return routeCostService.submit(routeCost);
 	}
+	/**
+	 * 新增或修改 航线成本
+	 */
+	@PostMapping("/add")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入routeCost")
+	public R add(@Valid @RequestBody RouteCost routeCost) {
+		return routeCostService.add(routeCost);
+	}
 
 
 	/**

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java

@@ -36,6 +36,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.los.box.dto.ExportTradingBoxItemOut;
 import org.springblade.los.box.dto.ExportTradingBoxOut;
 import org.springblade.los.box.entity.ExpenseApplication;
+import org.springblade.los.box.entity.PutBox;
 import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.entity.TradingBoxItem;
 import org.springblade.los.box.service.ITradingBoxItemService;
@@ -94,6 +95,8 @@ public class TradingBoxController extends BladeController {
 			.eq(TradingBox::getIsDeleted, 0)
 			.like(ObjectUtils.isNotNull(tradingBox.getSysNo()), TradingBox::getSysNo, tradingBox.getSysNo())
 			.like(ObjectUtils.isNotNull(tradingBox.getContractNo()), TradingBox::getContractNo, tradingBox.getContractNo())
+			.like(ObjectUtils.isNotNull(tradingBox.getMblno()), TradingBox::getMblno, tradingBox.getMblno())
+			.like(ObjectUtils.isNotNull(tradingBox.getHblno()), TradingBox::getHblno, tradingBox.getHblno())
 			.eq(ObjectUtils.isNotNull(tradingBox.getPurchaseCompanyId()), TradingBox::getPurchaseCompanyId, tradingBox.getPurchaseCompanyId())
 			.like(ObjectUtils.isNotNull(tradingBox.getPurchaseCompanyName()), TradingBox::getPurchaseCompanyName, tradingBox.getPurchaseCompanyName())
 			.eq(ObjectUtils.isNotNull(tradingBox.getOwnerId()), TradingBox::getOwnerId, tradingBox.getOwnerId())

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

@@ -1180,8 +1180,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 								} else {
 									throw new RuntimeException("未查到来源单据-放箱号为:" + archives.getContainerNumberOw());
 								}
-								 if ("OW(拿),代理箱".contains(putBox1.getBoxClass())) {
-									 archivesDateleList.add(archives.getId());
+								if ("OW(拿),代理箱".contains(putBox1.getBoxClass())) {
+									archivesDateleList.add(archives.getId());
 								}
 							} else {
 								throw new RuntimeException("放箱号:" + archives.getContainerNumberOw() + "单据类型错误,请联系管理员");
@@ -1373,10 +1373,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						//计算超期箱使费
 						this.countOverdueFeeV1(billsHYJK, tradingBoxList, tradingBoxItemOldList, putBoxItemsOldList, putBoxList);
 					}
-					if (!dlBoxIdList.isEmpty()){
+					if (!dlBoxIdList.isEmpty()) {
 						tradingBoxItemService.removeByIds(dlBoxIdList);
 					}
-					if (!dlPutBoxIdList.isEmpty()){
+					if (!dlPutBoxIdList.isEmpty()) {
 						putBoxItemsService.removeByIds(dlPutBoxIdList);
 					}
 					if (!archivesDateleList.isEmpty()) {
@@ -2593,6 +2593,20 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 								TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBoxData.getSrcId()))
 									.findFirst().orElse(null);
 								if (tradingBox != null) {
+									if (ObjectUtils.isNotNull(tradingBox.getMblno())) {
+										if (!tradingBox.getMblno().contains(billsDetails.getMblno())) {
+											tradingBox.setMblno(tradingBox.getMblno() + "," + billsDetails.getMblno());
+										}
+									} else {
+										tradingBox.setMblno(billsDetails.getMblno());
+									}
+									if (ObjectUtils.isNotNull(tradingBox.getHblno())) {
+										if (!tradingBox.getHblno().contains(billsDetails.getHblno())) {
+											tradingBox.setHblno(tradingBox.getMblno() + "," + billsDetails.getHblno());
+										}
+									} else {
+										tradingBox.setHblno(billsDetails.getHblno());
+									}
 									if (!tradingBoxes.isEmpty()) {
 										if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
 											tradingBoxes.add(tradingBox);
@@ -2949,6 +2963,16 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				}
 				if (!containersListNew.isEmpty()) {
 					containersService.saveOrUpdateBatch(containersListNew);
+					if (!billsList.isEmpty()) {
+						for (Bills item : billsList) {
+							if (containersListNew.stream().filter(e -> e.getPid().equals(item.getId()))
+                                    .map(Containers::getCntrNo).anyMatch(Objects::nonNull)){
+								item.setExtendedData(containersListNew.stream().filter(e -> e.getPid().equals(item.getId()))
+									.map(Containers::getCntrNo).filter(Objects::nonNull).collect(Collectors.joining(",")));
+								billsMapper.updateById(item);
+							}
+						}
+					}
 				}
 				if (!archivesArrayList.isEmpty()) {
 					archivesService.saveOrUpdateBatch(archivesArrayList);

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IRouteCostService.java

@@ -84,4 +84,6 @@ public interface IRouteCostService extends IService<RouteCost> {
 	R batchCopy(String ids, BigDecimal exrate, Date effectiveStartDate, Date effectiveEndDate,String type,String curCode);
 
 	R batchUnreviewed(String ids);
+
+	R add(RouteCost routeCost);
 }

+ 68 - 28
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/RouteCostServiceImpl.java

@@ -243,30 +243,30 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				routeCost.setOtherProfit(totalProfit(routeCost.getCostItemList(), "other"));
 				routeCost.setTotalProfit(routeCost.getProfit20().add(routeCost.getProfit40()).add(routeCost.getProfitHc()).add(routeCost.getOtherProfit()));
 
-				List<RouteCostItem> costItemList = routeCost.getCostItemList().stream().filter(e-> "0".equals(e.getDisable()))
+				List<RouteCostItem> costItemList = routeCost.getCostItemList().stream().filter(e -> "0".equals(e.getDisable()))
 					.collect(Collectors.toList());
-				if (!costItemList.isEmpty()){
-					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "20")) == 0){
+				if (!costItemList.isEmpty()) {
+					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "20")) == 0) {
 						routeCost.setProfit20Status("1");
-					}else{
+					} else {
 						routeCost.setProfit20Status("0");
 					}
-					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40")) == 0){
+					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40")) == 0) {
 						routeCost.setProfit40Status("1");
-					}else{
+					} else {
 						routeCost.setProfit40Status("0");
 					}
-					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40HC")) == 0){
+					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40HC")) == 0) {
 						routeCost.setProfitHcStatus("1");
-					}else{
+					} else {
 						routeCost.setProfitHcStatus("0");
 					}
-					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "other")) == 0){
+					if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "other")) == 0) {
 						routeCost.setOtherProfitStatus("1");
-					}else{
+					} else {
 						routeCost.setOtherProfitStatus("0");
 					}
-				}else{
+				} else {
 					routeCost.setProfit20Status("1");
 					routeCost.setProfit40Status("1");
 					routeCost.setProfitHcStatus("1");
@@ -1005,7 +1005,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public R batchCopy(String ids, BigDecimal exrate, Date effectiveStartDate, Date effectiveEndDate,String type,String s) {
+	public R batchCopy(String ids, BigDecimal exrate, Date effectiveStartDate, Date effectiveEndDate, String type, String s) {
 		if (ObjectUtils.isNull(ids) || ObjectUtils.isNull(exrate) || ObjectUtils.isNull(effectiveStartDate)
 			|| ObjectUtils.isNull(effectiveEndDate)) {
 			throw new RuntimeException("缺少必要参数");
@@ -1061,15 +1061,15 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			item.setEffectiveEndDate(effectiveEndDate);
 			routeCostListNew.add(item);
 		}
-		if (!routeCostListNew.isEmpty()){
+		if (!routeCostListNew.isEmpty()) {
 			this.saveBatch(routeCostListNew);
 			List<RouteCostFee> costFeesListNew = new ArrayList<>();
 			List<RouteCostItem> costItemListNew = new ArrayList<>();
-			for (RouteCost item : routeCostListNew){
-				if (!costFeesList.isEmpty()){
+			for (RouteCost item : routeCostListNew) {
+				if (!costFeesList.isEmpty()) {
 					List<RouteCostFee> costFeesListNews = new ArrayList<>();
-					List<RouteCostFee> costFees = costFeesList.stream().filter(e-> e.getPid().equals(item.getCopyId())).collect(Collectors.toList());
-					for (RouteCostFee costFeeItem : costFees){
+					List<RouteCostFee> costFees = costFeesList.stream().filter(e -> e.getPid().equals(item.getCopyId())).collect(Collectors.toList());
+					for (RouteCostFee costFeeItem : costFees) {
 						costFeeItem.setId(null);
 						costFeeItem.setPid(item.getId());
 						costFeeItem.setCreateTime(new Date());
@@ -1078,7 +1078,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 						costFeeItem.setUpdateUser(null);
 						costFeeItem.setUpdateTime(null);
 						costFeeItem.setUpdateUserName(null);
-						if (!exrateType.equals(costFeeItem.getCurCode())){
+						if (!exrateType.equals(costFeeItem.getCurCode())) {
 							costFeeItem.setExrate(exrate);
 						}
 						costFeesListNew.add(costFeeItem);
@@ -1086,10 +1086,10 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					}
 					item.setCostFeeList(costFeesListNews.isEmpty() ? new ArrayList<>() : costFeesListNews);
 				}
-				if (!costItemList.isEmpty()){
+				if (!costItemList.isEmpty()) {
 					List<RouteCostItem> costItemListNews = new ArrayList<>();
-					List<RouteCostItem> costItems = costItemList.stream().filter(e-> e.getPid().equals(item.getCopyId())).collect(Collectors.toList());
-					for (RouteCostItem costItem : costItems){
+					List<RouteCostItem> costItems = costItemList.stream().filter(e -> e.getPid().equals(item.getCopyId())).collect(Collectors.toList());
+					for (RouteCostItem costItem : costItems) {
 						costItem.setId(null);
 						costItem.setPid(item.getId());
 						costItem.setCreateTime(new Date());
@@ -1098,7 +1098,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 						costItem.setUpdateUser(null);
 						costItem.setUpdateTime(null);
 						costItem.setUpdateUserName(null);
-						if (!exrateType.equals(costItem.getCurCode())){
+						if (!exrateType.equals(costItem.getCurCode())) {
 							costItem.setExrate(exrate);
 						}
 						costItemListNews.add(costItem);
@@ -1109,7 +1109,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					int days = item.getNavigateDay() + item.getExistStationDay();
 					List<RouteCostFee> costFeeList = item.getCostFeeList();
 					for (RouteCostItem routeCostItem : item.getCostItemList()) {
-						if (!exrateType.equals(routeCostItem.getCurCode())){
+						if (!exrateType.equals(routeCostItem.getCurCode())) {
 							routeCostItem.setExrate(exrate);
 						}
 						//一程POL杂费成本
@@ -1161,10 +1161,10 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					item.setTotalProfit(item.getProfit20().add(item.getProfit40()).add(item.getProfitHc()).add(item.getOtherProfit()));
 				}
 			}
-			if (!costFeesListNew.isEmpty()){
+			if (!costFeesListNew.isEmpty()) {
 				routeCostFeeService.saveBatch(costFeesListNew);
 			}
-			if (!costItemListNew.isEmpty()){
+			if (!costItemListNew.isEmpty()) {
 				routeCostItemService.saveBatch(costItemListNew);
 			}
 		}
@@ -1191,6 +1191,46 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 		return R.data("操作成功");
 	}
 
+	@Override
+	public R add(RouteCost routeCost) {
+		if (ObjectUtils.isNotNull(routeCost.getCostItemList())) {
+			List<RouteCostItem> costItemList = routeCostItemService.list(new LambdaQueryWrapper<RouteCostItem>()
+				.eq(RouteCostItem::getTenantId,AuthUtil.getTenantId())
+				.eq(RouteCostItem::getIsDeleted,0)
+				.eq(RouteCostItem::getDisable,"0")
+				.eq(RouteCostItem::getPid,routeCost.getId()));
+			if (!costItemList.isEmpty()) {
+				if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "20")) == 0) {
+					routeCost.setProfit20Status("1");
+				} else {
+					routeCost.setProfit20Status("0");
+				}
+				if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40")) == 0) {
+					routeCost.setProfit40Status("1");
+				} else {
+					routeCost.setProfit40Status("0");
+				}
+				if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "40HC")) == 0) {
+					routeCost.setProfitHcStatus("1");
+				} else {
+					routeCost.setProfitHcStatus("0");
+				}
+				if (new BigDecimal("0.00").compareTo(totalProfit(costItemList, "other")) == 0) {
+					routeCost.setOtherProfitStatus("1");
+				} else {
+					routeCost.setOtherProfitStatus("0");
+				}
+			} else {
+				routeCost.setProfit20Status("1");
+				routeCost.setProfit40Status("1");
+				routeCost.setProfitHcStatus("1");
+				routeCost.setOtherProfitStatus("1");
+			}
+			this.saveOrUpdate(routeCost);
+		}
+		return R.data(routeCost);
+	}
+
 
 	/**
 	 * 合计费用成本
@@ -1202,7 +1242,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 	 */
 	public BigDecimal computationalCost(List<RouteCostFee> routeCostFeeList, String type, String boxType, BigDecimal exrate, String srcType) {
 		BigDecimal amount = new BigDecimal("0.00");
-		if (ObjectUtils.isNotNull(routeCostFeeList)&&!routeCostFeeList.isEmpty()) {
+		if (ObjectUtils.isNotNull(routeCostFeeList) && !routeCostFeeList.isEmpty()) {
 			amount = routeCostFeeList.stream().filter(e -> boxType.equals(e.getBoxType())
 				&& type.equals(e.getBusType()) && srcType.equals(e.getSrcType())).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getExrate().multiply(y.getCostPrice())), BigDecimal::add);
 			if (new BigDecimal("0.00").compareTo(amount) != 0) {
@@ -1224,7 +1264,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 	 */
 	public BigDecimal computationalIncome(List<RouteCostFee> routeCostFeeList, String type, String boxType, BigDecimal exrate, String srcType) {
 		BigDecimal amount = new BigDecimal("0.00");
-		if (ObjectUtils.isNotNull(routeCostFeeList)&&!routeCostFeeList.isEmpty()) {
+		if (ObjectUtils.isNotNull(routeCostFeeList) && !routeCostFeeList.isEmpty()) {
 			amount = routeCostFeeList.stream().filter(e -> boxType.equals(e.getBoxType())
 				&& type.equals(e.getBusType()) && srcType.equals(e.getSrcType())).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getExrate().multiply(y.getSalesPrice())), BigDecimal::add);
 			if (new BigDecimal("0.00").compareTo(amount) != 0) {
@@ -1244,7 +1284,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 	 */
 	public BigDecimal totalProfit(List<RouteCostItem> routeCostItemList, String type) {
 		BigDecimal profit;
-		if (ObjectUtils.isNotNull(routeCostItemList)&&!routeCostItemList.isEmpty()) {
+		if (ObjectUtils.isNotNull(routeCostItemList) && !routeCostItemList.isEmpty()) {
 			if ("20".equals(type)) {
 				profit = routeCostItemList.stream().filter(e -> ObjectUtils.isNotNull(e.getBoxType()) && e.getBoxType().contains("20"))
 					.map(RouteCostItem::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add);

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -420,9 +420,15 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				tradingBox.setActualBoxNumber(tradingBox.getTradingBoxItemsList().size());
 			}
 			tradingBox.setCode(String.join(",", codes));
+			tradingBox.setMblno(tradingBox.getTradingBoxItemsList().stream().map(TradingBoxItem::getMblno).filter(Objects::nonNull)
+				.distinct().collect(Collectors.joining(",")));
+			tradingBox.setHblno(tradingBox.getTradingBoxItemsList().stream().map(TradingBoxItem::getHblno).filter(Objects::nonNull)
+				.distinct().collect(Collectors.joining(",")));
 			tradingBox.setTradingBoxItemsList(tradingBox.getTradingBoxItemsList());
 		}else{
 			tradingBox.setCode("");
+			tradingBox.setMblno("");
+			tradingBox.setHblno("");
 		}
 		//费用数据
 		if (ObjectUtils.isNotNull(tradingBox.getFeeCenterList()) && !tradingBox.getFeeCenterList().isEmpty()) {

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

@@ -343,7 +343,7 @@ 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()) && "SE".equals(bills.getBusinessType())) {
 				Bills bills1 = baseMapper.selectById(bills.getTemporaryId());
 				if (bills1 != null) {
 					bills1.setMblno(bills.getMblno());
@@ -2891,6 +2891,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		billsJk.setSrcBusId(detail.getId());
 		billsJk.setBusinessType("SI");
 		billsJk.setSeaType("I");
+		billsJk.setTemporaryNo(null);
+		billsJk.setTemporaryId(null);
 		String deptId = billsJk.getPodCompanyId() + "";
 		String deptName = billsJk.getPodCompanyName();
 		String branchId = billsJk.getPodCompanyId() + "";