Kaynağa Gözat

2024年11月5日17:14:58

纪新园 1 yıl önce
ebeveyn
işleme
d265e02585

+ 1 - 1
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/Delivery.java

@@ -162,7 +162,7 @@ public class Delivery implements Serializable {
 	 * 版本
 	 */
 	@ApiModelProperty(value = "版本")
-	private String version;
+	private Integer version;
 	/**
 	 * 租户id
 	 */

+ 6 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjOrder.java

@@ -498,6 +498,12 @@ public class PjOrder implements Serializable {
 	private BigDecimal produceAdvanceChargeAmount;
 
 	/**
+	 * 参考号
+	 */
+	@ApiModelProperty(value = "参考号")
+	private String refno;
+
+	/**
 	 * 默认不显示已完成
 	 */
 	@TableField(exist = false)

+ 13 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/StockExportExcel.java

@@ -4,6 +4,7 @@ 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 io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -91,6 +92,18 @@ public class StockExportExcel implements Serializable {
 	private BigDecimal inventoryCostPrice;
 
 	/**
+	 * 返利后单价
+	 */
+	@ExcelProperty(value = "返利后单价")
+	private BigDecimal rebatePrice;
+
+	/**
+	 * 返利后单价库存金额
+	 */
+	@ExcelProperty(value = "返利后单价库存金额")
+	private BigDecimal rebateInventoryAmount;
+
+	/**
 	 * 库存预警
 	 */
 	@ExcelProperty(value = "库存预警")

+ 44 - 3
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java

@@ -392,12 +392,23 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	 * 确认收货及撤销确认收货
 	 */
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R submit(Delivery delivery) {
-
 		Long deliveryId = delivery.getId();
 		Delivery select = baseMapper.selectById(deliveryId);
-
+		if (select == null) {
+			throw new SecurityException("未查到相关数据,操作失败");
+		}
+		if (ObjectUtils.isNotNull(delivery.getVersion())){
+			Integer version = delivery.getVersion();
+			if (!select.getVersion().equals(version)) {
+				throw new RuntimeException("数据已被修改,请返回列表重新操作");
+			}
+			version = version + 1;
+			select.setVersion(version);
+			delivery.setVersion(version);
+		}
 		//计算返利
 		/*if ("GN".equals(delivery.getTradeType())) {
 			Order order = new Order();
@@ -576,7 +587,18 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	public R revocation(Delivery delivery) {
 		Long deliveryId = delivery.getId();
 		Delivery select = baseMapper.selectById(deliveryId);
-
+		if (select == null) {
+			throw new SecurityException("未查到相关数据,操作失败");
+		}
+		if (ObjectUtils.isNotNull(delivery.getVersion())){
+			Integer version = delivery.getVersion();
+			if (!select.getVersion().equals(version)) {
+				throw new RuntimeException("数据已被修改,请返回列表重新操作");
+			}
+			version = version + 1;
+			select.setVersion(version);
+			delivery.setVersion(version);
+		}
 		String billStatus = null;//订单状态
 		if (delivery.getDeliveryType() != null && delivery.getDeliveryType().equals(DeliveryEnum.TAKE.getType())) {
 			billStatus = DeliveryStatusEnum.HAVWARRIVED.getType();
@@ -732,6 +754,16 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 		if (select == null) {
 			throw new SecurityException("未查到相关数据,操作失败");
 		}
+		if (ObjectUtils.isNotNull(delivery.getVersion())){
+			Integer version = delivery.getVersion();
+			if (!select.getVersion().equals(version)) {
+				throw new RuntimeException("数据已被修改,请返回列表重新操作");
+			}
+			version = version + 1;
+			select.setVersion(version);
+			delivery.setVersion(version);
+		}
+
 		if ("681169".equals(AuthUtil.getTenantId())) {
 			if (ObjectUtil.isEmpty(select.getCorpId())) {
 				throw new SecurityException("供应商必填");
@@ -1402,6 +1434,15 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 		if (select == null) {
 			throw new SecurityException("未查到相关数据,操作失败");
 		}
+		if (ObjectUtils.isNotNull(delivery.getVersion())){
+			Integer version = delivery.getVersion();
+			if (!select.getVersion().equals(version)) {
+				throw new RuntimeException("数据已被修改,请返回列表重新操作");
+			}
+			version = version + 1;
+			select.setVersion(version);
+			delivery.setVersion(version);
+		}
 		if ("681169".equals(AuthUtil.getTenantId())) {
 			if (select.getDeliveryStatus() == null || !DeliveryStatusEnum.REVOCATION.getType().equals(select.getDeliveryStatus())) {
 				throw new SecurityException("此单据已撤回或者不存在,禁止重复操作");

+ 14 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

@@ -226,6 +226,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setBillCorpId(bills.getCorpId());
 					feeCenter.setBillCorpCnName(bills.getCorpCnName());
 					feeCenter.setBillCorpEnName(bills.getCorpEnName());
+					feeCenter.setBillShortName(bills.getCorpCnName());
 					feeCenter.setLineId(bills.getLineId());
 					feeCenter.setLineCnName(bills.getLineCnName());
 					feeCenter.setLineEnName(bills.getLineEnName());
@@ -253,20 +254,24 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						feeCenter.setCorpId(bills.getCorpId());
 						feeCenter.setCorpCnName(bills.getCorpCnName());
 						feeCenter.setCorpEnName(bills.getCorpEnName());
+						feeCenter.setShortName(bills.getShortName());
 					} else if ("船公司".equals(items.getCorpType())) {
 						feeCenter.setCorpId(bills.getCarrierId());
 						feeCenter.setCorpCnName(bills.getCarrierCnName());
 						feeCenter.setCorpEnName(bills.getCarrierEnName());
+						feeCenter.setShortName(bills.getCarrierCnName());
 					}/*else if ("工厂".equals(items.getCorpType())){
 
 					}*/ else if ("场站".equals(items.getCorpType())) {
 						feeCenter.setCorpId(bills.getCyId());
 						feeCenter.setCorpCnName(bills.getCyCnName());
 						feeCenter.setCorpEnName(bills.getCyEnName());
+						feeCenter.setShortName(bills.getCyCnName());
 					} else if ("订舱代理".equals(items.getCorpType())) {
 						feeCenter.setCorpId(bills.getBookingAgentId());
 						feeCenter.setCorpCnName(bills.getBookingAgentCnName());
 						feeCenter.setCorpEnName(bills.getBookingAgentEnName());
+						feeCenter.setShortName(bills.getBookingAgentCnName());
 					}/*else if ("BGH".equals(items.getCorpType())){
 
 					}else if ("LYGS".equals(items.getCorpType())){
@@ -275,14 +280,17 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						feeCenter.setCorpId(bills.getMconsigneeId());
 						feeCenter.setCorpCnName(bills.getMconsigneeCnName());
 						feeCenter.setCorpEnName(bills.getMconsigneeEnName());
+						feeCenter.setShortName(bills.getMconsigneeCnName());
 					} else if ("MBL通知人".equals(items.getCorpType())) {
 						feeCenter.setCorpId(bills.getMnotifyId());
 						feeCenter.setCorpCnName(bills.getMnotifyCnName());
 						feeCenter.setCorpEnName(bills.getMnotifyEnName());
+						feeCenter.setShortName(bills.getMnotifyCnName());
 					} else {
 						feeCenter.setCorpId(items.getCorpId());
 						feeCenter.setCorpCnName(items.getCorpCnName());
 						feeCenter.setCorpEnName(items.getCorpEnName());
+						feeCenter.setShortName(items.getCorpCnName());
 					}
 					feeCenter.setFeeId(items.getFeeId());
 					feeCenter.setFeeCode(items.getFeeCode());
@@ -382,6 +390,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setCorpId(items.getCorpId());
 					feeCenter.setCorpCnName(items.getCorpCnName());
 					feeCenter.setCorpEnName(items.getCorpEnName());
+					feeCenter.setShortName(items.getCorpCnName());
 					feeCenter.setFeeId(items.getFeeId());
 					feeCenter.setFeeCode(items.getFeeCode());
 					feeCenter.setFeeCnName(items.getFeeCnName());
@@ -467,6 +476,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setCorpId(items.getCorpId());
 					feeCenter.setCorpCnName(items.getCorpCnName());
 					feeCenter.setCorpEnName(items.getCorpEnName());
+					feeCenter.setShortName(items.getCorpCnName());
 					feeCenter.setFeeId(items.getFeeId());
 					feeCenter.setFeeCode(items.getFeeCode());
 					feeCenter.setFeeCnName(items.getFeeCnName());
@@ -1317,6 +1327,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setBillCorpId(bills.getCorpId());
 					feeCenter.setBillCorpCnName(bills.getCorpCnName());
 					feeCenter.setBillCorpEnName(bills.getCorpEnName());
+					feeCenter.setBillShortName(bills.getCorpCnName());
 					feeCenter.setLineId(bills.getLineId());
 					feeCenter.setLineCnName(bills.getLineCnName());
 					feeCenter.setLineEnName(bills.getLineEnName());
@@ -1344,6 +1355,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					feeCenter.setCorpId(bills.getCorpId());
 					feeCenter.setCorpCnName(bills.getCorpCnName());
 					feeCenter.setCorpEnName(bills.getCorpEnName());
+					feeCenter.setShortName(bills.getShortName());
 					feeCenter.setFeeId(items.getFeeId());
 					feeCenter.setFeeCode(items.getFeeCode());
 					feeCenter.setFeeCnName(items.getFeeCnName());
@@ -1395,8 +1407,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						feeCenter.setCorpId(agent.getAbroadConsignorId());
 						feeCenter.setCorpCnName(agent.getAbroadConsignorCname());
 					}
+					feeCenter.setShortName(feeCenter.getCorpCnName());
 					feeCenter.setBillCorpId(agent.getCorpId());
 					feeCenter.setBillCorpCnName(agent.getCorpName());
+					feeCenter.setBillShortName(agent.getCorpName());
 					feeCenter.setMblno(agent.getContractNo());
 					feeCenter.setPolId(agent.getPolId());
 					feeCenter.setPolCode(agent.getPolCode());

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/check/service/impl/AuditProecessServiceImpl.java

@@ -425,7 +425,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, P
 						item.setType("采购融资-审核通过");
 						item.setSrcId(auditProecess.getSrcBillId());
 						item.setSrcNo(auditProecess.getBillNo());
-						item.setAmount(auditProecess.getAmount());
+						item.setAmount(order.getSalesAmount());
 						if (ObjectUtils.isNull(proportion)) {
 							throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
 						}

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/controller/OrderController.java

@@ -112,7 +112,7 @@ public class OrderController extends BladeController {
 				PjOrder::getConfirmWarehouse, PjOrder::getWhetherRedeem, PjOrder::getFundingPartyId, PjOrder::getFundingPartyName,
 				PjOrder::getInterest, PjOrder::getFundingAmount, PjOrder::getBondAmount, PjOrder::getProportion,
 				PjOrder::getGoodsTotalShipAmount, PjOrder::getOutGoodsTotalShipNum, PjOrder::getOutGoodsTotalShipAmount,
-				PjOrder::getGoodsTotalShipNum,PjOrder::getSalesAmount)
+				PjOrder::getGoodsTotalShipNum,PjOrder::getSalesAmount,PjOrder::getRefno)
 			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
 			.eq(PjOrder::getIsDeleted, 0)
 			.eq(PjOrder::getBsType, order.getBsType())

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java

@@ -2072,7 +2072,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			}
 			orderItemsService.updateBatchById(orderItemsList);
 			BigDecimal amount = shipItemsList.stream().filter(e -> ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(e.getBrandName()))
-				.map(PjShipItems::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+				.map(PjShipItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 			pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().add(amount));
 			PjpfFundingItem item = new PjpfFundingItem();
 			item.setPid(pjpfFunding.getId());

+ 14 - 13
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

@@ -1404,7 +1404,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 						corpBuySingular1.setDate(orders.get(0).getBusinesDate());
 						corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
-					}else {
+					} else {
 						corpBuySingular1.setNum(new BigDecimal("0"));
 						corpBuySingular1.setNumber(new BigDecimal("0"));
 					}
@@ -1461,7 +1461,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 						corpBuySingular1.setDate(orders.get(0).getBusinesDate());
 						corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
-					}else {
+					} else {
 						corpBuySingular1.setNum(new BigDecimal("0"));
 						corpBuySingular1.setNumber(new BigDecimal("0"));
 					}
@@ -1481,6 +1481,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 			.eq(PjCorpsDesc::getIsDeleted, 0)
 			.eq(PjCorpsDesc::getSalesCompanyId, AuthUtil.getDeptId())
 			.like(ObjectUtils.isNotNull(corpBuySingular.getCorpName()), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
+//			.like( PjCorpsDesc::getCname, "青岛市黄岛鑫悦汽车服务")
 			.eq(PjCorpsDesc::getCorpType, "KH");
 		List<PjCorpsDesc> corpsDescIPage = corpsDescService.list(lambdaQueryWrapper);
 		if (!corpsDescIPage.isEmpty()) {
@@ -1512,12 +1513,12 @@ public class StatisticsServiceImpl implements IStatisticsService {
 						corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 						corpBuySingular1.setDate(orders.get(0).getBusinesDate());
 						corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
-					}else {
+					} else {
 						corpBuySingular1.setNum(new BigDecimal("0"));
 						corpBuySingular1.setNumber(new BigDecimal("0"));
 					}
+					corpBuySingularList.add(corpBuySingular1);
 				}
-				corpBuySingularList.add(corpBuySingular1);
 			}
 		}
 		List<String> list = new ArrayList<>();
@@ -1529,15 +1530,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		list.add("10次以上");
 		List<Long> numberList = new ArrayList<>();
 		if (!corpBuySingularList.isEmpty()) {
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("0")) == 0).count());
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("1")) == 0).count());
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("2")) == 0 ||
-				e.getNum().compareTo(new BigDecimal("3")) == 0)).count());
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("3")) == 0 ||
-				e.getNum().compareTo(new BigDecimal("4")) == 0)).count());
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("5")) >= 0 ||
-				e.getNum().compareTo(new BigDecimal("10")) <= 0)).count());
-			numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("10")) >= 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("0")) == 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("1")) == 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("2")) == 0 ||
+				e.getNum().compareTo(new BigDecimal("3")) == 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("4")) == 0 ||
+				e.getNum().compareTo(new BigDecimal("5")) == 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("6")) >= 0 &&
+				e.getNum().compareTo(new BigDecimal("10")) <= 0).count());
+			numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("10")) > 0).count());
 		} else {
 			numberList.add(0L);
 			numberList.add(0L);

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/stock/controller/StockDescController.java

@@ -116,7 +116,7 @@ public class StockDescController extends BladeController {
 				pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
 					.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
 					.eq(PjGoodsDesc::getIsDeleted, 0)
-					.eq(PjGoodsDesc::getBrandName, brandName)
+					.like(PjGoodsDesc::getBrandName, brandName)
 					.and(i -> i.like(PjGoodsDesc::getCname, cname)
 						.or().like(PjGoodsDesc::getCnameInt, cname))
 					.or().like(PjGoodsDesc::getCname, stockDesc.getCname())
@@ -130,7 +130,7 @@ public class StockDescController extends BladeController {
 					pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
 						.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
 						.eq(PjGoodsDesc::getIsDeleted, 0)
-						.eq(PjGoodsDesc::getBrandName, chineseWords[0])
+						.like(PjGoodsDesc::getBrandName, chineseWords[0])
 						.and(i -> i.like(PjGoodsDesc::getCname, cname)
 							.or().like(PjGoodsDesc::getCnameInt, cname)
 							.or().like(PjGoodsDesc::getCname, stockDesc.getCname())